blob: b6901eeddc3ac89e5349be6639716db70c1b47c8 [file] [log] [blame]
Harout Hedeshian04d69732013-10-02 09:29:11 -06001# -*- Autoconf -*-
2# Process this file with autoconf to produce a configure script.
3AC_PREREQ([2.65])
Andrew Walker2f3c0302015-03-25 17:16:58 -07004AC_INIT([data-oss], [1.0.0])
5AM_INIT_AUTOMAKE
Harout Hedeshianc6ae03c2013-10-11 08:00:29 -06006AC_OUTPUT(Makefile rmnetctl/src/Makefile rmnetctl/cli/Makefile data-oss.pc)
Harout Hedeshian04d69732013-10-02 09:29:11 -06007AC_CONFIG_SRCDIR([rmnetctl/src/librmnetctl.c])
8#AC_CONFIG_HEADERS([config.h])
9AC_CONFIG_MACRO_DIR([m4])
10
11# Checks for programs.
12AC_PROG_CC
13AC_PROG_LIBTOOL
Andrew Walker2f3c0302015-03-25 17:16:58 -070014PKG_PROG_PKG_CONFIG
Harout Hedeshian04d69732013-10-02 09:29:11 -060015
16# Checks for libraries.
17AC_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
22AC_ARG_WITH([glib],
23 AC_HELP_STRING([--with-glib],
24 [enable glib, building HLOS systems which use glib]))
25
26if (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)
36fi
37
38AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
39
40# Checks for header files.
41AC_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.
44AC_TYPE_OFF_T
45
46# Checks for library functions.
47AC_FUNC_MALLOC
48
49#AC_FUNC_MMAP
50#AC_CHECK_FUNCS([memset malloc sendto recvfrom ])
51AC_OUTPUT