#!/bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf. # Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create] # [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET] # Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and # --with-PACKAGE unless this script has special code to handle it. for arg do # Handle --exec-prefix with a space before the argument. if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix= # Handle --host with a space before the argument. elif test x$next_host = xyes; then next_host= # Handle --prefix with a space before the argument. elif test x$next_prefix = xyes; then prefix=$arg; next_prefix= # Handle --srcdir with a space before the argument. elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir= else case $arg in # For backward compatibility, also recognize exact --exec_prefix. -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*) exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e) next_exec_prefix=yes ;; -gas | --gas | --ga | --g) ;; -host=* | --host=* | --hos=* | --ho=* | --h=*) ;; -host | --host | --hos | --ho | --h) next_host=yes ;; -nfp | --nfp | --nf) ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no) no_create=1 ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) next_prefix=yes ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*) srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s) next_srcdir=yes ;; -with-* | --with-*) package=`echo $arg|sed 's/-*with-//'` # Delete all the valid chars; see if any are left. if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then echo "configure: $package: invalid package name" >&2; exit 1 fi eval "with_`echo $package|sed s/-/_/g`=1" ;; *) ;; esac fi done trap 'rm -f conftest* core; exit 1' 1 3 15 rm -f conftest* compile='${CC-cc} $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1' # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. unique_file=udposix.h # Find the source files, if location was not specified. if test -z "$srcdir"; then srcdirdefaulted=yes # Try the directory containing this script, then `..'. prog=$0 confdir=`echo $prog|sed 's%/[^/][^/]*$%%'` test "X$confdir" = "X$prog" && confdir=. srcdir=$confdir if test ! -r $srcdir/$unique_file; then srcdir=.. fi fi if test ! -r $srcdir/$unique_file; then if test x$srcdirdefaulted = xyes; then echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2 else echo "configure: Can not find sources in \`${srcdir}'." 1>&2 fi exit 1 fi # Preserve a srcdir of `.' to avoid automounter screwups with pwd. # But we can't avoid them for `..', to make subdirectories work. case $srcdir in .|/*|~*) ;; *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute. esac if [ -r CUSTOMIZE ]; then echo reading configuration customizations . ./CUSTOMIZE fi for arg in udposix.h.in; do case "$PORT_MANIFEST" in *$arg*) ;; *) PORT_MANIFEST="$PORT_MANIFEST $arg";; esac done CPPFLAGS=${CPPFLAGS-"-DNDEBUG"} CFLAGS=${CFLAGS-"-O"} if test -z "$OS"; then echo checking for type of operating system cat << \CAT_EOF > conftest.c #ifdef __osf__ OS_osf #endif #ifdef _AIX OS_aix #endif #ifdef hpux OS_hpux #endif #ifdef sgi OS_irix #endif #ifdef sun OS_sunos #endif #ifdef ultrix OS_ultrix #endif #ifdef _UNICOS OS_unicos #endif #ifdef masscomp OS_rtu #endif CAT_EOF OS=`cc -E conftest.c | sed -n '/^OS_/ { s///p q }'` rm conftest.c if test -z "$OS"; then echo "OS:operating system:sunos" >> conf.missing fi fi case "${OS}" in aix*) for arg in -D_ALL_SOURCE; do case "$CPPFLAGS" in *$arg*) ;; *) CPPFLAGS="$CPPFLAGS $arg";; esac done ;; hpux*) for arg in -D_HPUX_SOURCE; do case "$CPPFLAGS" in *$arg*) ;; *) CPPFLAGS="$CPPFLAGS $arg";; esac done ;; esac LIBOBJS=${LIBOBJS-""} PORT_HEADERS=${PORT_HEADERS-""} PORT_MANIFEST=${PORT_MANIFEST-""} PORT_SUBDIRS=${PORT_SUBDIRS-""} if test -z "$CC"; then echo checking for cc saveifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/cc; then CC="cc" break fi done IFS="$saveifs" fi test -z "$CC" && CC="" if test -z "$CC"; then echo "CC:C compiler:/bin/cc" >> conf.missing fi # Find out if we are using GNU C, under whatever name. cat < conftest.c #ifdef __GNUC__ yes #endif EOF ${CC-cc} -E conftest.c > conftest.out 2>&1 if egrep yes conftest.out >/dev/null 2>&1; then GCC=1 # For later tests. CC="$CC -O" fi rm -f conftest* if test -z "$AR"; then echo checking for ar saveifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ar; then AR="ar" break fi done IFS="$saveifs" fi test -z "$AR" && AR="" if test -z "$AR"; then echo "AR:library utility:/bin/ar" >> conf.missing fi if test -z "$RANLIB"; then echo checking for ranlib saveifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ranlib; then RANLIB="ranlib" break fi done IFS="$saveifs" fi test -z "$RANLIB" && RANLIB="@:" echo setting the installation prefix prefix=`case "${prefix-../../..}" in /*) echo ${prefix-../../..}; exit;; *) path=\`pwd\`/${prefix-../../..} tail= while test -n "$path"; do (cd $path && echo \`pwd\`$rest) 2> /dev/null && exit base=/\`basename "$path"\` tail=/$base$tail path=\`echo "$path" | sed "s/\/$base//"\` done;; esac ` test -z "$exec_prefix" && exec_prefix=$prefix/bin CPPFLAGS=${CPPFLAGS-"-DNDEBUG"} CFLAGS=${CFLAGS-"-O"} FFLAGS=${FFLAGS-"-O"} LIBOBJS=${LIBOBJS-""} if test -z "$RANLIB"; then echo checking for ranlib saveifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/ranlib; then RANLIB="ranlib" break fi done IFS="$saveifs" fi test -z "$RANLIB" && RANLIB="@:" case "$OS" in hpux*) for p in fort77 fortc f77 do if test -z "$FC"; then echo checking for $p saveifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/$p; then FC="$p" break fi done IFS="$saveifs" fi test -z "$FC" && FC="" test -n "$FC" && break done ;; *) for p in f77 cf77 do if test -z "$FC"; then echo checking for $p saveifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/$p; then FC="$p" break fi done IFS="$saveifs" fi test -z "$FC" && FC="" test -n "$FC" && break done ;; esac if test -z "$FC"; then echo "FC:FORTRAN compiler:/bin/f77" >> conf.missing fi echo checking how to run the C preprocessor if test -z "$CPP"; then CPP='${CC-cc} -E' cat > conftest.c < EOF err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"` if test -z "$err"; then : else CPP=/lib/cpp fi rm -f conftest* fi CPP=`eval echo $CPP` echo "#include " > conftest.c if test `$CPP conftest.c 2> /dev/null | wc -l` = 0; then if test "$CPP" = cpp; then echo 1>&2 "$0: C preprocessor, \`$CPP', doesn't work" echo "CPP:C preprocessor:/lib/cpp" >> conf.missing else echo 1>&2 "$0: C preprocessor, \`$CPP', doesn't work; setting to \`cpp'" CPP=cpp if test `which ${CPP} 2>&1 | wc -w` != 1; then echo 1>&2 "$0: C preprocessor, \`$CPP', doesn't exist" echo "CPP:C preprocessor:/lib/cpp" >> conf.missing fi fi fi rm -f conftest.c echo checking for working const cat > conftest.c < conftest.c < conftest.c < conftest.c < main() { exit(0); } t() { ;} int foo(int bar, ...) { va_list alist; va_start(alist, bar); bar = (int)va_arg(alist, int); va_end(alist); return bar; } EOF if eval $compile; then echo "#include " > conftestpath.c path=`$CPP conftestpath.c 2> /dev/null | sed -n 's/^#.* 1 "\(.*stdarg\.h\)".*/\1/p' | head -1` if test -z "$path"; then path=/dev/null else path=//$path fi rm -f conftestpath.c DEFS="$DEFS -DUD_SYSTEM_STDARG_H=\"$path\"" SEDDEFS="${SEDDEFS}\${SEDdA}UD_SYSTEM_STDARG_H\${SEDdB}UD_SYSTEM_STDARG_H\${SEDdC}\"$path\"\${SEDdD} \${SEDuA}UD_SYSTEM_STDARG_H\${SEDuB}UD_SYSTEM_STDARG_H\${SEDuC}\"$path\"\${SEDuD} \${SEDeA}UD_SYSTEM_STDARG_H\${SEDeB}UD_SYSTEM_STDARG_H\${SEDeC}\"$path\"\${SEDeD} " for arg in port/stdarg.h; do case "$UC_TRANSFORMEES" in *$arg*) ;; *) UC_TRANSFORMEES="$UC_TRANSFORMEES $arg";; esac done else DEFS="$DEFS -DUD_NO_STDARG=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_STDARG\${SEDdB}UD_NO_STDARG\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_STDARG\${SEDuB}UD_NO_STDARG\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_STDARG\${SEDeB}UD_NO_STDARG\${SEDeC}1\${SEDeD} " echo "#include " > conftestpath.c path=`$CPP conftestpath.c 2> /dev/null | sed -n 's/^#.* 1 "\(.*varargs\.h\)".*/\1/p' | head -1` if test -z "$path"; then path=/dev/null else path=//$path fi rm -f conftestpath.c DEFS="$DEFS -DUD_SYSTEM_STDARG_H=\"$path\"" SEDDEFS="${SEDDEFS}\${SEDdA}UD_SYSTEM_STDARG_H\${SEDdB}UD_SYSTEM_STDARG_H\${SEDdC}\"$path\"\${SEDdD} \${SEDuA}UD_SYSTEM_STDARG_H\${SEDuB}UD_SYSTEM_STDARG_H\${SEDuC}\"$path\"\${SEDuD} \${SEDeA}UD_SYSTEM_STDARG_H\${SEDeB}UD_SYSTEM_STDARG_H\${SEDeC}\"$path\"\${SEDeD} " for arg in port/varargs.h; do case "$UC_TRANSFORMEES" in *$arg*) ;; *) UC_TRANSFORMEES="$UC_TRANSFORMEES $arg";; esac done fi rm -f conftest* for arg in stdarg.h; do case "$PORT_HEADERS" in *$arg*) ;; *) PORT_HEADERS="$PORT_HEADERS $arg";; esac done echo checking for stringization cat > conftest.c < conftest.c < conftest.c <" > conftestpath.c path=`$CPP conftestpath.c 2> /dev/null | sed -n 's/^#.* 1 "\(.*stddef\.h\)".*/\1/p' | head -1` if test -z "$path"; then path=/dev/null else path=//$path fi rm -f conftestpath.c DEFS="$DEFS -DUD_SYSTEM_STDDEF_H=\"$path\"" SEDDEFS="${SEDDEFS}\${SEDdA}UD_SYSTEM_STDDEF_H\${SEDdB}UD_SYSTEM_STDDEF_H\${SEDdC}\"$path\"\${SEDdD} \${SEDuA}UD_SYSTEM_STDDEF_H\${SEDuB}UD_SYSTEM_STDDEF_H\${SEDuC}\"$path\"\${SEDuD} \${SEDeA}UD_SYSTEM_STDDEF_H\${SEDeB}UD_SYSTEM_STDDEF_H\${SEDeC}\"$path\"\${SEDeD} " for arg in port/stddef.h; do case "$UC_TRANSFORMEES" in *$arg*) ;; *) UC_TRANSFORMEES="$UC_TRANSFORMEES $arg";; esac done echo checking for macro offsetof cat > conftest.c < #ifdef offsetof error #endif main() { exit(0); } t() { } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_OFFSETOF_MACRO=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_OFFSETOF_MACRO\${SEDdB}UD_NO_OFFSETOF_MACRO\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_OFFSETOF_MACRO\${SEDuB}UD_NO_OFFSETOF_MACRO\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_OFFSETOF_MACRO\${SEDeB}UD_NO_OFFSETOF_MACRO\${SEDeC}1\${SEDeD} " fi rm -f conftest* for arg in fortc; do case "$PORT_SUBDIRS" in *$arg*) ;; *) PORT_SUBDIRS="$PORT_SUBDIRS $arg";; esac done for arg in fortc.h fortc.fc udalloc.h; do case "$PORT_MANIFEST" in *$arg*) ;; *) PORT_MANIFEST="$PORT_MANIFEST $arg";; esac done dir=`pwd`/port/fortc FORTC="$dir/fortc" NEED_FORTC=yes if test -z "$NEQN"; then echo checking for neqn saveifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/neqn; then NEQN="neqn" break fi done IFS="$saveifs" fi test -z "$NEQN" && NEQN="cat" test "$NEQN" = cat && echo 1>&2 "$0: Can't find program \`neqn'; setting to \`cat'" if test -z "$TBL"; then echo checking for tbl saveifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. if test -f $dir/tbl; then TBL="tbl" break fi done IFS="$saveifs" fi test -z "$TBL" && TBL="cat" test "$TBL" = cat && echo 1>&2 "$0: Can't find \`tbl'; setting to \`cat'" # Make sure to not get the incompatible SysV /etc/install and # /usr/sbin/install, which might be in PATH before a BSD-like install, # or the SunOS /usr/etc/install directory, or the AIX /bin/install, # or the AFS install, which mishandles nonexistent args. (Sigh.) if test -z "$INSTALL"; then echo checking for install saveifs="$IFS"; IFS="${IFS}:" for dir in $PATH; do test -z "$dir" && dir=. case $dir in /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;; *) if test -f $dir/install; then if grep dspmsg $dir/install >/dev/null 2>&1; then : # AIX else INSTALL="$dir/install -c" INSTALL_PROGRAM='$(INSTALL)' INSTALL_DATA='$(INSTALL) -m 644' break fi fi ;; esac done IFS="$saveifs" fi INSTALL=${INSTALL-cp} INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'} INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'} INSTALL_DATA="`echo "${INSTALL_DATA}" | sed 's/644/664/'`" for arg in signal.h.in sigaddset.c \ sigdelset.c sigemptyset.c sigfillset.c sigismember.c sigpending.c \ sigprocmask.c sigsuspend.c; do case "$PORT_MANIFEST" in *$arg*) ;; *) PORT_MANIFEST="$PORT_MANIFEST $arg";; esac done for arg in signal.h; do case "$PORT_HEADERS" in *$arg*) ;; *) PORT_HEADERS="$PORT_HEADERS $arg";; esac done echo "#include " > conftestpath.c path=`$CPP conftestpath.c 2> /dev/null | sed -n 's/^#.* 1 "\(.*signal\.h\)".*/\1/p' | head -1` if test -z "$path"; then path=/dev/null else path=//$path fi rm -f conftestpath.c DEFS="$DEFS -DUD_SYSTEM_SIGNAL_H=\"$path\"" SEDDEFS="${SEDDEFS}\${SEDdA}UD_SYSTEM_SIGNAL_H\${SEDdB}UD_SYSTEM_SIGNAL_H\${SEDdC}\"$path\"\${SEDdD} \${SEDuA}UD_SYSTEM_SIGNAL_H\${SEDuB}UD_SYSTEM_SIGNAL_H\${SEDuC}\"$path\"\${SEDuD} \${SEDeA}UD_SYSTEM_SIGNAL_H\${SEDeB}UD_SYSTEM_SIGNAL_H\${SEDeC}\"$path\"\${SEDeD} " for arg in port/signal.h; do case "$UC_TRANSFORMEES" in *$arg*) ;; *) UC_TRANSFORMEES="$UC_TRANSFORMEES $arg";; esac done echo checking for typedef sigset_t cat > conftest.c < typedef void sigset_t; main() { exit(0); } t() { } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGSET_T=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGSET_T\${SEDdB}UD_NO_SIGSET_T\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGSET_T\${SEDuB}UD_NO_SIGSET_T\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGSET_T\${SEDeB}UD_NO_SIGSET_T\${SEDeC}1\${SEDeD} " fi rm -f conftest* echo checking for typedef sig_atomic_t cat > conftest.c < typedef void sig_atomic_t; main() { exit(0); } t() { } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIG_ATOMIC_T=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIG_ATOMIC_T\${SEDdB}UD_NO_SIG_ATOMIC_T\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIG_ATOMIC_T\${SEDuB}UD_NO_SIG_ATOMIC_T\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIG_ATOMIC_T\${SEDeB}UD_NO_SIG_ATOMIC_T\${SEDeC}1\${SEDeD} " fi rm -f conftest* echo checking for structure sigaction cat > conftest.c < struct sigaction {char *foo;}; main() { exit(0); } t() { } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGACTION_STRUCT=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGACTION_STRUCT\${SEDdB}UD_NO_SIGACTION_STRUCT\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGACTION_STRUCT\${SEDuB}UD_NO_SIGACTION_STRUCT\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGACTION_STRUCT\${SEDeB}UD_NO_SIGACTION_STRUCT\${SEDeC}1\${SEDeD} " fi rm -f conftest* echo checking for function sigemptyset declaration cat > conftest.c < main() { exit(0); } t() { extern struct {int foo;} *sigemptyset(); } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGEMPTYSET_DECL=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGEMPTYSET_DECL\${SEDdB}UD_NO_SIGEMPTYSET_DECL\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGEMPTYSET_DECL\${SEDuB}UD_NO_SIGEMPTYSET_DECL\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGEMPTYSET_DECL\${SEDeB}UD_NO_SIGEMPTYSET_DECL\${SEDeC}1\${SEDeD} " for func in sigemptyset do echo checking for ${func} cat > conftest.c < conftest.c < main() { exit(0); } t() { extern struct {int foo;} *sigfillset(); } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGFILLSET_DECL=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGFILLSET_DECL\${SEDdB}UD_NO_SIGFILLSET_DECL\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGFILLSET_DECL\${SEDuB}UD_NO_SIGFILLSET_DECL\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGFILLSET_DECL\${SEDeB}UD_NO_SIGFILLSET_DECL\${SEDeC}1\${SEDeD} " for func in sigfillset do echo checking for ${func} cat > conftest.c < conftest.c < main() { exit(0); } t() { extern struct {int foo;} *sigaddset(); } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGADDSET_DECL=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGADDSET_DECL\${SEDdB}UD_NO_SIGADDSET_DECL\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGADDSET_DECL\${SEDuB}UD_NO_SIGADDSET_DECL\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGADDSET_DECL\${SEDeB}UD_NO_SIGADDSET_DECL\${SEDeC}1\${SEDeD} " for func in sigaddset do echo checking for ${func} cat > conftest.c < conftest.c < main() { exit(0); } t() { extern struct {int foo;} *sigdelset(); } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGDELSET_DECL=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGDELSET_DECL\${SEDdB}UD_NO_SIGDELSET_DECL\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGDELSET_DECL\${SEDuB}UD_NO_SIGDELSET_DECL\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGDELSET_DECL\${SEDeB}UD_NO_SIGDELSET_DECL\${SEDeC}1\${SEDeD} " for func in sigdelset do echo checking for ${func} cat > conftest.c < conftest.c < main() { exit(0); } t() { extern struct {int foo;} *sigismember(); } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGISMEMBER_DECL=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGISMEMBER_DECL\${SEDdB}UD_NO_SIGISMEMBER_DECL\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGISMEMBER_DECL\${SEDuB}UD_NO_SIGISMEMBER_DECL\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGISMEMBER_DECL\${SEDeB}UD_NO_SIGISMEMBER_DECL\${SEDeC}1\${SEDeD} " for func in sigismember do echo checking for ${func} cat > conftest.c < conftest.c < main() { exit(0); } t() { extern struct {int foo;} *sigaction(); } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGACTION_DECL=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGACTION_DECL\${SEDdB}UD_NO_SIGACTION_DECL\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGACTION_DECL\${SEDuB}UD_NO_SIGACTION_DECL\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGACTION_DECL\${SEDeB}UD_NO_SIGACTION_DECL\${SEDeC}1\${SEDeD} " for func in sigaction do echo checking for ${func} cat > conftest.c < conftest.c < main() { exit(0); } t() { extern struct {int foo;} *sigprocmask(); } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGPROCMASK_DECL=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGPROCMASK_DECL\${SEDdB}UD_NO_SIGPROCMASK_DECL\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGPROCMASK_DECL\${SEDuB}UD_NO_SIGPROCMASK_DECL\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGPROCMASK_DECL\${SEDeB}UD_NO_SIGPROCMASK_DECL\${SEDeC}1\${SEDeD} " for func in sigprocmask do echo checking for ${func} cat > conftest.c < conftest.c < main() { exit(0); } t() { extern struct {int foo;} *sigpending(); } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGPENDING_DECL=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGPENDING_DECL\${SEDdB}UD_NO_SIGPENDING_DECL\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGPENDING_DECL\${SEDuB}UD_NO_SIGPENDING_DECL\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGPENDING_DECL\${SEDeB}UD_NO_SIGPENDING_DECL\${SEDeC}1\${SEDeD} " for func in sigpending do echo checking for ${func} cat > conftest.c < conftest.c < main() { exit(0); } t() { extern struct {int foo;} *sigsuspend(); } EOF if eval $compile; then DEFS="$DEFS -DUD_NO_SIGSUSPEND_DECL=1" SEDDEFS="${SEDDEFS}\${SEDdA}UD_NO_SIGSUSPEND_DECL\${SEDdB}UD_NO_SIGSUSPEND_DECL\${SEDdC}1\${SEDdD} \${SEDuA}UD_NO_SIGSUSPEND_DECL\${SEDuB}UD_NO_SIGSUSPEND_DECL\${SEDuC}1\${SEDuD} \${SEDeA}UD_NO_SIGSUSPEND_DECL\${SEDeB}UD_NO_SIGSUSPEND_DECL\${SEDeC}1\${SEDeD} " for func in sigsuspend do echo checking for ${func} cat > conftest.c < conftest.c < main() { exit(0); } t() { #ifdef __stub_${func} choke me #else /* Override any gcc2 internal prototype to avoid an error. */ extern char ${func}(); ${func}(); #endif } EOF if eval $compile; then DEFS="$DEFS -D${trfunc}=1" SEDDEFS="${SEDDEFS}\${SEDdA}${trfunc}\${SEDdB}${trfunc}\${SEDdC}1\${SEDdD} \${SEDuA}${trfunc}\${SEDuB}${trfunc}\${SEDuC}1\${SEDuD} \${SEDeA}${trfunc}\${SEDeB}${trfunc}\${SEDeC}1\${SEDeD} " fi rm -f conftest* #endif done FTPDIR=${FTPDIR-/home/ftp}/pub/sdm echo checking for package version if test -z "$VERSION"; then if test -r VERSION; then \ VERSION="`cat VERSION`" else VERSION= fi fi if test -z "$MAJOR_NO"; then if test -n "$VERSION"; then \ MAJOR_NO=`echo $VERSION | sed -n '/^\([0-9][0-9]*\)\.[0-9][0-9]*.*/s//\1/p;q'` else MAJOR_NO= fi fi if test -z "$MINOR_NO"; then if test -n "$VERSION"; then \ MINOR_NO=`echo $VERSON | sed -n '/^[0-9][0-9]*\.\([0-9][0-9]*\).*/s//\1/p;q'` else MINOR_NO= fi fi if test -n "$prefix"; then test -z "$exec_prefix" && exec_prefix='${prefix}' prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%" fi if test -n "$exec_prefix"; then prsub="$prsub s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%\ exec_prefix\\1=\\2$exec_prefix%" fi trap 'rm -f config.status; exit 1' 1 3 15 echo creating config.status rm -f config.status cat > config.status </dev/null`: # # $0 $* for arg do case "\$arg" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) exec /bin/sh $0 $* ;; *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;; esac done trap 'rm -f Makefile \ fortc/Makefile \ ${UC_TRANSFORMEES-} port/udposix.h conftest*; exit 1' 1 3 15 PORT_MANIFEST='$PORT_MANIFEST' CPPFLAGS='$CPPFLAGS' CFLAGS='$CFLAGS' OS='$OS' LIBOBJS='$LIBOBJS' PORT_HEADERS='$PORT_HEADERS' PORT_SUBDIRS='$PORT_SUBDIRS' CC='$CC' AR='$AR' RANLIB='$RANLIB' prefix='$prefix' exec_prefix='$exec_prefix' FFLAGS='$FFLAGS' FC='$FC' CPP='$CPP' UC_TRANSFORMEES='$UC_TRANSFORMEES' FORTC='$FORTC' NEED_FORTC='$NEED_FORTC' NEQN='$NEQN' TBL='$TBL' INSTALL='$INSTALL' INSTALL_PROGRAM='$INSTALL_PROGRAM' INSTALL_DATA='$INSTALL_DATA' FTPDIR='$FTPDIR' VERSION='$VERSION' MAJOR_NO='$MAJOR_NO' MINOR_NO='$MINOR_NO' LIBS='$LIBS' srcdir='$srcdir' prefix='$prefix' exec_prefix='$exec_prefix' prsub='$prsub' EOF cat >> config.status <<\EOF top_srcdir=$srcdir for file in .. Makefile \ fortc/Makefile \ ${UC_TRANSFORMEES-}; do if [ "x$file" != "x.." ]; then srcdir=$top_srcdir # Remove last slash and all that follows it. Not all systems have dirname. dir=`echo $file|sed 's%/[^/][^/]*$%%'` if test "$dir" != "$file"; then test "$top_srcdir" != . && srcdir=$top_srcdir/$dir test ! -d $dir && mkdir $dir fi echo creating $file rm -f $file case $file in *.c|*.h) echo "/* Generated automatically from `echo $file|sed 's|.*/||'`.in by configure. */" > $file;; *) echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file;; esac sed -e " $prsub s%@PORT_MANIFEST@%$PORT_MANIFEST%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CFLAGS@%$CFLAGS%g s%@OS@%$OS%g s%@LIBOBJS@%$LIBOBJS%g s%@PORT_HEADERS@%$PORT_HEADERS%g s%@PORT_SUBDIRS@%$PORT_SUBDIRS%g s%@CC@%$CC%g s%@AR@%$AR%g s%@RANLIB@%$RANLIB%g s%@prefix@%$prefix%g s%@exec_prefix@%$exec_prefix%g s%@FFLAGS@%$FFLAGS%g s%@FC@%$FC%g s%@CPP@%$CPP%g s%@UC_TRANSFORMEES@%$UC_TRANSFORMEES%g s%@FORTC@%$FORTC%g s%@NEED_FORTC@%$NEED_FORTC%g s%@NEQN@%$NEQN%g s%@TBL@%$TBL%g s%@INSTALL@%$INSTALL%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@FTPDIR@%$FTPDIR%g s%@VERSION@%$VERSION%g s%@MAJOR_NO@%$MAJOR_NO%g s%@MINOR_NO@%$MINOR_NO%g s%@LIBS@%$LIBS%g s%@srcdir@%$srcdir%g s%@DEFS@%-DHAVE_CONFIG_H%" $top_srcdir/${file}.in >> $file fi; done echo creating port/udposix.h # These sed commands are put into SEDDEFS when defining a macro. # They are broken into pieces to make the sed script easier to manage. # They are passed to sed as "A NAME B NAME C VALUE D", where NAME # is the cpp macro being defined and VALUE is the value it is being given. # Each defining turns into a single global substitution command. # # SEDd sets the value in "#define NAME VALUE" lines. SEDdA='s@^\([ ]*\)#\([ ]*define[ ][ ]*\)' SEDdB='\([ ][ ]*\)[^ ]*@\1#\2' SEDdC='\3' SEDdD='@g' # SEDu turns "#undef NAME" with trailing blanks into "#define NAME VALUE". SEDuA='s@^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' SEDuB='\([ ]\)@\1#\2define\3' SEDuC=' ' SEDuD='\4@g' # SEDe turns "#undef NAME" without trailing blanks into "#define NAME VALUE". SEDeA='s@^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' SEDeB='$@\1#\2define\3' SEDeC=' ' SEDeD='@g' rm -f conftest.sed cat > conftest.sed <> config.status <> config.status <<\EOF CONFEOF rm -f conftest.h # Break up the sed commands because old seds have small limits. cp $top_srcdir/port/udposix.h.in conftest.h1 while : do lines=`grep -c . conftest.sed` if test -z "$lines" || test "$lines" -eq 0; then break; fi rm -f conftest.s1 conftest.s2 conftest.h2 sed 40q conftest.sed > conftest.s1 # Like head -40. sed 1,40d conftest.sed > conftest.s2 # Like tail +41. sed -f conftest.s1 < conftest.h1 > conftest.h2 rm -f conftest.s1 conftest.h1 conftest.sed mv conftest.h2 conftest.h1 mv conftest.s2 conftest.sed done rm -f conftest.sed conftest.h echo "/* port/udposix.h. Generated automatically by configure. */" > conftest.h cat conftest.h1 >> conftest.h rm -f conftest.h1 if cmp -s port/udposix.h conftest.h 2>/dev/null; then # The file exists and we would not be changing it. rm -f conftest.h else rm -f port/udposix.h mv conftest.h port/udposix.h fi EOF chmod +x config.status test -n "$no_create" || ./config.status if test -s conf.missing; then cat << CAT_EOF $0: The following variables need values. They may be set in the environment or in the file CUSTOMIZE. Variables referring to executable programs needn't be set if the relevant directory is added to PATH. In any case, ./configure should probably be rerun. See file INSTALL for details. CAT_EOF awk -F: 'BEGIN {printf "%-13s%-27s%s\n", "VARIABLE", "MEANING", "EXAMPLE"; printf "%-13s%-27s%s\n", "--------", "-------", "-------"} {printf "%-13s%-27s%s\n", $1, $2, $3}' conf.missing rm conf.missing exit 1 fi rm -f conf.missing # Post process any makefiles. # # Create a script to accomplish the post processing. # cat << \EOF_CONFTEST_SH > conftest.sh cat << \EOF_CONFTEST_C > conftest.c #include main() { return readsub((char*)NULL) ? 0 : 1; } readsub(inpath) char *inpath; { char buf[2048], path[1024]; FILE *fp = inpath == NULL ? stdin : fopen(inpath, "r"); if (fp == NULL) { (void) perror(inpath); return 0; } buf[sizeof(buf)-1] = 0; while (fgets(buf, sizeof(buf), fp) != NULL) { if (sscanf(buf, "include%*[] \t[]%s", path) == 1) { if (!readsub(path)) return 0; } else { (void) fputs(buf, stdout); } } return 1; } EOF_CONFTEST_C if $CC -o conftest conftest.c; then conftest=`pwd`/conftest set Makefile \ fortc/Makefile \ for file do echo post processing makefile \`$file\' sd=`pwd`/`echo $file | sed 's,[^/]*$,,'` base=`basename $file` (cd $sd; $conftest < $base > conftest.mk && mv conftest.mk $base) done fi rm conftest conftest.c EOF_CONFTEST_SH # # Append the above script to the output-script file, config.status, so that # invoking that file will also do the post processing. Note that the # output-script file will be invoked by ./configure before the post- # processing code is appended. # cat conftest.sh >> config.status # # If appropriate, do the postprocessing now because the previous step # couldn't. # test -n "$no_create" || CC=$CC sh conftest.sh rm conftest.sh