Timur Davydov has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bts/+/42700?usp=email )
Change subject: build: add WebSDR configure option and Emscripten detection ......................................................................
build: add WebSDR configure option and Emscripten detection
Detect Emscripten toolchain and introduce --with-websdr configure option
When enabled, check for libosmo-trx-websdr and required symbol modulateBits, failing configure if missing
Change-Id: Iff4b76e339e2873686c8c15885dd498458ceb546 --- M configure.ac 1 file changed, 37 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/00/42700/1
diff --git a/configure.ac b/configure.ac index 8f8e0d9..a3c22c6 100644 --- a/configure.ac +++ b/configure.ac @@ -24,6 +24,18 @@ AC_PROG_INSTALL LT_INIT
+dnl Detect emscripten compiler +case "$CC" in +*emcc*) + emscripten=yes + ;; +*) + emscripten=no + ;; +esac +AM_CONDITIONAL(HAVE_EMSCRIPTEN, test "x$emscripten" = "xyes") +AC_SUBST([HAVE_EMSCRIPTEN], [$emscripten]) + dnl patching ${archive_cmds} to affect generation of file "libtool" to fix linking with clang AS_CASE(["$LD"],[*clang*], [AS_CASE(["${host_os}"], @@ -321,6 +333,31 @@ AM_CONDITIONAL(ENABLE_ORTP, test "x$ENABLE_ORTP" = "xyes") AC_SUBST(ENABLE_ORTP)
+AC_ARG_WITH(websdr, [ + AS_HELP_STRING([--with-websdr], + [enable WebUSB based transceiver]) +]) + +AM_CONDITIONAL(ENABLE_WEBSDR, [test "x$with_websdr" = "xyes"]) + +if test "x$with_websdr" = "xyes"; then + AC_DEFINE(ENABLE_WEBSDR, 1, Define to 1 for enable WebUSB based transceiver) + + PKG_CHECK_MODULES(LIBOSMOTRX, libosmo-trx-websdr >= 1.7.2) + + # Check whether libosmo-trx-websdr provides modulateBits + save_LIBS="$LIBS" + LIBS="$LIBS $LIBOSMOTRX_LIBS" + AC_CHECK_FUNCS([modulateBits]) + + # modulateBits is required — fail configuration if it's missing + if test "x$ac_cv_func_modulateBits" != "xyes"; then + AC_MSG_ERROR([libosmo-trx-websdr does not provide the required function 'modulateBits'. Please rebuild osmo-trx with both --with-burst-lut and --with-websdr enabled.]) + fi + + LIBS="$save_LIBS" +fi + AC_CHECK_HEADER([linux/if_packet.h], [linux_if_packet_header="yes"], []) if test "x$linux_if_packet_header" = "xyes" ; then AC_DEFINE(HAVE_LINUX_IF_PACKET_H, 1, [Define if we found linux/if_packet.h])