summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-05-01 02:03:43 +0000
committerYang Tse <yangsita@gmail.com>2009-05-01 02:03:43 +0000
commitdcdabb9ebed2052500e77fb529b744c2ceb60e50 (patch)
treea9864c9d70e2578f106cd7b45a3e20c65e1bd974 /acinclude.m4
parentc2ae8f0059d116edadbfe1120b1c0455adba601f (diff)
downloadc-ares-dcdabb9ebed2052500e77fb529b744c2ceb60e50.tar.gz
c-ares-dcdabb9ebed2052500e77fb529b744c2ceb60e50.tar.bz2
c-ares-dcdabb9ebed2052500e77fb529b744c2ceb60e50.zip
Check definition of _XOPEN_SOURCE_EXTENDED with the compiler
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m438
1 files changed, 38 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 8cadce1..e5d96b2 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -96,6 +96,44 @@ CURL_DEF_TOKEN $1
])
+dnl CURL_CHECK_DEF_CC (SYMBOL, [INCLUDES], [SILENT])
+dnl -------------------------------------------------
+dnl Use the C compiler to find out only if the given symbol is defined
+dnl or not, this can not find out its expansion. This macro will not use
+dnl default includes even if no INCLUDES argument is given. This macro
+dnl will run silently when invoked with three arguments.
+
+AC_DEFUN([CURL_CHECK_DEF_CC], [
+ AS_VAR_PUSHDEF([ac_HaveDef], [curl_cv_have_def_$1])dnl
+ ifelse($3,,[AC_MSG_CHECKING([for compiler definition of $1])])
+ AC_COMPILE_IFELSE([
+ AC_LANG_SOURCE(
+ifelse($2,,,[$2])[[
+int main (void)
+{
+#ifdef $1
+ return 0;
+#else
+ force compilation error
+#endif
+}
+ ]])
+ ],[
+ tst_symbol_defined="yes"
+ ],[
+ tst_symbol_defined="no"
+ ])
+ if test "$tst_symbol_defined" = "yes"; then
+ AS_VAR_SET(ac_HaveDef, yes)
+ ifelse($3,,[AC_MSG_RESULT([yes])])
+ else
+ AS_VAR_SET(ac_HaveDef, no)
+ ifelse($3,,[AC_MSG_RESULT([no])])
+ fi
+ AS_VAR_POPDEF([ac_HaveDef])dnl
+])
+
+
dnl CARES_CHECK_AIX_ALL_SOURCE
dnl -------------------------------------------------
dnl Provides a replacement of traditional AC_AIX with