1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(openggsn, 0.91, laforge@gnumonks.org)
3 AC_CONFIG_SRCDIR([gtp/gtp.c])
4 AM_CONFIG_HEADER([config.h])
5 #AC_CONFIG_HEADER([config.h])
18 #JJAKO Check for libtool
22 AC_ARG_ENABLE(static-exec,
23 [ --enable-static-exec Enable static linking of executables],
24 [ EXEC_LDFLAGS="-all-static"])
26 AC_SUBST(EXEC_LDFLAGS)
31 EXEC_LDADD="-Wl,--rpath -Wl,/usr/local/lib" ;;
33 EXEC_LDADD="-lresolv -lsocket -lnsl" ;;
39 # Checks for libraries.
40 # FIXME: Replace `main' with a function in `-le':
41 #AC_CHECK_LIB([e], [main])
42 # FIXME: Replace `main' with a function in `-lgtp':
43 #AC_CHECK_LIB([gtp], [main])
44 # FIXME: Replace `main' with a function in `-links':
45 #AC_CHECK_LIB([inks], [main])
47 # Checks for header files.
50 AC_CHECK_HEADERS([arpa/inet.h fcntl.h netdb.h netinet/in.h stdint.h stdlib.h string.h sys/ioctl.h sys/socket.h sys/time.h syslog.h unistd.h])
53 AC_CHECK_HEADERS([linux/if.h net/if.h])
55 # Check for tun header
56 AC_CHECK_HEADERS([linux/if_tun.h net/if_tun.h])
58 # Check for netlink and rtnetlink headers
59 AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h])
62 # Checks for typedefs, structures, and compiler characteristics.
68 # check for ifaliasreq
69 AC_MSG_CHECKING(whether struct ifaliasreq exist)
70 AH_TEMPLATE(HAVE_IFALIASREQ)
71 AC_EGREP_HEADER(ifaliasreq, net/if.h,
73 AC_DEFINE([HAVE_IFALIASREQ])],
76 # check for ifreq.ifru_netmask
77 AC_MSG_CHECKING(whether struct ifreq.ifru_netmask exist)
78 AH_TEMPLATE(HAVE_IFREQ_IFRU_NETMASK)
79 AC_EGREP_HEADER(ifru_netmask, linux/if.h,
81 AC_DEFINE([HAVE_IFREQ_IFRU_NETMASK])],
86 AC_MSG_CHECKING(whether struct rt_msghdr exist)
87 AH_TEMPLATE(HAVE_RT_MSGHDR)
88 AC_EGREP_HEADER(rt_msghdr, net/route.h,
90 AC_DEFINE([HAVE_RT_MSGHDR])],
94 # Checks for library functions.
95 AC_PROG_GCC_TRADITIONAL
98 AC_CHECK_FUNCS([gethostbyname inet_ntoa memset select socket strdup strerror strtol])
99 AC_CHECK_FUNCS(inet_aton inet_addr, break)
101 # check for getopt in standard library
106 AC_CONFIG_FILES([Makefile