aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMihai Moldovan <ionic@ionic.de>2017-10-27 14:14:24 +0200
committerMihai Moldovan <ionic@ionic.de>2017-10-27 14:14:27 +0200
commit1c6c9c04b56656d9ab3f486738a4950e71f29b74 (patch)
tree7d702837897fe07c82d64db1c02ce7be5bca00bf
parent22bb128dc47b50dfd7b38d9a18188eb0b314ec4d (diff)
downloadnx-libs-1c6c9c04b56656d9ab3f486738a4950e71f29b74.tar.gz
nx-libs-1c6c9c04b56656d9ab3f486738a4950e71f29b74.tar.bz2
nx-libs-1c6c9c04b56656d9ab3f486738a4950e71f29b74.zip
nxproxy: use ax_pthread.m4.
Works around libtool bug related to using both -nostdlib and -pthread (with the former dropping latter usage.)
-rw-r--r--nxproxy/configure.ac11
l---------nxproxy/m4/ax_pthread.m41
-rw-r--r--nxproxy/src/Makefile.am6
3 files changed, 18 insertions, 0 deletions
diff --git a/nxproxy/configure.ac b/nxproxy/configure.ac
index cc8e898fc..b381862c0 100644
--- a/nxproxy/configure.ac
+++ b/nxproxy/configure.ac
@@ -23,6 +23,17 @@ AC_LANG([C])
NX_COMPILER_BRAND
NX_DEFAULT_OPTIONS
+dnl This is a workaround for a nasty libtool bug.
+dnl We actually compile libXcomp with pthread support, but libtool uses g++ ... -nostdlib ... -pthread
+dnl on Linux. -nostdlib causes -pthread to be ignored.
+dnl According to GCC upstream, this is not a bug: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=25460
+dnl GCC upstream insists that libtool needs to handle -pthread in a special way when using -nostdlib.
+dnl A patch has been submitted to the libtool project: http://lists.gnu.org/archive/html/libtool-patches/2013-11/msg00015.html
+dnl but never applied to the code base. Boo.
+dnl We will work around this bug by using AX_PTHREAD and linking with pthread support in all consumers of
+dnl libXcomp for now.
+AX_PTHREAD([], AC_MSG_ERROR([no POSIX threads support detected]))
+
AC_ARG_ENABLE([cxx11],
[AS_HELP_STRING([--enable-cxx11],
[enable optional features requiring C++11 support (disabled by default)])],
diff --git a/nxproxy/m4/ax_pthread.m4 b/nxproxy/m4/ax_pthread.m4
new file mode 120000
index 000000000..156af3df3
--- /dev/null
+++ b/nxproxy/m4/ax_pthread.m4
@@ -0,0 +1 @@
+../../m4/ax_pthread.m4 \ No newline at end of file
diff --git a/nxproxy/src/Makefile.am b/nxproxy/src/Makefile.am
index c09febcf6..7e55900d3 100644
--- a/nxproxy/src/Makefile.am
+++ b/nxproxy/src/Makefile.am
@@ -9,11 +9,17 @@ nxproxy_SOURCES = \
$(NULL)
nxproxy_LDADD = \
+ @PTHREAD_LIBS@ \
-L$(top_srcdir)/../nxcomp/src/.libs -lXcomp \
$(NULL)
+nxproxy_LDFLAGS = \
+ $(PTHREAD_LDFLAGS) \
+ $(NULL)
+
nxproxy_CFLAGS = \
$(BASE_CFLAGS) \
+ $(PTHREAD_CFLAGS) \
$(NULL)
AM_CPPFLAGS = \