2010-02-18 15:46:36 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script
|
2015-12-31 13:12:40 +00:00
|
|
|
AC_INIT([layer23], [0.0.0])
|
|
|
|
AM_INIT_AUTOMAKE
|
2010-02-18 15:46:36 +00:00
|
|
|
|
2023-01-05 15:19:03 +00:00
|
|
|
CFLAGS="$CFLAGS -std=gnu11"
|
|
|
|
|
2010-02-18 15:46:36 +00:00
|
|
|
dnl kernel style compile messages
|
|
|
|
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
|
|
|
|
|
|
|
dnl checks for programs
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
|
2018-08-11 10:52:00 +00:00
|
|
|
AC_ARG_ENABLE(sanitize,
|
|
|
|
[AS_HELP_STRING([--enable-sanitize], [Compile with address sanitizer enabled], )],
|
|
|
|
[sanitize=$enableval], [sanitize="no"])
|
|
|
|
if test x"$sanitize" = x"yes"
|
|
|
|
then
|
|
|
|
CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
|
|
|
|
CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(werror,
|
|
|
|
[AS_HELP_STRING(
|
|
|
|
[--enable-werror],
|
|
|
|
[Turn all compiler warnings into errors, with exceptions:
|
|
|
|
a) deprecation (allow upstream to mark deprecation without breaking builds);
|
|
|
|
b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds)
|
|
|
|
]
|
|
|
|
)],
|
|
|
|
[werror=$enableval], [werror="no"])
|
|
|
|
if test x"$werror" = x"yes"
|
|
|
|
then
|
|
|
|
WERROR_FLAGS="-Werror"
|
2022-11-05 12:10:55 +00:00
|
|
|
WERROR_FLAGS+=" -Werror=implicit-int -Werror=int-conversion -Werror=old-style-definition"
|
2018-08-11 10:52:00 +00:00
|
|
|
WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
|
|
|
|
WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
|
|
|
|
CFLAGS="$CFLAGS $WERROR_FLAGS"
|
|
|
|
CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
|
|
|
|
fi
|
|
|
|
|
2010-02-20 17:58:12 +00:00
|
|
|
dnl checks for libraries
|
2021-10-16 08:54:45 +00:00
|
|
|
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.5.0)
|
2017-10-29 10:53:17 +00:00
|
|
|
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0)
|
2011-04-26 00:55:30 +00:00
|
|
|
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm)
|
2011-07-28 18:54:42 +00:00
|
|
|
PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec)
|
2022-12-30 11:49:49 +00:00
|
|
|
PKG_CHECK_MODULES(LIBOSMOGPRSRLCMAC, libosmo-gprs-rlcmac)
|
2023-01-17 10:17:08 +00:00
|
|
|
PKG_CHECK_MODULES(LIBOSMOGPRSLLC, libosmo-gprs-llc)
|
|
|
|
PKG_CHECK_MODULES(LIBOSMOGPRSSNDCP, libosmo-gprs-sndcp)
|
2023-03-15 14:25:12 +00:00
|
|
|
PKG_CHECK_MODULES(LIBOSMOGPRSGMM, libosmo-gprs-gmm)
|
2023-03-30 10:37:55 +00:00
|
|
|
PKG_CHECK_MODULES(LIBOSMOGPRSSM, libosmo-gprs-sm)
|
Fix linking with GNU ld 2.22 and libgps
Error:
gcc -Wall -I/home/kevredon/osmocom-bb/src/shared/libosmocore/include -I/home/kevredon/osmocom-bb/src/shared/libosmocore/include -g -O2 -D_HAVE_GPSD -lgps -o cell_log main.o app_cell_log.o cell_log.o geo.o ../common/liblayer23.a /home/kevredon/osmocom-bb/src/shared/libosmocore/build-host/src/.libs/libosmocore.a /home/kevredon/osmocom-bb/src/shared/libosmocore/build-host/src/gsm/.libs/libosmogsm.a /home/kevredon/osmocom-bb/src/shared/libosmocore/build-host/src/codec/.libs/libosmocodec.a -lm
../common/liblayer23.a(gps.o): In function `osmo_gpsd_cb':
/home/kevredon/osmocom-bb/src/host/layer23/src/common/gps.c:79: undefined reference to `gps_waiting'
Fix:
Holger told me to do so (he knows better then me about autoconf)
- set CFLAGS and LIBS for LIBGPS in layer23
- add libgps CFLAGS and LIBS in Makefile.am for common, misc, mobile
I would have done the following (which also works):
-AC_CHECK_LIB(gps, gps_waiting, CFLAGS+=" -D_HAVE_GPSD" LDFLAGS+=" -lgps",,)
+AC_CHECK_LIB(gps, gps_waiting, CFLAGS+=" -D_HAVE_GPSD" LDFLAGS+=" -lgps" LIBS+=" -lgps",,)
2012-09-05 19:45:22 +00:00
|
|
|
AC_CHECK_LIB(gps, gps_waiting, LIBGPS_CFLAGS=" -D_HAVE_GPSD" LIBGPS_LIBS=" -lgps ",,)
|
|
|
|
AC_SUBST([LIBGPS_CFLAGS])
|
|
|
|
AC_SUBST([LIBGPS_LIBS])
|
|
|
|
|
2010-02-20 17:58:12 +00:00
|
|
|
|
2017-11-08 07:32:18 +00:00
|
|
|
dnl optional dependencies
|
2022-11-28 23:05:13 +00:00
|
|
|
AC_ARG_WITH([lua53], [
|
|
|
|
AS_HELP_STRING([--with-lua53],
|
|
|
|
[Enable LUA scripting support @<:@default=check@:>@])
|
|
|
|
])
|
|
|
|
|
2018-08-27 20:47:05 +00:00
|
|
|
AC_ARG_WITH([gapk_io], [
|
|
|
|
AS_HELP_STRING([--with-gapk-io],
|
|
|
|
[Enable GAPK I/O support @<:@default=check@:>@])
|
|
|
|
])
|
|
|
|
|
2022-11-28 23:05:13 +00:00
|
|
|
found_lua53=no
|
|
|
|
AS_IF([test "x$with_lua53" != "xno"], [
|
|
|
|
PKG_CHECK_MODULES(LIBLUA, lua53, [found_lua53=yes], [found_lua53=no])
|
|
|
|
AS_IF([test "x$with_lua53" = "xyes" -a "x$found_lua53" = "xno"], [
|
|
|
|
AC_MSG_ERROR([lua53 support requested but pkg-config is unable to find it])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL([BUILD_LUA], test "x$found_lua53" = "xyes")
|
2017-11-08 07:32:18 +00:00
|
|
|
|
2018-08-27 20:47:05 +00:00
|
|
|
found_gapk=no
|
|
|
|
AS_IF([test "x$with_gapk_io" != "xno"], [
|
|
|
|
PKG_CHECK_MODULES(LIBOSMOGAPK, libosmogapk, [found_gapk=yes], [found_gapk=no])
|
|
|
|
AS_IF([test "x$with_gapk_io" = "xyes" -a "x$found_gapk" = "xno"], [
|
|
|
|
AC_MSG_ERROR([GAPK I/O support requested but pkg-config is unable to find it])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
AM_CONDITIONAL([BUILD_GAPK], test "x$found_gapk" = "xyes")
|
|
|
|
|
2010-02-18 15:46:36 +00:00
|
|
|
dnl checks for header files
|
|
|
|
AC_HEADER_STDC
|
|
|
|
|
|
|
|
dnl Checks for typedefs, structures and compiler characteristics
|
|
|
|
|
2022-11-05 12:10:02 +00:00
|
|
|
AC_MSG_RESULT([CFLAGS="$CFLAGS"])
|
|
|
|
AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
|
|
|
|
|
2023-01-16 17:02:31 +00:00
|
|
|
dnl Generate the output
|
|
|
|
AM_CONFIG_HEADER(config.h)
|
|
|
|
|
2010-02-18 15:46:36 +00:00
|
|
|
AC_OUTPUT(
|
|
|
|
src/Makefile
|
2010-07-24 22:25:50 +00:00
|
|
|
src/common/Makefile
|
|
|
|
src/misc/Makefile
|
|
|
|
src/mobile/Makefile
|
2022-11-21 15:45:57 +00:00
|
|
|
src/modem/Makefile
|
2010-02-18 15:46:36 +00:00
|
|
|
include/Makefile
|
|
|
|
include/osmocom/Makefile
|
2010-07-27 18:44:46 +00:00
|
|
|
include/osmocom/bb/Makefile
|
|
|
|
include/osmocom/bb/common/Makefile
|
|
|
|
include/osmocom/bb/misc/Makefile
|
|
|
|
include/osmocom/bb/mobile/Makefile
|
2022-11-21 15:45:57 +00:00
|
|
|
include/osmocom/bb/modem/Makefile
|
2010-02-18 15:46:36 +00:00
|
|
|
Makefile)
|