dnl $Id$ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) dnl Should perhaps add the ggi-develop ML as the 3rd argument dnl to AC_INIT but someone has to take care of the spam... AC_INIT([libgii],[1.0.2],[http://www.ggi-project.org/contact.html]) AC_CONFIG_SRCDIR([input/stdin/input.c]) AC_CONFIG_MACRO_DIR(m4) AM_INIT_AUTOMAKE([libgii],[1.0.2],[-]) AM_MAINTAINER_MODE AC_CANONICAL_BUILD AC_CANONICAL_HOST dnl ======================================================================== dnl Set some defaults PATHTAG="pAtHTAg" TAGLEN="7" gii_conffile="libgii.conf" ggi_subdir="ggi" use_debug="yes" use_memdebug="no" dnl Bleech, select(2) in winsock does not support non-network fds. non_network_fd="yes" GGDLLIBS="" SELECTLIBS="" NETLIBS="" FD_INCLUDE="" TOPLEVELSUBDIRS="include gg gii input filter regress demos doc m4 dist" GGSUBDIRS="" INPUTSUBDIRS="" INPUTMODULES="" FILTERSUBDIRS="" FILTERMODULES="" TCPCONV="" DEMOS="" dnl Common usable Targets build_file_input="auto" build_kii_input="auto" build_mouse_input="auto" build_null_input="auto" build_stdin_input="auto" build_tcp_input="auto" build_x_input="auto" dnl FreeBSD specific Targets build_vgl_input="auto" dnl Linux specific Targets build_ipaq_ts_input="auto" build_linux_evdev_input="auto" build_linux_joy_input="auto" build_linux_kbd_input="auto" build_linux_mouse_input="auto" build_lk201_input="auto" build_zaurus_ts_input="auto" dnl MacOS X specific Targets build_cocoa_input="auto" build_quartz_input="auto" dnl Win32 specific Targets build_directx_input="auto" dnl misc targets build_pcjoy_input="auto" build_spaceorb_input="auto" dnl filters build_keytrans_filter="auto" build_mouse_filter="auto" build_save_filter="auto" build_tcp_filter="auto" dnl ======================================================================== dnl Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_RANLIB dnl Make Objective-C work with automake >= 1.7.x AM_CONDITIONAL([am__fastdepOBJC], false) LT_INIT([win32-dll]) dnl ======================================================================== dnl Generate libtool LT_OUTPUT dnl ======================================================================== dnl tests for CPU type GGI_CC_CAN_CPUID GGI_CC_CAN_AMASK dnl ======================================================================== dnl User selectable options AC_ARG_ENABLE(memdebug, [ --enable-memdebug include memory usage debugging code in LibGG], use_memdebug=$enableval) AC_ARG_ENABLE(filter_mouse, [ --disable-filter-mouse don't build the mouse filterlib], build_mouse_filter=$enableval) AC_ARG_ENABLE(filter_keytrans, [ --disable-filter-keytrans don't build the key translation filterlib], build_keytrans_filter=$enableval) AC_ARG_ENABLE(filter_save, [ --disable-filter-save don't build the save filterlib], build_save_filter=$enableval) AC_ARG_ENABLE(filter_tcp, [ --disable-filter-tcp don't build the tcp filterlib], build_tcp_filter=$enableval) AC_ARG_ENABLE(null, [ --disable-null don't build the null inputlib (discouraged - this is REQUIRED by LibGGI)], build_null_input=$enableval) AC_ARG_ENABLE(file, [ --disable-file don't build the file inputlib], build_file_input=$enableval) AC_ARG_ENABLE(ipaq_ts, [ --disable-ipaq_ts don't build the ipaq touchscreen inputlib], build_ipaq_ts_input=$enableval) AC_ARG_ENABLE(zaurus_ts, [ --disable-zaurus_ts don't build the zaurus touchscreen inputlib], build_zaurus_ts_input=$enableval) AC_ARG_ENABLE(tcp, [ --disable-tcp don't build the tcp inputlib], build_tcp_input=$enableval) AC_ARG_ENABLE(stdin, [ --disable-stdin don't build the stdin inputlib], build_stdin_input=$enableval) AC_ARG_ENABLE(x, [ --disable-x don't build the x inputlib], build_x_input=$enableval) AC_ARG_ENABLE(mouse, [ --disable-mouse don't build the mouse inputlib], build_mouse_input=$enableval) AC_ARG_ENABLE(linux_mouse, [ --disable-linux-mouse don't build the linux-mouse inputlib], build_linux_mouse_input=$enableval) AC_ARG_ENABLE(linux_kbd, [ --disable-linux-kbd don't build the linux-kbd inputlib], build_linux_kbd_input=$enableval) AC_ARG_ENABLE(linux_joy, [ --disable-linux-joy don't build the linux-joy inputlib], build_linux_joy_input=$enableval) AC_ARG_ENABLE(linux_evdev, [ --disable-linux-evdev don't build the linux-evdev inputlib], build_linux_evdev_input=$enableval) AC_ARG_ENABLE(spaceorb, [ --disable-spaceorb don't build the spaceorb inputlib], build_spaceorb_input=$enableval) AC_ARG_ENABLE(vgl, [ --disable-vgl don't build the vgl inputlib], build_vgl_input=$enableval) AC_ARG_ENABLE(directx, [ --disable-directx don't build the directx inputlib], build_directx_input=$enableval) AC_ARG_ENABLE(pcjoy, [ --enable-pcjoy build the pcjoy inputlib], build_pcjoy_input=$enableval) AC_ARG_ENABLE(lk201, [ --enable-lk201 build the lk201 DEC serial terminal inputlib], build_lk201_input=$enableval) AC_ARG_ENABLE(kii, [ --enable-kii build the kii inputlib], build_kii_input=$enableval) AC_ARG_ENABLE(cocoa, [ --enable-cocoa build the cocoa inputlib], build_cocoa_input=$enableval) AC_ARG_ENABLE(quartz, [ --enable-quartz build the quartz inputlib], build_quartz_input=$enableval) AC_ARG_ENABLE(mutexes, [ --enable-mutexes=TYPE force the kind of mutexes to use (builtin, pthread or win32)], mutextype="$enableval") AC_ARG_ENABLE(debug, [ --disable-debug build without run-time debugging (speed freaks)], use_debug=$enableval) GGI_EXTRA_PATHS dnl dnl ======================================================================== dnl Checks for platform specificas GGI_CHECK_DLOPEN GGI_CHECK_STRING_FUNCS GGI_CC_CHECK4_OPTION([Wall]) GGI_CC_CHECK4_OPTION([pedantic]) GGI_CHECK_IMPLICIT_DECLARATIONS dnl font-lock-mode prettyfier ' dnl ======================================================================== dnl Checks for libraries. dnl Replace `main' with a function in -lICE: dnl AC_CHECK_LIB(ICE, main) dnl Replace `main' with a function in -lSM: dnl AC_CHECK_LIB(SM, main) dnl Replace `main' with a function in -lX11: dnl AC_CHECK_LIB(X11, main) dnl Replace `main' with a function in -ldinput: dnl AC_CHECK_LIB(dinput, main) dnl Replace `main' with a function in -ldl: dnl AC_CHECK_LIB(dl, main) dnl Replace `main' with a function in -ldxguid: dnl AC_CHECK_LIB(dxguid, main) dnl Replace `main' with a function in -lgdi32: dnl AC_CHECK_LIB(gdi32, main) dnl Replace `main' with a function in -lm: dnl AC_CHECK_LIB(m, main) AC_CHECK_LIB(vgl, VGLInit, foo=bar, build_vgl_target="no") dnl ======================================================================== dnl Checks for header files. AC_PATH_X AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS(sys/time.h sys/types.h sys/io.h sys/kd.h \ sys/vt.h sys/stat.h sys/ioctl.h sys/un.h sys/socket.h \ sys/param.h unistd.h fcntl.h signal.h sched.h malloc.h \ limits.h netinet/in.h arpa/inet.h netdb.h \ asm/sharp_ts.h \ linux/keyboard.h linux/kd.h linux/input.h linux/vt.h \ linux/joystick.h linux/kdev_t.h linux/major.h \ linux/h3600_ts.h \ termios.h windows.h shlobj.h \ c_asm.h \ ApplicationServices/ApplicationServices.h \ ) AC_CHECK_HEADERS(sys/sysctl.h, [], [], [#ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_PARAM_H # include #endif]) AC_CHECK_HEADERS(winsock.h winsock2.h dinput.h, [], [], [#ifdef HAVE_WINDOWS_H # include #endif #define DIRECTINPUT_VERSION 0x0700]) AC_CHECK_HEADERS([sys/fbio.h]) AC_CHECK_HEADERS([vgl.h], [], [], [#ifdef HAVE_SYS_FBIO_H # include #endif]) dnl ======================================================================== dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_C_INLINE AC_TYPE_SIZE_T AC_DIAGNOSE([obsolete],[AC_STRUCT_ST_RDEV: your code should no longer depend upon `HAVE_ST_RDEV', but `HAVE_STRUCT_STAT_ST_RDEV'. Remove this warning and the `AC_DEFINE' when you adjust the code.]) AC_CHECK_MEMBERS([struct stat.st_rdev],[AC_DEFINE(HAVE_ST_RDEV, 1, [Define to 1 if your `struct stat' has `st_rdev'. Deprecated, use `HAVE_STRUCT_STAT_ST_RDEV' instead.])]) dnl check for socklen_t dnl Define HAVE_SOCKLEN_T if found. if test "$ac_cv_header_sys_socket_h" = "yes"; then AC_MSG_CHECKING([whether socklen_t is available]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include #include #ifdef HAVE_SYS_UN_H #include #endif]], [[socklen_t len;]])],[AC_MSG_RESULT(yes) AC_DEFINE([HAVE_SOCKLEN_T], [1], [Define if socklen_t type is supported.])],[AC_MSG_RESULT(no)]) fi dnl Hack for cross-compiling to win32 if test "$CC" = "i386-mingw32-gcc"; then ac_cv_c_bigendian=no else AC_C_BIGENDIAN fi dnl Not supported by new libtool dnl AM_SYS_SYMBOL_UNDERSCORE if test "x$cross_compiling" = "xyes"; then AC_MSG_WARN([ You are using a cross-compiler, please set the SIZEOF_* defines in config.h properly before compiling this package. Also check that the typedefs and defines in include/ggi/system.h are correct. ]) fi GGI_CHECK_TYPES dnl The gg subdirectory does not exist when $builddir != $srcdir mkdir -p gg cp "$srcdir/gg/EXPSYMS.in" gg/EXPSYMS if test "$have_64bit_int" = "yes"; then GGI_CC_CAN_INT64 if test "$ggi_cv_cc_can_int64" = "no"; then # We need quad! cat "$srcdir/gg/EXPSYMS.quad" >> gg/EXPSYMS fi fi AM_CONDITIONAL(NEED_QUAD, test "$have_64bit_int" = "yes" -a "$ggi_cv_cc_can_int64" = "no") if test "$ac_cv_header_sys_time_h" = "yes"; then TIMEVAL_INCLUDE='#include ' elif test "$ac_cv_header_time_h" = "yes"; then TIMEVAL_INCLUDE='#include ' elif test "$ac_cv_header_winsock2_h" = "yes"; then TIMEVAL_INCLUDE='#include /* defines struct timeval */' elif test "$ac_cv_header_winsock_h" = "yes"; then TIMEVAL_INCLUDE='#include /* defines struct timeval */' fi if test "$ac_cv_header_c_asm_h" = "yes"; then C_ASM_INCLUDE='#include /* for asm, fasm, dasm */' fi if test "x$ac_cv_c_bigendian" = "xyes"; then GGI_ENDIAN="#define GGI_BIG_ENDIAN 1" else GGI_ENDIAN="#define GGI_LITTLE_ENDIAN 1" fi if test "$ac_cv_header_inttypes_h" = "yes"; then INTTYPES_INCLUDE='#include ' else INTTYPES_INCLUDE='' AC_DEFINE(GG_NEED_INTTYPES, 1, [Tell libgg to define integer types for building]) fi case "${host}" in alpha*) arch_cpu="alpha" ;; i386-* | i486-* | i586-* | i686-* | i786-* ) arch_cpu="ia32" ;; powerpc-*) arch_cpu="ppc" ;; sparc64-* | sparc-* ) arch_cpu="sparc" ;; *) arch_cpu="" AC_DEFINE(HAVE_NO_CPUID, 1, [Define if there is no way to check CPU ID]) AC_DEFINE(HAVE_NO_SWARTYPE_IMPLEMENTATION, 1, [Undefine when there is an implementation for ggGetSwarType]) ;; esac AM_CONDITIONAL(ARCH_ALPHA, test "x${arch_cpu}" = "xalpha") AM_CONDITIONAL(ARCH_IA32, test "x${arch_cpu}" = "xia32") AM_CONDITIONAL(ARCH_PPC, test "x${arch_cpu}" = "xppc") AM_CONDITIONAL(ARCH_SPARC, test "x${arch_cpu}" = "xsparc") AC_MSG_CHECKING([for TIOCMSET in termios.h or sys/ioctl.h]) AC_EGREP_CPP(giitiocmset, [#include #include #ifdef TIOCMSET giitiocmset #endif ], HAVE_TIOCMSET=yes; AC_DEFINE(HAVE_TIOCMSET, 1, [Define if sys/ioctl.h defines TIOCMSET]), HAVE_TIOCMSET=no) AC_MSG_RESULT($HAVE_TIOCMSET) GGI_DLLEXT GGI_CHECKOS dnl ======================================================================== dnl Checks for library functions. AC_FUNC_MEMCMP AC_TYPE_SIGNAL AC_FUNC_VPRINTF dnl Must undefine select here :-( unset ac_cv_func_select dnl AC_CHECK_LIB works on Cygwin, but not on MinGW32 dnl AC_CHECK_LIB(c, select, ac_cv_func_select="yes", ac_cv_func_select="no") if test "x$ac_cv_func_select" = "xno"; then AC_MSG_CHECKING([for select in -lwsock32]) save_LIBS="$LIBS" save_CC="$CC" LIBS="$LIBS -lwsock32" CC="$SHELL ./libtool --mode=link $CC" if test "$ac_cv_header_winsock2_h" = "yes"; then AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[select(0, NULL, NULL, NULL, NULL); return 0;]])],[ac_cv_func_select="yes" non_network_fd="no" SELECTLIBS="$SELECTLIBS -lwsock32" NETLIBS="$NETLIBS -lwsock32" FD_INCLUDE="#include "],[ac_cv_func_select="no"]) elif test "$ac_cv_header_winsock_h" = "yes"; then AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[select(0, NULL, NULL, NULL, NULL); return 0;]])],[ac_cv_func_select="yes" non_network_fd="no" SELECTLIBS="$SELECTLIBS -lwsock32" NETLIBS="$NETLIBS -lwsock32" FD_INCLUDE="#include "],[ac_cv_func_select="no"]) else ac_cv_func_select="no" fi LIBS="$save_LIBS" CC="$save_CC" AC_MSG_RESULT($ac_cv_func_select) fi AC_CHECK_FUNCS(pipe fcntl signal raise sigaction siginterrupt \ readlink sched_yield atexit on_exit \ connect gethostbyname popen pclose \ ) AC_REPLACE_FUNCS(strtoul getopt) case "${host}" in *-*-mingw | *-*-cygwin) dnl Remark inet_aton() is available, dnl but header is broken... ac_cv_func_inet_aton="no" ;; *) AC_CHECK_FUNCS(inet_aton) ;; esac dnl Functions of the form func(num), func(pointer) or func(pointer,pointer) dnl should go here instead of above. AC_CHECK_WINFUNCS(gettimeofday strdup nanosleep usleep _exit \ Sleep GetSystemTimeAsFileTime) if test "x$ac_cv_func_usleep" = "xyes"; then AC_DEFINE(GG_USLEEP_USE_USLEEP, 1, [Define to 1 to use `usleep' for ggUSleep/ggUSlumber.]) GGI_USLEEP_VOID GGI_USLEEP_999999 elif test "x$ac_cv_func_Sleep" = "xyes"; then AC_DEFINE(GG_USLEEP_USE_W32SLEEP, 1, [Define to 1 to use win32 `Sleep' for ggUSleep/ggUSlumber.]) elif test "x$ac_cv_func_select" = "xyes"; then AC_DEFINE(GG_USLEEP_USE_SELECT, 1, [Define to 1 to use `select' for ggUSleep/ggUSlumber.]) dnl TODO: test select with zero fdset before continuing else produce error dnl (maybe this is already tested by autoconf suite?) else AC_MSG_ERROR([Could not find a usable sleep/usleep function.]) fi if test "x$ac_cv_func_gettimeofday" = "xyes"; then AC_DEFINE(GG_CURTIME_USE_GETTIMEOFDAY, 1, [Define to 1 to use `gettimeofday' for ggCurTime.]) elif test "x$ac_cv_func_GetSystemTimeAsFileTime" = "xyes"; then AC_DEFINE(GG_CURTIME_USE_GETSYSTEMTIMEASFILETIME, 1, [Define to 1 to use win32 `GetSystemTimeAsFileTime' for ggCurTime.]) else AC_MSG_ERROR([Could not find a usable function for ggCurTime.]) fi if test "x$ac_cv_func_atexit" = "xno"; then if test "x$ac_cv_func_on_exit" = "xyes"; then GG_ATEXIT="#define atexit(f) on_exit((void (*)(int,void*))f,NULL)" else AC_MSG_ERROR(No atexit alternative on this system.) fi else GG_ATEXIT="" fi if test "x$ac_cv_func_connect" = "xno"; then AC_CHECK_LIB(c, connect, , AC_CHECK_LIB(socket,connect,NETLIBS="$NETLIBS -lsocket") ) fi if test "x$ac_cv_func_gethostbyname" = "xno"; then AC_CHECK_LIB(c, gethostbyname, , AC_CHECK_LIB(nsl,gethostbyname,NETLIBS="$NETLIBS -lnsl") ) fi if test "x$ac_cv_func_nanosleep" = "xno"; then AC_CHECK_LIB(rt, nanosleep, GGDLLIBS="$GGDLLIBS -lrt" AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have the `nanosleep' function]) , AC_CHECK_LIB(posix4, nanosleep, GGDLLIBS="$GGDLLIBS -lposix4" AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have the `nanosleep' function]) ) ) fi if test "x$ac_cv_func_sched_yield" = "xno"; then AC_CHECK_LIB(posix4, sched_yield, GGDLLIBS="$GGDLLIBS -lposix4" AC_DEFINE(HAVE_SCHED_YIELD, 1, [Define if you have the sched_yield function]) ) fi dnl Mutextype autodetection GGI_MUTEXTYPE dnl Add the Threadlib to link against GGDLLIBS="$GGDLLIBS $THREADLIBS" AC_MSG_CHECKING(what kind of mutexes to use) AM_CONDITIONAL(PTLOCK, test "$mutextype" = "pthread") AM_CONDITIONAL(WIN32LOCK, test "$mutextype" = "win32") AM_CONDITIONAL(BUILTINLOCK, test "$mutextype" = "builtin") if test "$mutextype" = "builtin"; then GGSUBDIRS=ggtick fi AC_MSG_RESULT($mutextype) dnl ======================================================================== dnl Checks for target-specific libraries and headers AC_PATH_XTRA if test "x$no_x" = "xyes"; then build_x_input="no" else dnl This is necessary as there are plattforms, where dnl $(ac_)x_includes does NOT belong to the default search dnl path. Darwin is such a system, for example. dnl $(ac_)x_includes contains the right path to the X dnl includes (/usr/X11R6/include on most systems). cflags_old="$CFLAGS" cppflags_old="$CPPFLAGS" if test -z "$x_includes" -o "x$x_includes" = "xNONE"; then x_includes="$ac_x_includes" fi if test -n "$x_includes" -a "x$x_includes" != "xNONE"; then CFLAGS="$CFLAGS -I$x_includes" CPPFLAGS="$CPPFLAGS -I$x_includes" fi AC_CHECK_HEADERS(X11/extensions/xf86dga.h, [], [], [#include ]) CFLAGS="$cflags_old" CPPFLAGS="$cppflags_old" mkdir -p input/x cp "$srcdir/input/x/EXPSYMS.in" input/x/EXPSYMS if test "x$ac_cv_header_X11_extensions_xf86dga_h" = "xyes"; then AC_CHECK_LIB(Xxf86dga_pic, XF86DGAQueryVersion, XF86DGA_LIBS="-lXxf86dga_pic -lXext", AC_CHECK_LIB(Xxf86dga, XF86DGAQueryVersion, XF86DGA_LIBS="-lXxf86dga -lXext", , [ $X_LIBS -lXext -lX11 $X_EXTRA_LIBS ]), [ $X_LIBS -lXext -lX11 $X_EXTRA_LIBS ]) if test -n "$XF86DGA_LIBS"; then AC_SUBST(XF86DGA_LIBS) echo GIIdl_xf86dga >> input/x/EXPSYMS AC_DEFINE(HAVE_XF86DGA, 1, [Support for xf86dga in input-x]) fi fi fi AM_CONDITIONAL(INPUT_XF86DGA, test "$build_x_input" != no -a \ "x$ac_cv_header_X11_extensions_xf86dga_h" = "xyes") build_ipaq_ts_input="no" if test "x$ac_cv_header_linux_h3600_ts_h" = "xyes"; then build_ipaq_ts_input="yes" fi build_zaurus_ts_input="no" if test "x$ac_cv_header_asm_sharp_ts_h" = "xyes"; then build_zaurus_ts_input="yes" fi if test "x$ac_cv_header_unistd_h" != "xyes"; then build_stdin_input="no" build_mouse_input="no" build_linux_mouse_input="no" build_pcjoy_input="no" build_lk201_input="no" fi if test "x$non_network_fd" != "xyes"; then build_stdin_input="no" build_mouse_input="no" build_linux_mouse_input="no" fi if test "x$ac_cv_header_linux_keyboard_h" != "xyes"; then build_linux_kbd_input="no" fi if test "x$ac_cv_header_linux_joystick_h" != "xyes"; then build_linux_joy_input="no" fi if test "x$ac_cv_header_linux_input_h" != "xyes"; then build_linux_evdev_input="no" fi if test "x$ac_cv_header_sys_ioctl_h" != "xyes"; then build_spaceorb_input="no" fi if test "x$ac_cv_header_termios_h" != "xyes"; then build_spaceorb_input="no" build_lk201_input="no" fi if test "x$ac_cv_header_vgl_h" != "xyes"; then build_vgl_input="no" fi if test "x$ac_cv_header_dinput_h" != "xyes"; then build_directx_input="no" fi if test "x$ac_cv_header_asm_io_h" != "xyes"; then build_pcjoy_input="no" fi AC_EGREP_CPP(wonkdummy, [#include #ifdef JSIOCGVERSION wonkdummy #endif ], build_linux_joy_input="yes", build_linux_joy_input="no") if test "x$build_cocoa_input" != "xno" \ -o "x$build_quartz_input" != "xno"; then if test "x$ac_cv_header_ApplicationServices_ApplicationServices_h" != "xno"; then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ CGDirectDisplayID id; ]])], [foo=bar],[ dnl Compile failed, do not build inputs build_cocoa_input="no" build_quartz_input="no" ]) else dnl No header, do not build inputs. build_cocoa_input="no" build_quartz_input="no" fi fi if test "x$build_kii_input" != "xno" ; then AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include "kgi/config.h" #include #include ]], [[ __kgi_u64_t i; ]])],[build_kii_input=yes],[build_kii_input=no ]) fi dnl ======================================================================== dnl Check for inputlibs AC_MSG_CHECKING(if we should build the mhub program) if test "x$ac_cv_header_unistd_h" = "xyes" \ -a "x$ac_cv_func_fcntl" = "xyes" \ -a "x$ac_cv_func_signal" = "xyes"; then DEMOS="$DEMOS mhub\$(EXEEXT)" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(if we should build the xsendbut program) if test "x$no_x" != "xyes"; then DEMOS="$DEMOS xsendbut\$(EXEEXT)" AC_MSG_RESULT(yes) else AC_MSG_RESULT(no) fi AC_MSG_CHECKING(if we should build null inputlib) if test "x$build_null_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS null" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES null.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_NULL, 1, [Support for builtin input-null]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_NULL, test "$enable_static" = "yes" -a \ "x$build_null_input" != "xno") AC_MSG_CHECKING(if we should build file inputlib) if test "x$build_file_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS file" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES file.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_FILE, 1, [Support for builtin input-file]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_FILE, test "$enable_static" = "yes" -a \ "x$build_file_input" != "xno") AC_MSG_CHECKING(if we should build ipaq_touchscreen inputlib) if test "x$build_ipaq_ts_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS ipaq_touchscreen" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES ipaq_touchscreen.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_IPAQ_TS, 1, [Support for builtin input-ipaq-ts]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_IPAQ_TS, test "$enable_static" = "yes" -a \ "x$build_ipaq_ts_input" != "xno") AC_MSG_CHECKING(if we should build zaurus_touchscreen inputlib) if test "x$build_zaurus_ts_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS touchscreen" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES zaurus.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_ZAURUS_TS, 1, [Support for builtin input-zaurus]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_ZAURUS_TS, test "$enable_static" = "yes" -a \ "x$build_zaurus_ts_input" != "xno") AC_MSG_CHECKING(if we should build tcp inputlib) if test "x$build_tcp_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS tcp" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES tcp.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_TCP, 1, [Support for builtin input-tcp]) fi TCPCONV="libtcpconv.la" AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_TCP, test "$enable_static" = "yes" -a \ "x$build_tcp_input" != "xno") AC_MSG_CHECKING(if we should build stdio inputlib) if test "x$build_stdin_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS stdin" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES stdin.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_STDIN, 1, [Support for builtin input-stdin]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_STDIN, test "$enable_static" = "yes" -a \ "x$build_stdin_input" != "xno") AC_MSG_CHECKING(if we should build x inputlib) if test "x$build_x_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS x" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES x.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_X, 1, [Support for builtin input-x]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_X, test "$enable_static" = "yes" -a \ "x$build_x_input" != "xno") AC_MSG_CHECKING(if we should build mouse inputlib) if test "x$build_mouse_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS mouse" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES mouse.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_MOUSE, 1, [Support for builtin input-mouse]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_MOUSE, test "$enable_static" = "yes" -a \ "x$build_mouse_input" != "xno") AC_MSG_CHECKING(if we should build linux-mouse inputlib) if test "x$build_linux_mouse_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS linux_mouse" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES linux_mouse.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_LINUX_MOUSE, 1, [Support for builtin input-linux-mouse]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_LINUX_MOUSE, test "$enable_static" = "yes" -a \ "x$build_linux_mouse_input" != "xno") AC_MSG_CHECKING(if we should build linux-kbd inputlib) if test "x$build_linux_kbd_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS linux_kbd" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES linux_kbd.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_LINUX_KBD, 1, [Support for builtin input-linux-kbd]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_LINUX_KBD, test "$enable_static" = "yes" -a \ "x$build_linux_kbd_input" != "xno") AC_MSG_CHECKING(if we should build linux-joy inputlib) if test "x$build_linux_joy_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS linux_joy" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES linux_joy.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_LINUX_JOY, 1, [Support for builtin input-linux-joy]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_LINUX_JOY, test "$enable_static" = "yes" -a \ "x$build_linux_joy_input" != "xno") AC_MSG_CHECKING(if we should build linux-evdev inputlib) if test "x$build_linux_evdev_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS linux_evdev" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES linux_evdev.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_LINUX_EVDEV, 1, [Support for builtin input-linux-evdev]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_LINUX_EVDEV, test "$enable_static" = "yes" -a \ "x$build_linux_evdev_input" != "xno") AC_MSG_CHECKING(if we should build spaceorb inputlib) if test "x$build_spaceorb_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS spaceorb" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES spaceorb.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_SPACEORB, 1, [Support for builtin input-spaceorb]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_SPACEORB, test "$enable_static" = "yes" -a \ "x$build_spaceorb_input" != "xno") AC_MSG_CHECKING(if we should build vgl inputlib) if test "x$build_vgl_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS vgl" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES vgl.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_VGL, 1, [Support for builtin input-vgl]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_VGL, test "$enable_static" = "yes" -a \ "x$build_vgl_input" != "xno") AC_MSG_CHECKING(if we should build directx inputlib) if test "x$build_directx_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS directx" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES dxinput.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_DIRECTX, 1, [Support for builtin input-directx]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_DIRECTX, test "$enable_static" = "yes" -a \ "x$build_directx_input" != "xno") AC_MSG_CHECKING(if we should build pcjoy inputlib) if test "x$build_pcjoy_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS pcjoy" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES pcjoy.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_PCJOY, 1, [Support for builtin input-pcjoy]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_PCJOY, test "$enable_static" = "yes" -a \ "x$build_pcjoy_input" != "xno") AC_MSG_CHECKING(if we should build lk201 inputlib) if test "x$build_lk201_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS lk201" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES lk201.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_LK201, 1, [Support for builtin input-lk201]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_LK201, test "$enable_static" = "yes" -a \ "x$build_lk201_input" != "xno") AC_MSG_CHECKING(if we should build kii inputlib) if test "x$build_kii_input" = "xno" ; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS kii" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES kii.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_KII, 1, [Support for builtin input-kii]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_KII, test "$enable_static" = "yes" -a \ "x$build_kii_input" != "xno") AC_MSG_CHECKING(if we should build cocoa inputlib) if test "x$build_cocoa_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS cocoa" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES cocoa.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_COCOA, 1, [Support for builtin input-cocoa]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_COCOA, test "$enable_static" = "yes" -a \ "x$build_cocoa_input" != "xno") AC_MSG_CHECKING(if we should build quartz inputlib) if test "x$build_quartz_input" = "xno"; then AC_MSG_RESULT(no) else INPUTSUBDIRS="$INPUTSUBDIRS quartz" if test "$enable_shared" = "yes"; then INPUTMODULES="$INPUTMODULES quartz.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_INPUT_QUARTZ, 1, [Support for builtin input-quartz]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_INPUT_QUARTZ, test "$enable_static" = "yes" -a \ "x$build_quartz_input" != "xno") dnl ======================================================================== dnl Check for filterlibs AC_MSG_CHECKING(if we should build mouse emulation filterlib) if test "x$build_mouse_filter" = "xno"; then AC_MSG_RESULT(no) else FILTERSUBDIRS="$FILTERSUBDIRS mouse" if test "$enable_shared" = "yes"; then FILTERMODULES="$FILTERMODULES mouse.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_FILTER_MOUSE, 1, [Support for builtin filter-mouse]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_FILTER_MOUSE, test "$enable_static" = "yes" -a \ "x$build_mouse_filter" != "xno") AC_MSG_CHECKING(if we should build key translation filterlib) if test "x$build_keytrans_filter" = "xno"; then AC_MSG_RESULT(no) else FILTERSUBDIRS="$FILTERSUBDIRS keytrans" if test "$enable_shared" = "yes"; then FILTERMODULES="$FILTERMODULES keytrans.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_FILTER_KEYTRANS, 1, [Support for builtin filter-keytrans]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_FILTER_KEYTRANS, test "$enable_static" = "yes" -a \ "x$build_keytrans_filter" != "xno") AC_MSG_CHECKING(if we should build save filterlib) if test "x$build_save_filter" = "xno"; then AC_MSG_RESULT(no) else FILTERSUBDIRS="$FILTERSUBDIRS save" if test "$enable_shared" = "yes"; then FILTERMODULES="$FILTERMODULES save.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_FILTER_SAVE, 1, [Support for builtin filter-save]) fi AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_FILTER_SAVE, test "$enable_static" = "yes" -a \ "x$build_save_filter" != "xno") AC_MSG_CHECKING(if we should build tcp filterlib) if test "x$build_tcp_filter" = "xno"; then AC_MSG_RESULT(no) else FILTERSUBDIRS="$FILTERSUBDIRS tcp" if test "$enable_shared" = "yes"; then FILTERMODULES="$FILTERMODULES tcp.la" fi if test "$enable_static" = "yes"; then AC_DEFINE(BUILTIN_FILTER_TCP, 1, [Support for builtin filter-tcp]) fi TCPCONV="libtcpconv.la" AC_MSG_RESULT(yes) fi AM_CONDITIONAL(BUILTIN_FILTER_TCP, test "$enable_static" = "yes" -a \ "x$build_tcp_filter" != "xno") dnl =============================================================================== dnl System specific things if test "x$USE_SYMBOL_UNDERSCORE" = "xyes"; then AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are prefixed with underscore]) fi AM_CONDITIONAL(MEMDEBUG, test "$use_memdebug" = "yes") if test "$use_memdebug" = "yes"; then AC_CHECK_LIB(c, __malloc_hook, AC_DEFINE(HAVE_MALLOC_HOOK, 1, [Define if your libc has a __malloc_hook for debug]) ) AC_DEFINE(GG_MEMDEBUG, 1, [Define if you want memory usage debugging code]) fi dnl ======================================================================== dnl Finally add some flags dnl _THREAD_SAFE is used instead of _REENTRANT on some systems CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE" if test "x$use_debug" != "xno"; then case " $CFLAGS " in *" -DDEBUG "*) ;; # -DDEBUG already present, don't add. *) CFLAGS="$CFLAGS -DDEBUG" ;; esac if test "x$ac_cv_prog_cc_g" = "xyes"; then case " $CFLAGS " in *" -g "*) ;; # -g already present, don't add. *) CFLAGS="$CFLAGS -g" ;; esac fi fi if test "$ac_cv_c_compiler_gnu" = "yes"; then GGI_CC_CHECK4_OPTION([std=gnu99]) # Common warning flags CFLAGS="$CFLAGS -Wpointer-arith -Wsign-compare" CFLAGS="$CFLAGS -Wstrict-prototypes -Wswitch" CFLAGS="$CFLAGS -Wmissing-prototypes -Wreturn-type -Wshadow" # Advanced warning flags CFLAGS="$CFLAGS -Wnested-externs -Wredundant-decls" CFLAGS="$CFLAGS -Wuninitialized -Wcast-qual -Wwrite-strings" if test "x$cc_has_werror_implicit_function_declaration" = "xyes"; then CFLAGS="$CFLAGS -Werror-implicit-function-declaration" fi # Buggy warning flag # CFLAGS="$CFLAGS -Wconversion" # Super advanced (only used for building releases) # CFLAGS="$CFLAGS -Werror" fi dnl the gcc-builtin __PRETTY_FUNCTION__ is a non portable GNU extension dnl but is used throughout the regression tests. dnl only a few gcc-compatible compilers support __PRETTY_FUNCTION__ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[ int main(void) { printf("Hello, %s !\n", __PRETTY_FUNCTION__); return 0; } ]])],[],[CFLAGS="$CFLAGS -D__PRETTY_FUNCTION__=\\\"?\\\""]) # Check for darwin at the very end and set up the Objective C compiler # We do this here so that we get the full CFLAGS into OBJCFLAGS case "${host}" in *-*-darwin* | *-*-rhapsody*) OBJC="$CC" OBJCFLAGS="$CFLAGS" OBJCDEPMODE="$CCDEPMODE" OBJCCOMPILE="$CCCOMPILE" AC_SUBST(OBJC) AC_SUBST(OBJCFLAGS) dnl automake 1.6.x doesn't like dnl this OBJCDEPMODE, but it is required dnl to make compile the quartz target dnl with automake 1.7.x dnl So it's better to ignore the warning. AC_SUBST(OBJCDEPMODE) AC_SUBST(OBJCCOMPILE) ;; *) ;; esac dnl ======================================================================== dnl Fixup exports of replacement for missing functions from libgg if test "x$ac_cv_func_memcmp_working" != "xyes"; then AC_SUBST(REPLACE_MEMCMP, ["#define _GG_REPLACE_MEMCMP"]) echo _gg_memcmp >> gg/EXPSYMS gg_link_with_replace=yes else AC_SUBST(REPLACE_MEMCMP, ["/* using system memcmp */"]) fi if test "x$ac_cv_func_strtoul" != "xyes"; then AC_SUBST(REPLACE_STRTOUL, ["#define _GG_REPLACE_STRTOUL"]) echo _gg_strtoul >> gg/EXPSYMS gg_link_with_replace=yes else AC_SUBST(REPLACE_STRTOUL, ["/* using system strtoul */"]) fi if test "x$ac_cv_func_getopt" != "xyes"; then AC_SUBST(REPLACE_GETOPT, ["#define _GG_REPLACE_GETOPT"]) echo _gg_getopt >> gg/EXPSYMS echo _gg_opterr >> gg/EXPSYMS echo _gg_optind >> gg/EXPSYMS echo _gg_optopt >> gg/EXPSYMS echo _gg_optreset >> gg/EXPSYMS echo _gg_optarg >> gg/EXPSYMS gg_link_with_replace=yes else AC_SUBST(REPLACE_GETOPT, ["/* using system getopt */"]) fi if test "x$ac_cv_func_snprintf" != "xyes"; then AC_CHECK_FUNC(_snprintf) if test "x$ac_cv_func__snprintf" = "xyes"; then AC_SUBST(REPLACE_SNPRINTF, ["#define snprintf _snprintf"]) else AC_LIBOBJ([snprintf]) AC_SUBST(REPLACE_SNPRINTF, ["#define _GG_REPLACE_SNPRINTF"]) echo _gg_snprintf >> gg/EXPSYMS gg_link_with_replace=yes fi else AC_SUBST(REPLACE_SNPRINTF, ["/* using system snprintf */"]) fi if test "x$ac_cv_func_vsnprintf" != "xyes"; then AC_CHECK_FUNC(_vsnprintf) if test "x$ac_cv_func__vsnprintf" = "xyes"; then AC_SUBST(REPLACE_VSNPRINTF, ["#define vsnprintf _vsnprintf"]) else if test "x$ac_cv_func_snprintf" = "xyes" -o "x$ac_cv_func__snprintf" = "xyes"; then AC_LIBOBJ([snprintf]) fi AC_SUBST(REPLACE_VSNPRINTF, ["#define _GG_REPLACE_VSNPRINTF"]) echo _gg_vsnprintf >> gg/EXPSYMS gg_link_with_replace=yes fi else AC_SUBST(REPLACE_VSNPRINTF, ["/* using system vsnprintf */"]) fi if test "x$ac_cv_func_strlcpy" != "xyes"; then AC_SUBST(REPLACE_STRLCPY, ["#define strlcpy ggstrlcpy"]) else AC_SUBST(REPLACE_STRLCPY, ["/* using system strlcpy */"]) fi if test "x$ac_cv_func_strlcat" != "xyes"; then AC_SUBST(REPLACE_STRLCAT, ["#define strlcat ggstrlcat"]) else AC_SUBST(REPLACE_STRLCAT, ["/* using system strlcat */"]) fi if test "x$ac_cv_func_strcasecmp" != "xyes"; then AC_CHECK_FUNC(stricmp) if test "x$ac_cv_func_stricmp" = "xyes"; then AC_SUBST(REPLACE_STRCASECMP, ["#define strcasecmp stricmp"]) else AC_SUBST(REPLACE_STRCASECMP, ["/* please replace strcasecmp */"]) fi else AC_SUBST(REPLACE_STRCASECMP, ["/* using system strcasecmp */"]) fi if test "x$ac_cv_func_strncasecmp" != "xyes"; then AC_CHECK_FUNC(strnicmp) if test "x$ac_cv_func_strnicmp" = "xyes"; then AC_SUBST(REPLACE_STRNCASECMP, ["#define strncasecmp strnicmp"]) else AC_SUBST(REPLACE_STRNCASECMP, ["/* please replace strncasecmp */"]) fi else AC_SUBST(REPLACE_STRNCASECMP, ["/* using system strncasecmp */"]) fi if test "x$ac_cv_func_popen" != "xyes"; then AC_CHECK_FUNC(_popen) if test "x$ac_cv_func__popen" = "xyes"; then AC_SUBST(REPLACE_POPEN, ["#define popen _popen"]) else AC_SUBST(REPLACE_POPEN, ["/* please replace popen */"]) fi else AC_SUBST(REPLACE_POPEN, ["/* using system popen */"]) fi if test "x$ac_cv_func_pclose" != "xyes"; then AC_CHECK_FUNC(_pclose) if test "x$ac_cv_func__pclose" = "xyes"; then AC_SUBST(REPLACE_PCLOSE, ["#define pclose _pclose"]) else AC_SUBST(REPLACE_PCLOSE, ["/* please replace pclose */"]) fi else AC_SUBST(REPLACE_PCLOSE, ["/* using system pclose */"]) fi dnl Check if we need to build the "replace" convenience library if test -n "$gg_link_with_replace"; then GGSUBDIRS="lib $GGSUBDIRS" REPLACELIB="-L\$(top_builddir)/gg/lib -lreplace" AC_SUBST(REPLACELIB) fi dnl ======================================================================== dnl Write output dnl Bah! autoconf hasn't set prefix to it's default value yet! test "x$prefix" = "xNONE" && prefix=$ac_default_prefix test "x$exec_prefix" = "xNONE" && exec_prefix='${prefix}' AC_DEFINE_UNQUOTED(INSTALL_PREFIX, "${prefix}", [Set to install path]) AC_SUBST(INTTYPES_INCLUDE) AC_SUBST(TIMEVAL_INCLUDE) AC_SUBST(C_ASM_INCLUDE) AC_SUBST(GGI_8) AC_SUBST(GGI_16) AC_SUBST(GGI_32) AC_SUBST(GGI_64) AC_SUBST(GGI_DEFINE_INT64) AC_SUBST(GGI_ENDIAN) AC_SUBST(GG_ATEXIT) AC_SUBST(TOPLEVELSUBDIRS) AC_SUBST(GGSUBDIRS) AC_SUBST(INPUTSUBDIRS) AC_SUBST(INPUTMODULES) AC_SUBST(FILTERSUBDIRS) AC_SUBST(FILTERMODULES) AC_SUBST(TCPCONV) AC_SUBST(DEMOS) AC_SUBST(GGDLLIBS) AC_SUBST(SELECTLIBS) AC_SUBST(NETLIBS) AC_SUBST(FD_INCLUDE) dnl Use static_* to substitute into files where values shouldn't dnl dynamicly change. Makefiles need to be able to dynamicly change dnl paths between build and install and shouldn't use these static_*. dnl Files that will be installed must always show the final location where dnl they will reside and should use these static_* values. dnl Ensure that all static_* are fully expanded. eval static_libdir="$libdir" old_val="" until test "$static_libdir" = "$old_val"; do old_val="$static_libdir" eval static_libdir="$static_libdir" done eval static_sysconfdir="$sysconfdir" old_val="" until test "$static_sysconfdir" = "$old_val"; do old_val="$static_sysconfdir" eval static_sysconfdir="$static_sysconfdir" done case "${host}" in *-*-mingw*) dnl Find a relative path that takes us from static_sysconfdir dnl to static_libdir. GGI_SYSCONF_TO_LIB dnl The relative path from sysconfdir to sysconfdir is simple. ggi_sysconfdir="." ;; *) dnl Usually good to use an absolute path. ggi_sysconfdir_to_libdir="$static_libdir/$ggi_subdir" ggi_sysconfdir="$static_sysconfdir/$ggi_subdir" ;; esac AC_SUBST(ggi_subdir) AC_SUBST(ggi_sysconfdir_to_libdir) AC_SUBST(ggi_sysconfdir) AC_SUBST(static_libdir) AC_SUBST(static_sysconfdir) AC_DEFINE_UNQUOTED(GIITAGLEN,$TAGLEN,[Define to length of below tag]) AC_DEFINE_UNQUOTED(GIIPATHTAG,"$PATHTAG",[Used to s// in path to libgii.conf]) AC_DEFINE_UNQUOTED(GIICONFFILE,"$gii_conffile",[Name of LibGII main conf file]) AC_DEFINE_UNQUOTED(GIICONFDIR,"$PATHTAG$static_sysconfdir/$ggi_subdir", [Full path of configuration directory (including tag)]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_FILES([Makefile gg/Makefile gg/lib/Makefile gg/ggtick/Makefile gii/Makefile input/Makefile input/null/Makefile input/file/Makefile input/tcp/Makefile input/stdin/Makefile input/x/Makefile input/mouse/Makefile input/linux_mouse/Makefile input/linux_kbd/Makefile input/linux_joy/Makefile input/linux_evdev/Makefile input/ipaq_touchscreen/Makefile input/touchscreen/Makefile input/spaceorb/Makefile input/vgl/Makefile input/directx/Makefile input/fdselect/Makefile input/pcjoy/Makefile input/lk201/Makefile input/kii/Makefile input/cocoa/Makefile input/quartz/Makefile filter/Makefile filter/mouse/Makefile filter/keytrans/Makefile filter/save/Makefile filter/tcp/Makefile input-shared/Makefile filter-shared/Makefile demos/Makefile include/Makefile include/ggi/system.h include/ggi/Makefile include/ggi/input/Makefile include/ggi/internal/Makefile include/ggi/internal/gg_replace.h doc/Makefile doc/man/Makefile regress/Makefile regress/gg/Makefile regress/gii/Makefile m4/Makefile libgii.conf dist/Makefile dist/rpm/Makefile dist/rpm/libgii.spec ]) AC_OUTPUT