You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/app-misc/wipe/files/wipe-2.2.20050509-gentoo.patch

107 lines
3.5 KiB

* 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