dnl Process this file with autoconf to produce a configure script. AC_INIT(bidwatcher.h) AM_CONFIG_HEADER(config.h) AM_INIT_AUTOMAKE(bidwatcher,1.3.17) AC_PREREQ(2.53) dnl Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_INSTALL dnl Checks for libraries. dnl Checks for header files. dnl Checks for typedefs, structures, and compiler characteristics. CXXFLAGS="$CXXFLAGS -Wall" #CPPFLAGS="$CXXFLAGS -Wall" #CCFLAGS="$CFLAGS -Wall" dnl Checks for library functions. AM_PATH_GLIB(1.2.0) AM_PATH_GTK(1.2.0, [LIBS="$LIBS $GTK_LIBS" CXXFLAGS="$CXXFLAGS $GTK_CFLAGS"], AC_MSG_ERROR(Cannot find Gtk+)) AC_MSG_CHECKING([for socklen_t]) AC_EGREP_HEADER(socklen_t, sys/socket.h, AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]) AC_DEFINE(socklen_t,int, [ Define to 'int' if doesn't have it. ])) AC_CHECK_FUNC(getsockopt, , AC_CHECK_LIB(socket, getsockopt)) #AC_CHECK_FUNCS(gmtime) AC_STRUCT_TIMEZONE dnl for Ansi-C++ (g++-3.x) vs. older C++ implementations AC_LANG_CPLUSPLUS AC_CHECK_HEADERS([fstream fstream.h], break) AC_CHECK_HEADERS([sstream strstream.h], break) AC_CXX_NAMESPACES AC_CXX_HAVE_STL dnl On cygwin timezone is a function, but _timezone is usable. AC_CACHE_CHECK(if timezone is usable, nmh_cv_timezone_usable, [AC_TRY_COMPILE([#include ], [extern long timezone, long t= timezone], nmh_cv_timezone_usable=yes, nmh_cv_timezone_usable=no)]) if test $nmh_cv_timezone_usable = yes; then AC_DEFINE([TIMEZONE_USABLE], 1, [timezone is usable]) else AC_CACHE_CHECK(if _timezone is usable, nmh_cv_underscore_timezone_usable, [AC_TRY_COMPILE( [#include ], [long t= _timezone], nmh_cv_underscore_timezone_usable=yes, nmh_cv_underscore_timezone_usable=no)]) if test $nmh_cv_underscore_timezone_usable = yes; then AC_DEFINE([UNDERSCORE_TIMEZONE_USABLE], 1, [_timezone is usable]) fi fi AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug], [Enable noisy debugging code]), [use_debug=$enableval], [use_debug=no]) if test "$use_debug" != "no" ; then if test "$use_debug" = "yes" ; then #Default debugging level AC_DEFINE([DEBUGGING], 10, [Debugging level]) else #It's not the default, so we must have a value AC_DEFINE_UNQUOTED([DEBUGGING], $use_debug, [Debugging level]) fi fi AC_CACHE_CHECK([for %llu], bidwatcher_have_llu, [AC_TRY_RUN([ #include #include #define NIX "%llu" int main () { char test[11]; unsigned long long int num = 0xdeadbeef; sprintf (test, NIX, num); if (strcmp (test, "3735928559") == 0) exit (0); else exit (1); }], bidwatcher_have_llu=yes, bidwatcher_have_llu=no, AC_MSG_ERROR(can not run test program while cross compiling)) ] ) if test x"$bidwatcher_have_llu" = x"yes"; then AC_DEFINE([HAVE_LLU], 1, [Has llu format]) fi AC_CACHE_CHECK([for %qu], bidwatcher_have_qu, [AC_TRY_RUN([ #include #include #define NIX "%qu" int main () { char test[11]; unsigned long long int num = 0xdeadbeef; sprintf (test, NIX, num); if (strcmp (test, "3735928559") == 0) exit (0); else exit (1); }], bidwatcher_have_qu=yes, bidwatcher_have_qu=no, AC_MSG_ERROR(can not run test program while cross compiling)) ] ) if test x"$bidwatcher_have_qu" = x"yes"; then AC_DEFINE([HAVE_QU], 1, [Has qu format]) fi LIBCURL_CHECK_CONFIG([yes], 7.11.1, [have_libcurl=yes], [have_libcurl=no]) if test "Xno" = X$have_libcurl; then AC_MSG_ERROR(Cannot find libcurl) fi AC_OUTPUT(Makefile pixmaps/Makefile,echo timestamp > stamp-h)