[evolution-mapi] Inherit CFLAGS and LIBS in the 'Check for' configure test programs
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-mapi] Inherit CFLAGS and LIBS in the 'Check for' configure test programs
- Date: Mon, 18 May 2015 17:36:49 +0000 (UTC)
commit 7e729bb755cfebd9b785fd912e6da3196e2bcefb
Author: Milan Crha <mcrha redhat com>
Date: Mon May 18 19:35:23 2015 +0200
Inherit CFLAGS and LIBS in the 'Check for' configure test programs
It could happen that the test program failed due to missing CFLAGS
or even LIBS, thus it could give incorrect results.
configure.ac | 32 ++++++++++++++++----------------
1 files changed, 16 insertions(+), 16 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index ac11615..c515b46 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,42 +187,42 @@ dnl Check for struct mapi_SNotRestriction availability
dnl see http://tracker.openchange.org/issues/377
dnl ****************************
AC_MSG_CHECKING([libmapi struct mapi_SNotRestriction])
-save_cflags=$CFLAGS; CFLAGS=$LIBMAPI_CFLAGS
-save_libs=$LIBS; LIBS="$LIBMAPI_LIBS"
+save_cflags="$CFLAGS"; CFLAGS="$LIBMAPI_CFLAGS $CFLAGS"
+save_libs="$LIBS"; LIBS="$LIBMAPI_LIBS $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <libmapi/libmapi.h>]],
[[struct mapi_SNotRestriction snot; snot.res->rt = RES_NOT]])],
[AC_DEFINE(HAVE_RES_NOT_SUPPORTED, 1, [libmapi supports RES_NOT restrictions])
ac_cv_have_rns=yes],[ac_cv_have_rns=no])
-CFLAGS=$save_cflags
-LIBS=$save_libs
+CFLAGS="$save_cflags"
+LIBS="$save_libs"
AC_MSG_RESULT([$ac_cv_have_rns])
dnl ****************************
dnl Check for OpenChange 2.1 fast-transfer tags availability
dnl ****************************
AC_MSG_CHECKING([libmapi fast-transfer tags])
-save_cflags=$CFLAGS; CFLAGS=$LIBMAPI_CFLAGS
-save_libs=$LIBS; LIBS="$LIBMAPI_LIBS"
+save_cflags="$CFLAGS"; CFLAGS="$LIBMAPI_CFLAGS $CFLAGS"
+save_libs="$LIBS"; LIBS="$LIBMAPI_LIBS $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <libmapi/libmapi.h>]],
[[uint32_t tag; tag = StartMessage; tag = EndMessage; tag = StartRecip; tag = EndToRecip; tag =
NewAttach; tag = EndAttach; tag = StartEmbed; tag = EndEmbed;]])],
[AC_DEFINE(HAVE_FAST_TRANSFER_TAGS_2_1, 1, [libmapi supports fast-transfer tags from OpenChange 2.1])
ac_cv_have_ftt21=yes],[ac_cv_have_ftt21=no])
-CFLAGS=$save_cflags
-LIBS=$save_libs
+CFLAGS="$save_cflags"
+LIBS="$save_libs"
AC_MSG_RESULT([$ac_cv_have_ftt21])
dnl ****************************
dnl Check for OpenChange 2.2 ecRpcFailed
dnl ****************************
AC_MSG_CHECKING([libmapi ecRpcFailed error code])
-save_cflags=$CFLAGS; CFLAGS=$LIBMAPI_CFLAGS
-save_libs=$LIBS; LIBS="$LIBMAPI_LIBS"
+save_cflags="$CFLAGS"; CFLAGS="$LIBMAPI_CFLAGS $CFLAGS"
+save_libs="$LIBS"; LIBS="$LIBMAPI_LIBS $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <libmapi/libmapi.h>]],
[[uint32_t err = ecRpcFailed;]])],
[AC_DEFINE(HAVE_ECPRCFAILED_ERROR, 1, [libmapi defines ecRpcFailed error code])
ac_cv_have_ecrpcfailed=yes],[ac_cv_have_ecrpcfailed=no])
-CFLAGS=$save_cflags
-LIBS=$save_libs
+CFLAGS="$save_cflags"
+LIBS="$save_libs"
if [ test "x$ac_cv_have_ecrpcfailed" = "xno" ] ; then
CFLAGS="-DecRpcFailed=MAPI_E_NETWORK_ERROR $CFLAGS"
fi
@@ -232,14 +232,14 @@ dnl ****************************
dnl Check for OpenChange 2.3 QueryRows
dnl ****************************
AC_MSG_CHECKING([libmapi QueryRows arguments])
-save_cflags=$CFLAGS; CFLAGS=$LIBMAPI_CFLAGS
-save_libs=$LIBS; LIBS="$LIBMAPI_LIBS"
+save_cflags="$CFLAGS"; CFLAGS="$LIBMAPI_CFLAGS $CFLAGS"
+save_libs="$LIBS"; LIBS="$LIBMAPI_LIBS $LIBS"
AC_LINK_IFELSE([AC_LANG_PROGRAM(
[[#include <libmapi/libmapi.h>]],
[[QueryRows(NULL, 1, TBL_ADVANCE, TBL_FORWARD_READ, NULL);]])],
[AC_DEFINE(HAVE_QUERYROWS_FORWARDREAD, 1, [libmapi defines QueryRows with ForwardRead argument])
ac_cv_have_queryrows_forwardread=yes],[ac_cv_have_queryrows_forwardread=no])
-CFLAGS=$save_cflags
-LIBS=$save_libs
+CFLAGS="$save_cflags"
+LIBS="$save_libs"
AC_MSG_RESULT([$ac_cv_have_queryrows_forwardread])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]