[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master ab5d9ea 1/3: BuildProgram now accepts libtool'
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master ab5d9ea 1/3: BuildProgram now accepts libtool's --tag option |
Date: |
Mon, 20 Nov 2017 05:28:59 -0500 (EST) |
branch: master
commit ab5d9eaa93ab943f70c014b86527312709fe6ac9
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
BuildProgram now accepts libtool's --tag option
Raúl Infante Sainz reported that the test for BuildProgram failed on his
system with an error of "link: unable to infer tagged configuration, error:
specify a tag with '--tag'". Libtool uses the `--tag' option when it can't
infer the language automatically.
With this commit this issue is fixed with a new `--tag' option to
BuildProgram. It will be directly passed onto Libtool and is set to `CC'
(for the C programming language), by default.
I also noticed that BuildProgram's configuration file wasn't being
copied/used during `make check'. This is also now corrected.
---
bin/buildprog/args.h | 14 ++++++++++++++
bin/buildprog/astbuildprog.conf | 3 ++-
bin/buildprog/buildprog.c | 7 +++++--
bin/buildprog/main.h | 1 +
bin/buildprog/ui.h | 1 +
doc/gnuastro.texi | 10 ++++++++++
tests/prepconf.sh | 5 ++---
7 files changed, 35 insertions(+), 6 deletions(-)
diff --git a/bin/buildprog/args.h b/bin/buildprog/args.h
index a64911d..4961c87 100644
--- a/bin/buildprog/args.h
+++ b/bin/buildprog/args.h
@@ -87,6 +87,20 @@ struct argp_option program_options[] =
GAL_OPTIONS_NOT_SET
},
+ {
+ "tag",
+ UI_KEY_TAG,
+ "STR",
+ 0,
+ "Libtool `--tag': programming language.",
+ GAL_OPTIONS_GROUP_INPUT,
+ &p->tag,
+ GAL_TYPE_STRING,
+ GAL_OPTIONS_RANGE_ANY,
+ GAL_OPTIONS_NOT_MANDATORY,
+ GAL_OPTIONS_NOT_SET
+ },
+
diff --git a/bin/buildprog/astbuildprog.conf b/bin/buildprog/astbuildprog.conf
index 253158a..8eb1386 100644
--- a/bin/buildprog/astbuildprog.conf
+++ b/bin/buildprog/astbuildprog.conf
@@ -20,4 +20,5 @@
# Output
optimize 3
- warning all
\ No newline at end of file
+ warning all
+ tag CC
diff --git a/bin/buildprog/buildprog.c b/bin/buildprog/buildprog.c
index a0fc85c..aff4585 100644
--- a/bin/buildprog/buildprog.c
+++ b/bin/buildprog/buildprog.c
@@ -96,9 +96,12 @@ buildprog(struct buildprogparams *p)
else asprintf(&fullla, "%s/libgnuastro.la", LIBDIR);
/* Put the command to run into a string. */
- asprintf(&command, "%s %s --mode=link gcc %s %s %s %s %s %s %s "
- "-I%s %s -o %s", GAL_CONFIG_GNULIBTOOL_EXEC,
+ asprintf(&command, "%s %s %s%s --mode=link gcc %s %s %s %s %s %s %s "
+ "-I%s %s -o %s",
+ GAL_CONFIG_GNULIBTOOL_EXEC,
p->cp.quiet ? "--quiet" : "",
+ p->tag ? "--tag=" : "",
+ p->tag ? p->tag : "",
warning ? warning : "",
p->debug ? "-g" : "",
optimize ? optimize : "",
diff --git a/bin/buildprog/main.h b/bin/buildprog/main.h
index b519f30..4a1f8ff 100644
--- a/bin/buildprog/main.h
+++ b/bin/buildprog/main.h
@@ -50,6 +50,7 @@ struct buildprogparams
gal_list_str_t *linklib; /* Libraries to link against. */
char *la; /* Libtool `.la' instead of default. */
+ char *tag; /* Libtool tag (programming language).*/
char *optimize; /* Optimization level. */
char *debug; /* Keep debugging information. */
char *warning; /* Compiler warnings. */
diff --git a/bin/buildprog/ui.h b/bin/buildprog/ui.h
index f937df5..bd3b295 100644
--- a/bin/buildprog/ui.h
+++ b/bin/buildprog/ui.h
@@ -50,6 +50,7 @@ enum option_keys_enum
/* Only with long version (start with a value 1000, the rest will be set
automatically). */
UI_KEY_DETELECOMPILED = 1000,
+ UI_KEY_TAG,
};
diff --git a/doc/gnuastro.texi b/doc/gnuastro.texi
index 9976c83..73e91b7 100644
--- a/doc/gnuastro.texi
+++ b/doc/gnuastro.texi
@@ -18133,6 +18133,16 @@ list. Some of the most common values to this option
are: @option{pedantic}
(Warnings related to standard C) and @option{all} (all issues the compiler
confronts).
address@hidden --tag=STR
+The language configuration information. Libtool can build objects and
+libraries in many languages. In many cases, it can identify the language
+automatically, but when it doesn't you can use this option to explicitly
+notify Libtool of the language. The acceptable values are: @code{CC} for C,
address@hidden for C++, @code{GCJ} for Java, @code{F77} for Fortran 77,
address@hidden for Fortran, @code{GO} for Go and @code{RC} for Windows
+Resource. Note that the Gnuastro library is not yet fully compatible with
+all these languages.
+
@item -b
@itemx --onlybuild
Only build the program, don't run it. By default, the built program is
diff --git a/tests/prepconf.sh b/tests/prepconf.sh
index 0c9bafb..0e2a998 100755
--- a/tests/prepconf.sh
+++ b/tests/prepconf.sh
@@ -69,9 +69,8 @@ rm addedoptions.txt
#
# Each utility's configuration file is copied in the `tests' directory for
# easy readability.
-for prog in arithmetic convertt convolve cosmiccal crop fits \
- mkcatalog mknoise mkprof noisechisel statistics \
- table warp
+for prog in arithmetic buildprog convertt convolve cosmiccal crop fits \
+ mkcatalog mknoise mkprof noisechisel statistics table warp
do
cp $topsrc/bin/$prog/ast$prog.conf .gnuastro/ast$prog.conf
done