mirror of
https://github.com/isc-projects/bind9.git
synced 2026-04-15 22:09:31 -04:00
Fix restoring CFLAGS and LIBS in AX_LIB_LMDB()
The AX_LIB_LMDB() macro attempts to test the potential LMDB installation path provided to it by temporarily updating CFLAGS and LIBS, calling AC_SEARCH_LIBS(), and then restoring CFLAGS and LIBS to their original values. However, including certain statements (e.g. "break") in the arguments provided to the AX_LIB_LMDB() macro may cause an early exit from it, in which case CFLAGS and LIBS will be left polluted. Fix by resetting CFLAGS and LIBS to their original values before executing the commands provided as AX_LIB_LMDB() arguments.
This commit is contained in:
parent
5cc856095b
commit
bf0229caad
1 changed files with 3 additions and 4 deletions
|
|
@ -37,22 +37,21 @@ AC_DEFUN([AX_LIB_LMDB],
|
|||
[AC_MSG_RESULT([yes])
|
||||
LMDB_CFLAGS="-I$1/include"
|
||||
LMDB_LIBS="-L$1/lib"
|
||||
saved_CFLAGS="$CFLAGS"
|
||||
saved_LIBS="$LIBS"
|
||||
AX_SAVE_FLAGS([lmdb])
|
||||
CFLAGS="$CFLAGS $LMDB_CFLAGS"
|
||||
LIBS="$LIBS $LMDB_LIBS"
|
||||
AC_SEARCH_LIBS([mdb_env_create], [lmdb],
|
||||
[LMDB_LIBS="$LMDB_LIBS $ac_cv_search_mdb_env_create"
|
||||
AC_SUBST([LMDB_CFLAGS])
|
||||
AC_SUBST([LMDB_LDFLAGS])
|
||||
AX_RESTORE_FLAGS([lmdb])
|
||||
$2
|
||||
],
|
||||
[AC_MSG_RESULT([no])
|
||||
LMDB_CFLAGS=""
|
||||
LMDB_LIBS=""
|
||||
AX_RESTORE_FLAGS([lmdb])
|
||||
$3
|
||||
])
|
||||
CFLAGS="$saved_CFLAGS"
|
||||
LIBS="$saved_LIBS"
|
||||
],
|
||||
[AC_MSG_RESULT([no])])])
|
||||
|
|
|
|||
Loading…
Reference in a new issue