Module Information
Public.Parser.XML2
Viewing contents of Public_Parser_XML2-1.8/aclocal.m4
dnl $Id: aclocal.m4,v 1.1.1.1 2005/03/20 19:20:45 hww3 Exp $
dnl Some compatibility with Autoconf 2.50+. Not complete.
dnl newer Autoconf calls substr m4_substr
ifdef([substr], ,[m4_copy([m4_substr],[substr])])
dnl newer Autoconf calls changequote m4_changequote
ifdef([changequote], ,[m4_copy([m4_changequote],[changequote])])
dnl Autoconf 2.53+ hides their version numbers in m4_PACKAGE_VERSION.
ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])
dnl Not really a prerequisite, but suggest the use of Autoconf 2.50 to
dnl autoconf-wrapper if it is used. dnl can't be used since the wrapper
dnl checks for it, so just store it in a dummy define.
define([require_autoconf_2_50],[AC_PREREQ(2.50)])
define([if_autoconf],
[ifelse(ifelse(index(AC_ACVERSION,.),-1,0,[m4_eval(
substr(AC_ACVERSION, 0, index(AC_ACVERSION,.))-0 >= $1 &&
(
substr(AC_ACVERSION, 0, index(AC_ACVERSION,.))-0 > $1 ||
substr(AC_ACVERSION, index(+AC_ACVERSION,.))-0 >= $2
)
)]),1,$3,$4)])
pushdef([AC_PROG_CC_WORKS],
[
popdef([AC_PROG_CC_WORKS])
if test "x$enable_binary" != "xno"; then
if test "${ac_prog_cc_works_this_run-}" != "yes" ; then
AC_PROG_CC_WORKS
ac_prog_cc_works_this_run="${ac_cv_prog_cc_works-no}"
export ac_prog_cc_works_this_run
else
AC_MSG_CHECKING([whether the C compiler ($CC $CFLAGS $LDFLAGS) works])
AC_MSG_RESULT([(cached) yes])
fi
fi
])
pushdef([AC_PROG_CC],
[
popdef([AC_PROG_CC])
AC_PROG_CC
if test "$ac_cv_prog_cc_g" = no; then
# The -g test is broken for some compilers (eg ecc), since
# they always have output (they echo the name of the source file).
AC_MSG_CHECKING(if -g might not be ok after all)
AC_CACHE_VAL(pike_cv_prog_cc_g, [
echo 'void f(){}' > conftest.c
if test "`${CC-cc} -g -c conftest.c 2>&1`" = \
"`${CC-cc} -c conftest.c 2>&1`"; then
pike_cv_prog_cc_g=yes
else
pike_cv_prog_cc_g=no
fi
rm -f conftest*
])
if test "$pike_cv_prog_cc_g" = "yes"; then
AC_MSG_RESULT(yes)
ac_cv_prog_cc_g=yes
else
AC_MSG_RESULT(no)
fi
fi
if test "$ac_test_CFLAGS" = set; then :; else
if test "$GCC" = yes; then
# Remove -O2, and use a real test to restore it.
if test "$ac_cv_prog_cc_g" = yes; then
CFLAGS="-g"
else
CFLAGS=
fi
else :; fi
fi
AC_MSG_CHECKING([if we are using TCC (TenDRA C Compiler)])
AC_CACHE_VAL(pike_cv_prog_tcc, [
if $CC -V 2>&1 | grep -i TenDRA >/dev/null; then
pike_cv_prog_tcc="yes"
else
pike_cv_prog_tcc="no"
fi
])
if test "x$pike_cv_prog_tcc" = "xyes"; then
AC_MSG_RESULT(yes)
TCC="yes"
if echo "$CC $CFLAGS $CPPFLAGS" | grep " -Y" >/dev/null; then :; else
# We want to use the system API's...
CPPFLAGS="-Ysystem $CPPFLAGS"
fi
else
AC_MSG_RESULT(no)
TCC=no
fi
])
dnl option, descr, with, without, default
define([MY_AC_ARG_WITH], [
AC_ARG_WITH([$1], [$2], [
if test "x$withval" = "xno"; then
ifelse([$4], , :, [$4])
else
ifelse([$3], , :, [$3])
fi
], [$5])
])
dnl flag, descr
define([MY_DESCR],
[ substr([$1][ ],0,33) [$2]])
define([MY_AC_PROG_CC],
[
define(ac_cv_prog_CC,pike_cv_prog_CC)
AC_PROG_CC
undefine([ac_cv_prog_CC])
AC_PROG_CPP
if test "x$enable_binary" = "no"; then
# Do the check above even when --disable-binary is used, since we
# need a real $CPP, and AC_PROG_CPP wants AC_PROG_CC to be called
# earlier.
CC="$BINDIR/nobinary_dummy cc"
fi
])
pushdef([AC_CONFIG_HEADER],
[
CONFIG_HEADERS="$1"
popdef([AC_CONFIG_HEADER])
AC_CONFIG_HEADER($1)
])
AC_DEFUN([PIKE_CHECK_GNU_STUBS_H],[
AC_CHECK_HEADERS([gnu/stubs.h])
])
define([ORIG_AC_CHECK_FUNC], defn([AC_CHECK_FUNC]))
AC_DEFUN([AC_CHECK_FUNC],
[AC_REQUIRE([PIKE_CHECK_GNU_STUBS_H])dnl
AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(ac_cv_func_$1,
[AC_TRY_LINK([
#ifdef HAVE_GNU_STUBS_H
/* This file contains __stub_ defines for broken functions. */
#include
#endif
char $1();
], [
#if defined (__stub_$1) || defined (__stub___$1)
#error stupidity are us...
#else
$1();
#endif
], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])
if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then
AC_MSG_RESULT(yes)
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT(no)
ifelse([$3], , , [$3
])dnl
fi
])
define([ORIG_AC_CHECK_SIZEOF], defn([AC_CHECK_SIZEOF]))
pushdef([AC_CHECK_SIZEOF],
[
changequote(<<, >>)dnl
define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl
changequote([, ])dnl
if test "x$cross_compiling" = "xyes" -o "x$TCC" = "xyes"; then
AC_MSG_CHECKING(size of $1 ... crosscompiling or tcc)
AC_CACHE_VAL(AC_CV_NAME,[
cat > conftest.$ac_ext <
char size_info[[]] = {
0, 'S', 'i', 'Z', 'e', '_', 'I', 'n', 'F', 'o', '_',
'0' + sizeof([$1]), 0
};
EOF
if AC_TRY_EVAL(ac_compile); then
if test -f "conftest.$ac_objext"; then
AC_CV_NAME=`strings "conftest.$ac_objext" | sed -e '/^SiZe_InFo_[[0-9]]$/s/SiZe_InFo_//p' -ed | head -n 1`
if test "x$AC_CV_NAME" = "x"; then
AC_MSG_WARN([Magic cookie not found.])
AC_CV_NAME=ifelse([$2], , 0, [$2])
else :; fi
else
AC_MSG_WARN([Object file not found.])
AC_CV_NAME=ifelse([$2], , 0, [$2])
fi
else
AC_CV_NAME=0
fi
rm -rf conftest*
])
AC_MSG_RESULT($AC_CV_NAME)
elif test "x$enable_binary" = "xno"; then
AC_CV_NAME=ifelse([$2], , 0, [$2])
fi
undefine([AC_CV_NAME])dnl
ORIG_AC_CHECK_SIZEOF($1,$2)
])
define([ORIG_CHECK_HEADERS], defn([AC_CHECK_HEADERS]))
define([AC_CHECK_HEADERS],
[
if test "x$enable_binary" != "xno"; then
ORIG_CHECK_HEADERS($1,$2,$3,$4)
else
for ac_hdr in $1
do
ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'`
eval "ac_cv_header_$ac_safe=yes"
done
fi
])
AC_DEFUN(AC_MY_CHECK_TYPE,
[
AC_MSG_CHECKING([for $1])
AC_CACHE_VAL(ac_cv_type_$1,
[
AC_TRY_COMPILE([
#include
#if STDC_HEADERS
#include
#include
#endif
$3
],[
$1 tmp;
],ac_cv_type_$1=yes,ac_cv_type_$1=no)
])
if test $ac_cv_type_$1 = no; then
AC_DEFINE($1,$2)
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
fi
])
AC_DEFUN(AC_TRY_ASSEMBLE,
[ac_c_ext=$ac_ext
ac_ext=${ac_s_ext-s}
cat > conftest.$ac_ext <&AC_FD_CC
cat conftest.$ac_ext >&AC_FD_CC
ac_ext=$ac_c_ext
ifelse([$3], , , [ rm -rf conftest*
$3
])dnl
fi
rm -rf conftest*])
dnl PIKE_CHECK_CONSTANTS(checking_message, constant_names, includes, define_name)
dnl
dnl define_name will be defined to the first constant in
dnl constant_names that exists. It will remain undefined if none of
dnl them exists.
AC_DEFUN(PIKE_CHECK_CONSTANTS,
[
AC_MSG_CHECKING([$1])
AC_CACHE_VAL(pike_cv_$4_value, [
pike_cv_$4_value=""
for const in $2
do
AC_TRY_COMPILE([$3], [int tmp = (int) $const;], [
pike_cv_$4_value="$const"
break
])
done
])
if test x"$pike_cv_$4_value" != x; then
AC_MSG_RESULT($pike_cv_$4_value)
AC_DEFINE_UNQUOTED([$4], $pike_cv_$4_value)
else
AC_MSG_RESULT(none)
fi
])
dnl
dnl PIKE_FEATURE_CLEAR()
dnl PIKE_FEATURE(feature,text)
dnl
define(PIKE_FEATURE_CLEAR,[
rm pike_*.feature 2>/dev/null
])
define(PIKE_FEATURE_RAW,[
cat >pike_[$1].feature <pike_[$1].feature <&6
AC_TRY_LINK([$2], [$3], pike_cv_func_$1=yes, pike_cv_func_$1=no)
])
])
AC_MSG_RESULT([$]pike_cv_func_$1)
if test [$]pike_cv_func_$1 = yes; then
AC_DEFINE(translit(HAVE_$1,[a-z],[A-Z]))
else :; fi
])
dnl These are like AC_PATH_PROG etc, but gives a path to
dnl nobinary_dummy when --disable-binary is used. That program will
dnl always return true and have ' ' as output.
define(MY_AC_CHECK_PROG,[
if test "x$enable_binary" = "xno"; then
AC_CHECK_PROG($1,nobinary_dummy,$3,$4,$BINDIR)
else
AC_CHECK_PROG($1,$2,$3,$4,$5,$6)
fi
])
define(MY_AC_CHECK_PROGS,[
if test "x$enable_binary" = "xno"; then
AC_CHECK_PROGS($1,nobinary_dummy,$3,$BINDIR)
else
AC_CHECK_PROGS($1,$2,$3,$4)
fi
])
define(MY_AC_PATH_PROG,[
if test "x$enable_binary" = "xno"; then
AC_PATH_PROG($1,nobinary_dummy,$3,$BINDIR)
else
AC_PATH_PROG($1,$2,$3,$4)
fi
])
define(MY_AC_PATH_PROGS,[
if test "x$enable_binary" = "xno"; then
AC_PATH_PROGS($1,nobinary_dummy,$3,$BINDIR)
else
AC_PATH_PROGS($1,$2,$3,$4)
fi
])
dnl MY_AC_CHECK_PRINTF_INT_TYPE(type, alternatives, default, define, result message)
define(MY_AC_CHECK_PRINTF_INT_TYPE, [
AC_MSG_CHECKING(how to printf $1)
AC_CACHE_VAL(pike_cv_printf_$1, [
AC_TRY_COMPILE([
#define CONFIGURE_TEST
#include "global.h"
#include "pike_int_types.h"
], [
$1 tmp;
], [
found=no
for mod in $2 ; do
AC_TRY_RUN([
#include
#include
#define CONFIGURE_TEST
#include "global.h"
#include "pike_int_types.h"
int main() {
char buf[50];
if ((($1)4711) > (($1)-4711)) {
/* Signed type. */
if (sizeof($1)>4)
{
sprintf(buf, "%${mod}d,%${mod}d,%d",
(($1) 4711) << 32, -(($1) 4711) << 32, 17);
return !!strcmp("20233590931456,-20233590931456,17", buf);
}
else
{
sprintf(buf, "%${mod}d,%${mod}d,%d", ($1) 4711, ($1)-4711, 17);
return !!strcmp("4711,-4711,17", buf);
}
} else {
/* Unsigned type. */
if (sizeof($1)>4)
{
sprintf(buf, "%${mod}d,%d",
(($1) 4711) << 32, 17);
return !!strcmp("20233590931456,17", buf);
}
else
{
sprintf(buf, "%${mod}d,%d", ($1) 4711, 17);
return !!strcmp("4711,17", buf);
}
}
}], [pike_cv_printf_$1="${mod}"; found=yes], [:], [:])
test ${found} = yes && break
done
test ${found} = no && pike_cv_printf_$1=unknown
], [
pike_cv_printf_$1=nonexistent
])
])
if test x"${pike_cv_printf_$1}" = xnonexistent; then
AC_MSG_RESULT([type does not exist])
else
if test x"${pike_cv_printf_$1}" = xunknown ; then
res=$3
AC_MSG_RESULT([none found, defaulting to $5])
else
res="${pike_cv_printf_$1}"
AC_MSG_RESULT([$5])
fi
AC_DEFINE_UNQUOTED($4, "${res}")
fi
])
dnl MY_AC_CHECK_PRINTF_FLOAT_TYPE(type, alternatives, default, define, result message)
define(MY_AC_CHECK_PRINTF_FLOAT_TYPE, [
AC_MSG_CHECKING(how to printf $1)
AC_CACHE_VAL(pike_cv_printf_$1, [
AC_TRY_COMPILE([
#define CONFIGURE_TEST
#include "global.h"
], [
$1 tmp;
], [
found=no
for mod in $2 ; do
AC_TRY_RUN([
#include
#include
#include "confdefs.h"
int main() {
char buf[50];
sprintf(buf, "%${mod}4.1f,%d",($1)17.0,17);
return !!strcmp("17.0,17",buf);
}], [pike_cv_printf_$1="${mod}"; found=yes], [:], [:])
test ${found} = yes && break
done
test ${found} = no && pike_cv_printf_$1=unknown
], [
pike_cv_printf_$1=nonexistent
])
])
if test x"${pike_cv_printf_$1}" = xnonexistent; then
AC_MSG_RESULT([type does not exist])
else
if test x"${pike_cv_printf_$1}" = xunknown ; then
res=$3
AC_MSG_RESULT([none found, defaulting to $5])
else
res="${pike_cv_printf_$1}"
AC_MSG_RESULT([$5])
fi
AC_DEFINE_UNQUOTED($4, "${res}")
fi
])
dnl PIKE_MSG_WARN(message)
dnl == AC_MSG_WARN but prints with a bit more emphasis and adds to config.info.
define(PIKE_MSG_WARN, [
AC_MSG_WARN([
$1
])
cat >>config.warnings <"[$1].bundle"
break
fi
done
ifelse([$3], , , [
if test "$f" = "no"; then
# Bundle not available.
echo "Bundle [$1] not available in $pike_bundle_dir."
AC_MSG_ERROR([$3])
fi
])
fi
])
dnl PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, action-if, action-not)
dnl defines GSTUFF_LIBS, GSTUFF_CFLAGS, see pkg-config man page
dnl also defines GSTUFF_PKG_ERRORS on error
AC_DEFUN(PKG_CHECK_MODULES, [
succeeded=no
if test -z "$PKG_CONFIG"; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
fi
if test "$PKG_CONFIG" = "no" ; then
echo "*** The pkg-config script could not be found. Make sure it is"
echo "*** in your path, or set the PKG_CONFIG environment variable"
echo "*** to the full path to pkg-config."
echo "*** Or see http://www.freedesktop.org/software/pkgconfig to get pkg-config."
else
PKG_CONFIG_MIN_VERSION=0.9.0
if $PKG_CONFIG --atleast-pkgconfig-version $PKG_CONFIG_MIN_VERSION; then
AC_MSG_CHECKING(for $2)
if $PKG_CONFIG --exists "$2" ; then
AC_MSG_RESULT(yes)
succeeded=yes
AC_MSG_CHECKING($1_CFLAGS)
$1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
AC_MSG_RESULT($$1_CFLAGS)
AC_MSG_CHECKING($1_LIBS)
$1_LIBS=`$PKG_CONFIG --libs "$2"`
AC_MSG_RESULT($$1_LIBS)
else
$1_CFLAGS=""
$1_LIBS=""
## If we have a custom action on failure, don't print errors, but
## do set a variable so people can do so.
$1_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
ifelse([$4], ,echo $$1_PKG_ERRORS,)
fi
AC_SUBST($1_CFLAGS)
AC_SUBST($1_LIBS)
else
echo "*** Your version of pkg-config is too old. You need version $PKG_CONFIG_MIN_VERSION or newer."
echo "*** See http://www.freedesktop.org/software/pkgconfig"
fi
fi
if test $succeeded = yes; then
ifelse([$3], , :, [$3])
else
ifelse([$4], , AC_MSG_ERROR([Library requirements ($2) not met; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]), [$4])
fi
])
|
|