summaryrefslogtreecommitdiff
blob: 2519118e2f5eba8f181663c22945be275edcb6d8 (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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
* Get rid of a lot of compiler flag cruft
* Respect LDFLAGS and CFLAGS

--- a/configure.in	2004-11-28 00:47:52.000000000 +0100
+++ b/configure.in	2010-09-19 05:49:48.000000000 +0200
@@ -14,12 +14,7 @@
 bin=wipe
 
 fullCFLAGS=""
-wallCFLAGS=""
-pendanticCFLAGS=""
-tempCFLAGS=""
-temp2CFLAGS=""
-checkCFLAGS=""
-optCFLAGS=""
+optCFLAGS="${CFLAGS}"
 #CFLAGS="-g -Wall -Werror -ansi -pedantic -O2 -finline-functions -ffast-math -fomit-frame-pointer"
 
 AC_CANONICAL_SYSTEM
@@ -34,65 +29,9 @@
 AC_PROG_INSTALL
 
 dnl Compilation tests
-AC_MSG_CHECKING([whether the C compiler accepts -pipe])
-CFLAGS="-pipe"
-AC_TRY_COMPILE(,,AC_MSG_RESULT(yes); tempCFLAGS="$CFLAGS",AC_MSG_RESULT(no))
-
-AC_MSG_CHECKING([whether the C compiler accepts -g])
-CFLAGS="-g"
-AC_TRY_COMPILE(,,AC_MSG_RESULT(yes); debugCFLAGS="$CFLAGS",AC_MSG_RESULT(no))
-
-AC_MSG_CHECKING([whether the C compiler accepts -O0])
-CFLAGS="-O0"
-AC_TRY_COMPILE(,,AC_MSG_RESULT(yes); debugCFLAGS="$debugCFLAGS $CFLAGS",AC_MSG_RESULT(no))
-
-AC_MSG_CHECKING([whether the C compiler accepts -O2])
-CFLAGS="-O2"
-AC_TRY_COMPILE(,,AC_MSG_RESULT(yes); tempCFLAGS="$tempCFLAGS $CFLAGS",AC_MSG_RESULT(no))
-
-AC_MSG_CHECKING([whether the C compiler accepts -ansi])
-CFLAGS="-ansi"
-AC_TRY_COMPILE(,,AC_MSG_RESULT(yes); checkCFLAGS="$checkCFLAGS $CFLAGS",AC_MSG_RESULT(no))
-
-AC_MSG_CHECKING([whether the C compiler accepts -pedantic])
-CFLAGS="-pedantic"
-AC_TRY_COMPILE(,,AC_MSG_RESULT(yes); checkCFLAGS="$checkCFLAGS $CFLAGS",AC_MSG_RESULT(no))
-
-AC_MSG_CHECKING([whether the C compiler accepts -Wall])
-CFLAGS="-Wall"
-AC_TRY_COMPILE(,,AC_MSG_RESULT(yes); wallCFLAGS="$CFLAGS",AC_MSG_RESULT(no))
-
-AC_MSG_CHECKING([whether the C compiler accepts -Werror])
-CFLAGS="-Werror"
-AC_TRY_COMPILE(,,AC_MSG_RESULT(yes); pedanticCFLAGS="$wallCFLAGS $CFLAGS",AC_MSG_RESULT(no))
-
-AC_MSG_CHECKING([whether the C compiler accepts -ffast-math])
-CFLAGS="-ffast-math"
-AC_TRY_COMPILE(,,AC_MSG_RESULT(yes); optCFLAGS="$optCFLAGS $CFLAGS",AC_MSG_RESULT(no))
-
-AC_ARG_ENABLE(wall,
-	[  --enable-wall        compile with -ansi -pedantic -Wall -Werror],
-	[with_wall=$enableval],
-	[with_wall=no])
-test "$with_wall" = "yes" && fullCFLAGS="$checkCFLAGS $wallCFLAGS $pendanticCFLAGS $fullCFLAGS"
-
-temp2CFLAGS="$tempCFLAGS $optCFLAGS"
-
-AC_ARG_ENABLE(debug,
-	[  --enable-debug       compile for debugger compatibility],
-	[with_debug=$enableval],
-	[with_debug=no])
-test "$with_debug" = "yes" && temp2CFLAGS="$wallCFLAGS $debugCFLAGS"
-
-AC_ARG_ENABLE(efence,
-	[  --enable-efence      debug build + link with electric fence],
-	[with_efence=$enableval],
-	[with_efence=no])
-test "$with_efence" = "yes" && temp2CFLAGS="$debugCFLAGS" && LIBS="-lefence"
-
-DEBUG="$debugCFLAGS $fullCFLAGS"
-fullCFLAGS="$temp2CFLAGS $fullCFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
-CFLAGS="$checkCFLAGS -D__USE_BSD -D_BSD_SOURCE -D__USE_POSIX -D_POSIX_SOURCE -D_POSIX_MAPPED_FILES"
+
+fullCFLAGS="$optCFLAGS $fullCFLAGS -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"
+CFLAGS="$fullCFLAGS" # -D__USE_BSD -D_BSD_SOURCE -D__USE_POSIX -D_POSIX_SOURCE -D_POSIX_MAPPED_FILES"
 
 dnl Checks for libraries.
 
@@ -124,6 +63,4 @@
 
 dnl Done with tests
 
-CFLAGS="$fullCFLAGS"
-
 AC_OUTPUT(Makefile)
--- a/Makefile.in	2003-08-31 03:18:03.000000000 +0200
+++ b/Makefile.in	2010-09-19 05:50:30.000000000 +0200
@@ -31,7 +31,7 @@
 all:	$(REQ) $(BIN)
 
 $(BIN):	main.o wipe.o rand.o dir.o file.o blkdev.o lock.o text.o str.o percent.o prompt.o io.o mt.o
-	$(CC) $(LIBS) *.o -o $@
+	$(CC) $(CFLAGS) $(LDFLAGS) $(LIBS) *.o -o $@
 
 
 # restores everything to a pre-configured state