Timur Davydov has uploaded this change for review.
configure: disable libsctp by default when building with emscripten
Detect the emscripten compiler and introduce a HAVE_EMSCRIPTEN
conditional.
When building with emscripten, disable libsctp by default, as SCTP is
not supported in that environment. Native builds keep libsctp enabled
by default.
Also ignore generated .wasm artifacts.
Change-Id: I023158cc39989d6fe98080fecb61410aa4e535ab
---
M .gitignore
M configure.ac
2 files changed, 21 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/53/41953/1
diff --git a/.gitignore b/.gitignore
index 3526104..38e35c8 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
*.lo
*.la
*.pc
+*.wasm
aclocal.m4
acinclude.m4
aminclude.am
diff --git a/configure.ac b/configure.ac
index e76f418..4e3d2c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -24,6 +24,18 @@
LT_INIT
AC_PROG_LIBTOOL
+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}"],
@@ -94,8 +106,15 @@
PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 1.12.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.12.0)
+ENABLE_LIBSCTP_DEFAULT="yes"
+
+if test "x$emscripten" = "xyes"
+then
+ ENABLE_LIBSCTP_DEFAULT="no"
+fi
+
AC_ARG_ENABLE([libsctp], [AS_HELP_STRING([--disable-libsctp], [Do not enable socket multiaddr APIs requiring libsctp])],
- [ENABLE_LIBSCTP=$enableval], [ENABLE_LIBSCTP="yes"])
+ [ENABLE_LIBSCTP=$enableval], [ENABLE_LIBSCTP=$ENABLE_LIBSCTP_DEFAULT])
AM_CONDITIONAL(ENABLE_LIBSCTP, test x"$ENABLE_LIBSCTP" = x"yes")
AS_IF([test "x$ENABLE_LIBSCTP" = "xyes"], [
AC_CHECK_HEADERS(netinet/sctp.h,,AC_MSG_ERROR(netinet/sctp.h not found))
To view, visit change 41953. To unsubscribe, or for help writing mail filters, visit settings.