# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.53) AC_INIT([etherape],[0.9.6]) AC_CONFIG_SRCDIR(README) AM_CONFIG_HEADER([config.h]) AM_INIT_AUTOMAKE # defines #AC_DEFINE([ENABLE_NLS],[],[cmt]) AC_DEFINE([HAVE_CATGETS],[],[cmt]) #AC_DEFINE([HAVE_GETTEXT],[],[cmt]) AC_DEFINE([GETTEXT_PACKAGE],[],[cmt]) #AC_DEFINE([HAVE_LC_MESSAGES],[],[cmt]) #AC_DEFINE([HAVE_STPCPY],[],[cmt]) AC_DEFINE([HAVE_LIBSM],[],[cmt]) #AC_DEFINE([PACKAGE_LOCALE_DIR],[],[cmt]) #AC_DEFINE([PACKAGE_DATA_DIR],[],[cmt]) #AC_DEFINE([PACKAGE_SOURCE_DIR],[],[cmt]) #AC_DEFINE([DATAFILE_DIR],[],[Directory of data files]) #AC_DEFINE([PIXMAPS_DIR],[],[cmt]) AC_DEFINE([HAVE_LIBPCAP],[],[cmt]) AC_DEFINE([HAVE_U_INT],[],[cmt]) # Checks for programs. AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_MAKE_SET AC_PROG_LIBTOOL #AC_PROG_INTLTOOL(0.27) # gnome checks GNOME_COMPILE_WARNINGS # Checks for libraries. PKG_CHECK_MODULES(ETHERAPE, libglade-2.0 libgnomeui-2.0) AC_SUBST(ETHERAPE_CFLAGS) AC_SUBST(ETHERAPE_LIBS) # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h unistd.h ]) AC_CHECK_HEADERS([sys/socket.h]) AC_CHECK_HEADERS([net/if.h], [], [], [#include #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_SYS_SOCKET_H # include #endif ]) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_HEADER_TIME AC_STRUCT_TM AC_C_VOLATILE AC_CHECK_TYPES(u_int, ,AC_DEFINE(u_int, unsigned int, [define u_int])) AC_CHECK_TYPES(u_short, ,AC_DEFINE(u_short, unsigned short, [define u_short])) AC_CHECK_TYPES(u_long, ,AC_DEFINE(u_long, unsigned long, [define u_long])) AC_CHECK_TYPES(u_char, ,AC_DEFINE(u_char, unsigned char, [define u_char])) AC_ARG_ENABLE(thread-resolver, [AC_HELP_STRING([--enable-thread-resolver],[Use the multithreaded resolver (def. yes).])], [use_multithread=$enableval], [use_multithread=yes]) if test $use_multithread = no; then AC_DEFINE([USE_DIRECTDNS], [1], [Forces the old socket base resolver.]) fi # res_init and friends are used only on direct resolver. Otherwhise we need # gethostbyaddr_r() if test $use_multithread = no; then # Copied from mtr to support dns.c # After some kind of change in libc, it seems it is # required to #include for the test to succeed. # To go around it I included the test for __res_init AC_CHECK_FUNC(res_init, , AC_CHECK_LIB(bind, res_init, , AC_CHECK_LIB(resolv, res_init, , AC_CHECK_LIB(c, __res_init, , [AC_MSG_ERROR([No resolver library found])] )))) AC_CHECK_FUNC(res_mkquery, , AC_CHECK_LIB(bind, res_mkquery, , AC_CHECK_LIB(resolv, res_mkquery, , [AC_MSG_ERROR([No resolver library found])] ))) else AC_CHECK_FUNC(gethostbyaddr_r, [has_gethostbyaddr_r=yes], AC_CHECK_LIB(bind, gethostbyaddr_r, [has_gethostbyaddr_r=yes], AC_CHECK_LIB(resolv, gethostbyaddr_r, [has_gethostbyaddr_r=yes], AC_CHECK_LIB(nsl, gethostbyaddr_r, [has_gethostbyaddr_r=yes],[has_gethostbyaddr_r=no])))) if test $has_gethostbyaddr_r = no; then AC_MSG_NOTICE([gethostbyaddr_r not found, trying with gethostbyaddr]) AC_CHECK_FUNC(gethostbyaddr, [has_gethostbyaddr=yes], AC_CHECK_LIB(bind, gethostbyaddr, [has_gethostbyaddr=yes], AC_CHECK_LIB(resolv, gethostbyaddr, [has_gethostbyaddr=yes], AC_CHECK_LIB(nsl, gethostbyaddr, [has_gethostbyaddr=yes], [AC_MSG_ERROR([Missing both gethostbyaddr and gethostbyaddr_r. Please install a resolver library.])] )))) if test $has_gethostbyaddr = yes; then AC_MSG_WARN([Found only gethostbyaddr, while gethostbyaddr_r does not exists, resolving is restricted to single thread.]) AC_DEFINE([FORCE_SINGLE_THREAD], [1], [found only gethostbyaddr, while gethostbyaddr_r does not exists, resolving is restricted to single thread.]) fi fi fi # Check for the pcap library. AC_ARG_ENABLE(static-pcap, [ --enable-static-pcap Used to build the rpm within Debian. ], STATIC_PCAP=yes) AC_ETHEREAL_PCAP_CHECK # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_MEMCMP AC_FUNC_VPRINTF AC_TYPE_SIGNAL AC_CHECK_FUNCS([snprintf alarm floor gettimeofday inet_ntoa localtime_r memset pow putenv socket sqrt strcasecmp strchr strerror strpbrk strstr]) # Create DATAFILE_DIR #define for config.h DATAFILE_DIR=$sysconfdir # The following statement was in ethereal # but it breaks in some machines and I still don't know # what is for... JTC :-) #DATAFILE_DIR=( # test "x$prefix" = xNONE && prefix=$ac_default_prefix # test "x$exec_prefix" = xNONE && exec_prefix=${prefix} # eval echo "$DATAFILE_DIR" # ) AC_DEFINE_UNQUOTED(DATAFILE_DIR,"$DATAFILE_DIR",[data file directory]) AC_SUBST(DATAFILE_DIR) dnl Add the languages which your application supports here. ALL_LINGUAS="es fr nl tr" AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.11.5]) GETTEXT_PACKAGE=etherape AC_SUBST(GETTEXT_PACKAGE) AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE") dnl Set PACKAGE_LOCALE_DIR in config.h. if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/share/locale",[package locale directory]) else AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/share/locale",[package locale directory]) fi dnl Set PIXMAPS_DIR in config.h. if test "x${prefix}" = "xNONE"; then AC_DEFINE_UNQUOTED(PIXMAPS_DIR, "${ac_default_prefix}/share/pixmaps",[pixmaps directory]) else AC_DEFINE_UNQUOTED(PIXMAPS_DIR, "${prefix}/share/pixmaps",[pixmaps directory]) fi dnl see if the linker allows "--export-dynamic" AC_MSG_CHECKING([if the linker allows -Wl,--export-dynamic]) tmp_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,--export-dynamic" AC_LINK_IFELSE([int main(int argc, char *argv[]){return 0;}], AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]) LDFLAGS=$tmp_LDFLAGS) AC_CONFIG_FILES([Makefile po/Makefile.in etherape.spec etherape.desktop glade/Makefile src/Makefile m4/Makefile doc/Makefile doc/C/Makefile]) AC_OUTPUT