diff options
author | Ben Walton <bwalton@artsci.utoronto.ca> | 2009-03-12 22:20:08 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-13 09:23:38 +0300 |
commit | 918c8120172514704809cbdf889794d8b1345d0a (patch) | |
tree | 522045557a23dcc436e88751da7d84266ffbfd65 | |
parent | 08df6a3086f4bcd5b224d442f103a7f63a605967 (diff) |
configure: add macros to stash FLAG variables
Allow for quick stash/unstash of CPPFLAGS and LDFLAGS. Library tests
can now be easily bracketted with these macros to allow for values
set in user/site arguments.
Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | configure.ac | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index 0bff4808c0..469c9a98d2 100644 --- a/configure.ac +++ b/configure.ac @@ -80,6 +80,32 @@ AC_DEFUN([GIT_CHECK_FUNC],[AC_CHECK_FUNC([$1],[ AC_SEARCH_LIBS([$1],, [$2],[$3]) ],[$3])]) + +dnl +dnl GIT_STASH_FLAGS(BASEPATH_VAR) +dnl ----------------------------- +dnl Allow for easy stashing of LDFLAGS and CPPFLAGS before running +dnl tests that may want to take user settings into account. +AC_DEFUN([GIT_STASH_FLAGS],[ +if test -n "$1"; then + old_CPPFLAGS="$CPPFLAGS" + old_LDFLAGS="$LDFLAGS" + CPPFLAGS="-I$1/include $CPPFLAGS" + LDFLAGS="-L$1/$lib $LDFLAGS" +fi +]) + +dnl +dnl GIT_UNSTASH_FLAGS(BASEPATH_VAR) +dnl ----------------------------- +dnl Restore the stashed *FLAGS values. +AC_DEFUN([GIT_UNSTASH_FLAGS],[ +if test -n "$1"; then + CPPFLAGS="$old_CPPFLAGS" + LDFLAGS="$old_LDFLAGS" +fi +]) + ## Site configuration related to programs (before tests) ## --with-PACKAGE[=ARG] and --without-PACKAGE # |