proper use of CFLAGS push/pop. fix overwriting CFLAGS.

git-svn-id: https://www.opensc-project.org/svnp/opensc/trunk@2554 c6295689-39f2-0310-b995-f0e70906c6a9
This commit is contained in:
aj 2005-09-08 14:27:18 +00:00
parent 8596348a75
commit 596bbcd7de
1 changed files with 5 additions and 6 deletions

View File

@ -239,9 +239,9 @@ AC_SUBST(PCSC_LIBS)
AM_CONDITIONAL(HAVE_PCSC, test "x$PCSC_MSG" = "xyes")
saved_LIBS="$LIBS"
saved_CFLAGS="$CFLAGS"
if test "x$PCSC_MSG" = "xyes"; then
CPPFLAGS="${PCSC_CFLAGS} $saved_CPPFLAGS"
CFLAGS="$PCSC_CFLAGS $saved_CFLAGS"
CFLAGS="${PCSC_CFLAGS} $saved_CFLAGS"
LIBS="$PCSC_LIBS $saved_LIBS"
AC_TRY_LINK([
#include <stdlib.h>
@ -256,17 +256,16 @@ SCardControl(NULL, NULL, 0, NULL, NULL);
], [
AC_DEFINE(HAVE_PCSC_OLD, 1, [old version of pc/sc-lite])
])
CPPFLAGS="$saved_CPPFLAGS"
CFLAGS="$saved_CFLAGS"
LIBS="$saved_LIBS"
fi
LIBS="$saved_LIBS"
CFLAGS="$saved_CFLAGS"
# check for reader.h
saved_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $PCSC_CFLAGS"
AC_CHECK_HEADER(reader.h,
[AC_DEFINE([HAVE_READER_H], 1, [Define if pcsc-lite with reader.h exists])],
[AC_MSG_WARN([reader.h not found, install pcsc-lite 1.2.9-beta8 or later, or use CFLAGS=... ./configure])],
[AC_MSG_WARN([reader.h not found, install pcsc-lite 1.2.9-beta8 or later, or use PCSC_CFLAGS=... ./configure])],
[ #include <reader.h>])
CFLAGS="$saved_CFLAGS"