[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master f0a4d1e 01/14: In configure, current directory
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master f0a4d1e 01/14: In configure, current directory removed from PATH |
Date: |
Sun, 17 Dec 2017 11:31:17 -0500 (EST) |
branch: master
commit f0a4d1eec72ae85bf8d4f985864df8e706a18956
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
In configure, current directory removed from PATH
This is a followup of commit eaade0ba09b26fd: "Check for libtool rejects
Gnuastro's own libtool implementation". There, I had used the last argument
to AC_CHECK_PROG incorrectly. So following a similar issue that was
reported by Nicolas Bouché, I am trying to solve the problem more
elegantly.
The main problem is that the PATH variable on some systems might contain
the current directory in the form of `./' or `.'. In such cases, if
Gnuastro's Libtool is already built, it will be found as `.//libtool' or
`./libtool' respectively.
With this commit, a more fundamental fix to the problem is implemented: to
correct `PATH' (only for the configure script) so it doesn't look into the
current directory for any program.
---
configure.ac | 24 +++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index 455d9eb..f59d04a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -60,6 +60,22 @@ AC_SUBST(GAL_LT_VERSION)
+# Remove any occurance of `./' or `.' in PATH. The main problem is the
+# `libtool' executable which Gnuastro builds internally in the top build
+# directory. However, we also need to know if the system has libtool or
+# not.
+#
+# The first expression will remove occurance of `./' or `.'. If they are in
+# the middle of the path, then their removal will result in `::' (or
+# possibly more if they are immedately after each other). The second
+# expression will change `::' to `:'. If the removed paths are in the start
+# or end of the string, then an extra `:' will be present. So the third and
+# fourth expressions respectively remove them.
+PATH=$(AS_ECHO([$PATH]) | sed -e 's/\.\/*//g' -e 's/::*/:/g' -e 's/^://' -e
's/:$//')
+
+
+
+
# By default we assume no warnings
anywarnings=no
@@ -253,9 +269,11 @@ AC_SUBST(HAVE_LIBGIT2, [$has_libgit2])
-# Check the libtool executable: needed by BuildProgram.
-AC_CHECK_PROG(has_libtool, libtool, [yes], [no], ,
- ./libtool .//libtool $ac_pwd/libtool)
+# Check the libtool executable on the system. Note that Gnuastro also ships
+# with a version of Libtool. We don't want Gnuastro's Libtool, here we want
+# to see if the system has libtool independent of Gnuastro so BuildProgram
+# can use it later.
+AC_CHECK_PROG(has_libtool, libtool, [yes], [no])
# If Libtool is present, make sure it is GNU Libtool
AS_IF([test "x$has_libtool" = "xyes"],
- [gnuastro-commits] master updated (589ca52 -> 0487ba5), Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master c46e36d 03/14: Minor corrections in webpage script, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master 0bbdf6d 05/14: Minor corrections to optional dependencies, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master 74dd74f 08/14: Match program's man page is built, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master c6a96b2 07/14: In citation, primarily was changed to initially, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master 0487ba5 14/14: Initializing delta and dist arrays in match library, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master 2631def 10/14: Minor edits in book's configuration options and intro, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master d7a7c37 12/14: Minor edits in book, acknowledgements updated, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master c448b38 04/14: Better explanation on GNU Libtool in book, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master f0a4d1e 01/14: In configure, current directory removed from PATH,
Mohammad Akhlaghi <=
- [gnuastro-commits] master 104b657 06/14: Configuration warning if PATH includes current directory, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master 481b53a 13/14: -Qunused-arguments now dealt with in CXXFLAGS, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master 182f397 11/14: No -pthread flag in LDFLAGS, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master e9842b5 02/14: Webpage translations now fully incorporated, Mohammad Akhlaghi, 2017/12/17
- [gnuastro-commits] master eef4e80 09/14: Arithmetic's binary operators don't need compiled types, Mohammad Akhlaghi, 2017/12/17