LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File loki_setup-gpmstatic.diff of Package loki_setup (Project games:tools)

--- loki_setup/configure.in	2006-05-30 13:31:41.000000000 +0200
+++ loki_setup/configure.in	2006-05-30 13:31:55.000000000 +0200
@@ -286,11 +286,6 @@
 AC_CHECK_HEADERS(langinfo.h)
 AC_CHECK_HEADERS(locale.h)
 
-AC_CHECK_LIB(gpm, Gpm_Open, USE_GPM=yes)
-
-dnl If NCURSES_MOUSE_VERSION is defined, we don't use GPM, so let's not link it in
-AC_TRY_COMPILE([#include <ncurses.h>], [int n = NCURSES_MOUSE_VERSION;], unset USE_GPM)
-
 dnl Check for gtk12 libraries in case those are available (FreeBSD)
 AC_CHECK_LIB(glib12, g_log, GTK12="12")
 
@@ -355,6 +350,17 @@
 	USE_NCURSES=yes
 )	
 
+AC_ARG_ENABLE(gpm,
+[  --enable-gpm            enable gpm support (yes/no/static, default=no)],,
+enable_gpm=no)
+if test "x$enable_gpm" = "xstatic"; then
+	GPM_STATIC="$BSTATIC"
+	USE_GPM=yes
+elif test "x$enable_gpm" = "xyes"; then
+	GPM_STATIC=""
+	USE_GPM=yes
+fi
+
 AC_ARG_ENABLE(libglade-static,
 [  --enable-libglade-static            whether to statically link libglade (default=yes)],,
 enable_libglade_static=yes)
@@ -621,9 +627,9 @@
 	fi
 fi
 
-if test ! -z "$USE_GPM"; then
-	AC_CHECK_HEADERS(gpm.h)
-	CONSOLE_LIBS="$CONSOLE_LIBS -lgpm $LIBDL"
+if test "x$USE_GPM" = "xyes"; then
+	AC_CHECK_LIB(gpm, Gpm_Open,[:],AC_MSG_ERROR([libgpm not found]))
+	AC_CHECK_HEADERS(gpm.h,,AC_MSG_ERROR([gpm.h not found]))
 else
 	CONSOLE_LIBS="$CONSOLE_LIBS $LIBDL"
 fi
@@ -710,6 +716,3 @@
 AC_SUBST(GTK_SUBDIR)
 
 AC_OUTPUT(Makefile plugins/Makefile dialog/Makefile)
-
-
-