projects
/
m6w6
/
ext-psi
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
configure: fix fd restoration
[m6w6/ext-psi]
/
m4
/
psi
/
psi.m4
diff --git
a/m4/psi/psi.m4
b/m4/psi/psi.m4
index b0e30f49eff63bbf66c687e0f4dfb8539c2736fd..67878346db61e5765024af4e225c09502888b94d 100644
(file)
--- a/
m4/psi/psi.m4
+++ b/
m4/psi/psi.m4
@@
-15,6
+15,7
@@
AC_DEFUN(PSI_CONFIG_INIT, [
PHP_SUBST(PSI_DEPS)
PSI_CONFIG_TMP=$(mktemp -d)
PHP_SUBST(PSI_DEPS)
PSI_CONFIG_TMP=$(mktemp -d)
+ PSI_FUNC_LIBC_MAIN
else
PSI_FAST_CONFIG=false
PSI_DEPS=false
else
PSI_FAST_CONFIG=false
PSI_DEPS=false
@@
-40,11
+41,22
@@
AC_DEFUN(PSI_CONFIG_INIT, [
])
])
+dnl PSI_CONFIG_WAIT()
+dnl Internal: waits for sub configures in maintainer mode
+AC_DEFUN(PSI_CONFIG_WAIT, [
+ wait
+ if test $? -gt 0; then
+ cat $PSI_CONFIG_TMP/*/stderr.log >&2
+ exit 1
+ fi
+])
+
dnl PSI_CONFIG_DONE()
dnl Finish the headers with the pre-defined types etc.
AC_DEFUN(PSI_CONFIG_DONE, [
dnl PSI_CONFIG_DONE()
dnl Finish the headers with the pre-defined types etc.
AC_DEFUN(PSI_CONFIG_DONE, [
+ PSI_CONFIG_WAIT
+
if $PSI_FAST_CONFIG; then
if $PSI_FAST_CONFIG; then
- wait
for conf_env in $PSI_CONFIG_TMP/*/conf.env; do
source $conf_env
done
for conf_env in $PSI_CONFIG_TMP/*/conf.env; do
source $conf_env
done
@@
-78,7
+90,7
@@
AC_DEFUN(PSI_CONFIG_POSIX_ENABLED, [
AS_TR_SH([psi_config_posix_]$1)=true
;;
*)
AS_TR_SH([psi_config_posix_]$1)=true
;;
*)
- if expr "$PHP_PSI_POSIX" : '\b$1\b' >/dev/null; then
+ if expr "$PHP_PSI_POSIX" : '
.*
\b$1\b' >/dev/null; then
AS_TR_SH([psi_config_posix_]$1)=true
fi
;;
AS_TR_SH([psi_config_posix_]$1)=true
fi
;;
@@
-100,35
+112,35
@@
AC_DEFUN(PSI_SH_TEST_POSIX_ENABLED, [
fi
])
fi
])
-dnl PSI_CONFIG_POSIX(section, headers)
+dnl PSI_CONFIG_POSIX(section, headers
, dependents
)
AC_DEFUN(PSI_CONFIG_POSIX, [
PSI_CONFIG_POSIX_ENABLED($1, [
if $PSI_FAST_CONFIG; then
AC_DEFUN(PSI_CONFIG_POSIX, [
PSI_CONFIG_POSIX_ENABLED($1, [
if $PSI_FAST_CONFIG; then
- PSI_CONFIG_POSIX_PARALLEL($1, $2)
+ PSI_CONFIG_POSIX_PARALLEL($1, $2
, [$3]
)
else
ifelse([$2],,:,[AC_CHECK_HEADERS($2)])
AS_TR_CPP([PSI_CHECK_$1])
else
ifelse([$2],,:,[AC_CHECK_HEADERS($2)])
AS_TR_CPP([PSI_CHECK_$1])
+ $3
fi
])
])
AC_DEFUN([PSI_CONFIG_POSIX_PARALLEL], [
(
fi
])
])
AC_DEFUN([PSI_CONFIG_POSIX_PARALLEL], [
(
- dnl
setup
+ dnl
chaway
mkdir $PSI_CONFIG_TMP/AS_TR_SH([$1])
mkdir $PSI_CONFIG_TMP/AS_TR_SH([$1])
- ln -s $(pwd)/confdefs.h $PSI_CONFIG_TMP/AS_TR_SH([$1])/confdefs.h
+ cd $PSI_CONFIG_TMP/AS_TR_SH([$1])
- dnl restore stdio
- exec 66>&AS_MESSAGE_FD
- exec AS_MESSAGE_FD>$PSI_CONFIG_TMP/AS_TR_SH([$1])/stdout.log
- exec 2>$PSI_CONFIG_TMP/AS_TR_SH([$1])/stderr.log
+ dnl AC_DEFINEs
+ ln -s $abs_builddir/confdefs.h confdefs.h
+
+ dnl STDOUT, STDERR
+ exec {PSI_MESSAGE_FD}>&AS_MESSAGE_FD {PSI_ERROR_FD}>&2
+ exec AS_MESSAGE_FD>stdout.log 2>stderr.log
dnl check for headers?
ifelse([$2],,:,[AC_CHECK_HEADERS($2)])
dnl check for headers?
ifelse([$2],,:,[AC_CHECK_HEADERS($2)])
- dnl chaway
- cd $PSI_CONFIG_TMP/AS_TR_SH([$1])
-
dnl run checks
PSI_TYPES=
PSI_CONSTS=
dnl run checks
PSI_TYPES=
PSI_CONSTS=
@@
-139,21
+151,31
@@
AC_DEFUN([PSI_CONFIG_POSIX_PARALLEL], [
AS_TR_CPP([PSI_CHECK_$1])
dnl save env
AS_TR_CPP([PSI_CHECK_$1])
dnl save env
- cat >
$PSI_CONFIG_TMP/AS_TR_SH([$1])/
conf.env <<EOF
+ cat >conf.env <<EOF
LIBS="$LIBS \$LIBS"
EOF
for env in TYPES CONSTS COMPOSITES MACROS REDIRS DECLS; do
eval var=\$PSI_$env
if test -n "$var"; then
LIBS="$LIBS \$LIBS"
EOF
for env in TYPES CONSTS COMPOSITES MACROS REDIRS DECLS; do
eval var=\$PSI_$env
if test -n "$var"; then
- cat >>
$PSI_CONFIG_TMP/AS_TR_SH([$1])/
conf.env <<EOF
+ cat >>conf.env <<EOF
PSI_$env='$var'"
\$PSI_$env"
EOF
fi
done
PSI_$env='$var'"
\$PSI_$env"
EOF
fi
done
+ _AC_CACHE_DUMP >>conf.env
+ dnl restore STDOUT,STDERR
+ exec AS_MESSAGE_FD>&$PSI_MESSAGE_FD 2>&$PSI_ERROR_FD
+
dnl done
dnl done
- printf "%s " "$1" >&66
+ AS_ECHO_N(["$1 "])
+ cd - >/dev/null
+
+ dnl run dependents
+ $3
+
+ PSI_CONFIG_WAIT
) &
])
) &
])
@@
-215,6
+237,9
@@
typedef bool _Bool;
#ifdef HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h>
#endif
#ifdef HAVE_ARPA_NAMESER_H
# include <arpa/nameser.h>
#endif
+#ifdef HAVE_ARPA_INET_H
+# include <arpa/inet.h>
+#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
#ifdef HAVE_FCNTL_H
# include <fcntl.h>
#endif
@@
-275,8
+300,14
@@
AC_DEFUN(PSI_LEMON, [
AC_ARG_VAR(LEMON, The lemon parser generator of the SQLite project)
if test -z "$LEMON"
then
AC_ARG_VAR(LEMON, The lemon parser generator of the SQLite project)
if test -z "$LEMON"
then
- AC_PATH_PROG(LEMON, lemon, ./lemon)
+ AC_PATH_PROG(LEMON, lemon, $PHP_PSI_BUILDDIR/lemon)
+ if expr + "$LEMON" : "/" >/dev/null; then
+ LEMON_PATH=
+ else
+ LEMON_PATH=$abs_builddir/
+ fi
fi
fi
+ PHP_SUBST(LEMON_PATH)
PHP_SUBST(LEMON)
])
PHP_SUBST(LEMON)
])