Skip to content

Commit

Permalink
configure: force use of -pthread on Solaris
Browse files Browse the repository at this point in the history
This fixes a problem with non-threadsafe errno.

Ideally, this would be the use of the AX_PTHREAD macro, but it is GPL 3+
only, which is incompatible with the GPL 2 license of fish. It also
would need extending to cover C++.

For now, fish doesn't build on anything except GCC under Solaris anyway,
so `-pthread` is the right thing to use.

Work on #3340.
  • Loading branch information
zanchey committed Dec 3, 2016
1 parent ee15f1b commit 2b0bad8
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion configure.ac
Expand Up @@ -110,7 +110,7 @@ AX_CXX_COMPILE_STDCXX_11(noext,mandatory)
# Tell autoconf to create config.h header
#
AC_CONFIG_HEADERS(config.h)
AC_CANONICAL_TARGET
AC_CANONICAL_HOST


#
Expand Down Expand Up @@ -250,6 +250,18 @@ AC_CHECK_FILES([/proc/self/stat])
AC_DEFINE([NCURSES_NOMACROS], [1], [Define to 1 to disable ncurses macros that conflict with the STL])
AC_DEFINE([NOMACROS], [1], [Define to 1 to disable curses macros that conflict with the STL])

# Threading is excitingly broken on Solaris without adding -pthread to CXXFLAGS
# Only support GCC for now
dnl Ideally we would use the AX_PTHREAD macro here, but it's GPL3-licensed
dnl ACX_PTHREAD is way too old and seems to break the OS X build
dnl Both only check with AC_LANG(C) in any case
case $host_os in
solaris*)
CXXFLAGS="$CXXFLAGS -pthread"
CFLAGS="$CFLAGS -pthread"
;;
esac

#
# Check presense of various libraries. This is done on a per-binary
# level, since including various extra libraries in all binaries only
Expand Down

0 comments on commit 2b0bad8

Please sign in to comment.