[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master ec1d7f7 1/3: BuildProgram's libtool invocation
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master ec1d7f7 1/3: BuildProgram's libtool invocation with include-dir |
Date: |
Mon, 2 Oct 2017 16:15:46 -0400 (EDT) |
branch: master
commit ec1d7f74e126590d6b3ffcbafdd2f215dfc0d5b6
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
BuildProgram's libtool invocation with include-dir
The libtool `.la' file keeps all the information about linking, but not the
headers to parse. So for example, if an old Gnuastro was installed in a
system-wide directory, but a user installs a more recent version of
Gnuastro in their `~/.local' directory (and the functions don't match),
then the headers will be from the old version and the linked libraries will
be from the new version.
With this commit an `-I INCLUDEDIR' is added to the libtool invocation so
if the user doesn't give any other directory, by default it looks into the
header files of the same version as the linked libraries.
---
bin/buildprog/Makefile.am | 4 ++--
bin/buildprog/buildprog.c | 3 ++-
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/bin/buildprog/Makefile.am b/bin/buildprog/Makefile.am
index e20c19f..89e480e 100644
--- a/bin/buildprog/Makefile.am
+++ b/bin/buildprog/Makefile.am
@@ -25,8 +25,8 @@
## 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_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib \
- -DLIBDIR=\"$(libdir)\" -DEXEEXT=\"$(EXEEXT)\"
+AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -DLIBDIR=\"$(libdir)\" \
+ -DINCLUDEDIR=\"$(includedir)\" -DEXEEXT=\"$(EXEEXT)\"
diff --git a/bin/buildprog/buildprog.c b/bin/buildprog/buildprog.c
index 155ec10..16e4a8c 100644
--- a/bin/buildprog/buildprog.c
+++ b/bin/buildprog/buildprog.c
@@ -90,7 +90,7 @@ buildprog(struct buildprogparams *p)
/* Put the command to run into a string. */
asprintf(&command, "libtool %s --mode=link gcc %s %s %s %s %s %s %s "
- "%s/libgnuastro.la -o %s",
+ "-I%s %s/libgnuastro.la -o %s",
p->cp.quiet ? "--quiet" : "",
warning ? warning : "",
p->debug ? "-g" : "",
@@ -99,6 +99,7 @@ buildprog(struct buildprogparams *p)
linkdir ? linkdir : "",
p->sourceargs->v,
linklib ?linklib : "",
+ INCLUDEDIR,
LIBDIR,
p->cp.output);