summaryrefslogtreecommitdiff
blob: 592bdc664561b2fee398608340d0b6bd517386ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
commit 559fa7ed44238e811ac0c11321ed021c35cba2be
Author: Pierre-Louis Bonicoli <pierre-louis.bonicoli@gmx.fr>
Date:   Wed Sep 14 06:30:09 2011 +0200

    don't override user var. Thanks to Alex Legler
    
    Based on gentoo-x86/net-irc/bip/files/bip-configure.patch
    See http://www.gnu.org/software/autoconf/manual/automake.html#User-Variables
    If user doesn't specify CFLAGS, default value is "-Wall -Wextra -g -O2".

diff --git a/Makefile.am b/Makefile.am
index c2dae4d..f17c314 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,13 +13,8 @@ src_bip_SOURCES = src/conf.y src/lex.l \
 src_bipmkpw_SOURCES = src/bipmkpw.c src/md5.c src/util.c
 AM_YFLAGS= -d
 BUILT_SOURCES = src/conf.c src/conf.h src/lex.c
-if DEBUG
-	AM_CFLAGS+=-Wall -g
-	AM_LDFLAGS+=-g
-else
-	AM_CFLAGS+=-Wall
-endif
 
+AM_CFLAGS=-Wall -Wextra
 
 dist_man_MANS = bip.1 bip.conf.5 bipmkpw.1
 
diff --git a/configure.ac b/configure.ac
index 005e697..5740a39 100644
--- a/configure.ac
+++ b/configure.ac
@@ -44,16 +44,12 @@ AC_ARG_ENABLE([pie], AS_HELP_STRING([--disable-pie], [Do not build a position in
 
 AM_CONDITIONAL(DEBUG, test x$enable_debug = xyes)
 AS_IF([test "x$enable_debug" = "xyes"], [
-	CFLAGS="-O0 -g -W -Wall"
-	LDFLAGS="-g"
 	AC_CHECK_FUNC(backtrace_symbols_fd, [
 		AC_DEFINE(HAVE_BACKTRACE, [], [Use glibc backtrace on fatal()])
 		LDFLAGS="-rdynamic $LDFLAGS"
 		backtrace="(with backtrace)"
 	])
 ], [
-	CFLAGS="-O2 -g -W -Wall"
-	LDFLAGS="-g"
 	enable_debug=no
 ])