1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-05 08:16:11 +02:00

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>
This commit is contained in:
Ben Walton 2009-03-12 15:20:08 -04:00 committed by Junio C Hamano
parent 08df6a3086
commit 918c812017

View File

@ -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
#