aboutsummaryrefslogtreecommitdiffstats
path: root/m4/gecko.m4
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2006-03-05 20:21:24 +0800
committerChristian Persch <chpe@src.gnome.org>2006-03-05 20:21:24 +0800
commit3a2bda9152fbe270dc271fe0992db7b206ed27cc (patch)
tree310bafe2291d8fbb091ab7eeb21218349840db8d /m4/gecko.m4
parent59b244b8258700f9d04a72f8e26bf8d26330f64c (diff)
downloadgsoc2013-epiphany-3a2bda9152fbe270dc271fe0992db7b206ed27cc.tar.gz
gsoc2013-epiphany-3a2bda9152fbe270dc271fe0992db7b206ed27cc.tar.zst
gsoc2013-epiphany-3a2bda9152fbe270dc271fe0992db7b206ed27cc.zip
Before running any test programs, check that we can compile and run any
2006-03-05 Christian Persch <chpe@cvs.gnome.org> * configure.ac: * m4/gecko.m4: Before running any test programs, check that we can compile and run any XPCOM programs at all.
Diffstat (limited to 'm4/gecko.m4')
-rw-r--r--m4/gecko.m440
1 files changed, 36 insertions, 4 deletions
diff --git a/m4/gecko.m4 b/m4/gecko.m4
index cf5ef77f3..e0926c029 100644
--- a/m4/gecko.m4
+++ b/m4/gecko.m4
@@ -365,7 +365,7 @@ AC_DEFUN([GECKO_RUN_IFELSE],[_GECKO_DISPATCH([AC_RUN_IFELSE],$@)])
# ***************************************************************************
# ***************************************************************************
-# GECKO_XPCOMPROGRAM([PROLOGUE], [BODY])
+# GECKO_XPCOM_PROGRAM([PROLOGUE], [BODY])
#
# Produce a template C++ program which starts XPCOM up and shuts it down after
# the BODY part has run. In BODY, the the following variables are predeclared:
@@ -373,7 +373,7 @@ AC_DEFUN([GECKO_RUN_IFELSE],[_GECKO_DISPATCH([AC_RUN_IFELSE],$@)])
# nsresult rv
# PRBool retval (set to PR_FALSE)
#
-# The program's exit status will be EXIT_FAILURE if you retval is PR_FALSE;
+# The program's exit status will be EXIT_FAILURE if retval is PR_FALSE;
# else it will be EXIT_SUCCESS.
#
# To jump out of the BODY and exit the test program, you can use |break|.
@@ -431,6 +431,38 @@ exit (retval ? EXIT_SUCCESS : EXIT_FAILURE);
# ***************************************************************************
# ***************************************************************************
+# GECKO_XPCOM_PROGRAM_CHECK([ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [ACTION-IF-CROSS-COMPILING])
+#
+# Checks whether we can build and run any XPCOM test programs at all
+
+AC_DEFUN([GECKO_XPCOM_PROGRAM_CHECK],
+[AC_REQUIRE([GECKO_INIT])dnl
+
+AC_CACHE_CHECK([whether we can compile and run XPCOM programs],
+[gecko_cv_xpcom_program_check],
+[
+gecko_cv_xpcom_program_check=no
+
+GECKO_RUN_IFELSE([],
+ [GECKO_XPCOM_PROGRAM([],[[retval = PR_TRUE;]])],
+ [gecko_cv_xpcom_program_check=yes],
+ [gecko_cv_xpcom_program_check=no],
+ [gecko_cv_xpcom_program_check=maybe])
+])
+
+if test "$gecko_cv_xpcom_program_check" = "yes"; then
+ ifelse([$2],,[:],[$2])
+else
+ ifelse([$3],,[AC_MSG_FAILURE([Cannot compile and run XPCOM programs])],
+ [$3])
+fi
+
+]) # GECKO_XPCOM_PROGRAM_CHECK
+
+# ***************************************************************************
+# ***************************************************************************
+# ***************************************************************************
+
# GECKO_CHECK_CONTRACTID(CONTRACTID, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
#
# Checks wheter CONTRACTID is a registered contract ID
@@ -467,7 +499,7 @@ retval = NS_SUCCEEDED (rv) && isRegistered;
if test AS_VAR_GET(gecko_cv_have_CID) = "yes"; then
ifelse([$2],,[:],[$2])
else
- ifelse([$3],,[AC_MSG_FAILURE([dnl
+ ifelse([$3],,[AC_MSG_ERROR([dnl
Contract ID "$1" is not registered, but $PACKAGE_NAME depends on it.])],
[$3])
fi
@@ -495,7 +527,7 @@ done
if test "$result" = "yes"; then
ifelse([$2],,[:],[$2])
else
- ifelse([$3],,[AC_MSG_FAILURE([dnl
+ ifelse([$3],,[AC_MSG_ERROR([dnl
Contract ID "$as_contractid" is not registered, but $PACKAGE_NAME depends on it.])],
[$3])
fi