1# -*- Autoconf -*- 2# Process this file with autoconf to produce a configure script. 3 4AC_PREREQ([2.65]) 5AC_INIT(data-ipa, 1.0.0) 6AM_INIT_AUTOMAKE(data-ipa, 1.0.0) 7AC_OUTPUT(Makefile ipanat/src/Makefile ipacm/src/Makefile) 8AC_CONFIG_SRCDIR([ipanat/src/ipa_nat_drv.c]) 9AC_CONFIG_HEADERS([config.h]) 10AC_CONFIG_MACRO_DIR([m4]) 11 12# Checks for programs. 13AC_PROG_CC 14AC_PROG_LIBTOOL 15AC_PROG_CXX 16 17PKG_CHECK_MODULES([LIBXML], [libxml-2.0]) 18AC_SUBST([LIBXML_CFLAGS]) 19AC_SUBST([LIBXML_LIBS]) 20 21# Checks for libraries. 22 23AC_ARG_WITH(sanitized-headers, 24 AS_HELP_STRING([--with-sanitized-headers=DIR], 25 [Specify the location of the sanitized Linux headers]), 26 [CPPFLAGS="$CPPFLAGS -idirafter $withval"]) 27 28AC_ARG_WITH([glib], 29 AC_HELP_STRING([--with-glib], 30 [enable glib, building HLOS systems which use glib])) 31 32if (test "x${with_glib}" = "xyes"); then 33 AC_DEFINE(ENABLE_USEGLIB, 1, [Define if HLOS systems uses glib]) 34 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes, 35 AC_MSG_ERROR(GThread >= 2.16 is required)) 36 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes, 37 AC_MSG_ERROR(GLib >= 2.16 is required)) 38 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS" 39 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS" 40 AC_SUBST(GLIB_CFLAGS) 41 AC_SUBST(GLIB_LIBS) 42fi 43 44AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes") 45 46# Checks for header files. 47AC_CHECK_HEADERS([fcntl.h netinet/in.h sys/ioctl.h unistd.h]) 48 49# Checks for typedefs, structures, and compiler characteristics. 50AC_TYPE_OFF_T 51 52# Checks for library functions. 53AC_FUNC_MALLOC 54AC_FUNC_MMAP 55AC_CHECK_FUNCS([memset munmap]) 56 57AC_OUTPUT 58