]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Allow adding extra CFLAGS with a configure option.
authorAndres Mejia <amejia004@gmail.com>
Sat, 23 Feb 2013 01:02:40 +0000 (20:02 -0500)
committerAndres Mejia <amejia004@gmail.com>
Sat, 23 Feb 2013 01:02:40 +0000 (20:02 -0500)
This is a convenience option to pass in extra CFLAGS without overriding other
CFLAGS.

Makefile.am
configure.ac

index 57efe7916d0aa5c1ca00155e4b9edbb8a7c5d64f..19373921663cce994d114a5c07b366bebf6195b8 100644 (file)
@@ -25,7 +25,8 @@ COMMON_CFLAGS=-Wall -Wformat -Wformat-security
 # The next line is commented out by default in shipping libarchive releases.
 # It is uncommented by default in trunk.
 DEV_CFLAGS=-Werror -Wextra -Wunused -Wshadow -Wmissing-prototypes -Wcast-qual
-AM_CFLAGS=$(COMMON_CFLAGS) $(DEV_CFLAGS)
+EXTRA_CFLAGS = @EXTRA_CFLAGS@
+AM_CFLAGS=$(COMMON_CFLAGS) $(DEV_CFLAGS) $(EXTRA_CFLAGS)
 PLATFORMCPPFLAGS = @PLATFORMCPPFLAGS@
 AM_CPPFLAGS=$(PLATFORMCPPFLAGS)
 
index 73944d3e0754b70d73c4bc757a72f91ef84bbae2..8a4afd756d950edcd2b9e244cf584c4e8d7ea5d0 100644 (file)
@@ -190,6 +190,12 @@ esac
 AM_CONDITIONAL([BUILD_BSDCPIO], [ test "$build_bsdcpio" = yes ])
 AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ])
 
+AC_ARG_WITH([extra-cflags],
+  [AS_HELP_STRING([--with-extra-cflags=CFLAGS], [use extra CFLAGS])],
+  [], [enable_extra_cflags= ])
+
+EXTRA_CFLAGS=$with_extra_cflags
+
 # Set up defines needed before including any headers
 case $host in
   *mingw* | *cygwin* )
@@ -785,4 +791,5 @@ case "$host_os" in
        ;;
 esac
 
+AC_SUBST(EXTRA_CFLAGS)
 AC_OUTPUT