diff options
| author | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2019-11-18 18:31:18 +0000 |
|---|---|---|
| committer | Mohammad Akhlaghi <mohammad@akhlaghi.org> | 2019-11-18 18:42:09 +0000 |
| commit | a0344ca20da1a16570c492c8f91a61c0ac841514 (patch) | |
| tree | 00900018a61844e631b0c065cd0d36474bb5bc66 | |
| parent | c4174b2119d4aa6a429a33a8b0caba1f8ee06b68 (diff) | |
| download | gnuastro-a0344ca2.tar.gz | |
BuildProgram: CPPFLAGS and LDFLAGS passed to libtool after own options
Since the first implementation of BuildProgram reading CPPFLAGS and LDFLAGS
(in commit `1d4043f333ef'), they were being passed onto libtool with higher
precedence than BuildPrograms own options. This could cause problems during
`make check' when an older version of Gnuastro exists, and the old
installation's `--includepath' is in CPPFLAGS (as it should be!).
With this commit, the values given to CPPFLAGS and LDFLAGS are passed to
libtool after the values given to BuildProgram's `--includedir' and
`--linkdir'. In this way, if they are indeed unique, they will be used, but
they won't cause unnecessary conflicts like the scenario above.
This bug was reported by Takashi Ichikawa.
| -rw-r--r-- | bin/buildprog/buildprog.c | 4 | ||||
| -rw-r--r-- | doc/announce-acknowledge.txt | 1 | ||||
| -rw-r--r-- | doc/gnuastro.texi | 5 | ||||
| -rwxr-xr-x | tests/buildprog/simpleio.sh | 5 |
4 files changed, 12 insertions, 3 deletions
diff --git a/bin/buildprog/buildprog.c b/bin/buildprog/buildprog.c index 8a67871..32cba7d 100644 --- a/bin/buildprog/buildprog.c +++ b/bin/buildprog/buildprog.c @@ -122,10 +122,10 @@ buildprog(struct buildprogparams *p) warning ? warning : "", p->debug ? "-g" : "", optimize ? optimize : "", - cppflags ? cppflags : "", include ? include : "", - ldflags ? ldflags : "", + cppflags ? cppflags : "", linkdir ? linkdir : "", + ldflags ? ldflags : "", p->sourceargs->v, linklib ?linklib : "", INCLUDEDIR, diff --git a/doc/announce-acknowledge.txt b/doc/announce-acknowledge.txt index abb66d4..f16c9ac 100644 --- a/doc/announce-acknowledge.txt +++ b/doc/announce-acknowledge.txt @@ -3,6 +3,7 @@ Alphabetically ordered list to acknowledge in the next release. Hamed Altafi Stefan Brüns Alexey Dokuchaev +Takashi Ichikawa Raúl Infante Sainz Sebastián Luna Valero Joseph Putko diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi index 59ee77f..fb3cd32 100644 --- a/doc/gnuastro.texi +++ b/doc/gnuastro.texi @@ -17943,8 +17943,11 @@ You may also use Gnuastro's @ref{Configuration files} to specify other libraries The C compiler can be chosen with the @option{--cc} option, or environment variables, please see the description of @option{--cc} for more. The two common @code{LDFLAGS} and @code{CPPFLAGS} environment variables are also checked and used in the build by default. +Note that they are placed after the values to the corresponding options @option{--includedir} and @option{--linkdir}. +Therefore BuildProgram's own options take precedence. Using environment variables can be disabled with the @option{--noenv} option. -Just note that BuildProgram also keeps the important flags in these environment variables in its configuration file, so in many cases, when you needed them to build Gnuastro, you won't need them in BuildProgram. +Just note that BuildProgram also keeps the important flags in these environment variables in its configuration file. +Therefore, in many cases, even though you may needed them to build Gnuastro, you won't need them in BuildProgram. The first argument is considered to be the C source file that must be compiled and linked. Any other arguments (non-option tokens on the command-line) will be passed onto the program when BuildProgram wants to run it. diff --git a/tests/buildprog/simpleio.sh b/tests/buildprog/simpleio.sh index e9fa953..d171abd 100755 --- a/tests/buildprog/simpleio.sh +++ b/tests/buildprog/simpleio.sh @@ -62,5 +62,10 @@ if [ ! -f $source ]; then echo "$source does not exist."; exit 77; fi # `check_with_program' can be something like `Valgrind' or an empty # string. Such programs will execute the command if present and help in # debugging when the developer doesn't have access to the user's system. +echo "Test Environment" +echo "----------------" +echo "CPPFLAGS: $CPPFLAGS" +echo "LDFLAGS: $LDFLAGS" +echo "----------------" $check_with_program $execname $source $img 1 --la=../lib/libgnuastro.la \ -I$topsrc/lib -I../lib/ |
