]> git.armaanb.net Git - opendoas.git/commitdiff
configure: respect environment and make CFLAGS
authorDuncan Overbruck <mail@duncano.de>
Sat, 14 Nov 2020 15:27:07 +0000 (16:27 +0100)
committerDuncan Overbruck <mail@duncano.de>
Sat, 14 Nov 2020 15:32:41 +0000 (16:32 +0100)
GNUmakefile
configure

index 9e524fc23966b9efd7b6ff1ade24c554e7e81249..947020236706742699a4f4a4f58a8313c225784e 100644 (file)
@@ -5,9 +5,7 @@ SRCS=   parse.y doas.c env.c
 
 include config.mk
 
-CFLAGS+= -I. -Ilibopenbsd ${COPTS}
-COPTS+=        -Wall -Wextra -pedantic -O2 -D_FORTIFY_SOURCE=2
-YFLAGS=
+override CFLAGS:=-I. -Ilibopenbsd -O2 -Wall -Wextra ${OS_CFLAGS} ${CFLAGS}
 
 all: ${PROG}
 
index 9592a30f2b781d896652a975aecaa34ea7fcf6a7..1c5d9899bda3981acab60fa5669455991c7008fd 100755 (executable)
--- a/configure
+++ b/configure
@@ -153,7 +153,7 @@ BINGRP  ?=  ${BINGRP}
 EOF
 
 [ -n "$OS_CFLAGS" ] && \
-       printf 'CFLAGS   +=     %s\n' "$OS_CFLAGS" >>$CONFIG_MK
+       printf 'OS_CFLAGS   +=  %s\n' "$OS_CFLAGS" >>$CONFIG_MK
 
 [ -n "$DEBUG" ] && \
        printf 'CFLAGS   +=     -O0 -g\n' >>$CONFIG_MK
@@ -545,7 +545,7 @@ int main(void){return 0;}
 __attribute__((__unused__)) static void foo(void){return;}
 '
 check_func "__attribute__" "$src" || {
-       printf 'CFLAGS  +=      -DNO_ATTRIBUTE_ON_RETURN_TYPE=1\n' >>$CONFIG_MK
+       printf 'OS_CFLAGS       +=      -DNO_ATTRIBUTE_ON_RETURN_TYPE=1\n' >>$CONFIG_MK
 }
 
 auth=$(authmethod)