aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncan Overbruck <mail@duncano.de>2020-11-14 16:13:16 +0100
committerDuncan Overbruck <mail@duncano.de>2020-11-14 16:14:08 +0100
commitd67caab6ab5dfa342159fef7cef5ea91ccf0aad3 (patch)
tree4f02d923dfd9bf171873ca1c74e22924e09d4d02
parent29123f7c5b7cfb79419425ad4d2b7af153e06472 (diff)
downloadopendoas-d67caab6ab5dfa342159fef7cef5ea91ccf0aad3.tar.gz
configure: use LDLIBS instead of setting LDFLAGS
-rw-r--r--GNUmakefile4
-rwxr-xr-xconfigure12
2 files changed, 8 insertions, 8 deletions
diff --git a/GNUmakefile b/GNUmakefile
index cc64429..9e524fc 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -6,7 +6,7 @@ SRCS= parse.y doas.c env.c
include config.mk
CFLAGS+= -I. -Ilibopenbsd ${COPTS}
-COPTS+= -Wall -Wextra -Werror -pedantic
+COPTS+= -Wall -Wextra -pedantic -O2 -D_FORTIFY_SOURCE=2
YFLAGS=
all: ${PROG}
@@ -15,7 +15,7 @@ OBJS:= ${SRCS:.y=.c}
OBJS:= ${OBJS:.c=.o}
${PROG}: ${OBJS}
- ${CC} ${CFLAGS} $^ -o $@ ${LDFLAGS}
+ ${CC} ${CFLAGS} $^ -o $@ ${LDFLAGS} ${LDLIBS}
install: ${PROG} ${PAM_DOAS} ${MAN}
mkdir -p -m 0755 ${DESTDIR}${BINDIR}
diff --git a/configure b/configure
index 82b9331..9592a30 100755
--- a/configure
+++ b/configure
@@ -116,11 +116,11 @@ case "$OS" in
;;
netbsd)
OS_CFLAGS="$OS_CFLAGS -D_OPENBSD_SOURCE"
- printf 'LDFLAGS += -lutil\n' >>$CONFIG_MK
+ printf 'LDLIBS += -lutil\n' >>$CONFIG_MK
: ${BINGRP:=wheel}
;;
freebsd)
- printf 'LDFLAGS += -lutil\n' >>$CONFIG_MK
+ printf 'LDLIBS += -lutil\n' >>$CONFIG_MK
: ${BINGRP:=wheel}
;;
darwin)
@@ -161,8 +161,8 @@ EOF
[ -n "$BUILD_STATIC" ] && \
printf 'CFLAGS += -static\n' >>$CONFIG_MK
-# Add CPPFLAGS/CFLAGS/LDFLAGS to CC for testing features
-XCC="${CC:=cc} $CFLAGS $OS_CFLAGS $CPPFLAGS $LDFLAGS"
+# Add CPPFLAGS/CFLAGS/LDFLAGS/LDLIBS to CC for testing features
+XCC="${CC:=cc} $CFLAGS $OS_CFLAGS $CPPFLAGS $LDFLAGS $LDLIBS"
# Make sure to disable --as-needed for CC tests.
case "$OS" in
@@ -200,7 +200,7 @@ int main(void) {
}'
[ -z "$WITHOUT_PAM" ] && check_func "pam_appl_h" "$src" && {
printf 'SRCS += pam.c\n' >>$CONFIG_MK
- printf 'LDFLAGS += -lpam\n' >>$CONFIG_MK
+ printf 'LDLIBS += -lpam\n' >>$CONFIG_MK
printf '#define USE_PAM\n' >>$CONFIG_H
printf 'pam\n'
@@ -219,7 +219,7 @@ int main(void) {
}'
[ -z "$WITHOUT_SHADOW" ] && check_func "shadow_h" "$src" && {
printf 'SRCS += shadow.c\n' >>$CONFIG_MK
- printf 'LDFLAGS += -lcrypt\n' >>$CONFIG_MK
+ printf 'LDLIBS += -lcrypt\n' >>$CONFIG_MK
printf '#define USE_SHADOW\n' >>$CONFIG_H
printf 'shadow\n'
return 0