gnuastro-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnuastro-commits] master 182f397 11/14: No -pthread flag in LDFLAGS


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 182f397 11/14: No -pthread flag in LDFLAGS
Date: Sun, 17 Dec 2017 11:31:19 -0500 (EST)

branch: master
commit 182f397362ab927cd73970ea5f696ef40db9171c
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>

    No -pthread flag in LDFLAGS
    
    When calling the `AX_PTHREAD' macro in `configure.ac', we were adding
    `PTHREAD_CFLAGS' to `LDFLAGS'. This was extra, because the `-pthread' flag
    is both for the C compiler (to tell it to prepare for multiple threads) and
    the linker. Now, when Gnuastro creates the library, it only calls
    `-pthread' twice (instead of three times before). I am still trying to find
    where the extra `-pthread' comes from!
---
 configure.ac | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index c1e01f0..5175b71 100644
--- a/configure.ac
+++ b/configure.ac
@@ -96,11 +96,11 @@ CPPFLAGS="-I\$(top_srcdir)/lib $CPPFLAGS"
 
 
 # Check for pthreads and add the appropriate compilation flags. AX_PTHREAD
-# comes from the GNU Autoconf Archive's ax_pthread.m4.
+# comes from the GNU Autoconf Archive's ax_pthread.m4, see there for the
+# documentation. Note that
 AX_PTHREAD([],[AC_MSG_ERROR([AC_PACKAGE_NAME Needs POSIX Threads (pthread)])])
-CLIBS="$PTHREAD_LIBS $LIBS"
 CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
-LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS"
+LIBS="$PTHREAD_LIBS $LIBS"
 CC="$PTHREAD_CC"
 
 
@@ -225,12 +225,15 @@ AC_SEARCH_LIBS([wcspih], [wcs], [],
 # These are secondary tests for more fine-grained control in libraries that
 # have already been checked. We don't need to add them to the LIBS
 # variable, so we are using AC_CHECK_LIB for these tests.
+
+# If the WCS library has the `wcslib_version' function.
 AC_CHECK_LIB([wcs], [wcslib_version], [has_wcslib_version=1],
              [has_wcslib_version=0], [-lcfitsio -lm])
 AC_DEFINE_UNQUOTED([GAL_CONFIG_HAVE_WCSLIB_VERSION], [$has_wcslib_version],
                    [WCSLIB comes with wcslib_version])
 AC_SUBST(HAVE_WCSLIB_VERSION, [$has_wcslib_version])
 
+# If the pthreads library has `pthread_barrier_wait'.
 AC_CHECK_LIB([pthread], [pthread_barrier_wait], [has_pthread_barrier=1],
              [has_pthread_barrier=0])
 AC_DEFINE_UNQUOTED([GAL_CONFIG_HAVE_PTHREAD_BARRIER], [$has_pthread_barrier],



reply via email to

[Prev in Thread] Current Thread [Next in Thread]