From: Vladimír Čunát Date: Tue, 1 Aug 2017 11:23:38 +0000 (+0200) Subject: make: add -rpath when linking to find libkres X-Git-Tag: v1.3.3~11^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1d8b5706cd37c0cdeee1090bb4bf171f2a65e06f;p=thirdparty%2Fknot-resolver.git make: add -rpath when linking to find libkres ... even if LIBDIR isn't on a standard place. --- 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