dnl dnl AC_INIT AM_INIT_AUTOMAKE(gpsd, 2.0) AC_PREFIX_PROGRAM(gcc) AM_CONFIG_HEADER(config.h) AC_LANG([C]) AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_INSTALL AC_PROG_LIBTOOL CFLAGS="$CFLAGS -Wall -Werror" AC_CHECK_HEADERS(termio.h sys/param.h termios.h sys/termios.h sys/select.h strings.h path.h sys/filio.h sys/time.h) dnl dnl Locate Net Libraries dnl AC_CHECK_LIB(nsl, gethostbyname, LIBNSL="-lnsl") AC_SUBST(LIBNSL) dnl AC_CHECK_LIB(socket, socket, LIBSOCKET="-lsocket") AC_SUBST(LIBSOCKET) dnl dnl dnl dnl Locate Libraries dnl AC_MSG_CHECKING(whether to force -lm switch) AC_TRY_LINK([#include ], { double foo; foo = sin(1.234); }, link_libm=0, link_libm=1) if test $link_libm = 1; then AC_MSG_RESULT(yes) LIBM="-lm" AC_SUBST(LIBM) else AC_MSG_RESULT(no) fi dnl AC_CHECK_LIB(c, open, LIBC="-lc") AC_SUBST(LIBC) dnl AC_CHECK_LIB(gen, regcmp, LIBGEN="-lgen") AC_SUBST(LIBGEN) dnl dnl dnl dnl dnl Check for X stuff dnl dnl dnl Check X options dnl if test "$with_x" = no; then AC_MSG_WARN([Some of this software requires the X window system to compile and run. Please do not use the configure option '--without-x'.]) fi if test "$with_motif" = no; then AC_MSG_WARN([Some of this software requires Motif to compile and run. Please do not use the configure option '--without-motif'.]) fi dnl dnl dnl Check for X libraries dnl if test "$with_x" != no; then ice_save_LIBS="$LIBS" ice_save_CFLAGS="$CFLAGS" ice_save_CPPFLAGS="$CPPFLAGS" ice_save_LDFLAGS="$LDFLAGS" dnl AC_PATH_XTRA ICE_FIND_MOTIF ICE_FIND_ATHENA ICE_FIND_XPM dnl dnl Autoconf bug fix: Sun CC 3.0 requires `-R lib', g++ requires `-Rlib'. changequote(,)dnl case "$CXX" in *CC) X_LIBS="`echo $X_LIBS | $SED 's, -R\([^ ]\), -R \1,g'`" esac changequote([,])dnl dnl dnl dnl LIBS="$LIBS $X_EXTRA_LIBS" CFLAGS="$CFLAGS $X_CFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" dnl dnl Check for X library dnl X11_LIBS="" AC_CHECK_LIB(X11, XOpenDisplay, X11_LIBS="-lX11",,${X_PRE_LIBS}) if test "$X11_LIBS" = ""; then dnl Not having X may be fatal. Let the user fix this. AC_MSG_WARN([The X11 library '-lX11' could not be found. Please use the configure options '--x-includes=DIR' and '--x-libraries=DIR' to specify the X location. See the file 'config.log' for further diagnostics.]) fi AC_SUBST(X_LIBS) AC_SUBST(X11_LIBS) AC_SUBST(X_PRE_LIBS) dnl dnl dnl Check for -lXintl library. Lutz Kittler says dnl that DLD-Linux with CDE wants `-lXintl' to refine `Xlcmbcurmax'. dnl Guenther Roehrich says that dnl we must check for `_Xlcmbcurmax' instead of `Xlcmbcurmax'. dnl AC_CHECK_LIB(Xintl, _Xlcmbcurmax, X11_LIBS="${X11_LIBS} -lXintl",, ${X_PRE_LIBS} ${X11_LIBS}) dnl dnl dnl Check for -lipc library. SCO unix is said to want that. dnl AC_CHECK_LIB(ipc, shmap, X11_LIBS="${X11_LIBS} -lipc",, ${X_PRE_LIBS} ${X11_LIBS}) dnl dnl dnl Check for X toolkit libraries dnl XT_LIBS="" AC_CHECK_LIB(Xt, XtToolkitInitialize, XT_LIBS="-lXt",, ${X_PRE_LIBS} ${X11_LIBS}) if test "$XT_LIBS" = ""; then dnl Not having Xt is fatal. Let the user fix this. AC_MSG_WARN([The X toolkit library '-lXt' could not be found. Please use the configure options '--x-includes=DIR' and '--x-libraries=DIR' to specify the X location. See the file 'config.log' for further diagnostics.]) fi AC_SUBST(XT_LIBS) dnl dnl dnl Check for Xaw libraries dnl XAW_LIBS="" AC_CHECK_LIB(Xaw, XawInitializeWidgetSet, XAW_LIBS="-lXaw",, ${X_PRE_LIBS} ${X11_LIBS}) if test "$XAW_LIBS" = ""; then dnl Not having Xaw is fatal. Let the user fix this. AC_MSG_WARN([The Xaw library '-lXaw' could not be found. Please use the configure options '--x-includes=DIR' and '--x-libraries=DIR' to specify the X location. See the file 'config.log' for further diagnostics.]) fi AC_SUBST(XAW_LIBS) dnl dnl dnl Check for X extension libraries dnl dnl XEXT_LIBS="" AC_CHECK_LIB(Xext, XShapeQueryVersion, XEXT_LIBS="-lXext",, ${X_PRE_LIBS} ${X11_LIBS}) AC_SUBST(XEXT_LIBS) dnl dnl dnl dnl dnl Check for Xpm library and headers dnl XPM_LIBS="" AC_CHECK_LIB(Xpm, XpmCreatePixmapFromXpmImage, XPM_LIBS="-lXpm" AC_DEFINE([HAVE_XPM],1,[Xpm available]),,${X_PRE_LIBS} ${X11_LIBS}) if test "$XPM_LIBS" != ""; then AC_CHECK_HEADERS(X11/xpm.h xpm.h) fi AC_SUBST(XPM_LIBS) dnl dnl dnl Check for Motif widget libraries dnl dnl XM_LIBS="" XP_LIBS="" if test "$motif_includes" != "no" && test "$motif_libraries" != "no" then dnl Motif 2.1 wants `-lXp' (X11R6.3 print server) AC_CHECK_LIB(Xp, XpSelectInput, XP_LIBS="-lXp" AC_DEFINE([HAVE_XP],1,[Xp available]),, ${X_PRE_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} ${LIBGEN}) dnl AC_CHECK_LIB(Xm, XmCreateOptionMenu, XM_LIBS="-lXm" AC_DEFINE([HAVE_MOTIF],1,[Motif available]),, ${X_PRE_LIBS} ${XP_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XEXT_LIBS} ${X11_LIBS} ${LIBGEN}) fi if test "$XM_LIBS" = ""; then dnl Without Motif, we won't get far. Let the user fix this. AC_MSG_WARN([The Motif library '-lXm' could not be found. Please use the configure options '--with-motif-includes=DIR' and '--with-motif-libraries=DIR' to specify the Xm location. See the file 'config.log' for further diagnostics.]) fi AC_SUBST(XP_LIBS) AC_SUBST(XM_LIBS) AM_CONDITIONAL([HAVE_MOTIF], [test "$XM_LIBS" != ""]) dnl dnl dnl dnl LIBS="$ice_save_LIBS" CFLAGS="$ice_save_CFLAGS" CPPFLAGS="$ice_save_CPPFLAGS" LDFLAGS="$ice_save_LDFLAGS" fi AC_C_BIGENDIAN AC_DEFINE(TRIPMATE_ENABLE, 1, [DeLorme TripMate support]) AC_DEFINE(ZODIAC_ENABLE, 1, [Zodiac chipset support]) AC_OUTPUT(Makefile gpsd.spec) (echo "# Generated from gpsd.spec.in, do not handhack!"; cat gpsd.spec) >gpsd.tmp.$$ mv gpsd.tmp.$$ gpsd.spec