RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Ralf S. Engelschall Root: /v/rpm/cvs Email: [EMAIL PROTECTED] Module: rpm Date: 25-Jun-2007 08:37:13 Branch: HEAD Handle: 2007062507371200 Modified files: rpm CHANGES configure.ac Log: Make PIC/PIE/warnings build flags controllable via Autoconf flags --enable-build-{pic,pie,warnings}. This way one can for instance even use things like PIE on non-Linux platform. Summary: Revision Changes Path 1.1394 +2 -1 rpm/CHANGES 2.119 +35 -11 rpm/configure.ac ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/CHANGES ============================================================================ $ cvs diff -u -r1.1393 -r1.1394 CHANGES --- rpm/CHANGES 25 Jun 2007 06:22:00 -0000 1.1393 +++ rpm/CHANGES 25 Jun 2007 06:37:12 -0000 1.1394 @@ -1,5 +1,6 @@ 4.5 -> 5.0: - - rse: cleanup Autoconf glue for static linking by resurrecting functionality under --enable-link-static + - rse: make PIC/PIE/warnings build flags controllable via Autoconf --enable-build-{pic,pie,warnings} + - rse: cleanup Autoconf glue for static linking by resurrecting functionality under --enable-build-static - rse: replace too weak Autoconf glue for C99 va_copy(3) with a more sophisticated solution - jbj: add patch macro, renamed to Xpatch until fully wired. - jbj: remove support for patch-2.1. @@ . patch -p0 <<'@@ .' Index: rpm/configure.ac ============================================================================ $ cvs diff -u -r2.118 -r2.119 configure.ac --- rpm/configure.ac 25 Jun 2007 06:22:00 -0000 2.118 +++ rpm/configure.ac 25 Jun 2007 06:37:12 -0000 2.119 @@ -57,21 +57,45 @@ AC_PATH_PROG(CSCOPE, cscope, /bin/true) dnl # GCC specifics -if test ".$ac_cv_c_compiler_gnu" = .yes; then - CFLAGS="$CFLAGS -fPIC -DPIC" - CFLAGS="$CFLAGS -D_GNU_SOURCE -D_REENTRANT" - CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts" - case "$target" in - *-*-linux* ) CFLAGS="$CFLAGS -fpie"; LDFLAGS="$LDFLAGS -pie" ;; - esac -fi AC_PROG_GCC_TRADITIONAL +AC_ARG_ENABLE(build-pic, + AS_HELP_STRING([--enable-build-pic], [build RPM with Position Independent Code (PIC) (GCC only)]), [dnl + if test ".$enableval" = .yes; then + if test ".$ac_cv_c_compiler_gnu" = .yes; then + CFLAGS="$CFLAGS -fPIC -DPIC" + else + AC_MSG_WARN([--enable-build-pic requires GCC]) + fi + fi +]) +AC_ARG_ENABLE(build-pie, + AS_HELP_STRING([--enable-build-pie], [build RPM as Position Independent Executable (PIE) (GCC only)]), [dnl + if test ".$enableval" = .yes; then + if test ".$ac_cv_c_compiler_gnu" = .yes; then + CFLAGS="$CFLAGS -fpie" + LDFLAGS="$LDFLAGS -pie" + else + AC_MSG_WARN([--enable-build-pie requires GCC]) + fi + fi +]) +AC_ARG_ENABLE(build-warnings, + AS_HELP_STRING([--enable-build-warnings], [build RPM with extra compiler warnings turned on (GCC only)]), [dnl + if test ".$enableval" = .yes; then + if test ".$ac_cv_c_compiler_gnu" = .yes; then + CFLAGS="$CFLAGS -Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wno-char-subscripts" + else + AC_MSG_WARN([--enable-build-warnings requires GCC]) + fi + fi +]) +CFLAGS="$CFLAGS -D_GNU_SOURCE -D_REENTRANT" dnl # support static linking of RPM via GNU libtool LDFLAGS_STATIC="" -AC_ARG_ENABLE(link-static, - AS_HELP_STRING([--enable-link-static=ARG], [link RPM statically]), [dnl - AC_MSG_CHECKING(whether to link RPM statically via GNU libtool) +AC_ARG_ENABLE(build-static, + AS_HELP_STRING([--enable-build-static], [build RPM as a static executable]), [dnl + AC_MSG_CHECKING([whether to build RPM as a static executable (via GNU libtool)]) if test ".$enableval" = .yes; then case "$target" in *-*-darwin*) LDFLAGS_STATIC="";; # Mac OS X does not do static binaries. @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org