gnuastro-commits
[Top][All Lists]
Advanced

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

[gnuastro-commits] master 2b009b8: Build: CPPFLAGS now includes built bo


From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 2b009b8: Build: CPPFLAGS now includes built bootstrap directory
Date: Fri, 27 Nov 2020 23:22:12 -0500 (EST)

branch: master
commit 2b009b8e457e5462037eb1da6255c035bb8e72b0
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>

    Build: CPPFLAGS now includes built bootstrap directory
    
    Until now, in the 'Makefile.am' of each program and the libraries,
    'CPPFLAGS' was only looking into the bootstrapped source directory for
    headers. However, after a recet bootstrap of Gnulib (where 'error.h' and
    'argp.h' depended on 'stdio.h') in my normal test builds (where the source
    and build directories are different) many compiler warnings suddenly popped
    up, saying that ‘_GL_ATTRIBUTE_SPEC_PRINTF_SYSTEM’ is an unrecognized
    format function type.
    
    With the help of Paul Eggert and Bruno Haible from Gnulib, I found out that
    the problem is that Gnulib's 'stdio.h' is actully a built file that is
    customized for the running system. So its not in the source directory and
    the compiler was actually using my OS's 'stdio.h'.
    
    With this commit, to fix the problem, an explicit '-I' is now added to all
    the 'AM_CPPFLAGS' of all the programs and libraries, telling them to first
    look into the built bootstrap directory, then the source directory, and
    finally Gnuastro's own library directory. This fixed all the warnings.
    
    This bug would only happen when the source and build directories were
    different. So it won't affect most users who just build in the source
    directory.
---
 THANKS                       |  1 +
 bin/TEMPLATE/Makefile.am     |  6 ++++--
 bin/arithmetic/Makefile.am   |  6 ++++--
 bin/buildprog/Makefile.am    |  9 ++++++---
 bin/convertt/Makefile.am     |  6 ++++--
 bin/convolve/Makefile.am     |  6 ++++--
 bin/cosmiccal/Makefile.am    |  6 ++++--
 bin/crop/Makefile.am         |  6 ++++--
 bin/fits/Makefile.am         |  6 ++++--
 bin/match/Makefile.am        |  6 ++++--
 bin/mkcatalog/Makefile.am    |  6 ++++--
 bin/mknoise/Makefile.am      |  6 ++++--
 bin/mkprof/Makefile.am       |  6 ++++--
 bin/noisechisel/Makefile.am  |  6 ++++--
 bin/query/Makefile.am        |  6 ++++--
 bin/segment/Makefile.am      |  6 ++++--
 bin/statistics/Makefile.am   |  6 ++++--
 bin/table/Makefile.am        |  6 ++++--
 bin/warp/Makefile.am         |  6 ++++--
 doc/announce-acknowledge.txt |  2 ++
 lib/Makefile.am              | 11 +++++++----
 21 files changed, 84 insertions(+), 41 deletions(-)

diff --git a/THANKS b/THANKS
index 3470df8..7bb6c82 100644
--- a/THANKS
+++ b/THANKS
@@ -40,6 +40,7 @@ support in Gnuastro. The list is ordered alphabetically (by 
family name).
     Alexey Dokuchaev                     danfe@freebsd.org
     Pierre-Alain Duc                     pierre-alain.duc@astro.unistra.fr
     Elham Eftekhari                      elhamea@iac.es
+    Paul Eggert                          eggert@cs.ucla.edu
     Gaspar Galaz                         ggalaz@astro.puc.cl
     Thérèse Godefroy                     godef.th@free.fr
     Madusha Gunawardhana                 gunawardhana@strw.leidenuniv.nl
diff --git a/bin/TEMPLATE/Makefile.am b/bin/TEMPLATE/Makefile.am
index 4fb8dc1..12f4bcb 100644
--- a/bin/TEMPLATE/Makefile.am
+++ b/bin/TEMPLATE/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/arithmetic/Makefile.am b/bin/arithmetic/Makefile.am
index 272c156..9499833 100644
--- a/bin/arithmetic/Makefile.am
+++ b/bin/arithmetic/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/buildprog/Makefile.am b/bin/buildprog/Makefile.am
index 415aabd..d2b3e36 100644
--- a/bin/buildprog/Makefile.am
+++ b/bin/buildprog/Makefile.am
@@ -24,9 +24,12 @@
 ## Buildprog will also need some system-specific information that is
 ## gathered at compile time (for example the library installation directory
 ## (LIBDIR) and the executive file suffix (EXEEXT).
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib \
-              -DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\"      \
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib \
+              -DLIBDIR=\"$(libdir)\" \
+              -DINCLUDEDIR=\"$(includedir)\" \
               -DEXEEXT=\"$(EXEEXT)\"
 
 if COND_NORPATH
diff --git a/bin/convertt/Makefile.am b/bin/convertt/Makefile.am
index 07d41b5..e5c7c35 100644
--- a/bin/convertt/Makefile.am
+++ b/bin/convertt/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/convolve/Makefile.am b/bin/convolve/Makefile.am
index 3095a84..50fb71e 100644
--- a/bin/convolve/Makefile.am
+++ b/bin/convolve/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/cosmiccal/Makefile.am b/bin/cosmiccal/Makefile.am
index a1971bd..5b1a399 100644
--- a/bin/cosmiccal/Makefile.am
+++ b/bin/cosmiccal/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/crop/Makefile.am b/bin/crop/Makefile.am
index e0c5a25..094e508 100644
--- a/bin/crop/Makefile.am
+++ b/bin/crop/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/fits/Makefile.am b/bin/fits/Makefile.am
index ed5d8c6..91ea816 100644
--- a/bin/fits/Makefile.am
+++ b/bin/fits/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/match/Makefile.am b/bin/match/Makefile.am
index 742b392..dcc0654 100644
--- a/bin/match/Makefile.am
+++ b/bin/match/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/mkcatalog/Makefile.am b/bin/mkcatalog/Makefile.am
index 1a88d34..8165b58 100644
--- a/bin/mkcatalog/Makefile.am
+++ b/bin/mkcatalog/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/mknoise/Makefile.am b/bin/mknoise/Makefile.am
index a94905f..5eb271b 100644
--- a/bin/mknoise/Makefile.am
+++ b/bin/mknoise/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/mkprof/Makefile.am b/bin/mkprof/Makefile.am
index 0cc7529..9f519eb 100644
--- a/bin/mkprof/Makefile.am
+++ b/bin/mkprof/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/noisechisel/Makefile.am b/bin/noisechisel/Makefile.am
index 3fd9f16..48433d6 100644
--- a/bin/noisechisel/Makefile.am
+++ b/bin/noisechisel/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/query/Makefile.am b/bin/query/Makefile.am
index 49d88f4..31d5535 100644
--- a/bin/query/Makefile.am
+++ b/bin/query/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/segment/Makefile.am b/bin/segment/Makefile.am
index e5f0953..8184b1f 100644
--- a/bin/segment/Makefile.am
+++ b/bin/segment/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/statistics/Makefile.am b/bin/statistics/Makefile.am
index 8879095..5272d7d 100644
--- a/bin/statistics/Makefile.am
+++ b/bin/statistics/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/table/Makefile.am b/bin/table/Makefile.am
index 504aee0..702dc50 100644
--- a/bin/table/Makefile.am
+++ b/bin/table/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/bin/warp/Makefile.am b/bin/warp/Makefile.am
index ee67376..efc9f4c 100644
--- a/bin/warp/Makefile.am
+++ b/bin/warp/Makefile.am
@@ -20,8 +20,10 @@
 
 
 ## Necessary pre-processer and linker flags.
-AM_LDFLAGS = -L\$(top_builddir)/lib
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+AM_LDFLAGS  = -L\$(top_builddir)/lib
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
+              -I\$(top_srcdir)/lib
 
 if COND_NORPATH
   MAYBE_NORPATH = $(CONFIG_LDADD)
diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt
index a44b4e5..da63076 100644
--- a/doc/announce-acknowledge.txt
+++ b/doc/announce-acknowledge.txt
@@ -1,5 +1,7 @@
 Alphabetically ordered list to acknowledge in the next release.
 
+Paul Eggert
+Bruno Haible
 Martin Kuemmel
 Javier Licandro
 Sebastian Luna Valero
diff --git a/lib/Makefile.am b/lib/Makefile.am
index d67a34b..cd34378 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -24,13 +24,16 @@
 
 ## Necessary flags.
 ##
-##   $(top_srcdir)/bootstrapped/lib: only necessary for the libraries since
-##       the Gnulib functions will be statically linked to the Gnuastro
-##       library so linking to Gnuastro is enough to access them also.
+##   $(top_builddir)/bootstrapped/lib: Gnulib headers that are customized
+##   for the running system.
+##
+##   $(top_srcdir)/bootstrapped/lib: Gnulib headers that are generic (don't
+##   need any customization).
 ##
 ##   SYSCONFIG_DIR: only necessary in 'options.c' to get the system
 ##       installation directory.
-AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib            \
+AM_CPPFLAGS = -I\$(top_builddir)/bootstrapped/lib \
+              -I\$(top_srcdir)/bootstrapped/lib \
               -DSYSCONFIG_DIR=\"$(sysconfdir)\"
 
 



reply via email to

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