diff options
| author | Roy Marples <roy@marples.name> | 2014-03-26 11:16:02 +0000 |
|---|---|---|
| committer | Roy Marples <roy@marples.name> | 2014-03-26 11:16:02 +0000 |
| commit | 68dea6e3e66c98810b61dbad8279e89f5ea6add1 (patch) | |
| tree | 3d900833ca63e779c19220f9171f33da1d5b0104 /configure | |
| parent | b756d74bd40f817d65b4011c6fef2125b6872d1f (diff) | |
| download | dhcpcd-68dea6e3e66c98810b61dbad8279e89f5ea6add1.tar.xz | |
Default to building static for a $PREFIX of \ for non Linux platforms
if ld.elf-so or similar cannot be found in /libexec.
Diffstat (limited to 'configure')
| -rwxr-xr-x | configure | 25 |
1 files changed, 14 insertions, 11 deletions
@@ -292,10 +292,21 @@ if [ -n "$LDFLAGS" ]; then echo "LDFLAGS+= $LDFLAGS" >>$CONFIG_MK fi +# NetBSD: Even if we build for $PREFIX, the clueless user might move us to / +LDELF=/libexec/ld.elf_so +if [ -e "$LDELF" ]; then + echo "Linking against $LDELF" + echo "LDFLAGS+= -Wl,-dynamic-linker=$LDELF" >>$CONFIG_MK + echo "LDFLAGS+= -Wl,-rpath=${LIBDIR}" >>$CONFIG_MK +fi + case "$OS" in -openbsd*) - if [ "$SBINDIR" = /sbin ]; then - echo "Forcing a static build for OpenBSD and SBINDIR of /sbin" +linux*) ;; +*) + if ! [ -x "$LDELF" -o -x /libexec/ld-elf.so.[0-9]* ] && \ + [ -z "$PREFIX" -o "$PREFIX" = "/" ] + then + echo "Forcing a static build for $OS and \$PREFIX of /" STATIC=yes fi ;; @@ -378,14 +389,6 @@ if [ -z "$INET6" -o "$INET6" = yes ]; then echo "DHCPCD_SRCS+= ipv6.c ipv6nd.c dhcp6.c" >>$CONFIG_MK fi -# NetBSD: Even if we build for $PREFIX, the clueless user might move us to / -LDELF=/libexec/ld.elf_so -if [ -e "$LDELF" ]; then - echo "Linking against $LDELF" - echo "LDFLAGS+= -Wl,-dynamic-linker=$LDELF" >>$CONFIG_MK - echo "LDFLAGS+= -Wl,-rpath=${LIBDIR}" >>$CONFIG_MK -fi - # Add CPPFLAGS and CFLAGS to CC for testing features XCC="$CC `$SED -n -e 's/CPPFLAGS+=*\(.*\)/\1/p' $CONFIG_MK`" XCC="$XCC `$SED -n -e 's/CFLAGS+=*\(.*\)/\1/p' $CONFIG_MK`" |
