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