From c979fa04a40ff12370c8d3a82ad27d9d3b5907e3 Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Tue, 21 Jan 2014 13:45:17 +0000 Subject: [PATCH] Provide for static library linking. --- bld/pkg-wrapper | 22 +++++++++++++++++++--- src/config.h | 14 +++++++++++++- 2 files changed, 32 insertions(+), 4 deletions(-) diff --git a/bld/pkg-wrapper b/bld/pkg-wrapper index a29871e..37c33a2 100755 --- a/bld/pkg-wrapper +++ b/bld/pkg-wrapper @@ -2,10 +2,26 @@ search=$1 shift +pkg=$1 +shift +op=$1 +shift -if grep "^\#[[:space:]]*define[[:space:]]*$search" config.h >/dev/null 2>&1 || \ - grep $search >/dev/null 2>&1; then - exec $* +in=`cat` + +if grep "^\#[[:space:]]*define[[:space:]]*${search}_STATIC" config.h >/dev/null 2>&1 || \ + echo $in | grep ${search}_STATIC >/dev/null 2>&1; then + if [ $op = "--libs" ]; then + pkg=`$pkg --static $op $*` + echo "-Wl,-Bstatic $pkg -Wl,-Bdynamic" + exit 0 + fi fi +if grep "^\#[[:space:]]*define[[:space:]]*$search" config.h >/dev/null 2>&1 || \ + echo $in | grep $search >/dev/null 2>&1; then + pkg=`$pkg $op $*` + echo "$pkg" + +fi diff --git a/src/config.h b/src/config.h index c9870d4..c0e699d 100644 --- a/src/config.h +++ b/src/config.h @@ -124,6 +124,11 @@ RESOLVFILE */ +/* Defining this builds a binary which handles time differently and works better on a system without a + stable RTC (it uses uptime, not epoch time) and writes the DHCP leases file less often to avoid flash wear. +*/ + +/* #define HAVE_BROKEN_RTC */ /* The default set of options to build. Built with these options, dnsmasq has no library dependencies other than libc */ @@ -134,8 +139,15 @@ RESOLVFILE #define HAVE_SCRIPT #define HAVE_AUTH #define HAVE_IPSET + +/* Build options which require external libraries. + + Defining HAVE__STATIC as _well_ as HAVE_ will link the library statically. + + You can use "make COPTS=-DHAVE_" instead of editing these. +*/ + /* #define HAVE_LUASCRIPT */ -/* #define HAVE_BROKEN_RTC */ /* #define HAVE_DBUS */ /* #define HAVE_IDN */ /* #define HAVE_CONNTRACK */