1 # Process this file with autoconf to produce a configure script.
2 AC_INIT(openggsn, m4_esyscmd([./git-version-gen .tarball-version]), osmocom-net-gprs@lists.osmocom.org)
3 AC_CONFIG_SRCDIR([gtp/gtp.c])
4 AM_CONFIG_HEADER([config.h])
5 #AC_CONFIG_HEADER([config.h])
7 dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
12 dnl kernel style compile messages
13 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
15 # Checks for programs.
23 dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
24 AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
25 if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
26 AC_MSG_WARN([You need to install pkg-config])
28 PKG_PROG_PKG_CONFIG([0.20])
30 AC_CONFIG_MACRO_DIR([m4])
31 AC_CONFIG_LIBOBJ_DIR([lib])
33 AC_ARG_ENABLE(static-exec,
34 [ --enable-static-exec Enable static linking of executables],
35 [ EXEC_LDFLAGS="-all-static"])
37 AC_SUBST(EXEC_LDFLAGS)
44 EXEC_LDADD="-lresolv -lsocket -lnsl" ;;
50 # Checks for libraries.
51 # FIXME: Replace `main' with a function in `-le':
52 #AC_CHECK_LIB([e], [main])
53 # FIXME: Replace `main' with a function in `-lgtp':
54 #AC_CHECK_LIB([gtp], [main])
55 # FIXME: Replace `main' with a function in `-links':
56 #AC_CHECK_LIB([inks], [main])
58 dnl include release helper
59 RELMAKE='-include osmo-release.mk'
62 dnl GTP Linux kernel dependencies
63 AC_ARG_ENABLE([gtp-linux],
64 AS_HELP_STRING([--enable-gtp-linux], [Build GTP tunneling Linux kernel]),
65 [enable_gtp_linux="$enableval"], [enable_gtp_linux="no"])
67 AS_IF([test "x$enable_gtp_linux" = "xyes"], [
68 PKG_CHECK_MODULES([LIBGTPNL], [libgtpnl >= 1.0.0])
71 AM_CONDITIONAL([ENABLE_GTP_KERNEL], [test "$enable_gtp_linux" = "yes"])
73 # Checks for header files.
76 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 unistd.h])
79 AC_CHECK_HEADERS([linux/if.h net/if.h])
81 # Check for tun header
82 AC_CHECK_HEADERS([linux/if_tun.h net/if_tun.h])
84 # Check for netlink and rtnetlink headers
85 AC_CHECK_HEADERS([linux/netlink.h linux/rtnetlink.h])
88 # Checks for typedefs, structures, and compiler characteristics.
94 # check for ifaliasreq
95 AC_MSG_CHECKING(whether struct ifaliasreq exist)
96 AH_TEMPLATE(HAVE_IFALIASREQ)
97 AC_EGREP_HEADER(ifaliasreq, net/if.h,
99 AC_DEFINE([HAVE_IFALIASREQ])],
102 # check for ifreq.ifru_netmask
103 AC_MSG_CHECKING(whether struct ifreq.ifru_netmask exist)
104 AH_TEMPLATE(HAVE_IFREQ_IFRU_NETMASK)
105 AC_EGREP_HEADER(ifru_netmask, linux/if.h,
107 AC_DEFINE([HAVE_IFREQ_IFRU_NETMASK])],
111 # check for rt_msghdr
112 AC_MSG_CHECKING(whether struct rt_msghdr exist)
113 AH_TEMPLATE(HAVE_RT_MSGHDR)
114 AC_EGREP_HEADER(rt_msghdr, net/route.h,
116 AC_DEFINE([HAVE_RT_MSGHDR])],
119 AC_MSG_CHECKING(whether struct iphdr exists)
120 AH_TEMPLATE(HAVE_IPHDR)
121 AC_EGREP_HEADER(struct iphdr, netinet/ip.h,
123 AC_DEFINE([HAVE_IPHDR])],
126 # Checks for library functions.
127 AC_PROG_GCC_TRADITIONAL
130 AC_CHECK_FUNCS([gethostbyname inet_ntoa memset select socket strdup strerror strtol])
131 AC_CHECK_FUNCS(inet_aton inet_addr, break)
133 # check for getopt in standard library
136 AM_INIT_AUTOMAKE([foreign])
138 PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.6.4)
139 PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.3.0)
140 PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl)
142 AC_CONFIG_FILES([Makefile
156 openggsn Configuration:
157 GTP Linux kernel support: ${enable_gtp_linux}"