configure.ac
来自「gpsd, a popular GPS daemon.」· AC 代码 · 共 780 行 · 第 1/2 页
AC
780 行
dnl $Id: configure.ac 4684 2008-02-17 02:26:37Z ckuethe $AC_INITAM_INIT_AUTOMAKE(gpsd, 2.37)dnl AC_PREFIX_PROGRAM(gcc)AM_CONFIG_HEADER(gpsd_config.h)AC_LANG([C])AC_ARG_ENABLE(python, AC_HELP_STRING([--disable-python], [disable python scripts and library bindings]), [try_python="$enableval"], [try_python="yes"])ac_python="no"if test x"$try_python" = xyes ; thenAM_PATH_PYTHONac_python="yes"fiAM_CONDITIONAL([HAVE_PYTHON], [test x"$ac_python" = xyes])AC_PROG_LN_SAC_PROG_MAKE_SETAC_PROG_INSTALLAC_PROG_LIBTOOLAC_PROG_CXXAC_C_BIGENDIANtype_error="no"AC_CHECK_SIZEOF([char])AC_CHECK_SIZEOF([short])AC_CHECK_SIZEOF([int])AC_CHECK_SIZEOF([long])AC_CHECK_SIZEOF([float])AC_CHECK_SIZEOF([double])if test x"$ac_cv_sizeof_char" != "x1" ; then AC_MSG_WARN(gpsd requires sizeof(char)==1); type_error="yes"fiif test x"$ac_cv_sizeof_short" != "x2" ; then AC_MSG_WARN(gpsd requires sizeof(short)==2); type_error="yes"fiif test x"$ac_cv_sizeof_int" != "x4" ; then AC_MSG_WARN(gpsd requires sizeof(int)==4); type_error="yes"fiif test x"$ac_cv_sizeof_float" != "x4" ; then AC_MSG_WARN(gpsd requires sizeof(float)==4); type_error="yes"fiif test x"$ac_cv_sizeof_double" != "x8" ; then AC_MSG_WARN(gpsd requires sizeof(double)==8); type_error="yes"fiif test x"$type_error" = "xyes" ; then AC_ERROR(Your system does not provide all required data types);fiAC_FUNC_ALLOCAAC_STDC_HEADERSAC_C_CONSTAC_MSG_CHECKING([for properly working floating point implementation])if test "x$build" = "x$host"; then if eval "$CC $CFLAGS -o floattest ${srcdir}/floattest.c"; then if ./floattest > /dev/null; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_WARN([We strongly recommend you manually examine the floattest results]) fi else AC_MSG_RESULT([failure compiling floattest]) fielse AC_MSG_RESULT([skipped test (cross-compiling)]) AC_MSG_WARN([We are cross-compiling, and thus cannot run the floating point test now.We strongly recommend running floattest on the target platform.])fiif eval "test x$GCC = xyes"; then CFLAGS="$CFLAGS -Wall -Wcast-align -Wmissing-declarations -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith -Wreturn-type -D_GNU_SOURCE" dnl -Wcast-qual -WfiAC_CHECK_HEADERS(sys/termios.h sys/select.h sys/time.h sys/modem.h sys/ipc.h sys/shm.h sys/socket.h)AC_CHECK_HEADERS(arpa/inet.h netinet/in_systm.h netinet/in.h netinet/tcp.h)AC_CHECK_HEADERS([netinet/ip.h], [], [],[[#if HAVE_NETINET_IN_SYSTM_H && HAVE_NETINET_IN_H#include netinet/ip.h#endif]])AC_CHECK_HEADERS(termios.h strings.h ncurses.h getopt.h netdb.h)AC_CHECK_FUNCS(round, roundf)AC_CHECK_FUNCS(strlcpy)AC_CHECK_FUNCS(strlcat)AC_CHECK_FUNCS(strtonum)AC_CHECK_FUNCS(setlocale)AC_HEADER_TIMEAC_STRUCT_TIMEZONEAC_CACHE_CHECK(for timezone variable, ac_cv_var_timezone, AC_TRY_COMPILE([#include <time.h> ], [ timezone = 1; ], ac_cv_var_timezone=yes, ac_cv_var_timezone=no))if test $ac_cv_var_timezone = yes; then AC_DEFINE(HAVE_TIMEZONE, [], [Have timezone variable])else AC_CACHE_CHECK(for tm_gmtoff in struct tm, ac_cv_struct_tm_gmtoff, AC_TRY_COMPILE([#include <time.h> ], [ struct tm tm; tm.tm_gmtoff = 1; ], ac_cv_struct_tm_gmtoff=yes, ac_cv_struct_tm_gmtoff=no)) if test $ac_cv_struct_tm_gmtoff = yes; then AC_DEFINE(HAVE_TM_GMTOFF, [], [struct tm has tm_gmtoff]) else AC_ERROR(unable to find a way to determine timezone) fifi AC_CACHE_CHECK(for daylight external, mb_cv_var_daylight,[ AC_TRY_LINK([#include <time.h>], [return (int)daylight;], mb_cv_var_daylight=yes, mb_cv_var_daylight=no)])if test $mb_cv_var_daylight = yes; then AC_DEFINE([HAVE_DAYLIGHT], 1, [Define if you have the external 'daylight' variable.])fiAC_CHECK_LIB(nsl, gethostbyname, LIBNSL="-lnsl")AC_SUBST(LIBNSL)AC_CHECK_LIB(socket, socket, LIBSOCKET="-lsocket")AC_SUBST(LIBSOCKET)AC_CHECK_LIB(m, rint, LIBM="-lm")AC_SUBST(LIBM)AC_CHECK_LIB(c, open, LIBC="-lc")AC_SUBST(LIBC)AC_CHECK_LIB(pthread, pthread_setcancelstate, [LIBPTHREAD="-lpthread" AC_DEFINE([HAVE_LIBPTHREAD], [], [pthread libraries are present])])AC_SUBST(LIBPTHREAD)AH_VERBATIM([_GNU_SOURCE], [/* Macro for declaring function arguments unused. */#if defined(__GNUC__)# define UNUSED __attribute__((unused)) /* Flag variable as unused */#else /* not __GNUC__ */# define UNUSED#endif/* Some libc's don't have strlcat/strlcpy. Local copies are provided */#ifndef HAVE_STRLCATsize_t strlcat(/*@out@*/char *dst, /*@in@*/const char *src, size_t size);#endif#ifndef HAVE_STRLCPYsize_t strlcpy(/*@out@*/char *dst, /*@in@*/const char *src, size_t size);#endif])dnl Check for X librariesac_x="no"if test x"$with_x" != "xno" -a x"$have_x" != "xdisabled" then AC_CHECK_HEADERS(X11/xpm.h xpm.h) if test x"$ac_cv_header_X11_xpm_h" = "xno" && test x"$ac_cv_header_xpm_h" = "xno"; then AC_MSG_WARN([xpm.h problem - xgps won't be built.]) fi AC_PATH_XTRA if test x"$ac_cv_have_x" = "xno"; then AC_MSG_WARN([X problem - xgps won't be built.]) fi LIBS="$LIBS $X_EXTRA_LIBS" CFLAGS="$CFLAGS $X_CFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS" AC_SUBST(X_LIBS) AC_SUBST(X11_LIBS) AC_SUBST(X_PRE_LIBS) dnl Check for some auxiliary X libraries we'll need AC_CHECK_LIB(Xt, XtToolkitInitialize, XT_LIBS="-lXt",, ${X_PRE_LIBS} ${X11_LIBS}) AC_SUBST(XT_LIBS) if test x"$ac_cv_lib_Xt_XtToolkitInitialize" = "xno"; then AC_MSG_WARN([libXt problem - xgps won't be built.]) fi AC_CHECK_HEADER([X11/Xaw/Label.h],, motif_includes="no") AC_CHECK_LIB(Xaw, XawInitializeWidgetSet, XAW_LIBS="-lXaw",, ${X_PRE_LIBS} ${X11_LIBS}) AC_SUBST(XAW_LIBS) if test x"$ac_cv_lib_Xaw_XawInitializeWidgetSet" = "xno"; then AC_MSG_WARN([libXaw problem - xgps won't be built.]) fi AC_CHECK_LIB(Xext, XShapeQueryVersion, XEXT_LIBS="-lXext",, ${X_PRE_LIBS} ${X11_LIBS}) AC_SUBST(XEXT_LIBS) if test x"$ac_cv_lib_Xext_XShapeQueryVersion" = "xno"; then AC_MSG_WARN([libXext problem - xgps won't be built.]) fi AC_CHECK_LIB(Xpm, XpmCreatePixmapFromXpmImage, XPM_LIBS="-lXpm" AC_DEFINE([HAVE_XPM],1,[Xpm available]),,${X_PRE_LIBS} ${X11_LIBS}) AC_SUBST(XPM_LIBS) if test x"$ac_cv_lib_Xpm_XpmCreatePixmapFromXpmImage" = "xno"; then AC_MSG_WARN([libXpm problem - xgps won't be built.]) fi dnl Check for Motif widget libraries XM_LIBS="" XP_LIBS="" if test "$motif_includes" != "no" -a "$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, XmInternAtom, 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 AC_SUBST(XP_LIBS) AC_SUBST(XM_LIBS) AM_CONDITIONAL([HAVE_MOTIF], [test "$XM_LIBS" != "" -a "$motif_includes" != "no"]) ac_x="yes"else dnl X11 disabled AM_CONDITIONAL([HAVE_MOTIF], [test "motif" = "no"]) AC_MSG_WARN([Not including X11 support])fidnl End of X11 checksAC_CHECK_HEADER(ncurses.h, ac_ncurses='yes', ac_ncurses='no')AM_CONDITIONAL([HAVE_NCURSES], [test x"$ac_ncurses" = "xyes"])AC_CHECK_LIB(ncurses, initscr, ac_ncurses_lib='yes', ac_ncurses_lib='no')if test x"$ac_ncurses_lib" = "xyes" -a x"$ac_ncurses" = "xno" ; then AC_MSG_ERROR(I see an ncurses library but no header; you should install the development package);fidnl check for NMEA supportAC_ARG_ENABLE(nmea, AC_HELP_STRING([--disable-nmea], [disable NMEA support]), [ac_nmea=$enableval], [ac_nmea=yes])AC_MSG_CHECKING([for NMEA support])if test x"$ac_nmea" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE([NMEA_ENABLE], 1, [NMEA chipset support])else AC_MSG_RESULT([no])fidnl check for SiRF supportAC_ARG_ENABLE(sirf, AC_HELP_STRING([--disable-sirf], [disable SiRF chipset support]), [ac_sirf=$enableval], [ac_sirf=yes])AC_MSG_CHECKING([for SiRF support])if test x"$ac_sirf" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE([SIRF_ENABLE], 1, [SiRF chipset support])else AC_MSG_RESULT([no])fidnl check for Trimble TSIP supportAC_ARG_ENABLE(tsip, AC_HELP_STRING([--disable-tsip], [disable Trimble TSIP support]), [ac_tsip=$enableval], [ac_tsip=yes])AC_MSG_CHECKING([for Trimble TSIP support])if test x"$ac_tsip" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE([TSIP_ENABLE], 1, [Trimble TSIP support])else AC_MSG_RESULT([no])fidnl check for FV-18 supportAC_ARG_ENABLE(fv18, AC_HELP_STRING([--disable-fv18], [disable San Jose Navigation FV-18 support]), [ac_fv18=$enableval], [ac_fv18=yes])AC_MSG_CHECKING([for FV-18 support])if test x"$ac_fv18" = "xyes"; then ac_nmea=yes AC_MSG_RESULT([yes]) AC_DEFINE([FV18_ENABLE], 1, [San Jose Navigation FV-18 support]) AC_DEFINE([NMEA_ENABLE], 1, [San Jose Navigation FV-18 requires NMEA support])else AC_MSG_RESULT([no])fidnl check for Tripmate supportAC_ARG_ENABLE(tripmate, AC_HELP_STRING([--disable-tripmate], [disable DeLorme TripMate support]), [ac_tripmate=$enableval], [ac_tripmate=yes])AC_MSG_CHECKING([for Tripmate support])if test x"$ac_tripmate" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE([TRIPMATE_ENABLE], 1, [DeLorme TripMate support])else AC_MSG_RESULT([no])fidnl check for EarthMate supportAC_ARG_ENABLE(earthmate, AC_HELP_STRING([--disable-earthmate], [disable DeLorme EarthMate Zodiac support]), [ac_earthmate=$enableval], [ac_earthmate=yes])AC_MSG_CHECKING([for EarthMate support])if test x"$ac_earthmate" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE([EARTHMATE_ENABLE], 1, [DeLorme EarthMate Zodiac support])else AC_MSG_RESULT([no])fidnl check for iTrax supportAC_ARG_ENABLE(itrax, AC_HELP_STRING([--disable-itrax], [disable iTrax hardware support]), [ac_itrax=$enableval], [ac_itrax=yes])AC_MSG_CHECKING([for iTrax support])if test x"$ac_itrax" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE([ITRAX_ENABLE], 1, [iTrax chipset support])else AC_MSG_RESULT([no])fidnl check for Ashtech supportAC_ARG_ENABLE(ashtech, AC_HELP_STRING([--disable-ashtech], [disable Ashtech support]), [ac_ashtech=$enableval], [ac_ashtech=yes])AC_MSG_CHECKING([for Ashtech support])if test x"$ac_ashtech" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE([ASHTECH_ENABLE], 1, [Ashtech chipset support])else AC_MSG_RESULT([no])fidnl check for Navcom supportAC_ARG_ENABLE(navcom, AC_HELP_STRING([--disable-navcom], [disable Navcom support]), [ac_navcom=$enableval], [ac_navcom=yes])AC_MSG_CHECKING([for Navcom support])if test x"$ac_navcom" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE([NAVCOM_ENABLE], 1, [Navcom support])else AC_MSG_RESULT([no])fidnl check for Garmin supportAC_ARG_ENABLE(garmin, AC_HELP_STRING([--disable-garmin], [disable Garmin kernel driver support]), [ac_garmin=$enableval], [ac_garmin=yes])AC_MSG_CHECKING([for Garmin support])if test x"$ac_garmin" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE([GARMIN_ENABLE], 1, [Garmin support])else AC_MSG_RESULT([no])fidnl check for Garmin Simple Text supportAC_ARG_ENABLE(garmintxt, AC_HELP_STRING([--enable-garmintxt], [enable Garmin Simple Text support]), [ac_garmintxt=$enableval], [ac_garmintxt=no])AC_MSG_CHECKING([for Garmin Simple Text support])if test x"$ac_garmintxt" = "xyes"; then AC_MSG_RESULT([yes]) AC_DEFINE([GARMINTXT_ENABLE], 1, [Garmin Simple Text support])else AC_MSG_RESULT([no])fi
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?