# proces this file with autoconf rm -f config.cache AC_INIT(acconfig.h) AC_CANONICAL_SYSTEM AC_ARG_PROGRAM AM_INIT_AUTOMAKE(sualibrary,0.1.5) AM_CONFIG_HEADER(config.h:config.h.in) # Checks for programs. AC_PROG_AWK AC_PROG_CC AC_PROG_CPP AC_PROG_INSTALL AC_PROG_LN_S AC_PROG_CXX AC_PROG_RANLIB # Checks for libraries. # create only shared libtool-libraries (add --enable-shared) AC_ENABLE_SHARED(yes) # AM_DISABLE_SHARED # set the following to yes, if you want to create static # libtool-libraries, else no AC_ENABLE_STATIC(yes) # create a working libtool-script if test -z "$LIBTOOL"; then AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_LIBTOOL_DLOPEN AM_PROG_LIBTOOL # LIBTOOL="$LIBTOOL --silent" # AC_SUBST(LIBTOOL) AC_LANG_RESTORE LIBTOOL_SHELL='/bin/sh ./libtool' else LIBTOOL_SHELL=$LIBTOOL fi # activate the following for some additional tests # (compat, crypt, socket, nsl, ...) all_libraries="$USER_LDFLAGS $all_libraries" all_includes="$all_includes $USER_INCLUDES" AC_SUBST(all_includes) AC_SUBST(all_libraries) AC_SUBST(AUTODIRS) AC_SUBST(ac_aux_dir) AC_SUBST(CHECKERGCC,[checkergcc]) # Checks for header files. AC_HEADER_STDC AC_HEADER_TIME AC_CHECK_HEADERS([stdlib.h string.h]) AC_CHECK_HEADERS(strings.h sys/file.h sys/time.h unistd.h) AC_CHECK_HEADERS( netinet/in.h netdb.h sys/socket.h netinet/icmp6.h) AC_CHECK_HEADERS(sys/poll.h, AC_DEFINE(HAVE_SYS_POLL_H)) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST # ---------------------- # Packages configuration - Blatantly stolen from zebra ! # ---------------------- AC_ARG_ENABLE(ipv6, [ --disable-ipv6 turn off IPv6 support ]) # ---------- # IPv6 check # ---------- AC_MSG_CHECKING(whether this OS does have IPv6 stack) if test "${enable_ipv6}" = "no"; then AC_MSG_RESULT(disabled) else # ---------- # INRIA IPv6 # ---------- if grep IPV6_INRIA_VERSION /usr/include/netinet/in.h >/dev/null 2>&1; then cv_ipv6=yes AC_DEFINE(HAVE_IPV6) AC_DEFINE(INRIA_IPV6) LIB_IPV6="" AC_MSG_RESULT(INRIA IPv6) fi # --------- # KAME IPv6 # --------- if grep WIDE /usr/include/netinet6/in6.h >/dev/null 2>&1; then cv_ipv6=yes AC_DEFINE(HAVE_IPV6) AC_DEFINE(KAME) if test -d /usr/local/v6/lib -a -f /usr/local/v6/lib/libinet6.a; then LIB_IPV6="-L/usr/local/v6/lib -linet6" fi AC_MSG_RESULT(KAME) fi # --------- # NRL check # --------- if grep NRL /usr/include/netinet6/in6.h >/dev/null 2>&1; then cv_ipv6=yes AC_DEFINE(HAVE_IPV6) AC_DEFINE(NRL) if test x"$opsys" = x"bsdi";then AC_DEFINE(BSDI_NRL) AC_MSG_RESULT(BSDI_NRL) else AC_MSG_RESULT(NRL) fi fi # ---------- # Linux IPv6 # ---------- if test "${enable_ipv6}" = "yes"; then AC_EGREP_CPP(yes, [# #include /* 2.1.128 or later */ #if LINUX_VERSION_CODE >= 0x020180 yes #endif], [cv_ipv6=yes; cv_linux_ipv6=yes;AC_MSG_RESULT(Linux IPv6)]) else if test x`ls /proc/net/ipv6_route 2>/dev/null` = x"/proc/net/ipv6_route" then cv_ipv6=yes cv_linux_ipv6=yes AC_MSG_RESULT(Linux IPv6) fi fi if test "$cv_linux_ipv6" = "yes";then AC_DEFINE(HAVE_IPV6) AC_MSG_CHECKING(for GNU libc 2.1) AC_EGREP_CPP(yes, [ #include #if __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1 yes #endif], [glibc=yes; AC_MSG_RESULT(yes)], AC_MSG_RESULT(no)) AC_DEFINE(LINUX_IPV6) if test "$glibc" != "yes"; then INCLUDES="-I/usr/inet6/include" if test x`ls /usr/inet6/lib/libinet6.a 2>/dev/null` != x;then LIB_IPV6="-L/usr/inet6/lib -linet6" fi fi fi fi # ----------------------- # Set IPv6 related values # ----------------------- LIBS="$LIB_IPV6 $LIBS" AC_SUBST(LIB_IPV6) # ----------------------------------- # check sin6_scope_id of sockaddr_in6 # ----------------------------------- if test "$cv_ipv6" = yes; then AC_MSG_CHECKING(whether struct sockaddr_in6 has a sin6_scope_id field) AC_TRY_COMPILE([#include #include ],[static struct sockaddr_in6 ac_i;int ac_j = sizeof(ac_i.sin6_scope_id);], [AC_MSG_RESULT(yes) AC_DEFINE(HAVE_SIN6_SCOPE_ID)], AC_MSG_RESULT(no)) fi # ----------------------------------- # Check for New Socket API (RFC2292BIS) # ----------------------------------- AC_MSG_CHECKING(for rfc2292bis support) AC_TRY_COMPILE([#include #include ], [int x = IPV6_RECVPKTINFO;], [AC_DEFINE(USE_RFC2292BIS) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) AC_MSG_CHECKING(for struct in_pktinfo) AC_TRY_COMPILE([#include #include ], [struct in_pktinfo x; x.ipi_ifindex = 0;], [AC_DEFINE(HAVE_PKTINFO) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) # Checks for library functions. AC_CHECK_LIB(socket, socket) AC_CHECK_LIB(nsl, gethostbyname) # removed libefence....this should be used though, when we REALLY debug :-) AC_CHECK_LIB(efence, malloc) AC_CHECK_LIB(c, inet_ntop, [AC_DEFINE(HAVE_INET_NTOP)]) AC_CHECK_LIB(c, inet_pton, [AC_DEFINE(HAVE_INET_PTON)]) AC_CHECK_LIB(c, inet_aton, [AC_DEFINE(HAVE_INET_ATON)]) # GLib & SCTPlib checks enable_sctpd="no" sctpd_SUBDIRS="" # Honor GLIB_CFLAGS AM_PATH_GLIB(1.2.0, CFLAGS="$CFLAGS $GLIB_CFLAGS", AC_MSG_ERROR(GLib distribution not found. On FreeBSD do: ln -s glib12-config glib-config), gmodule) glib_LIBS="$GLIB_LIBS" AC_SUBST(glib_LIBS) AC_CHECK_LIB(glib, g_main_add_poll) sctp_LIBS="-L/usr/local/lib -lsctplib" AC_CHECK_LIB(sctplib, sctp_eventLoop) AC_SUBST(sctp_LIBS) # Checks for library functions. AC_FUNC_VPRINTF AC_FUNC_MEMCMP AC_CHECK_FUNCS(gettimeofday socket strerror poll getuid setuid geteuid random) AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no]) CFLAGS="$CFLAGS -D_REENTRANT -D_THREAD_SAFE" # checks for host/build/target system type AC_CANONICAL_HOST case $host_os in bsdi*) CFLAGS="$CFLAGS -DBSDI" thread_LIBS="-lpthread" # CFLAGS="$CFLAGS `glib-config --cflags`" #LDFLAGS="$LDFLAGS `glib-config --libs`" ;; freebsd*) CFLAGS="$CFLAGS -DFreeBSD -Wall -pthread" CXXFLAGS="$CXXFLAGS -DFreeBSD -Wall -pthread" thread_LIBS="" # CFLAGS="$CFLAGS `glib12-config --cflags`" #LDFLAGS="$LDFLAGS `glib12-config --libs`" ;; hpux*) CFLAGS="$CFLAGS -DSNAKE" test -z "$GCC" && TRY_CFLAGS="$TRY_CFLAGS -Wp,-H600000" thread_LIBS="-lpthread" # CFLAGS="$CFLAGS `glib-config --cflags`" #LDFLAGS="$LDFLAGS `glib-config --libs`" ;; linux*) CFLAGS="$CFLAGS -Wall -DLINUX " CXXFLAGS="$CXXFLAGS -Wall -DLINUX " thread_LIBS="-lpthread" # CFLAGS="$CFLAGS `glib-config --cflags`" #LDFLAGS="`glib-config --libs` $LDFLAGS" ;; openbsd*) LIBS="$LIBS -lcompat" thread_LIBS="-lpthread" # CFLAGS="$CFLAGS `glib-config --cflags`" #LDFLAGS="$LDFLAGS `glib-config --libs`" ;; solaris*) CFLAGS="$CFLAGS -Wall -DSOLARIS -D__sun -DSUN -DSUNOS_5" CXXFLAGS="$CXXFLAGS -Wall -DSOLARIS -D__sun -DSUN -DSUNOS_5" thread_LIBS="-lpthread" LDFLAGS="$LDFLAGS -lsocket -lnsl -lrt -lresolv" # CFLAGS="$CFLAGS `glib-config --cflags`" # LDFLAGS="$LDFLAGS `glib-config --libs`" ;; sunos4*) CFLAGS="$CFLAGS -DSUN -DSUN4" thread_LIBS="-lpthread" # CFLAGS="$CFLAGS `glib-config --cflags`" # LDFLAGS="$LDFLAGS `glib-config --libs`" ;; darwin*) CFLAGS="$CFLAGS -DDARWIN" CXXFLAGS="$CXXFLAGS -DDARWIN" thread_LIBS="-lpthread" # CFLAGS="$CFLAGS `glib-config --cflags`" # LDFLAGS="$LDFLAGS `glib-config --libs`" ;; esac AC_SUBST(thread_LIBS) # Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T AC_STRUCT_TM AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(short, 2) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) AC_CHECK_SIZEOF(long long, 8) AC_MSG_CHECKING(for type socklen_t) AC_TRY_COMPILE([#include #include #include #include ], [socklen_t x; x = 0;], [AC_DEFINE(HAVE_SOCKLEN_T) AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no)]) # add here all your Makefiles. These will be created by configure AC_OUTPUT(Makefile sualibrary/Makefile sualibrary/docs/Makefile sualibrary/docs/en/Makefile sualibrary/sua/Makefile sualibrary/testup/Makefile )