Timur Davydov has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-abis/+/41956?usp=email )
Change subject: configure: handle emscripten builds and disable unsupported
features
......................................................................
configure: handle emscripten builds and disable unsupported features
Detect emscripten compiler and adjust default configure options
accordingly. When building with emcc, disable ortp and DAHDI
support by default, as these components are not applicable in
Emscripten environments.
Also ignore generated .wasm artifacts in .gitignore.
No functional change for native builds.
Change-Id: I879e698f2d514cf6e2f7bb33b4d6148f79aea6f6
---
M .gitignore
M configure.ac
2 files changed, 24 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/56/41956/1
diff --git a/.gitignore b/.gitignore
index 30a1cf7..a50ee62 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
*.lo
*.la
*.pc
+*.wasm
aclocal.m4
m4/*.m4
autom4te.cache
diff --git a/configure.ac b/configure.ac
index e38201f..b5f9526 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,18 @@
AC_PROG_INSTALL
LT_INIT([pic-only])
+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}"],
@@ -73,12 +85,21 @@
PKG_CHECK_MODULES(LIBOSMONETIF, libosmo-netif >= 1.7.0)
+ENABLE_ORTP_DEFAULT="yes"
+ENABLE_DAHDI_DEFAULT="yes"
+
+if test "x$emscripten" = "xyes"
+then
+ ENABLE_ORTP_DEFAULT="no"
+ ENABLE_DAHDI_DEFAULT="no"
+fi
+
AC_ARG_ENABLE([ortp], [AS_HELP_STRING([--disable-ortp], [Build without ortp
support])],
[
ENABLE_ORTP=$enableval
],
[
- ENABLE_ORTP="yes"
+ ENABLE_ORTP=$ENABLE_ORTP_DEFAULT
])
AS_IF([test "x$ENABLE_ORTP" = "xyes"], [
PKG_CHECK_MODULES(ORTP, ortp >= 0.22.0)
@@ -90,7 +111,7 @@
AC_ARG_ENABLE([dahdi],
AC_HELP_STRING([--disable-dahdi],
[disable support for DAHID ISDN (E1/T1) cards
[default=yes]]),
- [enable_dahdi="$enableval"], [enable_dahdi="yes"])
+ [enable_dahdi="$enableval"], [enable_dahdi=$ENABLE_DAHDI_DEFAULT])
AM_CONDITIONAL(ENABLE_DAHDI, test "x$enable_dahdi" = "xyes")
if test "x$enable_dahdi" = "xyes"; then
AC_CHECK_HEADERS([dahdi/user.h],[],[AC_MSG_ERROR([DAHDI input driver
enabled but DAHDI not found])])
--
To view, visit https://gerrit.osmocom.org/c/libosmo-abis/+/41956?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Change-Id: I879e698f2d514cf6e2f7bb33b4d6148f79aea6f6
Gerrit-Change-Number: 41956
Gerrit-PatchSet: 1
Gerrit-Owner: Timur Davydov <[email protected]>