__fail=exit
+
+__ac_tmpdir=''
+__ac_clean_up () {
+ if test "$__ac_tmpdir"; then
+ rm -rf "$__ac_tmpdir"
+ fi
+}
+trap __ac_clean_up EXIT
+
+
if dirname B/A 2>/dev/null >/dev/null; then
__ac_dirname() {
dirname "$1"
AC_CHECK_HEADERS () {
AC_PROG_CC
- echo "/* AC_CHECK_HEADERS */" > /tmp/ngc$$.c
+ echo "/* AC_CHECK_HEADERS */" > "$__ac_tmpdir/ngc$$.c"
for hdr in $*; do
- echo "#include <$hdr>" >> /tmp/ngc$$.c
+ echo "#include <$hdr>" >> "$__ac_tmpdir/ngc$$.c"
done
- echo "main() { }" >> /tmp/ngc$$.c
+ echo "main() { }" >> "$__ac_tmpdir/ngc$$.c"
LOGN "checking for header $hdr"
- if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c; then
+ if $AC_CC -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c"; then
AC_DEFINE 'HAVE_'`echo $hdr | tr 'a-z' 'A-Z' | tr './' '_'` 1
TLOG " (found)"
rc=0
TLOG " (not found)"
rc=1
fi
- rm -f /tmp/ngc$$.c /tmp/ngc$$
+ rm -f "$__ac_tmpdir/ngc$$.c" "$__ac_tmpdir/ngc$$"
return $rc
}
F=$1
shift
-rm -f /tmp/ngc$$.c
+rm -f "$__ac_tmpdir/ngc$$.c"
while [ "$1" ]; do
- echo "#include <$1>" >> /tmp/ngc$$.c
+ echo "#include <$1>" >> "$__ac_tmpdir/ngc$$.c"
shift
done
- cat >> /tmp/ngc$$.c << EOF
+ cat >> "$__ac_tmpdir/ngc$$.c" << EOF
main()
{
LOGN "checking for the $F function"
- if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $LIBS; then
+ if $AC_CC -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c" $LIBS; then
AC_DEFINE `echo ${2:-HAVE_$F} | tr 'a-z' 'A-Z'` 1
TLOG " (found)"
rc=0
else
echo "offending command was:"
- cat /tmp/ngc$$.c
- echo "$AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $LIBS"
+ cat "$__ac_tmpdir/ngc$$.c"
+ echo "$AC_CC -o $__ac_tmpdir/ngc$$ $__ac_tmpdir/ngc$$.c $LIBS"
TLOG " (not found)"
rc=1
fi
- rm -f /tmp/ngc$$.c /tmp/ngc$$
+ rm -f "$__ac_tmpdir/ngc$$.c" "$__ac_tmpdir/ngc$$"
return $rc
}
struct=$1
shift
- rm -f /tmp/ngc$$.c
+ rm -f "$__ac_tmpdir/ngc$$.c"
for include in $*; do
- echo "#include <$include>" >> /tmp/ngc$$.c
+ echo "#include <$include>" >> "$__ac_tmpdir/ngc$$.c"
done
- cat >> /tmp/ngc$$.c << EOF
+ cat >> "$__ac_tmpdir/ngc$$.c" << EOF
main()
{
struct $struct foo;
LOGN "checking for struct $struct"
- if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $AC_LIBS 2>>config.log; then
+ if $AC_CC -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c" $AC_LIBS 2>>config.log; then
AC_DEFINE HAVE_STRUCT_`echo ${struct} | tr 'a-z' 'A-Z'`
TLOG " (found)"
rc=0
TLOG " (not found)"
rc=1
fi
- rm -f /tmp/ngc$$.c /tmp/ngc$$
+ rm -f "$__ac_tmpdir/ngc$$.c" "$__ac_tmpdir/ngc$$"
return $rc
}
field=$2
shift 2
- rm -f /tmp/ngc$$.c
+ rm -f "$__ac_tmpdir/ngc$$.c"
for include in $*;do
- echo "#include <$include>" >> /tmp/ngc$$.c
+ echo "#include <$include>" >> "$__ac_tmpdir/ngc$$.c"
done
- cat >> /tmp/ngc$$.c << EOF
+ cat >> "$__ac_tmpdir/ngc$$.c" << EOF
main()
{
struct $struct foo;
LOGN "checking that struct $struct has a $field field"
- if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $AC_LIBS 2>>config.log; then
+ if $AC_CC -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c" $AC_LIBS 2>>config.log; then
AC_DEFINE HAVE_`echo ${struct}_$field | tr 'a-z' 'A-Z'`
TLOG " (yes)"
rc=0
TLOG " (no)"
rc=1
fi
- rm -f /tmp/ngc$$.c /tmp/ngc$$
+ rm -f "$__ac_tmpdir/ngc$$.c" "$__ac_tmpdir/ngc$$"
return $rc
}
AC_PROG_CC () {
test "$AC_CC" && return 0
- cat > /tmp/ngc$$.c << \EOF
+ cat > "$__ac_tmpdir/ngc$$.c" << \EOF
#include <stdio.h>
main()
{
fi
echo "checking out the C compiler"
- $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c
+ $AC_CC -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c"
status=$?
TLOGN " ($AC_CC)"
if [ "$CFLAGS" ]; then
test "$CFLAGS" && echo "validating CFLAGS=${CFLAGS}"
- if $AC_CC $CFLAGS -o /tmp/ngc$$.o /tmp/ngc$$.c ; then
+ if $AC_CC $CFLAGS -o "$__ac_tmpdir/ngc$$.o" "$__ac_tmpdir/ngc$$.c" ; then
AC_CFLAGS=${CFLAGS:-"-g"}
test "$CFLAGS" && echo "CFLAGS=\"${CFLAGS}\" are okay"
elif [ "$CFLAGS" ]; then
fi
if [ "$LDFLAGS" ]; then
test "$LDFLAGS" && echo "validating LDFLAGS=${LDFLAGS}"
- if $AC_CC $LDFLAGS -o /tmp/ngc$$ /tmp/ngc$$.o; then
+ if $AC_CC $LDFLAGS -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.o"; then
AC_LDFLAGS=${LDFLAGS:-"-g"}
test "$LDFLAGS" && TLOG "LDFLAGS=\"${LDFLAGS}\" are okay"
elif [ "$LDFLAGS" ]; then
AC_SUB 'CC' "$AC_CC"
- rm -f /tmp/ngc$$ /tmp/ngc$$.c /tmp/ngc$$.o
+ rm -f "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c" "$__ac_tmpdir/ngc$$.o"
return $status
}
# and fd 5 points to what used to be fd 1
#
AC_INIT () {
+ __ac_tmpdir=$(mktemp -d)
__config_files="config.cmd config.sub config.h config.mak config.log"
__config_detritus="config.h.tmp"
rm -f $__config_files $__config_detritus
DEST=`acLookFor ln`
if [ "$DEST" ]; then
- rm -f /tmp/b$$
- $DEST -s /tmp/a$$ /tmp/b$$
- if [ "`$AC_FIND_PROG /tmp/b$$ -type l -print`" ]; then
+ rm -f "$__ac_tmpdir/b$$"
+ $DEST -s "$__ac_tmpdir/a$$" "$__ac_tmpdir/b$$"
+ if [ "`$AC_FIND_PROG $__ac_tmpdir/b$$ -type l -print`" ]; then
TLOG " ($DEST)"
echo "$DEST exists, and ln -s works"
AC_SUB 'LN_S' "$DEST -s"
- rm -f /tmp/b$$
+ rm -f "$__ac_tmpdir/b$$"
else
AC_SUB 'LN_S' ''
TLOG " ($DEST exists, but -s does not seem to work)"
echo "$DEST exists, but ln -s doesn't seem to work"
- rm -f /tmp/b$$
+ rm -f "$__ac_tmpdir/b$$"
return 1
fi
else
# AC_TYPE_PID_T checks to see if the pid_t type exists
#
AC_TYPE_PID_T () {
- cat > /tmp/pd$$.c << EOF
+ cat > "$__ac_tmpdir/pd$$.c" << EOF
#include <sys/types.h>
main() { pid_t me; }
EOF
LOGN "checking for pid_t"
- if $AC_CC -c /tmp/pd$$.c -o /tmp/pd$$.o; then
+ if $AC_CC -c "$__ac_tmpdir/pd$$.c" -o "$__ac_tmpdir/pd$$.o"; then
TLOG " (found)"
rc=0
else
TLOG " (not found)"
rc=1
fi
- rm -f /tmp/pd$$.o /tmp/pd$$.c
+ rm -f "$__ac_tmpdir/pd$$.o" "$__ac_tmpdir/pd$$.c"
return $rc
}
# AC_C_CONST checks to see if the compiler supports the const keyword
#
AC_C_CONST () {
- cat > /tmp/pd$$.c << EOF
+ cat > "$__ac_tmpdir/pd$$.c" << EOF
const char me=1;
EOF
LOGN "checking for \"const\" keyword"
- if $AC_CC -c /tmp/pd$$.c -o /tmp/pd$$.o; then
+ if $AC_CC -c "$__ac_tmpdir/pd$$.c" -o "$__ac_tmpdir/pd$$.o"; then
TLOG " (yes)"
rc=0
else
TLOG " (no)"
rc=1
fi
- rm -f /tmp/pd$$.o /tmp/pd$$.c
+ rm -f "$__ac_tmpdir/pd$$.o" "$__ac_tmpdir/pd$$.c"
return $rc
}
# AC_SCALAR_TYPES checks to see if the compiler can generate 2 and 4 byte ints.
#
AC_SCALAR_TYPES () {
- cat > /tmp/pd$$.c << EOF
+ cat > "$__ac_tmpdir/pd$$.c" << EOF
#include <stdio.h>
main()
{
EOF
rc=1
LOGN "defining WORD & DWORD scalar types"
- if $AC_CC /tmp/pd$$.c -o /tmp/pd$$; then
- if /tmp/pd$$ >> $__cwd/config.h.tmp; then
+ if $AC_CC "$__ac_tmpdir/pd$$.c" -o "$__ac_tmpdir/pd$$"; then
+ if "$__ac_tmpdir/pd$$" >> $__cwd/config.h.tmp; then
rc=0
fi
fi
0) TLOG "" ;;
*) TLOG " ** FAILED **" ;;
esac
- rm -f /tmp/pd$$ /tmp/pd$$.c
+ rm -f "$__ac_tmpdir/pd$$" "$__ac_tmpdir/pd$$.c"
}
TLOGN "checking for the Berkeley resolver library"
- cat > /tmp/ngc$$.c << EOF
+ cat > "$__ac_tmpdir/ngc$$.c" << EOF
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
# first see if res_init() and res_query() actually exist...
- if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c; then
+ if $AC_CC -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c"; then
__extralib=
- elif $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c -lresolv; then
+ elif $AC_CC -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c" -lresolv; then
__extralib=-lresolv
AC_LIBS="$AC_LIBS -lresolv"
else
TLOG " (not found)"
- rm -f /tmp/ngc$$.c
+ rm -f "$__ac_tmpdir/ngc$$.c"
return 1
fi
# if res_init() and res_query() actually exist, check to
# see if the HEADER structure is defined ...
- cat > /tmp/ngc$$.c << EOF
+ cat > "$__ac_tmpdir/ngc$$.c" << EOF
#include <sys/types.h>
#include <netinet/in.h>
#include <arpa/nameser.h>
}
EOF
- if $AC_CC -o /tmp/ngc$$ /tmp/ngc$$.c $__extralib; then
+ if $AC_CC -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c" $__extralib; then
TLOG " (found)"
- elif $AC_CC -DBIND_8_COMPAT -o /tmp/ngc$$ /tmp/ngc$$.c $__extralib; then
+ elif $AC_CC -DBIND_8_COMPAT -o "$__ac_tmpdir/ngc$$" "$__ac_tmpdir/ngc$$.c" $__extralib; then
TLOG " (bind9 with BIND_8_COMPAT)"
AC_DEFINE BIND_8_COMPAT 1
else
TLOG " (broken)"
- rm -f /tmp/ngc$$.c
+ rm -f "$__ac_tmpdir/ngc$$.c"
return 1
fi
- rm -f /tmp/ngc$$.c
+ rm -f "$__ac_tmpdir/ngc$$.c"
return 0
}
unset IS_BSD
if [ "$DEST" ]; then
# BSD install or GNU install? Let's find out...
- touch /tmp/a$$
+ touch "$__ac_tmpdir/a$$"
- $DEST /tmp/a$$ /tmp/b$$
+ $DEST "$__ac_tmpdir/a$$" "$__ac_tmpdir/b$$"
- if test -r /tmp/a$$; then
+ if test -r "$__ac_tmpdir/a$$"; then
LOG " ($DEST)"
else
IS_BSD=1
LOG " ($DEST) bsd install"
fi
- rm -f /tmp/a$$ /tmp/b$$
+ rm -f "$__ac_tmpdir/a$$" "$__ac_tmpdir/b$$"
else
DEST=`acLookFor ginstall`
if [ "$DEST" ]; then
# compiler options
#
acCheckCPP () {
- cat > /tmp/ngc$$.c << EOF
+ cat > "$__ac_tmpdir/ngc$$.c" << EOF
#define FOO BAR
FOO
EOF
- if $1 $2 /tmp/ngc$$.c > /tmp/ngc$$.o; then
- if grep -v '#define' /tmp/ngc$$.o | grep -s BAR >/dev/null; then
+ if $1 $2 "$__ac_tmpdir/ngc$$.c" > "$__ac_tmpdir/ngc$$.o"; then
+ if grep -v '#define' "$__ac_tmpdir/ngc$$.o" | grep -s BAR >/dev/null; then
echo "CPP=[$1], CPPFLAGS=[$2]"
AC_SUB 'CPP' "$1"
AC_SUB 'CPPFLAGS' "$2"
- rm /tmp/ngc$$.c /tmp/ngc$$.o
+ rm "$__ac_tmpdir/ngc$$.c" "$__ac_tmpdir/ngc$$.o"
return 0
fi
fi
- rm /tmp/ngc$$.c /tmp/ngc$$.o
+ rm "$__ac_tmpdir/ngc$$.c" "$__ac_tmpdir/ngc$$.o"
return 1
}