[Top][All Lists]

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

[gnuastro-commits] master 0a4f344: Checks for libtool in system added at

From: Mohammad Akhlaghi
Subject: [gnuastro-commits] master 0a4f344: Checks for libtool in system added at configure time
Date: Mon, 2 Oct 2017 10:40:42 -0400 (EDT)

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

    Checks for libtool in system added at configure time
    The Gnuastro tarball ships with its own version of GNU Libtool (from
    Gnulib) that is used for compiling and building the programs. So within the
    build environment, libtool is recognized. However, if the user doesn't have
    libtool, they will not be alerted and later when they want to use
    BuildProgram, they will be confronted with an error and get confused: why
    did `make check' pass, but I can't use it?
    So now, at configure time, we check if the libtool executable is available
    within the search path. If it isn't a warning will be printed and the `make
    check' BuildProgram test will get skipped. However, if the user later
    installs Libtool, they can use BuildProgram.
---                 |  2 +-                | 19 ++++++++++++++++++-
 doc/gnuastro.texi           | 17 +++++++++++++++++
 tests/           |  4 ++++
 tests/buildprog/ |  7 ++++++-
 5 files changed, 46 insertions(+), 3 deletions(-)

diff --git a/ b/
index 8555c23..2d2308d 100644
--- a/
+++ b/
@@ -190,7 +190,7 @@ check-local:
"==================================================================="; \
"==================================================================="; \
         echo "Your build of Gnuastro $(VERSION) didn't fail on any tests.";    
-        echo "To install Gnuastro, please run the commands below:";            
+        echo "To install Gnuastro, please run the command(s) below:";          
         if [ ! -w $(prefix) ] ; then                                           
          echo "(NOTE: As the user $$USER, you don't have writing permissions"; 
diff --git a/ b/
index 73d8679..030cf73 100644
--- a/
+++ b/
@@ -226,6 +226,15 @@ AC_SUBST(HAVE_LIBGIT2, [$has_libgit2])
+# Check libtool: need by BuildProgram.
+AC_CHECK_PROG(has_libtool, libtool, [yes], [no])
+AS_IF([test "x$has_libtool" = "xno"], [anywarnings=yes])
+AM_CONDITIONAL([COND_HASLIBTOOL], [test "x$has_libtool" = "xyes"])
 # Check Ghostscript: "-dPDFFitPage" option to Ghostscript, used by
 # ConvertType to convert from EPS to PDF, has been introduced in
 # Ghostscript 9.10.  Make sure we have at least that version.
@@ -715,13 +724,21 @@ AS_IF([test x$enable_guide_message = xyes],
                AS_ECHO(["    output files if Gnuastro's programs were called 
within a Git"])
                AS_ECHO(["    version controlled directory to help in 
                AS_ECHO([]) ])
+        AS_IF([test "x$has_libtool" = "xno"],
+              [AS_ECHO(["  - GNU Libtool, could not be found in your search 
+               AS_ECHO(["    Gnuastro's BuildProgram uses libtool to link your 
source code"])
+               AS_ECHO(["    with the various libraries (Gnuastro's 
dependencies). Note that"])
+               AS_ECHO(["    not having libtool in your search path will not 
harm Gnuastro's"])
+               AS_ECHO(["    building and installation process. This warning 
is only for"])
+               AS_ECHO(["    using BuildProgram after Gnuastro has been built 
and installed."])
+               AS_ECHO([]) ])
         AS_IF([test "x$has_ghostscript" = "xno"],
               [AS_ECHO(["  - GPL GhostScript version 9.10 or later, with the 
                AS_ECHO(["    name \`gs', was not found in your PATH 
environment variable."])
                AS_ECHO(["    If PDF outputs are desired from ConvertType, it 
will abort"])
                AS_ECHO(["    with an EPS output which you can convert to PDF 
by other means."])
                AS_ECHO([]) ])
-        AS_ECHO(["  All checks related to the warning(s) will be skipped."])
+        AS_ECHO(["  All checks related to the warning(s) above will be 
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 52c368e..adb2fac 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -2597,6 +2597,23 @@ take effect.
 @table @asis
address@hidden libtool
address@hidden GNU Libtool
+GNU Libtool is a program to simplify managing of the libraries to build an
+executable (program). It is used by @ref{BuildProgram} in Gnuastro to help
+you easily link to all the necessary libraries that Gnuastro's library
+depends on. Libtool is a low-level program that is probably already present
+on your system (and in your operating system package manager). However, if
+you want to install it's latest version from source, please visit its
address@hidden://, webpage}.
+Gnuastro's tarball ships with Libtool and it is extensively used during its
+building and installing. Therefore, you can easily build Gnuastro even if
+you don't have Libtool installed on your system. However, this internal
+Libtool does not get installed. Hence, if you want to use the installed
+BuildProgram to compile and link your own source code later, you need to
+have Libtool on your system (independent of Gnuastro).
 @item libgit2
 @cindex Git
 @cindex libgit2
diff --git a/tests/ b/tests/
index ea6b095..195ed90 100644
--- a/tests/
+++ b/tests/
@@ -48,6 +48,9 @@ endif
   MAYBE_ARITHMETIC_TESTS = arithmetic/ arithmetic/ \
   arithmetic/ arithmetic/
@@ -185,6 +188,7 @@ AM_TESTS_ENVIRONMENT =                              \
 export mkdir_p="$(MKDIR_P)";                        \
 export topsrc=$(top_srcdir);                        \
 export haslibjpeg=$(MAYBE_HASLIBJPEG);              \
+export haslibtool=$(MAYBE_HASLIBTOOL);              \
 export hasghostscript=$(MAYBE_HASGHOSTSCRIPT);
diff --git a/tests/buildprog/ b/tests/buildprog/
index e45ab26..8eef3ba 100755
--- a/tests/buildprog/
+++ b/tests/buildprog/
@@ -41,10 +41,15 @@ source=$topsrc/tests/$prog/simpleio.c
 #   - The input data was not made (for example the test that created the
 #     data file failed).
+#   - Gnuastro ships with its own version of Libtool for the building of
+#     the libraries and programs. But here, we want to test the user's
+#     libtool (and how it works with BuildProgram). So if libtool wasn't
+#     found at configure time, we need to skip this test.
 if [ ! -f $execname ]; then echo "$execname not created.";  exit 77; fi
 if [ ! -f $img      ]; then echo "$img does not exist.";    exit 77; fi
 if [ ! -f $source   ]; then echo "$source does not exist."; exit 77; fi
+if [ "x$haslibtool" != "xyes" ];then echo "libtool not present.";  exit 77;fi

reply via email to

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