gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master eaf24d3: Absolute build and source directories


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master eaf24d3: Absolute build and source directories for LDFLAGS and CPPFLAGS
Date: Sun, 13 May 2018 22:21:16 -0400 (EDT)

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

    Absolute build and source directories for LDFLAGS and CPPFLAGS
    
    It was a long time I hadn't ran `make distcheck'. But after doing so, I
    noticed a libtool error, complaining about not finding the `./lib'
    directory while it was building Gnulib (in `bootstrapped/lib'). After some
    digging up in the code, I found the cause of the problem: at the start of
    `configure.ac', we were adding `top_srcdir' and `top_builddir' (which are
    relative paths) to `CPPFLAGS' and `LDFLAGS'. To fix the problem, we are now
    using the absolute Autoconf paths: `abs_top_srcdir' and `abs_top_builddir'.
---
 configure.ac | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index 7b589c2..b9045e7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -98,10 +98,17 @@ AC_SUBST(IN_CPPFLAGS, "$CPPFLAGS")
 
 
 # Generic compiler flags for all sub-directories.
+#
+# IMPORTANT note: we need to add the `./lib/' directory to `LDFLAGS' and
+# `CPPFLAGS', since all Gnuastro needs to use the library headers and link
+# with them. But we need to use the absolute address of `./lib/'. So we
+# need to use the Autoconf variables with an `abs_' prefix. Otherwise (if
+# we use `top_builddir' istead of `abs_top_builddir'), we are going to have
+# problems in special conditions (most specifically: in `make distcheck').
 CFLAGS="-Wall -O3 $CFLAGS"
 CXXFLAGS="-Wall -O3 $CXXFLAGS"
-LDFLAGS="-L\$(top_builddir)/lib $LDFLAGS"
-CPPFLAGS="-I\$(top_srcdir)/lib $CPPFLAGS"
+LDFLAGS="-L\$(abs_top_builddir)/lib $LDFLAGS"
+CPPFLAGS="-I\$(abs_top_srcdir)/lib $CPPFLAGS"
 
 
 



reply via email to

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