diff options
author | Werner Koch <[email protected]> | 2014-01-09 18:14:09 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2014-01-24 18:49:45 +0000 |
commit | 2e4c5963119dc02cac7b8f0dfb46572c43d1ebe7 (patch) | |
tree | 279dc41008885a514f86ade2a2d0e8d1169aaadb | |
parent | Make multi-threading flags available via gpg-error-config. (diff) | |
download | libgpg-error-2e4c5963119dc02cac7b8f0dfb46572c43d1ebe7.tar.gz libgpg-error-2e4c5963119dc02cac7b8f0dfb46572c43d1ebe7.zip |
Do not use the threadlib macros for Windows.
* configure.ac: Move platform detection before gl_THREADLIB_EARLY. Do
not use gl_THREADLIB for Windows.
Signed-off-by: Werner Koch <[email protected]>
Diffstat (limited to '')
-rw-r--r-- | configure.ac | 72 |
1 files changed, 45 insertions, 27 deletions
diff --git a/configure.ac b/configure.ac index e3fa795..77f235f 100644 --- a/configure.ac +++ b/configure.ac @@ -85,28 +85,6 @@ AC_PROG_AWK AC_CHECK_TOOL(AR, ar, :) AC_GNU_SOURCE -gl_THREADLIB_EARLY - - -LT_PREREQ([2.2.6]) -LT_INIT([win32-dll disable-static]) -LT_LANG([Windows Resource]) - - -# We need to compile and run a program on the build machine. -dnl The AC_PROG_CC_FOR_BUILD macro in the AC archive is broken for -dnl autoconf 2.57. -dnl AC_PROG_CC_FOR_BUILD -AC_MSG_CHECKING(for cc for build) -if test "$cross_compiling" = "yes"; then - CC_FOR_BUILD="${CC_FOR_BUILD-cc}" -else - CC_FOR_BUILD="${CC_FOR_BUILD-$CC}" -fi -AC_MSG_RESULT($CC_FOR_BUILD) -AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler]) - - # Set some internal variables depending on the platform for later use. have_w32_system=no have_w64_system=no @@ -128,6 +106,30 @@ case "${host}" in esac +if test "$have_w32_system" != yes; then + gl_THREADLIB_EARLY +fi + + +LT_PREREQ([2.2.6]) +LT_INIT([win32-dll disable-static]) +LT_LANG([Windows Resource]) + + +# We need to compile and run a program on the build machine. +dnl The AC_PROG_CC_FOR_BUILD macro in the AC archive is broken for +dnl autoconf 2.57. +dnl AC_PROG_CC_FOR_BUILD +AC_MSG_CHECKING(for cc for build) +if test "$cross_compiling" = "yes"; then + CC_FOR_BUILD="${CC_FOR_BUILD-cc}" +else + CC_FOR_BUILD="${CC_FOR_BUILD-$CC}" +fi +AC_MSG_RESULT($CC_FOR_BUILD) +AC_ARG_VAR(CC_FOR_BUILD,[build system C compiler]) + + AH_BOTTOM([ /* Force using of NLS for W32 even if no libintl has been found. This is okay because we have our own gettext implementation for W32. */ @@ -166,11 +168,27 @@ AC_CHECK_FUNCS([flockfile]) AC_C_CONST -# Check for thread library -gl_LOCK -if test "$gl_threads_api" = posix; then - AC_CHECK_SIZEOF(pthread_mutex_t,,[AC_INCLUDES_DEFAULT - #include <pthread.h>]) +# Check for thread library. +# +# Windows has always thread support; thus we don't bother to test for +# it as it may lead to false results when cross building. +if test "$have_w32_system" = yes; then + AC_DEFINE([USE_WINDOWS_THREADS], [1]) + LIBTHREAD= + LTLIBTHREAD= + LIBMULTITHREAD= + LTLIBMULTITHREAD= + THREADLIB_CPPFLAGS="" + AC_SUBST([LIBTHREAD]) + AC_SUBST([LTLIBTHREAD]) + AC_SUBST([LIBMULTITHREAD]) + AC_SUBST([LTLIBMULTITHREAD]) +else + gl_LOCK + if test "$gl_threads_api" = posix; then + AC_CHECK_SIZEOF(pthread_mutex_t,,[AC_INCLUDES_DEFAULT + #include <pthread.h>]) + fi fi |