From 1d8b5706cd37c0cdeee1090bb4bf171f2a65e06f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Vladim=C3=ADr=20=C4=8Cun=C3=A1t?= Date: Tue, 1 Aug 2017 13:23:38 +0200 Subject: [PATCH] make: add -rpath when linking to find libkres ... even if LIBDIR isn't on a standard place. --- config.mk | 2 +- doc/build.rst | 6 ------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/config.mk b/config.mk index 026df4019..c4fd8b43f 100644 --- a/config.mk +++ b/config.mk @@ -28,7 +28,7 @@ XXD_LUA := ./scripts/embed-lua.sh INSTALL := install # Flags -BUILD_LDFLAGS += $(LDFLAGS) +BUILD_LDFLAGS += "-Wl,-rpath=$(LIBDIR)" $(LDFLAGS) BUILD_CFLAGS := $(CFLAGS) -std=c99 -D_GNU_SOURCE -Wno-unused -Wtype-limits -Wformat -Wformat-security -Wall -I$(abspath .) -I$(abspath lib/generic) -I$(abspath contrib) -I$(abspath contrib/lmdb) BUILD_CFLAGS += -DPACKAGE_VERSION="\"$(VERSION)\"" -DPREFIX="\"$(PREFIX)\"" -DMODULEDIR="\"$(MODULEDIR)\"" ifeq (,$(findstring -O,$(CFLAGS))) diff --git a/doc/build.rst b/doc/build.rst index 56264ea85..6b8275989 100644 --- a/doc/build.rst +++ b/doc/build.rst @@ -125,12 +125,6 @@ When you have all the dependencies ready, you can build and install. Production code should be compiled with ``-DNDEBUG``. If you build the binary with ``-DNOVERBOSELOG``, it won't be possible to turn on verbose logging; we advise packagers against using that flag. -.. note:: If you build with ``PREFIX``, you may need to also set the ``LDFLAGS`` for the libraries: - -.. code-block:: bash - - make LDFLAGS="-Wl,-rpath=/usr/local/lib" PREFIX="/usr/local" - Alternatively you can build only specific parts of the project, i.e. ``library``. .. code-block:: bash -- 2.47.2