summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 08df6a3)
raw | patch | inline | side by side (parent: 08df6a3)
author | Ben Walton <bwalton@artsci.utoronto.ca> | |
Thu, 12 Mar 2009 19:20:08 +0000 (15:20 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Fri, 13 Mar 2009 06:23:38 +0000 (23:23 -0700) |
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>
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>
configure.ac | patch | blob | history |
diff --git a/configure.ac b/configure.ac
index 0bff4808c05f6d2d97a4986b29434a5ad60afb5d..469c9a98d2414c0788cdbcb30b9294e0b9f0c168 100644 (file)
--- a/configure.ac
+++ b/configure.ac
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
#