blob: deb5fd437da62dbc845830fa087efa2a8a058977 [file] [log] [blame]
Harald Welte4cd3d8a2010-03-23 00:30:19 +08001AC_INIT([libosmocore],
2 m4_esyscmd([./git-version-gen .tarball-version]),
Holger Hans Peter Freyther8db70202012-03-26 16:34:37 +02003 [openbsc@lists.osmocom.org])
Harald Welte3cae0392010-02-20 21:09:24 +01004
Diego Elio Pettenò8dd81fa2012-06-29 13:01:22 -07005AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.6])
Holger Hans Peter Freytherf9eda742011-11-13 01:02:54 +01006AC_CONFIG_TESTDIR(tests)
Harald Welte3cae0392010-02-20 21:09:24 +01007
8dnl kernel style compile messages
9m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
11dnl checks for programs
12AC_PROG_MAKE_SET
Diego Elio Pettenòd471a212012-06-29 13:01:19 -070013AC_PROG_MKDIR_P
Harald Welte3cae0392010-02-20 21:09:24 +010014AC_PROG_CC
15AC_PROG_INSTALL
Harald Welte4cd3d8a2010-03-23 00:30:19 +080016LT_INIT
Harald Welte3cae0392010-02-20 21:09:24 +010017AC_PROG_LIBTOOL
18
Harald Welte4cd3d8a2010-03-23 00:30:19 +080019AC_CONFIG_MACRO_DIR([m4])
20
Harald Welte3cae0392010-02-20 21:09:24 +010021dnl checks for header files
22AC_HEADER_STDC
Harald Weltee4764422011-05-22 12:25:57 +020023AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
Holger Hans Peter Freyther47723482011-11-09 11:26:15 +010024# for src/conv.c
25AC_FUNC_ALLOCA
26AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
27AC_SUBST(LIBRARY_DL)
Harald Welte3cae0392010-02-20 21:09:24 +010028
Harald Welte21e73c22011-08-17 19:33:06 +020029AC_PATH_PROG(DOXYGEN,doxygen,false)
30AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
31
Harald Welte3cae0392010-02-20 21:09:24 +010032# The following test is taken from WebKit's webkit.m4
33saved_CFLAGS="$CFLAGS"
34CFLAGS="$CFLAGS -fvisibility=hidden "
35AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemer3d79f532011-05-24 15:16:13 +020036AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Harald Welte3cae0392010-02-20 21:09:24 +010037 [ AC_MSG_RESULT([yes])
38 SYMBOL_VISIBILITY="-fvisibility=hidden"],
39 AC_MSG_RESULT([no]))
40CFLAGS="$saved_CFLAGS"
41AC_SUBST(SYMBOL_VISIBILITY)
42
43dnl Generate the output
44AM_CONFIG_HEADER(config.h)
45
Harald Weltecbb29f72010-03-07 20:24:30 +010046AC_ARG_ENABLE(talloc,
Sylvain Munautf23abab2010-07-25 16:16:42 +020047 [AS_HELP_STRING(
48 [--disable-talloc],
49 [Disable building talloc memory allocator]
50 )],
job36b4a202011-08-21 17:18:23 +020051 [enable_talloc=$enableval], [enable_talloc="yes"])
52AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"])
Harald Weltecbb29f72010-03-07 20:24:30 +010053
Harald Welteb9ce51c2010-06-30 19:43:11 +020054AC_ARG_ENABLE(plugin,
Sylvain Munautf23abab2010-07-25 16:16:42 +020055 [AS_HELP_STRING(
56 [--disable-plugin],
57 [Disable support for dlopen plugins],
58 )],
job36b4a202011-08-21 17:18:23 +020059 [enable_plugin=$enableval], [enable_plugin="yes"])
60AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes")
Harald Welteb9ce51c2010-06-30 19:43:11 +020061
Harald Welte1067e8c2010-06-25 03:00:58 +020062AC_ARG_ENABLE(vty,
Sylvain Munautf23abab2010-07-25 16:16:42 +020063 [AS_HELP_STRING(
64 [--disable-vty],
65 [Disable building VTY telnet interface]
66 )],
job36b4a202011-08-21 17:18:23 +020067 [enable_vty=$enableval], [enable_vty="yes"])
68AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes")
Harald Welte54403772010-05-29 11:49:51 +020069
Sylvain Munautac3e61a2010-07-25 18:08:54 +020070AC_ARG_ENABLE(panic_infloop,
71 [AS_HELP_STRING(
72 [--enable-panic-infloop],
73 [Trigger infinite loop on panic rather than fprintf/abort]
74 )],
job36b4a202011-08-21 17:18:23 +020075 [panic_infloop=$enableval], [panic_infloop="no"])
76if test x"$panic_infloop" = x"yes"
Sylvain Munautac3e61a2010-07-25 18:08:54 +020077then
78 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
79fi
80
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080081AC_ARG_ENABLE(bsc_fd_check,
82 [AS_HELP_STRING(
83 [--enable-bsc-fd-check],
84 [Instrument bsc_register_fd to check that the fd is registered]
85 )],
job36b4a202011-08-21 17:18:23 +020086 [fd_check=$enableval], [fd_check="no"])
87if test x"$fd_check" = x"no"
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080088then
89 AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
90fi
91
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080092AC_ARG_ENABLE(msgfile,
93 [AS_HELP_STRING(
94 [--disable-msgfile],
95 [Disable support for the msgfile],
96 )],
job36b4a202011-08-21 17:18:23 +020097 [enable_msgfile=$enableval], [enable_msgfile="yes"])
98AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes")
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080099
Sylvain Munautfe28ded2011-09-02 22:18:24 +0200100AC_ARG_ENABLE(serial,
101 [AS_HELP_STRING(
102 [--disable-serial],
103 [Disable support for the serial helpers],
104 )],
105 [enable_serial=$enableval], [enable_serial="yes"])
106AM_CONDITIONAL(ENABLE_SERIAL, test x"$enable_serial" = x"yes")
107
job8e4deb62011-08-21 17:18:24 +0200108AC_ARG_ENABLE(utilities,
109 [AS_HELP_STRING(
110 [--disable-utilities],
111 [Disable building utility programs],
112 )],
113 [enable_utilities=$enableval], [enable_utilities="yes"])
114AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes")
115
116AC_ARG_ENABLE(embedded,
117 [AS_HELP_STRING(
118 [--enable-embedded],
119 [Enable building for embedded use and disable unsupported features]
120 )],
121 [embedded=$enableval], [embedded="no"])
122if test x"$embedded" = x"yes"
123then
124 AC_DEFINE([EMBEDDED],[1],[Select building for embedded use])
job8e4deb62011-08-21 17:18:24 +0200125 AM_CONDITIONAL(ENABLE_PLUGIN, false)
126 AM_CONDITIONAL(ENABLE_MSGFILE, false)
Sylvain Munautfe28ded2011-09-02 22:18:24 +0200127 AM_CONDITIONAL(ENABLE_SERIAL, false)
job8e4deb62011-08-21 17:18:24 +0200128 AM_CONDITIONAL(ENABLE_VTY, false)
129 AM_CONDITIONAL(ENABLE_TALLOC, false)
130 AM_CONDITIONAL(ENABLE_UTILITIES, false)
131 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
132fi
Harald Welte54403772010-05-29 11:49:51 +0200133
Holger Hans Peter Freytherf9eda742011-11-13 01:02:54 +0100134
Harald Welte3cae0392010-02-20 21:09:24 +0100135AC_OUTPUT(
136 libosmocore.pc
Sylvain Munautb99b9302010-10-24 18:23:10 +0200137 libosmocodec.pc
Harald Weltee352c522010-05-19 19:42:32 +0200138 libosmovty.pc
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100139 libosmogsm.pc
Harald Welte641f7ce2012-06-17 23:05:26 +0800140 libosmogb.pc
Harald Welte3cae0392010-02-20 21:09:24 +0100141 include/Makefile
142 src/Makefile
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200143 src/vty/Makefile
Sylvain Munaut1a4ea5b2010-10-08 15:09:16 +0200144 src/codec/Makefile
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100145 src/gsm/Makefile
Harald Welte641f7ce2012-06-17 23:05:26 +0800146 src/gb/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100147 tests/Makefile
Harald Welteeeb78dd2011-08-02 13:44:54 +0200148 utils/Makefile
Harald Weltec7859ed2011-08-20 12:54:17 +0200149 Doxyfile.core
Harald Welte49e10562011-08-17 19:21:07 +0200150 Doxyfile.gsm
151 Doxyfile.vty
152 Doxyfile.codec
Harald Welte3cae0392010-02-20 21:09:24 +0100153 Makefile)