[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master 100fcff 1/2: Installation: proper linking of p
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master 100fcff 1/2: Installation: proper linking of programs with --disable-rpath |
Date: |
Fri, 2 Aug 2019 21:09:35 -0400 (EDT) |
branch: master
commit 100fcffdf74dccb31c93db2b45c65ddc9df5df76
Author: Mohammad Akhlaghi <address@hidden>
Commit: Mohammad Akhlaghi <address@hidden>
Installation: proper linking of programs with --disable-rpath
While packaging Gnuastro for Debian, I noticed that it is not linking with
libraries because Debian's package manager disables RPATH.
With this commit, when `--disable-rpath' is given, we manually add the
LDFLAGS to the programs.
---
bin/TEMPLATE/Makefile.am | 6 +++++-
bin/arithmetic/Makefile.am | 7 ++++++-
bin/buildprog/Makefile.am | 6 +++++-
bin/convertt/Makefile.am | 6 +++++-
bin/convolve/Makefile.am | 6 +++++-
bin/cosmiccal/Makefile.am | 6 +++++-
bin/crop/Makefile.am | 6 +++++-
bin/fits/Makefile.am | 6 +++++-
bin/match/Makefile.am | 6 +++++-
bin/mkcatalog/Makefile.am | 6 +++++-
bin/mknoise/Makefile.am | 6 +++++-
bin/mkprof/Makefile.am | 6 +++++-
bin/noisechisel/Makefile.am | 6 +++++-
bin/segment/Makefile.am | 6 +++++-
bin/statistics/Makefile.am | 6 +++++-
bin/table/Makefile.am | 6 +++++-
bin/warp/Makefile.am | 6 +++++-
configure.ac | 1 +
18 files changed, 87 insertions(+), 17 deletions(-)
diff --git a/bin/TEMPLATE/Makefile.am b/bin/TEMPLATE/Makefile.am
index bab4ad9..ee006da 100644
--- a/bin/TEMPLATE/Makefile.am
+++ b/bin/TEMPLATE/Makefile.am
@@ -23,6 +23,9 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
@@ -33,7 +36,8 @@ bin_PROGRAMS = astTEMPLATE
## don't keep external variables (needed in Argp) after the first link. So
## the `libgnu' (that is indirectly linked through `libgnuastro') can't see
## those variables. We thus need to explicitly link with `libgnu' first.
-astTEMPLATE_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astTEMPLATE_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astTEMPLATE_SOURCES = main.c ui.c TEMPLATE.c
diff --git a/bin/arithmetic/Makefile.am b/bin/arithmetic/Makefile.am
index 6d562d8..22ccfd2 100644
--- a/bin/arithmetic/Makefile.am
+++ b/bin/arithmetic/Makefile.am
@@ -23,13 +23,18 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
+
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astarithmetic
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astarithmetic_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astarithmetic_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
+ -lgnuastro $(MAYBE_NORPATH)
astarithmetic_SOURCES = main.c ui.c arithmetic.c operands.c
diff --git a/bin/buildprog/Makefile.am b/bin/buildprog/Makefile.am
index fa4f1c5..e8ea17d 100644
--- a/bin/buildprog/Makefile.am
+++ b/bin/buildprog/Makefile.am
@@ -29,13 +29,17 @@ AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib
-I\$(top_srcdir)/lib \
-DLIBDIR=\"$(libdir)\" -DINCLUDEDIR=\"$(includedir)\" \
-DEXEEXT=\"$(EXEEXT)\"
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astbuildprog
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astbuildprog_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astbuildprog_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
# Basic program sources.
astbuildprog_SOURCES = main.c ui.c buildprog.c
diff --git a/bin/convertt/Makefile.am b/bin/convertt/Makefile.am
index c5f6e76..1935ff1 100644
--- a/bin/convertt/Makefile.am
+++ b/bin/convertt/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astconvertt
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astconvertt_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astconvertt_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astconvertt_SOURCES = main.c ui.c convertt.c color.c
diff --git a/bin/convolve/Makefile.am b/bin/convolve/Makefile.am
index 72aeadd..a5c42a3 100644
--- a/bin/convolve/Makefile.am
+++ b/bin/convolve/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astconvolve
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astconvolve_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astconvolve_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astconvolve_SOURCES = main.c ui.c convolve.c
diff --git a/bin/cosmiccal/Makefile.am b/bin/cosmiccal/Makefile.am
index 96cafdd..984a93a 100644
--- a/bin/cosmiccal/Makefile.am
+++ b/bin/cosmiccal/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astcosmiccal
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astcosmiccal_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astcosmiccal_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astcosmiccal_SOURCES = main.c ui.c cosmiccal.c
diff --git a/bin/crop/Makefile.am b/bin/crop/Makefile.am
index e6a86a2..b644d67 100644
--- a/bin/crop/Makefile.am
+++ b/bin/crop/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astcrop
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astcrop_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astcrop_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astcrop_SOURCES = main.c ui.c crop.c wcsmode.c onecrop.c
diff --git a/bin/fits/Makefile.am b/bin/fits/Makefile.am
index 8d7d0e8..a112c75 100644
--- a/bin/fits/Makefile.am
+++ b/bin/fits/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astfits
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astfits_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astfits_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astfits_SOURCES = main.c ui.c extension.c fits.c keywords.c
diff --git a/bin/match/Makefile.am b/bin/match/Makefile.am
index c11c58d..9e9fe33 100644
--- a/bin/match/Makefile.am
+++ b/bin/match/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astmatch
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astmatch_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astmatch_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astmatch_SOURCES = main.c ui.c match.c
diff --git a/bin/mkcatalog/Makefile.am b/bin/mkcatalog/Makefile.am
index b834dff..19b30f3 100644
--- a/bin/mkcatalog/Makefile.am
+++ b/bin/mkcatalog/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astmkcatalog
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astmkcatalog_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astmkcatalog_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astmkcatalog_SOURCES = main.c ui.c mkcatalog.c columns.c upperlimit.c parse.c
diff --git a/bin/mknoise/Makefile.am b/bin/mknoise/Makefile.am
index 6f09968..555f7fd 100644
--- a/bin/mknoise/Makefile.am
+++ b/bin/mknoise/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astmknoise
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astmknoise_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astmknoise_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astmknoise_SOURCES = main.c ui.c mknoise.c
diff --git a/bin/mkprof/Makefile.am b/bin/mkprof/Makefile.am
index c7c06b0..a8f23c5 100644
--- a/bin/mkprof/Makefile.am
+++ b/bin/mkprof/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astmkprof
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astmkprof_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astmkprof_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astmkprof_SOURCES = main.c ui.c mkprof.c oneprofile.c profiles.c
diff --git a/bin/noisechisel/Makefile.am b/bin/noisechisel/Makefile.am
index a3f51e7..79ce55a 100644
--- a/bin/noisechisel/Makefile.am
+++ b/bin/noisechisel/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astnoisechisel
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astnoisechisel_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astnoisechisel_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
+ -lgnuastro $(MAYBE_NORPATH)
astnoisechisel_SOURCES = main.c ui.c detection.c noisechisel.c sky.c \
threshold.c
diff --git a/bin/segment/Makefile.am b/bin/segment/Makefile.am
index 242ec48..817600f 100644
--- a/bin/segment/Makefile.am
+++ b/bin/segment/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astsegment
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astsegment_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astsegment_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astsegment_SOURCES = main.c ui.c segment.c clumps.c
diff --git a/bin/statistics/Makefile.am b/bin/statistics/Makefile.am
index 972cc54..4106976 100644
--- a/bin/statistics/Makefile.am
+++ b/bin/statistics/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = aststatistics
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-aststatistics_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+aststatistics_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la \
+ -lgnuastro $(MAYBE_NORPATH)
aststatistics_SOURCES = main.c ui.c sky.c statistics.c
diff --git a/bin/table/Makefile.am b/bin/table/Makefile.am
index 244830a..8b4dcdb 100644
--- a/bin/table/Makefile.am
+++ b/bin/table/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = asttable
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-asttable_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+asttable_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
asttable_SOURCES = main.c ui.c arithmetic.c table.c
diff --git a/bin/warp/Makefile.am b/bin/warp/Makefile.am
index b7c0a7f..9759465 100644
--- a/bin/warp/Makefile.am
+++ b/bin/warp/Makefile.am
@@ -23,13 +23,17 @@
AM_LDFLAGS = -L\$(top_builddir)/lib
AM_CPPFLAGS = -I\$(top_srcdir)/bootstrapped/lib -I\$(top_srcdir)/lib
+if COND_NORPATH
+ MAYBE_NORPATH = $(CONFIG_LDADD)
+endif
## Program definition (name, linking, sources and headers)
bin_PROGRAMS = astwarp
## Reason for linking with `libgnu' described in `bin/TEMPLATE/Makefile.am'.
-astwarp_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro
+astwarp_LDADD = $(top_builddir)/bootstrapped/lib/libgnu.la -lgnuastro \
+ $(MAYBE_NORPATH)
astwarp_SOURCES = main.c ui.c warp.c
diff --git a/configure.ac b/configure.ac
index 8b7f17c..fdb3ed4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -883,6 +883,7 @@ AM_CONDITIONAL([COND_WARP], [test $enable_warp =
yes])
# linking flags and put them in the Makefiles.
LIBS="$orig_LIBS"
AC_SUBST(CONFIG_LDADD, [$LDADD])
+AM_CONDITIONAL([COND_NORPATH], [test "x$enable_rpath" = "xno"])
AS_ECHO(["linking flags (LDADD) ... $LDADD"])