From 2acb23eba9d148e24341bfb4cc2f88e8e50addce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= Date: Mon, 4 Sep 2017 10:57:29 +0200 Subject: [PATCH] Do not force static linking MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If ./configure is run without options, dontpanic tool is linked statically to the dontpanic library. If ./configure is invoked with --disable-static, libtool will add RPATH pointing to a build-time directory into the dontpanic tool. The path is obviously wrong after installing the files into a final location (make install). It's probably a bug in libtool. This patch fixes/work around it by not enforcing dontpanic tool static linking inside the Makefile.am when --disable-static was requested. Otherwise if both static and dynamic libraries are built, the tool will be linked statically. Signed-off-by: Petr Písař --- configure.ac | 1 + src/Makefile.am | 3 +++ 2 files changed, 4 insertions(+) diff --git a/configure.ac b/configure.ac index a2cfa33..8970401 100644 --- a/configure.ac +++ b/configure.ac @@ -25,6 +25,7 @@ AM_PROG_LIBTOOL LT_INIT AM_INIT_AUTOMAKE +AM_CONDITIONAL([STATIC_ENABLED], [test "$enable_static" != "no"]) AC_CONFIG_FILES([src/Makefile Makefile]) AC_OUTPUT diff --git a/src/Makefile.am b/src/Makefile.am index ee3ee40..c36258c 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -11,4 +11,7 @@ include_HEADERS = libdontpanic.h bin_PROGRAMS = dontpanic dontpanic_SOURCES = main.c dontpanic_LDADD = libdontpanic.la + +if STATIC_ENABLED dontpanic_LDFLAGS = -static +endif -- 2.13.5