From c8e94979acb9135060b6ac8b0c101d7ea871a211 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 28 Nov 2017 07:25:27 +0100 Subject: shtool Gbp-Pq: Name 04_shtool.diff --- etc/shtool | 3248 ++++++++++++++++++++---------------------------------------- 1 file changed, 1098 insertions(+), 2150 deletions(-) diff --git a/etc/shtool b/etc/shtool index 0b71ff7..c41f19f 100755 --- a/etc/shtool +++ b/etc/shtool @@ -1,12 +1,13 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-1999 Ralf S. Engelschall +## Copyright (c) 1994-2004 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.0 (02-Jul-1999) +## Version: 2.0.1 (11-Aug-2004) +## Contents: 3/19 available modules ## ## @@ -25,7 +26,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## -## Notice: Given that you include this file verbatim into your own +## NOTICE: Given that you include this file verbatim into your own ## source tree, you are justified in saying that it remains separate ## from your package, and that this way you are simply just using GNU ## shtool. So, in this situation, there is no requirement that your @@ -37,68 +38,127 @@ ## Usage: shtool [] [ [] []] ## ## Available commands: +## install Install a program, script or datafile +## platform Platform Identification Utility +## version Maintain a version information file +## +## Not available commands (because module was not built-in): ## echo Print string with optional construct expansion ## mdate Pretty-print modification time of a file or dir -## table Pretty print a field-sperarated list as a table +## table Pretty-print a field-separated list as a table ## prop Display progress with a running propeller -## move Move files with simultan substitution -## install Install a program, script or datafile +## move Move files with simultaneous substitution ## mkdir Make one or more directories ## mkln Make link with calculation of relative paths -## mkshadow Make a shadow tree +## mkshadow Make a shadow tree through symbolic links ## fixperm Fix file permissions inside a source tree -## guessos Simple OS/platform guesser +## rotate Logfile rotation +## tarball Roll distribution tarballs +## subst Apply sed(1) substitution operations ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor -## version Generate and maintain a version information file ## path Deal with program paths ## if [ $# -eq 0 ]; then - echo "$0:ERROR: invalid command line" 1>&2 - echo "$0:HINT: run \`$0 -h' for usage" 1>&2 + echo "$0:Error: invalid command line" 1>&2 + echo "$0:Hint: run \`$0 -h' for usage" 1>&2 exit 1 fi -if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is shtool, version 1.4.0 (02-Jul-1999)" - echo "Copyright (c) 1994-1999 Ralf S. Engelschall " +if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then + echo "This is GNU shtool, version 2.0.1 (11-Aug-2004)" + echo "Copyright (c) 1994-2004 Ralf S. Engelschall " + echo "Report bugs to " echo '' - echo "Usage: shtool [] [ [] []]" + echo "Usage: shtool [] [ [] []]" echo '' echo 'Available global :' echo ' -v, --version display shtool version information' echo ' -h, --help display shtool usage help page (this one)' + echo ' -d, --debug display shell trace information' + echo ' -r, --recreate recreate this shtool script via shtoolize' echo '' echo 'Available [] []:' - echo ' echo [-n] [-e] [ ...]' - echo ' mdate [-n] [-z] [-s] [-d] [-f] [-o] ' - echo ' table [-F] [-w] [-c] [-s] ...' - echo ' prop [-p]' - echo ' move [-v] [-t] [-e] [-p] ' - echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] ' - echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' - echo ' mkln [-t] [-f] [-s] [ ...] ' - echo ' mkshadow [-v] [-t] [-a] ' - echo ' fixperm [-v] [-t] [ ...]' - echo ' guessos ' - echo ' arx [-t] [-C] [ ...]' - echo ' slo -- -L -l [ -L -l ... ]' - echo ' scpp [-v] [-p] [-o] [-t] [-M] [-D]' - echo ' [-C] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' - echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' + echo ' install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]' + echo ' [-C|--compare-copy] [-s|--strip] [-m|--mode ]' + echo ' [-o|--owner ] [-g|--group ] [-e|--exec' + echo ' ] [ ...] ' + echo ' platform [-F|--format ] [-S|--sep ] [-C|--conc' + echo ' ] [-L|--lower] [-U|--upper] [-v|--verbose]' + echo ' [-c|--concise] [-n|--no-newline] [-t|--type ]' + echo ' [-V|--version] [-h|--help]' + echo ' version [-l|--language ] [-n|--name ] [-p|--prefix' + echo ' ] [-s|--set ] [-e|--edit] [-i|--increase' + echo ' ] [-d|--display ] ' + echo '' + echo 'Not available (because module was not built-in):' + echo ' echo [-n|--newline] [-e|--expand] [ ...]' + echo ' mdate [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]' + echo ' [-f|--field-sep ] [-o|--order ] ' + echo ' table [-F|--field-sep ] [-w|--width ] [-c|--columns' + echo ' ] [-s|--strip ] ...' + echo ' prop [-p|--prefix ]' + echo ' move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]' + echo ' ' + echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] ' + echo ' [ ...]' + echo ' mkln [-t|--trace] [-f|--force] [-s|--symbolic] ' + echo ' [ ...] ' + echo ' mkshadow [-v|--verbose] [-t|--trace] [-a|--all] ' + echo ' fixperm [-v|--verbose] [-t|--trace] [ ...]' + echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files' + echo ' ] [-s|--size ] [-c|--copy] [-r|--remove]' + echo ' [-a|--archive-dir ] [-z|--compress [:]]' + echo ' [-b|--background] [-d|--delay] [-p|--pad ] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] [-M|--migrate' + echo ' ] [-P|--prolog ] [-E|--epilog ] [...]' + echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output ]' + echo ' [-c|--compress ] [-d|--directory ] [-u|--user' + echo ' ] [-g|--group ] [-e|--exclude ]' + echo ' [ ...]' + echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]' + echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup' + echo ' ] [-e|--exec ] [-f|--file ] []' + echo ' [...]' + echo ' arx [-t|--trace] [-C|--command ] [' + echo ' ...]' + echo ' slo [-p|--prefix ] -- -L -l [-L -l' + echo ' ...]' + echo ' scpp [-v|--verbose] [-p|--preserve] [-f|--filter ]' + echo ' [-o|--output ] [-t|--template ] [-M|--mark' + echo ' ] [-D|--define ] [-C|--class ]' + echo ' [ ...]' + echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]' + echo ' [-m|--magic] [-p|--path ] [ ...]' echo '' exit 0 fi -if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "shtool 1.4.0 (02-Jul-1999)" +if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then + echo "GNU shtool 2.0.1 (11-Aug-2004)" exit 0 fi -tool="$1" -shift +if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then + shtoolize -oetc/shtool install platform version + exit 0 +fi +if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then + shift + set -x +fi +name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` +case "$name" in + install|platform|version ) + # implicit tool command selection + tool="$name" + ;; + * ) + # explicit tool command selection + tool="$1" + shift + ;; +esac arg_spec="" opt_spec="" gen_tmpfile=no @@ -108,128 +168,63 @@ gen_tmpfile=no ## case $tool in - echo ) - str_tool="echo" - str_usage="[-n] [-e] [ ...]" - arg_spec="0+" - opt_spec="ne" - ;; - mdate ) - str_tool="mdate" - str_usage="[-n] [-z] [-s] [-d] [-f] [-o] " - arg_spec="1" - opt_spec="nzsdf:!o:!" - opt_f=" " - opt_o="dmy" - ;; - table ) - str_tool="table" - str_usage="[-F] [-w] [-c] [-s] ..." - arg_spec="1+" - opt_spec="F:!w:!c:!s:!" - opt_F=":" - opt_w=15 - opt_c=3 - opt_s=79 - ;; - prop ) - str_tool="prop" - str_usage="[-p]" - arg_spec="0" - opt_spec="p:" - ;; - move ) - str_tool="move" - str_usage="[-v] [-t] [-e] [-p] " - arg_spec="2" - opt_spec="vtep" - ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] " - arg_spec="2" - opt_spec="vtcCsm:o:g:e:" - ;; - mkdir ) - str_tool="mkdir" - str_usage="[-t] [-f] [-p] [-m] [ ...]" - arg_spec="1+" - opt_spec="tfpm:" - ;; - mkln ) - str_tool="mkln" - str_usage="[-t] [-f] [-s] [ ...] " - arg_spec="2+" - opt_spec="tfs" - ;; - mkshadow ) - str_tool="mkshadow" - str_usage="[-v] [-t] [-a] " - arg_spec="2" - opt_spec="vta" - ;; - fixperm ) - str_tool="fixperm" - str_usage="[-v] [-t] [ ...]" - gen_tmpfile=yes + str_usage="[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode ] [-o|--owner ] [-g|--group ] [-e|--exec ] [ ...] " arg_spec="1+" - opt_spec="vt" + opt_spec="v.t.d.c.C.s.m:o:g:e+" + opt_alias="v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec" + opt_v=no + opt_t=no + opt_d=no + opt_c=no + opt_C=no + opt_s=no + opt_m="0755" + opt_o="" + opt_g="" + opt_e="" ;; - guessos ) - str_tool="guessos" - str_usage="" - arg_spec="0" - opt_spec="" - ;; - arx ) - str_tool="arx" - str_usage="[-t] [-C] [ ...]" - arg_spec="2+" - opt_spec="tC:!" - opt_C="ar" - ;; - slo ) - str_tool="slo" - str_usage="-- -L -l [ -L -l ... ]" - arg_spec="1+" - opt_spec="" - ;; - scpp ) - str_tool="scpp" - str_usage="[-v] [-p] [-o] [-t] [-M] [-D] [-C] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="vpo:!t:!M:!D:!C:!" - opt_o="lib.h" - opt_t="lib.h.in" - opt_M="%%MARK%%" - opt_D="cpp" - opt_C="intern" + platform ) + str_tool="platform" + str_usage="[-F|--format ] [-S|--sep ] [-C|--conc ] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type ] [-V|--version] [-h|--help]" + arg_spec="0=" + opt_spec="F:S:C:L.U.v.c.n.t:d.V.h." + opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help" + opt_F="%{sp} (%{ap})" + opt_S=" " + opt_C="/" + opt_L=no + opt_U=no + opt_t="" + opt_v=no + opt_c=no + opt_n=no + opt_V=no + opt_h=no ;; version ) str_tool="version" - str_usage="[-l] [-n] [-p] [-s] [-i] [-d] " - arg_spec="1+" - opt_spec="l:!n:!p:!s:!i:!d:!" + str_usage="[-l|--language ] [-n|--name ] [-p|--prefix ] [-s|--set ] [-e|--edit] [-i|--increase ] [-d|--display ] " + arg_spec="1=" + opt_spec="l:n:p:s:i:e.d:" + opt_alias="l:language,n:name,p:prefix,s:set,e:edit,i:increase,d:display" opt_l="txt" opt_n="unknown" - opt_p="unknown" - opt_s="unknown" - opt_i="P" - opt_d="NO" - gen_tmpfile=yes + opt_p="" + opt_s="" + opt_e="no" + opt_i="" + opt_d="short" ;; - path ) - str_tool="path" - str_usage="[-s] [-r] [-d] [-b] [-m] [-p] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="srdbmp:!" - opt_p="$PATH" + -* ) + echo "$0:Error: unknown option \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 ;; * ) - echo "$0:ERROR: unknown command \`$tool'" 2>&1 - echo "$0:HINT: run \`$0 -h' for usage" 2>&1 + echo "$0:Error: unknown command \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 exit 1 ;; esac @@ -238,36 +233,35 @@ esac ## COMMON UTILITY CODE ## +# commonly used ASCII values +ASC_TAB=" " +ASC_NL=" +" + # determine name of tool if [ ".$tool" != . ]; then - # inside shtool + # used inside shtool script toolcmd="$0 $tool" + toolcmdhelp="shtool $tool" msgprefix="shtool:$tool" else - # standalone + # used as standalone script toolcmd="$0" + toolcmdhelp="sh $0" msgprefix="$str_tool" fi # parse argument specification string -eval `echo $arg_spec | sed -e 's/^\([0-9]*\)\(.*\)/arg_NUMS="\1"; arg_MODE="\2"/'` -test ".$arg_MODE" = . && arg_MODE="=" +eval `echo $arg_spec |\ + sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` # parse option specification string -for opt in `echo "h$opt_spec" | sed -e 's/\([a-zA-Z0-9][!:+]*\)/\1 /g'`; do - opt_MODE="."; opt_INIT="." - eval `echo $opt |\ - sed -e 's/^\([a-zA-Z0-9]\)/opt_THIS="\1";/' \ - -e 's/";\([:+]\)/"; opt_MODE="\1";/' \ - -e 's/";\(!\)/"; opt_INIT="\1"/'` - eval "opt_MODE_${opt_THIS}=${opt_MODE}" - if [ ".$opt_INIT" != ".!" ]; then - case "$opt_MODE" in - "." ) eval "opt_${opt_THIS}=no" ;; - ":"|"+" ) eval "opt_${opt_THIS}=\"\"" ;; - esac - fi -done +eval `echo h.$opt_spec |\ + sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` + +# parse option alias string +eval `echo h:help,$opt_alias |\ + sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'` # interate over argument line opt_PREV='' @@ -285,18 +279,29 @@ while [ $# -gt 0 ]; do opt_OPT="$opt_PREV" opt_ARG="$1" opt_ARG_OK=yes - opt_PREV="" + opt_PREV='' else # split argument into option and argument case "$1" in + --[a-zA-Z0-9]*=*) + eval `echo "x$1" |\ + sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + ;; + --[a-zA-Z0-9]*) + opt_OPT=`echo "x$1" | cut -c4-` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + opt_ARG='' + ;; -[a-zA-Z0-9]*) eval `echo "x$1" |\ sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ -e 's/";\(.*\)$/"; opt_ARG="\1"/'` ;; -[a-zA-Z0-9]) - opt_OPT=`awk 'BEGIN { printf("%s", substr(OPT, 2)); }' \ - "OPT=$1" &2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 exit 1 ;; esac done if [ ".$opt_PREV" != . ]; then - echo "$msgprefix:ERROR: missing argument to option \`-$opt_PREV'" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 exit 1 fi # process help option -if [ .$opt_h = .yes ]; then - echo "Usage: $toolcmd $str_usage" +if [ ".$opt_h" = .yes ]; then + echo "Usage: $toolcmdhelp $str_usage" exit 0 fi # complain about incorrect number of arguments case $arg_MODE in - "=" ) + '=' ) if [ $# -ne $arg_NUMS ]; then - echo "$msgprefix:ERROR: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; - "+" ) + '+' ) if [ $# -lt $arg_NUMS ]; then - echo "$msgprefix:ERROR: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; @@ -370,1827 +375,849 @@ esac # establish a temporary file on request if [ ".$gen_tmpfile" = .yes ]; then - tmpdir="/tmp" if [ ".$TMPDIR" != . ]; then tmpdir="$TMPDIR" + elif [ ".$TEMPDIR" != . ]; then + tmpdir="$TEMPDIR" else - if [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - fi + tmpdir="/tmp" + fi + if mkdir "$tmpdir/.shtool.$$"; then + tmpfile="$tmpdir/.shtool.$$/shtool.tmp" + else + echo "$msgprefix:Error: failed to create temporary file" 1>&2 + exit 1 fi - tmpfile="$tmpdir/.shtool.$$" + tmpfile="$tmpdir/.shtool.$$/shtool.tmp" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi +# utility function: map string to lower case +util_lower () { + echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' +} + +# utility function: map string to upper case +util_upper () { + echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +} + +# cleanup procedure +shtool_exit () { + rc="$1" + if [ ".$gen_tmpfile" = .yes ]; then + rm -fr "$tmpdir/.shtool.$$" >/dev/null 2>&1 || true + fi + exit $rc +} + ## ## DISPATCH INTO SCRIPT BODY ## case $tool in -echo ) +install ) ## - ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for WML as buildinfo + ## install -- Install a program, script or datafile + ## Copyright (c) 1997-2004 Ralf S. Engelschall ## - - text="$*" - - # check for broken escape sequence expansion - seo='' - bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" != .3 ]; then - bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - seo='-E' - fi - fi - - # check for existing -n option (to suppress newline) - minusn='' - bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - minusn='-n' - fi - - # determine terminal bold sequence - term_bold='' - term_norm='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then - # the most important terminals we directly know - case $TERM in - xterm|xterm*|vt220|vt220*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` - ;; - vt100|vt100*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` - ;; - esac - # then try a possibly existing "tput" or "tcout" utility - paths=`echo $PATH | sed -e 's/:/ /g'` - for tool in tput tcout; do - for dir in $paths; do - if [ -r "$dir/$tool" ]; then - for seq in bold md smso; do # smso is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" - break - fi - done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done - fi - break - fi - done - if [ ".$term_bold" != . -a ".$term_norm" != . ]; then - break; - fi - done - if [ ".$term_bold" = . -o ".$term_norm" = . ]; then - echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 - fi - fi - - # determine user name - username='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then - username="$LOGNAME" - if [ ".$username" = . ]; then - username="$USER" - if [ ".$username" = . ]; then - username="`(whoami) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username="`(who am i) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username='unknown' - fi - fi - fi - fi - fi - - # determine user id - userid='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then - userid="`(id -u) 2>/dev/null`" - if [ ".$userid" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then - userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*//'` - fi - if [ ".$userid" = . ]; then - userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid=`(ypcat passwd) 2>/dev/null | - egrep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid='?' - fi - fi - fi - fi - fi - - # determine host name - hostname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then - hostname="`(uname -n) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname="`(hostname) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname='unknown' - fi + + # special case: "shtool install -d [...]" internally + # maps to "shtool mkdir -f -p -m 755 [...]" + if [ "$opt_d" = yes ]; then + cmd="$0 mkdir -f -p -m 755" + if [ ".$opt_o" != . ]; then + cmd="$cmd -o '$opt_o'" fi - case $hostname in - *.* ) - domainname=".`echo $hostname | cut -d. -f2-`" - hostname="`echo $hostname | cut -d. -f1`" - ;; - esac - fi - - # determine domain name - domainname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then - if [ ".$domainname" = . ]; then - if [ -f /etc/resolv.conf ]; then - domainname="`egrep '^[ ]*domain' /etc/resolv.conf | head -1 |\ - sed -e 's/.*domain//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - if [ ".$domainname" = . ]; then - domainname="`egrep '^[ ]*search' /etc/resolv.conf | head -1 |\ - sed -e 's/.*search//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/ .*//' -e 's/ .*//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - fi - fi + if [ ".$opt_g" != . ]; then + cmd="$cmd -g '$opt_g'" fi - fi - - # determine current time - time_day='' - time_month='' - time_year='' - time_monthname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then - time_day=`date '+%d'` - time_month=`date '+%m'` - time_year=`date '+%Y' 2>/dev/null` - if [ ".$time_year" = . ]; then - time_year=`date '+%y'` - case $time_year in - [5-9][0-9]) time_year="19$time_year" ;; - [0-4][0-9]) time_year="20$time_year" ;; - esac + if [ ".$opt_v" = .yes ]; then + cmd="$cmd -v" fi - case $time_month in - 1|01) time_monthname='Jan' ;; - 2|02) time_monthname='Feb' ;; - 3|03) time_monthname='Mar' ;; - 4|04) time_monthname='Apr' ;; - 5|05) time_monthname='May' ;; - 6|06) time_monthname='Jun' ;; - 7|07) time_monthname='Jul' ;; - 8|08) time_monthname='Aug' ;; - 9|09) time_monthname='Sep' ;; - 10) time_monthname='Oct' ;; - 11) time_monthname='Nov' ;; - 12) time_monthname='Dec' ;; - esac - fi - - # expand special ``%x'' constructs - if [ ".$opt_e" = .yes ]; then - text=`echo $seo "$text" |\ - sed -e "s/%B/${term_bold}/g" \ - -e "s/%b/${term_norm}/g" \ - -e "s/%u/${username}/g" \ - -e "s/%U/${userid}/g" \ - -e "s/%h/${hostname}/g" \ - -e "s/%d/${domainname}/g" \ - -e "s/%D/${time_day}/g" \ - -e "s/%M/${time_month}/g" \ - -e "s/%Y/${time_year}/g" \ - -e "s/%m/${time_monthname}/g" 2>/dev/null` - fi - - # create output - if [ .$opt_n = .no ]; then - echo $seo $text - else - # the harder part: echo -n is best, because - # awk complains about some \xx sequences. - if [ ".$minusn" != . ]; then - echo $seo $minusn $text - else - echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" + if [ ".$opt_t" = .yes ]; then + cmd="$cmd -t" fi + for dir in "$@"; do + eval "$cmd $dir" || shtool_exit $? + done + shtool_exit 0 fi - ;; -mdate ) - ## - ## mdate -- Pretty-print modification time of a file or dir - ## Copyright (c) 1995-1997 Free Software Foundation, Inc. - ## Originally idea and basis code by Ulrich Drepper - ## Enhanced by Ralf S. Engelschall for shtool - ## - - fod="$1" - case "$opt_o" in - [dmy][dmy][dmy] ) - ;; - * ) echo "$msgprefix:Error: invalid argument to option \`-o': $opt_o" 1>&2 - exit 1 - ;; - esac - if [ ! -r "$fod" ]; then - echo "$msgprefix:Error: file or directory not found: $fod" 1>&2 - exit 1 - fi - - # prevent "date" giving response in another language - LANG=C; export LANG - LC_ALL=C; export LC_ALL - LC_TIME=C; export LC_TIME - - # get the extended ls output of the file or directory. - if ls -L /dev/null >/dev/null 2>&1; then - set - x`ls -L -l -d $fod` - else - set - x`ls -l -d $fod` - fi - - # The month is at least the fourth argument - # (3 shifts here, the next inside the loop). - shift; shift; shift - - # Find the month. Next argument is day, followed by the year or time. - month="" - while [ ".$month" = . ]; do + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" shift - case $1 in - Jan) month=January; nummonth=1 ;; - Feb) month=February; nummonth=2 ;; - Mar) month=March; nummonth=3 ;; - Apr) month=April; nummonth=4 ;; - May) month=May; nummonth=5 ;; - Jun) month=June; nummonth=6 ;; - Jul) month=July; nummonth=7 ;; - Aug) month=August; nummonth=8 ;; - Sep) month=September; nummonth=9 ;; - Oct) month=October; nummonth=10 ;; - Nov) month=November; nummonth=11 ;; - Dec) month=December; nummonth=12 ;; - esac done - day="$2" - year="$3" - - # We finally have to deal with the problem that the "ls" output - # gives either the time of the day or the year. - case $year in - *:*) - this_year=`date '+%Y' 2>/dev/null` - if [ ".$this_year" = . ]; then - this_year=`date '+%y'` - case $this_year in - [5-9][0-9]) this_year="19$this_year" ;; - [0-4][0-9]) this_year="20$this_year" ;; - esac - fi - # for the following months of the last year the time notation - # is usually also used for files modified in the last year. - this_month=`date '+%m'` - if (expr $nummonth \> $this_month) >/dev/null; then - this_year=`expr $this_year - 1` - fi - year="$this_year" - ;; - esac - - # Optionally fill day and month with leeding zeros - if [ ".$opt_z" = .yes ]; then - case $day in - [0-9][0-9] ) ;; - [0-9] ) day="0$day" ;; - esac - case $nummonth in - [0-9][0-9] ) ;; - [0-9] ) nummonth="0$nummonth" ;; - esac - fi - - # Optionally use digits for month - if [ ".$opt_d" = .yes ]; then - month="$nummonth" - fi - - # Optionally shorten the month name to three characters - if [ ".$opt_s" = .yes ]; then - month=`echo $month | cut -c1-3` - fi - - # Output the resulting date string - echo dummy | awk '{ - for (i = 0; i < 3; i++) { - now = substr(order, 1, 1); - order = substr(order, 2); - if (now == "d") - out = day; - else if (now == "m") - out = month; - else if (now == "y") - out = year; - if (i < 2) - printf("%s%s", out, field); - else - printf("%s", out); - } - if (newline != "yes") - printf("\n"); - }' "day=$day" "month=$month" "year=$year" \ - "field=$opt_f" "order=$opt_o" "newline=$opt_n" - ;; + dstpath="$1" -table ) - ## - ## table -- Pretty print a field-sperarated list as a table - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - if [ $opt_c -gt 4 ]; then - echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2 - exit 1 + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 fi - case "x$opt_F" in - x? ) ;; - * ) echo "$msgprefix:Error: Invalid seperator (one char allowed only)" 1>&2; exit 1 ;; - esac - - # split the list into a table - list=` - IFS="$opt_F" - for entry in $*; do - if [ ".$entry" != . ]; then - echo "$entry" - fi - done |\ - awk " - BEGIN { list = \"\"; n = 0; } - { - list = list \\$1; - n = n + 1; - if (n < $opt_c) { - list = list \":\"; - } - if (n == $opt_c) { - list = list \"\\n\"; - n = 0; - } - } - END { print list; } - " - ` - - # format table cells and make sure table - # doesn't exceed maximum width - OIFS="$IFS" - IFS=' -' - for entry in $list; do - case $opt_c in - 1 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s\\n\", \$1); }'" ;; - 2 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s\\n\", \$1, \$2); }'" ;; - 3 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3); }'" ;; - 4 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3, \$4); }'" ;; - esac - done |\ - awk "{ - if (length(\$0) > $opt_s) { - printf(\"%s\\n\", substr(\$0, 0, $opt_s-1)); - } else { - print \$0; - } - }" - IFS="$OIFS" - ;; -prop ) - ## - ## prop -- Display progress with a running propeller - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for mod_ssl - ## - - perl='' - for dir in `echo $PATH | sed -e 's/:/ /g'` .; do - if [ -f "$dir/perl" ]; then - perl="$dir/perl" - break - fi - done - if [ ".$perl" != . ]; then - # Perl is preferred because writing to STDERR in - # Perl really writes immediately as one would expect - $perl -e ' - @p = ("|","/","-","\\"); - $i = 0; - while () { - printf(STDERR "\r%s...%s\b", $ARGV[0], $p[$i++]); - $i = 0 if ($i > 3); - } - printf(STDERR "\r%s \n", $ARGV[0]); - ' "$opt_p" - else - # But when Perl doesn't exists we use Awk even - # some Awk's buffer even the /dev/stderr writing :-( - awk ' - BEGIN { - split("|#/#-#\\", p, "#"); - i = 1; - } - { - printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr"; - if (i > 4) { i = 1; } - } - END { - printf("\r%s \n", prefix) > "/dev/stderr"; - } - ' "prefix=$opt_p" + # consistency check for destination + if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 + shtool_exit 1 fi - ;; -move ) - ## - ## move -- Move files with simultan substitution - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # consistency checks - if [ ".$src" = . -o ".$dst" = . ]; then - echo "$msgprefix:Error: Invalid arguments" 1>&2 - exit 1 - fi - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: Source and destination files are the same" 1>&2 - exit 1 - fi - expsrc="$src" - if [ ".$opt_e" = .yes ]; then - expsrc="`echo $expsrc`" - fi - if [ ".$opt_e" = .yes ]; then - if [ ".`echo "$src" | sed -e 's;^.*\\*.*$;;'`" = ".$src" ]; then - echo "$msgprefix:Error: Source doesn't contain wildcard ('*'): $dst" 1>&2 - exit 1 - fi - if [ ".`echo "$dst" | sed -e 's;^.*%[1-9].*$;;'`" = ".$dst" ]; then - echo "$msgprefix:Error: Destination doesn't contain substitution ('%N'): $dst" 1>&2 - exit 1 - fi - if [ ".$expsrc" = ".$src" ]; then - echo "$msgprefix:Error: Sources not found or no asterisk : $src" 1>&2 - exit 1 + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath + + # if destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" fi - else - if [ ! -r "$src" ]; then - echo "$msgprefix:Error: Source not found: $src" 1>&2 - exit 1 + + # check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue fi - fi - - # determine substitution patterns - if [ ".$opt_e" = .yes ]; then - srcpat=`echo "$src" | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 's;\\*;\\\\(.*\\\\);g'` - dstpat=`echo "$dst" | sed -e 's;%\([1-9]\);\\\\\1;g'` - fi - - # iterate over source(s) - for onesrc in $expsrc; do - if [ .$opt_e = .yes ]; then - onedst=`echo $onesrc | sed -e "s;$srcpat;$dstpat;"` - else - onedst="$dst" + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue fi - errorstatus=0 + + # make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # verbosity if [ ".$opt_v" = .yes ]; then - echo "$onesrc -> $onedst" + echo "$src -> $dst" 1>&2 fi - if [ ".$opt_p" = .yes ]; then - if [ -r $onedst ]; then - if cmp -s $onesrc $onedst; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $onesrc" 1>&2 - fi - rm -f $onesrc || errorstatus=$? - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? - fi - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? + + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes + fi + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 fi + cp $src $dsttmp || shtool_exit $? else if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 + echo "mv $src $dsttmp" 1>&2 fi - mv -f $onesrc $onedst || errorstatus=$? - fi - if [ $errorstatus -ne 0 ]; then - break; + mv $src $dsttmp || shtool_exit $? fi - done - exit $errorstatus - ;; -install ) - ## - ## install -- Install a program, script or datafile - ## Copyright (c) 1997-1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi - - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 - exit 1 - fi - - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#INST@$$#" - - # Verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi - - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 - fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 - fi - mv $src $dsttmp || exit $? - fi - - # Adjust the target file - # (we do chmod last to preserve setuid bits) - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 - fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 - fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS" + for e + do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + chmod u+w $dsttmp + eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $? + rm -f $dsttmp.old fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 + fi + strip $dsttmp || shtool_exit $? fi - chmod $opt_m $dsttmp || exit $? - fi - - # Determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 fi + chown $opt_o $dsttmp || shtool_exit $? fi - fi - - # Finally install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || shtool_exit $? fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + if [ ".$opt_m" != ".-" ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 + fi + chmod $opt_m $dsttmp || shtool_exit $? fi - rm -f $dst && mv $dsttmp $dst - fi - ;; -mkdir ) - ## - ## mkdir -- Make one or more directories - ## Copyright (c) 1996-1999 Ralf S. Engelschall - ## Originally written for public domain by Noah Friedman - ## Cleaned up and enhanced for shtool - ## - - errstatus=0 - for p in ${1+"$@"}; do - # when the directory already exists... - if [ -d "$p" ]; then - if [ ".$opt_f" = .no ]; then - echo "$msgprefix:Error: file exists: $p" 1>&2 - errstatus=1 - break - else - continue + # determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s $src $dst; then + quick=yes + fi fi fi - # when the directory has to be created - if [ ".$opt_p" = .no ]; then + + # finally, install the file to the real destination + if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then - echo "mkdir $p" 1>&2 + echo "rm -f $dsttmp" 1>&2 fi - mkdir $p || errstatus=$? + rm -f $dsttmp else - # the smart situation - set fnord `echo ":$p" |\ - sed -e 's/^:\//%/' \ - -e 's/^://' \ - -e 's/\// /g' \ - -e 's/^%/\//'` - shift - pathcomp= - for d in ${1+"$@"}; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp="./$pathcomp" ;; - esac - if [ ! -d "$pathcomp" ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $pathcomp" 1>&2 - fi - mkdir $pathcomp || errstatus=$? - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $pathcomp" 1>&2 - fi - chmod $opt_m $pathcomp || errstatus=$? - fi - fi - pathcomp="$pathcomp/" - done + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst fi done - exit $errstatus + + shtool_exit 0 ;; -mkln ) +platform ) ## - ## mkln -- Make link with calculation of relative paths - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool + ## platform -- Platform Identification Utility + ## Copyright (c) 2003-2004 Ralf S. Engelschall ## - - args=$? - srcs="" - while [ $# -gt 1 ]; do - srcs="$srcs $1" - shift - done - dst="$1" - if [ ! -d $dst ]; then - if [ $args -gt 2 ]; then - echo "$msgprefix:Error: multiple sources not allowed when target isn't a directory" 1>&2 - exit 1 - fi - fi - - # determine link options - lnopt="" - if [ ".$opt_f" = .yes ]; then - lnopt="$lnopt -f" - fi - if [ ".$opt_s" = .yes ]; then - lnopt="$lnopt -s" - fi - - # iterate over sources - for src in $srcs; do - # determine if one of the paths is an absolute path, - # because then we _have_ to use an absolute symlink - oneisabs=0 - srcisabs=0 - dstisabs=0 - case $src in - /* ) oneisabs=1; srcisabs=1 ;; - esac - case $dst in - /* ) oneisabs=1; dstisabs=1 ;; - esac - - # split source and destination into dir and base name - if [ -d $src ]; then - srcdir=`echo $src | sed -e 's;/*$;;'` - srcbase="" - else - srcdir=`echo $src | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` - srcbase=`echo $src | sed -e 's;.*/\([^/]*\)$;\1;'` - fi - if [ -d $dst ]; then - dstdir=`echo $dst | sed -e 's;/*$;;'` - dstbase="" - else - dstdir=`echo $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` - dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'` - fi - - # consistency check - if [ ".$dstdir" != . ]; then - if [ ! -d $dstdir ]; then - echo "$msgprefix:Error: destination directory not found: $dstdir" 1>&2 + + # option post-processing + if [ ".$opt_t" != . ]; then + case "$opt_t" in + binary ) + # binary package id (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + build ) + # build time checking (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + gnu ) + # GNU config.guess style -- + opt_F="%-unknown-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + web ) + # non-whitespace HTTP Server-header id + opt_F="%-%" + opt_S="/" + opt_C="+" + ;; + summary) + # human readable verbose summary information + opt_F="Class: %[sc] (%[ac])\\nProduct: %[sp] (%[ap])\\nTechnology: %[st] (%[at])" + opt_S=" " + opt_C="/" + ;; + all-in-one ) + # full-table all-in-one information + opt_F="" + opt_F="${opt_F}concise architecture class: %\\n" + opt_F="${opt_F}regular architecture class: %{ac}\\n" + opt_F="${opt_F}verbose architecture class: %[ac]\\n" + opt_F="${opt_F}concise architecture product: %\\n" + opt_F="${opt_F}regular architecture product: %{ap}\\n" + opt_F="${opt_F}verbose architecture product: %[ap]\\n" + opt_F="${opt_F}concise architecture technology: %\\n" + opt_F="${opt_F}regular architecture technology: %{at}\\n" + opt_F="${opt_F}verbose architecture technology: %[at]\\n" + opt_F="${opt_F}concise system class: %\\n" + opt_F="${opt_F}regular system class: %{sc}\\n" + opt_F="${opt_F}verbose system class: %[sc]\\n" + opt_F="${opt_F}concise system product: %\\n" + opt_F="${opt_F}regular system product: %{sp}\\n" + opt_F="${opt_F}verbose system product: %[sp]\\n" + opt_F="${opt_F}concise system technology: %\\n" + opt_F="${opt_F}regular system technology: %{st}\\n" + opt_F="${opt_F}verbose system technology: %[st]" + ;; + * ) + echo "$msgprefix:Error: invalid type \`$opt_t'" 1>&2 exit 1 - fi - fi - - # make sure the source is reachable from the destination - if [ $dstisabs = 1 ]; then - if [ $srcisabs = 0 ]; then - if [ -d $srcdir ]; then - srcdir="`cd $srcdir; pwd | sed -e 's;/*$;;'`" - srcisabs=1 - oneisabs=1 - fi - fi - fi - - # split away a common prefix - prefix="" - if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then - prefix="$srcdir/" - srcdir="" - dstdir="" - else - while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do - presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'` - predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'` - if [ ".$presrc" != ".$predst" ]; then - break - fi - prefix="$prefix$presrc/" - srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'` - dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'` - done - fi - - # destination prefix is just the common prefix - dstpre="$prefix" - - # determine source prefix which is the reverse directory - # step-up corresponding to the destination directory - srcpre="" - if [ $oneisabs = 0 ] || [ ".$prefix" != . -a ".$prefix" != ./ ]; then - pl="$dstdir/" - OIFS="$IFS"; IFS='/' - for pe in $pl; do - [ ".$pe" = . ] && continue - srcpre="../$srcpre" - done - IFS="$OIFS" - else - if [ $srcisabs = 1 ]; then - srcpre="$prefix" - fi - fi - - # determine destination symlink name - if [ ".$dstbase" = . ]; then - if [ ".$srcbase" != . ]; then - dstbase="$srcbase" - else - dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'` - fi - fi - - # now finalize source and destination directory paths - srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'` - dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'` - - # run the final link command - if [ ".$opt_t" = .yes ]; then - echo "ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase" - fi - eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase - done - ;; - -mkshadow ) - ## - ## mkshadow -- Make a shadow tree - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - # source and destination directory - src=`echo "$1" | sed -e 's:/$::'` - dst=`echo "$2" | sed -e 's:/$::'` - - # check whether source exists - if [ ! -d $src ]; then - echo "$msgprefix:Error: source directory not found: \`$src'" 1>&2 - exit 1 - fi - - # determine if one of the paths is an absolute path, - # because then we have to use an absolute symlink - oneisabs=0 - case $src in - /* ) oneisabs=1 ;; - esac - case $dst in - /* ) oneisabs=1 ;; - esac - - # determine reverse directory for destination directory - dstrevdir='' - if [ $oneisabs = 0 ]; then - # (inlined fp2rp) - OIFS="$IFS"; IFS='/' - for pe in $dst; do - dstrevdir="../$dstrevdir" - done - IFS="$OIFS" - else - src="`cd $src; pwd`"; - fi - - # create directory tree at destination - if [ ! -d $dst ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $dst" 1>&2 - fi - mkdir $dst - fi - if [ ".$opt_a" = .yes ]; then - DIRS=`cd $src; find . -type d -print |\ - sed -e '/^\.$/d' -e 's:^\./::'` - else - DIRS=`cd $src; find . -type d -print |\ - sed -e '/\/CVS/d' -e '/^\.$/d' -e 's:^\./::'` - fi - for dir in $DIRS; do - if [ ".$opt_t" = .yes ]; then - echo "mkdir $dst/$dir" 1>&2 - fi - mkdir $dst/$dir - done - - # fill directory tree with symlinks to files - if [ ".$opt_a" = .yes ]; then - FILES="`cd $src; find . -depth -print |\ - sed -e 's/^\.\///'`" - else - FILES="`cd $src; find . -depth -print |\ - sed -e '/\.o$/d' -e '/\.a$/d' -e '/\.so$/d' \ - -e '/\.cvsignore$/d' -e '/\/CVS/d' \ - -e '/\/\.#/d' -e '/\.orig$/d' \ - -e 's/^\.\///'`" + ;; + esac fi - for file in $FILES; do - # don't use `-type f' above for find because of symlinks - if [ -d "$src/$file" ]; then - continue - fi - basename=`echo $file | sed -e 's:^.*/::'` - dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'` - from=`echo "$src/$file" | sed -e 's/^\.\///'` - to="$dst/$dir$basename" - if [ $oneisabs = 0 ]; then - if [ ".$dir" != . ]; then - subdir=`echo $dir | sed -e 's:/$::'` - # (inlined fp2rp) - revdir='' - OIFS="$IFS"; IFS='/' - for pe in $subdir; do - revdir="../$revdir" - done - IFS="$OIFS" - # finalize from - from="$revdir$from" - fi - from="$dstrevdir$from" - fi - if [ ".$opt_v" = .yes ]; then - echo " $to" 1>&2 - fi - if [ ".$opt_t" = .yes ]; then - echo "ln -s $from $to" 1>&2 - fi - ln -s $from $to - done - ;; -fixperm ) - ## - ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-1999 Ralf S. Engelschall - ## Originally written for ePerl - ## - - paths="$*" - - # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then - minusx="-x" - else - minusx="-r" - fi - rm -f $tmpfile - - # iterate over paths - for p in $paths; do - for file in `find $p -depth -print`; do - if [ -f $file ]; then - if [ $minusx $file ]; then - if [ ".$opt_v" = .yes ]; then - echo "-rwxrwxr-x $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 775 $file" 2>&1 - fi - chmod 775 $file - else - if [ ".$opt_v" = .yes ]; then - echo "-rw-rw-r-- $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 664 $file" 2>&1 - fi - chmod 664 $file - fi - continue - fi - if [ -d $file ]; then - if [ ".$opt_v" = .yes ]; then - echo "drwxrwxr-x $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 775 $file" 2>&1 - fi - chmod 775 $file - continue - fi - if [ ".$opt_v" = .yes ]; then - echo "?????????? $file" 2>&1 - fi - done - done - ;; + # assemble initial platform information + UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\ + UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\ + UNAME_MACHINE='unknown' + UNAME_SYSTEM=`(uname -s) 2>/dev/null` ||\ + UNAME_SYSTEM='unknown' + UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\ + UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\ + UNAME_RELEASE='unknown' -guessos ) - ## - ## guessos -- Simple OS/platform guesser - ## Copyright (c) 1996-1999 The Apache Group, http://www.apache.org/ - ## The Apache license applies (see http://www.apache.org/docs/LICENSE) - ## Originally written for Apache - ## - - MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" - RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" - SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" - VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" - - XREL=`(uname -X) 2>/dev/null | grep "^Release" | awk '{print $3}'` - if [ "x$XREL" != "x" ]; then - if [ -f /etc/kconfig ]; then - case "$XREL" in - 4.0|4.1) echo "${MACHINE}-whatever-isc4"; exit 0 ;; + UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}" + + AC=""; AP=""; AT="" + SC=""; SP=""; ST="" + + # dispatch into platform specific sections + case "${UNAME}" in + + # FreeBSD + *:FreeBSD:* ) + # determine architecture + AC="${UNAME_MACHINE}" + case "${AC}" in + i386 ) AC="iX86" ;; + esac + AP="${AC}" + AT=`(/sbin/sysctl -n hw.model) 2>&1` + case "${AT}" in + *"Xeon"* | *"Pentium Pro"* | *"Cyrix 6x86MX"* | *"Pentium II"* | *"Pentium III"* | *"Pentium 4"* | *"Celeron"* ) AT="i686" ;; + *"Pentium"* ) AT="i586" ;; *"i486[SD]X"* | *"Cyrix 486"* | *"Cyrix [56]x86"* | *"Blue Lightning" | *"Cyrix 486S/DX" ) AT="i486" ;; + *"i386[SD]X"* | *"NexGen 586"* ) AT="i386" ;; + * ) AT="${AP}" ;; + esac + # determine system + r=`echo "${UNAME_RELEASE}" |\ + sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'` + ST="FreeBSD ${r}" + SP="${ST}" + case "${r}" in + 1.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; esac - else - case "$XREL" in - 3.2v4.2) - echo "whatever-whatever-sco3"; exit 0 - ;; - 3.2v5.0*) - echo "whatever-whatever-sco5"; exit 0 - ;; - 4.2MP) - if [ "x$VERSION" = "x2.1.1" ]; then - echo "${MACHINE}-whatever-unixware211"; exit 0 - elif [ "x$VERSION" = "x2.1.2" ]; then - echo "${MACHINE}-whatever-unixware212"; exit 0 - else - echo "${MACHINE}-whatever-unixware2"; exit 0 - fi - ;; - 4.2) - echo "whatever-whatever-unixware1"; exit 0 - ;; - 5) - case "$VERSION" in - 7*) echo "${MACHINE}-whatever-unixware7"; exit 0 ;; - esac - ;; - esac - fi - fi - case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in - MiNT:*) - echo "m68k-atari-mint"; exit 0 - ;; - A/UX:*) - echo "m68k-apple-aux3"; exit 0 - ;; - AIX:*) - MACH=`echo $MACHINE | sed -e 's;[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F];;'` - echo "${MACH}-ibm-aix${VERSION}.${RELEASE}"; exit 0 - ;; - dgux:*) - echo "${MACHINE}-dg-dgux"; exit 0 ;; - HI-UX:*) - echo "${MACHINE}-hi-hiux"; exit 0 + + # NetBSD + *:NetBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="NetBSD ${r}" + SP="${ST}" + case "${r}" in + 0.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; + esac ;; - HP-UX:*) - HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo "${MACHINE}-hp-hpux${HPUXVER}"; exit 0 + + # OpenBSD + *:OpenBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="OpenBSD ${r}" + SP="${ST}" + SC="4.4BSD" ;; - IRIX:*) - if [ -f /usr/lib32/mips4/libm.so ]; then - echo "${MACHINE}/32-sgi-irix${RELEASE}"; exit 0 - else - echo "${MACHINE}-sgi-irix${RELEASE}"; exit 0 + + # GNU/Linux + *:Linux:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + x86_64 ) AT='AMD64' ;; + parisc ) AT="HPPA32" ;; + parisc64 ) AT="HPPA64" ;; + esac + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP='iX86' ;; + esac + AC="${AP}" + # determine system + v_kern=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'` + v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\ + sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null` + ST="GNU/${v_libc}/<${v_kern}>" + if [ -f /etc/lsb-release ]; then + eval `( . /etc/lsb-release + echo "SC=\"LSB${LSB_VERSION}\"" + if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then + echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\"" + fi + ) 2>/dev/null` fi + if [ ".$SP" = . ]; then + for tagfile in x \ + `cd /etc && \ + /bin/ls *[_-]release *[_-]version 2>/dev/null | \ + sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \ + echo redhat-release lsb-release` + do + [ ".${tagfile}" = .x ] && continue + [ ! -f "/etc/${tagfile}" ] && continue + n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'` + v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$//'` + case "`util_lower ${n}`" in + redhat ) + if [ ".`grep 'Red Hat Enterprise Linux' /etc/${tagfile}`" != . ]; then + n="ed at nterprise inux" + else + n="ed at inux" + fi + ;; + debian ) n="Debian[ GNU/Linux]" ;; + fedora ) n=" Core[ GNU/Linux]" ;; + suse ) n="SuSE[ Linux]" ;; + mandrake ) n="Mandrake[ Linux]" ;; + gentoo ) n="Gentoo[ GNU/Linux]" ;; + slackware ) n="Slackware[ Linux]" ;; + turbolinux ) n="TurboLinux" ;; + unitedlinux ) n="UnitedLinux" ;; + * ) n="${n}[ GNU/Linux]" ;; + esac + case "$n" in + *"<"*">"* ) SP="$n <$v>" ;; + * ) SP="$n $v" ;; + esac + break + done + fi + [ ".$SP" = . ] && SP="${ST}" + [ ".$SC" = . ] && SC="LSB" ;; - IRIX64:*) - echo "${MACHINE}-sgi-irix64"; exit 0 - ;; - Linux:[2-9].*) - echo "${MACHINE}-whatever-linux2"; exit 0 - ;; - Linux:1.*) - echo "${MACHINE}-whatever-linux1"; exit 0 - ;; - LynxOS:*) - echo "${MACHINE}-lynx-lynxos"; exit 0 + + # Sun Solaris + *:SunOS:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i86pc ) AT="iX86" ;; + esac + AP="${AT}" + case "${AP}" in + sun4[cdm] ) AP="SPARC32" ;; + sun4u ) AP="SPARC64" ;; + sun4* ) AP="SPARC" ;; + esac + AC="${AP}" + case "${AC}" in + SPARC* ) AC="SPARC" ;; + esac + # determine system + ST="[Sun ]SunOS ${UNAME_RELEASE}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's;^4\.;1.;' \ + -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \ + -e 's;^5\.\([0-9][0-9]*\).*;\1;'` + SP="[Sun ]Solaris $v" + case "${UNAME_RELEASE}" in + 4.* ) SC="4.3BSD" ;; + 5.* ) SC="SVR4" ;; + esac ;; - BSD/386|BSD/OS:3.*) - echo "${MACHINE}-whatever-bsdi3"; exit 0 + + # SCO UnixWare + *:UnixWare:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i[3-6]86 | ix86at ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v=`/sbin/uname -v` + ST="[SCO ]UnixWare ${v}" + SP="${ST}" + SC="SVR${UNAME_RELEASE}" ;; - BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*) - echo "i486-whatever-bsdi"; exit 0 + + # QNX + *:QNX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + x86pc ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v="${UNAME_RELEASE}" + ST="QNX[ Neutrino RTOS] ${v}" + v=`echo "${v}" | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'` + SP="QNX[ Neutrino RTOS] ${v}" + SC="QNX" ;; - BSD/386:*|BSD/OS:*) - echo "${MACHINE}-whatever-bsdi"; exit 0 + + # SGI IRIX + *:IRIX*:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}:${UNAME_SYSTEM}" in + IP*:IRIX64 ) AP="MIPS64" ;; + IP*:* ) AP="MIPS" ;; + esac + AC="${AP}" + # determine system + v=`(/bin/uname -R || /bin/uname -r) 2>/dev/null | sed -e 's;[0-9.]* ;;'` + ST="[SGI ]IRIX ${v}" + v="${UNAME_RELEASE}" + SP="[SGI ]IRIX ${v}" + SC="4.2BSD/SVR3" ;; - FreeBSD:*) - VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'` - MACH=`sysctl -n hw.model` - ARCH='whatever' - case ${MACH} in - *386* ) MACH="i386" ;; - *486* ) MACH="i486" ;; - Pentium\ II*) MACH="i686" ;; - Pentium* ) MACH="i586" ;; - Alpha* ) MACH="alpha" ;; - * ) MACH="$MACHINE" ;; + + # HP HP-UX + *:HP-UX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + 9000/[34]?? ) AT=M68K ;; + 9000/[678][0-9][0-9]) + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523 ) AT="HPPA1.0" ;; + 528 ) AT="HPPA1.1" ;; + 532 ) AT="HPPA2.0" + case "${sc_kernel_bits}" in + 32 ) AT="${AT}n" ;; + 64 ) AT="${AT}w" ;; + esac + ;; + esac + ;; esac - case ${MACH} in - i[0-9]86 ) ARCH="pc" ;; + AP="${AT}" + case "${AP}" in + HPPA* ) AP="HPPA" ;; + esac + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[^0-9]*;;'` + ST="[HP ]-" + SP="${ST}" + case "${v}" in + 10.* ) SC="SVR4.2" ;; + [7-9]* ) SC="SVR4" ;; esac - echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0 - ;; - NetBSD:*:*:*486*) - echo "i486-whatever-netbsd${RELEASE}"; exit 0 - ;; - NetBSD:*) - echo "${MACHINE}-whatever-netbsd${RELEASE}"; exit 0 - ;; - OpenBSD:*) - echo "${MACHINE}-whatever-openbsd"; exit 0 ;; - OSF1:*:*:*alpha*) - VERS=`echo $RELEASE | sed -e 's;^V;;'` - echo "${MACHINE}-dec-osf${VERS}"; exit 0 + + # HP Tru64 (OSF1) + *:OSF1:* ) + # determine architecture + AP="${UNAME_MACHINE}" + case "${AP}" in + alpha ) AP="Alpha" ;; + esac + alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\ + sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'` + AT="${AP}${alpha_type}" + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[VTX];;'` + ST="[HP ]Tru64 ${v}" + SP="${ST}" + SC="OSF1" ;; - QNX:*) - if [ "$VERSION" -gt 422 ]; then - echo "${MACHINE}-qssl-qnx32" + + # IBM AIX + *:AIX:* ) + cpu_arch=rs6000 + if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then + cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then + cpu_arch=powerpc + fi + fi + if [ -x /usr/bin/oslevel ]; then + os_level=`/usr/bin/oslevel` else - echo "${MACHINE}-qssl-qnx" + os_level="`uname -r`.`uname -v`" fi - exit 0 - ;; - Paragon*:*:*:*) - echo "i860-intel-osf1"; exit 0 - ;; - SunOS:5.*) - VERSION=`echo $RELEASE | sed -e 's;^5\.;;'` - echo "${MACHINE}-sun-solaris2.${VERSION}"; exit 0 - ;; - SunOS:*) - echo "${MACHINE}-sun-sunos4"; exit 0 - ;; - UNIX_System_V:4.*:*) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - unix:3.0.9*:*:88k) - echo "${MACHINE}-encore-sysv4"; exit 0 - ;; - *:4*:R4*:m88k) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - UnixWare:5:99*:*) - # Gemini, beta release of next rev of unixware - echo "${MACHINE}-whatever-unixware212"; exit 0 - ;; - DYNIX/ptx:4*:*) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - *:4.0:3.0:[345][0-9]?? | *:4.0:3.0:3[34]??[/,]* | library:*) - echo "x86-ncr-sysv4"; exit 0 - ;; - ULTRIX:*) - echo "${MACHINE}-unknown-ultrix"; exit 0 + os_level=`echo "${os_level}" |\ + sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \ + -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'` + AT="${cpu_arch}" + AP="${AT}" + AC="${AP}" + ST="[IBM ]AIX ${os_level}" + SP="${ST}" + case "${os_level}" in + [12]* ) SC="SVR2" ;; + * ) SC="SVR4" ;; + esac ;; - SINIX-?:* | ReliantUNIX-?:*) - echo "${MACHINE}-siemens-sysv4"; exit 0 + + # Apple MacOS X Darwin + *:Darwin:* ) + AT=`uname -p` + case "${AT}" in + powerpc ) AT="PPC" ;; + esac + AP="${AT}" + AC="${AP}" + case "${AC}" in + i?86 ) AC="iX86" ;; + esac + ST="[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}" + SP="${ST}" + SC="4.4BSD/Mach3" ;; - POSIX*BS2000) - echo "${MACHINE}-siemens-sysv4"; exit 0 + + # TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO + # *:XXX:* ) + # ... + # ;; + + # ...A STILL UNKNOWN PLATFORM... + * ) + AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"` + AP="${AT}" + AC="${AP}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$/?/'` + ST="${UNAME_SYSTEM} ${v}" + SP="${ST}" + SC="${SP}" ;; - machten:*) - echo "${MACHINE}-tenon-${SYSTEM}"; exit 0; - ;; - ConvexOS:*:11.*:*) - echo "${MACHINE}-v11-${SYSTEM}"; exit 0; - ;; - UNIX_SV:*:*:maxion) - echo "${MACHINE}-ccur-sysv4"; exit 0; - ;; - PowerMAX_OS:*:*:Night_Hawk) - MACHINE=`uname -p` - echo "${MACHINE}-concurrent-powermax"; exit 0; - ;; - UNIX_SV:*) - if [ -d /usr/nec ];then - echo "mips-nec-sysv4"; exit 0; - fi - ;; - NonStop-UX:4.[02]*:[BC]*:*) - echo "${MACHINE}-tandem-sysv4"; exit 0; - ;; - Rhapsody:*:*:*) - case "${MACHINE}" in - "Power Macintosh") MACHINE=powerpc ;; - esac - echo "${MACHINE}-apple-rhapsody${RELEASE}"; exit 0 - ;; - "Mac OS":*:*:*) - MACHINE=`uname -p` - echo "${MACHINE}-apple-macos${RELEASE}"; exit 0 - ;; - "RISC iX":*) - echo "arm-whatever-riscix"; exit 0; - ;; - *:4.0:2:*) - echo "whatever-unisys-sysv4"; exit 0; - ;; - *:*:dcosx:NILE*) - echo "pyramid-pyramid-svr4"; exit 0; - ;; - *:*:*:"DRS 6000") - echo "drs6000-whatever-whatever"; exit 0; - ;; - esac - - # Now NeXT - ISNEXT=`(hostinfo) 2>/dev/null` - case "$ISNEXT" in - *NeXT*) - # Swiped from a friendly uname clone for NEXT/OPEN Step. - NEXTOSVER="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" - if [ "$NEXTOSVER" -gt 3.3 ]; then - NEXTOS="openstep" - else - NEXTOS="nextstep" - fi - NEXTREL="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" - NEXTARCH=`arch` - echo "${NEXTARCH}-next-${NEXTOS}${NEXTREL}" ; exit 0 - ;; + esac - - # Fallback - echo "${MACHINE}-whatever-${SYSTEM}|${RELEASE}|${VERSION}" - ;; -arx ) - ## - ## arx -- Extended archive command - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - ar_prg="$opt_C" - ar_cmd="$1"; shift - archive="$1"; shift - files="$*" - - # walk through the file list and expand archives members - tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'` - nfiles='' - if [ ".$files" != . ]; then - for file in $files; do - if [ ! -f $file ]; then - echo "$msgprefix:Error: input file not found: $file" 1>&2 - exit 1 - fi - case $file in - *.a ) - if [ ! -d $tmpdir ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $tmpdir" 1>&2 - fi - mkdir $tmpdir - fi - case $tmpdir in - .arx ) - from="../$file" - ;; - * ) - dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - base=`echo $file | sed -e 's;.*/\([^/]*\)$;\1;'` - from="`cd $dir; pwd`/$base" - ;; - esac - if [ ".$opt_t" = .yes ]; then - echo "(cd $tmpdir && $ar_prg x $from)" 1>&2 - fi - (cd $tmpdir && eval $ar_prg x $from) - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: member extraction failed for archive: $file" 1>&2 - exit 1 - fi - for member in - `eval $ar_prg t $file`; do - [ ".$member" = .- ] && continue - nfiles="$nfiles $tmpdir/$member" - done + # provide fallback values + [ ".$AT" = . ] && AT="${AP:-${AC}}" + [ ".$AP" = . ] && AP="${AT:-${AC}}" + [ ".$AC" = . ] && AC="${AP:-${AT}}" + [ ".$ST" = . ] && ST="${SP:-${SC}}" + [ ".$SP" = . ] && SP="${ST:-${SC}}" + [ ".$SC" = . ] && SC="${SP:-${ST}}" + + # support explicit enforced verbose/concise output + if [ ".$opt_v" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'` + elif [ ".$opt_c" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'` + fi + + # provide verbose and concise variants + AC_V=""; AC_N=""; AC_C="" + AP_V=""; AP_N=""; AP_C="" + AT_V=""; AT_N=""; AT_C="" + SC_V=""; SC_N=""; SC_C="" + SP_V=""; SP_N=""; SP_C="" + ST_V=""; ST_N=""; ST_C="" + for var_lc in at ap ac st sp sc; do + case "$opt_F" in + *"%[${val_lc}]"* | *"%{${val_lc}}"* | *"%${val_lc}"* | *"%<${val_lc}>"* ) + var_uc=`util_upper "$var_lc"` + eval "val=\"\$${var_uc}\"" + val_V=""; val_N=""; val_C="" + case "$opt_F" in + *"%[${var_lc}]"* ) + val_V=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];\1;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_V=\"\${val_V}\"" ;; - * ) - nfiles="$nfiles $file" + esac + case "$opt_F" in + *"%{${var_lc}}"* | *"%${var_lc}"* ) + val_N=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_N=\"\${val_N}\"" ;; esac - done - fi - - # run the final archive command - if [ ".$opt_t" = .yes ]; then - echo "$ar_prg $ar_cmd $archive $nfiles" 1>&2 - fi - eval $ar_prg $ar_cmd $archive $nfiles - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: archive command failed" 1>&2 - exit $? - fi - - # cleanup and die gracefully - if [ -d $tmpdir ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -rf $tmpdir" 1>&2 - fi - rm -rf $tmpdir - fi - ;; - -slo ) - ## - ## slo -- Separate linker options by library class - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - DIFS="$IFS" - - # parse out -L and -l options from command line - DIRS='' - LIBS='' - ARGV='' - optprev='' - for opt - do - # concatenate with previous option if exists - if [ ".$optprev" != . ]; then - opt="${optprev}${opt}"; - optprev='' - fi - # remember options for arg when used stand-alone - if [ ".$opt" = ".-L" -o ".$opt" = ".-l" ]; then - optprev="$opt" - continue; - fi - # split argument into option plus option argument - arg="`echo $opt | cut -c3-`" - opt="`echo $opt | cut -c1-2`" - # store into containers - case $opt in - -L) DIRS="$DIRS:$arg" ;; - -l) LIBS="$LIBS:$arg" ;; - *) ARGV="$ARGV $opt" ;; + case "$opt_F" in + *"%<${var_lc}>"* ) + val_C=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_C=\"\${val_C}\"" + ;; + esac + ;; esac done - - # set linker default directories - DIRS_DEFAULT='/lib:/usr/lib' - if [ ".$LD_LIBRARY_PATH" != . ]; then - DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH" - fi - - # sort options by class - DIRS_OBJ='' - LIBS_OBJ='' - DIRS_PIC='' - LIBS_PIC='' - DIRS_DSO='' - LIBS_DSO='' - - # for each library... - OIFS="$IFS" IFS=':' - for lib in $LIBS; do - [ ".$lib" = . ] && continue - - found='no' - found_indefdir='no' - found_type='' - found_dir='' - - # for each directory... - OIFS2="$IFS" IFS=":$DIFS" - for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do - [ ".$dir" = . ] && continue - [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes - [ ! -d $dir ] && continue - - # search the file - OIFS3="$IFS" IFS="$DIFS" - for file in '' `cd $dir && ls lib${lib}.* 2>/dev/null`; do - [ ".$file" = . ] && continue - case $file in - *.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* ) - found=yes; - found_type=DSO; - break - ;; - *.lo|*.la ) - found=yes; - found_type=PIC - ;; - *.a ) - if [ ".$found_type" = . ]; then - found=yes - found_type=OBJ - fi - ;; - esac - done - IFS="$OIFS3" - if [ ".$found" = .yes ]; then - found_dir="$dir" - break - fi - done - IFS="$OIFS2" - - if [ ".$found" = .yes ]; then - if [ ".$found_indefdir" != .yes ]; then - eval "dirlist=\"\${DIRS_${found_type}}:\"" - if [ ".`echo \"$dirlist\" | fgrep :$found_dir:`" = . ]; then - eval "DIRS_${found_type}=\"\$DIRS_${found_type}:${found_dir}\"" - fi - eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" - else - eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" - fi - else - LIBS_OBJ="$LIBS_OBJ:$lib" - #dirlist="`echo $DIRS $DIRS_DEFAULT | sed -e 's/:/ /g'`" - #echo "slo:Warning: library \"$lib\" not found in any of the following dirs:" 2>&1 - #echo "slo:Warning: $dirlist" 1>&1 - fi - done - IFS="$OIFS" - - # also pass-through unused dirs even if it's useless - OIFS="$IFS" IFS=':' - for dir in $DIRS; do - dirlist="${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:" - if [ ".`echo \"$dirlist\" | fgrep :$dir:`" = . ]; then - DIRS_OBJ="$DIRS_OBJ:$dir" - fi - done - IFS="$OIFS" - - # reassemble the options but seperated by type - for type in OBJ PIC DSO; do - OIFS="$IFS" IFS=':' - eval "libs=\"\$LIBS_${type}\"" - opts='' - for lib in $libs; do - [ ".$lib" = . ] && continue - opts="$opts -l$lib" - done - eval "LIBS_${type}=\"$opts\"" - - eval "dirs=\"\$DIRS_${type}\"" - opts='' - for dir in $dirs; do - [ ".$dir" = . ] && continue - opts="$opts -L$dir" - done - eval "DIRS_${type}=\"$opts\"" - IFS="$OIFS" - done - - # give back results - for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do - eval "val=\"\$${var}\"" - val="`echo $val | sed -e 's/^ *//'`" - echo "SLO_${var}=\"${val}\"" - done - ;; -scpp ) - ## - ## scpp -- Sharing C Pre-Processor - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for NPS - ## - - srcs="$*" - output="${opt_o}.n" - - # parse source file(s) - if [ ".$opt_v" = .yes ]; then - echo "Parsing:" | awk '{ printf("%s", $0); }' 1>&2 - fi - for src in $srcs; do - if [ ".$opt_v" = .yes ]; then - echo $src | awk '{ printf(" %s", $0); }' 1>&2 - fi - awk <$src ' - BEGIN { - ln = 0; - fln = 0; - level = 0; - mode = ""; - store = ""; - } - { - ln++; - } - /^#if.*/ { - level++; - } - /^#if [a-zA-Z_][a-zA-Z0-9_]* *$/ { - if ($2 == define) { - mode = "D"; - printf("D:#line %d \"%s\"\n", ln, src); - next; - } - } - /^#endif.*/ { - level--; - if (mode == "D" && level == 0) { - mode = ""; - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_].*;.*/ || /^[a-zA-Z_][a-zA-Z0-9_].*=.*/ { - if ($1 == class) { - printf("V:#line %d \"%s\"\n", ln, src); - printf("V:%s\n", $0); - printf("J:%s\n", $0); - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_]*/ { - if ($1 == class) { - fln = ln; - store = $0; - mode = "F"; - next; - } - } - /^\{ *$/ { - if (mode == "F") { - printf("F:#line %d \"%s\"\n", fln, src); - printf("F:%s;\n", store); - printf("I:%s;\n", store); - store = ""; - mode = ""; - next; - } - } - { - if (mode == "D") - printf("D:%s\n", $0); - else if (mode == "F") - store = store " " $0; - } - ' "src=$src" "define=$opt_D" "class=$opt_C" >>$tmpfile - done - if [ ".$opt_v" = .yes ]; then - echo "" 1>&2 + # create output string + output=`echo ":$opt_F" |\ + sed -e "s/^://" \ + -e "s;%\\[ac\\];${AC_V};g" \ + -e "s;%{ac};${AC_N};g" \ + -e "s;%ac;${AC_N};g" \ + -e "s;%;${AC_C};g" \ + -e "s;%\\[ap\\];${AP_V};g" \ + -e "s;%{ap};${AP_N};g" \ + -e "s;%ap;${AP_N};g" \ + -e "s;%;${AP_C};g" \ + -e "s;%\\[at\\];${AT_V};g" \ + -e "s;%{at};${AT_N};g" \ + -e "s;%at;${AT_N};g" \ + -e "s;%;${AT_C};g" \ + -e "s;%\\[sc\\];${SC_V};g" \ + -e "s;%{sc};${SC_N};g" \ + -e "s;%sc;${SC_N};g" \ + -e "s;%;${SC_C};g" \ + -e "s;%\\[sp\\];${SP_V};g" \ + -e "s;%{sp};${SP_N};g" \ + -e "s;%sp;${SP_N};g" \ + -e "s;%;${SP_C};g" \ + -e "s;%\\[st\\];${ST_V};g" \ + -e "s;%{st};${ST_N};g" \ + -e "s;%st;${ST_N};g" \ + -e "s;%;${ST_C};g" \ + -e 's/\\\\n/^/g' |\ + tr '^' '\012'` + + # support lower/upper-case mapping + if [ ".$opt_L" = .yes ]; then + output=`util_lower "$output"` + elif [ ".$opt_U" = .yes ]; then + output=`util_upper "$output"` fi - - # start generating output header - echo "/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */" >$output - echo "#line 1 \"$opt_t\"" >>$output - sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd' |\ - sed -e "/^${opt_M} *\$/d" >>$output - - # merge in the define blocks - grep '^D:' $tmpfile | sed -e 's/^D://' >>$output - - # generate standard prolog - echo "#line 1 \"_ON_THE_FLY_\"" >>$output - echo "" >>$output - echo "/* make sure the scpp source extensions are skipped */" >>$output - echo "#define $opt_D 0" >>$output - echo "#define $opt_C /**/" >>$output - - # generate namespace hiding for variables - echo "" >>$output - echo "/* move intern variables to hidden namespace */" >>$output - grep '^J:' $tmpfile | sed >>$output \ - -e 's/^J://' \ - -e 's/ */ /g' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\];.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/' - - # generate namespace hiding for functions - echo "" >>$output - echo "/* move intern functions to hidden namespace */" >>$output - grep '^I:' $tmpfile | sed >>$output \ - -e 's/^I://' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/' - - # generate prototypes for variables - echo "" >>$output - echo "/* prototypes for intern variables */" >>$output - grep '^V:' $tmpfile | sed >>$output \ - -e 's/^V://' \ - -e 's/ */ /g' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\);.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\) =.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\);.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \ - -e 's/ ;/;/g' \ - -e "s/^$opt_C /extern /" - - # generate prototypes for functions - echo "" >>$output - echo "/* prototypes for intern functions */" >>$output - grep '^F:' $tmpfile | sed >>$output \ - -e 's/^F://' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e "s/^$opt_C /extern /" - - # finish generating output header - n=`(echo ''; sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd') |\ - wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'` - echo "#line $n \"$opt_t\"" >>$output - sed <$opt_t -e "/^${opt_M} *\$/,\$p" -e 'd' |\ - sed -e "/^${opt_M} *\$/d" >>$output - - # create final output file - if [ -f $opt_o ]; then - if [ ".$opt_p" = .yes ]; then - grep -v '^#line' $opt_o >$tmpfile.o - grep -v '^#line' $output >$tmpfile.n - out_old="$tmpfile.o" - out_new="$tmpfile.n" - else - out_old="$opt_o" - out_new="$output" - fi - if cmp -s $out_old $out_new; then - : - else - cp $output $opt_o - fi + + # display output string + if [ ".$opt_n" = .yes ]; then + echo . | awk '{ printf("%s", output); }' output="$output" else - cp $output $opt_o + echo "$output" fi - rm -f $output - rm -f $tmpfile $tmpfile.* >/dev/null 2>&1 + + shtool_exit 0 ;; version ) ## - ## version -- Generate and maintain a version information file - ## Copyright (c) 1994-1999 Ralf S. Engelschall - ## Originally written for ePerl + ## version -- Maintain a version information file + ## Copyright (c) 1994-2004 Ralf S. Engelschall ## - - LANGUAGE="$opt_l" - NAME="$opt_n" - PREFIX="$opt_p" - FULLVERSION="$opt_s" - INCREASE="$opt_i" - REPORT="$opt_d" - FILE="$1" - - # determine language - if [ ".$LANGUAGE" = .unknown ]; then - case $FILE in - *.txt ) LANGUAGE=txt ;; - *.c ) LANGUAGE=c ;; - *.pl | *.pm ) LANGUAGE=perl ;; - * ) echo "$tool:Error: unknown language type" 1>&2; exit 1 ;; - esac - fi - - # determine prefix from name and vice versa - if [ ".$PREFIX" = . -o ".$PREFIX" = .unknown ]; then - if [ ".$NAME" != . -a ".$NAME" != .unknown ]; then - PREFIX="$NAME" + + file="$1" + + # determine prefix and name + name="$opt_n" + prefix="$opt_p" + + # determine current version + triple="$opt_s" + if [ ".$triple" != . ]; then + # use given triple + if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then + echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2 + shtool_exit 1 fi + eval `echo $triple |\ + sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc + elif [ -r $file ]; then + # determine triple from given file + eval `grep 'Version [0-9]*.[0-9]*[sabp.][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $file |\ + sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\ + ver="\1";rev="\2";typ="\3";lev="\4";tim="\5"%' -e 'q'` + else + # intialise to first version + ver=0 + rev=1 + typ=. + lev=0 + tim=calc fi - if [ ".$NAME" = . -o ".$NAME" = .unknown ]; then - if [ ".$PREFIX" != . -a ".$PREFIX" != .unknown ]; then - NAME="$PREFIX" - fi + + # determine new version in batch + if [ ".$opt_i" != . ]; then + case $opt_i in + v ) ver=`expr $ver + 1` + rev=0 + lev=0 + ;; + r ) rev=`expr $rev + 1` + lev=0 + ;; + l ) lev=`expr $lev + 1` + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2 + shtool_exit 1 + ;; + esac + tim=calc fi - - # determine version - date=unknown - version=0 - revision=0 - bplevel=0 - if [ ".$FULLVERSION" = .unknown ]; then - if [ -r "$FILE" ]; then - # grep out current information - id=`grep 'Version [0-9]*.[0-9]*[.abps][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $FILE | \ - head -1 | \ - sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\1:\2:\3:\4:\5%'` - version=`echo $id | awk -F: '{ print $1 }'` - revision=`echo $id | awk -F: '{ print $2 }'` - bptype=`echo $id | awk -F: '{ print $3 }'` - bplevel=`echo $id | awk -F: '{ print $4 }'` - date=`echo $id | awk -F: '{ print $5 }'` - if [ .$REPORT = .NO ]; then - case $INCREASE in - b ) bplevel=`expr $bplevel + 1` - bptype=b - ;; - a ) bplevel=`expr $bplevel + 1` - bptype=a - ;; - s ) bplevel=`expr $bplevel + 1` - bptype=s - ;; - P ) bplevel=`expr $bplevel + 1` - bptype=. - ;; - p ) bplevel=`expr $bplevel + 1` - bptype=p - ;; - r ) revision=`expr $revision + 1` - bptype=. - bplevel=0 - ;; - v ) version=`expr $version + 1` - revision=0 - bptype=. - bplevel=0 - ;; - esac - date=calc - fi - FULLVERSION="$version.$revision$bptype$bplevel" - else - # intialise to first version - version=0 - revision=5 - bptype=b - bplevel=0 - date=calc - fi - else - # take given version - V=`echo $FULLVERSION | sed -e 's%\([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\).*%\1:\2:\3:\4%'` - version=`echo $V | awk -F: '{ print $1 }'` - revision=`echo $V | awk -F: '{ print $2 }'` - bptype=`echo $V | awk -F: '{ print $3 }'` - bplevel=`echo $V | awk -F: '{ print $4 }'` - date=calc + + # determine new version interactively + if [ ".$opt_e" = .yes ]; then + echo "old version: ${ver}.${rev}${typ}${lev}" + while [ 1 ]; do + echo dummy | awk '{ printf("new version: "); }' + read triple + case $triple in + [0-9]*.[0-9]*[sabp.][0-9]* ) + ;; + * ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2 + continue + ;; + esac + break + done + eval `echo $triple |\ + sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc fi - - # determine hex value of version - case $FULLVERSION in - *.*a* ) - HEX=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*a//' | awk '{ printf("0%02d", $1); }'` - ;; - *.*b* ) - HEX=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*b//' | awk '{ printf("1%02d", $1); }'` - ;; - *.*.* ) - HEX=`echo "$FULLVERSION" | awk -F. '{ printf("%d%02d2%02d", $1, $2, $3); }'` - ;; - esac - - # determine libtool version - case $FULLVERSION in - *.*a* ) - LTV=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*b* ) - LTV=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*.* ) - LTV=`echo "$FULLVERSION" | awk -F. '{ printf("%d:%d", $1*10+$2, $3); }'` - ;; + + # determine hexadecimal and libtool value of version + case $typ in + a ) typnum=0; levnum=$lev ;; + b ) typnum=1; levnum=$lev ;; + p | . ) typnum=2; levnum=$lev ;; + s ) typnum=15; levnum=255 ;; # snapshots are special esac - - # determine string out of filename - # (don't try to optimize this in any way - portability!) - FILESTR=`echo "$FILE" |\ - tr 'abcdefghijklmnopqrstuvwxyz./%+' \ - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` - + hex=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("0x%x%02x%1x%02x", $1, $2, $3, $4); }' |\ + tr 'abcdef' 'ABCDEF'` + ltv=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` + # determine date - if [ ".$date" = .calc ]; then + if [ ".$tim" = .calc ]; then day=`date '+%d'` month=`date '+%m'` year=`date '+%Y' 2>/dev/null` @@ -2215,264 +1242,185 @@ version ) 11) month='Nov' ;; 12) month='Dec' ;; esac - date="${day}-${month}-${year}" + tim="${day}-${month}-${year}" fi - - if [ .$REPORT != .NO ]; then - case $REPORT in - long ) - echo "$version.$revision$bptype$bplevel ($date)" - ;; + + # perform result actions + mode=show + if [ ".$opt_i" != . ]; then + mode=edit + elif [ ".$opt_e" = .yes ]; then + mode=edit + elif [ ".$opt_s" != . ]; then + mode=edit + fi + if [ ".$mode" = .show ]; then + # just display the current version + case $opt_d in short ) - echo "$version.$revision$bptype$bplevel" + echo "${ver}.${rev}${typ}${lev}" + ;; + long ) + echo "${ver}.${rev}${typ}${lev} ($tim)" ;; libtool ) - echo "$LTV" + echo "${ltv}" ;; hex ) - echo "0x$HEX" + echo "${hex}" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2 + shtool_exit 1 ;; esac - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - fi - - # create the version file according the the selected language - echo "new version: $version.$revision$bptype$bplevel ($date)" - case $LANGUAGE in - txt ) - cat >$tmpfile <<'EOT' - - This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@) -EOT - ;; - c ) - cat >$tmpfile <<'EOT' -/* -** @FILE@ -- Version Information -** [automatically generated and maintained by shtool] -*/ - -#ifdef _AS_HEADER - -#ifndef _@FILESTR@ -#define _@FILESTR@ -#define @PREFIX@_VERSION 0x@HEX@ -extern const int @PREFIX@_Version; -extern const char @PREFIX@_VersionStr[]; -extern const char @PREFIX@_Hello[]; -extern const char @PREFIX@_GNUVersion[]; -extern const char @PREFIX@_WhatID[]; -extern const char @PREFIX@_RCSIdentID[]; -extern const char @PREFIX@_WebID[]; -extern const char @PREFIX@_PlainID[]; -#endif /* _@FILESTR@ */ - -#else - -const int @PREFIX@_Version = 0x@HEX@; -const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_RCSIdentID[] = "$Id: shtool 1.1 Tue, 27 Jan 2004 11:46:36 -0800 shawnw $"; -const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -#endif -EOT - ;; - perl ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by shtool] -## + else + # update the version file -$@PREFIX@_Version = 0x@HEX@; -$@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_RCSIdentID = "\$Id: shtool 1.1 Tue, 27 Jan 2004 11:46:36 -0800 shawnw $/"; -$@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -1; -EOT - ;; - esac - - # now create the version file - rm -f $FILE >/dev/null 2>&1 - sed \ - -e "s|@FILE@|$FILE|g" \ - -e "s|@FILESTR@|$FILESTR|g" \ - -e "s|@PREFIX@|$PREFIX|g" \ - -e "s|@NAME@|$NAME|g" \ - -e "s|@HEX@|$HEX|g" \ - -e "s|@VERSION@|$version|g" \ - -e "s|@REVISION@|$revision|g" \ - -e "s|@BPTYPE@|$bptype|g" \ - -e "s|@BPLEVEL@|$bplevel|g" \ - -e "s|@YEAR@|$year|g" \ - -e "s|@MONTH@|$month|g" \ - -e "s|@DAY@|$day|g" <$tmpfile >$FILE - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - ;; + # pre-generate various strings + triple="${ver}.${rev}${typ}${lev}" + vHex="$hex" + vShort="${triple}" + vLong="${triple} (${tim})" + vTeX="This is ${name}, Version ${triple} (${tim})" + vGNU="${name} ${triple} (${tim})" + vWeb="${name}/${triple}" + vSCCS="@(#)${name} ${triple} (${tim})" + vRCS="\$Id: ${name} ${triple} (${tim}) \$" -path ) - ## - ## path -- Deal with program paths - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - namelist="$*" - - # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then - minusx="-x" - else - minusx="-r" - fi - rm -f $tmpfile - - # split path string - paths="`echo $opt_p |\ - sed -e 's/^:/.:/' \ - -e 's/::/:.:/g' \ - -e 's/:$/:./' \ - -e 's/:/ /g'`" - - # SPECIAL REQUEST - # translate forward to reverse path - if [ ".$opt_r" = .yes ]; then - if [ "x$namelist" = "x." ]; then - rp='.' - else - rp='' - for pe in `IFS="$IFS/"; echo $namelist`; do - rp="../$rp" - done - fi - echo $rp | sed -e 's:/$::' - exit 0 - fi - - # SPECIAL REQUEST - # strip out directory or base name - if [ ".$opt_d" = .yes ]; then - echo "$namelist" |\ - sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' - exit 0 - fi - if [ ".$opt_b" = .yes ]; then - echo "$namelist" |\ - sed -e 's;.*/\([^/]*\)$;\1;' - exit 0 - fi - - # MAGIC SITUATION - # Perl Interpreter (perl) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then - rm -f $tmpfile - touch $tmpfile - c=0 - found=0 - for dir in $paths; do - dir=`echo $dir | sed -e 's;/*$;;'` - for perl in perl5 perl miniperl; do - if [ $minusx "$dir/$perl" ]; then - perl="$dir/$perl" - version=`$perl -v | grep version |\ - sed -e 's/.* version //' -e 's/ built.*//' -e 's/ with.*//'` - versionnum="`echo $version | sed -e 's/\.//g' -e 's/_//g'`" - versionnum=`expr $versionnum - $c` - echo "$versionnum $perl" >>$tmpfile - found=1 - fi - done - c=`expr $c + 1` - done - if [ $found = 1 ]; then - perl="`cat $tmpfile | sort -u | tail -1 | cut '-d ' -f2`" - rm -f $tmpfile - echo "$perl" - exit 0 - fi - exit 1 - fi - - # MAGIC SITUATION - # C pre-processor (cpp) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then - cat >$tmpfile.c < - Syntax Error -EOT - # 1. try the standard cc -E approach - cpp="${CC-cc} -E" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 2. try the cc -E approach and GCC's -traditional-ccp option - cpp="${CC-cc} -E -traditional-cpp" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 3. try a standalone cpp command in path and lib dirs - for path in $paths /lib /usr/lib /usr/local/lib; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then - cpp="$path/cpp" - break - fi - done - if [ ".$cpp" != . ]; then - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # ok, we gave up... - cpp='' - fi - fi - fi - fi - rm -f $tmpfile.c $tmpfile.out - if [ ".$cpp" != . ]; then - echo "$cpp" - exit 0 - fi - exit 1 + # determine string out of filename + # (do NOT try to optimize this in any way because of portability) + filestr=`echo $file |\ + tr 'abcdefghijklmnopqrstuvwxyz./%+' \ + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` + + # generate uppercase prefix + prefixupper=`echo $prefix |\ + tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + + # create the version file according the the selected language + echo "new version: ${vLong}" + + cp /dev/null $file + case $opt_l in + txt ) + echo >>$file "" + echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)" + echo >>$file " [automatically generated and maintained by GNU shtool]" + echo >>$file "" + echo >>$file " $vTeX" + echo >>$file "" + ;; + c ) + echo >>$file "/*" + echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)" + echo >>$file "** [automatically generated and maintained by GNU shtool]" + echo >>$file "*/" + echo >>$file "" + echo >>$file "#ifdef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "#ifndef _${filestr}_" + echo >>$file "#define _${filestr}_" + echo >>$file "" + echo >>$file "#define ${prefixupper}VERSION ${vHex}" + echo >>$file "" + echo >>$file "typedef struct {" + echo >>$file " const int v_hex;" + echo >>$file " const char *v_short;" + echo >>$file " const char *v_long;" + echo >>$file " const char *v_tex;" + echo >>$file " const char *v_gnu;" + echo >>$file " const char *v_web;" + echo >>$file " const char *v_sccs;" + echo >>$file " const char *v_rcs;" + echo >>$file "} ${prefix}version_t;" + echo >>$file "" + echo >>$file "extern ${prefix}version_t ${prefix}version;" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_ */" + echo >>$file "" + echo >>$file "#else /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + echo >>$file "#define _${filestr}_AS_HEADER_" + echo >>$file "#include \"${file}\"" + echo >>$file "#undef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "${prefix}version_t ${prefix}version = {" + echo >>$file " ${vHex}," + echo >>$file " \"${vShort}\"," + echo >>$file " \"${vLong}\"," + echo >>$file " \"${vTeX}\"," + echo >>$file " \"${vGNU}\"," + echo >>$file " \"${vWeb}\"," + echo >>$file " \"${vSCCS}\"," + echo >>$file " \"${vRCS}\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + ;; + m4 ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: M4)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "m4_define([v_hex], [${vHex}])" + echo >>$file "m4_define([v_short], [${vShort}])" + echo >>$file "m4_define([v_long], [${vLong}])" + echo >>$file "m4_define([v_tex], [${vTeX}])" + echo >>$file "m4_define([v_gnu], [${vGNU}])" + echo >>$file "m4_define([v_web], [${vWeb}])" + echo >>$file "m4_define([v_sccs], [${vSCCS}])" + echo >>$file "m4_define([v_rcs], [${vRCS}])" + echo >>$file "" + ;; + perl ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Perl)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "my \$${prefix}version = {" + echo >>$file " 'v_hex' => ${vHex}," + echo >>$file " 'v_short' => \"${vShort}\"," + echo >>$file " 'v_long' => \"${vLong}\"," + echo >>$file " 'v_tex' => \"${vTeX}\"," + echo >>$file " 'v_gnu' => \"${vGNU}\"," + echo >>$file " 'v_web' => \"${vWeb}\"," + echo >>$file " 'v_sccs' => \"${vSCCS}\"," + echo >>$file " 'v_rcs' => \"\\${vRCS}/\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "1;" + echo >>$file "" + ;; + python ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Python)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "class ${prefix}version:" + echo >>$file " v_hex = ${vHex}" + echo >>$file " v_short = \"${vShort}\"" + echo >>$file " v_long = \"${vLong}\"" + echo >>$file " v_tex = \"${vTeX}\"" + echo >>$file " v_gnu = \"${vGNU}\"" + echo >>$file " v_web = \"${vWeb}\"" + echo >>$file " v_sccs = \"${vSCCS}\"" + echo >>$file " v_rcs = \"${vRCS}\"" + echo >>$file "" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 + shtool_exit 1 + ;; + esac fi - - # STANDARD SITUATION - # iterate over names - for name in $namelist; do - # iterate over paths - for path in $paths; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then - if [ ".$opt_s" != .yes ]; then - echo "$path/$name" 2>&1 - fi - exit 0 - fi - done - done - exit 1 + + shtool_exit 0 ;; esac -exit 0 +shtool_exit 0 -##EOF## -- cgit v1.2.3 From 75e16fb4273b859106f7ca0355c0ef545efe89b1 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 28 Nov 2017 07:25:27 +0100 Subject: configure_in Gbp-Pq: Name 05_configure_in.diff --- Makefile.in | 2 +- configure.in | 204 ++++++++++++++++++------------------------------------ tests/Makefile.in | 4 +- 3 files changed, 69 insertions(+), 141 deletions(-) diff --git a/Makefile.in b/Makefile.in index c1f41c0..b2f802d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,7 +4,7 @@ RESULT=pcap LIBINSTALL_FILES=$(wildcard *.mli *.cmi *.cma *.cmx *.cmxa *.a *.so) CC=@CC@ -CFLAGS=@CFLAGS@ +CFLAGS=@CFLAGS@ @cp4flag@ CLIBS=$(foreach lib, @LIBS@, $(subst -l,,${lib})) LDFLAGS=@LDFLAGS@ IDLFLAGS=-no-include diff --git a/configure.in b/configure.in index 0211f96..0ace885 100644 --- a/configure.in +++ b/configure.in @@ -1,162 +1,90 @@ +dnl Standard configuration + AC_INIT(pcap.idl) -AC_MSG_CHECKING(for version) +AC_MSG_CHECKING([for version]) VERSION="`etc/shtool version -l txt -d short VERSION`" -AC_MSG_RESULT "Configuring Version $VERSION" +AC_MSG_RESULT([Configuring Version $VERSION]) AC_SUBST(VERSION) - -AC_MSG_CHECKING(for platform) -ARCH="`etc/shtool guessos`" -AC_MSG_RESULT "$ARCH" +AC_MSG_CHECKING([for platform]) +ARCH="`etc/shtool platform`" +AC_MSG_RESULT([$ARCH]) AC_SUBST(ARCH) -AC_CHECKING(for ocaml compiler and tools) -AC_CHECK_PROG(ocamlc,ocamlc,ocamlc) -AC_CHECK_PROG(ocamlopt,ocamlopt,ocamlopt) -AC_CHECK_PROG(ocamlfind,ocamlfind,ocamlfind,ocamlidl) AC_PROG_INSTALL AC_SUBST(INSTALL) -AC_CHECKING(for C compiler) AC_PROG_CC - -AC_CHECKING(for C header files) AC_HEADER_STDC -# -camlidldir="" -camlidllibdir="" -ffcalldir="" -ffcallarchive="" -libpcapdir="" -cp4flag="" -# - -AC_ARG_ENABLE(examples, - [ --enable-examples build example programs [default=no]],,enable_examples="no") - -# -AC_CHECKING(libraries) - -#AC_CHECKING(for pcap library) -#if test "$ac_cv_lib_pcap" == "no"; then -# #dirs="/usr/local/lib -# # /usr/local/lib -# # /usr/lib -# # /lib" -# dirs="/home/x25/code/MLpcap/libpcap-0.8.3" -# for d in $dirs; do -# test -f "$d/libpcap.a" && LDFLAGS="-L$d" -# done -# AC_CHECKING(in more locations) -# unset ac_cv_lib_pcap -#fi - -if test "x$enable_examples" = "xyes"; then - -AC_ARG_WITH(camlidl-lib, -[ --with-camlidl-lib[=DIR] libcamlidl.a location], -[ - camlidllibdir=$withval - if ! test -f "$camlidllibdir/libcamlidl.a"; then - AC_MSG_ERROR(can't find libcamlidl.a in $camlidllibdir) - fi -], -[ - AC_MSG_ERROR(missing --with-camlidl-lib) -]) - -AC_CHECKING(for ffcall callback library) - dirs="/usr/local/lib - /usr/lib - /lib" - for d in $dirs; do - test -f "$d/libcallback.a" && ffcallarchive="$d/libcallback.a" - done +dnl Ocaml + +AC_CHECK_PROG(ocamlc,ocamlc,ocamlc,no) +if test "x$ocamlc" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlc.]) fi -AC_ARG_WITH(libpcap, -[ --with-libpcap[=DIR] libpcap.a/.so location], -[ - libpcapdir=$withval - if ! test -f "$libpcapdir/libpcap.a"; then - AC_MSG_ERROR(can't find libpcap.a in $libpcapdir) - fi - - # check for libpcap >=0.8, set CFLAGS and camlp4 flag - `which strings` "$libpcapdir/libpcap.a"|grep to_descr 2>&1 >/dev/null - test $? && CFLAGS="$CFLAGS -DHAVE_PCAP08" && cp4flag="HAVE_PCAP08" -], -[ - #AC_MSG_ERROR(missing --with-libpcap) - # try the default - libpcapdir="/usr/lib" -]) - - -AC_CHECKING(for pcap header files) - -AC_ARG_WITH(pcap-header, -[ --with-pcap-header[=DIR] pcap header installation directory], -[ - pcapheaderdir=$withval - AC_CHECK_HEADER($pcapheaderdir/pcap.h, - [ CFLAGS="$CFLAGS -I$pcapheaderdir"; HAVE_PCAP_HEADER="yes" ]) -], -[ - AC_CHECK_HEADER(pcap.h, [HAVE_PCAP_HEADER="yes"]) -]) - -if test -z "$HAVE_PCAP_HEADER"; then - AC_MSG_ERROR(can't find pcap.h) +AC_CHECK_PROG(ocamlopt,ocamlopt,ocamlopt) +if test "x$ocamlopt" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlopt.]) fi -AC_CHECKING(for camlidl header) - -AC_ARG_WITH(camlidl, -[ --with-camlidl[=DIR] camlidl installation directory], -[ - camlidldir=$withval - AC_CHECK_HEADER($camlidldir/caml/camlidlruntime.h, - [ CFLAGS="$CFLAGS -I$camlidldir"; HAVE_CAMLIDLRUNTIME_H="yes" ]) -], -[ - AC_CHECK_HEADER(caml/camlidlruntime.h, [HAVE_CAMLIDLRUNTIME_H="yes"]) -]) - -if test -z "$HAVE_CAMLIDLRUNTIME_H"; then - AC_MSG_ERROR(can't find camlidlruntime.h) +AC_CHECK_PROG(ocamlfind,ocamlfind,ocamlfind) +if test "x$ocamlfind" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlfind.]) fi -AC_CHECKING(for ffcall callback header) - -AC_ARG_WITH(ffcall, -[ --with-ffcall[=DIR] ffcall installation directory], -[ - ffcalldir=$withval - AC_CHECK_HEADER($ffcalldir/callback.h, - [ CFLAGS="$CFLAGS -I$ffcalldir"; HAVE_CALLBACK_H="yes" ]) -], -[ - AC_CHECK_HEADER(callback.h,[HAVE_CALLBACK_H="yes"]) -]) - -if test -z "$HAVE_CALLBACK_H"; then - AC_MSG_ERROR(can't find callback.h) +dnl ------- +dnl Camlidl +dnl ------- + +AC_CHECK_PROG(camlidl,camlidl,camlidl) +if test "x$camlidl" = "xno"; then + AC_MSG_ERROR([Cannot find camlidl.]) fi -AC_SUBST(camlidldir) -AC_SUBST(camlidllibdir) -AC_SUBST(ffcalldir) -AC_SUBST(ffcallarchive) -AC_SUBST(libpcapdir) -AC_SUBST(cp4flag) +dnl Header + +AC_CHECK_HEADER(caml/camlidlruntime.h,, + AC_MSG_ERROR([can't find camlidlruntime.h])) + +dnl ------- +dnl Libpcap +dnl ------- -if test "x$enable_examples" = "xyes"; then - output="[Makefile tests/Makefile]" -else - output="Makefile" +dnl Version 0.8 +AC_CHECK_LIB(pcap, + pcap_datalink_val_to_description, + [AC_DEFINE(HAVE_PCAP08) + cp4flag="-DHAVE_PCAP08" + LIBS="-lpcap $LIBS"]) + +if test "x$cp4flag" = "x"; then + AC_CHECK_LIB(pcap, + pcap_open_live,, + AC_MSG_ERROR([can't find pcap library].)) fi -AC_OUTPUT($output) +AC_SUBST(cp4flag) + +dnl Header + +AC_CHECK_HEADER(pcap.h,, + AC_MSG_ERROR(can't find pcap.h)) + +dnl --------------- +dnl Ffcall callback +dnl --------------- + +AC_CHECK_LIB(callback, + alloc_trampoline_r,, + AC_MSG_ERROR([can't find callback library.])) + +dnl Header + +AC_CHECK_HEADER(callback.h) + +dnl Makefile generation + +AC_OUTPUT([Makefile tests/Makefile]) diff --git a/tests/Makefile.in b/tests/Makefile.in index ea6abce..9c3b4ab 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -12,7 +12,7 @@ pcap_open_offline all: $(TARGETS) $(TARGETS): $(OBJECTS) - $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma -I @camlidllibdir@ -ccopt -L@libpcapdir@ -cclib -lpcap @ffcallarchive@ + $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma clean: rm -f *.cmo *.cmi $(TARGETS) @@ -20,5 +20,5 @@ clean: .SUFFIXES: .ml .cmo .cmi .ml.cmo: - $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo -D@cp4flag@' -I .. -c $< + $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -I .. -c $< -- cgit v1.2.3 From beb80185569e351e76a17ac05aae6cf9d372125a Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 28 Nov 2017 07:25:27 +0100 Subject: configure Gbp-Pq: Name 06_configure.diff --- configure | 4928 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 2825 insertions(+), 2103 deletions(-) diff --git a/configure b/configure index 4812885..bdf9387 100755 --- a/configure +++ b/configure @@ -1,9 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. +# Generated by GNU Autoconf 2.60a. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -17,20 +17,80 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -41,21 +101,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,206 +124,436 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -274,42 +565,109 @@ ac_unique_file="pcap.idl" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION ARCH ocamlc ocamlopt ocamlfind INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP camlidldir camlidllibdir ffcalldir ffcallarchive libpcapdir cp4flag LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +VERSION +ARCH +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +INSTALL +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +ocamlc +ocamlopt +ocamlfind +camlidl +cp4flag +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -336,34 +694,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -385,12 +757,18 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. @@ -398,7 +776,17 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` @@ -407,11 +795,7 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -438,6 +822,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -462,13 +852,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -533,6 +926,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -589,11 +992,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` @@ -602,7 +1001,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -633,8 +1032,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -654,27 +1052,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -701,74 +1091,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -797,14 +1189,11 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -817,15 +1206,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -836,113 +1232,99 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-examples build example programs default=no - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-camlidl-lib=DIR libcamlidl.a location - --with-libpcap=DIR libpcap.a/.so location - --with-pcap-header=DIR pcap header installation directory - --with-camlidl=DIR camlidl installation directory - --with-ffcall=DIR ffcall installation directory - Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.60a -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.60a. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -961,7 +1343,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -975,6 +1357,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -996,7 +1379,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1007,7 +1389,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1015,23 +1397,21 @@ do 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1042,8 +1422,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1056,20 +1436,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1080,22 +1474,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1107,26 +1507,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1157,14 +1555,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1180,8 +1581,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1193,12 +1594,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1211,20 +1611,19 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1241,12 +1640,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1263,156 +1656,58 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for version" >&5 -echo $ECHO_N "checking for version... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for version" >&5 +echo $ECHO_N "checking for version... $ECHO_C" >&6; } VERSION="`etc/shtool version -l txt -d short VERSION`" -echo "$as_me:$LINENO: result: " >&5 -echo "${ECHO_T}" >&6 "Configuring Version $VERSION" - - - -echo "$as_me:$LINENO: checking for platform" >&5 -echo $ECHO_N "checking for platform... $ECHO_C" >&6 -ARCH="`etc/shtool guessos`" -echo "$as_me:$LINENO: result: " >&5 -echo "${ECHO_T}" >&6 "$ARCH" - -{ echo "$as_me:$LINENO: checking for ocaml compiler and tools..." >&5 -echo "$as_me: checking for ocaml compiler and tools..." >&6;} -# Extract the first word of "ocamlc", so it can be a program name with args. -set dummy ocamlc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlc"; then - ac_cv_prog_ocamlc="$ocamlc" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlc="ocamlc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ocamlc=$ac_cv_prog_ocamlc -if test -n "$ocamlc"; then - echo "$as_me:$LINENO: result: $ocamlc" >&5 -echo "${ECHO_T}$ocamlc" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -# Extract the first word of "ocamlopt", so it can be a program name with args. -set dummy ocamlopt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlopt"; then - ac_cv_prog_ocamlopt="$ocamlopt" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlopt="ocamlopt" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ocamlopt=$ac_cv_prog_ocamlopt -if test -n "$ocamlopt"; then - echo "$as_me:$LINENO: result: $ocamlopt" >&5 -echo "${ECHO_T}$ocamlopt" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +{ echo "$as_me:$LINENO: result: Configuring Version $VERSION" >&5 +echo "${ECHO_T}Configuring Version $VERSION" >&6; } -# Extract the first word of "ocamlfind", so it can be a program name with args. -set dummy ocamlfind; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlfind+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlfind"; then - ac_cv_prog_ocamlfind="$ocamlfind" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlfind="ocamlfind" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - test -z "$ac_cv_prog_ocamlfind" && ac_cv_prog_ocamlfind="ocamlidl" -fi -fi -ocamlfind=$ac_cv_prog_ocamlfind -if test -n "$ocamlfind"; then - echo "$as_me:$LINENO: result: $ocamlfind" >&5 -echo "${ECHO_T}$ocamlfind" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +{ echo "$as_me:$LINENO: checking for platform" >&5 +echo $ECHO_N "checking for platform... $ECHO_C" >&6; } +ARCH="`etc/shtool platform`" +{ echo "$as_me:$LINENO: result: $ARCH" >&5 +echo "${ECHO_T}$ARCH" >&6; } ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -1425,9 +1720,10 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1441,6 +1737,7 @@ do case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -1448,40 +1745,41 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1493,8 +1791,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ echo "$as_me:$LINENO: checking for C compiler..." >&5 -echo "$as_me: checking for C compiler..." >&6;} ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1503,8 +1799,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1517,32 +1813,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1555,36 +1853,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1597,74 +1910,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1678,7 +1951,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1689,6 +1962,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1706,22 +1980,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1734,36 +2009,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1776,29 +2053,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1811,27 +2104,40 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1851,47 +2157,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; + # We found the default executable, but exeext='' is most + # certainly right. + break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; * ) - break;; + break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1903,19 +2239,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -1934,22 +2272,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -1960,10 +2303,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + break;; * ) break;; esac done @@ -1976,19 +2318,18 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2004,14 +2345,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2029,17 +2376,16 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2058,14 +2404,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2074,25 +2442,28 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2108,14 +2479,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2124,239 +2517,278 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; + int main () { -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' \ - '#include ' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - : + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue + fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; int main () { -exit (42); +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - break + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h +rm -f conftest.$ac_ext +CC=$ac_save_CC + fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2364,16 +2796,13 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for C header files..." >&5 -echo "$as_me: checking for C header files..." >&6;} - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2395,7 +2824,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2406,10 +2834,15 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2418,6 +2851,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2433,12 +2867,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2446,8 +2880,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2456,6 +2895,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2473,6 +2913,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2490,8 +2931,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -2502,7 +2943,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2513,10 +2953,15 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2525,6 +2970,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2540,12 +2986,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2553,8 +2999,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2563,6 +3014,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2580,6 +3032,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2602,28 +3055,174 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2643,14 +3242,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2659,14 +3280,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2688,7 +3309,6 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2713,21 +3333,21 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -2738,19 +3358,28 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + || toupper (i) != TOUPPER (i)) + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2763,12 +3392,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -2778,100 +3409,181 @@ _ACEOF fi -# -camlidldir="" -camlidllibdir="" -ffcalldir="" -ffcallarchive="" -libpcapdir="" -cp4flag="" -# - -# Check whether --enable-examples or --disable-examples was given. -if test "${enable_examples+set}" = set; then - enableval="$enable_examples" +# Extract the first word of "ocamlc", so it can be a program name with args. +set dummy ocamlc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - enable_examples="no" -fi; - -# -{ echo "$as_me:$LINENO: checking libraries..." >&5 -echo "$as_me: checking libraries..." >&6;} - -#AC_CHECKING(for pcap library) -#if test "$ac_cv_lib_pcap" == "no"; then -# #dirs="/usr/local/lib -# # /usr/local/lib -# # /usr/lib -# # /lib" -# dirs="/home/x25/code/MLpcap/libpcap-0.8.3" -# for d in $dirs; do -# test -f "$d/libpcap.a" && LDFLAGS="-L$d" -# done -# AC_CHECKING(in more locations) -# unset ac_cv_lib_pcap -#fi - -if test "x$enable_examples" = "xyes"; then - - -# Check whether --with-camlidl-lib or --without-camlidl-lib was given. -if test "${with_camlidl_lib+set}" = set; then - withval="$with_camlidl_lib" - - camlidllibdir=$withval - if ! test -f "$camlidllibdir/libcamlidl.a"; then - { { echo "$as_me:$LINENO: error: can't find libcamlidl.a in $camlidllibdir" >&5 -echo "$as_me: error: can't find libcamlidl.a in $camlidllibdir" >&2;} - { (exit 1); exit 1; }; } - fi - + if test -n "$ocamlc"; then + ac_cv_prog_ocamlc="$ocamlc" # Let the user override the test. else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlc="ocamlc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - { { echo "$as_me:$LINENO: error: missing --with-camlidl-lib" >&5 -echo "$as_me: error: missing --with-camlidl-lib" >&2;} - { (exit 1); exit 1; }; } - -fi; - -{ echo "$as_me:$LINENO: checking for ffcall callback library..." >&5 -echo "$as_me: checking for ffcall callback library..." >&6;} - dirs="/usr/local/lib - /usr/lib - /lib" - for d in $dirs; do - test -f "$d/libcallback.a" && ffcallarchive="$d/libcallback.a" - done + test -z "$ac_cv_prog_ocamlc" && ac_cv_prog_ocamlc="no" +fi +fi +ocamlc=$ac_cv_prog_ocamlc +if test -n "$ocamlc"; then + { echo "$as_me:$LINENO: result: $ocamlc" >&5 +echo "${ECHO_T}$ocamlc" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -# Check whether --with-libpcap or --without-libpcap was given. -if test "${with_libpcap+set}" = set; then - withval="$with_libpcap" - - libpcapdir=$withval - if ! test -f "$libpcapdir/libpcap.a"; then - { { echo "$as_me:$LINENO: error: can't find libpcap.a in $libpcapdir" >&5 -echo "$as_me: error: can't find libpcap.a in $libpcapdir" >&2;} +if test "x$ocamlc" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlc." >&5 +echo "$as_me: error: Cannot find ocamlc." >&2;} { (exit 1); exit 1; }; } - fi - - # check for libpcap >=0.8, set CFLAGS and camlp4 flag - `which strings` "$libpcapdir/libpcap.a"|grep to_descr 2>&1 >/dev/null - test $? && CFLAGS="$CFLAGS -DHAVE_PCAP08" && cp4flag="HAVE_PCAP08" - -else - - #AC_MSG_ERROR(missing --with-libpcap) - # try the default - libpcapdir="/usr/lib" +fi -fi; +# Extract the first word of "ocamlopt", so it can be a program name with args. +set dummy ocamlopt; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ocamlopt"; then + ac_cv_prog_ocamlopt="$ocamlopt" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlopt="ocamlopt" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS +fi +fi +ocamlopt=$ac_cv_prog_ocamlopt +if test -n "$ocamlopt"; then + { echo "$as_me:$LINENO: result: $ocamlopt" >&5 +echo "${ECHO_T}$ocamlopt" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$ocamlopt" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlopt." >&5 +echo "$as_me: error: Cannot find ocamlopt." >&2;} + { (exit 1); exit 1; }; } +fi + +# Extract the first word of "ocamlfind", so it can be a program name with args. +set dummy ocamlfind; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlfind+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ocamlfind"; then + ac_cv_prog_ocamlfind="$ocamlfind" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlfind="ocamlfind" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ocamlfind=$ac_cv_prog_ocamlfind +if test -n "$ocamlfind"; then + { echo "$as_me:$LINENO: result: $ocamlfind" >&5 +echo "${ECHO_T}$ocamlfind" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$ocamlfind" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlfind." >&5 +echo "$as_me: error: Cannot find ocamlfind." >&2;} + { (exit 1); exit 1; }; } +fi + + +# Extract the first word of "camlidl", so it can be a program name with args. +set dummy camlidl; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_camlidl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$camlidl"; then + ac_cv_prog_camlidl="$camlidl" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_camlidl="camlidl" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +camlidl=$ac_cv_prog_camlidl +if test -n "$camlidl"; then + { echo "$as_me:$LINENO: result: $camlidl" >&5 +echo "${ECHO_T}$camlidl" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$camlidl" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find camlidl." >&5 +echo "$as_me: error: Cannot find camlidl." >&2;} + { (exit 1); exit 1; }; } +fi -{ echo "$as_me:$LINENO: checking for pcap header files..." >&5 -echo "$as_me: checking for pcap header files..." >&6;} # On IRIX 5.3, sys/types and inttypes.h are conflicting. @@ -2884,16 +3596,15 @@ echo "$as_me: checking for pcap header files..." >&6;} for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2904,14 +3615,36 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2920,12 +3653,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -2936,44 +3671,58 @@ fi done - -# Check whether --with-pcap-header or --without-pcap-header was given. -if test "${with_pcap_header+set}" = set; then - withval="$with_pcap_header" - - pcapheaderdir=$withval - as_ac_Header=`echo "ac_cv_header_$pcapheaderdir/pcap.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $pcapheaderdir/pcap.h" >&5 -echo $ECHO_N "checking for $pcapheaderdir/pcap.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then + { echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 +echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6; } +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 +echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $pcapheaderdir/pcap.h usability" >&5 -echo $ECHO_N "checking $pcapheaderdir/pcap.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking caml/camlidlruntime.h usability" >&5 +echo $ECHO_N "checking caml/camlidlruntime.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$pcapheaderdir/pcap.h> +#include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2982,26 +3731,31 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $pcapheaderdir/pcap.h presence" >&5 -echo $ECHO_N "checking $pcapheaderdir/pcap.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking caml/camlidlruntime.h presence" >&5 +echo $ECHO_N "checking caml/camlidlruntime.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$pcapheaderdir/pcap.h> +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3010,6 +3764,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3024,383 +3779,294 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for $pcapheaderdir/pcap.h" >&5 -echo $ECHO_N "checking for $pcapheaderdir/pcap.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 +echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6; } +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + ac_cv_header_caml_camlidlruntime_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 +echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$pcapheaderdir"; HAVE_PCAP_HEADER="yes" +if test $ac_cv_header_caml_camlidlruntime_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: can't find camlidlruntime.h" >&5 +echo "$as_me: error: can't find camlidlruntime.h" >&2;} + { (exit 1); exit 1; }; } fi -else - if test "${ac_cv_header_pcap_h+set}" = set; then - echo "$as_me:$LINENO: checking for pcap.h" >&5 -echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6 -if test "${ac_cv_header_pcap_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for pcap_datalink_val_to_description in -lpcap" >&5 +echo $ECHO_N "checking for pcap_datalink_val_to_description in -lpcap... $ECHO_C" >&6; } +if test "${ac_cv_lib_pcap_pcap_datalink_val_to_description+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 -echo "${ECHO_T}$ac_cv_header_pcap_h" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking pcap.h usability" >&5 -echo $ECHO_N "checking pcap.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcap_datalink_val_to_description (); +int +main () +{ +return pcap_datalink_val_to_description (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking pcap.h presence" >&5 -echo $ECHO_N "checking pcap.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + (exit $ac_status); }; }; then + ac_cv_lib_pcap_pcap_datalink_val_to_description=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: pcap.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: pcap.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: pcap.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for pcap.h" >&5 -echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6 -if test "${ac_cv_header_pcap_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_pcap_h=$ac_header_preproc + ac_cv_lib_pcap_pcap_datalink_val_to_description=no fi -echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 -echo "${ECHO_T}$ac_cv_header_pcap_h" >&6 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test $ac_cv_header_pcap_h = yes; then - HAVE_PCAP_HEADER="yes" -fi - - - -fi; +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcap_pcap_datalink_val_to_description" >&5 +echo "${ECHO_T}$ac_cv_lib_pcap_pcap_datalink_val_to_description" >&6; } +if test $ac_cv_lib_pcap_pcap_datalink_val_to_description = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_PCAP08 1 +_ACEOF -if test -z "$HAVE_PCAP_HEADER"; then - { { echo "$as_me:$LINENO: error: can't find pcap.h" >&5 -echo "$as_me: error: can't find pcap.h" >&2;} - { (exit 1); exit 1; }; } + cp4flag="-DHAVE_PCAP08" + LIBS="-lpcap $LIBS" fi -{ echo "$as_me:$LINENO: checking for camlidl header..." >&5 -echo "$as_me: checking for camlidl header..." >&6;} - -# Check whether --with-camlidl or --without-camlidl was given. -if test "${with_camlidl+set}" = set; then - withval="$with_camlidl" +if test "x$cp4flag" = "x"; then - camlidldir=$withval - as_ac_Header=`echo "ac_cv_header_$camlidldir/caml/camlidlruntime.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $camlidldir/caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for $camlidldir/caml/camlidlruntime.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for pcap_open_live in -lpcap" >&5 +echo $ECHO_N "checking for pcap_open_live in -lpcap... $ECHO_C" >&6; } +if test "${ac_cv_lib_pcap_pcap_open_live+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $camlidldir/caml/camlidlruntime.h usability" >&5 -echo $ECHO_N "checking $camlidldir/caml/camlidlruntime.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$camlidldir/caml/camlidlruntime.h> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcap_open_live (); +int +main () +{ +return pcap_open_live (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_pcap_pcap_open_live=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_cv_lib_pcap_pcap_open_live=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $camlidldir/caml/camlidlruntime.h presence" >&5 -echo $ECHO_N "checking $camlidldir/caml/camlidlruntime.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$camlidldir/caml/camlidlruntime.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcap_pcap_open_live" >&5 +echo "${ECHO_T}$ac_cv_lib_pcap_pcap_open_live" >&6; } +if test $ac_cv_lib_pcap_pcap_open_live = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPCAP 1 +_ACEOF - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 + LIBS="-lpcap $LIBS" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $camlidldir/caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for $camlidldir/caml/camlidlruntime.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + { { echo "$as_me:$LINENO: error: can't find pcap library." >&5 +echo "$as_me: error: can't find pcap library." >&2;} + { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$camlidldir"; HAVE_CAMLIDLRUNTIME_H="yes" -fi -else - if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then - echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6 -if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then +if test "${ac_cv_header_pcap_h+set}" = set; then + { echo "$as_me:$LINENO: checking for pcap.h" >&5 +echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pcap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 -echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 +echo "${ECHO_T}$ac_cv_header_pcap_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking caml/camlidlruntime.h usability" >&5 -echo $ECHO_N "checking caml/camlidlruntime.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pcap.h usability" >&5 +echo $ECHO_N "checking pcap.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3409,26 +4075,31 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking caml/camlidlruntime.h presence" >&5 -echo $ECHO_N "checking caml/camlidlruntime.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pcap.h presence" >&5 +echo $ECHO_N "checking pcap.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3437,6 +4108,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3451,229 +4123,164 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pcap.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: pcap.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pcap.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pcap.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pcap.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pcap.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pcap.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6 -if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for pcap.h" >&5 +echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pcap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_caml_camlidlruntime_h=$ac_header_preproc + ac_cv_header_pcap_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 -echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 +echo "${ECHO_T}$ac_cv_header_pcap_h" >&6; } fi -if test $ac_cv_header_caml_camlidlruntime_h = yes; then - HAVE_CAMLIDLRUNTIME_H="yes" -fi - - - -fi; - -if test -z "$HAVE_CAMLIDLRUNTIME_H"; then - { { echo "$as_me:$LINENO: error: can't find camlidlruntime.h" >&5 -echo "$as_me: error: can't find camlidlruntime.h" >&2;} +if test $ac_cv_header_pcap_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: can't find pcap.h" >&5 +echo "$as_me: error: can't find pcap.h" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking for ffcall callback header..." >&5 -echo "$as_me: checking for ffcall callback header..." >&6;} -# Check whether --with-ffcall or --without-ffcall was given. -if test "${with_ffcall+set}" = set; then - withval="$with_ffcall" - ffcalldir=$withval - as_ac_Header=`echo "ac_cv_header_$ffcalldir/callback.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ffcalldir/callback.h" >&5 -echo $ECHO_N "checking for $ffcalldir/callback.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then + +{ echo "$as_me:$LINENO: checking for alloc_trampoline_r in -lcallback" >&5 +echo $ECHO_N "checking for alloc_trampoline_r in -lcallback... $ECHO_C" >&6; } +if test "${ac_cv_lib_callback_alloc_trampoline_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ffcalldir/callback.h usability" >&5 -echo $ECHO_N "checking $ffcalldir/callback.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcallback $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ffcalldir/callback.h> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char alloc_trampoline_r (); +int +main () +{ +return alloc_trampoline_r (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_callback_alloc_trampoline_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_cv_lib_callback_alloc_trampoline_r=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $ffcalldir/callback.h presence" >&5 -echo $ECHO_N "checking $ffcalldir/callback.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ffcalldir/callback.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_callback_alloc_trampoline_r" >&5 +echo "${ECHO_T}$ac_cv_lib_callback_alloc_trampoline_r" >&6; } +if test $ac_cv_lib_callback_alloc_trampoline_r = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCALLBACK 1 +_ACEOF - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 + LIBS="-lcallback $LIBS" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ffcalldir/callback.h" >&5 -echo $ECHO_N "checking for $ffcalldir/callback.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$ffcalldir"; HAVE_CALLBACK_H="yes" + { { echo "$as_me:$LINENO: error: can't find callback library." >&5 +echo "$as_me: error: can't find callback library." >&2;} + { (exit 1); exit 1; }; } fi -else - - if test "${ac_cv_header_callback_h+set}" = set; then - echo "$as_me:$LINENO: checking for callback.h" >&5 -echo $ECHO_N "checking for callback.h... $ECHO_C" >&6 +if test "${ac_cv_header_callback_h+set}" = set; then + { echo "$as_me:$LINENO: checking for callback.h" >&5 +echo $ECHO_N "checking for callback.h... $ECHO_C" >&6; } if test "${ac_cv_header_callback_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 -echo "${ECHO_T}$ac_cv_header_callback_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 +echo "${ECHO_T}$ac_cv_header_callback_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking callback.h usability" >&5 -echo $ECHO_N "checking callback.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking callback.h usability" >&5 +echo $ECHO_N "checking callback.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3683,14 +4290,36 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3699,17 +4328,17 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking callback.h presence" >&5 -echo $ECHO_N "checking callback.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking callback.h presence" >&5 +echo $ECHO_N "checking callback.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3717,8 +4346,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3727,6 +4361,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3741,82 +4376,53 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: callback.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: callback.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: callback.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: callback.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: callback.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: callback.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: callback.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: callback.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: callback.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: callback.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: callback.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: callback.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for callback.h" >&5 -echo $ECHO_N "checking for callback.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for callback.h" >&5 +echo $ECHO_N "checking for callback.h... $ECHO_C" >&6; } if test "${ac_cv_header_callback_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_callback_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 -echo "${ECHO_T}$ac_cv_header_callback_h" >&6 - -fi -if test $ac_cv_header_callback_h = yes; then - HAVE_CALLBACK_H="yes" -fi - - - -fi; - -if test -z "$HAVE_CALLBACK_H"; then - { { echo "$as_me:$LINENO: error: can't find callback.h" >&5 -echo "$as_me: error: can't find callback.h" >&2;} - { (exit 1); exit 1; }; } -fi - - - +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 +echo "${ECHO_T}$ac_cv_header_callback_h" >&6; } +fi -if test "x$enable_examples" = "xyes"; then - output="Makefile tests/Makefile" -else - output="Makefile" -fi +ac_config_files="$ac_config_files Makefile tests/Makefile" - ac_config_files="$ac_config_files $output" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -3835,39 +4441,58 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -3876,63 +4501,48 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, +# take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF +ac_script=' t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -3970,20 +4580,80 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -3994,21 +4664,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -4016,200 +4687,157 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi +# CDPATH. +$as_unset CDPATH - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.60a. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4217,30 +4845,18 @@ generated by GNU Autoconf 2.57. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -4248,31 +4864,32 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.60a, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -4283,60 +4900,42 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -4352,28 +4951,43 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 - - - +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "$output" ) CONFIG_FILES="$CONFIG_FILES $output" ;; + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -4383,277 +4997,374 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@VERSION@,$VERSION,;t t -s,@ARCH@,$ARCH,;t t -s,@ocamlc@,$ocamlc,;t t -s,@ocamlopt@,$ocamlopt,;t t -s,@ocamlfind@,$ocamlfind,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@INSTALL@,$INSTALL,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@camlidldir@,$camlidldir,;t t -s,@camlidllibdir@,$camlidllibdir,;t t -s,@ffcalldir@,$ffcalldir,;t t -s,@ffcallarchive@,$ffcallarchive,;t t -s,@libpcapdir@,$libpcapdir,;t t -s,@cp4flag@,$cp4flag,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +VERSION!$VERSION$ac_delim +ARCH!$ARCH$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +INSTALL!$INSTALL$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ocamlc!$ocamlc$ac_delim +ocamlopt!$ocamlopt$ac_delim +ocamlfind!$ocamlfind$ac_delim +camlidl!$camlidl$ac_delim +cp4flag!$cp4flag$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 60; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -4661,29 +5372,40 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + + esac + +done # for ac_tag + { (exit 0); exit 0; } _ACEOF -- cgit v1.2.3 From 1ef6cf43d206c8bdfcddb259ce8c4fcc59460c65 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 28 Nov 2017 07:25:27 +0100 Subject: Use ocamlfind to compile the project Gbp-Pq: Name 02_ocamlfind_for_example.diff --- tests/Makefile.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.in b/tests/Makefile.in index 9c3b4ab..316060f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,4 +1,3 @@ -OCAMLC=ocamlc CAMLP4O=camlp4o OBJECTS = misc.cmo pcap_next.cmo pcap_loop.cmo \ @@ -12,7 +11,7 @@ pcap_open_offline all: $(TARGETS) $(TARGETS): $(OBJECTS) - $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma + ocamlfind ocamlc -package pcap -linkpkg -o $@ $@.cmo clean: rm -f *.cmo *.cmi $(TARGETS) @@ -20,5 +19,5 @@ clean: .SUFFIXES: .ml .cmo .cmi .ml.cmo: - $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -I .. -c $< + ocamlfind ocamlc -package pcap -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -c $< -- cgit v1.2.3 From 8199ad04023c9dda8b8077113d05c7f495f32063 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 28 Nov 2017 07:25:27 +0100 Subject: Fix META file Gbp-Pq: Name 03_correct_META.diff --- META | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/META b/META index cf95b64..c787ef1 100644 --- a/META +++ b/META @@ -1,7 +1,6 @@ name="pcap" -version="0.8" +version="0.9" description="Ocaml bindings to libpcap" requires="" archive(byte) = "pcap.cma" -archive(opt) = "pcap.cmxa" -linkopts = "-cclib -lpcap -cclib -lcallback" +archive(native) = "pcap.cmxa" -- cgit v1.2.3 From 5d255311ce23d4978bcc23e0e0ee92af9e5534ab Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 28 Nov 2017 07:25:27 +0100 Subject: Use system's libcamlidl.a Gbp-Pq: Name 07_dll_with_camlidl.diff --- OCamlMakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OCamlMakefile b/OCamlMakefile index 0d20314..eed3443 100644 --- a/OCamlMakefile +++ b/OCamlMakefile @@ -774,7 +774,7 @@ endif ifndef MSVC $(DLLSONAME): $(OBJ_LINK) $(CC) -shared $(CINCFLAGS) $(CLIBFLAGS) \ - -o $@ $(OBJ_LINK) $(CLIBS:%=-l%) + -o $@ $(OBJ_LINK) $(shell ocamlc -where)/libcamlidl.a $(CLIBS:%=-l%) endif $(RESULT).cma: $(REAL_IMPL_INTF) $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS) -- cgit v1.2.3 From 23852be63f1e44a51e7e1a4270bfb1ba7acb023b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Tue, 28 Nov 2017 07:25:27 +0100 Subject: Fix detection of callback library Forwarded: no Last-Update: 2017-11-09 The callback library is now embedded in libffcall, and the symbol names have changed, hence fix the configure test. Last-Update: 2017-11-09 Gbp-Pq: Name 08_ffcall.diff --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 0ace885..ffcc4d1 100644 --- a/configure.in +++ b/configure.in @@ -77,9 +77,9 @@ dnl --------------- dnl Ffcall callback dnl --------------- -AC_CHECK_LIB(callback, - alloc_trampoline_r,, - AC_MSG_ERROR([can't find callback library.])) +AC_CHECK_LIB(ffcall, + callback_trampoline_alloc,, + AC_MSG_ERROR([can't find ffcall library.])) dnl Header -- cgit v1.2.3 From 191636511ebe0fbed9b398fa4db0dd1b5068123f Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 24 Jul 2020 13:19:05 +0200 Subject: shtool Gbp-Pq: Name 04_shtool.diff --- etc/shtool | 3248 ++++++++++++++++++++---------------------------------------- 1 file changed, 1098 insertions(+), 2150 deletions(-) diff --git a/etc/shtool b/etc/shtool index 0b71ff7..c41f19f 100755 --- a/etc/shtool +++ b/etc/shtool @@ -1,12 +1,13 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-1999 Ralf S. Engelschall +## Copyright (c) 1994-2004 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.0 (02-Jul-1999) +## Version: 2.0.1 (11-Aug-2004) +## Contents: 3/19 available modules ## ## @@ -25,7 +26,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## -## Notice: Given that you include this file verbatim into your own +## NOTICE: Given that you include this file verbatim into your own ## source tree, you are justified in saying that it remains separate ## from your package, and that this way you are simply just using GNU ## shtool. So, in this situation, there is no requirement that your @@ -37,68 +38,127 @@ ## Usage: shtool [] [ [] []] ## ## Available commands: +## install Install a program, script or datafile +## platform Platform Identification Utility +## version Maintain a version information file +## +## Not available commands (because module was not built-in): ## echo Print string with optional construct expansion ## mdate Pretty-print modification time of a file or dir -## table Pretty print a field-sperarated list as a table +## table Pretty-print a field-separated list as a table ## prop Display progress with a running propeller -## move Move files with simultan substitution -## install Install a program, script or datafile +## move Move files with simultaneous substitution ## mkdir Make one or more directories ## mkln Make link with calculation of relative paths -## mkshadow Make a shadow tree +## mkshadow Make a shadow tree through symbolic links ## fixperm Fix file permissions inside a source tree -## guessos Simple OS/platform guesser +## rotate Logfile rotation +## tarball Roll distribution tarballs +## subst Apply sed(1) substitution operations ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor -## version Generate and maintain a version information file ## path Deal with program paths ## if [ $# -eq 0 ]; then - echo "$0:ERROR: invalid command line" 1>&2 - echo "$0:HINT: run \`$0 -h' for usage" 1>&2 + echo "$0:Error: invalid command line" 1>&2 + echo "$0:Hint: run \`$0 -h' for usage" 1>&2 exit 1 fi -if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is shtool, version 1.4.0 (02-Jul-1999)" - echo "Copyright (c) 1994-1999 Ralf S. Engelschall " +if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then + echo "This is GNU shtool, version 2.0.1 (11-Aug-2004)" + echo "Copyright (c) 1994-2004 Ralf S. Engelschall " + echo "Report bugs to " echo '' - echo "Usage: shtool [] [ [] []]" + echo "Usage: shtool [] [ [] []]" echo '' echo 'Available global :' echo ' -v, --version display shtool version information' echo ' -h, --help display shtool usage help page (this one)' + echo ' -d, --debug display shell trace information' + echo ' -r, --recreate recreate this shtool script via shtoolize' echo '' echo 'Available [] []:' - echo ' echo [-n] [-e] [ ...]' - echo ' mdate [-n] [-z] [-s] [-d] [-f] [-o] ' - echo ' table [-F] [-w] [-c] [-s] ...' - echo ' prop [-p]' - echo ' move [-v] [-t] [-e] [-p] ' - echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] ' - echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' - echo ' mkln [-t] [-f] [-s] [ ...] ' - echo ' mkshadow [-v] [-t] [-a] ' - echo ' fixperm [-v] [-t] [ ...]' - echo ' guessos ' - echo ' arx [-t] [-C] [ ...]' - echo ' slo -- -L -l [ -L -l ... ]' - echo ' scpp [-v] [-p] [-o] [-t] [-M] [-D]' - echo ' [-C] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' - echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' + echo ' install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]' + echo ' [-C|--compare-copy] [-s|--strip] [-m|--mode ]' + echo ' [-o|--owner ] [-g|--group ] [-e|--exec' + echo ' ] [ ...] ' + echo ' platform [-F|--format ] [-S|--sep ] [-C|--conc' + echo ' ] [-L|--lower] [-U|--upper] [-v|--verbose]' + echo ' [-c|--concise] [-n|--no-newline] [-t|--type ]' + echo ' [-V|--version] [-h|--help]' + echo ' version [-l|--language ] [-n|--name ] [-p|--prefix' + echo ' ] [-s|--set ] [-e|--edit] [-i|--increase' + echo ' ] [-d|--display ] ' + echo '' + echo 'Not available (because module was not built-in):' + echo ' echo [-n|--newline] [-e|--expand] [ ...]' + echo ' mdate [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]' + echo ' [-f|--field-sep ] [-o|--order ] ' + echo ' table [-F|--field-sep ] [-w|--width ] [-c|--columns' + echo ' ] [-s|--strip ] ...' + echo ' prop [-p|--prefix ]' + echo ' move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]' + echo ' ' + echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] ' + echo ' [ ...]' + echo ' mkln [-t|--trace] [-f|--force] [-s|--symbolic] ' + echo ' [ ...] ' + echo ' mkshadow [-v|--verbose] [-t|--trace] [-a|--all] ' + echo ' fixperm [-v|--verbose] [-t|--trace] [ ...]' + echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files' + echo ' ] [-s|--size ] [-c|--copy] [-r|--remove]' + echo ' [-a|--archive-dir ] [-z|--compress [:]]' + echo ' [-b|--background] [-d|--delay] [-p|--pad ] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] [-M|--migrate' + echo ' ] [-P|--prolog ] [-E|--epilog ] [...]' + echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output ]' + echo ' [-c|--compress ] [-d|--directory ] [-u|--user' + echo ' ] [-g|--group ] [-e|--exclude ]' + echo ' [ ...]' + echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]' + echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup' + echo ' ] [-e|--exec ] [-f|--file ] []' + echo ' [...]' + echo ' arx [-t|--trace] [-C|--command ] [' + echo ' ...]' + echo ' slo [-p|--prefix ] -- -L -l [-L -l' + echo ' ...]' + echo ' scpp [-v|--verbose] [-p|--preserve] [-f|--filter ]' + echo ' [-o|--output ] [-t|--template ] [-M|--mark' + echo ' ] [-D|--define ] [-C|--class ]' + echo ' [ ...]' + echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]' + echo ' [-m|--magic] [-p|--path ] [ ...]' echo '' exit 0 fi -if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "shtool 1.4.0 (02-Jul-1999)" +if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then + echo "GNU shtool 2.0.1 (11-Aug-2004)" exit 0 fi -tool="$1" -shift +if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then + shtoolize -oetc/shtool install platform version + exit 0 +fi +if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then + shift + set -x +fi +name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` +case "$name" in + install|platform|version ) + # implicit tool command selection + tool="$name" + ;; + * ) + # explicit tool command selection + tool="$1" + shift + ;; +esac arg_spec="" opt_spec="" gen_tmpfile=no @@ -108,128 +168,63 @@ gen_tmpfile=no ## case $tool in - echo ) - str_tool="echo" - str_usage="[-n] [-e] [ ...]" - arg_spec="0+" - opt_spec="ne" - ;; - mdate ) - str_tool="mdate" - str_usage="[-n] [-z] [-s] [-d] [-f] [-o] " - arg_spec="1" - opt_spec="nzsdf:!o:!" - opt_f=" " - opt_o="dmy" - ;; - table ) - str_tool="table" - str_usage="[-F] [-w] [-c] [-s] ..." - arg_spec="1+" - opt_spec="F:!w:!c:!s:!" - opt_F=":" - opt_w=15 - opt_c=3 - opt_s=79 - ;; - prop ) - str_tool="prop" - str_usage="[-p]" - arg_spec="0" - opt_spec="p:" - ;; - move ) - str_tool="move" - str_usage="[-v] [-t] [-e] [-p] " - arg_spec="2" - opt_spec="vtep" - ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] " - arg_spec="2" - opt_spec="vtcCsm:o:g:e:" - ;; - mkdir ) - str_tool="mkdir" - str_usage="[-t] [-f] [-p] [-m] [ ...]" - arg_spec="1+" - opt_spec="tfpm:" - ;; - mkln ) - str_tool="mkln" - str_usage="[-t] [-f] [-s] [ ...] " - arg_spec="2+" - opt_spec="tfs" - ;; - mkshadow ) - str_tool="mkshadow" - str_usage="[-v] [-t] [-a] " - arg_spec="2" - opt_spec="vta" - ;; - fixperm ) - str_tool="fixperm" - str_usage="[-v] [-t] [ ...]" - gen_tmpfile=yes + str_usage="[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode ] [-o|--owner ] [-g|--group ] [-e|--exec ] [ ...] " arg_spec="1+" - opt_spec="vt" + opt_spec="v.t.d.c.C.s.m:o:g:e+" + opt_alias="v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec" + opt_v=no + opt_t=no + opt_d=no + opt_c=no + opt_C=no + opt_s=no + opt_m="0755" + opt_o="" + opt_g="" + opt_e="" ;; - guessos ) - str_tool="guessos" - str_usage="" - arg_spec="0" - opt_spec="" - ;; - arx ) - str_tool="arx" - str_usage="[-t] [-C] [ ...]" - arg_spec="2+" - opt_spec="tC:!" - opt_C="ar" - ;; - slo ) - str_tool="slo" - str_usage="-- -L -l [ -L -l ... ]" - arg_spec="1+" - opt_spec="" - ;; - scpp ) - str_tool="scpp" - str_usage="[-v] [-p] [-o] [-t] [-M] [-D] [-C] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="vpo:!t:!M:!D:!C:!" - opt_o="lib.h" - opt_t="lib.h.in" - opt_M="%%MARK%%" - opt_D="cpp" - opt_C="intern" + platform ) + str_tool="platform" + str_usage="[-F|--format ] [-S|--sep ] [-C|--conc ] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type ] [-V|--version] [-h|--help]" + arg_spec="0=" + opt_spec="F:S:C:L.U.v.c.n.t:d.V.h." + opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help" + opt_F="%{sp} (%{ap})" + opt_S=" " + opt_C="/" + opt_L=no + opt_U=no + opt_t="" + opt_v=no + opt_c=no + opt_n=no + opt_V=no + opt_h=no ;; version ) str_tool="version" - str_usage="[-l] [-n] [-p] [-s] [-i] [-d] " - arg_spec="1+" - opt_spec="l:!n:!p:!s:!i:!d:!" + str_usage="[-l|--language ] [-n|--name ] [-p|--prefix ] [-s|--set ] [-e|--edit] [-i|--increase ] [-d|--display ] " + arg_spec="1=" + opt_spec="l:n:p:s:i:e.d:" + opt_alias="l:language,n:name,p:prefix,s:set,e:edit,i:increase,d:display" opt_l="txt" opt_n="unknown" - opt_p="unknown" - opt_s="unknown" - opt_i="P" - opt_d="NO" - gen_tmpfile=yes + opt_p="" + opt_s="" + opt_e="no" + opt_i="" + opt_d="short" ;; - path ) - str_tool="path" - str_usage="[-s] [-r] [-d] [-b] [-m] [-p] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="srdbmp:!" - opt_p="$PATH" + -* ) + echo "$0:Error: unknown option \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 ;; * ) - echo "$0:ERROR: unknown command \`$tool'" 2>&1 - echo "$0:HINT: run \`$0 -h' for usage" 2>&1 + echo "$0:Error: unknown command \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 exit 1 ;; esac @@ -238,36 +233,35 @@ esac ## COMMON UTILITY CODE ## +# commonly used ASCII values +ASC_TAB=" " +ASC_NL=" +" + # determine name of tool if [ ".$tool" != . ]; then - # inside shtool + # used inside shtool script toolcmd="$0 $tool" + toolcmdhelp="shtool $tool" msgprefix="shtool:$tool" else - # standalone + # used as standalone script toolcmd="$0" + toolcmdhelp="sh $0" msgprefix="$str_tool" fi # parse argument specification string -eval `echo $arg_spec | sed -e 's/^\([0-9]*\)\(.*\)/arg_NUMS="\1"; arg_MODE="\2"/'` -test ".$arg_MODE" = . && arg_MODE="=" +eval `echo $arg_spec |\ + sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` # parse option specification string -for opt in `echo "h$opt_spec" | sed -e 's/\([a-zA-Z0-9][!:+]*\)/\1 /g'`; do - opt_MODE="."; opt_INIT="." - eval `echo $opt |\ - sed -e 's/^\([a-zA-Z0-9]\)/opt_THIS="\1";/' \ - -e 's/";\([:+]\)/"; opt_MODE="\1";/' \ - -e 's/";\(!\)/"; opt_INIT="\1"/'` - eval "opt_MODE_${opt_THIS}=${opt_MODE}" - if [ ".$opt_INIT" != ".!" ]; then - case "$opt_MODE" in - "." ) eval "opt_${opt_THIS}=no" ;; - ":"|"+" ) eval "opt_${opt_THIS}=\"\"" ;; - esac - fi -done +eval `echo h.$opt_spec |\ + sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` + +# parse option alias string +eval `echo h:help,$opt_alias |\ + sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'` # interate over argument line opt_PREV='' @@ -285,18 +279,29 @@ while [ $# -gt 0 ]; do opt_OPT="$opt_PREV" opt_ARG="$1" opt_ARG_OK=yes - opt_PREV="" + opt_PREV='' else # split argument into option and argument case "$1" in + --[a-zA-Z0-9]*=*) + eval `echo "x$1" |\ + sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + ;; + --[a-zA-Z0-9]*) + opt_OPT=`echo "x$1" | cut -c4-` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + opt_ARG='' + ;; -[a-zA-Z0-9]*) eval `echo "x$1" |\ sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ -e 's/";\(.*\)$/"; opt_ARG="\1"/'` ;; -[a-zA-Z0-9]) - opt_OPT=`awk 'BEGIN { printf("%s", substr(OPT, 2)); }' \ - "OPT=$1" &2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 exit 1 ;; esac done if [ ".$opt_PREV" != . ]; then - echo "$msgprefix:ERROR: missing argument to option \`-$opt_PREV'" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 exit 1 fi # process help option -if [ .$opt_h = .yes ]; then - echo "Usage: $toolcmd $str_usage" +if [ ".$opt_h" = .yes ]; then + echo "Usage: $toolcmdhelp $str_usage" exit 0 fi # complain about incorrect number of arguments case $arg_MODE in - "=" ) + '=' ) if [ $# -ne $arg_NUMS ]; then - echo "$msgprefix:ERROR: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; - "+" ) + '+' ) if [ $# -lt $arg_NUMS ]; then - echo "$msgprefix:ERROR: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; @@ -370,1827 +375,849 @@ esac # establish a temporary file on request if [ ".$gen_tmpfile" = .yes ]; then - tmpdir="/tmp" if [ ".$TMPDIR" != . ]; then tmpdir="$TMPDIR" + elif [ ".$TEMPDIR" != . ]; then + tmpdir="$TEMPDIR" else - if [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - fi + tmpdir="/tmp" + fi + if mkdir "$tmpdir/.shtool.$$"; then + tmpfile="$tmpdir/.shtool.$$/shtool.tmp" + else + echo "$msgprefix:Error: failed to create temporary file" 1>&2 + exit 1 fi - tmpfile="$tmpdir/.shtool.$$" + tmpfile="$tmpdir/.shtool.$$/shtool.tmp" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi +# utility function: map string to lower case +util_lower () { + echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' +} + +# utility function: map string to upper case +util_upper () { + echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +} + +# cleanup procedure +shtool_exit () { + rc="$1" + if [ ".$gen_tmpfile" = .yes ]; then + rm -fr "$tmpdir/.shtool.$$" >/dev/null 2>&1 || true + fi + exit $rc +} + ## ## DISPATCH INTO SCRIPT BODY ## case $tool in -echo ) +install ) ## - ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for WML as buildinfo + ## install -- Install a program, script or datafile + ## Copyright (c) 1997-2004 Ralf S. Engelschall ## - - text="$*" - - # check for broken escape sequence expansion - seo='' - bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" != .3 ]; then - bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - seo='-E' - fi - fi - - # check for existing -n option (to suppress newline) - minusn='' - bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - minusn='-n' - fi - - # determine terminal bold sequence - term_bold='' - term_norm='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then - # the most important terminals we directly know - case $TERM in - xterm|xterm*|vt220|vt220*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` - ;; - vt100|vt100*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` - ;; - esac - # then try a possibly existing "tput" or "tcout" utility - paths=`echo $PATH | sed -e 's/:/ /g'` - for tool in tput tcout; do - for dir in $paths; do - if [ -r "$dir/$tool" ]; then - for seq in bold md smso; do # smso is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" - break - fi - done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done - fi - break - fi - done - if [ ".$term_bold" != . -a ".$term_norm" != . ]; then - break; - fi - done - if [ ".$term_bold" = . -o ".$term_norm" = . ]; then - echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 - fi - fi - - # determine user name - username='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then - username="$LOGNAME" - if [ ".$username" = . ]; then - username="$USER" - if [ ".$username" = . ]; then - username="`(whoami) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username="`(who am i) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username='unknown' - fi - fi - fi - fi - fi - - # determine user id - userid='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then - userid="`(id -u) 2>/dev/null`" - if [ ".$userid" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then - userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*//'` - fi - if [ ".$userid" = . ]; then - userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid=`(ypcat passwd) 2>/dev/null | - egrep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid='?' - fi - fi - fi - fi - fi - - # determine host name - hostname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then - hostname="`(uname -n) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname="`(hostname) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname='unknown' - fi + + # special case: "shtool install -d [...]" internally + # maps to "shtool mkdir -f -p -m 755 [...]" + if [ "$opt_d" = yes ]; then + cmd="$0 mkdir -f -p -m 755" + if [ ".$opt_o" != . ]; then + cmd="$cmd -o '$opt_o'" fi - case $hostname in - *.* ) - domainname=".`echo $hostname | cut -d. -f2-`" - hostname="`echo $hostname | cut -d. -f1`" - ;; - esac - fi - - # determine domain name - domainname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then - if [ ".$domainname" = . ]; then - if [ -f /etc/resolv.conf ]; then - domainname="`egrep '^[ ]*domain' /etc/resolv.conf | head -1 |\ - sed -e 's/.*domain//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - if [ ".$domainname" = . ]; then - domainname="`egrep '^[ ]*search' /etc/resolv.conf | head -1 |\ - sed -e 's/.*search//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/ .*//' -e 's/ .*//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - fi - fi + if [ ".$opt_g" != . ]; then + cmd="$cmd -g '$opt_g'" fi - fi - - # determine current time - time_day='' - time_month='' - time_year='' - time_monthname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then - time_day=`date '+%d'` - time_month=`date '+%m'` - time_year=`date '+%Y' 2>/dev/null` - if [ ".$time_year" = . ]; then - time_year=`date '+%y'` - case $time_year in - [5-9][0-9]) time_year="19$time_year" ;; - [0-4][0-9]) time_year="20$time_year" ;; - esac + if [ ".$opt_v" = .yes ]; then + cmd="$cmd -v" fi - case $time_month in - 1|01) time_monthname='Jan' ;; - 2|02) time_monthname='Feb' ;; - 3|03) time_monthname='Mar' ;; - 4|04) time_monthname='Apr' ;; - 5|05) time_monthname='May' ;; - 6|06) time_monthname='Jun' ;; - 7|07) time_monthname='Jul' ;; - 8|08) time_monthname='Aug' ;; - 9|09) time_monthname='Sep' ;; - 10) time_monthname='Oct' ;; - 11) time_monthname='Nov' ;; - 12) time_monthname='Dec' ;; - esac - fi - - # expand special ``%x'' constructs - if [ ".$opt_e" = .yes ]; then - text=`echo $seo "$text" |\ - sed -e "s/%B/${term_bold}/g" \ - -e "s/%b/${term_norm}/g" \ - -e "s/%u/${username}/g" \ - -e "s/%U/${userid}/g" \ - -e "s/%h/${hostname}/g" \ - -e "s/%d/${domainname}/g" \ - -e "s/%D/${time_day}/g" \ - -e "s/%M/${time_month}/g" \ - -e "s/%Y/${time_year}/g" \ - -e "s/%m/${time_monthname}/g" 2>/dev/null` - fi - - # create output - if [ .$opt_n = .no ]; then - echo $seo $text - else - # the harder part: echo -n is best, because - # awk complains about some \xx sequences. - if [ ".$minusn" != . ]; then - echo $seo $minusn $text - else - echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" + if [ ".$opt_t" = .yes ]; then + cmd="$cmd -t" fi + for dir in "$@"; do + eval "$cmd $dir" || shtool_exit $? + done + shtool_exit 0 fi - ;; -mdate ) - ## - ## mdate -- Pretty-print modification time of a file or dir - ## Copyright (c) 1995-1997 Free Software Foundation, Inc. - ## Originally idea and basis code by Ulrich Drepper - ## Enhanced by Ralf S. Engelschall for shtool - ## - - fod="$1" - case "$opt_o" in - [dmy][dmy][dmy] ) - ;; - * ) echo "$msgprefix:Error: invalid argument to option \`-o': $opt_o" 1>&2 - exit 1 - ;; - esac - if [ ! -r "$fod" ]; then - echo "$msgprefix:Error: file or directory not found: $fod" 1>&2 - exit 1 - fi - - # prevent "date" giving response in another language - LANG=C; export LANG - LC_ALL=C; export LC_ALL - LC_TIME=C; export LC_TIME - - # get the extended ls output of the file or directory. - if ls -L /dev/null >/dev/null 2>&1; then - set - x`ls -L -l -d $fod` - else - set - x`ls -l -d $fod` - fi - - # The month is at least the fourth argument - # (3 shifts here, the next inside the loop). - shift; shift; shift - - # Find the month. Next argument is day, followed by the year or time. - month="" - while [ ".$month" = . ]; do + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" shift - case $1 in - Jan) month=January; nummonth=1 ;; - Feb) month=February; nummonth=2 ;; - Mar) month=March; nummonth=3 ;; - Apr) month=April; nummonth=4 ;; - May) month=May; nummonth=5 ;; - Jun) month=June; nummonth=6 ;; - Jul) month=July; nummonth=7 ;; - Aug) month=August; nummonth=8 ;; - Sep) month=September; nummonth=9 ;; - Oct) month=October; nummonth=10 ;; - Nov) month=November; nummonth=11 ;; - Dec) month=December; nummonth=12 ;; - esac done - day="$2" - year="$3" - - # We finally have to deal with the problem that the "ls" output - # gives either the time of the day or the year. - case $year in - *:*) - this_year=`date '+%Y' 2>/dev/null` - if [ ".$this_year" = . ]; then - this_year=`date '+%y'` - case $this_year in - [5-9][0-9]) this_year="19$this_year" ;; - [0-4][0-9]) this_year="20$this_year" ;; - esac - fi - # for the following months of the last year the time notation - # is usually also used for files modified in the last year. - this_month=`date '+%m'` - if (expr $nummonth \> $this_month) >/dev/null; then - this_year=`expr $this_year - 1` - fi - year="$this_year" - ;; - esac - - # Optionally fill day and month with leeding zeros - if [ ".$opt_z" = .yes ]; then - case $day in - [0-9][0-9] ) ;; - [0-9] ) day="0$day" ;; - esac - case $nummonth in - [0-9][0-9] ) ;; - [0-9] ) nummonth="0$nummonth" ;; - esac - fi - - # Optionally use digits for month - if [ ".$opt_d" = .yes ]; then - month="$nummonth" - fi - - # Optionally shorten the month name to three characters - if [ ".$opt_s" = .yes ]; then - month=`echo $month | cut -c1-3` - fi - - # Output the resulting date string - echo dummy | awk '{ - for (i = 0; i < 3; i++) { - now = substr(order, 1, 1); - order = substr(order, 2); - if (now == "d") - out = day; - else if (now == "m") - out = month; - else if (now == "y") - out = year; - if (i < 2) - printf("%s%s", out, field); - else - printf("%s", out); - } - if (newline != "yes") - printf("\n"); - }' "day=$day" "month=$month" "year=$year" \ - "field=$opt_f" "order=$opt_o" "newline=$opt_n" - ;; + dstpath="$1" -table ) - ## - ## table -- Pretty print a field-sperarated list as a table - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - if [ $opt_c -gt 4 ]; then - echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2 - exit 1 + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 fi - case "x$opt_F" in - x? ) ;; - * ) echo "$msgprefix:Error: Invalid seperator (one char allowed only)" 1>&2; exit 1 ;; - esac - - # split the list into a table - list=` - IFS="$opt_F" - for entry in $*; do - if [ ".$entry" != . ]; then - echo "$entry" - fi - done |\ - awk " - BEGIN { list = \"\"; n = 0; } - { - list = list \\$1; - n = n + 1; - if (n < $opt_c) { - list = list \":\"; - } - if (n == $opt_c) { - list = list \"\\n\"; - n = 0; - } - } - END { print list; } - " - ` - - # format table cells and make sure table - # doesn't exceed maximum width - OIFS="$IFS" - IFS=' -' - for entry in $list; do - case $opt_c in - 1 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s\\n\", \$1); }'" ;; - 2 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s\\n\", \$1, \$2); }'" ;; - 3 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3); }'" ;; - 4 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3, \$4); }'" ;; - esac - done |\ - awk "{ - if (length(\$0) > $opt_s) { - printf(\"%s\\n\", substr(\$0, 0, $opt_s-1)); - } else { - print \$0; - } - }" - IFS="$OIFS" - ;; -prop ) - ## - ## prop -- Display progress with a running propeller - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for mod_ssl - ## - - perl='' - for dir in `echo $PATH | sed -e 's/:/ /g'` .; do - if [ -f "$dir/perl" ]; then - perl="$dir/perl" - break - fi - done - if [ ".$perl" != . ]; then - # Perl is preferred because writing to STDERR in - # Perl really writes immediately as one would expect - $perl -e ' - @p = ("|","/","-","\\"); - $i = 0; - while () { - printf(STDERR "\r%s...%s\b", $ARGV[0], $p[$i++]); - $i = 0 if ($i > 3); - } - printf(STDERR "\r%s \n", $ARGV[0]); - ' "$opt_p" - else - # But when Perl doesn't exists we use Awk even - # some Awk's buffer even the /dev/stderr writing :-( - awk ' - BEGIN { - split("|#/#-#\\", p, "#"); - i = 1; - } - { - printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr"; - if (i > 4) { i = 1; } - } - END { - printf("\r%s \n", prefix) > "/dev/stderr"; - } - ' "prefix=$opt_p" + # consistency check for destination + if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 + shtool_exit 1 fi - ;; -move ) - ## - ## move -- Move files with simultan substitution - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # consistency checks - if [ ".$src" = . -o ".$dst" = . ]; then - echo "$msgprefix:Error: Invalid arguments" 1>&2 - exit 1 - fi - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: Source and destination files are the same" 1>&2 - exit 1 - fi - expsrc="$src" - if [ ".$opt_e" = .yes ]; then - expsrc="`echo $expsrc`" - fi - if [ ".$opt_e" = .yes ]; then - if [ ".`echo "$src" | sed -e 's;^.*\\*.*$;;'`" = ".$src" ]; then - echo "$msgprefix:Error: Source doesn't contain wildcard ('*'): $dst" 1>&2 - exit 1 - fi - if [ ".`echo "$dst" | sed -e 's;^.*%[1-9].*$;;'`" = ".$dst" ]; then - echo "$msgprefix:Error: Destination doesn't contain substitution ('%N'): $dst" 1>&2 - exit 1 - fi - if [ ".$expsrc" = ".$src" ]; then - echo "$msgprefix:Error: Sources not found or no asterisk : $src" 1>&2 - exit 1 + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath + + # if destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" fi - else - if [ ! -r "$src" ]; then - echo "$msgprefix:Error: Source not found: $src" 1>&2 - exit 1 + + # check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue fi - fi - - # determine substitution patterns - if [ ".$opt_e" = .yes ]; then - srcpat=`echo "$src" | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 's;\\*;\\\\(.*\\\\);g'` - dstpat=`echo "$dst" | sed -e 's;%\([1-9]\);\\\\\1;g'` - fi - - # iterate over source(s) - for onesrc in $expsrc; do - if [ .$opt_e = .yes ]; then - onedst=`echo $onesrc | sed -e "s;$srcpat;$dstpat;"` - else - onedst="$dst" + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue fi - errorstatus=0 + + # make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # verbosity if [ ".$opt_v" = .yes ]; then - echo "$onesrc -> $onedst" + echo "$src -> $dst" 1>&2 fi - if [ ".$opt_p" = .yes ]; then - if [ -r $onedst ]; then - if cmp -s $onesrc $onedst; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $onesrc" 1>&2 - fi - rm -f $onesrc || errorstatus=$? - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? - fi - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? + + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes + fi + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 fi + cp $src $dsttmp || shtool_exit $? else if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 + echo "mv $src $dsttmp" 1>&2 fi - mv -f $onesrc $onedst || errorstatus=$? - fi - if [ $errorstatus -ne 0 ]; then - break; + mv $src $dsttmp || shtool_exit $? fi - done - exit $errorstatus - ;; -install ) - ## - ## install -- Install a program, script or datafile - ## Copyright (c) 1997-1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi - - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 - exit 1 - fi - - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#INST@$$#" - - # Verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi - - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 - fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 - fi - mv $src $dsttmp || exit $? - fi - - # Adjust the target file - # (we do chmod last to preserve setuid bits) - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 - fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 - fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS" + for e + do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + chmod u+w $dsttmp + eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $? + rm -f $dsttmp.old fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 + fi + strip $dsttmp || shtool_exit $? fi - chmod $opt_m $dsttmp || exit $? - fi - - # Determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 fi + chown $opt_o $dsttmp || shtool_exit $? fi - fi - - # Finally install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || shtool_exit $? fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + if [ ".$opt_m" != ".-" ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 + fi + chmod $opt_m $dsttmp || shtool_exit $? fi - rm -f $dst && mv $dsttmp $dst - fi - ;; -mkdir ) - ## - ## mkdir -- Make one or more directories - ## Copyright (c) 1996-1999 Ralf S. Engelschall - ## Originally written for public domain by Noah Friedman - ## Cleaned up and enhanced for shtool - ## - - errstatus=0 - for p in ${1+"$@"}; do - # when the directory already exists... - if [ -d "$p" ]; then - if [ ".$opt_f" = .no ]; then - echo "$msgprefix:Error: file exists: $p" 1>&2 - errstatus=1 - break - else - continue + # determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s $src $dst; then + quick=yes + fi fi fi - # when the directory has to be created - if [ ".$opt_p" = .no ]; then + + # finally, install the file to the real destination + if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then - echo "mkdir $p" 1>&2 + echo "rm -f $dsttmp" 1>&2 fi - mkdir $p || errstatus=$? + rm -f $dsttmp else - # the smart situation - set fnord `echo ":$p" |\ - sed -e 's/^:\//%/' \ - -e 's/^://' \ - -e 's/\// /g' \ - -e 's/^%/\//'` - shift - pathcomp= - for d in ${1+"$@"}; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp="./$pathcomp" ;; - esac - if [ ! -d "$pathcomp" ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $pathcomp" 1>&2 - fi - mkdir $pathcomp || errstatus=$? - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $pathcomp" 1>&2 - fi - chmod $opt_m $pathcomp || errstatus=$? - fi - fi - pathcomp="$pathcomp/" - done + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst fi done - exit $errstatus + + shtool_exit 0 ;; -mkln ) +platform ) ## - ## mkln -- Make link with calculation of relative paths - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool + ## platform -- Platform Identification Utility + ## Copyright (c) 2003-2004 Ralf S. Engelschall ## - - args=$? - srcs="" - while [ $# -gt 1 ]; do - srcs="$srcs $1" - shift - done - dst="$1" - if [ ! -d $dst ]; then - if [ $args -gt 2 ]; then - echo "$msgprefix:Error: multiple sources not allowed when target isn't a directory" 1>&2 - exit 1 - fi - fi - - # determine link options - lnopt="" - if [ ".$opt_f" = .yes ]; then - lnopt="$lnopt -f" - fi - if [ ".$opt_s" = .yes ]; then - lnopt="$lnopt -s" - fi - - # iterate over sources - for src in $srcs; do - # determine if one of the paths is an absolute path, - # because then we _have_ to use an absolute symlink - oneisabs=0 - srcisabs=0 - dstisabs=0 - case $src in - /* ) oneisabs=1; srcisabs=1 ;; - esac - case $dst in - /* ) oneisabs=1; dstisabs=1 ;; - esac - - # split source and destination into dir and base name - if [ -d $src ]; then - srcdir=`echo $src | sed -e 's;/*$;;'` - srcbase="" - else - srcdir=`echo $src | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` - srcbase=`echo $src | sed -e 's;.*/\([^/]*\)$;\1;'` - fi - if [ -d $dst ]; then - dstdir=`echo $dst | sed -e 's;/*$;;'` - dstbase="" - else - dstdir=`echo $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` - dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'` - fi - - # consistency check - if [ ".$dstdir" != . ]; then - if [ ! -d $dstdir ]; then - echo "$msgprefix:Error: destination directory not found: $dstdir" 1>&2 + + # option post-processing + if [ ".$opt_t" != . ]; then + case "$opt_t" in + binary ) + # binary package id (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + build ) + # build time checking (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + gnu ) + # GNU config.guess style -- + opt_F="%-unknown-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + web ) + # non-whitespace HTTP Server-header id + opt_F="%-%" + opt_S="/" + opt_C="+" + ;; + summary) + # human readable verbose summary information + opt_F="Class: %[sc] (%[ac])\\nProduct: %[sp] (%[ap])\\nTechnology: %[st] (%[at])" + opt_S=" " + opt_C="/" + ;; + all-in-one ) + # full-table all-in-one information + opt_F="" + opt_F="${opt_F}concise architecture class: %\\n" + opt_F="${opt_F}regular architecture class: %{ac}\\n" + opt_F="${opt_F}verbose architecture class: %[ac]\\n" + opt_F="${opt_F}concise architecture product: %\\n" + opt_F="${opt_F}regular architecture product: %{ap}\\n" + opt_F="${opt_F}verbose architecture product: %[ap]\\n" + opt_F="${opt_F}concise architecture technology: %\\n" + opt_F="${opt_F}regular architecture technology: %{at}\\n" + opt_F="${opt_F}verbose architecture technology: %[at]\\n" + opt_F="${opt_F}concise system class: %\\n" + opt_F="${opt_F}regular system class: %{sc}\\n" + opt_F="${opt_F}verbose system class: %[sc]\\n" + opt_F="${opt_F}concise system product: %\\n" + opt_F="${opt_F}regular system product: %{sp}\\n" + opt_F="${opt_F}verbose system product: %[sp]\\n" + opt_F="${opt_F}concise system technology: %\\n" + opt_F="${opt_F}regular system technology: %{st}\\n" + opt_F="${opt_F}verbose system technology: %[st]" + ;; + * ) + echo "$msgprefix:Error: invalid type \`$opt_t'" 1>&2 exit 1 - fi - fi - - # make sure the source is reachable from the destination - if [ $dstisabs = 1 ]; then - if [ $srcisabs = 0 ]; then - if [ -d $srcdir ]; then - srcdir="`cd $srcdir; pwd | sed -e 's;/*$;;'`" - srcisabs=1 - oneisabs=1 - fi - fi - fi - - # split away a common prefix - prefix="" - if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then - prefix="$srcdir/" - srcdir="" - dstdir="" - else - while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do - presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'` - predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'` - if [ ".$presrc" != ".$predst" ]; then - break - fi - prefix="$prefix$presrc/" - srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'` - dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'` - done - fi - - # destination prefix is just the common prefix - dstpre="$prefix" - - # determine source prefix which is the reverse directory - # step-up corresponding to the destination directory - srcpre="" - if [ $oneisabs = 0 ] || [ ".$prefix" != . -a ".$prefix" != ./ ]; then - pl="$dstdir/" - OIFS="$IFS"; IFS='/' - for pe in $pl; do - [ ".$pe" = . ] && continue - srcpre="../$srcpre" - done - IFS="$OIFS" - else - if [ $srcisabs = 1 ]; then - srcpre="$prefix" - fi - fi - - # determine destination symlink name - if [ ".$dstbase" = . ]; then - if [ ".$srcbase" != . ]; then - dstbase="$srcbase" - else - dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'` - fi - fi - - # now finalize source and destination directory paths - srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'` - dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'` - - # run the final link command - if [ ".$opt_t" = .yes ]; then - echo "ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase" - fi - eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase - done - ;; - -mkshadow ) - ## - ## mkshadow -- Make a shadow tree - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - # source and destination directory - src=`echo "$1" | sed -e 's:/$::'` - dst=`echo "$2" | sed -e 's:/$::'` - - # check whether source exists - if [ ! -d $src ]; then - echo "$msgprefix:Error: source directory not found: \`$src'" 1>&2 - exit 1 - fi - - # determine if one of the paths is an absolute path, - # because then we have to use an absolute symlink - oneisabs=0 - case $src in - /* ) oneisabs=1 ;; - esac - case $dst in - /* ) oneisabs=1 ;; - esac - - # determine reverse directory for destination directory - dstrevdir='' - if [ $oneisabs = 0 ]; then - # (inlined fp2rp) - OIFS="$IFS"; IFS='/' - for pe in $dst; do - dstrevdir="../$dstrevdir" - done - IFS="$OIFS" - else - src="`cd $src; pwd`"; - fi - - # create directory tree at destination - if [ ! -d $dst ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $dst" 1>&2 - fi - mkdir $dst - fi - if [ ".$opt_a" = .yes ]; then - DIRS=`cd $src; find . -type d -print |\ - sed -e '/^\.$/d' -e 's:^\./::'` - else - DIRS=`cd $src; find . -type d -print |\ - sed -e '/\/CVS/d' -e '/^\.$/d' -e 's:^\./::'` - fi - for dir in $DIRS; do - if [ ".$opt_t" = .yes ]; then - echo "mkdir $dst/$dir" 1>&2 - fi - mkdir $dst/$dir - done - - # fill directory tree with symlinks to files - if [ ".$opt_a" = .yes ]; then - FILES="`cd $src; find . -depth -print |\ - sed -e 's/^\.\///'`" - else - FILES="`cd $src; find . -depth -print |\ - sed -e '/\.o$/d' -e '/\.a$/d' -e '/\.so$/d' \ - -e '/\.cvsignore$/d' -e '/\/CVS/d' \ - -e '/\/\.#/d' -e '/\.orig$/d' \ - -e 's/^\.\///'`" + ;; + esac fi - for file in $FILES; do - # don't use `-type f' above for find because of symlinks - if [ -d "$src/$file" ]; then - continue - fi - basename=`echo $file | sed -e 's:^.*/::'` - dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'` - from=`echo "$src/$file" | sed -e 's/^\.\///'` - to="$dst/$dir$basename" - if [ $oneisabs = 0 ]; then - if [ ".$dir" != . ]; then - subdir=`echo $dir | sed -e 's:/$::'` - # (inlined fp2rp) - revdir='' - OIFS="$IFS"; IFS='/' - for pe in $subdir; do - revdir="../$revdir" - done - IFS="$OIFS" - # finalize from - from="$revdir$from" - fi - from="$dstrevdir$from" - fi - if [ ".$opt_v" = .yes ]; then - echo " $to" 1>&2 - fi - if [ ".$opt_t" = .yes ]; then - echo "ln -s $from $to" 1>&2 - fi - ln -s $from $to - done - ;; -fixperm ) - ## - ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-1999 Ralf S. Engelschall - ## Originally written for ePerl - ## - - paths="$*" - - # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then - minusx="-x" - else - minusx="-r" - fi - rm -f $tmpfile - - # iterate over paths - for p in $paths; do - for file in `find $p -depth -print`; do - if [ -f $file ]; then - if [ $minusx $file ]; then - if [ ".$opt_v" = .yes ]; then - echo "-rwxrwxr-x $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 775 $file" 2>&1 - fi - chmod 775 $file - else - if [ ".$opt_v" = .yes ]; then - echo "-rw-rw-r-- $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 664 $file" 2>&1 - fi - chmod 664 $file - fi - continue - fi - if [ -d $file ]; then - if [ ".$opt_v" = .yes ]; then - echo "drwxrwxr-x $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 775 $file" 2>&1 - fi - chmod 775 $file - continue - fi - if [ ".$opt_v" = .yes ]; then - echo "?????????? $file" 2>&1 - fi - done - done - ;; + # assemble initial platform information + UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\ + UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\ + UNAME_MACHINE='unknown' + UNAME_SYSTEM=`(uname -s) 2>/dev/null` ||\ + UNAME_SYSTEM='unknown' + UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\ + UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\ + UNAME_RELEASE='unknown' -guessos ) - ## - ## guessos -- Simple OS/platform guesser - ## Copyright (c) 1996-1999 The Apache Group, http://www.apache.org/ - ## The Apache license applies (see http://www.apache.org/docs/LICENSE) - ## Originally written for Apache - ## - - MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" - RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" - SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" - VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" - - XREL=`(uname -X) 2>/dev/null | grep "^Release" | awk '{print $3}'` - if [ "x$XREL" != "x" ]; then - if [ -f /etc/kconfig ]; then - case "$XREL" in - 4.0|4.1) echo "${MACHINE}-whatever-isc4"; exit 0 ;; + UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}" + + AC=""; AP=""; AT="" + SC=""; SP=""; ST="" + + # dispatch into platform specific sections + case "${UNAME}" in + + # FreeBSD + *:FreeBSD:* ) + # determine architecture + AC="${UNAME_MACHINE}" + case "${AC}" in + i386 ) AC="iX86" ;; + esac + AP="${AC}" + AT=`(/sbin/sysctl -n hw.model) 2>&1` + case "${AT}" in + *"Xeon"* | *"Pentium Pro"* | *"Cyrix 6x86MX"* | *"Pentium II"* | *"Pentium III"* | *"Pentium 4"* | *"Celeron"* ) AT="i686" ;; + *"Pentium"* ) AT="i586" ;; *"i486[SD]X"* | *"Cyrix 486"* | *"Cyrix [56]x86"* | *"Blue Lightning" | *"Cyrix 486S/DX" ) AT="i486" ;; + *"i386[SD]X"* | *"NexGen 586"* ) AT="i386" ;; + * ) AT="${AP}" ;; + esac + # determine system + r=`echo "${UNAME_RELEASE}" |\ + sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'` + ST="FreeBSD ${r}" + SP="${ST}" + case "${r}" in + 1.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; esac - else - case "$XREL" in - 3.2v4.2) - echo "whatever-whatever-sco3"; exit 0 - ;; - 3.2v5.0*) - echo "whatever-whatever-sco5"; exit 0 - ;; - 4.2MP) - if [ "x$VERSION" = "x2.1.1" ]; then - echo "${MACHINE}-whatever-unixware211"; exit 0 - elif [ "x$VERSION" = "x2.1.2" ]; then - echo "${MACHINE}-whatever-unixware212"; exit 0 - else - echo "${MACHINE}-whatever-unixware2"; exit 0 - fi - ;; - 4.2) - echo "whatever-whatever-unixware1"; exit 0 - ;; - 5) - case "$VERSION" in - 7*) echo "${MACHINE}-whatever-unixware7"; exit 0 ;; - esac - ;; - esac - fi - fi - case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in - MiNT:*) - echo "m68k-atari-mint"; exit 0 - ;; - A/UX:*) - echo "m68k-apple-aux3"; exit 0 - ;; - AIX:*) - MACH=`echo $MACHINE | sed -e 's;[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F];;'` - echo "${MACH}-ibm-aix${VERSION}.${RELEASE}"; exit 0 - ;; - dgux:*) - echo "${MACHINE}-dg-dgux"; exit 0 ;; - HI-UX:*) - echo "${MACHINE}-hi-hiux"; exit 0 + + # NetBSD + *:NetBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="NetBSD ${r}" + SP="${ST}" + case "${r}" in + 0.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; + esac ;; - HP-UX:*) - HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo "${MACHINE}-hp-hpux${HPUXVER}"; exit 0 + + # OpenBSD + *:OpenBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="OpenBSD ${r}" + SP="${ST}" + SC="4.4BSD" ;; - IRIX:*) - if [ -f /usr/lib32/mips4/libm.so ]; then - echo "${MACHINE}/32-sgi-irix${RELEASE}"; exit 0 - else - echo "${MACHINE}-sgi-irix${RELEASE}"; exit 0 + + # GNU/Linux + *:Linux:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + x86_64 ) AT='AMD64' ;; + parisc ) AT="HPPA32" ;; + parisc64 ) AT="HPPA64" ;; + esac + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP='iX86' ;; + esac + AC="${AP}" + # determine system + v_kern=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'` + v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\ + sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null` + ST="GNU/${v_libc}/<${v_kern}>" + if [ -f /etc/lsb-release ]; then + eval `( . /etc/lsb-release + echo "SC=\"LSB${LSB_VERSION}\"" + if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then + echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\"" + fi + ) 2>/dev/null` fi + if [ ".$SP" = . ]; then + for tagfile in x \ + `cd /etc && \ + /bin/ls *[_-]release *[_-]version 2>/dev/null | \ + sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \ + echo redhat-release lsb-release` + do + [ ".${tagfile}" = .x ] && continue + [ ! -f "/etc/${tagfile}" ] && continue + n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'` + v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$//'` + case "`util_lower ${n}`" in + redhat ) + if [ ".`grep 'Red Hat Enterprise Linux' /etc/${tagfile}`" != . ]; then + n="ed at nterprise inux" + else + n="ed at inux" + fi + ;; + debian ) n="Debian[ GNU/Linux]" ;; + fedora ) n=" Core[ GNU/Linux]" ;; + suse ) n="SuSE[ Linux]" ;; + mandrake ) n="Mandrake[ Linux]" ;; + gentoo ) n="Gentoo[ GNU/Linux]" ;; + slackware ) n="Slackware[ Linux]" ;; + turbolinux ) n="TurboLinux" ;; + unitedlinux ) n="UnitedLinux" ;; + * ) n="${n}[ GNU/Linux]" ;; + esac + case "$n" in + *"<"*">"* ) SP="$n <$v>" ;; + * ) SP="$n $v" ;; + esac + break + done + fi + [ ".$SP" = . ] && SP="${ST}" + [ ".$SC" = . ] && SC="LSB" ;; - IRIX64:*) - echo "${MACHINE}-sgi-irix64"; exit 0 - ;; - Linux:[2-9].*) - echo "${MACHINE}-whatever-linux2"; exit 0 - ;; - Linux:1.*) - echo "${MACHINE}-whatever-linux1"; exit 0 - ;; - LynxOS:*) - echo "${MACHINE}-lynx-lynxos"; exit 0 + + # Sun Solaris + *:SunOS:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i86pc ) AT="iX86" ;; + esac + AP="${AT}" + case "${AP}" in + sun4[cdm] ) AP="SPARC32" ;; + sun4u ) AP="SPARC64" ;; + sun4* ) AP="SPARC" ;; + esac + AC="${AP}" + case "${AC}" in + SPARC* ) AC="SPARC" ;; + esac + # determine system + ST="[Sun ]SunOS ${UNAME_RELEASE}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's;^4\.;1.;' \ + -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \ + -e 's;^5\.\([0-9][0-9]*\).*;\1;'` + SP="[Sun ]Solaris $v" + case "${UNAME_RELEASE}" in + 4.* ) SC="4.3BSD" ;; + 5.* ) SC="SVR4" ;; + esac ;; - BSD/386|BSD/OS:3.*) - echo "${MACHINE}-whatever-bsdi3"; exit 0 + + # SCO UnixWare + *:UnixWare:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i[3-6]86 | ix86at ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v=`/sbin/uname -v` + ST="[SCO ]UnixWare ${v}" + SP="${ST}" + SC="SVR${UNAME_RELEASE}" ;; - BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*) - echo "i486-whatever-bsdi"; exit 0 + + # QNX + *:QNX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + x86pc ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v="${UNAME_RELEASE}" + ST="QNX[ Neutrino RTOS] ${v}" + v=`echo "${v}" | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'` + SP="QNX[ Neutrino RTOS] ${v}" + SC="QNX" ;; - BSD/386:*|BSD/OS:*) - echo "${MACHINE}-whatever-bsdi"; exit 0 + + # SGI IRIX + *:IRIX*:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}:${UNAME_SYSTEM}" in + IP*:IRIX64 ) AP="MIPS64" ;; + IP*:* ) AP="MIPS" ;; + esac + AC="${AP}" + # determine system + v=`(/bin/uname -R || /bin/uname -r) 2>/dev/null | sed -e 's;[0-9.]* ;;'` + ST="[SGI ]IRIX ${v}" + v="${UNAME_RELEASE}" + SP="[SGI ]IRIX ${v}" + SC="4.2BSD/SVR3" ;; - FreeBSD:*) - VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'` - MACH=`sysctl -n hw.model` - ARCH='whatever' - case ${MACH} in - *386* ) MACH="i386" ;; - *486* ) MACH="i486" ;; - Pentium\ II*) MACH="i686" ;; - Pentium* ) MACH="i586" ;; - Alpha* ) MACH="alpha" ;; - * ) MACH="$MACHINE" ;; + + # HP HP-UX + *:HP-UX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + 9000/[34]?? ) AT=M68K ;; + 9000/[678][0-9][0-9]) + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523 ) AT="HPPA1.0" ;; + 528 ) AT="HPPA1.1" ;; + 532 ) AT="HPPA2.0" + case "${sc_kernel_bits}" in + 32 ) AT="${AT}n" ;; + 64 ) AT="${AT}w" ;; + esac + ;; + esac + ;; esac - case ${MACH} in - i[0-9]86 ) ARCH="pc" ;; + AP="${AT}" + case "${AP}" in + HPPA* ) AP="HPPA" ;; + esac + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[^0-9]*;;'` + ST="[HP ]-" + SP="${ST}" + case "${v}" in + 10.* ) SC="SVR4.2" ;; + [7-9]* ) SC="SVR4" ;; esac - echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0 - ;; - NetBSD:*:*:*486*) - echo "i486-whatever-netbsd${RELEASE}"; exit 0 - ;; - NetBSD:*) - echo "${MACHINE}-whatever-netbsd${RELEASE}"; exit 0 - ;; - OpenBSD:*) - echo "${MACHINE}-whatever-openbsd"; exit 0 ;; - OSF1:*:*:*alpha*) - VERS=`echo $RELEASE | sed -e 's;^V;;'` - echo "${MACHINE}-dec-osf${VERS}"; exit 0 + + # HP Tru64 (OSF1) + *:OSF1:* ) + # determine architecture + AP="${UNAME_MACHINE}" + case "${AP}" in + alpha ) AP="Alpha" ;; + esac + alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\ + sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'` + AT="${AP}${alpha_type}" + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[VTX];;'` + ST="[HP ]Tru64 ${v}" + SP="${ST}" + SC="OSF1" ;; - QNX:*) - if [ "$VERSION" -gt 422 ]; then - echo "${MACHINE}-qssl-qnx32" + + # IBM AIX + *:AIX:* ) + cpu_arch=rs6000 + if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then + cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then + cpu_arch=powerpc + fi + fi + if [ -x /usr/bin/oslevel ]; then + os_level=`/usr/bin/oslevel` else - echo "${MACHINE}-qssl-qnx" + os_level="`uname -r`.`uname -v`" fi - exit 0 - ;; - Paragon*:*:*:*) - echo "i860-intel-osf1"; exit 0 - ;; - SunOS:5.*) - VERSION=`echo $RELEASE | sed -e 's;^5\.;;'` - echo "${MACHINE}-sun-solaris2.${VERSION}"; exit 0 - ;; - SunOS:*) - echo "${MACHINE}-sun-sunos4"; exit 0 - ;; - UNIX_System_V:4.*:*) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - unix:3.0.9*:*:88k) - echo "${MACHINE}-encore-sysv4"; exit 0 - ;; - *:4*:R4*:m88k) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - UnixWare:5:99*:*) - # Gemini, beta release of next rev of unixware - echo "${MACHINE}-whatever-unixware212"; exit 0 - ;; - DYNIX/ptx:4*:*) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - *:4.0:3.0:[345][0-9]?? | *:4.0:3.0:3[34]??[/,]* | library:*) - echo "x86-ncr-sysv4"; exit 0 - ;; - ULTRIX:*) - echo "${MACHINE}-unknown-ultrix"; exit 0 + os_level=`echo "${os_level}" |\ + sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \ + -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'` + AT="${cpu_arch}" + AP="${AT}" + AC="${AP}" + ST="[IBM ]AIX ${os_level}" + SP="${ST}" + case "${os_level}" in + [12]* ) SC="SVR2" ;; + * ) SC="SVR4" ;; + esac ;; - SINIX-?:* | ReliantUNIX-?:*) - echo "${MACHINE}-siemens-sysv4"; exit 0 + + # Apple MacOS X Darwin + *:Darwin:* ) + AT=`uname -p` + case "${AT}" in + powerpc ) AT="PPC" ;; + esac + AP="${AT}" + AC="${AP}" + case "${AC}" in + i?86 ) AC="iX86" ;; + esac + ST="[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}" + SP="${ST}" + SC="4.4BSD/Mach3" ;; - POSIX*BS2000) - echo "${MACHINE}-siemens-sysv4"; exit 0 + + # TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO + # *:XXX:* ) + # ... + # ;; + + # ...A STILL UNKNOWN PLATFORM... + * ) + AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"` + AP="${AT}" + AC="${AP}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$/?/'` + ST="${UNAME_SYSTEM} ${v}" + SP="${ST}" + SC="${SP}" ;; - machten:*) - echo "${MACHINE}-tenon-${SYSTEM}"; exit 0; - ;; - ConvexOS:*:11.*:*) - echo "${MACHINE}-v11-${SYSTEM}"; exit 0; - ;; - UNIX_SV:*:*:maxion) - echo "${MACHINE}-ccur-sysv4"; exit 0; - ;; - PowerMAX_OS:*:*:Night_Hawk) - MACHINE=`uname -p` - echo "${MACHINE}-concurrent-powermax"; exit 0; - ;; - UNIX_SV:*) - if [ -d /usr/nec ];then - echo "mips-nec-sysv4"; exit 0; - fi - ;; - NonStop-UX:4.[02]*:[BC]*:*) - echo "${MACHINE}-tandem-sysv4"; exit 0; - ;; - Rhapsody:*:*:*) - case "${MACHINE}" in - "Power Macintosh") MACHINE=powerpc ;; - esac - echo "${MACHINE}-apple-rhapsody${RELEASE}"; exit 0 - ;; - "Mac OS":*:*:*) - MACHINE=`uname -p` - echo "${MACHINE}-apple-macos${RELEASE}"; exit 0 - ;; - "RISC iX":*) - echo "arm-whatever-riscix"; exit 0; - ;; - *:4.0:2:*) - echo "whatever-unisys-sysv4"; exit 0; - ;; - *:*:dcosx:NILE*) - echo "pyramid-pyramid-svr4"; exit 0; - ;; - *:*:*:"DRS 6000") - echo "drs6000-whatever-whatever"; exit 0; - ;; - esac - - # Now NeXT - ISNEXT=`(hostinfo) 2>/dev/null` - case "$ISNEXT" in - *NeXT*) - # Swiped from a friendly uname clone for NEXT/OPEN Step. - NEXTOSVER="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" - if [ "$NEXTOSVER" -gt 3.3 ]; then - NEXTOS="openstep" - else - NEXTOS="nextstep" - fi - NEXTREL="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" - NEXTARCH=`arch` - echo "${NEXTARCH}-next-${NEXTOS}${NEXTREL}" ; exit 0 - ;; + esac - - # Fallback - echo "${MACHINE}-whatever-${SYSTEM}|${RELEASE}|${VERSION}" - ;; -arx ) - ## - ## arx -- Extended archive command - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - ar_prg="$opt_C" - ar_cmd="$1"; shift - archive="$1"; shift - files="$*" - - # walk through the file list and expand archives members - tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'` - nfiles='' - if [ ".$files" != . ]; then - for file in $files; do - if [ ! -f $file ]; then - echo "$msgprefix:Error: input file not found: $file" 1>&2 - exit 1 - fi - case $file in - *.a ) - if [ ! -d $tmpdir ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $tmpdir" 1>&2 - fi - mkdir $tmpdir - fi - case $tmpdir in - .arx ) - from="../$file" - ;; - * ) - dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - base=`echo $file | sed -e 's;.*/\([^/]*\)$;\1;'` - from="`cd $dir; pwd`/$base" - ;; - esac - if [ ".$opt_t" = .yes ]; then - echo "(cd $tmpdir && $ar_prg x $from)" 1>&2 - fi - (cd $tmpdir && eval $ar_prg x $from) - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: member extraction failed for archive: $file" 1>&2 - exit 1 - fi - for member in - `eval $ar_prg t $file`; do - [ ".$member" = .- ] && continue - nfiles="$nfiles $tmpdir/$member" - done + # provide fallback values + [ ".$AT" = . ] && AT="${AP:-${AC}}" + [ ".$AP" = . ] && AP="${AT:-${AC}}" + [ ".$AC" = . ] && AC="${AP:-${AT}}" + [ ".$ST" = . ] && ST="${SP:-${SC}}" + [ ".$SP" = . ] && SP="${ST:-${SC}}" + [ ".$SC" = . ] && SC="${SP:-${ST}}" + + # support explicit enforced verbose/concise output + if [ ".$opt_v" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'` + elif [ ".$opt_c" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'` + fi + + # provide verbose and concise variants + AC_V=""; AC_N=""; AC_C="" + AP_V=""; AP_N=""; AP_C="" + AT_V=""; AT_N=""; AT_C="" + SC_V=""; SC_N=""; SC_C="" + SP_V=""; SP_N=""; SP_C="" + ST_V=""; ST_N=""; ST_C="" + for var_lc in at ap ac st sp sc; do + case "$opt_F" in + *"%[${val_lc}]"* | *"%{${val_lc}}"* | *"%${val_lc}"* | *"%<${val_lc}>"* ) + var_uc=`util_upper "$var_lc"` + eval "val=\"\$${var_uc}\"" + val_V=""; val_N=""; val_C="" + case "$opt_F" in + *"%[${var_lc}]"* ) + val_V=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];\1;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_V=\"\${val_V}\"" ;; - * ) - nfiles="$nfiles $file" + esac + case "$opt_F" in + *"%{${var_lc}}"* | *"%${var_lc}"* ) + val_N=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_N=\"\${val_N}\"" ;; esac - done - fi - - # run the final archive command - if [ ".$opt_t" = .yes ]; then - echo "$ar_prg $ar_cmd $archive $nfiles" 1>&2 - fi - eval $ar_prg $ar_cmd $archive $nfiles - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: archive command failed" 1>&2 - exit $? - fi - - # cleanup and die gracefully - if [ -d $tmpdir ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -rf $tmpdir" 1>&2 - fi - rm -rf $tmpdir - fi - ;; - -slo ) - ## - ## slo -- Separate linker options by library class - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - DIFS="$IFS" - - # parse out -L and -l options from command line - DIRS='' - LIBS='' - ARGV='' - optprev='' - for opt - do - # concatenate with previous option if exists - if [ ".$optprev" != . ]; then - opt="${optprev}${opt}"; - optprev='' - fi - # remember options for arg when used stand-alone - if [ ".$opt" = ".-L" -o ".$opt" = ".-l" ]; then - optprev="$opt" - continue; - fi - # split argument into option plus option argument - arg="`echo $opt | cut -c3-`" - opt="`echo $opt | cut -c1-2`" - # store into containers - case $opt in - -L) DIRS="$DIRS:$arg" ;; - -l) LIBS="$LIBS:$arg" ;; - *) ARGV="$ARGV $opt" ;; + case "$opt_F" in + *"%<${var_lc}>"* ) + val_C=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_C=\"\${val_C}\"" + ;; + esac + ;; esac done - - # set linker default directories - DIRS_DEFAULT='/lib:/usr/lib' - if [ ".$LD_LIBRARY_PATH" != . ]; then - DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH" - fi - - # sort options by class - DIRS_OBJ='' - LIBS_OBJ='' - DIRS_PIC='' - LIBS_PIC='' - DIRS_DSO='' - LIBS_DSO='' - - # for each library... - OIFS="$IFS" IFS=':' - for lib in $LIBS; do - [ ".$lib" = . ] && continue - - found='no' - found_indefdir='no' - found_type='' - found_dir='' - - # for each directory... - OIFS2="$IFS" IFS=":$DIFS" - for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do - [ ".$dir" = . ] && continue - [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes - [ ! -d $dir ] && continue - - # search the file - OIFS3="$IFS" IFS="$DIFS" - for file in '' `cd $dir && ls lib${lib}.* 2>/dev/null`; do - [ ".$file" = . ] && continue - case $file in - *.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* ) - found=yes; - found_type=DSO; - break - ;; - *.lo|*.la ) - found=yes; - found_type=PIC - ;; - *.a ) - if [ ".$found_type" = . ]; then - found=yes - found_type=OBJ - fi - ;; - esac - done - IFS="$OIFS3" - if [ ".$found" = .yes ]; then - found_dir="$dir" - break - fi - done - IFS="$OIFS2" - - if [ ".$found" = .yes ]; then - if [ ".$found_indefdir" != .yes ]; then - eval "dirlist=\"\${DIRS_${found_type}}:\"" - if [ ".`echo \"$dirlist\" | fgrep :$found_dir:`" = . ]; then - eval "DIRS_${found_type}=\"\$DIRS_${found_type}:${found_dir}\"" - fi - eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" - else - eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" - fi - else - LIBS_OBJ="$LIBS_OBJ:$lib" - #dirlist="`echo $DIRS $DIRS_DEFAULT | sed -e 's/:/ /g'`" - #echo "slo:Warning: library \"$lib\" not found in any of the following dirs:" 2>&1 - #echo "slo:Warning: $dirlist" 1>&1 - fi - done - IFS="$OIFS" - - # also pass-through unused dirs even if it's useless - OIFS="$IFS" IFS=':' - for dir in $DIRS; do - dirlist="${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:" - if [ ".`echo \"$dirlist\" | fgrep :$dir:`" = . ]; then - DIRS_OBJ="$DIRS_OBJ:$dir" - fi - done - IFS="$OIFS" - - # reassemble the options but seperated by type - for type in OBJ PIC DSO; do - OIFS="$IFS" IFS=':' - eval "libs=\"\$LIBS_${type}\"" - opts='' - for lib in $libs; do - [ ".$lib" = . ] && continue - opts="$opts -l$lib" - done - eval "LIBS_${type}=\"$opts\"" - - eval "dirs=\"\$DIRS_${type}\"" - opts='' - for dir in $dirs; do - [ ".$dir" = . ] && continue - opts="$opts -L$dir" - done - eval "DIRS_${type}=\"$opts\"" - IFS="$OIFS" - done - - # give back results - for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do - eval "val=\"\$${var}\"" - val="`echo $val | sed -e 's/^ *//'`" - echo "SLO_${var}=\"${val}\"" - done - ;; -scpp ) - ## - ## scpp -- Sharing C Pre-Processor - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for NPS - ## - - srcs="$*" - output="${opt_o}.n" - - # parse source file(s) - if [ ".$opt_v" = .yes ]; then - echo "Parsing:" | awk '{ printf("%s", $0); }' 1>&2 - fi - for src in $srcs; do - if [ ".$opt_v" = .yes ]; then - echo $src | awk '{ printf(" %s", $0); }' 1>&2 - fi - awk <$src ' - BEGIN { - ln = 0; - fln = 0; - level = 0; - mode = ""; - store = ""; - } - { - ln++; - } - /^#if.*/ { - level++; - } - /^#if [a-zA-Z_][a-zA-Z0-9_]* *$/ { - if ($2 == define) { - mode = "D"; - printf("D:#line %d \"%s\"\n", ln, src); - next; - } - } - /^#endif.*/ { - level--; - if (mode == "D" && level == 0) { - mode = ""; - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_].*;.*/ || /^[a-zA-Z_][a-zA-Z0-9_].*=.*/ { - if ($1 == class) { - printf("V:#line %d \"%s\"\n", ln, src); - printf("V:%s\n", $0); - printf("J:%s\n", $0); - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_]*/ { - if ($1 == class) { - fln = ln; - store = $0; - mode = "F"; - next; - } - } - /^\{ *$/ { - if (mode == "F") { - printf("F:#line %d \"%s\"\n", fln, src); - printf("F:%s;\n", store); - printf("I:%s;\n", store); - store = ""; - mode = ""; - next; - } - } - { - if (mode == "D") - printf("D:%s\n", $0); - else if (mode == "F") - store = store " " $0; - } - ' "src=$src" "define=$opt_D" "class=$opt_C" >>$tmpfile - done - if [ ".$opt_v" = .yes ]; then - echo "" 1>&2 + # create output string + output=`echo ":$opt_F" |\ + sed -e "s/^://" \ + -e "s;%\\[ac\\];${AC_V};g" \ + -e "s;%{ac};${AC_N};g" \ + -e "s;%ac;${AC_N};g" \ + -e "s;%;${AC_C};g" \ + -e "s;%\\[ap\\];${AP_V};g" \ + -e "s;%{ap};${AP_N};g" \ + -e "s;%ap;${AP_N};g" \ + -e "s;%;${AP_C};g" \ + -e "s;%\\[at\\];${AT_V};g" \ + -e "s;%{at};${AT_N};g" \ + -e "s;%at;${AT_N};g" \ + -e "s;%;${AT_C};g" \ + -e "s;%\\[sc\\];${SC_V};g" \ + -e "s;%{sc};${SC_N};g" \ + -e "s;%sc;${SC_N};g" \ + -e "s;%;${SC_C};g" \ + -e "s;%\\[sp\\];${SP_V};g" \ + -e "s;%{sp};${SP_N};g" \ + -e "s;%sp;${SP_N};g" \ + -e "s;%;${SP_C};g" \ + -e "s;%\\[st\\];${ST_V};g" \ + -e "s;%{st};${ST_N};g" \ + -e "s;%st;${ST_N};g" \ + -e "s;%;${ST_C};g" \ + -e 's/\\\\n/^/g' |\ + tr '^' '\012'` + + # support lower/upper-case mapping + if [ ".$opt_L" = .yes ]; then + output=`util_lower "$output"` + elif [ ".$opt_U" = .yes ]; then + output=`util_upper "$output"` fi - - # start generating output header - echo "/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */" >$output - echo "#line 1 \"$opt_t\"" >>$output - sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd' |\ - sed -e "/^${opt_M} *\$/d" >>$output - - # merge in the define blocks - grep '^D:' $tmpfile | sed -e 's/^D://' >>$output - - # generate standard prolog - echo "#line 1 \"_ON_THE_FLY_\"" >>$output - echo "" >>$output - echo "/* make sure the scpp source extensions are skipped */" >>$output - echo "#define $opt_D 0" >>$output - echo "#define $opt_C /**/" >>$output - - # generate namespace hiding for variables - echo "" >>$output - echo "/* move intern variables to hidden namespace */" >>$output - grep '^J:' $tmpfile | sed >>$output \ - -e 's/^J://' \ - -e 's/ */ /g' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\];.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/' - - # generate namespace hiding for functions - echo "" >>$output - echo "/* move intern functions to hidden namespace */" >>$output - grep '^I:' $tmpfile | sed >>$output \ - -e 's/^I://' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/' - - # generate prototypes for variables - echo "" >>$output - echo "/* prototypes for intern variables */" >>$output - grep '^V:' $tmpfile | sed >>$output \ - -e 's/^V://' \ - -e 's/ */ /g' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\);.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\) =.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\);.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \ - -e 's/ ;/;/g' \ - -e "s/^$opt_C /extern /" - - # generate prototypes for functions - echo "" >>$output - echo "/* prototypes for intern functions */" >>$output - grep '^F:' $tmpfile | sed >>$output \ - -e 's/^F://' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e "s/^$opt_C /extern /" - - # finish generating output header - n=`(echo ''; sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd') |\ - wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'` - echo "#line $n \"$opt_t\"" >>$output - sed <$opt_t -e "/^${opt_M} *\$/,\$p" -e 'd' |\ - sed -e "/^${opt_M} *\$/d" >>$output - - # create final output file - if [ -f $opt_o ]; then - if [ ".$opt_p" = .yes ]; then - grep -v '^#line' $opt_o >$tmpfile.o - grep -v '^#line' $output >$tmpfile.n - out_old="$tmpfile.o" - out_new="$tmpfile.n" - else - out_old="$opt_o" - out_new="$output" - fi - if cmp -s $out_old $out_new; then - : - else - cp $output $opt_o - fi + + # display output string + if [ ".$opt_n" = .yes ]; then + echo . | awk '{ printf("%s", output); }' output="$output" else - cp $output $opt_o + echo "$output" fi - rm -f $output - rm -f $tmpfile $tmpfile.* >/dev/null 2>&1 + + shtool_exit 0 ;; version ) ## - ## version -- Generate and maintain a version information file - ## Copyright (c) 1994-1999 Ralf S. Engelschall - ## Originally written for ePerl + ## version -- Maintain a version information file + ## Copyright (c) 1994-2004 Ralf S. Engelschall ## - - LANGUAGE="$opt_l" - NAME="$opt_n" - PREFIX="$opt_p" - FULLVERSION="$opt_s" - INCREASE="$opt_i" - REPORT="$opt_d" - FILE="$1" - - # determine language - if [ ".$LANGUAGE" = .unknown ]; then - case $FILE in - *.txt ) LANGUAGE=txt ;; - *.c ) LANGUAGE=c ;; - *.pl | *.pm ) LANGUAGE=perl ;; - * ) echo "$tool:Error: unknown language type" 1>&2; exit 1 ;; - esac - fi - - # determine prefix from name and vice versa - if [ ".$PREFIX" = . -o ".$PREFIX" = .unknown ]; then - if [ ".$NAME" != . -a ".$NAME" != .unknown ]; then - PREFIX="$NAME" + + file="$1" + + # determine prefix and name + name="$opt_n" + prefix="$opt_p" + + # determine current version + triple="$opt_s" + if [ ".$triple" != . ]; then + # use given triple + if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then + echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2 + shtool_exit 1 fi + eval `echo $triple |\ + sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc + elif [ -r $file ]; then + # determine triple from given file + eval `grep 'Version [0-9]*.[0-9]*[sabp.][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $file |\ + sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\ + ver="\1";rev="\2";typ="\3";lev="\4";tim="\5"%' -e 'q'` + else + # intialise to first version + ver=0 + rev=1 + typ=. + lev=0 + tim=calc fi - if [ ".$NAME" = . -o ".$NAME" = .unknown ]; then - if [ ".$PREFIX" != . -a ".$PREFIX" != .unknown ]; then - NAME="$PREFIX" - fi + + # determine new version in batch + if [ ".$opt_i" != . ]; then + case $opt_i in + v ) ver=`expr $ver + 1` + rev=0 + lev=0 + ;; + r ) rev=`expr $rev + 1` + lev=0 + ;; + l ) lev=`expr $lev + 1` + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2 + shtool_exit 1 + ;; + esac + tim=calc fi - - # determine version - date=unknown - version=0 - revision=0 - bplevel=0 - if [ ".$FULLVERSION" = .unknown ]; then - if [ -r "$FILE" ]; then - # grep out current information - id=`grep 'Version [0-9]*.[0-9]*[.abps][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $FILE | \ - head -1 | \ - sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\1:\2:\3:\4:\5%'` - version=`echo $id | awk -F: '{ print $1 }'` - revision=`echo $id | awk -F: '{ print $2 }'` - bptype=`echo $id | awk -F: '{ print $3 }'` - bplevel=`echo $id | awk -F: '{ print $4 }'` - date=`echo $id | awk -F: '{ print $5 }'` - if [ .$REPORT = .NO ]; then - case $INCREASE in - b ) bplevel=`expr $bplevel + 1` - bptype=b - ;; - a ) bplevel=`expr $bplevel + 1` - bptype=a - ;; - s ) bplevel=`expr $bplevel + 1` - bptype=s - ;; - P ) bplevel=`expr $bplevel + 1` - bptype=. - ;; - p ) bplevel=`expr $bplevel + 1` - bptype=p - ;; - r ) revision=`expr $revision + 1` - bptype=. - bplevel=0 - ;; - v ) version=`expr $version + 1` - revision=0 - bptype=. - bplevel=0 - ;; - esac - date=calc - fi - FULLVERSION="$version.$revision$bptype$bplevel" - else - # intialise to first version - version=0 - revision=5 - bptype=b - bplevel=0 - date=calc - fi - else - # take given version - V=`echo $FULLVERSION | sed -e 's%\([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\).*%\1:\2:\3:\4%'` - version=`echo $V | awk -F: '{ print $1 }'` - revision=`echo $V | awk -F: '{ print $2 }'` - bptype=`echo $V | awk -F: '{ print $3 }'` - bplevel=`echo $V | awk -F: '{ print $4 }'` - date=calc + + # determine new version interactively + if [ ".$opt_e" = .yes ]; then + echo "old version: ${ver}.${rev}${typ}${lev}" + while [ 1 ]; do + echo dummy | awk '{ printf("new version: "); }' + read triple + case $triple in + [0-9]*.[0-9]*[sabp.][0-9]* ) + ;; + * ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2 + continue + ;; + esac + break + done + eval `echo $triple |\ + sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc fi - - # determine hex value of version - case $FULLVERSION in - *.*a* ) - HEX=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*a//' | awk '{ printf("0%02d", $1); }'` - ;; - *.*b* ) - HEX=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*b//' | awk '{ printf("1%02d", $1); }'` - ;; - *.*.* ) - HEX=`echo "$FULLVERSION" | awk -F. '{ printf("%d%02d2%02d", $1, $2, $3); }'` - ;; - esac - - # determine libtool version - case $FULLVERSION in - *.*a* ) - LTV=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*b* ) - LTV=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*.* ) - LTV=`echo "$FULLVERSION" | awk -F. '{ printf("%d:%d", $1*10+$2, $3); }'` - ;; + + # determine hexadecimal and libtool value of version + case $typ in + a ) typnum=0; levnum=$lev ;; + b ) typnum=1; levnum=$lev ;; + p | . ) typnum=2; levnum=$lev ;; + s ) typnum=15; levnum=255 ;; # snapshots are special esac - - # determine string out of filename - # (don't try to optimize this in any way - portability!) - FILESTR=`echo "$FILE" |\ - tr 'abcdefghijklmnopqrstuvwxyz./%+' \ - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` - + hex=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("0x%x%02x%1x%02x", $1, $2, $3, $4); }' |\ + tr 'abcdef' 'ABCDEF'` + ltv=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` + # determine date - if [ ".$date" = .calc ]; then + if [ ".$tim" = .calc ]; then day=`date '+%d'` month=`date '+%m'` year=`date '+%Y' 2>/dev/null` @@ -2215,264 +1242,185 @@ version ) 11) month='Nov' ;; 12) month='Dec' ;; esac - date="${day}-${month}-${year}" + tim="${day}-${month}-${year}" fi - - if [ .$REPORT != .NO ]; then - case $REPORT in - long ) - echo "$version.$revision$bptype$bplevel ($date)" - ;; + + # perform result actions + mode=show + if [ ".$opt_i" != . ]; then + mode=edit + elif [ ".$opt_e" = .yes ]; then + mode=edit + elif [ ".$opt_s" != . ]; then + mode=edit + fi + if [ ".$mode" = .show ]; then + # just display the current version + case $opt_d in short ) - echo "$version.$revision$bptype$bplevel" + echo "${ver}.${rev}${typ}${lev}" + ;; + long ) + echo "${ver}.${rev}${typ}${lev} ($tim)" ;; libtool ) - echo "$LTV" + echo "${ltv}" ;; hex ) - echo "0x$HEX" + echo "${hex}" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2 + shtool_exit 1 ;; esac - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - fi - - # create the version file according the the selected language - echo "new version: $version.$revision$bptype$bplevel ($date)" - case $LANGUAGE in - txt ) - cat >$tmpfile <<'EOT' - - This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@) -EOT - ;; - c ) - cat >$tmpfile <<'EOT' -/* -** @FILE@ -- Version Information -** [automatically generated and maintained by shtool] -*/ - -#ifdef _AS_HEADER - -#ifndef _@FILESTR@ -#define _@FILESTR@ -#define @PREFIX@_VERSION 0x@HEX@ -extern const int @PREFIX@_Version; -extern const char @PREFIX@_VersionStr[]; -extern const char @PREFIX@_Hello[]; -extern const char @PREFIX@_GNUVersion[]; -extern const char @PREFIX@_WhatID[]; -extern const char @PREFIX@_RCSIdentID[]; -extern const char @PREFIX@_WebID[]; -extern const char @PREFIX@_PlainID[]; -#endif /* _@FILESTR@ */ - -#else - -const int @PREFIX@_Version = 0x@HEX@; -const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_RCSIdentID[] = "$Id: shtool 1.1 Tue, 27 Jan 2004 11:46:36 -0800 shawnw $"; -const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -#endif -EOT - ;; - perl ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by shtool] -## + else + # update the version file -$@PREFIX@_Version = 0x@HEX@; -$@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_RCSIdentID = "\$Id: shtool 1.1 Tue, 27 Jan 2004 11:46:36 -0800 shawnw $/"; -$@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -1; -EOT - ;; - esac - - # now create the version file - rm -f $FILE >/dev/null 2>&1 - sed \ - -e "s|@FILE@|$FILE|g" \ - -e "s|@FILESTR@|$FILESTR|g" \ - -e "s|@PREFIX@|$PREFIX|g" \ - -e "s|@NAME@|$NAME|g" \ - -e "s|@HEX@|$HEX|g" \ - -e "s|@VERSION@|$version|g" \ - -e "s|@REVISION@|$revision|g" \ - -e "s|@BPTYPE@|$bptype|g" \ - -e "s|@BPLEVEL@|$bplevel|g" \ - -e "s|@YEAR@|$year|g" \ - -e "s|@MONTH@|$month|g" \ - -e "s|@DAY@|$day|g" <$tmpfile >$FILE - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - ;; + # pre-generate various strings + triple="${ver}.${rev}${typ}${lev}" + vHex="$hex" + vShort="${triple}" + vLong="${triple} (${tim})" + vTeX="This is ${name}, Version ${triple} (${tim})" + vGNU="${name} ${triple} (${tim})" + vWeb="${name}/${triple}" + vSCCS="@(#)${name} ${triple} (${tim})" + vRCS="\$Id: ${name} ${triple} (${tim}) \$" -path ) - ## - ## path -- Deal with program paths - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - namelist="$*" - - # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then - minusx="-x" - else - minusx="-r" - fi - rm -f $tmpfile - - # split path string - paths="`echo $opt_p |\ - sed -e 's/^:/.:/' \ - -e 's/::/:.:/g' \ - -e 's/:$/:./' \ - -e 's/:/ /g'`" - - # SPECIAL REQUEST - # translate forward to reverse path - if [ ".$opt_r" = .yes ]; then - if [ "x$namelist" = "x." ]; then - rp='.' - else - rp='' - for pe in `IFS="$IFS/"; echo $namelist`; do - rp="../$rp" - done - fi - echo $rp | sed -e 's:/$::' - exit 0 - fi - - # SPECIAL REQUEST - # strip out directory or base name - if [ ".$opt_d" = .yes ]; then - echo "$namelist" |\ - sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' - exit 0 - fi - if [ ".$opt_b" = .yes ]; then - echo "$namelist" |\ - sed -e 's;.*/\([^/]*\)$;\1;' - exit 0 - fi - - # MAGIC SITUATION - # Perl Interpreter (perl) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then - rm -f $tmpfile - touch $tmpfile - c=0 - found=0 - for dir in $paths; do - dir=`echo $dir | sed -e 's;/*$;;'` - for perl in perl5 perl miniperl; do - if [ $minusx "$dir/$perl" ]; then - perl="$dir/$perl" - version=`$perl -v | grep version |\ - sed -e 's/.* version //' -e 's/ built.*//' -e 's/ with.*//'` - versionnum="`echo $version | sed -e 's/\.//g' -e 's/_//g'`" - versionnum=`expr $versionnum - $c` - echo "$versionnum $perl" >>$tmpfile - found=1 - fi - done - c=`expr $c + 1` - done - if [ $found = 1 ]; then - perl="`cat $tmpfile | sort -u | tail -1 | cut '-d ' -f2`" - rm -f $tmpfile - echo "$perl" - exit 0 - fi - exit 1 - fi - - # MAGIC SITUATION - # C pre-processor (cpp) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then - cat >$tmpfile.c < - Syntax Error -EOT - # 1. try the standard cc -E approach - cpp="${CC-cc} -E" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 2. try the cc -E approach and GCC's -traditional-ccp option - cpp="${CC-cc} -E -traditional-cpp" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 3. try a standalone cpp command in path and lib dirs - for path in $paths /lib /usr/lib /usr/local/lib; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then - cpp="$path/cpp" - break - fi - done - if [ ".$cpp" != . ]; then - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # ok, we gave up... - cpp='' - fi - fi - fi - fi - rm -f $tmpfile.c $tmpfile.out - if [ ".$cpp" != . ]; then - echo "$cpp" - exit 0 - fi - exit 1 + # determine string out of filename + # (do NOT try to optimize this in any way because of portability) + filestr=`echo $file |\ + tr 'abcdefghijklmnopqrstuvwxyz./%+' \ + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` + + # generate uppercase prefix + prefixupper=`echo $prefix |\ + tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + + # create the version file according the the selected language + echo "new version: ${vLong}" + + cp /dev/null $file + case $opt_l in + txt ) + echo >>$file "" + echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)" + echo >>$file " [automatically generated and maintained by GNU shtool]" + echo >>$file "" + echo >>$file " $vTeX" + echo >>$file "" + ;; + c ) + echo >>$file "/*" + echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)" + echo >>$file "** [automatically generated and maintained by GNU shtool]" + echo >>$file "*/" + echo >>$file "" + echo >>$file "#ifdef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "#ifndef _${filestr}_" + echo >>$file "#define _${filestr}_" + echo >>$file "" + echo >>$file "#define ${prefixupper}VERSION ${vHex}" + echo >>$file "" + echo >>$file "typedef struct {" + echo >>$file " const int v_hex;" + echo >>$file " const char *v_short;" + echo >>$file " const char *v_long;" + echo >>$file " const char *v_tex;" + echo >>$file " const char *v_gnu;" + echo >>$file " const char *v_web;" + echo >>$file " const char *v_sccs;" + echo >>$file " const char *v_rcs;" + echo >>$file "} ${prefix}version_t;" + echo >>$file "" + echo >>$file "extern ${prefix}version_t ${prefix}version;" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_ */" + echo >>$file "" + echo >>$file "#else /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + echo >>$file "#define _${filestr}_AS_HEADER_" + echo >>$file "#include \"${file}\"" + echo >>$file "#undef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "${prefix}version_t ${prefix}version = {" + echo >>$file " ${vHex}," + echo >>$file " \"${vShort}\"," + echo >>$file " \"${vLong}\"," + echo >>$file " \"${vTeX}\"," + echo >>$file " \"${vGNU}\"," + echo >>$file " \"${vWeb}\"," + echo >>$file " \"${vSCCS}\"," + echo >>$file " \"${vRCS}\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + ;; + m4 ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: M4)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "m4_define([v_hex], [${vHex}])" + echo >>$file "m4_define([v_short], [${vShort}])" + echo >>$file "m4_define([v_long], [${vLong}])" + echo >>$file "m4_define([v_tex], [${vTeX}])" + echo >>$file "m4_define([v_gnu], [${vGNU}])" + echo >>$file "m4_define([v_web], [${vWeb}])" + echo >>$file "m4_define([v_sccs], [${vSCCS}])" + echo >>$file "m4_define([v_rcs], [${vRCS}])" + echo >>$file "" + ;; + perl ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Perl)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "my \$${prefix}version = {" + echo >>$file " 'v_hex' => ${vHex}," + echo >>$file " 'v_short' => \"${vShort}\"," + echo >>$file " 'v_long' => \"${vLong}\"," + echo >>$file " 'v_tex' => \"${vTeX}\"," + echo >>$file " 'v_gnu' => \"${vGNU}\"," + echo >>$file " 'v_web' => \"${vWeb}\"," + echo >>$file " 'v_sccs' => \"${vSCCS}\"," + echo >>$file " 'v_rcs' => \"\\${vRCS}/\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "1;" + echo >>$file "" + ;; + python ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Python)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "class ${prefix}version:" + echo >>$file " v_hex = ${vHex}" + echo >>$file " v_short = \"${vShort}\"" + echo >>$file " v_long = \"${vLong}\"" + echo >>$file " v_tex = \"${vTeX}\"" + echo >>$file " v_gnu = \"${vGNU}\"" + echo >>$file " v_web = \"${vWeb}\"" + echo >>$file " v_sccs = \"${vSCCS}\"" + echo >>$file " v_rcs = \"${vRCS}\"" + echo >>$file "" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 + shtool_exit 1 + ;; + esac fi - - # STANDARD SITUATION - # iterate over names - for name in $namelist; do - # iterate over paths - for path in $paths; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then - if [ ".$opt_s" != .yes ]; then - echo "$path/$name" 2>&1 - fi - exit 0 - fi - done - done - exit 1 + + shtool_exit 0 ;; esac -exit 0 +shtool_exit 0 -##EOF## -- cgit v1.2.3 From 4fe70fcc677fcf420cfd77820c367f7dea83a237 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 24 Jul 2020 13:19:05 +0200 Subject: configure_in Gbp-Pq: Name 05_configure_in.diff --- Makefile.in | 2 +- configure.in | 204 ++++++++++++++++++------------------------------------ tests/Makefile.in | 4 +- 3 files changed, 69 insertions(+), 141 deletions(-) diff --git a/Makefile.in b/Makefile.in index c1f41c0..b2f802d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,7 +4,7 @@ RESULT=pcap LIBINSTALL_FILES=$(wildcard *.mli *.cmi *.cma *.cmx *.cmxa *.a *.so) CC=@CC@ -CFLAGS=@CFLAGS@ +CFLAGS=@CFLAGS@ @cp4flag@ CLIBS=$(foreach lib, @LIBS@, $(subst -l,,${lib})) LDFLAGS=@LDFLAGS@ IDLFLAGS=-no-include diff --git a/configure.in b/configure.in index 0211f96..0ace885 100644 --- a/configure.in +++ b/configure.in @@ -1,162 +1,90 @@ +dnl Standard configuration + AC_INIT(pcap.idl) -AC_MSG_CHECKING(for version) +AC_MSG_CHECKING([for version]) VERSION="`etc/shtool version -l txt -d short VERSION`" -AC_MSG_RESULT "Configuring Version $VERSION" +AC_MSG_RESULT([Configuring Version $VERSION]) AC_SUBST(VERSION) - -AC_MSG_CHECKING(for platform) -ARCH="`etc/shtool guessos`" -AC_MSG_RESULT "$ARCH" +AC_MSG_CHECKING([for platform]) +ARCH="`etc/shtool platform`" +AC_MSG_RESULT([$ARCH]) AC_SUBST(ARCH) -AC_CHECKING(for ocaml compiler and tools) -AC_CHECK_PROG(ocamlc,ocamlc,ocamlc) -AC_CHECK_PROG(ocamlopt,ocamlopt,ocamlopt) -AC_CHECK_PROG(ocamlfind,ocamlfind,ocamlfind,ocamlidl) AC_PROG_INSTALL AC_SUBST(INSTALL) -AC_CHECKING(for C compiler) AC_PROG_CC - -AC_CHECKING(for C header files) AC_HEADER_STDC -# -camlidldir="" -camlidllibdir="" -ffcalldir="" -ffcallarchive="" -libpcapdir="" -cp4flag="" -# - -AC_ARG_ENABLE(examples, - [ --enable-examples build example programs [default=no]],,enable_examples="no") - -# -AC_CHECKING(libraries) - -#AC_CHECKING(for pcap library) -#if test "$ac_cv_lib_pcap" == "no"; then -# #dirs="/usr/local/lib -# # /usr/local/lib -# # /usr/lib -# # /lib" -# dirs="/home/x25/code/MLpcap/libpcap-0.8.3" -# for d in $dirs; do -# test -f "$d/libpcap.a" && LDFLAGS="-L$d" -# done -# AC_CHECKING(in more locations) -# unset ac_cv_lib_pcap -#fi - -if test "x$enable_examples" = "xyes"; then - -AC_ARG_WITH(camlidl-lib, -[ --with-camlidl-lib[=DIR] libcamlidl.a location], -[ - camlidllibdir=$withval - if ! test -f "$camlidllibdir/libcamlidl.a"; then - AC_MSG_ERROR(can't find libcamlidl.a in $camlidllibdir) - fi -], -[ - AC_MSG_ERROR(missing --with-camlidl-lib) -]) - -AC_CHECKING(for ffcall callback library) - dirs="/usr/local/lib - /usr/lib - /lib" - for d in $dirs; do - test -f "$d/libcallback.a" && ffcallarchive="$d/libcallback.a" - done +dnl Ocaml + +AC_CHECK_PROG(ocamlc,ocamlc,ocamlc,no) +if test "x$ocamlc" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlc.]) fi -AC_ARG_WITH(libpcap, -[ --with-libpcap[=DIR] libpcap.a/.so location], -[ - libpcapdir=$withval - if ! test -f "$libpcapdir/libpcap.a"; then - AC_MSG_ERROR(can't find libpcap.a in $libpcapdir) - fi - - # check for libpcap >=0.8, set CFLAGS and camlp4 flag - `which strings` "$libpcapdir/libpcap.a"|grep to_descr 2>&1 >/dev/null - test $? && CFLAGS="$CFLAGS -DHAVE_PCAP08" && cp4flag="HAVE_PCAP08" -], -[ - #AC_MSG_ERROR(missing --with-libpcap) - # try the default - libpcapdir="/usr/lib" -]) - - -AC_CHECKING(for pcap header files) - -AC_ARG_WITH(pcap-header, -[ --with-pcap-header[=DIR] pcap header installation directory], -[ - pcapheaderdir=$withval - AC_CHECK_HEADER($pcapheaderdir/pcap.h, - [ CFLAGS="$CFLAGS -I$pcapheaderdir"; HAVE_PCAP_HEADER="yes" ]) -], -[ - AC_CHECK_HEADER(pcap.h, [HAVE_PCAP_HEADER="yes"]) -]) - -if test -z "$HAVE_PCAP_HEADER"; then - AC_MSG_ERROR(can't find pcap.h) +AC_CHECK_PROG(ocamlopt,ocamlopt,ocamlopt) +if test "x$ocamlopt" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlopt.]) fi -AC_CHECKING(for camlidl header) - -AC_ARG_WITH(camlidl, -[ --with-camlidl[=DIR] camlidl installation directory], -[ - camlidldir=$withval - AC_CHECK_HEADER($camlidldir/caml/camlidlruntime.h, - [ CFLAGS="$CFLAGS -I$camlidldir"; HAVE_CAMLIDLRUNTIME_H="yes" ]) -], -[ - AC_CHECK_HEADER(caml/camlidlruntime.h, [HAVE_CAMLIDLRUNTIME_H="yes"]) -]) - -if test -z "$HAVE_CAMLIDLRUNTIME_H"; then - AC_MSG_ERROR(can't find camlidlruntime.h) +AC_CHECK_PROG(ocamlfind,ocamlfind,ocamlfind) +if test "x$ocamlfind" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlfind.]) fi -AC_CHECKING(for ffcall callback header) - -AC_ARG_WITH(ffcall, -[ --with-ffcall[=DIR] ffcall installation directory], -[ - ffcalldir=$withval - AC_CHECK_HEADER($ffcalldir/callback.h, - [ CFLAGS="$CFLAGS -I$ffcalldir"; HAVE_CALLBACK_H="yes" ]) -], -[ - AC_CHECK_HEADER(callback.h,[HAVE_CALLBACK_H="yes"]) -]) - -if test -z "$HAVE_CALLBACK_H"; then - AC_MSG_ERROR(can't find callback.h) +dnl ------- +dnl Camlidl +dnl ------- + +AC_CHECK_PROG(camlidl,camlidl,camlidl) +if test "x$camlidl" = "xno"; then + AC_MSG_ERROR([Cannot find camlidl.]) fi -AC_SUBST(camlidldir) -AC_SUBST(camlidllibdir) -AC_SUBST(ffcalldir) -AC_SUBST(ffcallarchive) -AC_SUBST(libpcapdir) -AC_SUBST(cp4flag) +dnl Header + +AC_CHECK_HEADER(caml/camlidlruntime.h,, + AC_MSG_ERROR([can't find camlidlruntime.h])) + +dnl ------- +dnl Libpcap +dnl ------- -if test "x$enable_examples" = "xyes"; then - output="[Makefile tests/Makefile]" -else - output="Makefile" +dnl Version 0.8 +AC_CHECK_LIB(pcap, + pcap_datalink_val_to_description, + [AC_DEFINE(HAVE_PCAP08) + cp4flag="-DHAVE_PCAP08" + LIBS="-lpcap $LIBS"]) + +if test "x$cp4flag" = "x"; then + AC_CHECK_LIB(pcap, + pcap_open_live,, + AC_MSG_ERROR([can't find pcap library].)) fi -AC_OUTPUT($output) +AC_SUBST(cp4flag) + +dnl Header + +AC_CHECK_HEADER(pcap.h,, + AC_MSG_ERROR(can't find pcap.h)) + +dnl --------------- +dnl Ffcall callback +dnl --------------- + +AC_CHECK_LIB(callback, + alloc_trampoline_r,, + AC_MSG_ERROR([can't find callback library.])) + +dnl Header + +AC_CHECK_HEADER(callback.h) + +dnl Makefile generation + +AC_OUTPUT([Makefile tests/Makefile]) diff --git a/tests/Makefile.in b/tests/Makefile.in index ea6abce..9c3b4ab 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -12,7 +12,7 @@ pcap_open_offline all: $(TARGETS) $(TARGETS): $(OBJECTS) - $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma -I @camlidllibdir@ -ccopt -L@libpcapdir@ -cclib -lpcap @ffcallarchive@ + $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma clean: rm -f *.cmo *.cmi $(TARGETS) @@ -20,5 +20,5 @@ clean: .SUFFIXES: .ml .cmo .cmi .ml.cmo: - $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo -D@cp4flag@' -I .. -c $< + $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -I .. -c $< -- cgit v1.2.3 From f965e3e938698821d8cda06e75fa9b2b2199196e Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 24 Jul 2020 13:19:05 +0200 Subject: configure Gbp-Pq: Name 06_configure.diff --- configure | 4928 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 2825 insertions(+), 2103 deletions(-) diff --git a/configure b/configure index 4812885..bdf9387 100755 --- a/configure +++ b/configure @@ -1,9 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. +# Generated by GNU Autoconf 2.60a. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -17,20 +17,80 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -41,21 +101,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,206 +124,436 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -274,42 +565,109 @@ ac_unique_file="pcap.idl" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION ARCH ocamlc ocamlopt ocamlfind INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP camlidldir camlidllibdir ffcalldir ffcallarchive libpcapdir cp4flag LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +VERSION +ARCH +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +INSTALL +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +ocamlc +ocamlopt +ocamlfind +camlidl +cp4flag +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -336,34 +694,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -385,12 +757,18 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. @@ -398,7 +776,17 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` @@ -407,11 +795,7 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -438,6 +822,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -462,13 +852,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -533,6 +926,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -589,11 +992,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` @@ -602,7 +1001,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -633,8 +1032,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -654,27 +1052,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -701,74 +1091,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -797,14 +1189,11 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -817,15 +1206,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -836,113 +1232,99 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-examples build example programs default=no - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-camlidl-lib=DIR libcamlidl.a location - --with-libpcap=DIR libpcap.a/.so location - --with-pcap-header=DIR pcap header installation directory - --with-camlidl=DIR camlidl installation directory - --with-ffcall=DIR ffcall installation directory - Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.60a -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.60a. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -961,7 +1343,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -975,6 +1357,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -996,7 +1379,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1007,7 +1389,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1015,23 +1397,21 @@ do 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1042,8 +1422,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1056,20 +1436,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1080,22 +1474,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1107,26 +1507,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1157,14 +1555,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1180,8 +1581,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1193,12 +1594,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1211,20 +1611,19 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1241,12 +1640,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1263,156 +1656,58 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for version" >&5 -echo $ECHO_N "checking for version... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for version" >&5 +echo $ECHO_N "checking for version... $ECHO_C" >&6; } VERSION="`etc/shtool version -l txt -d short VERSION`" -echo "$as_me:$LINENO: result: " >&5 -echo "${ECHO_T}" >&6 "Configuring Version $VERSION" - - - -echo "$as_me:$LINENO: checking for platform" >&5 -echo $ECHO_N "checking for platform... $ECHO_C" >&6 -ARCH="`etc/shtool guessos`" -echo "$as_me:$LINENO: result: " >&5 -echo "${ECHO_T}" >&6 "$ARCH" - -{ echo "$as_me:$LINENO: checking for ocaml compiler and tools..." >&5 -echo "$as_me: checking for ocaml compiler and tools..." >&6;} -# Extract the first word of "ocamlc", so it can be a program name with args. -set dummy ocamlc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlc"; then - ac_cv_prog_ocamlc="$ocamlc" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlc="ocamlc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ocamlc=$ac_cv_prog_ocamlc -if test -n "$ocamlc"; then - echo "$as_me:$LINENO: result: $ocamlc" >&5 -echo "${ECHO_T}$ocamlc" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -# Extract the first word of "ocamlopt", so it can be a program name with args. -set dummy ocamlopt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlopt"; then - ac_cv_prog_ocamlopt="$ocamlopt" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlopt="ocamlopt" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ocamlopt=$ac_cv_prog_ocamlopt -if test -n "$ocamlopt"; then - echo "$as_me:$LINENO: result: $ocamlopt" >&5 -echo "${ECHO_T}$ocamlopt" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +{ echo "$as_me:$LINENO: result: Configuring Version $VERSION" >&5 +echo "${ECHO_T}Configuring Version $VERSION" >&6; } -# Extract the first word of "ocamlfind", so it can be a program name with args. -set dummy ocamlfind; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlfind+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlfind"; then - ac_cv_prog_ocamlfind="$ocamlfind" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlfind="ocamlfind" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - test -z "$ac_cv_prog_ocamlfind" && ac_cv_prog_ocamlfind="ocamlidl" -fi -fi -ocamlfind=$ac_cv_prog_ocamlfind -if test -n "$ocamlfind"; then - echo "$as_me:$LINENO: result: $ocamlfind" >&5 -echo "${ECHO_T}$ocamlfind" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +{ echo "$as_me:$LINENO: checking for platform" >&5 +echo $ECHO_N "checking for platform... $ECHO_C" >&6; } +ARCH="`etc/shtool platform`" +{ echo "$as_me:$LINENO: result: $ARCH" >&5 +echo "${ECHO_T}$ARCH" >&6; } ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -1425,9 +1720,10 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1441,6 +1737,7 @@ do case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -1448,40 +1745,41 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1493,8 +1791,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ echo "$as_me:$LINENO: checking for C compiler..." >&5 -echo "$as_me: checking for C compiler..." >&6;} ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1503,8 +1799,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1517,32 +1813,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1555,36 +1853,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1597,74 +1910,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1678,7 +1951,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1689,6 +1962,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1706,22 +1980,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1734,36 +2009,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1776,29 +2053,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1811,27 +2104,40 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1851,47 +2157,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; + # We found the default executable, but exeext='' is most + # certainly right. + break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; * ) - break;; + break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1903,19 +2239,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -1934,22 +2272,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -1960,10 +2303,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + break;; * ) break;; esac done @@ -1976,19 +2318,18 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2004,14 +2345,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2029,17 +2376,16 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2058,14 +2404,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2074,25 +2442,28 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2108,14 +2479,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2124,239 +2517,278 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; + int main () { -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' \ - '#include ' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - : + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue + fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; int main () { -exit (42); +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - break + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h +rm -f conftest.$ac_ext +CC=$ac_save_CC + fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2364,16 +2796,13 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for C header files..." >&5 -echo "$as_me: checking for C header files..." >&6;} - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2395,7 +2824,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2406,10 +2834,15 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2418,6 +2851,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2433,12 +2867,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2446,8 +2880,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2456,6 +2895,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2473,6 +2913,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2490,8 +2931,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -2502,7 +2943,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2513,10 +2953,15 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2525,6 +2970,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2540,12 +2986,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2553,8 +2999,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2563,6 +3014,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2580,6 +3032,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2602,28 +3055,174 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2643,14 +3242,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2659,14 +3280,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2688,7 +3309,6 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2713,21 +3333,21 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -2738,19 +3358,28 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + || toupper (i) != TOUPPER (i)) + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2763,12 +3392,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -2778,100 +3409,181 @@ _ACEOF fi -# -camlidldir="" -camlidllibdir="" -ffcalldir="" -ffcallarchive="" -libpcapdir="" -cp4flag="" -# - -# Check whether --enable-examples or --disable-examples was given. -if test "${enable_examples+set}" = set; then - enableval="$enable_examples" +# Extract the first word of "ocamlc", so it can be a program name with args. +set dummy ocamlc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - enable_examples="no" -fi; - -# -{ echo "$as_me:$LINENO: checking libraries..." >&5 -echo "$as_me: checking libraries..." >&6;} - -#AC_CHECKING(for pcap library) -#if test "$ac_cv_lib_pcap" == "no"; then -# #dirs="/usr/local/lib -# # /usr/local/lib -# # /usr/lib -# # /lib" -# dirs="/home/x25/code/MLpcap/libpcap-0.8.3" -# for d in $dirs; do -# test -f "$d/libpcap.a" && LDFLAGS="-L$d" -# done -# AC_CHECKING(in more locations) -# unset ac_cv_lib_pcap -#fi - -if test "x$enable_examples" = "xyes"; then - - -# Check whether --with-camlidl-lib or --without-camlidl-lib was given. -if test "${with_camlidl_lib+set}" = set; then - withval="$with_camlidl_lib" - - camlidllibdir=$withval - if ! test -f "$camlidllibdir/libcamlidl.a"; then - { { echo "$as_me:$LINENO: error: can't find libcamlidl.a in $camlidllibdir" >&5 -echo "$as_me: error: can't find libcamlidl.a in $camlidllibdir" >&2;} - { (exit 1); exit 1; }; } - fi - + if test -n "$ocamlc"; then + ac_cv_prog_ocamlc="$ocamlc" # Let the user override the test. else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlc="ocamlc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - { { echo "$as_me:$LINENO: error: missing --with-camlidl-lib" >&5 -echo "$as_me: error: missing --with-camlidl-lib" >&2;} - { (exit 1); exit 1; }; } - -fi; - -{ echo "$as_me:$LINENO: checking for ffcall callback library..." >&5 -echo "$as_me: checking for ffcall callback library..." >&6;} - dirs="/usr/local/lib - /usr/lib - /lib" - for d in $dirs; do - test -f "$d/libcallback.a" && ffcallarchive="$d/libcallback.a" - done + test -z "$ac_cv_prog_ocamlc" && ac_cv_prog_ocamlc="no" +fi +fi +ocamlc=$ac_cv_prog_ocamlc +if test -n "$ocamlc"; then + { echo "$as_me:$LINENO: result: $ocamlc" >&5 +echo "${ECHO_T}$ocamlc" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -# Check whether --with-libpcap or --without-libpcap was given. -if test "${with_libpcap+set}" = set; then - withval="$with_libpcap" - - libpcapdir=$withval - if ! test -f "$libpcapdir/libpcap.a"; then - { { echo "$as_me:$LINENO: error: can't find libpcap.a in $libpcapdir" >&5 -echo "$as_me: error: can't find libpcap.a in $libpcapdir" >&2;} +if test "x$ocamlc" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlc." >&5 +echo "$as_me: error: Cannot find ocamlc." >&2;} { (exit 1); exit 1; }; } - fi - - # check for libpcap >=0.8, set CFLAGS and camlp4 flag - `which strings` "$libpcapdir/libpcap.a"|grep to_descr 2>&1 >/dev/null - test $? && CFLAGS="$CFLAGS -DHAVE_PCAP08" && cp4flag="HAVE_PCAP08" - -else - - #AC_MSG_ERROR(missing --with-libpcap) - # try the default - libpcapdir="/usr/lib" +fi -fi; +# Extract the first word of "ocamlopt", so it can be a program name with args. +set dummy ocamlopt; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ocamlopt"; then + ac_cv_prog_ocamlopt="$ocamlopt" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlopt="ocamlopt" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS +fi +fi +ocamlopt=$ac_cv_prog_ocamlopt +if test -n "$ocamlopt"; then + { echo "$as_me:$LINENO: result: $ocamlopt" >&5 +echo "${ECHO_T}$ocamlopt" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$ocamlopt" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlopt." >&5 +echo "$as_me: error: Cannot find ocamlopt." >&2;} + { (exit 1); exit 1; }; } +fi + +# Extract the first word of "ocamlfind", so it can be a program name with args. +set dummy ocamlfind; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlfind+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ocamlfind"; then + ac_cv_prog_ocamlfind="$ocamlfind" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlfind="ocamlfind" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ocamlfind=$ac_cv_prog_ocamlfind +if test -n "$ocamlfind"; then + { echo "$as_me:$LINENO: result: $ocamlfind" >&5 +echo "${ECHO_T}$ocamlfind" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$ocamlfind" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlfind." >&5 +echo "$as_me: error: Cannot find ocamlfind." >&2;} + { (exit 1); exit 1; }; } +fi + + +# Extract the first word of "camlidl", so it can be a program name with args. +set dummy camlidl; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_camlidl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$camlidl"; then + ac_cv_prog_camlidl="$camlidl" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_camlidl="camlidl" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +camlidl=$ac_cv_prog_camlidl +if test -n "$camlidl"; then + { echo "$as_me:$LINENO: result: $camlidl" >&5 +echo "${ECHO_T}$camlidl" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$camlidl" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find camlidl." >&5 +echo "$as_me: error: Cannot find camlidl." >&2;} + { (exit 1); exit 1; }; } +fi -{ echo "$as_me:$LINENO: checking for pcap header files..." >&5 -echo "$as_me: checking for pcap header files..." >&6;} # On IRIX 5.3, sys/types and inttypes.h are conflicting. @@ -2884,16 +3596,15 @@ echo "$as_me: checking for pcap header files..." >&6;} for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2904,14 +3615,36 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2920,12 +3653,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -2936,44 +3671,58 @@ fi done - -# Check whether --with-pcap-header or --without-pcap-header was given. -if test "${with_pcap_header+set}" = set; then - withval="$with_pcap_header" - - pcapheaderdir=$withval - as_ac_Header=`echo "ac_cv_header_$pcapheaderdir/pcap.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $pcapheaderdir/pcap.h" >&5 -echo $ECHO_N "checking for $pcapheaderdir/pcap.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then + { echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 +echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6; } +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 +echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $pcapheaderdir/pcap.h usability" >&5 -echo $ECHO_N "checking $pcapheaderdir/pcap.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking caml/camlidlruntime.h usability" >&5 +echo $ECHO_N "checking caml/camlidlruntime.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$pcapheaderdir/pcap.h> +#include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2982,26 +3731,31 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $pcapheaderdir/pcap.h presence" >&5 -echo $ECHO_N "checking $pcapheaderdir/pcap.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking caml/camlidlruntime.h presence" >&5 +echo $ECHO_N "checking caml/camlidlruntime.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$pcapheaderdir/pcap.h> +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3010,6 +3764,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3024,383 +3779,294 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for $pcapheaderdir/pcap.h" >&5 -echo $ECHO_N "checking for $pcapheaderdir/pcap.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 +echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6; } +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + ac_cv_header_caml_camlidlruntime_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 +echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$pcapheaderdir"; HAVE_PCAP_HEADER="yes" +if test $ac_cv_header_caml_camlidlruntime_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: can't find camlidlruntime.h" >&5 +echo "$as_me: error: can't find camlidlruntime.h" >&2;} + { (exit 1); exit 1; }; } fi -else - if test "${ac_cv_header_pcap_h+set}" = set; then - echo "$as_me:$LINENO: checking for pcap.h" >&5 -echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6 -if test "${ac_cv_header_pcap_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for pcap_datalink_val_to_description in -lpcap" >&5 +echo $ECHO_N "checking for pcap_datalink_val_to_description in -lpcap... $ECHO_C" >&6; } +if test "${ac_cv_lib_pcap_pcap_datalink_val_to_description+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 -echo "${ECHO_T}$ac_cv_header_pcap_h" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking pcap.h usability" >&5 -echo $ECHO_N "checking pcap.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcap_datalink_val_to_description (); +int +main () +{ +return pcap_datalink_val_to_description (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking pcap.h presence" >&5 -echo $ECHO_N "checking pcap.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + (exit $ac_status); }; }; then + ac_cv_lib_pcap_pcap_datalink_val_to_description=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: pcap.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: pcap.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: pcap.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for pcap.h" >&5 -echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6 -if test "${ac_cv_header_pcap_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_pcap_h=$ac_header_preproc + ac_cv_lib_pcap_pcap_datalink_val_to_description=no fi -echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 -echo "${ECHO_T}$ac_cv_header_pcap_h" >&6 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test $ac_cv_header_pcap_h = yes; then - HAVE_PCAP_HEADER="yes" -fi - - - -fi; +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcap_pcap_datalink_val_to_description" >&5 +echo "${ECHO_T}$ac_cv_lib_pcap_pcap_datalink_val_to_description" >&6; } +if test $ac_cv_lib_pcap_pcap_datalink_val_to_description = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_PCAP08 1 +_ACEOF -if test -z "$HAVE_PCAP_HEADER"; then - { { echo "$as_me:$LINENO: error: can't find pcap.h" >&5 -echo "$as_me: error: can't find pcap.h" >&2;} - { (exit 1); exit 1; }; } + cp4flag="-DHAVE_PCAP08" + LIBS="-lpcap $LIBS" fi -{ echo "$as_me:$LINENO: checking for camlidl header..." >&5 -echo "$as_me: checking for camlidl header..." >&6;} - -# Check whether --with-camlidl or --without-camlidl was given. -if test "${with_camlidl+set}" = set; then - withval="$with_camlidl" +if test "x$cp4flag" = "x"; then - camlidldir=$withval - as_ac_Header=`echo "ac_cv_header_$camlidldir/caml/camlidlruntime.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $camlidldir/caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for $camlidldir/caml/camlidlruntime.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for pcap_open_live in -lpcap" >&5 +echo $ECHO_N "checking for pcap_open_live in -lpcap... $ECHO_C" >&6; } +if test "${ac_cv_lib_pcap_pcap_open_live+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $camlidldir/caml/camlidlruntime.h usability" >&5 -echo $ECHO_N "checking $camlidldir/caml/camlidlruntime.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$camlidldir/caml/camlidlruntime.h> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcap_open_live (); +int +main () +{ +return pcap_open_live (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_pcap_pcap_open_live=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_cv_lib_pcap_pcap_open_live=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $camlidldir/caml/camlidlruntime.h presence" >&5 -echo $ECHO_N "checking $camlidldir/caml/camlidlruntime.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$camlidldir/caml/camlidlruntime.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcap_pcap_open_live" >&5 +echo "${ECHO_T}$ac_cv_lib_pcap_pcap_open_live" >&6; } +if test $ac_cv_lib_pcap_pcap_open_live = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPCAP 1 +_ACEOF - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 + LIBS="-lpcap $LIBS" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $camlidldir/caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for $camlidldir/caml/camlidlruntime.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + { { echo "$as_me:$LINENO: error: can't find pcap library." >&5 +echo "$as_me: error: can't find pcap library." >&2;} + { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$camlidldir"; HAVE_CAMLIDLRUNTIME_H="yes" -fi -else - if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then - echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6 -if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then +if test "${ac_cv_header_pcap_h+set}" = set; then + { echo "$as_me:$LINENO: checking for pcap.h" >&5 +echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pcap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 -echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 +echo "${ECHO_T}$ac_cv_header_pcap_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking caml/camlidlruntime.h usability" >&5 -echo $ECHO_N "checking caml/camlidlruntime.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pcap.h usability" >&5 +echo $ECHO_N "checking pcap.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3409,26 +4075,31 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking caml/camlidlruntime.h presence" >&5 -echo $ECHO_N "checking caml/camlidlruntime.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pcap.h presence" >&5 +echo $ECHO_N "checking pcap.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3437,6 +4108,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3451,229 +4123,164 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pcap.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: pcap.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pcap.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pcap.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pcap.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pcap.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pcap.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6 -if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for pcap.h" >&5 +echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pcap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_caml_camlidlruntime_h=$ac_header_preproc + ac_cv_header_pcap_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 -echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 +echo "${ECHO_T}$ac_cv_header_pcap_h" >&6; } fi -if test $ac_cv_header_caml_camlidlruntime_h = yes; then - HAVE_CAMLIDLRUNTIME_H="yes" -fi - - - -fi; - -if test -z "$HAVE_CAMLIDLRUNTIME_H"; then - { { echo "$as_me:$LINENO: error: can't find camlidlruntime.h" >&5 -echo "$as_me: error: can't find camlidlruntime.h" >&2;} +if test $ac_cv_header_pcap_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: can't find pcap.h" >&5 +echo "$as_me: error: can't find pcap.h" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking for ffcall callback header..." >&5 -echo "$as_me: checking for ffcall callback header..." >&6;} -# Check whether --with-ffcall or --without-ffcall was given. -if test "${with_ffcall+set}" = set; then - withval="$with_ffcall" - ffcalldir=$withval - as_ac_Header=`echo "ac_cv_header_$ffcalldir/callback.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ffcalldir/callback.h" >&5 -echo $ECHO_N "checking for $ffcalldir/callback.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then + +{ echo "$as_me:$LINENO: checking for alloc_trampoline_r in -lcallback" >&5 +echo $ECHO_N "checking for alloc_trampoline_r in -lcallback... $ECHO_C" >&6; } +if test "${ac_cv_lib_callback_alloc_trampoline_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ffcalldir/callback.h usability" >&5 -echo $ECHO_N "checking $ffcalldir/callback.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcallback $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ffcalldir/callback.h> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char alloc_trampoline_r (); +int +main () +{ +return alloc_trampoline_r (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_callback_alloc_trampoline_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_cv_lib_callback_alloc_trampoline_r=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $ffcalldir/callback.h presence" >&5 -echo $ECHO_N "checking $ffcalldir/callback.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ffcalldir/callback.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_callback_alloc_trampoline_r" >&5 +echo "${ECHO_T}$ac_cv_lib_callback_alloc_trampoline_r" >&6; } +if test $ac_cv_lib_callback_alloc_trampoline_r = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCALLBACK 1 +_ACEOF - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 + LIBS="-lcallback $LIBS" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ffcalldir/callback.h" >&5 -echo $ECHO_N "checking for $ffcalldir/callback.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$ffcalldir"; HAVE_CALLBACK_H="yes" + { { echo "$as_me:$LINENO: error: can't find callback library." >&5 +echo "$as_me: error: can't find callback library." >&2;} + { (exit 1); exit 1; }; } fi -else - - if test "${ac_cv_header_callback_h+set}" = set; then - echo "$as_me:$LINENO: checking for callback.h" >&5 -echo $ECHO_N "checking for callback.h... $ECHO_C" >&6 +if test "${ac_cv_header_callback_h+set}" = set; then + { echo "$as_me:$LINENO: checking for callback.h" >&5 +echo $ECHO_N "checking for callback.h... $ECHO_C" >&6; } if test "${ac_cv_header_callback_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 -echo "${ECHO_T}$ac_cv_header_callback_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 +echo "${ECHO_T}$ac_cv_header_callback_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking callback.h usability" >&5 -echo $ECHO_N "checking callback.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking callback.h usability" >&5 +echo $ECHO_N "checking callback.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3683,14 +4290,36 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3699,17 +4328,17 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking callback.h presence" >&5 -echo $ECHO_N "checking callback.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking callback.h presence" >&5 +echo $ECHO_N "checking callback.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3717,8 +4346,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3727,6 +4361,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3741,82 +4376,53 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: callback.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: callback.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: callback.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: callback.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: callback.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: callback.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: callback.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: callback.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: callback.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: callback.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: callback.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: callback.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for callback.h" >&5 -echo $ECHO_N "checking for callback.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for callback.h" >&5 +echo $ECHO_N "checking for callback.h... $ECHO_C" >&6; } if test "${ac_cv_header_callback_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_callback_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 -echo "${ECHO_T}$ac_cv_header_callback_h" >&6 - -fi -if test $ac_cv_header_callback_h = yes; then - HAVE_CALLBACK_H="yes" -fi - - - -fi; - -if test -z "$HAVE_CALLBACK_H"; then - { { echo "$as_me:$LINENO: error: can't find callback.h" >&5 -echo "$as_me: error: can't find callback.h" >&2;} - { (exit 1); exit 1; }; } -fi - - - +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 +echo "${ECHO_T}$ac_cv_header_callback_h" >&6; } +fi -if test "x$enable_examples" = "xyes"; then - output="Makefile tests/Makefile" -else - output="Makefile" -fi +ac_config_files="$ac_config_files Makefile tests/Makefile" - ac_config_files="$ac_config_files $output" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -3835,39 +4441,58 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -3876,63 +4501,48 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, +# take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF +ac_script=' t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -3970,20 +4580,80 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -3994,21 +4664,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -4016,200 +4687,157 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi +# CDPATH. +$as_unset CDPATH - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.60a. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4217,30 +4845,18 @@ generated by GNU Autoconf 2.57. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -4248,31 +4864,32 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.60a, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -4283,60 +4900,42 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -4352,28 +4951,43 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 - - - +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "$output" ) CONFIG_FILES="$CONFIG_FILES $output" ;; + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -4383,277 +4997,374 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@VERSION@,$VERSION,;t t -s,@ARCH@,$ARCH,;t t -s,@ocamlc@,$ocamlc,;t t -s,@ocamlopt@,$ocamlopt,;t t -s,@ocamlfind@,$ocamlfind,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@INSTALL@,$INSTALL,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@camlidldir@,$camlidldir,;t t -s,@camlidllibdir@,$camlidllibdir,;t t -s,@ffcalldir@,$ffcalldir,;t t -s,@ffcallarchive@,$ffcallarchive,;t t -s,@libpcapdir@,$libpcapdir,;t t -s,@cp4flag@,$cp4flag,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +VERSION!$VERSION$ac_delim +ARCH!$ARCH$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +INSTALL!$INSTALL$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ocamlc!$ocamlc$ac_delim +ocamlopt!$ocamlopt$ac_delim +ocamlfind!$ocamlfind$ac_delim +camlidl!$camlidl$ac_delim +cp4flag!$cp4flag$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 60; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -4661,29 +5372,40 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + + esac + +done # for ac_tag + { (exit 0); exit 0; } _ACEOF -- cgit v1.2.3 From 0e63ded0dd9cb3b7cbba2f0b993511e8a5ccfc90 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 24 Jul 2020 13:19:05 +0200 Subject: Use ocamlfind to compile the project Gbp-Pq: Name 02_ocamlfind_for_example.diff --- tests/Makefile.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.in b/tests/Makefile.in index 9c3b4ab..316060f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,4 +1,3 @@ -OCAMLC=ocamlc CAMLP4O=camlp4o OBJECTS = misc.cmo pcap_next.cmo pcap_loop.cmo \ @@ -12,7 +11,7 @@ pcap_open_offline all: $(TARGETS) $(TARGETS): $(OBJECTS) - $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma + ocamlfind ocamlc -package pcap -linkpkg -o $@ $@.cmo clean: rm -f *.cmo *.cmi $(TARGETS) @@ -20,5 +19,5 @@ clean: .SUFFIXES: .ml .cmo .cmi .ml.cmo: - $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -I .. -c $< + ocamlfind ocamlc -package pcap -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -c $< -- cgit v1.2.3 From c1ef1d710e880ddf5506b666ef6c2f3513adce22 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 24 Jul 2020 13:19:05 +0200 Subject: Fix META file Gbp-Pq: Name 03_correct_META.diff --- META | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/META b/META index cf95b64..c787ef1 100644 --- a/META +++ b/META @@ -1,7 +1,6 @@ name="pcap" -version="0.8" +version="0.9" description="Ocaml bindings to libpcap" requires="" archive(byte) = "pcap.cma" -archive(opt) = "pcap.cmxa" -linkopts = "-cclib -lpcap -cclib -lcallback" +archive(native) = "pcap.cmxa" -- cgit v1.2.3 From 593812eb313f545269062a60f20993a3ba6be390 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 24 Jul 2020 13:19:05 +0200 Subject: Use system's libcamlidl.a Gbp-Pq: Name 07_dll_with_camlidl.diff --- OCamlMakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OCamlMakefile b/OCamlMakefile index 0d20314..eed3443 100644 --- a/OCamlMakefile +++ b/OCamlMakefile @@ -774,7 +774,7 @@ endif ifndef MSVC $(DLLSONAME): $(OBJ_LINK) $(CC) -shared $(CINCFLAGS) $(CLIBFLAGS) \ - -o $@ $(OBJ_LINK) $(CLIBS:%=-l%) + -o $@ $(OBJ_LINK) $(shell ocamlc -where)/libcamlidl.a $(CLIBS:%=-l%) endif $(RESULT).cma: $(REAL_IMPL_INTF) $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS) -- cgit v1.2.3 From ed4b118300e359f3a008650914756a7ae6725575 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Fri, 24 Jul 2020 13:19:05 +0200 Subject: Fix detection of callback library Forwarded: no Last-Update: 2017-11-09 The callback library is now embedded in libffcall, and the symbol names have changed, hence fix the configure test. Last-Update: 2017-11-09 Gbp-Pq: Name 08_ffcall.diff --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 0ace885..ffcc4d1 100644 --- a/configure.in +++ b/configure.in @@ -77,9 +77,9 @@ dnl --------------- dnl Ffcall callback dnl --------------- -AC_CHECK_LIB(callback, - alloc_trampoline_r,, - AC_MSG_ERROR([can't find callback library.])) +AC_CHECK_LIB(ffcall, + callback_trampoline_alloc,, + AC_MSG_ERROR([can't find ffcall library.])) dnl Header -- cgit v1.2.3 From 97c726c115cc2ab8958799738bb40b731804ba73 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 13 Oct 2020 13:00:43 +0200 Subject: shtool Gbp-Pq: Name 04_shtool.diff --- etc/shtool | 3248 ++++++++++++++++++++---------------------------------------- 1 file changed, 1098 insertions(+), 2150 deletions(-) diff --git a/etc/shtool b/etc/shtool index 0b71ff7..c41f19f 100755 --- a/etc/shtool +++ b/etc/shtool @@ -1,12 +1,13 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-1999 Ralf S. Engelschall +## Copyright (c) 1994-2004 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.0 (02-Jul-1999) +## Version: 2.0.1 (11-Aug-2004) +## Contents: 3/19 available modules ## ## @@ -25,7 +26,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## -## Notice: Given that you include this file verbatim into your own +## NOTICE: Given that you include this file verbatim into your own ## source tree, you are justified in saying that it remains separate ## from your package, and that this way you are simply just using GNU ## shtool. So, in this situation, there is no requirement that your @@ -37,68 +38,127 @@ ## Usage: shtool [] [ [] []] ## ## Available commands: +## install Install a program, script or datafile +## platform Platform Identification Utility +## version Maintain a version information file +## +## Not available commands (because module was not built-in): ## echo Print string with optional construct expansion ## mdate Pretty-print modification time of a file or dir -## table Pretty print a field-sperarated list as a table +## table Pretty-print a field-separated list as a table ## prop Display progress with a running propeller -## move Move files with simultan substitution -## install Install a program, script or datafile +## move Move files with simultaneous substitution ## mkdir Make one or more directories ## mkln Make link with calculation of relative paths -## mkshadow Make a shadow tree +## mkshadow Make a shadow tree through symbolic links ## fixperm Fix file permissions inside a source tree -## guessos Simple OS/platform guesser +## rotate Logfile rotation +## tarball Roll distribution tarballs +## subst Apply sed(1) substitution operations ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor -## version Generate and maintain a version information file ## path Deal with program paths ## if [ $# -eq 0 ]; then - echo "$0:ERROR: invalid command line" 1>&2 - echo "$0:HINT: run \`$0 -h' for usage" 1>&2 + echo "$0:Error: invalid command line" 1>&2 + echo "$0:Hint: run \`$0 -h' for usage" 1>&2 exit 1 fi -if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is shtool, version 1.4.0 (02-Jul-1999)" - echo "Copyright (c) 1994-1999 Ralf S. Engelschall " +if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then + echo "This is GNU shtool, version 2.0.1 (11-Aug-2004)" + echo "Copyright (c) 1994-2004 Ralf S. Engelschall " + echo "Report bugs to " echo '' - echo "Usage: shtool [] [ [] []]" + echo "Usage: shtool [] [ [] []]" echo '' echo 'Available global :' echo ' -v, --version display shtool version information' echo ' -h, --help display shtool usage help page (this one)' + echo ' -d, --debug display shell trace information' + echo ' -r, --recreate recreate this shtool script via shtoolize' echo '' echo 'Available [] []:' - echo ' echo [-n] [-e] [ ...]' - echo ' mdate [-n] [-z] [-s] [-d] [-f] [-o] ' - echo ' table [-F] [-w] [-c] [-s] ...' - echo ' prop [-p]' - echo ' move [-v] [-t] [-e] [-p] ' - echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] ' - echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' - echo ' mkln [-t] [-f] [-s] [ ...] ' - echo ' mkshadow [-v] [-t] [-a] ' - echo ' fixperm [-v] [-t] [ ...]' - echo ' guessos ' - echo ' arx [-t] [-C] [ ...]' - echo ' slo -- -L -l [ -L -l ... ]' - echo ' scpp [-v] [-p] [-o] [-t] [-M] [-D]' - echo ' [-C] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' - echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' + echo ' install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]' + echo ' [-C|--compare-copy] [-s|--strip] [-m|--mode ]' + echo ' [-o|--owner ] [-g|--group ] [-e|--exec' + echo ' ] [ ...] ' + echo ' platform [-F|--format ] [-S|--sep ] [-C|--conc' + echo ' ] [-L|--lower] [-U|--upper] [-v|--verbose]' + echo ' [-c|--concise] [-n|--no-newline] [-t|--type ]' + echo ' [-V|--version] [-h|--help]' + echo ' version [-l|--language ] [-n|--name ] [-p|--prefix' + echo ' ] [-s|--set ] [-e|--edit] [-i|--increase' + echo ' ] [-d|--display ] ' + echo '' + echo 'Not available (because module was not built-in):' + echo ' echo [-n|--newline] [-e|--expand] [ ...]' + echo ' mdate [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]' + echo ' [-f|--field-sep ] [-o|--order ] ' + echo ' table [-F|--field-sep ] [-w|--width ] [-c|--columns' + echo ' ] [-s|--strip ] ...' + echo ' prop [-p|--prefix ]' + echo ' move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]' + echo ' ' + echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] ' + echo ' [ ...]' + echo ' mkln [-t|--trace] [-f|--force] [-s|--symbolic] ' + echo ' [ ...] ' + echo ' mkshadow [-v|--verbose] [-t|--trace] [-a|--all] ' + echo ' fixperm [-v|--verbose] [-t|--trace] [ ...]' + echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files' + echo ' ] [-s|--size ] [-c|--copy] [-r|--remove]' + echo ' [-a|--archive-dir ] [-z|--compress [:]]' + echo ' [-b|--background] [-d|--delay] [-p|--pad ] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] [-M|--migrate' + echo ' ] [-P|--prolog ] [-E|--epilog ] [...]' + echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output ]' + echo ' [-c|--compress ] [-d|--directory ] [-u|--user' + echo ' ] [-g|--group ] [-e|--exclude ]' + echo ' [ ...]' + echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]' + echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup' + echo ' ] [-e|--exec ] [-f|--file ] []' + echo ' [...]' + echo ' arx [-t|--trace] [-C|--command ] [' + echo ' ...]' + echo ' slo [-p|--prefix ] -- -L -l [-L -l' + echo ' ...]' + echo ' scpp [-v|--verbose] [-p|--preserve] [-f|--filter ]' + echo ' [-o|--output ] [-t|--template ] [-M|--mark' + echo ' ] [-D|--define ] [-C|--class ]' + echo ' [ ...]' + echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]' + echo ' [-m|--magic] [-p|--path ] [ ...]' echo '' exit 0 fi -if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "shtool 1.4.0 (02-Jul-1999)" +if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then + echo "GNU shtool 2.0.1 (11-Aug-2004)" exit 0 fi -tool="$1" -shift +if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then + shtoolize -oetc/shtool install platform version + exit 0 +fi +if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then + shift + set -x +fi +name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` +case "$name" in + install|platform|version ) + # implicit tool command selection + tool="$name" + ;; + * ) + # explicit tool command selection + tool="$1" + shift + ;; +esac arg_spec="" opt_spec="" gen_tmpfile=no @@ -108,128 +168,63 @@ gen_tmpfile=no ## case $tool in - echo ) - str_tool="echo" - str_usage="[-n] [-e] [ ...]" - arg_spec="0+" - opt_spec="ne" - ;; - mdate ) - str_tool="mdate" - str_usage="[-n] [-z] [-s] [-d] [-f] [-o] " - arg_spec="1" - opt_spec="nzsdf:!o:!" - opt_f=" " - opt_o="dmy" - ;; - table ) - str_tool="table" - str_usage="[-F] [-w] [-c] [-s] ..." - arg_spec="1+" - opt_spec="F:!w:!c:!s:!" - opt_F=":" - opt_w=15 - opt_c=3 - opt_s=79 - ;; - prop ) - str_tool="prop" - str_usage="[-p]" - arg_spec="0" - opt_spec="p:" - ;; - move ) - str_tool="move" - str_usage="[-v] [-t] [-e] [-p] " - arg_spec="2" - opt_spec="vtep" - ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] " - arg_spec="2" - opt_spec="vtcCsm:o:g:e:" - ;; - mkdir ) - str_tool="mkdir" - str_usage="[-t] [-f] [-p] [-m] [ ...]" - arg_spec="1+" - opt_spec="tfpm:" - ;; - mkln ) - str_tool="mkln" - str_usage="[-t] [-f] [-s] [ ...] " - arg_spec="2+" - opt_spec="tfs" - ;; - mkshadow ) - str_tool="mkshadow" - str_usage="[-v] [-t] [-a] " - arg_spec="2" - opt_spec="vta" - ;; - fixperm ) - str_tool="fixperm" - str_usage="[-v] [-t] [ ...]" - gen_tmpfile=yes + str_usage="[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode ] [-o|--owner ] [-g|--group ] [-e|--exec ] [ ...] " arg_spec="1+" - opt_spec="vt" + opt_spec="v.t.d.c.C.s.m:o:g:e+" + opt_alias="v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec" + opt_v=no + opt_t=no + opt_d=no + opt_c=no + opt_C=no + opt_s=no + opt_m="0755" + opt_o="" + opt_g="" + opt_e="" ;; - guessos ) - str_tool="guessos" - str_usage="" - arg_spec="0" - opt_spec="" - ;; - arx ) - str_tool="arx" - str_usage="[-t] [-C] [ ...]" - arg_spec="2+" - opt_spec="tC:!" - opt_C="ar" - ;; - slo ) - str_tool="slo" - str_usage="-- -L -l [ -L -l ... ]" - arg_spec="1+" - opt_spec="" - ;; - scpp ) - str_tool="scpp" - str_usage="[-v] [-p] [-o] [-t] [-M] [-D] [-C] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="vpo:!t:!M:!D:!C:!" - opt_o="lib.h" - opt_t="lib.h.in" - opt_M="%%MARK%%" - opt_D="cpp" - opt_C="intern" + platform ) + str_tool="platform" + str_usage="[-F|--format ] [-S|--sep ] [-C|--conc ] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type ] [-V|--version] [-h|--help]" + arg_spec="0=" + opt_spec="F:S:C:L.U.v.c.n.t:d.V.h." + opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help" + opt_F="%{sp} (%{ap})" + opt_S=" " + opt_C="/" + opt_L=no + opt_U=no + opt_t="" + opt_v=no + opt_c=no + opt_n=no + opt_V=no + opt_h=no ;; version ) str_tool="version" - str_usage="[-l] [-n] [-p] [-s] [-i] [-d] " - arg_spec="1+" - opt_spec="l:!n:!p:!s:!i:!d:!" + str_usage="[-l|--language ] [-n|--name ] [-p|--prefix ] [-s|--set ] [-e|--edit] [-i|--increase ] [-d|--display ] " + arg_spec="1=" + opt_spec="l:n:p:s:i:e.d:" + opt_alias="l:language,n:name,p:prefix,s:set,e:edit,i:increase,d:display" opt_l="txt" opt_n="unknown" - opt_p="unknown" - opt_s="unknown" - opt_i="P" - opt_d="NO" - gen_tmpfile=yes + opt_p="" + opt_s="" + opt_e="no" + opt_i="" + opt_d="short" ;; - path ) - str_tool="path" - str_usage="[-s] [-r] [-d] [-b] [-m] [-p] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="srdbmp:!" - opt_p="$PATH" + -* ) + echo "$0:Error: unknown option \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 ;; * ) - echo "$0:ERROR: unknown command \`$tool'" 2>&1 - echo "$0:HINT: run \`$0 -h' for usage" 2>&1 + echo "$0:Error: unknown command \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 exit 1 ;; esac @@ -238,36 +233,35 @@ esac ## COMMON UTILITY CODE ## +# commonly used ASCII values +ASC_TAB=" " +ASC_NL=" +" + # determine name of tool if [ ".$tool" != . ]; then - # inside shtool + # used inside shtool script toolcmd="$0 $tool" + toolcmdhelp="shtool $tool" msgprefix="shtool:$tool" else - # standalone + # used as standalone script toolcmd="$0" + toolcmdhelp="sh $0" msgprefix="$str_tool" fi # parse argument specification string -eval `echo $arg_spec | sed -e 's/^\([0-9]*\)\(.*\)/arg_NUMS="\1"; arg_MODE="\2"/'` -test ".$arg_MODE" = . && arg_MODE="=" +eval `echo $arg_spec |\ + sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` # parse option specification string -for opt in `echo "h$opt_spec" | sed -e 's/\([a-zA-Z0-9][!:+]*\)/\1 /g'`; do - opt_MODE="."; opt_INIT="." - eval `echo $opt |\ - sed -e 's/^\([a-zA-Z0-9]\)/opt_THIS="\1";/' \ - -e 's/";\([:+]\)/"; opt_MODE="\1";/' \ - -e 's/";\(!\)/"; opt_INIT="\1"/'` - eval "opt_MODE_${opt_THIS}=${opt_MODE}" - if [ ".$opt_INIT" != ".!" ]; then - case "$opt_MODE" in - "." ) eval "opt_${opt_THIS}=no" ;; - ":"|"+" ) eval "opt_${opt_THIS}=\"\"" ;; - esac - fi -done +eval `echo h.$opt_spec |\ + sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` + +# parse option alias string +eval `echo h:help,$opt_alias |\ + sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'` # interate over argument line opt_PREV='' @@ -285,18 +279,29 @@ while [ $# -gt 0 ]; do opt_OPT="$opt_PREV" opt_ARG="$1" opt_ARG_OK=yes - opt_PREV="" + opt_PREV='' else # split argument into option and argument case "$1" in + --[a-zA-Z0-9]*=*) + eval `echo "x$1" |\ + sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + ;; + --[a-zA-Z0-9]*) + opt_OPT=`echo "x$1" | cut -c4-` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + opt_ARG='' + ;; -[a-zA-Z0-9]*) eval `echo "x$1" |\ sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ -e 's/";\(.*\)$/"; opt_ARG="\1"/'` ;; -[a-zA-Z0-9]) - opt_OPT=`awk 'BEGIN { printf("%s", substr(OPT, 2)); }' \ - "OPT=$1" &2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 exit 1 ;; esac done if [ ".$opt_PREV" != . ]; then - echo "$msgprefix:ERROR: missing argument to option \`-$opt_PREV'" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 exit 1 fi # process help option -if [ .$opt_h = .yes ]; then - echo "Usage: $toolcmd $str_usage" +if [ ".$opt_h" = .yes ]; then + echo "Usage: $toolcmdhelp $str_usage" exit 0 fi # complain about incorrect number of arguments case $arg_MODE in - "=" ) + '=' ) if [ $# -ne $arg_NUMS ]; then - echo "$msgprefix:ERROR: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; - "+" ) + '+' ) if [ $# -lt $arg_NUMS ]; then - echo "$msgprefix:ERROR: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; @@ -370,1827 +375,849 @@ esac # establish a temporary file on request if [ ".$gen_tmpfile" = .yes ]; then - tmpdir="/tmp" if [ ".$TMPDIR" != . ]; then tmpdir="$TMPDIR" + elif [ ".$TEMPDIR" != . ]; then + tmpdir="$TEMPDIR" else - if [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - fi + tmpdir="/tmp" + fi + if mkdir "$tmpdir/.shtool.$$"; then + tmpfile="$tmpdir/.shtool.$$/shtool.tmp" + else + echo "$msgprefix:Error: failed to create temporary file" 1>&2 + exit 1 fi - tmpfile="$tmpdir/.shtool.$$" + tmpfile="$tmpdir/.shtool.$$/shtool.tmp" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi +# utility function: map string to lower case +util_lower () { + echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' +} + +# utility function: map string to upper case +util_upper () { + echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +} + +# cleanup procedure +shtool_exit () { + rc="$1" + if [ ".$gen_tmpfile" = .yes ]; then + rm -fr "$tmpdir/.shtool.$$" >/dev/null 2>&1 || true + fi + exit $rc +} + ## ## DISPATCH INTO SCRIPT BODY ## case $tool in -echo ) +install ) ## - ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for WML as buildinfo + ## install -- Install a program, script or datafile + ## Copyright (c) 1997-2004 Ralf S. Engelschall ## - - text="$*" - - # check for broken escape sequence expansion - seo='' - bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" != .3 ]; then - bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - seo='-E' - fi - fi - - # check for existing -n option (to suppress newline) - minusn='' - bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - minusn='-n' - fi - - # determine terminal bold sequence - term_bold='' - term_norm='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then - # the most important terminals we directly know - case $TERM in - xterm|xterm*|vt220|vt220*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` - ;; - vt100|vt100*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` - ;; - esac - # then try a possibly existing "tput" or "tcout" utility - paths=`echo $PATH | sed -e 's/:/ /g'` - for tool in tput tcout; do - for dir in $paths; do - if [ -r "$dir/$tool" ]; then - for seq in bold md smso; do # smso is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" - break - fi - done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done - fi - break - fi - done - if [ ".$term_bold" != . -a ".$term_norm" != . ]; then - break; - fi - done - if [ ".$term_bold" = . -o ".$term_norm" = . ]; then - echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 - fi - fi - - # determine user name - username='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then - username="$LOGNAME" - if [ ".$username" = . ]; then - username="$USER" - if [ ".$username" = . ]; then - username="`(whoami) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username="`(who am i) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username='unknown' - fi - fi - fi - fi - fi - - # determine user id - userid='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then - userid="`(id -u) 2>/dev/null`" - if [ ".$userid" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then - userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*//'` - fi - if [ ".$userid" = . ]; then - userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid=`(ypcat passwd) 2>/dev/null | - egrep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid='?' - fi - fi - fi - fi - fi - - # determine host name - hostname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then - hostname="`(uname -n) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname="`(hostname) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname='unknown' - fi + + # special case: "shtool install -d [...]" internally + # maps to "shtool mkdir -f -p -m 755 [...]" + if [ "$opt_d" = yes ]; then + cmd="$0 mkdir -f -p -m 755" + if [ ".$opt_o" != . ]; then + cmd="$cmd -o '$opt_o'" fi - case $hostname in - *.* ) - domainname=".`echo $hostname | cut -d. -f2-`" - hostname="`echo $hostname | cut -d. -f1`" - ;; - esac - fi - - # determine domain name - domainname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then - if [ ".$domainname" = . ]; then - if [ -f /etc/resolv.conf ]; then - domainname="`egrep '^[ ]*domain' /etc/resolv.conf | head -1 |\ - sed -e 's/.*domain//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - if [ ".$domainname" = . ]; then - domainname="`egrep '^[ ]*search' /etc/resolv.conf | head -1 |\ - sed -e 's/.*search//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/ .*//' -e 's/ .*//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - fi - fi + if [ ".$opt_g" != . ]; then + cmd="$cmd -g '$opt_g'" fi - fi - - # determine current time - time_day='' - time_month='' - time_year='' - time_monthname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then - time_day=`date '+%d'` - time_month=`date '+%m'` - time_year=`date '+%Y' 2>/dev/null` - if [ ".$time_year" = . ]; then - time_year=`date '+%y'` - case $time_year in - [5-9][0-9]) time_year="19$time_year" ;; - [0-4][0-9]) time_year="20$time_year" ;; - esac + if [ ".$opt_v" = .yes ]; then + cmd="$cmd -v" fi - case $time_month in - 1|01) time_monthname='Jan' ;; - 2|02) time_monthname='Feb' ;; - 3|03) time_monthname='Mar' ;; - 4|04) time_monthname='Apr' ;; - 5|05) time_monthname='May' ;; - 6|06) time_monthname='Jun' ;; - 7|07) time_monthname='Jul' ;; - 8|08) time_monthname='Aug' ;; - 9|09) time_monthname='Sep' ;; - 10) time_monthname='Oct' ;; - 11) time_monthname='Nov' ;; - 12) time_monthname='Dec' ;; - esac - fi - - # expand special ``%x'' constructs - if [ ".$opt_e" = .yes ]; then - text=`echo $seo "$text" |\ - sed -e "s/%B/${term_bold}/g" \ - -e "s/%b/${term_norm}/g" \ - -e "s/%u/${username}/g" \ - -e "s/%U/${userid}/g" \ - -e "s/%h/${hostname}/g" \ - -e "s/%d/${domainname}/g" \ - -e "s/%D/${time_day}/g" \ - -e "s/%M/${time_month}/g" \ - -e "s/%Y/${time_year}/g" \ - -e "s/%m/${time_monthname}/g" 2>/dev/null` - fi - - # create output - if [ .$opt_n = .no ]; then - echo $seo $text - else - # the harder part: echo -n is best, because - # awk complains about some \xx sequences. - if [ ".$minusn" != . ]; then - echo $seo $minusn $text - else - echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" + if [ ".$opt_t" = .yes ]; then + cmd="$cmd -t" fi + for dir in "$@"; do + eval "$cmd $dir" || shtool_exit $? + done + shtool_exit 0 fi - ;; -mdate ) - ## - ## mdate -- Pretty-print modification time of a file or dir - ## Copyright (c) 1995-1997 Free Software Foundation, Inc. - ## Originally idea and basis code by Ulrich Drepper - ## Enhanced by Ralf S. Engelschall for shtool - ## - - fod="$1" - case "$opt_o" in - [dmy][dmy][dmy] ) - ;; - * ) echo "$msgprefix:Error: invalid argument to option \`-o': $opt_o" 1>&2 - exit 1 - ;; - esac - if [ ! -r "$fod" ]; then - echo "$msgprefix:Error: file or directory not found: $fod" 1>&2 - exit 1 - fi - - # prevent "date" giving response in another language - LANG=C; export LANG - LC_ALL=C; export LC_ALL - LC_TIME=C; export LC_TIME - - # get the extended ls output of the file or directory. - if ls -L /dev/null >/dev/null 2>&1; then - set - x`ls -L -l -d $fod` - else - set - x`ls -l -d $fod` - fi - - # The month is at least the fourth argument - # (3 shifts here, the next inside the loop). - shift; shift; shift - - # Find the month. Next argument is day, followed by the year or time. - month="" - while [ ".$month" = . ]; do + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" shift - case $1 in - Jan) month=January; nummonth=1 ;; - Feb) month=February; nummonth=2 ;; - Mar) month=March; nummonth=3 ;; - Apr) month=April; nummonth=4 ;; - May) month=May; nummonth=5 ;; - Jun) month=June; nummonth=6 ;; - Jul) month=July; nummonth=7 ;; - Aug) month=August; nummonth=8 ;; - Sep) month=September; nummonth=9 ;; - Oct) month=October; nummonth=10 ;; - Nov) month=November; nummonth=11 ;; - Dec) month=December; nummonth=12 ;; - esac done - day="$2" - year="$3" - - # We finally have to deal with the problem that the "ls" output - # gives either the time of the day or the year. - case $year in - *:*) - this_year=`date '+%Y' 2>/dev/null` - if [ ".$this_year" = . ]; then - this_year=`date '+%y'` - case $this_year in - [5-9][0-9]) this_year="19$this_year" ;; - [0-4][0-9]) this_year="20$this_year" ;; - esac - fi - # for the following months of the last year the time notation - # is usually also used for files modified in the last year. - this_month=`date '+%m'` - if (expr $nummonth \> $this_month) >/dev/null; then - this_year=`expr $this_year - 1` - fi - year="$this_year" - ;; - esac - - # Optionally fill day and month with leeding zeros - if [ ".$opt_z" = .yes ]; then - case $day in - [0-9][0-9] ) ;; - [0-9] ) day="0$day" ;; - esac - case $nummonth in - [0-9][0-9] ) ;; - [0-9] ) nummonth="0$nummonth" ;; - esac - fi - - # Optionally use digits for month - if [ ".$opt_d" = .yes ]; then - month="$nummonth" - fi - - # Optionally shorten the month name to three characters - if [ ".$opt_s" = .yes ]; then - month=`echo $month | cut -c1-3` - fi - - # Output the resulting date string - echo dummy | awk '{ - for (i = 0; i < 3; i++) { - now = substr(order, 1, 1); - order = substr(order, 2); - if (now == "d") - out = day; - else if (now == "m") - out = month; - else if (now == "y") - out = year; - if (i < 2) - printf("%s%s", out, field); - else - printf("%s", out); - } - if (newline != "yes") - printf("\n"); - }' "day=$day" "month=$month" "year=$year" \ - "field=$opt_f" "order=$opt_o" "newline=$opt_n" - ;; + dstpath="$1" -table ) - ## - ## table -- Pretty print a field-sperarated list as a table - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - if [ $opt_c -gt 4 ]; then - echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2 - exit 1 + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 fi - case "x$opt_F" in - x? ) ;; - * ) echo "$msgprefix:Error: Invalid seperator (one char allowed only)" 1>&2; exit 1 ;; - esac - - # split the list into a table - list=` - IFS="$opt_F" - for entry in $*; do - if [ ".$entry" != . ]; then - echo "$entry" - fi - done |\ - awk " - BEGIN { list = \"\"; n = 0; } - { - list = list \\$1; - n = n + 1; - if (n < $opt_c) { - list = list \":\"; - } - if (n == $opt_c) { - list = list \"\\n\"; - n = 0; - } - } - END { print list; } - " - ` - - # format table cells and make sure table - # doesn't exceed maximum width - OIFS="$IFS" - IFS=' -' - for entry in $list; do - case $opt_c in - 1 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s\\n\", \$1); }'" ;; - 2 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s\\n\", \$1, \$2); }'" ;; - 3 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3); }'" ;; - 4 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3, \$4); }'" ;; - esac - done |\ - awk "{ - if (length(\$0) > $opt_s) { - printf(\"%s\\n\", substr(\$0, 0, $opt_s-1)); - } else { - print \$0; - } - }" - IFS="$OIFS" - ;; -prop ) - ## - ## prop -- Display progress with a running propeller - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for mod_ssl - ## - - perl='' - for dir in `echo $PATH | sed -e 's/:/ /g'` .; do - if [ -f "$dir/perl" ]; then - perl="$dir/perl" - break - fi - done - if [ ".$perl" != . ]; then - # Perl is preferred because writing to STDERR in - # Perl really writes immediately as one would expect - $perl -e ' - @p = ("|","/","-","\\"); - $i = 0; - while () { - printf(STDERR "\r%s...%s\b", $ARGV[0], $p[$i++]); - $i = 0 if ($i > 3); - } - printf(STDERR "\r%s \n", $ARGV[0]); - ' "$opt_p" - else - # But when Perl doesn't exists we use Awk even - # some Awk's buffer even the /dev/stderr writing :-( - awk ' - BEGIN { - split("|#/#-#\\", p, "#"); - i = 1; - } - { - printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr"; - if (i > 4) { i = 1; } - } - END { - printf("\r%s \n", prefix) > "/dev/stderr"; - } - ' "prefix=$opt_p" + # consistency check for destination + if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 + shtool_exit 1 fi - ;; -move ) - ## - ## move -- Move files with simultan substitution - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # consistency checks - if [ ".$src" = . -o ".$dst" = . ]; then - echo "$msgprefix:Error: Invalid arguments" 1>&2 - exit 1 - fi - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: Source and destination files are the same" 1>&2 - exit 1 - fi - expsrc="$src" - if [ ".$opt_e" = .yes ]; then - expsrc="`echo $expsrc`" - fi - if [ ".$opt_e" = .yes ]; then - if [ ".`echo "$src" | sed -e 's;^.*\\*.*$;;'`" = ".$src" ]; then - echo "$msgprefix:Error: Source doesn't contain wildcard ('*'): $dst" 1>&2 - exit 1 - fi - if [ ".`echo "$dst" | sed -e 's;^.*%[1-9].*$;;'`" = ".$dst" ]; then - echo "$msgprefix:Error: Destination doesn't contain substitution ('%N'): $dst" 1>&2 - exit 1 - fi - if [ ".$expsrc" = ".$src" ]; then - echo "$msgprefix:Error: Sources not found or no asterisk : $src" 1>&2 - exit 1 + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath + + # if destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" fi - else - if [ ! -r "$src" ]; then - echo "$msgprefix:Error: Source not found: $src" 1>&2 - exit 1 + + # check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue fi - fi - - # determine substitution patterns - if [ ".$opt_e" = .yes ]; then - srcpat=`echo "$src" | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 's;\\*;\\\\(.*\\\\);g'` - dstpat=`echo "$dst" | sed -e 's;%\([1-9]\);\\\\\1;g'` - fi - - # iterate over source(s) - for onesrc in $expsrc; do - if [ .$opt_e = .yes ]; then - onedst=`echo $onesrc | sed -e "s;$srcpat;$dstpat;"` - else - onedst="$dst" + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue fi - errorstatus=0 + + # make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # verbosity if [ ".$opt_v" = .yes ]; then - echo "$onesrc -> $onedst" + echo "$src -> $dst" 1>&2 fi - if [ ".$opt_p" = .yes ]; then - if [ -r $onedst ]; then - if cmp -s $onesrc $onedst; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $onesrc" 1>&2 - fi - rm -f $onesrc || errorstatus=$? - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? - fi - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? + + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes + fi + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 fi + cp $src $dsttmp || shtool_exit $? else if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 + echo "mv $src $dsttmp" 1>&2 fi - mv -f $onesrc $onedst || errorstatus=$? - fi - if [ $errorstatus -ne 0 ]; then - break; + mv $src $dsttmp || shtool_exit $? fi - done - exit $errorstatus - ;; -install ) - ## - ## install -- Install a program, script or datafile - ## Copyright (c) 1997-1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi - - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 - exit 1 - fi - - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#INST@$$#" - - # Verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi - - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 - fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 - fi - mv $src $dsttmp || exit $? - fi - - # Adjust the target file - # (we do chmod last to preserve setuid bits) - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 - fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 - fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS" + for e + do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + chmod u+w $dsttmp + eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $? + rm -f $dsttmp.old fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 + fi + strip $dsttmp || shtool_exit $? fi - chmod $opt_m $dsttmp || exit $? - fi - - # Determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 fi + chown $opt_o $dsttmp || shtool_exit $? fi - fi - - # Finally install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || shtool_exit $? fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + if [ ".$opt_m" != ".-" ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 + fi + chmod $opt_m $dsttmp || shtool_exit $? fi - rm -f $dst && mv $dsttmp $dst - fi - ;; -mkdir ) - ## - ## mkdir -- Make one or more directories - ## Copyright (c) 1996-1999 Ralf S. Engelschall - ## Originally written for public domain by Noah Friedman - ## Cleaned up and enhanced for shtool - ## - - errstatus=0 - for p in ${1+"$@"}; do - # when the directory already exists... - if [ -d "$p" ]; then - if [ ".$opt_f" = .no ]; then - echo "$msgprefix:Error: file exists: $p" 1>&2 - errstatus=1 - break - else - continue + # determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s $src $dst; then + quick=yes + fi fi fi - # when the directory has to be created - if [ ".$opt_p" = .no ]; then + + # finally, install the file to the real destination + if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then - echo "mkdir $p" 1>&2 + echo "rm -f $dsttmp" 1>&2 fi - mkdir $p || errstatus=$? + rm -f $dsttmp else - # the smart situation - set fnord `echo ":$p" |\ - sed -e 's/^:\//%/' \ - -e 's/^://' \ - -e 's/\// /g' \ - -e 's/^%/\//'` - shift - pathcomp= - for d in ${1+"$@"}; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp="./$pathcomp" ;; - esac - if [ ! -d "$pathcomp" ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $pathcomp" 1>&2 - fi - mkdir $pathcomp || errstatus=$? - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $pathcomp" 1>&2 - fi - chmod $opt_m $pathcomp || errstatus=$? - fi - fi - pathcomp="$pathcomp/" - done + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst fi done - exit $errstatus + + shtool_exit 0 ;; -mkln ) +platform ) ## - ## mkln -- Make link with calculation of relative paths - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool + ## platform -- Platform Identification Utility + ## Copyright (c) 2003-2004 Ralf S. Engelschall ## - - args=$? - srcs="" - while [ $# -gt 1 ]; do - srcs="$srcs $1" - shift - done - dst="$1" - if [ ! -d $dst ]; then - if [ $args -gt 2 ]; then - echo "$msgprefix:Error: multiple sources not allowed when target isn't a directory" 1>&2 - exit 1 - fi - fi - - # determine link options - lnopt="" - if [ ".$opt_f" = .yes ]; then - lnopt="$lnopt -f" - fi - if [ ".$opt_s" = .yes ]; then - lnopt="$lnopt -s" - fi - - # iterate over sources - for src in $srcs; do - # determine if one of the paths is an absolute path, - # because then we _have_ to use an absolute symlink - oneisabs=0 - srcisabs=0 - dstisabs=0 - case $src in - /* ) oneisabs=1; srcisabs=1 ;; - esac - case $dst in - /* ) oneisabs=1; dstisabs=1 ;; - esac - - # split source and destination into dir and base name - if [ -d $src ]; then - srcdir=`echo $src | sed -e 's;/*$;;'` - srcbase="" - else - srcdir=`echo $src | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` - srcbase=`echo $src | sed -e 's;.*/\([^/]*\)$;\1;'` - fi - if [ -d $dst ]; then - dstdir=`echo $dst | sed -e 's;/*$;;'` - dstbase="" - else - dstdir=`echo $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` - dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'` - fi - - # consistency check - if [ ".$dstdir" != . ]; then - if [ ! -d $dstdir ]; then - echo "$msgprefix:Error: destination directory not found: $dstdir" 1>&2 + + # option post-processing + if [ ".$opt_t" != . ]; then + case "$opt_t" in + binary ) + # binary package id (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + build ) + # build time checking (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + gnu ) + # GNU config.guess style -- + opt_F="%-unknown-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + web ) + # non-whitespace HTTP Server-header id + opt_F="%-%" + opt_S="/" + opt_C="+" + ;; + summary) + # human readable verbose summary information + opt_F="Class: %[sc] (%[ac])\\nProduct: %[sp] (%[ap])\\nTechnology: %[st] (%[at])" + opt_S=" " + opt_C="/" + ;; + all-in-one ) + # full-table all-in-one information + opt_F="" + opt_F="${opt_F}concise architecture class: %\\n" + opt_F="${opt_F}regular architecture class: %{ac}\\n" + opt_F="${opt_F}verbose architecture class: %[ac]\\n" + opt_F="${opt_F}concise architecture product: %\\n" + opt_F="${opt_F}regular architecture product: %{ap}\\n" + opt_F="${opt_F}verbose architecture product: %[ap]\\n" + opt_F="${opt_F}concise architecture technology: %\\n" + opt_F="${opt_F}regular architecture technology: %{at}\\n" + opt_F="${opt_F}verbose architecture technology: %[at]\\n" + opt_F="${opt_F}concise system class: %\\n" + opt_F="${opt_F}regular system class: %{sc}\\n" + opt_F="${opt_F}verbose system class: %[sc]\\n" + opt_F="${opt_F}concise system product: %\\n" + opt_F="${opt_F}regular system product: %{sp}\\n" + opt_F="${opt_F}verbose system product: %[sp]\\n" + opt_F="${opt_F}concise system technology: %\\n" + opt_F="${opt_F}regular system technology: %{st}\\n" + opt_F="${opt_F}verbose system technology: %[st]" + ;; + * ) + echo "$msgprefix:Error: invalid type \`$opt_t'" 1>&2 exit 1 - fi - fi - - # make sure the source is reachable from the destination - if [ $dstisabs = 1 ]; then - if [ $srcisabs = 0 ]; then - if [ -d $srcdir ]; then - srcdir="`cd $srcdir; pwd | sed -e 's;/*$;;'`" - srcisabs=1 - oneisabs=1 - fi - fi - fi - - # split away a common prefix - prefix="" - if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then - prefix="$srcdir/" - srcdir="" - dstdir="" - else - while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do - presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'` - predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'` - if [ ".$presrc" != ".$predst" ]; then - break - fi - prefix="$prefix$presrc/" - srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'` - dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'` - done - fi - - # destination prefix is just the common prefix - dstpre="$prefix" - - # determine source prefix which is the reverse directory - # step-up corresponding to the destination directory - srcpre="" - if [ $oneisabs = 0 ] || [ ".$prefix" != . -a ".$prefix" != ./ ]; then - pl="$dstdir/" - OIFS="$IFS"; IFS='/' - for pe in $pl; do - [ ".$pe" = . ] && continue - srcpre="../$srcpre" - done - IFS="$OIFS" - else - if [ $srcisabs = 1 ]; then - srcpre="$prefix" - fi - fi - - # determine destination symlink name - if [ ".$dstbase" = . ]; then - if [ ".$srcbase" != . ]; then - dstbase="$srcbase" - else - dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'` - fi - fi - - # now finalize source and destination directory paths - srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'` - dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'` - - # run the final link command - if [ ".$opt_t" = .yes ]; then - echo "ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase" - fi - eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase - done - ;; - -mkshadow ) - ## - ## mkshadow -- Make a shadow tree - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - # source and destination directory - src=`echo "$1" | sed -e 's:/$::'` - dst=`echo "$2" | sed -e 's:/$::'` - - # check whether source exists - if [ ! -d $src ]; then - echo "$msgprefix:Error: source directory not found: \`$src'" 1>&2 - exit 1 - fi - - # determine if one of the paths is an absolute path, - # because then we have to use an absolute symlink - oneisabs=0 - case $src in - /* ) oneisabs=1 ;; - esac - case $dst in - /* ) oneisabs=1 ;; - esac - - # determine reverse directory for destination directory - dstrevdir='' - if [ $oneisabs = 0 ]; then - # (inlined fp2rp) - OIFS="$IFS"; IFS='/' - for pe in $dst; do - dstrevdir="../$dstrevdir" - done - IFS="$OIFS" - else - src="`cd $src; pwd`"; - fi - - # create directory tree at destination - if [ ! -d $dst ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $dst" 1>&2 - fi - mkdir $dst - fi - if [ ".$opt_a" = .yes ]; then - DIRS=`cd $src; find . -type d -print |\ - sed -e '/^\.$/d' -e 's:^\./::'` - else - DIRS=`cd $src; find . -type d -print |\ - sed -e '/\/CVS/d' -e '/^\.$/d' -e 's:^\./::'` - fi - for dir in $DIRS; do - if [ ".$opt_t" = .yes ]; then - echo "mkdir $dst/$dir" 1>&2 - fi - mkdir $dst/$dir - done - - # fill directory tree with symlinks to files - if [ ".$opt_a" = .yes ]; then - FILES="`cd $src; find . -depth -print |\ - sed -e 's/^\.\///'`" - else - FILES="`cd $src; find . -depth -print |\ - sed -e '/\.o$/d' -e '/\.a$/d' -e '/\.so$/d' \ - -e '/\.cvsignore$/d' -e '/\/CVS/d' \ - -e '/\/\.#/d' -e '/\.orig$/d' \ - -e 's/^\.\///'`" + ;; + esac fi - for file in $FILES; do - # don't use `-type f' above for find because of symlinks - if [ -d "$src/$file" ]; then - continue - fi - basename=`echo $file | sed -e 's:^.*/::'` - dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'` - from=`echo "$src/$file" | sed -e 's/^\.\///'` - to="$dst/$dir$basename" - if [ $oneisabs = 0 ]; then - if [ ".$dir" != . ]; then - subdir=`echo $dir | sed -e 's:/$::'` - # (inlined fp2rp) - revdir='' - OIFS="$IFS"; IFS='/' - for pe in $subdir; do - revdir="../$revdir" - done - IFS="$OIFS" - # finalize from - from="$revdir$from" - fi - from="$dstrevdir$from" - fi - if [ ".$opt_v" = .yes ]; then - echo " $to" 1>&2 - fi - if [ ".$opt_t" = .yes ]; then - echo "ln -s $from $to" 1>&2 - fi - ln -s $from $to - done - ;; -fixperm ) - ## - ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-1999 Ralf S. Engelschall - ## Originally written for ePerl - ## - - paths="$*" - - # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then - minusx="-x" - else - minusx="-r" - fi - rm -f $tmpfile - - # iterate over paths - for p in $paths; do - for file in `find $p -depth -print`; do - if [ -f $file ]; then - if [ $minusx $file ]; then - if [ ".$opt_v" = .yes ]; then - echo "-rwxrwxr-x $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 775 $file" 2>&1 - fi - chmod 775 $file - else - if [ ".$opt_v" = .yes ]; then - echo "-rw-rw-r-- $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 664 $file" 2>&1 - fi - chmod 664 $file - fi - continue - fi - if [ -d $file ]; then - if [ ".$opt_v" = .yes ]; then - echo "drwxrwxr-x $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 775 $file" 2>&1 - fi - chmod 775 $file - continue - fi - if [ ".$opt_v" = .yes ]; then - echo "?????????? $file" 2>&1 - fi - done - done - ;; + # assemble initial platform information + UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\ + UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\ + UNAME_MACHINE='unknown' + UNAME_SYSTEM=`(uname -s) 2>/dev/null` ||\ + UNAME_SYSTEM='unknown' + UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\ + UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\ + UNAME_RELEASE='unknown' -guessos ) - ## - ## guessos -- Simple OS/platform guesser - ## Copyright (c) 1996-1999 The Apache Group, http://www.apache.org/ - ## The Apache license applies (see http://www.apache.org/docs/LICENSE) - ## Originally written for Apache - ## - - MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" - RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" - SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" - VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" - - XREL=`(uname -X) 2>/dev/null | grep "^Release" | awk '{print $3}'` - if [ "x$XREL" != "x" ]; then - if [ -f /etc/kconfig ]; then - case "$XREL" in - 4.0|4.1) echo "${MACHINE}-whatever-isc4"; exit 0 ;; + UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}" + + AC=""; AP=""; AT="" + SC=""; SP=""; ST="" + + # dispatch into platform specific sections + case "${UNAME}" in + + # FreeBSD + *:FreeBSD:* ) + # determine architecture + AC="${UNAME_MACHINE}" + case "${AC}" in + i386 ) AC="iX86" ;; + esac + AP="${AC}" + AT=`(/sbin/sysctl -n hw.model) 2>&1` + case "${AT}" in + *"Xeon"* | *"Pentium Pro"* | *"Cyrix 6x86MX"* | *"Pentium II"* | *"Pentium III"* | *"Pentium 4"* | *"Celeron"* ) AT="i686" ;; + *"Pentium"* ) AT="i586" ;; *"i486[SD]X"* | *"Cyrix 486"* | *"Cyrix [56]x86"* | *"Blue Lightning" | *"Cyrix 486S/DX" ) AT="i486" ;; + *"i386[SD]X"* | *"NexGen 586"* ) AT="i386" ;; + * ) AT="${AP}" ;; + esac + # determine system + r=`echo "${UNAME_RELEASE}" |\ + sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'` + ST="FreeBSD ${r}" + SP="${ST}" + case "${r}" in + 1.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; esac - else - case "$XREL" in - 3.2v4.2) - echo "whatever-whatever-sco3"; exit 0 - ;; - 3.2v5.0*) - echo "whatever-whatever-sco5"; exit 0 - ;; - 4.2MP) - if [ "x$VERSION" = "x2.1.1" ]; then - echo "${MACHINE}-whatever-unixware211"; exit 0 - elif [ "x$VERSION" = "x2.1.2" ]; then - echo "${MACHINE}-whatever-unixware212"; exit 0 - else - echo "${MACHINE}-whatever-unixware2"; exit 0 - fi - ;; - 4.2) - echo "whatever-whatever-unixware1"; exit 0 - ;; - 5) - case "$VERSION" in - 7*) echo "${MACHINE}-whatever-unixware7"; exit 0 ;; - esac - ;; - esac - fi - fi - case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in - MiNT:*) - echo "m68k-atari-mint"; exit 0 - ;; - A/UX:*) - echo "m68k-apple-aux3"; exit 0 - ;; - AIX:*) - MACH=`echo $MACHINE | sed -e 's;[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F];;'` - echo "${MACH}-ibm-aix${VERSION}.${RELEASE}"; exit 0 - ;; - dgux:*) - echo "${MACHINE}-dg-dgux"; exit 0 ;; - HI-UX:*) - echo "${MACHINE}-hi-hiux"; exit 0 + + # NetBSD + *:NetBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="NetBSD ${r}" + SP="${ST}" + case "${r}" in + 0.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; + esac ;; - HP-UX:*) - HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo "${MACHINE}-hp-hpux${HPUXVER}"; exit 0 + + # OpenBSD + *:OpenBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="OpenBSD ${r}" + SP="${ST}" + SC="4.4BSD" ;; - IRIX:*) - if [ -f /usr/lib32/mips4/libm.so ]; then - echo "${MACHINE}/32-sgi-irix${RELEASE}"; exit 0 - else - echo "${MACHINE}-sgi-irix${RELEASE}"; exit 0 + + # GNU/Linux + *:Linux:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + x86_64 ) AT='AMD64' ;; + parisc ) AT="HPPA32" ;; + parisc64 ) AT="HPPA64" ;; + esac + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP='iX86' ;; + esac + AC="${AP}" + # determine system + v_kern=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'` + v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\ + sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null` + ST="GNU/${v_libc}/<${v_kern}>" + if [ -f /etc/lsb-release ]; then + eval `( . /etc/lsb-release + echo "SC=\"LSB${LSB_VERSION}\"" + if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then + echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\"" + fi + ) 2>/dev/null` fi + if [ ".$SP" = . ]; then + for tagfile in x \ + `cd /etc && \ + /bin/ls *[_-]release *[_-]version 2>/dev/null | \ + sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \ + echo redhat-release lsb-release` + do + [ ".${tagfile}" = .x ] && continue + [ ! -f "/etc/${tagfile}" ] && continue + n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'` + v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$//'` + case "`util_lower ${n}`" in + redhat ) + if [ ".`grep 'Red Hat Enterprise Linux' /etc/${tagfile}`" != . ]; then + n="ed at nterprise inux" + else + n="ed at inux" + fi + ;; + debian ) n="Debian[ GNU/Linux]" ;; + fedora ) n=" Core[ GNU/Linux]" ;; + suse ) n="SuSE[ Linux]" ;; + mandrake ) n="Mandrake[ Linux]" ;; + gentoo ) n="Gentoo[ GNU/Linux]" ;; + slackware ) n="Slackware[ Linux]" ;; + turbolinux ) n="TurboLinux" ;; + unitedlinux ) n="UnitedLinux" ;; + * ) n="${n}[ GNU/Linux]" ;; + esac + case "$n" in + *"<"*">"* ) SP="$n <$v>" ;; + * ) SP="$n $v" ;; + esac + break + done + fi + [ ".$SP" = . ] && SP="${ST}" + [ ".$SC" = . ] && SC="LSB" ;; - IRIX64:*) - echo "${MACHINE}-sgi-irix64"; exit 0 - ;; - Linux:[2-9].*) - echo "${MACHINE}-whatever-linux2"; exit 0 - ;; - Linux:1.*) - echo "${MACHINE}-whatever-linux1"; exit 0 - ;; - LynxOS:*) - echo "${MACHINE}-lynx-lynxos"; exit 0 + + # Sun Solaris + *:SunOS:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i86pc ) AT="iX86" ;; + esac + AP="${AT}" + case "${AP}" in + sun4[cdm] ) AP="SPARC32" ;; + sun4u ) AP="SPARC64" ;; + sun4* ) AP="SPARC" ;; + esac + AC="${AP}" + case "${AC}" in + SPARC* ) AC="SPARC" ;; + esac + # determine system + ST="[Sun ]SunOS ${UNAME_RELEASE}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's;^4\.;1.;' \ + -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \ + -e 's;^5\.\([0-9][0-9]*\).*;\1;'` + SP="[Sun ]Solaris $v" + case "${UNAME_RELEASE}" in + 4.* ) SC="4.3BSD" ;; + 5.* ) SC="SVR4" ;; + esac ;; - BSD/386|BSD/OS:3.*) - echo "${MACHINE}-whatever-bsdi3"; exit 0 + + # SCO UnixWare + *:UnixWare:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i[3-6]86 | ix86at ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v=`/sbin/uname -v` + ST="[SCO ]UnixWare ${v}" + SP="${ST}" + SC="SVR${UNAME_RELEASE}" ;; - BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*) - echo "i486-whatever-bsdi"; exit 0 + + # QNX + *:QNX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + x86pc ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v="${UNAME_RELEASE}" + ST="QNX[ Neutrino RTOS] ${v}" + v=`echo "${v}" | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'` + SP="QNX[ Neutrino RTOS] ${v}" + SC="QNX" ;; - BSD/386:*|BSD/OS:*) - echo "${MACHINE}-whatever-bsdi"; exit 0 + + # SGI IRIX + *:IRIX*:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}:${UNAME_SYSTEM}" in + IP*:IRIX64 ) AP="MIPS64" ;; + IP*:* ) AP="MIPS" ;; + esac + AC="${AP}" + # determine system + v=`(/bin/uname -R || /bin/uname -r) 2>/dev/null | sed -e 's;[0-9.]* ;;'` + ST="[SGI ]IRIX ${v}" + v="${UNAME_RELEASE}" + SP="[SGI ]IRIX ${v}" + SC="4.2BSD/SVR3" ;; - FreeBSD:*) - VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'` - MACH=`sysctl -n hw.model` - ARCH='whatever' - case ${MACH} in - *386* ) MACH="i386" ;; - *486* ) MACH="i486" ;; - Pentium\ II*) MACH="i686" ;; - Pentium* ) MACH="i586" ;; - Alpha* ) MACH="alpha" ;; - * ) MACH="$MACHINE" ;; + + # HP HP-UX + *:HP-UX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + 9000/[34]?? ) AT=M68K ;; + 9000/[678][0-9][0-9]) + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523 ) AT="HPPA1.0" ;; + 528 ) AT="HPPA1.1" ;; + 532 ) AT="HPPA2.0" + case "${sc_kernel_bits}" in + 32 ) AT="${AT}n" ;; + 64 ) AT="${AT}w" ;; + esac + ;; + esac + ;; esac - case ${MACH} in - i[0-9]86 ) ARCH="pc" ;; + AP="${AT}" + case "${AP}" in + HPPA* ) AP="HPPA" ;; + esac + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[^0-9]*;;'` + ST="[HP ]-" + SP="${ST}" + case "${v}" in + 10.* ) SC="SVR4.2" ;; + [7-9]* ) SC="SVR4" ;; esac - echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0 - ;; - NetBSD:*:*:*486*) - echo "i486-whatever-netbsd${RELEASE}"; exit 0 - ;; - NetBSD:*) - echo "${MACHINE}-whatever-netbsd${RELEASE}"; exit 0 - ;; - OpenBSD:*) - echo "${MACHINE}-whatever-openbsd"; exit 0 ;; - OSF1:*:*:*alpha*) - VERS=`echo $RELEASE | sed -e 's;^V;;'` - echo "${MACHINE}-dec-osf${VERS}"; exit 0 + + # HP Tru64 (OSF1) + *:OSF1:* ) + # determine architecture + AP="${UNAME_MACHINE}" + case "${AP}" in + alpha ) AP="Alpha" ;; + esac + alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\ + sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'` + AT="${AP}${alpha_type}" + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[VTX];;'` + ST="[HP ]Tru64 ${v}" + SP="${ST}" + SC="OSF1" ;; - QNX:*) - if [ "$VERSION" -gt 422 ]; then - echo "${MACHINE}-qssl-qnx32" + + # IBM AIX + *:AIX:* ) + cpu_arch=rs6000 + if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then + cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then + cpu_arch=powerpc + fi + fi + if [ -x /usr/bin/oslevel ]; then + os_level=`/usr/bin/oslevel` else - echo "${MACHINE}-qssl-qnx" + os_level="`uname -r`.`uname -v`" fi - exit 0 - ;; - Paragon*:*:*:*) - echo "i860-intel-osf1"; exit 0 - ;; - SunOS:5.*) - VERSION=`echo $RELEASE | sed -e 's;^5\.;;'` - echo "${MACHINE}-sun-solaris2.${VERSION}"; exit 0 - ;; - SunOS:*) - echo "${MACHINE}-sun-sunos4"; exit 0 - ;; - UNIX_System_V:4.*:*) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - unix:3.0.9*:*:88k) - echo "${MACHINE}-encore-sysv4"; exit 0 - ;; - *:4*:R4*:m88k) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - UnixWare:5:99*:*) - # Gemini, beta release of next rev of unixware - echo "${MACHINE}-whatever-unixware212"; exit 0 - ;; - DYNIX/ptx:4*:*) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - *:4.0:3.0:[345][0-9]?? | *:4.0:3.0:3[34]??[/,]* | library:*) - echo "x86-ncr-sysv4"; exit 0 - ;; - ULTRIX:*) - echo "${MACHINE}-unknown-ultrix"; exit 0 + os_level=`echo "${os_level}" |\ + sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \ + -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'` + AT="${cpu_arch}" + AP="${AT}" + AC="${AP}" + ST="[IBM ]AIX ${os_level}" + SP="${ST}" + case "${os_level}" in + [12]* ) SC="SVR2" ;; + * ) SC="SVR4" ;; + esac ;; - SINIX-?:* | ReliantUNIX-?:*) - echo "${MACHINE}-siemens-sysv4"; exit 0 + + # Apple MacOS X Darwin + *:Darwin:* ) + AT=`uname -p` + case "${AT}" in + powerpc ) AT="PPC" ;; + esac + AP="${AT}" + AC="${AP}" + case "${AC}" in + i?86 ) AC="iX86" ;; + esac + ST="[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}" + SP="${ST}" + SC="4.4BSD/Mach3" ;; - POSIX*BS2000) - echo "${MACHINE}-siemens-sysv4"; exit 0 + + # TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO + # *:XXX:* ) + # ... + # ;; + + # ...A STILL UNKNOWN PLATFORM... + * ) + AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"` + AP="${AT}" + AC="${AP}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$/?/'` + ST="${UNAME_SYSTEM} ${v}" + SP="${ST}" + SC="${SP}" ;; - machten:*) - echo "${MACHINE}-tenon-${SYSTEM}"; exit 0; - ;; - ConvexOS:*:11.*:*) - echo "${MACHINE}-v11-${SYSTEM}"; exit 0; - ;; - UNIX_SV:*:*:maxion) - echo "${MACHINE}-ccur-sysv4"; exit 0; - ;; - PowerMAX_OS:*:*:Night_Hawk) - MACHINE=`uname -p` - echo "${MACHINE}-concurrent-powermax"; exit 0; - ;; - UNIX_SV:*) - if [ -d /usr/nec ];then - echo "mips-nec-sysv4"; exit 0; - fi - ;; - NonStop-UX:4.[02]*:[BC]*:*) - echo "${MACHINE}-tandem-sysv4"; exit 0; - ;; - Rhapsody:*:*:*) - case "${MACHINE}" in - "Power Macintosh") MACHINE=powerpc ;; - esac - echo "${MACHINE}-apple-rhapsody${RELEASE}"; exit 0 - ;; - "Mac OS":*:*:*) - MACHINE=`uname -p` - echo "${MACHINE}-apple-macos${RELEASE}"; exit 0 - ;; - "RISC iX":*) - echo "arm-whatever-riscix"; exit 0; - ;; - *:4.0:2:*) - echo "whatever-unisys-sysv4"; exit 0; - ;; - *:*:dcosx:NILE*) - echo "pyramid-pyramid-svr4"; exit 0; - ;; - *:*:*:"DRS 6000") - echo "drs6000-whatever-whatever"; exit 0; - ;; - esac - - # Now NeXT - ISNEXT=`(hostinfo) 2>/dev/null` - case "$ISNEXT" in - *NeXT*) - # Swiped from a friendly uname clone for NEXT/OPEN Step. - NEXTOSVER="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" - if [ "$NEXTOSVER" -gt 3.3 ]; then - NEXTOS="openstep" - else - NEXTOS="nextstep" - fi - NEXTREL="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" - NEXTARCH=`arch` - echo "${NEXTARCH}-next-${NEXTOS}${NEXTREL}" ; exit 0 - ;; + esac - - # Fallback - echo "${MACHINE}-whatever-${SYSTEM}|${RELEASE}|${VERSION}" - ;; -arx ) - ## - ## arx -- Extended archive command - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - ar_prg="$opt_C" - ar_cmd="$1"; shift - archive="$1"; shift - files="$*" - - # walk through the file list and expand archives members - tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'` - nfiles='' - if [ ".$files" != . ]; then - for file in $files; do - if [ ! -f $file ]; then - echo "$msgprefix:Error: input file not found: $file" 1>&2 - exit 1 - fi - case $file in - *.a ) - if [ ! -d $tmpdir ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $tmpdir" 1>&2 - fi - mkdir $tmpdir - fi - case $tmpdir in - .arx ) - from="../$file" - ;; - * ) - dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - base=`echo $file | sed -e 's;.*/\([^/]*\)$;\1;'` - from="`cd $dir; pwd`/$base" - ;; - esac - if [ ".$opt_t" = .yes ]; then - echo "(cd $tmpdir && $ar_prg x $from)" 1>&2 - fi - (cd $tmpdir && eval $ar_prg x $from) - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: member extraction failed for archive: $file" 1>&2 - exit 1 - fi - for member in - `eval $ar_prg t $file`; do - [ ".$member" = .- ] && continue - nfiles="$nfiles $tmpdir/$member" - done + # provide fallback values + [ ".$AT" = . ] && AT="${AP:-${AC}}" + [ ".$AP" = . ] && AP="${AT:-${AC}}" + [ ".$AC" = . ] && AC="${AP:-${AT}}" + [ ".$ST" = . ] && ST="${SP:-${SC}}" + [ ".$SP" = . ] && SP="${ST:-${SC}}" + [ ".$SC" = . ] && SC="${SP:-${ST}}" + + # support explicit enforced verbose/concise output + if [ ".$opt_v" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'` + elif [ ".$opt_c" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'` + fi + + # provide verbose and concise variants + AC_V=""; AC_N=""; AC_C="" + AP_V=""; AP_N=""; AP_C="" + AT_V=""; AT_N=""; AT_C="" + SC_V=""; SC_N=""; SC_C="" + SP_V=""; SP_N=""; SP_C="" + ST_V=""; ST_N=""; ST_C="" + for var_lc in at ap ac st sp sc; do + case "$opt_F" in + *"%[${val_lc}]"* | *"%{${val_lc}}"* | *"%${val_lc}"* | *"%<${val_lc}>"* ) + var_uc=`util_upper "$var_lc"` + eval "val=\"\$${var_uc}\"" + val_V=""; val_N=""; val_C="" + case "$opt_F" in + *"%[${var_lc}]"* ) + val_V=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];\1;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_V=\"\${val_V}\"" ;; - * ) - nfiles="$nfiles $file" + esac + case "$opt_F" in + *"%{${var_lc}}"* | *"%${var_lc}"* ) + val_N=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_N=\"\${val_N}\"" ;; esac - done - fi - - # run the final archive command - if [ ".$opt_t" = .yes ]; then - echo "$ar_prg $ar_cmd $archive $nfiles" 1>&2 - fi - eval $ar_prg $ar_cmd $archive $nfiles - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: archive command failed" 1>&2 - exit $? - fi - - # cleanup and die gracefully - if [ -d $tmpdir ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -rf $tmpdir" 1>&2 - fi - rm -rf $tmpdir - fi - ;; - -slo ) - ## - ## slo -- Separate linker options by library class - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - DIFS="$IFS" - - # parse out -L and -l options from command line - DIRS='' - LIBS='' - ARGV='' - optprev='' - for opt - do - # concatenate with previous option if exists - if [ ".$optprev" != . ]; then - opt="${optprev}${opt}"; - optprev='' - fi - # remember options for arg when used stand-alone - if [ ".$opt" = ".-L" -o ".$opt" = ".-l" ]; then - optprev="$opt" - continue; - fi - # split argument into option plus option argument - arg="`echo $opt | cut -c3-`" - opt="`echo $opt | cut -c1-2`" - # store into containers - case $opt in - -L) DIRS="$DIRS:$arg" ;; - -l) LIBS="$LIBS:$arg" ;; - *) ARGV="$ARGV $opt" ;; + case "$opt_F" in + *"%<${var_lc}>"* ) + val_C=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_C=\"\${val_C}\"" + ;; + esac + ;; esac done - - # set linker default directories - DIRS_DEFAULT='/lib:/usr/lib' - if [ ".$LD_LIBRARY_PATH" != . ]; then - DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH" - fi - - # sort options by class - DIRS_OBJ='' - LIBS_OBJ='' - DIRS_PIC='' - LIBS_PIC='' - DIRS_DSO='' - LIBS_DSO='' - - # for each library... - OIFS="$IFS" IFS=':' - for lib in $LIBS; do - [ ".$lib" = . ] && continue - - found='no' - found_indefdir='no' - found_type='' - found_dir='' - - # for each directory... - OIFS2="$IFS" IFS=":$DIFS" - for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do - [ ".$dir" = . ] && continue - [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes - [ ! -d $dir ] && continue - - # search the file - OIFS3="$IFS" IFS="$DIFS" - for file in '' `cd $dir && ls lib${lib}.* 2>/dev/null`; do - [ ".$file" = . ] && continue - case $file in - *.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* ) - found=yes; - found_type=DSO; - break - ;; - *.lo|*.la ) - found=yes; - found_type=PIC - ;; - *.a ) - if [ ".$found_type" = . ]; then - found=yes - found_type=OBJ - fi - ;; - esac - done - IFS="$OIFS3" - if [ ".$found" = .yes ]; then - found_dir="$dir" - break - fi - done - IFS="$OIFS2" - - if [ ".$found" = .yes ]; then - if [ ".$found_indefdir" != .yes ]; then - eval "dirlist=\"\${DIRS_${found_type}}:\"" - if [ ".`echo \"$dirlist\" | fgrep :$found_dir:`" = . ]; then - eval "DIRS_${found_type}=\"\$DIRS_${found_type}:${found_dir}\"" - fi - eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" - else - eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" - fi - else - LIBS_OBJ="$LIBS_OBJ:$lib" - #dirlist="`echo $DIRS $DIRS_DEFAULT | sed -e 's/:/ /g'`" - #echo "slo:Warning: library \"$lib\" not found in any of the following dirs:" 2>&1 - #echo "slo:Warning: $dirlist" 1>&1 - fi - done - IFS="$OIFS" - - # also pass-through unused dirs even if it's useless - OIFS="$IFS" IFS=':' - for dir in $DIRS; do - dirlist="${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:" - if [ ".`echo \"$dirlist\" | fgrep :$dir:`" = . ]; then - DIRS_OBJ="$DIRS_OBJ:$dir" - fi - done - IFS="$OIFS" - - # reassemble the options but seperated by type - for type in OBJ PIC DSO; do - OIFS="$IFS" IFS=':' - eval "libs=\"\$LIBS_${type}\"" - opts='' - for lib in $libs; do - [ ".$lib" = . ] && continue - opts="$opts -l$lib" - done - eval "LIBS_${type}=\"$opts\"" - - eval "dirs=\"\$DIRS_${type}\"" - opts='' - for dir in $dirs; do - [ ".$dir" = . ] && continue - opts="$opts -L$dir" - done - eval "DIRS_${type}=\"$opts\"" - IFS="$OIFS" - done - - # give back results - for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do - eval "val=\"\$${var}\"" - val="`echo $val | sed -e 's/^ *//'`" - echo "SLO_${var}=\"${val}\"" - done - ;; -scpp ) - ## - ## scpp -- Sharing C Pre-Processor - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for NPS - ## - - srcs="$*" - output="${opt_o}.n" - - # parse source file(s) - if [ ".$opt_v" = .yes ]; then - echo "Parsing:" | awk '{ printf("%s", $0); }' 1>&2 - fi - for src in $srcs; do - if [ ".$opt_v" = .yes ]; then - echo $src | awk '{ printf(" %s", $0); }' 1>&2 - fi - awk <$src ' - BEGIN { - ln = 0; - fln = 0; - level = 0; - mode = ""; - store = ""; - } - { - ln++; - } - /^#if.*/ { - level++; - } - /^#if [a-zA-Z_][a-zA-Z0-9_]* *$/ { - if ($2 == define) { - mode = "D"; - printf("D:#line %d \"%s\"\n", ln, src); - next; - } - } - /^#endif.*/ { - level--; - if (mode == "D" && level == 0) { - mode = ""; - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_].*;.*/ || /^[a-zA-Z_][a-zA-Z0-9_].*=.*/ { - if ($1 == class) { - printf("V:#line %d \"%s\"\n", ln, src); - printf("V:%s\n", $0); - printf("J:%s\n", $0); - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_]*/ { - if ($1 == class) { - fln = ln; - store = $0; - mode = "F"; - next; - } - } - /^\{ *$/ { - if (mode == "F") { - printf("F:#line %d \"%s\"\n", fln, src); - printf("F:%s;\n", store); - printf("I:%s;\n", store); - store = ""; - mode = ""; - next; - } - } - { - if (mode == "D") - printf("D:%s\n", $0); - else if (mode == "F") - store = store " " $0; - } - ' "src=$src" "define=$opt_D" "class=$opt_C" >>$tmpfile - done - if [ ".$opt_v" = .yes ]; then - echo "" 1>&2 + # create output string + output=`echo ":$opt_F" |\ + sed -e "s/^://" \ + -e "s;%\\[ac\\];${AC_V};g" \ + -e "s;%{ac};${AC_N};g" \ + -e "s;%ac;${AC_N};g" \ + -e "s;%;${AC_C};g" \ + -e "s;%\\[ap\\];${AP_V};g" \ + -e "s;%{ap};${AP_N};g" \ + -e "s;%ap;${AP_N};g" \ + -e "s;%;${AP_C};g" \ + -e "s;%\\[at\\];${AT_V};g" \ + -e "s;%{at};${AT_N};g" \ + -e "s;%at;${AT_N};g" \ + -e "s;%;${AT_C};g" \ + -e "s;%\\[sc\\];${SC_V};g" \ + -e "s;%{sc};${SC_N};g" \ + -e "s;%sc;${SC_N};g" \ + -e "s;%;${SC_C};g" \ + -e "s;%\\[sp\\];${SP_V};g" \ + -e "s;%{sp};${SP_N};g" \ + -e "s;%sp;${SP_N};g" \ + -e "s;%;${SP_C};g" \ + -e "s;%\\[st\\];${ST_V};g" \ + -e "s;%{st};${ST_N};g" \ + -e "s;%st;${ST_N};g" \ + -e "s;%;${ST_C};g" \ + -e 's/\\\\n/^/g' |\ + tr '^' '\012'` + + # support lower/upper-case mapping + if [ ".$opt_L" = .yes ]; then + output=`util_lower "$output"` + elif [ ".$opt_U" = .yes ]; then + output=`util_upper "$output"` fi - - # start generating output header - echo "/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */" >$output - echo "#line 1 \"$opt_t\"" >>$output - sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd' |\ - sed -e "/^${opt_M} *\$/d" >>$output - - # merge in the define blocks - grep '^D:' $tmpfile | sed -e 's/^D://' >>$output - - # generate standard prolog - echo "#line 1 \"_ON_THE_FLY_\"" >>$output - echo "" >>$output - echo "/* make sure the scpp source extensions are skipped */" >>$output - echo "#define $opt_D 0" >>$output - echo "#define $opt_C /**/" >>$output - - # generate namespace hiding for variables - echo "" >>$output - echo "/* move intern variables to hidden namespace */" >>$output - grep '^J:' $tmpfile | sed >>$output \ - -e 's/^J://' \ - -e 's/ */ /g' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\];.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/' - - # generate namespace hiding for functions - echo "" >>$output - echo "/* move intern functions to hidden namespace */" >>$output - grep '^I:' $tmpfile | sed >>$output \ - -e 's/^I://' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/' - - # generate prototypes for variables - echo "" >>$output - echo "/* prototypes for intern variables */" >>$output - grep '^V:' $tmpfile | sed >>$output \ - -e 's/^V://' \ - -e 's/ */ /g' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\);.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\) =.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\);.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \ - -e 's/ ;/;/g' \ - -e "s/^$opt_C /extern /" - - # generate prototypes for functions - echo "" >>$output - echo "/* prototypes for intern functions */" >>$output - grep '^F:' $tmpfile | sed >>$output \ - -e 's/^F://' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e "s/^$opt_C /extern /" - - # finish generating output header - n=`(echo ''; sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd') |\ - wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'` - echo "#line $n \"$opt_t\"" >>$output - sed <$opt_t -e "/^${opt_M} *\$/,\$p" -e 'd' |\ - sed -e "/^${opt_M} *\$/d" >>$output - - # create final output file - if [ -f $opt_o ]; then - if [ ".$opt_p" = .yes ]; then - grep -v '^#line' $opt_o >$tmpfile.o - grep -v '^#line' $output >$tmpfile.n - out_old="$tmpfile.o" - out_new="$tmpfile.n" - else - out_old="$opt_o" - out_new="$output" - fi - if cmp -s $out_old $out_new; then - : - else - cp $output $opt_o - fi + + # display output string + if [ ".$opt_n" = .yes ]; then + echo . | awk '{ printf("%s", output); }' output="$output" else - cp $output $opt_o + echo "$output" fi - rm -f $output - rm -f $tmpfile $tmpfile.* >/dev/null 2>&1 + + shtool_exit 0 ;; version ) ## - ## version -- Generate and maintain a version information file - ## Copyright (c) 1994-1999 Ralf S. Engelschall - ## Originally written for ePerl + ## version -- Maintain a version information file + ## Copyright (c) 1994-2004 Ralf S. Engelschall ## - - LANGUAGE="$opt_l" - NAME="$opt_n" - PREFIX="$opt_p" - FULLVERSION="$opt_s" - INCREASE="$opt_i" - REPORT="$opt_d" - FILE="$1" - - # determine language - if [ ".$LANGUAGE" = .unknown ]; then - case $FILE in - *.txt ) LANGUAGE=txt ;; - *.c ) LANGUAGE=c ;; - *.pl | *.pm ) LANGUAGE=perl ;; - * ) echo "$tool:Error: unknown language type" 1>&2; exit 1 ;; - esac - fi - - # determine prefix from name and vice versa - if [ ".$PREFIX" = . -o ".$PREFIX" = .unknown ]; then - if [ ".$NAME" != . -a ".$NAME" != .unknown ]; then - PREFIX="$NAME" + + file="$1" + + # determine prefix and name + name="$opt_n" + prefix="$opt_p" + + # determine current version + triple="$opt_s" + if [ ".$triple" != . ]; then + # use given triple + if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then + echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2 + shtool_exit 1 fi + eval `echo $triple |\ + sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc + elif [ -r $file ]; then + # determine triple from given file + eval `grep 'Version [0-9]*.[0-9]*[sabp.][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $file |\ + sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\ + ver="\1";rev="\2";typ="\3";lev="\4";tim="\5"%' -e 'q'` + else + # intialise to first version + ver=0 + rev=1 + typ=. + lev=0 + tim=calc fi - if [ ".$NAME" = . -o ".$NAME" = .unknown ]; then - if [ ".$PREFIX" != . -a ".$PREFIX" != .unknown ]; then - NAME="$PREFIX" - fi + + # determine new version in batch + if [ ".$opt_i" != . ]; then + case $opt_i in + v ) ver=`expr $ver + 1` + rev=0 + lev=0 + ;; + r ) rev=`expr $rev + 1` + lev=0 + ;; + l ) lev=`expr $lev + 1` + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2 + shtool_exit 1 + ;; + esac + tim=calc fi - - # determine version - date=unknown - version=0 - revision=0 - bplevel=0 - if [ ".$FULLVERSION" = .unknown ]; then - if [ -r "$FILE" ]; then - # grep out current information - id=`grep 'Version [0-9]*.[0-9]*[.abps][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $FILE | \ - head -1 | \ - sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\1:\2:\3:\4:\5%'` - version=`echo $id | awk -F: '{ print $1 }'` - revision=`echo $id | awk -F: '{ print $2 }'` - bptype=`echo $id | awk -F: '{ print $3 }'` - bplevel=`echo $id | awk -F: '{ print $4 }'` - date=`echo $id | awk -F: '{ print $5 }'` - if [ .$REPORT = .NO ]; then - case $INCREASE in - b ) bplevel=`expr $bplevel + 1` - bptype=b - ;; - a ) bplevel=`expr $bplevel + 1` - bptype=a - ;; - s ) bplevel=`expr $bplevel + 1` - bptype=s - ;; - P ) bplevel=`expr $bplevel + 1` - bptype=. - ;; - p ) bplevel=`expr $bplevel + 1` - bptype=p - ;; - r ) revision=`expr $revision + 1` - bptype=. - bplevel=0 - ;; - v ) version=`expr $version + 1` - revision=0 - bptype=. - bplevel=0 - ;; - esac - date=calc - fi - FULLVERSION="$version.$revision$bptype$bplevel" - else - # intialise to first version - version=0 - revision=5 - bptype=b - bplevel=0 - date=calc - fi - else - # take given version - V=`echo $FULLVERSION | sed -e 's%\([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\).*%\1:\2:\3:\4%'` - version=`echo $V | awk -F: '{ print $1 }'` - revision=`echo $V | awk -F: '{ print $2 }'` - bptype=`echo $V | awk -F: '{ print $3 }'` - bplevel=`echo $V | awk -F: '{ print $4 }'` - date=calc + + # determine new version interactively + if [ ".$opt_e" = .yes ]; then + echo "old version: ${ver}.${rev}${typ}${lev}" + while [ 1 ]; do + echo dummy | awk '{ printf("new version: "); }' + read triple + case $triple in + [0-9]*.[0-9]*[sabp.][0-9]* ) + ;; + * ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2 + continue + ;; + esac + break + done + eval `echo $triple |\ + sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc fi - - # determine hex value of version - case $FULLVERSION in - *.*a* ) - HEX=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*a//' | awk '{ printf("0%02d", $1); }'` - ;; - *.*b* ) - HEX=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*b//' | awk '{ printf("1%02d", $1); }'` - ;; - *.*.* ) - HEX=`echo "$FULLVERSION" | awk -F. '{ printf("%d%02d2%02d", $1, $2, $3); }'` - ;; - esac - - # determine libtool version - case $FULLVERSION in - *.*a* ) - LTV=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*b* ) - LTV=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*.* ) - LTV=`echo "$FULLVERSION" | awk -F. '{ printf("%d:%d", $1*10+$2, $3); }'` - ;; + + # determine hexadecimal and libtool value of version + case $typ in + a ) typnum=0; levnum=$lev ;; + b ) typnum=1; levnum=$lev ;; + p | . ) typnum=2; levnum=$lev ;; + s ) typnum=15; levnum=255 ;; # snapshots are special esac - - # determine string out of filename - # (don't try to optimize this in any way - portability!) - FILESTR=`echo "$FILE" |\ - tr 'abcdefghijklmnopqrstuvwxyz./%+' \ - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` - + hex=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("0x%x%02x%1x%02x", $1, $2, $3, $4); }' |\ + tr 'abcdef' 'ABCDEF'` + ltv=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` + # determine date - if [ ".$date" = .calc ]; then + if [ ".$tim" = .calc ]; then day=`date '+%d'` month=`date '+%m'` year=`date '+%Y' 2>/dev/null` @@ -2215,264 +1242,185 @@ version ) 11) month='Nov' ;; 12) month='Dec' ;; esac - date="${day}-${month}-${year}" + tim="${day}-${month}-${year}" fi - - if [ .$REPORT != .NO ]; then - case $REPORT in - long ) - echo "$version.$revision$bptype$bplevel ($date)" - ;; + + # perform result actions + mode=show + if [ ".$opt_i" != . ]; then + mode=edit + elif [ ".$opt_e" = .yes ]; then + mode=edit + elif [ ".$opt_s" != . ]; then + mode=edit + fi + if [ ".$mode" = .show ]; then + # just display the current version + case $opt_d in short ) - echo "$version.$revision$bptype$bplevel" + echo "${ver}.${rev}${typ}${lev}" + ;; + long ) + echo "${ver}.${rev}${typ}${lev} ($tim)" ;; libtool ) - echo "$LTV" + echo "${ltv}" ;; hex ) - echo "0x$HEX" + echo "${hex}" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2 + shtool_exit 1 ;; esac - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - fi - - # create the version file according the the selected language - echo "new version: $version.$revision$bptype$bplevel ($date)" - case $LANGUAGE in - txt ) - cat >$tmpfile <<'EOT' - - This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@) -EOT - ;; - c ) - cat >$tmpfile <<'EOT' -/* -** @FILE@ -- Version Information -** [automatically generated and maintained by shtool] -*/ - -#ifdef _AS_HEADER - -#ifndef _@FILESTR@ -#define _@FILESTR@ -#define @PREFIX@_VERSION 0x@HEX@ -extern const int @PREFIX@_Version; -extern const char @PREFIX@_VersionStr[]; -extern const char @PREFIX@_Hello[]; -extern const char @PREFIX@_GNUVersion[]; -extern const char @PREFIX@_WhatID[]; -extern const char @PREFIX@_RCSIdentID[]; -extern const char @PREFIX@_WebID[]; -extern const char @PREFIX@_PlainID[]; -#endif /* _@FILESTR@ */ - -#else - -const int @PREFIX@_Version = 0x@HEX@; -const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_RCSIdentID[] = "$Id: shtool 1.1 Tue, 27 Jan 2004 11:46:36 -0800 shawnw $"; -const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -#endif -EOT - ;; - perl ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by shtool] -## + else + # update the version file -$@PREFIX@_Version = 0x@HEX@; -$@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_RCSIdentID = "\$Id: shtool 1.1 Tue, 27 Jan 2004 11:46:36 -0800 shawnw $/"; -$@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -1; -EOT - ;; - esac - - # now create the version file - rm -f $FILE >/dev/null 2>&1 - sed \ - -e "s|@FILE@|$FILE|g" \ - -e "s|@FILESTR@|$FILESTR|g" \ - -e "s|@PREFIX@|$PREFIX|g" \ - -e "s|@NAME@|$NAME|g" \ - -e "s|@HEX@|$HEX|g" \ - -e "s|@VERSION@|$version|g" \ - -e "s|@REVISION@|$revision|g" \ - -e "s|@BPTYPE@|$bptype|g" \ - -e "s|@BPLEVEL@|$bplevel|g" \ - -e "s|@YEAR@|$year|g" \ - -e "s|@MONTH@|$month|g" \ - -e "s|@DAY@|$day|g" <$tmpfile >$FILE - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - ;; + # pre-generate various strings + triple="${ver}.${rev}${typ}${lev}" + vHex="$hex" + vShort="${triple}" + vLong="${triple} (${tim})" + vTeX="This is ${name}, Version ${triple} (${tim})" + vGNU="${name} ${triple} (${tim})" + vWeb="${name}/${triple}" + vSCCS="@(#)${name} ${triple} (${tim})" + vRCS="\$Id: ${name} ${triple} (${tim}) \$" -path ) - ## - ## path -- Deal with program paths - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - namelist="$*" - - # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then - minusx="-x" - else - minusx="-r" - fi - rm -f $tmpfile - - # split path string - paths="`echo $opt_p |\ - sed -e 's/^:/.:/' \ - -e 's/::/:.:/g' \ - -e 's/:$/:./' \ - -e 's/:/ /g'`" - - # SPECIAL REQUEST - # translate forward to reverse path - if [ ".$opt_r" = .yes ]; then - if [ "x$namelist" = "x." ]; then - rp='.' - else - rp='' - for pe in `IFS="$IFS/"; echo $namelist`; do - rp="../$rp" - done - fi - echo $rp | sed -e 's:/$::' - exit 0 - fi - - # SPECIAL REQUEST - # strip out directory or base name - if [ ".$opt_d" = .yes ]; then - echo "$namelist" |\ - sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' - exit 0 - fi - if [ ".$opt_b" = .yes ]; then - echo "$namelist" |\ - sed -e 's;.*/\([^/]*\)$;\1;' - exit 0 - fi - - # MAGIC SITUATION - # Perl Interpreter (perl) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then - rm -f $tmpfile - touch $tmpfile - c=0 - found=0 - for dir in $paths; do - dir=`echo $dir | sed -e 's;/*$;;'` - for perl in perl5 perl miniperl; do - if [ $minusx "$dir/$perl" ]; then - perl="$dir/$perl" - version=`$perl -v | grep version |\ - sed -e 's/.* version //' -e 's/ built.*//' -e 's/ with.*//'` - versionnum="`echo $version | sed -e 's/\.//g' -e 's/_//g'`" - versionnum=`expr $versionnum - $c` - echo "$versionnum $perl" >>$tmpfile - found=1 - fi - done - c=`expr $c + 1` - done - if [ $found = 1 ]; then - perl="`cat $tmpfile | sort -u | tail -1 | cut '-d ' -f2`" - rm -f $tmpfile - echo "$perl" - exit 0 - fi - exit 1 - fi - - # MAGIC SITUATION - # C pre-processor (cpp) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then - cat >$tmpfile.c < - Syntax Error -EOT - # 1. try the standard cc -E approach - cpp="${CC-cc} -E" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 2. try the cc -E approach and GCC's -traditional-ccp option - cpp="${CC-cc} -E -traditional-cpp" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 3. try a standalone cpp command in path and lib dirs - for path in $paths /lib /usr/lib /usr/local/lib; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then - cpp="$path/cpp" - break - fi - done - if [ ".$cpp" != . ]; then - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # ok, we gave up... - cpp='' - fi - fi - fi - fi - rm -f $tmpfile.c $tmpfile.out - if [ ".$cpp" != . ]; then - echo "$cpp" - exit 0 - fi - exit 1 + # determine string out of filename + # (do NOT try to optimize this in any way because of portability) + filestr=`echo $file |\ + tr 'abcdefghijklmnopqrstuvwxyz./%+' \ + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` + + # generate uppercase prefix + prefixupper=`echo $prefix |\ + tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + + # create the version file according the the selected language + echo "new version: ${vLong}" + + cp /dev/null $file + case $opt_l in + txt ) + echo >>$file "" + echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)" + echo >>$file " [automatically generated and maintained by GNU shtool]" + echo >>$file "" + echo >>$file " $vTeX" + echo >>$file "" + ;; + c ) + echo >>$file "/*" + echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)" + echo >>$file "** [automatically generated and maintained by GNU shtool]" + echo >>$file "*/" + echo >>$file "" + echo >>$file "#ifdef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "#ifndef _${filestr}_" + echo >>$file "#define _${filestr}_" + echo >>$file "" + echo >>$file "#define ${prefixupper}VERSION ${vHex}" + echo >>$file "" + echo >>$file "typedef struct {" + echo >>$file " const int v_hex;" + echo >>$file " const char *v_short;" + echo >>$file " const char *v_long;" + echo >>$file " const char *v_tex;" + echo >>$file " const char *v_gnu;" + echo >>$file " const char *v_web;" + echo >>$file " const char *v_sccs;" + echo >>$file " const char *v_rcs;" + echo >>$file "} ${prefix}version_t;" + echo >>$file "" + echo >>$file "extern ${prefix}version_t ${prefix}version;" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_ */" + echo >>$file "" + echo >>$file "#else /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + echo >>$file "#define _${filestr}_AS_HEADER_" + echo >>$file "#include \"${file}\"" + echo >>$file "#undef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "${prefix}version_t ${prefix}version = {" + echo >>$file " ${vHex}," + echo >>$file " \"${vShort}\"," + echo >>$file " \"${vLong}\"," + echo >>$file " \"${vTeX}\"," + echo >>$file " \"${vGNU}\"," + echo >>$file " \"${vWeb}\"," + echo >>$file " \"${vSCCS}\"," + echo >>$file " \"${vRCS}\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + ;; + m4 ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: M4)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "m4_define([v_hex], [${vHex}])" + echo >>$file "m4_define([v_short], [${vShort}])" + echo >>$file "m4_define([v_long], [${vLong}])" + echo >>$file "m4_define([v_tex], [${vTeX}])" + echo >>$file "m4_define([v_gnu], [${vGNU}])" + echo >>$file "m4_define([v_web], [${vWeb}])" + echo >>$file "m4_define([v_sccs], [${vSCCS}])" + echo >>$file "m4_define([v_rcs], [${vRCS}])" + echo >>$file "" + ;; + perl ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Perl)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "my \$${prefix}version = {" + echo >>$file " 'v_hex' => ${vHex}," + echo >>$file " 'v_short' => \"${vShort}\"," + echo >>$file " 'v_long' => \"${vLong}\"," + echo >>$file " 'v_tex' => \"${vTeX}\"," + echo >>$file " 'v_gnu' => \"${vGNU}\"," + echo >>$file " 'v_web' => \"${vWeb}\"," + echo >>$file " 'v_sccs' => \"${vSCCS}\"," + echo >>$file " 'v_rcs' => \"\\${vRCS}/\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "1;" + echo >>$file "" + ;; + python ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Python)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "class ${prefix}version:" + echo >>$file " v_hex = ${vHex}" + echo >>$file " v_short = \"${vShort}\"" + echo >>$file " v_long = \"${vLong}\"" + echo >>$file " v_tex = \"${vTeX}\"" + echo >>$file " v_gnu = \"${vGNU}\"" + echo >>$file " v_web = \"${vWeb}\"" + echo >>$file " v_sccs = \"${vSCCS}\"" + echo >>$file " v_rcs = \"${vRCS}\"" + echo >>$file "" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 + shtool_exit 1 + ;; + esac fi - - # STANDARD SITUATION - # iterate over names - for name in $namelist; do - # iterate over paths - for path in $paths; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then - if [ ".$opt_s" != .yes ]; then - echo "$path/$name" 2>&1 - fi - exit 0 - fi - done - done - exit 1 + + shtool_exit 0 ;; esac -exit 0 +shtool_exit 0 -##EOF## -- cgit v1.2.3 From a4cd8f550635922984b2f0d52c718be9aaa5e662 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 13 Oct 2020 13:00:43 +0200 Subject: configure_in Gbp-Pq: Name 05_configure_in.diff --- Makefile.in | 2 +- configure.in | 204 ++++++++++++++++++------------------------------------ tests/Makefile.in | 4 +- 3 files changed, 69 insertions(+), 141 deletions(-) diff --git a/Makefile.in b/Makefile.in index c1f41c0..b2f802d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,7 +4,7 @@ RESULT=pcap LIBINSTALL_FILES=$(wildcard *.mli *.cmi *.cma *.cmx *.cmxa *.a *.so) CC=@CC@ -CFLAGS=@CFLAGS@ +CFLAGS=@CFLAGS@ @cp4flag@ CLIBS=$(foreach lib, @LIBS@, $(subst -l,,${lib})) LDFLAGS=@LDFLAGS@ IDLFLAGS=-no-include diff --git a/configure.in b/configure.in index 0211f96..0ace885 100644 --- a/configure.in +++ b/configure.in @@ -1,162 +1,90 @@ +dnl Standard configuration + AC_INIT(pcap.idl) -AC_MSG_CHECKING(for version) +AC_MSG_CHECKING([for version]) VERSION="`etc/shtool version -l txt -d short VERSION`" -AC_MSG_RESULT "Configuring Version $VERSION" +AC_MSG_RESULT([Configuring Version $VERSION]) AC_SUBST(VERSION) - -AC_MSG_CHECKING(for platform) -ARCH="`etc/shtool guessos`" -AC_MSG_RESULT "$ARCH" +AC_MSG_CHECKING([for platform]) +ARCH="`etc/shtool platform`" +AC_MSG_RESULT([$ARCH]) AC_SUBST(ARCH) -AC_CHECKING(for ocaml compiler and tools) -AC_CHECK_PROG(ocamlc,ocamlc,ocamlc) -AC_CHECK_PROG(ocamlopt,ocamlopt,ocamlopt) -AC_CHECK_PROG(ocamlfind,ocamlfind,ocamlfind,ocamlidl) AC_PROG_INSTALL AC_SUBST(INSTALL) -AC_CHECKING(for C compiler) AC_PROG_CC - -AC_CHECKING(for C header files) AC_HEADER_STDC -# -camlidldir="" -camlidllibdir="" -ffcalldir="" -ffcallarchive="" -libpcapdir="" -cp4flag="" -# - -AC_ARG_ENABLE(examples, - [ --enable-examples build example programs [default=no]],,enable_examples="no") - -# -AC_CHECKING(libraries) - -#AC_CHECKING(for pcap library) -#if test "$ac_cv_lib_pcap" == "no"; then -# #dirs="/usr/local/lib -# # /usr/local/lib -# # /usr/lib -# # /lib" -# dirs="/home/x25/code/MLpcap/libpcap-0.8.3" -# for d in $dirs; do -# test -f "$d/libpcap.a" && LDFLAGS="-L$d" -# done -# AC_CHECKING(in more locations) -# unset ac_cv_lib_pcap -#fi - -if test "x$enable_examples" = "xyes"; then - -AC_ARG_WITH(camlidl-lib, -[ --with-camlidl-lib[=DIR] libcamlidl.a location], -[ - camlidllibdir=$withval - if ! test -f "$camlidllibdir/libcamlidl.a"; then - AC_MSG_ERROR(can't find libcamlidl.a in $camlidllibdir) - fi -], -[ - AC_MSG_ERROR(missing --with-camlidl-lib) -]) - -AC_CHECKING(for ffcall callback library) - dirs="/usr/local/lib - /usr/lib - /lib" - for d in $dirs; do - test -f "$d/libcallback.a" && ffcallarchive="$d/libcallback.a" - done +dnl Ocaml + +AC_CHECK_PROG(ocamlc,ocamlc,ocamlc,no) +if test "x$ocamlc" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlc.]) fi -AC_ARG_WITH(libpcap, -[ --with-libpcap[=DIR] libpcap.a/.so location], -[ - libpcapdir=$withval - if ! test -f "$libpcapdir/libpcap.a"; then - AC_MSG_ERROR(can't find libpcap.a in $libpcapdir) - fi - - # check for libpcap >=0.8, set CFLAGS and camlp4 flag - `which strings` "$libpcapdir/libpcap.a"|grep to_descr 2>&1 >/dev/null - test $? && CFLAGS="$CFLAGS -DHAVE_PCAP08" && cp4flag="HAVE_PCAP08" -], -[ - #AC_MSG_ERROR(missing --with-libpcap) - # try the default - libpcapdir="/usr/lib" -]) - - -AC_CHECKING(for pcap header files) - -AC_ARG_WITH(pcap-header, -[ --with-pcap-header[=DIR] pcap header installation directory], -[ - pcapheaderdir=$withval - AC_CHECK_HEADER($pcapheaderdir/pcap.h, - [ CFLAGS="$CFLAGS -I$pcapheaderdir"; HAVE_PCAP_HEADER="yes" ]) -], -[ - AC_CHECK_HEADER(pcap.h, [HAVE_PCAP_HEADER="yes"]) -]) - -if test -z "$HAVE_PCAP_HEADER"; then - AC_MSG_ERROR(can't find pcap.h) +AC_CHECK_PROG(ocamlopt,ocamlopt,ocamlopt) +if test "x$ocamlopt" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlopt.]) fi -AC_CHECKING(for camlidl header) - -AC_ARG_WITH(camlidl, -[ --with-camlidl[=DIR] camlidl installation directory], -[ - camlidldir=$withval - AC_CHECK_HEADER($camlidldir/caml/camlidlruntime.h, - [ CFLAGS="$CFLAGS -I$camlidldir"; HAVE_CAMLIDLRUNTIME_H="yes" ]) -], -[ - AC_CHECK_HEADER(caml/camlidlruntime.h, [HAVE_CAMLIDLRUNTIME_H="yes"]) -]) - -if test -z "$HAVE_CAMLIDLRUNTIME_H"; then - AC_MSG_ERROR(can't find camlidlruntime.h) +AC_CHECK_PROG(ocamlfind,ocamlfind,ocamlfind) +if test "x$ocamlfind" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlfind.]) fi -AC_CHECKING(for ffcall callback header) - -AC_ARG_WITH(ffcall, -[ --with-ffcall[=DIR] ffcall installation directory], -[ - ffcalldir=$withval - AC_CHECK_HEADER($ffcalldir/callback.h, - [ CFLAGS="$CFLAGS -I$ffcalldir"; HAVE_CALLBACK_H="yes" ]) -], -[ - AC_CHECK_HEADER(callback.h,[HAVE_CALLBACK_H="yes"]) -]) - -if test -z "$HAVE_CALLBACK_H"; then - AC_MSG_ERROR(can't find callback.h) +dnl ------- +dnl Camlidl +dnl ------- + +AC_CHECK_PROG(camlidl,camlidl,camlidl) +if test "x$camlidl" = "xno"; then + AC_MSG_ERROR([Cannot find camlidl.]) fi -AC_SUBST(camlidldir) -AC_SUBST(camlidllibdir) -AC_SUBST(ffcalldir) -AC_SUBST(ffcallarchive) -AC_SUBST(libpcapdir) -AC_SUBST(cp4flag) +dnl Header + +AC_CHECK_HEADER(caml/camlidlruntime.h,, + AC_MSG_ERROR([can't find camlidlruntime.h])) + +dnl ------- +dnl Libpcap +dnl ------- -if test "x$enable_examples" = "xyes"; then - output="[Makefile tests/Makefile]" -else - output="Makefile" +dnl Version 0.8 +AC_CHECK_LIB(pcap, + pcap_datalink_val_to_description, + [AC_DEFINE(HAVE_PCAP08) + cp4flag="-DHAVE_PCAP08" + LIBS="-lpcap $LIBS"]) + +if test "x$cp4flag" = "x"; then + AC_CHECK_LIB(pcap, + pcap_open_live,, + AC_MSG_ERROR([can't find pcap library].)) fi -AC_OUTPUT($output) +AC_SUBST(cp4flag) + +dnl Header + +AC_CHECK_HEADER(pcap.h,, + AC_MSG_ERROR(can't find pcap.h)) + +dnl --------------- +dnl Ffcall callback +dnl --------------- + +AC_CHECK_LIB(callback, + alloc_trampoline_r,, + AC_MSG_ERROR([can't find callback library.])) + +dnl Header + +AC_CHECK_HEADER(callback.h) + +dnl Makefile generation + +AC_OUTPUT([Makefile tests/Makefile]) diff --git a/tests/Makefile.in b/tests/Makefile.in index ea6abce..9c3b4ab 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -12,7 +12,7 @@ pcap_open_offline all: $(TARGETS) $(TARGETS): $(OBJECTS) - $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma -I @camlidllibdir@ -ccopt -L@libpcapdir@ -cclib -lpcap @ffcallarchive@ + $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma clean: rm -f *.cmo *.cmi $(TARGETS) @@ -20,5 +20,5 @@ clean: .SUFFIXES: .ml .cmo .cmi .ml.cmo: - $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo -D@cp4flag@' -I .. -c $< + $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -I .. -c $< -- cgit v1.2.3 From 975985f883d1d7f4a5267a68522c08113631edba Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 13 Oct 2020 13:00:43 +0200 Subject: configure Gbp-Pq: Name 06_configure.diff --- configure | 4928 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 2825 insertions(+), 2103 deletions(-) diff --git a/configure b/configure index 4812885..bdf9387 100755 --- a/configure +++ b/configure @@ -1,9 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. +# Generated by GNU Autoconf 2.60a. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -17,20 +17,80 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -41,21 +101,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,206 +124,436 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -274,42 +565,109 @@ ac_unique_file="pcap.idl" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION ARCH ocamlc ocamlopt ocamlfind INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP camlidldir camlidllibdir ffcalldir ffcallarchive libpcapdir cp4flag LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +VERSION +ARCH +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +INSTALL +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +ocamlc +ocamlopt +ocamlfind +camlidl +cp4flag +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -336,34 +694,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -385,12 +757,18 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. @@ -398,7 +776,17 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` @@ -407,11 +795,7 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -438,6 +822,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -462,13 +852,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -533,6 +926,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -589,11 +992,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` @@ -602,7 +1001,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -633,8 +1032,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -654,27 +1052,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -701,74 +1091,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -797,14 +1189,11 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -817,15 +1206,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -836,113 +1232,99 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-examples build example programs default=no - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-camlidl-lib=DIR libcamlidl.a location - --with-libpcap=DIR libpcap.a/.so location - --with-pcap-header=DIR pcap header installation directory - --with-camlidl=DIR camlidl installation directory - --with-ffcall=DIR ffcall installation directory - Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.60a -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.60a. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -961,7 +1343,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -975,6 +1357,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -996,7 +1379,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1007,7 +1389,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1015,23 +1397,21 @@ do 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1042,8 +1422,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1056,20 +1436,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1080,22 +1474,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1107,26 +1507,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1157,14 +1555,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1180,8 +1581,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1193,12 +1594,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1211,20 +1611,19 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1241,12 +1640,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1263,156 +1656,58 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for version" >&5 -echo $ECHO_N "checking for version... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for version" >&5 +echo $ECHO_N "checking for version... $ECHO_C" >&6; } VERSION="`etc/shtool version -l txt -d short VERSION`" -echo "$as_me:$LINENO: result: " >&5 -echo "${ECHO_T}" >&6 "Configuring Version $VERSION" - - - -echo "$as_me:$LINENO: checking for platform" >&5 -echo $ECHO_N "checking for platform... $ECHO_C" >&6 -ARCH="`etc/shtool guessos`" -echo "$as_me:$LINENO: result: " >&5 -echo "${ECHO_T}" >&6 "$ARCH" - -{ echo "$as_me:$LINENO: checking for ocaml compiler and tools..." >&5 -echo "$as_me: checking for ocaml compiler and tools..." >&6;} -# Extract the first word of "ocamlc", so it can be a program name with args. -set dummy ocamlc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlc"; then - ac_cv_prog_ocamlc="$ocamlc" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlc="ocamlc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ocamlc=$ac_cv_prog_ocamlc -if test -n "$ocamlc"; then - echo "$as_me:$LINENO: result: $ocamlc" >&5 -echo "${ECHO_T}$ocamlc" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -# Extract the first word of "ocamlopt", so it can be a program name with args. -set dummy ocamlopt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlopt"; then - ac_cv_prog_ocamlopt="$ocamlopt" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlopt="ocamlopt" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ocamlopt=$ac_cv_prog_ocamlopt -if test -n "$ocamlopt"; then - echo "$as_me:$LINENO: result: $ocamlopt" >&5 -echo "${ECHO_T}$ocamlopt" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +{ echo "$as_me:$LINENO: result: Configuring Version $VERSION" >&5 +echo "${ECHO_T}Configuring Version $VERSION" >&6; } -# Extract the first word of "ocamlfind", so it can be a program name with args. -set dummy ocamlfind; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlfind+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlfind"; then - ac_cv_prog_ocamlfind="$ocamlfind" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlfind="ocamlfind" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - test -z "$ac_cv_prog_ocamlfind" && ac_cv_prog_ocamlfind="ocamlidl" -fi -fi -ocamlfind=$ac_cv_prog_ocamlfind -if test -n "$ocamlfind"; then - echo "$as_me:$LINENO: result: $ocamlfind" >&5 -echo "${ECHO_T}$ocamlfind" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +{ echo "$as_me:$LINENO: checking for platform" >&5 +echo $ECHO_N "checking for platform... $ECHO_C" >&6; } +ARCH="`etc/shtool platform`" +{ echo "$as_me:$LINENO: result: $ARCH" >&5 +echo "${ECHO_T}$ARCH" >&6; } ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -1425,9 +1720,10 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1441,6 +1737,7 @@ do case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -1448,40 +1745,41 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1493,8 +1791,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ echo "$as_me:$LINENO: checking for C compiler..." >&5 -echo "$as_me: checking for C compiler..." >&6;} ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1503,8 +1799,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1517,32 +1813,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1555,36 +1853,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1597,74 +1910,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1678,7 +1951,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1689,6 +1962,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1706,22 +1980,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1734,36 +2009,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1776,29 +2053,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1811,27 +2104,40 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1851,47 +2157,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; + # We found the default executable, but exeext='' is most + # certainly right. + break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; * ) - break;; + break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1903,19 +2239,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -1934,22 +2272,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -1960,10 +2303,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + break;; * ) break;; esac done @@ -1976,19 +2318,18 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2004,14 +2345,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2029,17 +2376,16 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2058,14 +2404,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2074,25 +2442,28 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2108,14 +2479,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2124,239 +2517,278 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; + int main () { -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' \ - '#include ' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - : + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue + fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; int main () { -exit (42); +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - break + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h +rm -f conftest.$ac_ext +CC=$ac_save_CC + fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2364,16 +2796,13 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for C header files..." >&5 -echo "$as_me: checking for C header files..." >&6;} - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2395,7 +2824,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2406,10 +2834,15 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2418,6 +2851,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2433,12 +2867,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2446,8 +2880,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2456,6 +2895,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2473,6 +2913,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2490,8 +2931,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -2502,7 +2943,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2513,10 +2953,15 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2525,6 +2970,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2540,12 +2986,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2553,8 +2999,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2563,6 +3014,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2580,6 +3032,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2602,28 +3055,174 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2643,14 +3242,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2659,14 +3280,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2688,7 +3309,6 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2713,21 +3333,21 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -2738,19 +3358,28 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + || toupper (i) != TOUPPER (i)) + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2763,12 +3392,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -2778,100 +3409,181 @@ _ACEOF fi -# -camlidldir="" -camlidllibdir="" -ffcalldir="" -ffcallarchive="" -libpcapdir="" -cp4flag="" -# - -# Check whether --enable-examples or --disable-examples was given. -if test "${enable_examples+set}" = set; then - enableval="$enable_examples" +# Extract the first word of "ocamlc", so it can be a program name with args. +set dummy ocamlc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - enable_examples="no" -fi; - -# -{ echo "$as_me:$LINENO: checking libraries..." >&5 -echo "$as_me: checking libraries..." >&6;} - -#AC_CHECKING(for pcap library) -#if test "$ac_cv_lib_pcap" == "no"; then -# #dirs="/usr/local/lib -# # /usr/local/lib -# # /usr/lib -# # /lib" -# dirs="/home/x25/code/MLpcap/libpcap-0.8.3" -# for d in $dirs; do -# test -f "$d/libpcap.a" && LDFLAGS="-L$d" -# done -# AC_CHECKING(in more locations) -# unset ac_cv_lib_pcap -#fi - -if test "x$enable_examples" = "xyes"; then - - -# Check whether --with-camlidl-lib or --without-camlidl-lib was given. -if test "${with_camlidl_lib+set}" = set; then - withval="$with_camlidl_lib" - - camlidllibdir=$withval - if ! test -f "$camlidllibdir/libcamlidl.a"; then - { { echo "$as_me:$LINENO: error: can't find libcamlidl.a in $camlidllibdir" >&5 -echo "$as_me: error: can't find libcamlidl.a in $camlidllibdir" >&2;} - { (exit 1); exit 1; }; } - fi - + if test -n "$ocamlc"; then + ac_cv_prog_ocamlc="$ocamlc" # Let the user override the test. else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlc="ocamlc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - { { echo "$as_me:$LINENO: error: missing --with-camlidl-lib" >&5 -echo "$as_me: error: missing --with-camlidl-lib" >&2;} - { (exit 1); exit 1; }; } - -fi; - -{ echo "$as_me:$LINENO: checking for ffcall callback library..." >&5 -echo "$as_me: checking for ffcall callback library..." >&6;} - dirs="/usr/local/lib - /usr/lib - /lib" - for d in $dirs; do - test -f "$d/libcallback.a" && ffcallarchive="$d/libcallback.a" - done + test -z "$ac_cv_prog_ocamlc" && ac_cv_prog_ocamlc="no" +fi +fi +ocamlc=$ac_cv_prog_ocamlc +if test -n "$ocamlc"; then + { echo "$as_me:$LINENO: result: $ocamlc" >&5 +echo "${ECHO_T}$ocamlc" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -# Check whether --with-libpcap or --without-libpcap was given. -if test "${with_libpcap+set}" = set; then - withval="$with_libpcap" - - libpcapdir=$withval - if ! test -f "$libpcapdir/libpcap.a"; then - { { echo "$as_me:$LINENO: error: can't find libpcap.a in $libpcapdir" >&5 -echo "$as_me: error: can't find libpcap.a in $libpcapdir" >&2;} +if test "x$ocamlc" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlc." >&5 +echo "$as_me: error: Cannot find ocamlc." >&2;} { (exit 1); exit 1; }; } - fi - - # check for libpcap >=0.8, set CFLAGS and camlp4 flag - `which strings` "$libpcapdir/libpcap.a"|grep to_descr 2>&1 >/dev/null - test $? && CFLAGS="$CFLAGS -DHAVE_PCAP08" && cp4flag="HAVE_PCAP08" - -else - - #AC_MSG_ERROR(missing --with-libpcap) - # try the default - libpcapdir="/usr/lib" +fi -fi; +# Extract the first word of "ocamlopt", so it can be a program name with args. +set dummy ocamlopt; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ocamlopt"; then + ac_cv_prog_ocamlopt="$ocamlopt" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlopt="ocamlopt" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS +fi +fi +ocamlopt=$ac_cv_prog_ocamlopt +if test -n "$ocamlopt"; then + { echo "$as_me:$LINENO: result: $ocamlopt" >&5 +echo "${ECHO_T}$ocamlopt" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$ocamlopt" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlopt." >&5 +echo "$as_me: error: Cannot find ocamlopt." >&2;} + { (exit 1); exit 1; }; } +fi + +# Extract the first word of "ocamlfind", so it can be a program name with args. +set dummy ocamlfind; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlfind+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ocamlfind"; then + ac_cv_prog_ocamlfind="$ocamlfind" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlfind="ocamlfind" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ocamlfind=$ac_cv_prog_ocamlfind +if test -n "$ocamlfind"; then + { echo "$as_me:$LINENO: result: $ocamlfind" >&5 +echo "${ECHO_T}$ocamlfind" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$ocamlfind" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlfind." >&5 +echo "$as_me: error: Cannot find ocamlfind." >&2;} + { (exit 1); exit 1; }; } +fi + + +# Extract the first word of "camlidl", so it can be a program name with args. +set dummy camlidl; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_camlidl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$camlidl"; then + ac_cv_prog_camlidl="$camlidl" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_camlidl="camlidl" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +camlidl=$ac_cv_prog_camlidl +if test -n "$camlidl"; then + { echo "$as_me:$LINENO: result: $camlidl" >&5 +echo "${ECHO_T}$camlidl" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$camlidl" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find camlidl." >&5 +echo "$as_me: error: Cannot find camlidl." >&2;} + { (exit 1); exit 1; }; } +fi -{ echo "$as_me:$LINENO: checking for pcap header files..." >&5 -echo "$as_me: checking for pcap header files..." >&6;} # On IRIX 5.3, sys/types and inttypes.h are conflicting. @@ -2884,16 +3596,15 @@ echo "$as_me: checking for pcap header files..." >&6;} for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2904,14 +3615,36 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2920,12 +3653,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -2936,44 +3671,58 @@ fi done - -# Check whether --with-pcap-header or --without-pcap-header was given. -if test "${with_pcap_header+set}" = set; then - withval="$with_pcap_header" - - pcapheaderdir=$withval - as_ac_Header=`echo "ac_cv_header_$pcapheaderdir/pcap.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $pcapheaderdir/pcap.h" >&5 -echo $ECHO_N "checking for $pcapheaderdir/pcap.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then + { echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 +echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6; } +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 +echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $pcapheaderdir/pcap.h usability" >&5 -echo $ECHO_N "checking $pcapheaderdir/pcap.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking caml/camlidlruntime.h usability" >&5 +echo $ECHO_N "checking caml/camlidlruntime.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$pcapheaderdir/pcap.h> +#include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2982,26 +3731,31 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $pcapheaderdir/pcap.h presence" >&5 -echo $ECHO_N "checking $pcapheaderdir/pcap.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking caml/camlidlruntime.h presence" >&5 +echo $ECHO_N "checking caml/camlidlruntime.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$pcapheaderdir/pcap.h> +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3010,6 +3764,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3024,383 +3779,294 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for $pcapheaderdir/pcap.h" >&5 -echo $ECHO_N "checking for $pcapheaderdir/pcap.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 +echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6; } +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + ac_cv_header_caml_camlidlruntime_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 +echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$pcapheaderdir"; HAVE_PCAP_HEADER="yes" +if test $ac_cv_header_caml_camlidlruntime_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: can't find camlidlruntime.h" >&5 +echo "$as_me: error: can't find camlidlruntime.h" >&2;} + { (exit 1); exit 1; }; } fi -else - if test "${ac_cv_header_pcap_h+set}" = set; then - echo "$as_me:$LINENO: checking for pcap.h" >&5 -echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6 -if test "${ac_cv_header_pcap_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for pcap_datalink_val_to_description in -lpcap" >&5 +echo $ECHO_N "checking for pcap_datalink_val_to_description in -lpcap... $ECHO_C" >&6; } +if test "${ac_cv_lib_pcap_pcap_datalink_val_to_description+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 -echo "${ECHO_T}$ac_cv_header_pcap_h" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking pcap.h usability" >&5 -echo $ECHO_N "checking pcap.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcap_datalink_val_to_description (); +int +main () +{ +return pcap_datalink_val_to_description (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking pcap.h presence" >&5 -echo $ECHO_N "checking pcap.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + (exit $ac_status); }; }; then + ac_cv_lib_pcap_pcap_datalink_val_to_description=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: pcap.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: pcap.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: pcap.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for pcap.h" >&5 -echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6 -if test "${ac_cv_header_pcap_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_pcap_h=$ac_header_preproc + ac_cv_lib_pcap_pcap_datalink_val_to_description=no fi -echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 -echo "${ECHO_T}$ac_cv_header_pcap_h" >&6 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test $ac_cv_header_pcap_h = yes; then - HAVE_PCAP_HEADER="yes" -fi - - - -fi; +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcap_pcap_datalink_val_to_description" >&5 +echo "${ECHO_T}$ac_cv_lib_pcap_pcap_datalink_val_to_description" >&6; } +if test $ac_cv_lib_pcap_pcap_datalink_val_to_description = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_PCAP08 1 +_ACEOF -if test -z "$HAVE_PCAP_HEADER"; then - { { echo "$as_me:$LINENO: error: can't find pcap.h" >&5 -echo "$as_me: error: can't find pcap.h" >&2;} - { (exit 1); exit 1; }; } + cp4flag="-DHAVE_PCAP08" + LIBS="-lpcap $LIBS" fi -{ echo "$as_me:$LINENO: checking for camlidl header..." >&5 -echo "$as_me: checking for camlidl header..." >&6;} - -# Check whether --with-camlidl or --without-camlidl was given. -if test "${with_camlidl+set}" = set; then - withval="$with_camlidl" +if test "x$cp4flag" = "x"; then - camlidldir=$withval - as_ac_Header=`echo "ac_cv_header_$camlidldir/caml/camlidlruntime.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $camlidldir/caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for $camlidldir/caml/camlidlruntime.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for pcap_open_live in -lpcap" >&5 +echo $ECHO_N "checking for pcap_open_live in -lpcap... $ECHO_C" >&6; } +if test "${ac_cv_lib_pcap_pcap_open_live+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $camlidldir/caml/camlidlruntime.h usability" >&5 -echo $ECHO_N "checking $camlidldir/caml/camlidlruntime.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$camlidldir/caml/camlidlruntime.h> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcap_open_live (); +int +main () +{ +return pcap_open_live (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_pcap_pcap_open_live=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_cv_lib_pcap_pcap_open_live=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $camlidldir/caml/camlidlruntime.h presence" >&5 -echo $ECHO_N "checking $camlidldir/caml/camlidlruntime.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$camlidldir/caml/camlidlruntime.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcap_pcap_open_live" >&5 +echo "${ECHO_T}$ac_cv_lib_pcap_pcap_open_live" >&6; } +if test $ac_cv_lib_pcap_pcap_open_live = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPCAP 1 +_ACEOF - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 + LIBS="-lpcap $LIBS" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $camlidldir/caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for $camlidldir/caml/camlidlruntime.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + { { echo "$as_me:$LINENO: error: can't find pcap library." >&5 +echo "$as_me: error: can't find pcap library." >&2;} + { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$camlidldir"; HAVE_CAMLIDLRUNTIME_H="yes" -fi -else - if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then - echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6 -if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then +if test "${ac_cv_header_pcap_h+set}" = set; then + { echo "$as_me:$LINENO: checking for pcap.h" >&5 +echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pcap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 -echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 +echo "${ECHO_T}$ac_cv_header_pcap_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking caml/camlidlruntime.h usability" >&5 -echo $ECHO_N "checking caml/camlidlruntime.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pcap.h usability" >&5 +echo $ECHO_N "checking pcap.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3409,26 +4075,31 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking caml/camlidlruntime.h presence" >&5 -echo $ECHO_N "checking caml/camlidlruntime.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pcap.h presence" >&5 +echo $ECHO_N "checking pcap.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3437,6 +4108,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3451,229 +4123,164 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pcap.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: pcap.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pcap.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pcap.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pcap.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pcap.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pcap.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6 -if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for pcap.h" >&5 +echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pcap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_caml_camlidlruntime_h=$ac_header_preproc + ac_cv_header_pcap_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 -echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 +echo "${ECHO_T}$ac_cv_header_pcap_h" >&6; } fi -if test $ac_cv_header_caml_camlidlruntime_h = yes; then - HAVE_CAMLIDLRUNTIME_H="yes" -fi - - - -fi; - -if test -z "$HAVE_CAMLIDLRUNTIME_H"; then - { { echo "$as_me:$LINENO: error: can't find camlidlruntime.h" >&5 -echo "$as_me: error: can't find camlidlruntime.h" >&2;} +if test $ac_cv_header_pcap_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: can't find pcap.h" >&5 +echo "$as_me: error: can't find pcap.h" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking for ffcall callback header..." >&5 -echo "$as_me: checking for ffcall callback header..." >&6;} -# Check whether --with-ffcall or --without-ffcall was given. -if test "${with_ffcall+set}" = set; then - withval="$with_ffcall" - ffcalldir=$withval - as_ac_Header=`echo "ac_cv_header_$ffcalldir/callback.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ffcalldir/callback.h" >&5 -echo $ECHO_N "checking for $ffcalldir/callback.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then + +{ echo "$as_me:$LINENO: checking for alloc_trampoline_r in -lcallback" >&5 +echo $ECHO_N "checking for alloc_trampoline_r in -lcallback... $ECHO_C" >&6; } +if test "${ac_cv_lib_callback_alloc_trampoline_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ffcalldir/callback.h usability" >&5 -echo $ECHO_N "checking $ffcalldir/callback.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcallback $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ffcalldir/callback.h> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char alloc_trampoline_r (); +int +main () +{ +return alloc_trampoline_r (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_callback_alloc_trampoline_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_cv_lib_callback_alloc_trampoline_r=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $ffcalldir/callback.h presence" >&5 -echo $ECHO_N "checking $ffcalldir/callback.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ffcalldir/callback.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_callback_alloc_trampoline_r" >&5 +echo "${ECHO_T}$ac_cv_lib_callback_alloc_trampoline_r" >&6; } +if test $ac_cv_lib_callback_alloc_trampoline_r = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCALLBACK 1 +_ACEOF - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 + LIBS="-lcallback $LIBS" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ffcalldir/callback.h" >&5 -echo $ECHO_N "checking for $ffcalldir/callback.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$ffcalldir"; HAVE_CALLBACK_H="yes" + { { echo "$as_me:$LINENO: error: can't find callback library." >&5 +echo "$as_me: error: can't find callback library." >&2;} + { (exit 1); exit 1; }; } fi -else - - if test "${ac_cv_header_callback_h+set}" = set; then - echo "$as_me:$LINENO: checking for callback.h" >&5 -echo $ECHO_N "checking for callback.h... $ECHO_C" >&6 +if test "${ac_cv_header_callback_h+set}" = set; then + { echo "$as_me:$LINENO: checking for callback.h" >&5 +echo $ECHO_N "checking for callback.h... $ECHO_C" >&6; } if test "${ac_cv_header_callback_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 -echo "${ECHO_T}$ac_cv_header_callback_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 +echo "${ECHO_T}$ac_cv_header_callback_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking callback.h usability" >&5 -echo $ECHO_N "checking callback.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking callback.h usability" >&5 +echo $ECHO_N "checking callback.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3683,14 +4290,36 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3699,17 +4328,17 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking callback.h presence" >&5 -echo $ECHO_N "checking callback.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking callback.h presence" >&5 +echo $ECHO_N "checking callback.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3717,8 +4346,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3727,6 +4361,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3741,82 +4376,53 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: callback.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: callback.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: callback.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: callback.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: callback.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: callback.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: callback.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: callback.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: callback.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: callback.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: callback.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: callback.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for callback.h" >&5 -echo $ECHO_N "checking for callback.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for callback.h" >&5 +echo $ECHO_N "checking for callback.h... $ECHO_C" >&6; } if test "${ac_cv_header_callback_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_callback_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 -echo "${ECHO_T}$ac_cv_header_callback_h" >&6 - -fi -if test $ac_cv_header_callback_h = yes; then - HAVE_CALLBACK_H="yes" -fi - - - -fi; - -if test -z "$HAVE_CALLBACK_H"; then - { { echo "$as_me:$LINENO: error: can't find callback.h" >&5 -echo "$as_me: error: can't find callback.h" >&2;} - { (exit 1); exit 1; }; } -fi - - - +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 +echo "${ECHO_T}$ac_cv_header_callback_h" >&6; } +fi -if test "x$enable_examples" = "xyes"; then - output="Makefile tests/Makefile" -else - output="Makefile" -fi +ac_config_files="$ac_config_files Makefile tests/Makefile" - ac_config_files="$ac_config_files $output" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -3835,39 +4441,58 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -3876,63 +4501,48 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, +# take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF +ac_script=' t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -3970,20 +4580,80 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -3994,21 +4664,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -4016,200 +4687,157 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi +# CDPATH. +$as_unset CDPATH - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.60a. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4217,30 +4845,18 @@ generated by GNU Autoconf 2.57. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -4248,31 +4864,32 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.60a, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -4283,60 +4900,42 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -4352,28 +4951,43 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 - - - +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "$output" ) CONFIG_FILES="$CONFIG_FILES $output" ;; + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -4383,277 +4997,374 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@VERSION@,$VERSION,;t t -s,@ARCH@,$ARCH,;t t -s,@ocamlc@,$ocamlc,;t t -s,@ocamlopt@,$ocamlopt,;t t -s,@ocamlfind@,$ocamlfind,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@INSTALL@,$INSTALL,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@camlidldir@,$camlidldir,;t t -s,@camlidllibdir@,$camlidllibdir,;t t -s,@ffcalldir@,$ffcalldir,;t t -s,@ffcallarchive@,$ffcallarchive,;t t -s,@libpcapdir@,$libpcapdir,;t t -s,@cp4flag@,$cp4flag,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +VERSION!$VERSION$ac_delim +ARCH!$ARCH$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +INSTALL!$INSTALL$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ocamlc!$ocamlc$ac_delim +ocamlopt!$ocamlopt$ac_delim +ocamlfind!$ocamlfind$ac_delim +camlidl!$camlidl$ac_delim +cp4flag!$cp4flag$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 60; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -4661,29 +5372,40 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + + esac + +done # for ac_tag + { (exit 0); exit 0; } _ACEOF -- cgit v1.2.3 From cfe4d8ce3c48db2a60a0958ad51166ae95ad9eaf Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 13 Oct 2020 13:00:43 +0200 Subject: Use ocamlfind to compile the project Gbp-Pq: Name 02_ocamlfind_for_example.diff --- tests/Makefile.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.in b/tests/Makefile.in index 9c3b4ab..316060f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,4 +1,3 @@ -OCAMLC=ocamlc CAMLP4O=camlp4o OBJECTS = misc.cmo pcap_next.cmo pcap_loop.cmo \ @@ -12,7 +11,7 @@ pcap_open_offline all: $(TARGETS) $(TARGETS): $(OBJECTS) - $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma + ocamlfind ocamlc -package pcap -linkpkg -o $@ $@.cmo clean: rm -f *.cmo *.cmi $(TARGETS) @@ -20,5 +19,5 @@ clean: .SUFFIXES: .ml .cmo .cmi .ml.cmo: - $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -I .. -c $< + ocamlfind ocamlc -package pcap -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -c $< -- cgit v1.2.3 From f83f55c090787859cf5c77d04edd0ae055204463 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 13 Oct 2020 13:00:43 +0200 Subject: Fix META file Gbp-Pq: Name 03_correct_META.diff --- META | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/META b/META index cf95b64..c787ef1 100644 --- a/META +++ b/META @@ -1,7 +1,6 @@ name="pcap" -version="0.8" +version="0.9" description="Ocaml bindings to libpcap" requires="" archive(byte) = "pcap.cma" -archive(opt) = "pcap.cmxa" -linkopts = "-cclib -lpcap -cclib -lcallback" +archive(native) = "pcap.cmxa" -- cgit v1.2.3 From e8cbbe3b2843a7872ba85fdb7b9654f84c7da280 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Tue, 13 Oct 2020 13:00:43 +0200 Subject: Use system's libcamlidl.a Gbp-Pq: Name 07_dll_with_camlidl.diff --- OCamlMakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OCamlMakefile b/OCamlMakefile index 0d20314..eed3443 100644 --- a/OCamlMakefile +++ b/OCamlMakefile @@ -774,7 +774,7 @@ endif ifndef MSVC $(DLLSONAME): $(OBJ_LINK) $(CC) -shared $(CINCFLAGS) $(CLIBFLAGS) \ - -o $@ $(OBJ_LINK) $(CLIBS:%=-l%) + -o $@ $(OBJ_LINK) $(shell ocamlc -where)/libcamlidl.a $(CLIBS:%=-l%) endif $(RESULT).cma: $(REAL_IMPL_INTF) $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS) -- cgit v1.2.3 From 79d216b768a637aa5e2e59415a67347ab456be03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Tue, 13 Oct 2020 13:00:43 +0200 Subject: Fix detection of callback library Forwarded: no Last-Update: 2017-11-09 The callback library is now embedded in libffcall, and the symbol names have changed, hence fix the configure test. Last-Update: 2017-11-09 Gbp-Pq: Name 08_ffcall.diff --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 0ace885..ffcc4d1 100644 --- a/configure.in +++ b/configure.in @@ -77,9 +77,9 @@ dnl --------------- dnl Ffcall callback dnl --------------- -AC_CHECK_LIB(callback, - alloc_trampoline_r,, - AC_MSG_ERROR([can't find callback library.])) +AC_CHECK_LIB(ffcall, + callback_trampoline_alloc,, + AC_MSG_ERROR([can't find ffcall library.])) dnl Header -- cgit v1.2.3 From 067c4d401e7672a49f137e839380e6481cc4e5f4 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 31 Dec 2021 09:06:59 +0100 Subject: shtool Gbp-Pq: Name 04_shtool.diff --- etc/shtool | 3248 ++++++++++++++++++++---------------------------------------- 1 file changed, 1098 insertions(+), 2150 deletions(-) diff --git a/etc/shtool b/etc/shtool index 0b71ff7..c41f19f 100755 --- a/etc/shtool +++ b/etc/shtool @@ -1,12 +1,13 @@ #!/bin/sh ## ## GNU shtool -- The GNU Portable Shell Tool -## Copyright (c) 1994-1999 Ralf S. Engelschall +## Copyright (c) 1994-2004 Ralf S. Engelschall ## ## See http://www.gnu.org/software/shtool/ for more information. ## See ftp://ftp.gnu.org/gnu/shtool/ for latest version. ## -## Version 1.4.0 (02-Jul-1999) +## Version: 2.0.1 (11-Aug-2004) +## Contents: 3/19 available modules ## ## @@ -25,7 +26,7 @@ ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, ## USA, or contact Ralf S. Engelschall . ## -## Notice: Given that you include this file verbatim into your own +## NOTICE: Given that you include this file verbatim into your own ## source tree, you are justified in saying that it remains separate ## from your package, and that this way you are simply just using GNU ## shtool. So, in this situation, there is no requirement that your @@ -37,68 +38,127 @@ ## Usage: shtool [] [ [] []] ## ## Available commands: +## install Install a program, script or datafile +## platform Platform Identification Utility +## version Maintain a version information file +## +## Not available commands (because module was not built-in): ## echo Print string with optional construct expansion ## mdate Pretty-print modification time of a file or dir -## table Pretty print a field-sperarated list as a table +## table Pretty-print a field-separated list as a table ## prop Display progress with a running propeller -## move Move files with simultan substitution -## install Install a program, script or datafile +## move Move files with simultaneous substitution ## mkdir Make one or more directories ## mkln Make link with calculation of relative paths -## mkshadow Make a shadow tree +## mkshadow Make a shadow tree through symbolic links ## fixperm Fix file permissions inside a source tree -## guessos Simple OS/platform guesser +## rotate Logfile rotation +## tarball Roll distribution tarballs +## subst Apply sed(1) substitution operations ## arx Extended archive command ## slo Separate linker options by library class ## scpp Sharing C Pre-Processor -## version Generate and maintain a version information file ## path Deal with program paths ## if [ $# -eq 0 ]; then - echo "$0:ERROR: invalid command line" 1>&2 - echo "$0:HINT: run \`$0 -h' for usage" 1>&2 + echo "$0:Error: invalid command line" 1>&2 + echo "$0:Hint: run \`$0 -h' for usage" 1>&2 exit 1 fi -if [ ".$1" = ".-h" -o ".$1" = ".--help" ]; then - echo "This is shtool, version 1.4.0 (02-Jul-1999)" - echo "Copyright (c) 1994-1999 Ralf S. Engelschall " +if [ ".$1" = ".-h" ] || [ ".$1" = ".--help" ]; then + echo "This is GNU shtool, version 2.0.1 (11-Aug-2004)" + echo "Copyright (c) 1994-2004 Ralf S. Engelschall " + echo "Report bugs to " echo '' - echo "Usage: shtool [] [ [] []]" + echo "Usage: shtool [] [ [] []]" echo '' echo 'Available global :' echo ' -v, --version display shtool version information' echo ' -h, --help display shtool usage help page (this one)' + echo ' -d, --debug display shell trace information' + echo ' -r, --recreate recreate this shtool script via shtoolize' echo '' echo 'Available [] []:' - echo ' echo [-n] [-e] [ ...]' - echo ' mdate [-n] [-z] [-s] [-d] [-f] [-o] ' - echo ' table [-F] [-w] [-c] [-s] ...' - echo ' prop [-p]' - echo ' move [-v] [-t] [-e] [-p] ' - echo ' install [-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g]' - echo ' [-e] ' - echo ' mkdir [-t] [-f] [-p] [-m] [ ...]' - echo ' mkln [-t] [-f] [-s] [ ...] ' - echo ' mkshadow [-v] [-t] [-a] ' - echo ' fixperm [-v] [-t] [ ...]' - echo ' guessos ' - echo ' arx [-t] [-C] [ ...]' - echo ' slo -- -L -l [ -L -l ... ]' - echo ' scpp [-v] [-p] [-o] [-t] [-M] [-D]' - echo ' [-C] [ ...]' - echo ' version [-l] [-n] [-p] [-s] [-i]' - echo ' [-d] ' - echo ' path [-s] [-r] [-d] [-b] [-m] [-p] [ ...]' + echo ' install [-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy]' + echo ' [-C|--compare-copy] [-s|--strip] [-m|--mode ]' + echo ' [-o|--owner ] [-g|--group ] [-e|--exec' + echo ' ] [ ...] ' + echo ' platform [-F|--format ] [-S|--sep ] [-C|--conc' + echo ' ] [-L|--lower] [-U|--upper] [-v|--verbose]' + echo ' [-c|--concise] [-n|--no-newline] [-t|--type ]' + echo ' [-V|--version] [-h|--help]' + echo ' version [-l|--language ] [-n|--name ] [-p|--prefix' + echo ' ] [-s|--set ] [-e|--edit] [-i|--increase' + echo ' ] [-d|--display ] ' + echo '' + echo 'Not available (because module was not built-in):' + echo ' echo [-n|--newline] [-e|--expand] [ ...]' + echo ' mdate [-n|--newline] [-z|--zero] [-s|--shorten] [-d|--digits]' + echo ' [-f|--field-sep ] [-o|--order ] ' + echo ' table [-F|--field-sep ] [-w|--width ] [-c|--columns' + echo ' ] [-s|--strip ] ...' + echo ' prop [-p|--prefix ]' + echo ' move [-v|--verbose] [-t|--trace] [-e|--expand] [-p|--preserve]' + echo ' ' + echo ' mkdir [-t|--trace] [-f|--force] [-p|--parents] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] ' + echo ' [ ...]' + echo ' mkln [-t|--trace] [-f|--force] [-s|--symbolic] ' + echo ' [ ...] ' + echo ' mkshadow [-v|--verbose] [-t|--trace] [-a|--all] ' + echo ' fixperm [-v|--verbose] [-t|--trace] [ ...]' + echo ' rotate [-v|--verbose] [-t|--trace] [-f|--force] [-n|--num-files' + echo ' ] [-s|--size ] [-c|--copy] [-r|--remove]' + echo ' [-a|--archive-dir ] [-z|--compress [:]]' + echo ' [-b|--background] [-d|--delay] [-p|--pad ] [-m|--mode' + echo ' ] [-o|--owner ] [-g|--group ] [-M|--migrate' + echo ' ] [-P|--prolog ] [-E|--epilog ] [...]' + echo ' tarball [-t|--trace] [-v|--verbose] [-o|--output ]' + echo ' [-c|--compress ] [-d|--directory ] [-u|--user' + echo ' ] [-g|--group ] [-e|--exclude ]' + echo ' [ ...]' + echo ' subst [-v|--verbose] [-t|--trace] [-n|--nop] [-w|--warning]' + echo ' [-q|--quiet] [-s|--stealth] [-i|--interactive] [-b|--backup' + echo ' ] [-e|--exec ] [-f|--file ] []' + echo ' [...]' + echo ' arx [-t|--trace] [-C|--command ] [' + echo ' ...]' + echo ' slo [-p|--prefix ] -- -L -l [-L -l' + echo ' ...]' + echo ' scpp [-v|--verbose] [-p|--preserve] [-f|--filter ]' + echo ' [-o|--output ] [-t|--template ] [-M|--mark' + echo ' ] [-D|--define ] [-C|--class ]' + echo ' [ ...]' + echo ' path [-s|--suppress] [-r|--reverse] [-d|--dirname] [-b|--basename]' + echo ' [-m|--magic] [-p|--path ] [ ...]' echo '' exit 0 fi -if [ ".$1" = ".-v" -o ".$1" = ."--version" ]; then - echo "shtool 1.4.0 (02-Jul-1999)" +if [ ".$1" = ".-v" ] || [ ".$1" = ".--version" ]; then + echo "GNU shtool 2.0.1 (11-Aug-2004)" exit 0 fi -tool="$1" -shift +if [ ".$1" = ".-r" ] || [ ".$1" = ".--recreate" ]; then + shtoolize -oetc/shtool install platform version + exit 0 +fi +if [ ".$1" = ".-d" ] || [ ".$1" = ".--debug" ]; then + shift + set -x +fi +name=`echo "$0" | sed -e 's;.*/\([^/]*\)$;\1;' -e 's;-sh$;;' -e 's;\.sh$;;'` +case "$name" in + install|platform|version ) + # implicit tool command selection + tool="$name" + ;; + * ) + # explicit tool command selection + tool="$1" + shift + ;; +esac arg_spec="" opt_spec="" gen_tmpfile=no @@ -108,128 +168,63 @@ gen_tmpfile=no ## case $tool in - echo ) - str_tool="echo" - str_usage="[-n] [-e] [ ...]" - arg_spec="0+" - opt_spec="ne" - ;; - mdate ) - str_tool="mdate" - str_usage="[-n] [-z] [-s] [-d] [-f] [-o] " - arg_spec="1" - opt_spec="nzsdf:!o:!" - opt_f=" " - opt_o="dmy" - ;; - table ) - str_tool="table" - str_usage="[-F] [-w] [-c] [-s] ..." - arg_spec="1+" - opt_spec="F:!w:!c:!s:!" - opt_F=":" - opt_w=15 - opt_c=3 - opt_s=79 - ;; - prop ) - str_tool="prop" - str_usage="[-p]" - arg_spec="0" - opt_spec="p:" - ;; - move ) - str_tool="move" - str_usage="[-v] [-t] [-e] [-p] " - arg_spec="2" - opt_spec="vtep" - ;; install ) str_tool="install" - str_usage="[-v] [-t] [-c] [-C] [-s] [-m] [-o] [-g] [-e] " - arg_spec="2" - opt_spec="vtcCsm:o:g:e:" - ;; - mkdir ) - str_tool="mkdir" - str_usage="[-t] [-f] [-p] [-m] [ ...]" - arg_spec="1+" - opt_spec="tfpm:" - ;; - mkln ) - str_tool="mkln" - str_usage="[-t] [-f] [-s] [ ...] " - arg_spec="2+" - opt_spec="tfs" - ;; - mkshadow ) - str_tool="mkshadow" - str_usage="[-v] [-t] [-a] " - arg_spec="2" - opt_spec="vta" - ;; - fixperm ) - str_tool="fixperm" - str_usage="[-v] [-t] [ ...]" - gen_tmpfile=yes + str_usage="[-v|--verbose] [-t|--trace] [-d|--mkdir] [-c|--copy] [-C|--compare-copy] [-s|--strip] [-m|--mode ] [-o|--owner ] [-g|--group ] [-e|--exec ] [ ...] " arg_spec="1+" - opt_spec="vt" + opt_spec="v.t.d.c.C.s.m:o:g:e+" + opt_alias="v:verbose,t:trace,d:mkdir,c:copy,C:compare-copy,s:strip,m:mode,o:owner,g:group,e:exec" + opt_v=no + opt_t=no + opt_d=no + opt_c=no + opt_C=no + opt_s=no + opt_m="0755" + opt_o="" + opt_g="" + opt_e="" ;; - guessos ) - str_tool="guessos" - str_usage="" - arg_spec="0" - opt_spec="" - ;; - arx ) - str_tool="arx" - str_usage="[-t] [-C] [ ...]" - arg_spec="2+" - opt_spec="tC:!" - opt_C="ar" - ;; - slo ) - str_tool="slo" - str_usage="-- -L -l [ -L -l ... ]" - arg_spec="1+" - opt_spec="" - ;; - scpp ) - str_tool="scpp" - str_usage="[-v] [-p] [-o] [-t] [-M] [-D] [-C] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="vpo:!t:!M:!D:!C:!" - opt_o="lib.h" - opt_t="lib.h.in" - opt_M="%%MARK%%" - opt_D="cpp" - opt_C="intern" + platform ) + str_tool="platform" + str_usage="[-F|--format ] [-S|--sep ] [-C|--conc ] [-L|--lower] [-U|--upper] [-v|--verbose] [-c|--concise] [-n|--no-newline] [-t|--type ] [-V|--version] [-h|--help]" + arg_spec="0=" + opt_spec="F:S:C:L.U.v.c.n.t:d.V.h." + opt_alias="F:format,S:sep,C:conc,L:lower,U:upper,v:verbose,c:consise,t:type,n:no-newline,V:version,h:help" + opt_F="%{sp} (%{ap})" + opt_S=" " + opt_C="/" + opt_L=no + opt_U=no + opt_t="" + opt_v=no + opt_c=no + opt_n=no + opt_V=no + opt_h=no ;; version ) str_tool="version" - str_usage="[-l] [-n] [-p] [-s] [-i] [-d] " - arg_spec="1+" - opt_spec="l:!n:!p:!s:!i:!d:!" + str_usage="[-l|--language ] [-n|--name ] [-p|--prefix ] [-s|--set ] [-e|--edit] [-i|--increase ] [-d|--display ] " + arg_spec="1=" + opt_spec="l:n:p:s:i:e.d:" + opt_alias="l:language,n:name,p:prefix,s:set,e:edit,i:increase,d:display" opt_l="txt" opt_n="unknown" - opt_p="unknown" - opt_s="unknown" - opt_i="P" - opt_d="NO" - gen_tmpfile=yes + opt_p="" + opt_s="" + opt_e="no" + opt_i="" + opt_d="short" ;; - path ) - str_tool="path" - str_usage="[-s] [-r] [-d] [-b] [-m] [-p] [ ...]" - gen_tmpfile=yes - arg_spec="1+" - opt_spec="srdbmp:!" - opt_p="$PATH" + -* ) + echo "$0:Error: unknown option \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 + exit 1 ;; * ) - echo "$0:ERROR: unknown command \`$tool'" 2>&1 - echo "$0:HINT: run \`$0 -h' for usage" 2>&1 + echo "$0:Error: unknown command \`$tool'" 2>&1 + echo "$0:Hint: run \`$0 -h' for usage" 2>&1 exit 1 ;; esac @@ -238,36 +233,35 @@ esac ## COMMON UTILITY CODE ## +# commonly used ASCII values +ASC_TAB=" " +ASC_NL=" +" + # determine name of tool if [ ".$tool" != . ]; then - # inside shtool + # used inside shtool script toolcmd="$0 $tool" + toolcmdhelp="shtool $tool" msgprefix="shtool:$tool" else - # standalone + # used as standalone script toolcmd="$0" + toolcmdhelp="sh $0" msgprefix="$str_tool" fi # parse argument specification string -eval `echo $arg_spec | sed -e 's/^\([0-9]*\)\(.*\)/arg_NUMS="\1"; arg_MODE="\2"/'` -test ".$arg_MODE" = . && arg_MODE="=" +eval `echo $arg_spec |\ + sed -e 's/^\([0-9]*\)\([+=]\)/arg_NUMS=\1; arg_MODE=\2/'` # parse option specification string -for opt in `echo "h$opt_spec" | sed -e 's/\([a-zA-Z0-9][!:+]*\)/\1 /g'`; do - opt_MODE="."; opt_INIT="." - eval `echo $opt |\ - sed -e 's/^\([a-zA-Z0-9]\)/opt_THIS="\1";/' \ - -e 's/";\([:+]\)/"; opt_MODE="\1";/' \ - -e 's/";\(!\)/"; opt_INIT="\1"/'` - eval "opt_MODE_${opt_THIS}=${opt_MODE}" - if [ ".$opt_INIT" != ".!" ]; then - case "$opt_MODE" in - "." ) eval "opt_${opt_THIS}=no" ;; - ":"|"+" ) eval "opt_${opt_THIS}=\"\"" ;; - esac - fi -done +eval `echo h.$opt_spec |\ + sed -e 's/\([a-zA-Z0-9]\)\([.:+]\)/opt_MODE_\1=\2;/g'` + +# parse option alias string +eval `echo h:help,$opt_alias |\ + sed -e 's/-/_/g' -e 's/\([a-zA-Z0-9]\):\([^,]*\),*/opt_ALIAS_\2=\1;/g'` # interate over argument line opt_PREV='' @@ -285,18 +279,29 @@ while [ $# -gt 0 ]; do opt_OPT="$opt_PREV" opt_ARG="$1" opt_ARG_OK=yes - opt_PREV="" + opt_PREV='' else # split argument into option and argument case "$1" in + --[a-zA-Z0-9]*=*) + eval `echo "x$1" |\ + sed -e 's/^x--\([a-zA-Z0-9-]*\)=\(.*\)$/opt_OPT="\1";opt_ARG="\2"/'` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + ;; + --[a-zA-Z0-9]*) + opt_OPT=`echo "x$1" | cut -c4-` + opt_STR=`echo $opt_OPT | sed -e 's/-/_/g'` + eval "opt_OPT=\${opt_ALIAS_${opt_STR}-${opt_OPT}}" + opt_ARG='' + ;; -[a-zA-Z0-9]*) eval `echo "x$1" |\ sed -e 's/^x-\([a-zA-Z0-9]\)/opt_OPT="\1";/' \ -e 's/";\(.*\)$/"; opt_ARG="\1"/'` ;; -[a-zA-Z0-9]) - opt_OPT=`awk 'BEGIN { printf("%s", substr(OPT, 2)); }' \ - "OPT=$1" &2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: unknown option: \`$opt_OPT'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 exit 1 ;; esac done if [ ".$opt_PREV" != . ]; then - echo "$msgprefix:ERROR: missing argument to option \`-$opt_PREV'" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: missing argument to option \`$opt_PREV'" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmdhelp -h' or \`man shtool' for details" 1>&2 exit 1 fi # process help option -if [ .$opt_h = .yes ]; then - echo "Usage: $toolcmd $str_usage" +if [ ".$opt_h" = .yes ]; then + echo "Usage: $toolcmdhelp $str_usage" exit 0 fi # complain about incorrect number of arguments case $arg_MODE in - "=" ) + '=' ) if [ $# -ne $arg_NUMS ]; then - echo "$msgprefix:ERROR: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: invalid number of arguments (exactly $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; - "+" ) + '+' ) if [ $# -lt $arg_NUMS ]; then - echo "$msgprefix:ERROR: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 - echo "$msgprefix:HINT: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 + echo "$msgprefix:Error: invalid number of arguments (at least $arg_NUMS expected)" 1>&2 + echo "$msgprefix:Hint: run \`$toolcmd -h' or \`man shtool' for details" 1>&2 exit 1 fi ;; @@ -370,1827 +375,849 @@ esac # establish a temporary file on request if [ ".$gen_tmpfile" = .yes ]; then - tmpdir="/tmp" if [ ".$TMPDIR" != . ]; then tmpdir="$TMPDIR" + elif [ ".$TEMPDIR" != . ]; then + tmpdir="$TEMPDIR" else - if [ ".$TEMPDIR" != . ]; then - tmpdir="$TEMPDIR" - fi + tmpdir="/tmp" + fi + if mkdir "$tmpdir/.shtool.$$"; then + tmpfile="$tmpdir/.shtool.$$/shtool.tmp" + else + echo "$msgprefix:Error: failed to create temporary file" 1>&2 + exit 1 fi - tmpfile="$tmpdir/.shtool.$$" + tmpfile="$tmpdir/.shtool.$$/shtool.tmp" rm -f $tmpfile >/dev/null 2>&1 touch $tmpfile + chmod 600 $tmpfile fi +# utility function: map string to lower case +util_lower () { + echo "$1" | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' +} + +# utility function: map string to upper case +util_upper () { + echo "$1" | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' +} + +# cleanup procedure +shtool_exit () { + rc="$1" + if [ ".$gen_tmpfile" = .yes ]; then + rm -fr "$tmpdir/.shtool.$$" >/dev/null 2>&1 || true + fi + exit $rc +} + ## ## DISPATCH INTO SCRIPT BODY ## case $tool in -echo ) +install ) ## - ## echo -- Print string with optional construct expansion - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for WML as buildinfo + ## install -- Install a program, script or datafile + ## Copyright (c) 1997-2004 Ralf S. Engelschall ## - - text="$*" - - # check for broken escape sequence expansion - seo='' - bytes=`echo '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" != .3 ]; then - bytes=`echo -E '\1' | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - seo='-E' - fi - fi - - # check for existing -n option (to suppress newline) - minusn='' - bytes=`echo -n 123 2>/dev/null | wc -c | awk '{ printf("%s", $1); }'` - if [ ".$bytes" = .3 ]; then - minusn='-n' - fi - - # determine terminal bold sequence - term_bold='' - term_norm='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[Bb]'`" != . ]; then - # the most important terminals we directly know - case $TERM in - xterm|xterm*|vt220|vt220*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c", 27, 91, 49, 109); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c", 27, 91, 109); }' /dev/null` - ;; - vt100|vt100*) - term_bold=`awk 'BEGIN { printf("%c%c%c%c%c%c", 27, 91, 49, 109, 0, 0); }' /dev/null` - term_norm=`awk 'BEGIN { printf("%c%c%c%c%c", 27, 91, 109, 0, 0); }' /dev/null` - ;; - esac - # then try a possibly existing "tput" or "tcout" utility - paths=`echo $PATH | sed -e 's/:/ /g'` - for tool in tput tcout; do - for dir in $paths; do - if [ -r "$dir/$tool" ]; then - for seq in bold md smso; do # smso is last - bold="`$dir/$tool $seq 2>/dev/null`" - if [ ".$bold" != . ]; then - term_bold="$bold" - break - fi - done - if [ ".$term_bold" != . ]; then - for seq in sgr0 me rmso reset; do # 'reset' is last - norm="`$dir/$tool $seq 2>/dev/null`" - if [ ".$norm" != . ]; then - term_norm="$norm" - break - fi - done - fi - break - fi - done - if [ ".$term_bold" != . -a ".$term_norm" != . ]; then - break; - fi - done - if [ ".$term_bold" = . -o ".$term_norm" = . ]; then - echo "$msgprefix:Warning: unable to determine terminal sequence for bold mode" 1>&2 - fi - fi - - # determine user name - username='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[uU]'`" != . ]; then - username="$LOGNAME" - if [ ".$username" = . ]; then - username="$USER" - if [ ".$username" = . ]; then - username="`(whoami) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username="`(who am i) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$username" = . ]; then - username='unknown' - fi - fi - fi - fi - fi - - # determine user id - userid='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%U'`" != . ]; then - userid="`(id -u) 2>/dev/null`" - if [ ".$userid" = . ]; then - str="`(id) 2>/dev/null`" - if [ ".`echo $str | grep '^uid[ ]*=[ ]*[0-9]*('`" != . ]; then - userid=`echo $str | sed -e 's/^uid[ ]*=[ ]*//' -e 's/(.*//'` - fi - if [ ".$userid" = . ]; then - userid=`egrep "^${username}:" /etc/passwd 2>/dev/null | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid=`(ypcat passwd) 2>/dev/null | - egrep "^${username}:" | \ - sed -e 's/[^:]*:[^:]*://' -e 's/:.*$//'` - if [ ".$userid" = . ]; then - userid='?' - fi - fi - fi - fi - fi - - # determine host name - hostname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%h'`" != . ]; then - hostname="`(uname -n) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname="`(hostname) 2>/dev/null |\ - awk '{ printf("%s", $1); }'`" - if [ ".$hostname" = . ]; then - hostname='unknown' - fi + + # special case: "shtool install -d [...]" internally + # maps to "shtool mkdir -f -p -m 755 [...]" + if [ "$opt_d" = yes ]; then + cmd="$0 mkdir -f -p -m 755" + if [ ".$opt_o" != . ]; then + cmd="$cmd -o '$opt_o'" fi - case $hostname in - *.* ) - domainname=".`echo $hostname | cut -d. -f2-`" - hostname="`echo $hostname | cut -d. -f1`" - ;; - esac - fi - - # determine domain name - domainname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%d'`" != . ]; then - if [ ".$domainname" = . ]; then - if [ -f /etc/resolv.conf ]; then - domainname="`egrep '^[ ]*domain' /etc/resolv.conf | head -1 |\ - sed -e 's/.*domain//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - if [ ".$domainname" = . ]; then - domainname="`egrep '^[ ]*search' /etc/resolv.conf | head -1 |\ - sed -e 's/.*search//' \ - -e 's/^[ ]*//' -e 's/^ *//' -e 's/^ *//' \ - -e 's/ .*//' -e 's/ .*//' \ - -e 's/^\.//' -e 's/^/./' |\ - awk '{ printf("%s", $1); }'`" - fi - fi + if [ ".$opt_g" != . ]; then + cmd="$cmd -g '$opt_g'" fi - fi - - # determine current time - time_day='' - time_month='' - time_year='' - time_monthname='' - if [ ".$opt_e" = .yes -a ".`echo $text | egrep '%[DMYm]'`" != . ]; then - time_day=`date '+%d'` - time_month=`date '+%m'` - time_year=`date '+%Y' 2>/dev/null` - if [ ".$time_year" = . ]; then - time_year=`date '+%y'` - case $time_year in - [5-9][0-9]) time_year="19$time_year" ;; - [0-4][0-9]) time_year="20$time_year" ;; - esac + if [ ".$opt_v" = .yes ]; then + cmd="$cmd -v" fi - case $time_month in - 1|01) time_monthname='Jan' ;; - 2|02) time_monthname='Feb' ;; - 3|03) time_monthname='Mar' ;; - 4|04) time_monthname='Apr' ;; - 5|05) time_monthname='May' ;; - 6|06) time_monthname='Jun' ;; - 7|07) time_monthname='Jul' ;; - 8|08) time_monthname='Aug' ;; - 9|09) time_monthname='Sep' ;; - 10) time_monthname='Oct' ;; - 11) time_monthname='Nov' ;; - 12) time_monthname='Dec' ;; - esac - fi - - # expand special ``%x'' constructs - if [ ".$opt_e" = .yes ]; then - text=`echo $seo "$text" |\ - sed -e "s/%B/${term_bold}/g" \ - -e "s/%b/${term_norm}/g" \ - -e "s/%u/${username}/g" \ - -e "s/%U/${userid}/g" \ - -e "s/%h/${hostname}/g" \ - -e "s/%d/${domainname}/g" \ - -e "s/%D/${time_day}/g" \ - -e "s/%M/${time_month}/g" \ - -e "s/%Y/${time_year}/g" \ - -e "s/%m/${time_monthname}/g" 2>/dev/null` - fi - - # create output - if [ .$opt_n = .no ]; then - echo $seo $text - else - # the harder part: echo -n is best, because - # awk complains about some \xx sequences. - if [ ".$minusn" != . ]; then - echo $seo $minusn $text - else - echo dummy | awk '{ printf("%s", TEXT); }' TEXT="$text" + if [ ".$opt_t" = .yes ]; then + cmd="$cmd -t" fi + for dir in "$@"; do + eval "$cmd $dir" || shtool_exit $? + done + shtool_exit 0 fi - ;; -mdate ) - ## - ## mdate -- Pretty-print modification time of a file or dir - ## Copyright (c) 1995-1997 Free Software Foundation, Inc. - ## Originally idea and basis code by Ulrich Drepper - ## Enhanced by Ralf S. Engelschall for shtool - ## - - fod="$1" - case "$opt_o" in - [dmy][dmy][dmy] ) - ;; - * ) echo "$msgprefix:Error: invalid argument to option \`-o': $opt_o" 1>&2 - exit 1 - ;; - esac - if [ ! -r "$fod" ]; then - echo "$msgprefix:Error: file or directory not found: $fod" 1>&2 - exit 1 - fi - - # prevent "date" giving response in another language - LANG=C; export LANG - LC_ALL=C; export LC_ALL - LC_TIME=C; export LC_TIME - - # get the extended ls output of the file or directory. - if ls -L /dev/null >/dev/null 2>&1; then - set - x`ls -L -l -d $fod` - else - set - x`ls -l -d $fod` - fi - - # The month is at least the fourth argument - # (3 shifts here, the next inside the loop). - shift; shift; shift - - # Find the month. Next argument is day, followed by the year or time. - month="" - while [ ".$month" = . ]; do + # determine source(s) and destination + argc=$# + srcs="" + while [ $# -gt 1 ]; do + srcs="$srcs $1" shift - case $1 in - Jan) month=January; nummonth=1 ;; - Feb) month=February; nummonth=2 ;; - Mar) month=March; nummonth=3 ;; - Apr) month=April; nummonth=4 ;; - May) month=May; nummonth=5 ;; - Jun) month=June; nummonth=6 ;; - Jul) month=July; nummonth=7 ;; - Aug) month=August; nummonth=8 ;; - Sep) month=September; nummonth=9 ;; - Oct) month=October; nummonth=10 ;; - Nov) month=November; nummonth=11 ;; - Dec) month=December; nummonth=12 ;; - esac done - day="$2" - year="$3" - - # We finally have to deal with the problem that the "ls" output - # gives either the time of the day or the year. - case $year in - *:*) - this_year=`date '+%Y' 2>/dev/null` - if [ ".$this_year" = . ]; then - this_year=`date '+%y'` - case $this_year in - [5-9][0-9]) this_year="19$this_year" ;; - [0-4][0-9]) this_year="20$this_year" ;; - esac - fi - # for the following months of the last year the time notation - # is usually also used for files modified in the last year. - this_month=`date '+%m'` - if (expr $nummonth \> $this_month) >/dev/null; then - this_year=`expr $this_year - 1` - fi - year="$this_year" - ;; - esac - - # Optionally fill day and month with leeding zeros - if [ ".$opt_z" = .yes ]; then - case $day in - [0-9][0-9] ) ;; - [0-9] ) day="0$day" ;; - esac - case $nummonth in - [0-9][0-9] ) ;; - [0-9] ) nummonth="0$nummonth" ;; - esac - fi - - # Optionally use digits for month - if [ ".$opt_d" = .yes ]; then - month="$nummonth" - fi - - # Optionally shorten the month name to three characters - if [ ".$opt_s" = .yes ]; then - month=`echo $month | cut -c1-3` - fi - - # Output the resulting date string - echo dummy | awk '{ - for (i = 0; i < 3; i++) { - now = substr(order, 1, 1); - order = substr(order, 2); - if (now == "d") - out = day; - else if (now == "m") - out = month; - else if (now == "y") - out = year; - if (i < 2) - printf("%s%s", out, field); - else - printf("%s", out); - } - if (newline != "yes") - printf("\n"); - }' "day=$day" "month=$month" "year=$year" \ - "field=$opt_f" "order=$opt_o" "newline=$opt_n" - ;; + dstpath="$1" -table ) - ## - ## table -- Pretty print a field-sperarated list as a table - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - if [ $opt_c -gt 4 ]; then - echo "$msgprefix:Error: Invalid number of colums (1..4 allowed only)" 1>&2 - exit 1 + # type check for destination + dstisdir=0 + if [ -d $dstpath ]; then + dstpath=`echo "$dstpath" | sed -e 's:/$::'` + dstisdir=1 fi - case "x$opt_F" in - x? ) ;; - * ) echo "$msgprefix:Error: Invalid seperator (one char allowed only)" 1>&2; exit 1 ;; - esac - - # split the list into a table - list=` - IFS="$opt_F" - for entry in $*; do - if [ ".$entry" != . ]; then - echo "$entry" - fi - done |\ - awk " - BEGIN { list = \"\"; n = 0; } - { - list = list \\$1; - n = n + 1; - if (n < $opt_c) { - list = list \":\"; - } - if (n == $opt_c) { - list = list \"\\n\"; - n = 0; - } - } - END { print list; } - " - ` - - # format table cells and make sure table - # doesn't exceed maximum width - OIFS="$IFS" - IFS=' -' - for entry in $list; do - case $opt_c in - 1 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s\\n\", \$1); }'" ;; - 2 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s\\n\", \$1, \$2); }'" ;; - 3 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3); }'" ;; - 4 ) eval "echo \"\${entry}\" | awk -F: '{ printf(\"%-${opt_w}s %-${opt_w}s %-${opt_w}s %-${opt_w}s\\n\", \$1, \$2, \$3, \$4); }'" ;; - esac - done |\ - awk "{ - if (length(\$0) > $opt_s) { - printf(\"%s\\n\", substr(\$0, 0, $opt_s-1)); - } else { - print \$0; - } - }" - IFS="$OIFS" - ;; -prop ) - ## - ## prop -- Display progress with a running propeller - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for mod_ssl - ## - - perl='' - for dir in `echo $PATH | sed -e 's/:/ /g'` .; do - if [ -f "$dir/perl" ]; then - perl="$dir/perl" - break - fi - done - if [ ".$perl" != . ]; then - # Perl is preferred because writing to STDERR in - # Perl really writes immediately as one would expect - $perl -e ' - @p = ("|","/","-","\\"); - $i = 0; - while () { - printf(STDERR "\r%s...%s\b", $ARGV[0], $p[$i++]); - $i = 0 if ($i > 3); - } - printf(STDERR "\r%s \n", $ARGV[0]); - ' "$opt_p" - else - # But when Perl doesn't exists we use Awk even - # some Awk's buffer even the /dev/stderr writing :-( - awk ' - BEGIN { - split("|#/#-#\\", p, "#"); - i = 1; - } - { - printf("\r%s%c\b", prefix, p[i++]) > "/dev/stderr"; - if (i > 4) { i = 1; } - } - END { - printf("\r%s \n", prefix) > "/dev/stderr"; - } - ' "prefix=$opt_p" + # consistency check for destination + if [ $argc -gt 2 ] && [ $dstisdir = 0 ]; then + echo "$msgprefix:Error: multiple sources require destination to be directory" 1>&2 + shtool_exit 1 fi - ;; -move ) - ## - ## move -- Move files with simultan substitution - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # consistency checks - if [ ".$src" = . -o ".$dst" = . ]; then - echo "$msgprefix:Error: Invalid arguments" 1>&2 - exit 1 - fi - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: Source and destination files are the same" 1>&2 - exit 1 - fi - expsrc="$src" - if [ ".$opt_e" = .yes ]; then - expsrc="`echo $expsrc`" - fi - if [ ".$opt_e" = .yes ]; then - if [ ".`echo "$src" | sed -e 's;^.*\\*.*$;;'`" = ".$src" ]; then - echo "$msgprefix:Error: Source doesn't contain wildcard ('*'): $dst" 1>&2 - exit 1 - fi - if [ ".`echo "$dst" | sed -e 's;^.*%[1-9].*$;;'`" = ".$dst" ]; then - echo "$msgprefix:Error: Destination doesn't contain substitution ('%N'): $dst" 1>&2 - exit 1 - fi - if [ ".$expsrc" = ".$src" ]; then - echo "$msgprefix:Error: Sources not found or no asterisk : $src" 1>&2 - exit 1 + # iterate over all source(s) + for src in $srcs; do + dst=$dstpath + + # if destination is a directory, append the input filename + if [ $dstisdir = 1 ]; then + dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` + dst="$dst/$dstfile" fi - else - if [ ! -r "$src" ]; then - echo "$msgprefix:Error: Source not found: $src" 1>&2 - exit 1 + + # check for correct arguments + if [ ".$src" = ".$dst" ]; then + echo "$msgprefix:Warning: source and destination are the same - skipped" 1>&2 + continue fi - fi - - # determine substitution patterns - if [ ".$opt_e" = .yes ]; then - srcpat=`echo "$src" | sed -e 's/\\./\\\\./g' -e 's/;/\\;/g' -e 's;\\*;\\\\(.*\\\\);g'` - dstpat=`echo "$dst" | sed -e 's;%\([1-9]\);\\\\\1;g'` - fi - - # iterate over source(s) - for onesrc in $expsrc; do - if [ .$opt_e = .yes ]; then - onedst=`echo $onesrc | sed -e "s;$srcpat;$dstpat;"` - else - onedst="$dst" + if [ -d "$src" ]; then + echo "$msgprefix:Warning: source \`$src' is a directory - skipped" 1>&2 + continue fi - errorstatus=0 + + # make a temp file name in the destination directory + dsttmp=`echo $dst |\ + sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;' \ + -e "s;\$;/#INST@$$#;"` + + # verbosity if [ ".$opt_v" = .yes ]; then - echo "$onesrc -> $onedst" + echo "$src -> $dst" 1>&2 fi - if [ ".$opt_p" = .yes ]; then - if [ -r $onedst ]; then - if cmp -s $onesrc $onedst; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $onesrc" 1>&2 - fi - rm -f $onesrc || errorstatus=$? - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? - fi - else - if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 - fi - mv -f $onesrc $onedst || errorstatus=$? + + # copy or move the file name to the temp name + # (because we might be not allowed to change the source) + if [ ".$opt_C" = .yes ]; then + opt_c=yes + fi + if [ ".$opt_c" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "cp $src $dsttmp" 1>&2 fi + cp $src $dsttmp || shtool_exit $? else if [ ".$opt_t" = .yes ]; then - echo "mv -f $onesrc $onedst" 1>&2 + echo "mv $src $dsttmp" 1>&2 fi - mv -f $onesrc $onedst || errorstatus=$? - fi - if [ $errorstatus -ne 0 ]; then - break; + mv $src $dsttmp || shtool_exit $? fi - done - exit $errorstatus - ;; -install ) - ## - ## install -- Install a program, script or datafile - ## Copyright (c) 1997-1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - src="$1" - dst="$2" - - # If destination is a directory, append the input filename - if [ -d $dst ]; then - dst=`echo "$dst" | sed -e 's:/$::'` - dstfile=`echo "$src" | sed -e 's;.*/\([^/]*\)$;\1;'` - dst="$dst/$dstfile" - fi - - # Add a possible extension to src and dst - if [ ".$opt_e" != . ]; then - src="$src$opt_e" - dst="$dst$opt_e" - fi - - # Check for correct arguments - if [ ".$src" = ".$dst" ]; then - echo "$msgprefix:Error: source and destination are the same" 1>&2 - exit 1 - fi - - # Make a temp file name in the destination directory - dstdir=`echo $dst | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - dsttmp="$dstdir/#INST@$$#" - - # Verbosity - if [ ".$opt_v" = .yes ]; then - echo "$src -> $dst" 1>&2 - fi - - # Copy or move the file name to the temp name - # (because we might be not allowed to change the source) - if [ ".$opt_C" = .yes ]; then - opt_c=yes - fi - if [ ".$opt_c" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "cp $src $dsttmp" 1>&2 - fi - cp $src $dsttmp || exit $? - else - if [ ".$opt_t" = .yes ]; then - echo "mv $src $dsttmp" 1>&2 - fi - mv $src $dsttmp || exit $? - fi - - # Adjust the target file - # (we do chmod last to preserve setuid bits) - if [ ".$opt_s" = .yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "strip $dsttmp" 1>&2 - fi - strip $dsttmp || exit $? - fi - if [ ".$opt_o" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chown $opt_o $dsttmp" 1>&2 - fi - chown $opt_o $dsttmp || exit $? - fi - if [ ".$opt_g" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chgrp $opt_g $dsttmp" 1>&2 + # adjust the target file + if [ ".$opt_e" != . ]; then + sed='sed' + OIFS="$IFS"; IFS="$ASC_NL"; set -- $opt_e; IFS="$OIFS" + for e + do + sed="$sed -e '$e'" + done + cp $dsttmp $dsttmp.old + chmod u+w $dsttmp + eval "$sed <$dsttmp.old >$dsttmp" || shtool_exit $? + rm -f $dsttmp.old fi - chgrp $opt_g $dsttmp || exit $? - fi - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $dsttmp" 1>&2 + if [ ".$opt_s" = .yes ]; then + if [ ".$opt_t" = .yes ]; then + echo "strip $dsttmp" 1>&2 + fi + strip $dsttmp || shtool_exit $? fi - chmod $opt_m $dsttmp || exit $? - fi - - # Determine whether to do a quick install - # (has to be done _after_ the strip was already done) - quick=no - if [ ".$opt_C" = .yes ]; then - if [ -r $dst ]; then - if cmp -s $src $dst; then - quick=yes + if [ ".$opt_o" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chown $opt_o $dsttmp" 1>&2 fi + chown $opt_o $dsttmp || shtool_exit $? fi - fi - - # Finally install the file to the real destination - if [ $quick = yes ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dsttmp" 1>&2 + if [ ".$opt_g" != . ]; then + if [ ".$opt_t" = .yes ]; then + echo "chgrp $opt_g $dsttmp" 1>&2 + fi + chgrp $opt_g $dsttmp || shtool_exit $? fi - rm -f $dsttmp - else - if [ ".$opt_t" = .yes ]; then - echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + if [ ".$opt_m" != ".-" ]; then + if [ ".$opt_t" = .yes ]; then + echo "chmod $opt_m $dsttmp" 1>&2 + fi + chmod $opt_m $dsttmp || shtool_exit $? fi - rm -f $dst && mv $dsttmp $dst - fi - ;; -mkdir ) - ## - ## mkdir -- Make one or more directories - ## Copyright (c) 1996-1999 Ralf S. Engelschall - ## Originally written for public domain by Noah Friedman - ## Cleaned up and enhanced for shtool - ## - - errstatus=0 - for p in ${1+"$@"}; do - # when the directory already exists... - if [ -d "$p" ]; then - if [ ".$opt_f" = .no ]; then - echo "$msgprefix:Error: file exists: $p" 1>&2 - errstatus=1 - break - else - continue + # determine whether to do a quick install + # (has to be done _after_ the strip was already done) + quick=no + if [ ".$opt_C" = .yes ]; then + if [ -r $dst ]; then + if cmp -s $src $dst; then + quick=yes + fi fi fi - # when the directory has to be created - if [ ".$opt_p" = .no ]; then + + # finally, install the file to the real destination + if [ $quick = yes ]; then if [ ".$opt_t" = .yes ]; then - echo "mkdir $p" 1>&2 + echo "rm -f $dsttmp" 1>&2 fi - mkdir $p || errstatus=$? + rm -f $dsttmp else - # the smart situation - set fnord `echo ":$p" |\ - sed -e 's/^:\//%/' \ - -e 's/^://' \ - -e 's/\// /g' \ - -e 's/^%/\//'` - shift - pathcomp= - for d in ${1+"$@"}; do - pathcomp="$pathcomp$d" - case "$pathcomp" in - -* ) pathcomp="./$pathcomp" ;; - esac - if [ ! -d "$pathcomp" ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $pathcomp" 1>&2 - fi - mkdir $pathcomp || errstatus=$? - if [ ".$opt_m" != . ]; then - if [ ".$opt_t" = .yes ]; then - echo "chmod $opt_m $pathcomp" 1>&2 - fi - chmod $opt_m $pathcomp || errstatus=$? - fi - fi - pathcomp="$pathcomp/" - done + if [ ".$opt_t" = .yes ]; then + echo "rm -f $dst && mv $dsttmp $dst" 1>&2 + fi + rm -f $dst && mv $dsttmp $dst fi done - exit $errstatus + + shtool_exit 0 ;; -mkln ) +platform ) ## - ## mkln -- Make link with calculation of relative paths - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool + ## platform -- Platform Identification Utility + ## Copyright (c) 2003-2004 Ralf S. Engelschall ## - - args=$? - srcs="" - while [ $# -gt 1 ]; do - srcs="$srcs $1" - shift - done - dst="$1" - if [ ! -d $dst ]; then - if [ $args -gt 2 ]; then - echo "$msgprefix:Error: multiple sources not allowed when target isn't a directory" 1>&2 - exit 1 - fi - fi - - # determine link options - lnopt="" - if [ ".$opt_f" = .yes ]; then - lnopt="$lnopt -f" - fi - if [ ".$opt_s" = .yes ]; then - lnopt="$lnopt -s" - fi - - # iterate over sources - for src in $srcs; do - # determine if one of the paths is an absolute path, - # because then we _have_ to use an absolute symlink - oneisabs=0 - srcisabs=0 - dstisabs=0 - case $src in - /* ) oneisabs=1; srcisabs=1 ;; - esac - case $dst in - /* ) oneisabs=1; dstisabs=1 ;; - esac - - # split source and destination into dir and base name - if [ -d $src ]; then - srcdir=`echo $src | sed -e 's;/*$;;'` - srcbase="" - else - srcdir=`echo $src | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` - srcbase=`echo $src | sed -e 's;.*/\([^/]*\)$;\1;'` - fi - if [ -d $dst ]; then - dstdir=`echo $dst | sed -e 's;/*$;;'` - dstbase="" - else - dstdir=`echo $dst | sed -e 's;^[^/]*$;;' -e 's;^\(.*/\)[^/]*$;\1;' -e 's;\(.\)/$;\1;'` - dstbase=`echo $dst | sed -e 's;.*/\([^/]*\)$;\1;'` - fi - - # consistency check - if [ ".$dstdir" != . ]; then - if [ ! -d $dstdir ]; then - echo "$msgprefix:Error: destination directory not found: $dstdir" 1>&2 + + # option post-processing + if [ ".$opt_t" != . ]; then + case "$opt_t" in + binary ) + # binary package id (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + build ) + # build time checking (OpenPKG RPM) + opt_F="%-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + gnu ) + # GNU config.guess style -- + opt_F="%-unknown-%" + opt_L=yes + opt_S="" + opt_C="+" + ;; + web ) + # non-whitespace HTTP Server-header id + opt_F="%-%" + opt_S="/" + opt_C="+" + ;; + summary) + # human readable verbose summary information + opt_F="Class: %[sc] (%[ac])\\nProduct: %[sp] (%[ap])\\nTechnology: %[st] (%[at])" + opt_S=" " + opt_C="/" + ;; + all-in-one ) + # full-table all-in-one information + opt_F="" + opt_F="${opt_F}concise architecture class: %\\n" + opt_F="${opt_F}regular architecture class: %{ac}\\n" + opt_F="${opt_F}verbose architecture class: %[ac]\\n" + opt_F="${opt_F}concise architecture product: %\\n" + opt_F="${opt_F}regular architecture product: %{ap}\\n" + opt_F="${opt_F}verbose architecture product: %[ap]\\n" + opt_F="${opt_F}concise architecture technology: %\\n" + opt_F="${opt_F}regular architecture technology: %{at}\\n" + opt_F="${opt_F}verbose architecture technology: %[at]\\n" + opt_F="${opt_F}concise system class: %\\n" + opt_F="${opt_F}regular system class: %{sc}\\n" + opt_F="${opt_F}verbose system class: %[sc]\\n" + opt_F="${opt_F}concise system product: %\\n" + opt_F="${opt_F}regular system product: %{sp}\\n" + opt_F="${opt_F}verbose system product: %[sp]\\n" + opt_F="${opt_F}concise system technology: %\\n" + opt_F="${opt_F}regular system technology: %{st}\\n" + opt_F="${opt_F}verbose system technology: %[st]" + ;; + * ) + echo "$msgprefix:Error: invalid type \`$opt_t'" 1>&2 exit 1 - fi - fi - - # make sure the source is reachable from the destination - if [ $dstisabs = 1 ]; then - if [ $srcisabs = 0 ]; then - if [ -d $srcdir ]; then - srcdir="`cd $srcdir; pwd | sed -e 's;/*$;;'`" - srcisabs=1 - oneisabs=1 - fi - fi - fi - - # split away a common prefix - prefix="" - if [ ".$srcdir" = ".$dstdir" ] && [ ".$srcdir" != . ]; then - prefix="$srcdir/" - srcdir="" - dstdir="" - else - while [ ".$srcdir" != . ] && [ ".$dstdir" != . ]; do - presrc=`echo $srcdir | sed -e 's;^\([^/]*\)/.*;\1;'` - predst=`echo $dstdir | sed -e 's;^\([^/]*\)/.*;\1;'` - if [ ".$presrc" != ".$predst" ]; then - break - fi - prefix="$prefix$presrc/" - srcdir=`echo $srcdir | sed -e 's;^[^/]*/*;;'` - dstdir=`echo $dstdir | sed -e 's;^[^/]*/*;;'` - done - fi - - # destination prefix is just the common prefix - dstpre="$prefix" - - # determine source prefix which is the reverse directory - # step-up corresponding to the destination directory - srcpre="" - if [ $oneisabs = 0 ] || [ ".$prefix" != . -a ".$prefix" != ./ ]; then - pl="$dstdir/" - OIFS="$IFS"; IFS='/' - for pe in $pl; do - [ ".$pe" = . ] && continue - srcpre="../$srcpre" - done - IFS="$OIFS" - else - if [ $srcisabs = 1 ]; then - srcpre="$prefix" - fi - fi - - # determine destination symlink name - if [ ".$dstbase" = . ]; then - if [ ".$srcbase" != . ]; then - dstbase="$srcbase" - else - dstbase=`echo "$prefix$srcdir" | sed -e 's;/*$;;' -e 's;.*/\([^/]*\)$;\1;'` - fi - fi - - # now finalize source and destination directory paths - srcdir=`echo $srcdir | sed -e 's;\([^/]\)$;\1/;'` - dstdir=`echo $dstdir | sed -e 's;\([^/]\)$;\1/;'` - - # run the final link command - if [ ".$opt_t" = .yes ]; then - echo "ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase" - fi - eval ln$lnopt $srcpre$srcdir$srcbase $dstpre$dstdir$dstbase - done - ;; - -mkshadow ) - ## - ## mkshadow -- Make a shadow tree - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - # source and destination directory - src=`echo "$1" | sed -e 's:/$::'` - dst=`echo "$2" | sed -e 's:/$::'` - - # check whether source exists - if [ ! -d $src ]; then - echo "$msgprefix:Error: source directory not found: \`$src'" 1>&2 - exit 1 - fi - - # determine if one of the paths is an absolute path, - # because then we have to use an absolute symlink - oneisabs=0 - case $src in - /* ) oneisabs=1 ;; - esac - case $dst in - /* ) oneisabs=1 ;; - esac - - # determine reverse directory for destination directory - dstrevdir='' - if [ $oneisabs = 0 ]; then - # (inlined fp2rp) - OIFS="$IFS"; IFS='/' - for pe in $dst; do - dstrevdir="../$dstrevdir" - done - IFS="$OIFS" - else - src="`cd $src; pwd`"; - fi - - # create directory tree at destination - if [ ! -d $dst ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $dst" 1>&2 - fi - mkdir $dst - fi - if [ ".$opt_a" = .yes ]; then - DIRS=`cd $src; find . -type d -print |\ - sed -e '/^\.$/d' -e 's:^\./::'` - else - DIRS=`cd $src; find . -type d -print |\ - sed -e '/\/CVS/d' -e '/^\.$/d' -e 's:^\./::'` - fi - for dir in $DIRS; do - if [ ".$opt_t" = .yes ]; then - echo "mkdir $dst/$dir" 1>&2 - fi - mkdir $dst/$dir - done - - # fill directory tree with symlinks to files - if [ ".$opt_a" = .yes ]; then - FILES="`cd $src; find . -depth -print |\ - sed -e 's/^\.\///'`" - else - FILES="`cd $src; find . -depth -print |\ - sed -e '/\.o$/d' -e '/\.a$/d' -e '/\.so$/d' \ - -e '/\.cvsignore$/d' -e '/\/CVS/d' \ - -e '/\/\.#/d' -e '/\.orig$/d' \ - -e 's/^\.\///'`" + ;; + esac fi - for file in $FILES; do - # don't use `-type f' above for find because of symlinks - if [ -d "$src/$file" ]; then - continue - fi - basename=`echo $file | sed -e 's:^.*/::'` - dir=`echo $file | sed -e 's:[^/]*$::' -e 's:/$::' -e 's:$:/:' -e 's:^/$::'` - from=`echo "$src/$file" | sed -e 's/^\.\///'` - to="$dst/$dir$basename" - if [ $oneisabs = 0 ]; then - if [ ".$dir" != . ]; then - subdir=`echo $dir | sed -e 's:/$::'` - # (inlined fp2rp) - revdir='' - OIFS="$IFS"; IFS='/' - for pe in $subdir; do - revdir="../$revdir" - done - IFS="$OIFS" - # finalize from - from="$revdir$from" - fi - from="$dstrevdir$from" - fi - if [ ".$opt_v" = .yes ]; then - echo " $to" 1>&2 - fi - if [ ".$opt_t" = .yes ]; then - echo "ln -s $from $to" 1>&2 - fi - ln -s $from $to - done - ;; -fixperm ) - ## - ## fixperm -- Fix file permissions inside a source tree - ## Copyright (c) 1996-1999 Ralf S. Engelschall - ## Originally written for ePerl - ## - - paths="$*" - - # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then - minusx="-x" - else - minusx="-r" - fi - rm -f $tmpfile - - # iterate over paths - for p in $paths; do - for file in `find $p -depth -print`; do - if [ -f $file ]; then - if [ $minusx $file ]; then - if [ ".$opt_v" = .yes ]; then - echo "-rwxrwxr-x $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 775 $file" 2>&1 - fi - chmod 775 $file - else - if [ ".$opt_v" = .yes ]; then - echo "-rw-rw-r-- $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 664 $file" 2>&1 - fi - chmod 664 $file - fi - continue - fi - if [ -d $file ]; then - if [ ".$opt_v" = .yes ]; then - echo "drwxrwxr-x $file" 2>&1 - fi - if [ ".$opt_t" = .yes ]; then - echo "chmod 775 $file" 2>&1 - fi - chmod 775 $file - continue - fi - if [ ".$opt_v" = .yes ]; then - echo "?????????? $file" 2>&1 - fi - done - done - ;; + # assemble initial platform information + UNAME_MACHINE=`(uname -m) 2>/dev/null` ||\ + UNAME_MACHINE=`(uname -p) 2>/dev/null` ||\ + UNAME_MACHINE='unknown' + UNAME_SYSTEM=`(uname -s) 2>/dev/null` ||\ + UNAME_SYSTEM='unknown' + UNAME_RELEASE=`(uname -r) 2>/dev/null` ||\ + UNAME_RELEASE=`(uname -v) 2>/dev/null` ||\ + UNAME_RELEASE='unknown' -guessos ) - ## - ## guessos -- Simple OS/platform guesser - ## Copyright (c) 1996-1999 The Apache Group, http://www.apache.org/ - ## The Apache license applies (see http://www.apache.org/docs/LICENSE) - ## Originally written for Apache - ## - - MACHINE=`(uname -m) 2>/dev/null` || MACHINE="unknown" - RELEASE=`(uname -r) 2>/dev/null` || RELEASE="unknown" - SYSTEM=`(uname -s) 2>/dev/null` || SYSTEM="unknown" - VERSION=`(uname -v) 2>/dev/null` || VERSION="unknown" - - XREL=`(uname -X) 2>/dev/null | grep "^Release" | awk '{print $3}'` - if [ "x$XREL" != "x" ]; then - if [ -f /etc/kconfig ]; then - case "$XREL" in - 4.0|4.1) echo "${MACHINE}-whatever-isc4"; exit 0 ;; + UNAME="${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}" + + AC=""; AP=""; AT="" + SC=""; SP=""; ST="" + + # dispatch into platform specific sections + case "${UNAME}" in + + # FreeBSD + *:FreeBSD:* ) + # determine architecture + AC="${UNAME_MACHINE}" + case "${AC}" in + i386 ) AC="iX86" ;; + esac + AP="${AC}" + AT=`(/sbin/sysctl -n hw.model) 2>&1` + case "${AT}" in + *"Xeon"* | *"Pentium Pro"* | *"Cyrix 6x86MX"* | *"Pentium II"* | *"Pentium III"* | *"Pentium 4"* | *"Celeron"* ) AT="i686" ;; + *"Pentium"* ) AT="i586" ;; *"i486[SD]X"* | *"Cyrix 486"* | *"Cyrix [56]x86"* | *"Blue Lightning" | *"Cyrix 486S/DX" ) AT="i486" ;; + *"i386[SD]X"* | *"NexGen 586"* ) AT="i386" ;; + * ) AT="${AP}" ;; + esac + # determine system + r=`echo "${UNAME_RELEASE}" |\ + sed -e 's;[()];;' -e 's/\(-.*\)$/[\1]/'` + ST="FreeBSD ${r}" + SP="${ST}" + case "${r}" in + 1.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; esac - else - case "$XREL" in - 3.2v4.2) - echo "whatever-whatever-sco3"; exit 0 - ;; - 3.2v5.0*) - echo "whatever-whatever-sco5"; exit 0 - ;; - 4.2MP) - if [ "x$VERSION" = "x2.1.1" ]; then - echo "${MACHINE}-whatever-unixware211"; exit 0 - elif [ "x$VERSION" = "x2.1.2" ]; then - echo "${MACHINE}-whatever-unixware212"; exit 0 - else - echo "${MACHINE}-whatever-unixware2"; exit 0 - fi - ;; - 4.2) - echo "whatever-whatever-unixware1"; exit 0 - ;; - 5) - case "$VERSION" in - 7*) echo "${MACHINE}-whatever-unixware7"; exit 0 ;; - esac - ;; - esac - fi - fi - case "${SYSTEM}:${RELEASE}:${VERSION}:${MACHINE}" in - MiNT:*) - echo "m68k-atari-mint"; exit 0 - ;; - A/UX:*) - echo "m68k-apple-aux3"; exit 0 - ;; - AIX:*) - MACH=`echo $MACHINE | sed -e 's;[0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F][0-9a-fA-F];;'` - echo "${MACH}-ibm-aix${VERSION}.${RELEASE}"; exit 0 - ;; - dgux:*) - echo "${MACHINE}-dg-dgux"; exit 0 ;; - HI-UX:*) - echo "${MACHINE}-hi-hiux"; exit 0 + + # NetBSD + *:NetBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="NetBSD ${r}" + SP="${ST}" + case "${r}" in + 0.* ) SC="4.3BSD" ;; + * ) SC="4.4BSD" ;; + esac ;; - HP-UX:*) - HPUXVER=`echo ${RELEASE}|sed -e 's/[^.]*.[0B]*//'` - echo "${MACHINE}-hp-hpux${HPUXVER}"; exit 0 + + # OpenBSD + *:OpenBSD:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP="iX86" ;; + esac + AC="${AP}" + # determine system + r=`echo "${UNAME_RELEASE}" | sed -e 's/\([-_].*\)$/[\1]/'` + ST="OpenBSD ${r}" + SP="${ST}" + SC="4.4BSD" ;; - IRIX:*) - if [ -f /usr/lib32/mips4/libm.so ]; then - echo "${MACHINE}/32-sgi-irix${RELEASE}"; exit 0 - else - echo "${MACHINE}-sgi-irix${RELEASE}"; exit 0 + + # GNU/Linux + *:Linux:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + x86_64 ) AT='AMD64' ;; + parisc ) AT="HPPA32" ;; + parisc64 ) AT="HPPA64" ;; + esac + AP="${AT}" + case "${AP}" in + i[3-6]86 ) AP='iX86' ;; + esac + AC="${AP}" + # determine system + v_kern=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/'` + v_libc=`(strings /lib/libc.so.* | grep '^GLIBC_' | sed -e 's/^GLIBC_//' |\ + sort -n | sed -n -e '$p' | sed -e 's/^\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/') 2>/dev/null` + ST="GNU/${v_libc}/<${v_kern}>" + if [ -f /etc/lsb-release ]; then + eval `( . /etc/lsb-release + echo "SC=\"LSB${LSB_VERSION}\"" + if [ ".${DISTRIB_ID}" != . -a ".${DISTRIB_RELEASE}" != . ]; then + echo "SP=\"${DISTRIB_ID} ${DISTRIB_RELEASE}\"" + fi + ) 2>/dev/null` fi + if [ ".$SP" = . ]; then + for tagfile in x \ + `cd /etc && \ + /bin/ls *[_-]release *[_-]version 2>/dev/null | \ + sed -e '/^redhat-release$/d' -e '/^lsb-release$/d'; \ + echo redhat-release lsb-release` + do + [ ".${tagfile}" = .x ] && continue + [ ! -f "/etc/${tagfile}" ] && continue + n=`echo ${tagfile} | sed -e 's/[_-]release$//' -e 's/[_-]version$//'` + v=`(grep VERSION /etc/${tagfile}; cat /etc/${tagfile}) | grep '[0-9]' | sed -e 'q' |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$//'` + case "`util_lower ${n}`" in + redhat ) + if [ ".`grep 'Red Hat Enterprise Linux' /etc/${tagfile}`" != . ]; then + n="ed at nterprise inux" + else + n="ed at inux" + fi + ;; + debian ) n="Debian[ GNU/Linux]" ;; + fedora ) n=" Core[ GNU/Linux]" ;; + suse ) n="SuSE[ Linux]" ;; + mandrake ) n="Mandrake[ Linux]" ;; + gentoo ) n="Gentoo[ GNU/Linux]" ;; + slackware ) n="Slackware[ Linux]" ;; + turbolinux ) n="TurboLinux" ;; + unitedlinux ) n="UnitedLinux" ;; + * ) n="${n}[ GNU/Linux]" ;; + esac + case "$n" in + *"<"*">"* ) SP="$n <$v>" ;; + * ) SP="$n $v" ;; + esac + break + done + fi + [ ".$SP" = . ] && SP="${ST}" + [ ".$SC" = . ] && SC="LSB" ;; - IRIX64:*) - echo "${MACHINE}-sgi-irix64"; exit 0 - ;; - Linux:[2-9].*) - echo "${MACHINE}-whatever-linux2"; exit 0 - ;; - Linux:1.*) - echo "${MACHINE}-whatever-linux1"; exit 0 - ;; - LynxOS:*) - echo "${MACHINE}-lynx-lynxos"; exit 0 + + # Sun Solaris + *:SunOS:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i86pc ) AT="iX86" ;; + esac + AP="${AT}" + case "${AP}" in + sun4[cdm] ) AP="SPARC32" ;; + sun4u ) AP="SPARC64" ;; + sun4* ) AP="SPARC" ;; + esac + AC="${AP}" + case "${AC}" in + SPARC* ) AC="SPARC" ;; + esac + # determine system + ST="[Sun ]SunOS ${UNAME_RELEASE}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's;^4\.;1.;' \ + -e 's;^5\.\([0-6]\)[^0-9]*$;2.\1;' \ + -e 's;^5\.\([0-9][0-9]*\).*;\1;'` + SP="[Sun ]Solaris $v" + case "${UNAME_RELEASE}" in + 4.* ) SC="4.3BSD" ;; + 5.* ) SC="SVR4" ;; + esac ;; - BSD/386|BSD/OS:3.*) - echo "${MACHINE}-whatever-bsdi3"; exit 0 + + # SCO UnixWare + *:UnixWare:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + i[3-6]86 | ix86at ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v=`/sbin/uname -v` + ST="[SCO ]UnixWare ${v}" + SP="${ST}" + SC="SVR${UNAME_RELEASE}" ;; - BSD/386:*:*:*486*|BSD/OS:*:*:*:*486*) - echo "i486-whatever-bsdi"; exit 0 + + # QNX + *:QNX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + x86pc ) AT="iX86" ;; + esac + AP="${AT}" + # determine system + v="${UNAME_RELEASE}" + ST="QNX[ Neutrino RTOS] ${v}" + v=`echo "${v}" | sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\).*$;\1;'` + SP="QNX[ Neutrino RTOS] ${v}" + SC="QNX" ;; - BSD/386:*|BSD/OS:*) - echo "${MACHINE}-whatever-bsdi"; exit 0 + + # SGI IRIX + *:IRIX*:* ) + # determine architecture + AT="${UNAME_MACHINE}" + AP="${AT}" + case "${AP}:${UNAME_SYSTEM}" in + IP*:IRIX64 ) AP="MIPS64" ;; + IP*:* ) AP="MIPS" ;; + esac + AC="${AP}" + # determine system + v=`(/bin/uname -R || /bin/uname -r) 2>/dev/null | sed -e 's;[0-9.]* ;;'` + ST="[SGI ]IRIX ${v}" + v="${UNAME_RELEASE}" + SP="[SGI ]IRIX ${v}" + SC="4.2BSD/SVR3" ;; - FreeBSD:*) - VERS=`echo ${RELEASE} | sed -e 's/[-(].*//'` - MACH=`sysctl -n hw.model` - ARCH='whatever' - case ${MACH} in - *386* ) MACH="i386" ;; - *486* ) MACH="i486" ;; - Pentium\ II*) MACH="i686" ;; - Pentium* ) MACH="i586" ;; - Alpha* ) MACH="alpha" ;; - * ) MACH="$MACHINE" ;; + + # HP HP-UX + *:HP-UX:* ) + # determine architecture + AT="${UNAME_MACHINE}" + case "${AT}" in + ia64 ) AT="IA64" ;; + 9000/[34]?? ) AT=M68K ;; + 9000/[678][0-9][0-9]) + sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in + 523 ) AT="HPPA1.0" ;; + 528 ) AT="HPPA1.1" ;; + 532 ) AT="HPPA2.0" + case "${sc_kernel_bits}" in + 32 ) AT="${AT}n" ;; + 64 ) AT="${AT}w" ;; + esac + ;; + esac + ;; esac - case ${MACH} in - i[0-9]86 ) ARCH="pc" ;; + AP="${AT}" + case "${AP}" in + HPPA* ) AP="HPPA" ;; + esac + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[^0-9]*;;'` + ST="[HP ]-" + SP="${ST}" + case "${v}" in + 10.* ) SC="SVR4.2" ;; + [7-9]* ) SC="SVR4" ;; esac - echo "${MACH}-${ARCH}-freebsd${VERS}"; exit 0 - ;; - NetBSD:*:*:*486*) - echo "i486-whatever-netbsd${RELEASE}"; exit 0 - ;; - NetBSD:*) - echo "${MACHINE}-whatever-netbsd${RELEASE}"; exit 0 - ;; - OpenBSD:*) - echo "${MACHINE}-whatever-openbsd"; exit 0 ;; - OSF1:*:*:*alpha*) - VERS=`echo $RELEASE | sed -e 's;^V;;'` - echo "${MACHINE}-dec-osf${VERS}"; exit 0 + + # HP Tru64 (OSF1) + *:OSF1:* ) + # determine architecture + AP="${UNAME_MACHINE}" + case "${AP}" in + alpha ) AP="Alpha" ;; + esac + alpha_type=`(/usr/sbin/psrinfo -v) 2>/dev/null |\ + sed -n -e 's/^.*The alpha \([^ ][^ ]*\).*processor.*$/\1/p' | sed -e 'q'` + AT="${AP}${alpha_type}" + AC="${AP}" + # determine system + v=`echo "${UNAME_RELEASE}" | sed -e 's;^[VTX];;'` + ST="[HP ]Tru64 ${v}" + SP="${ST}" + SC="OSF1" ;; - QNX:*) - if [ "$VERSION" -gt 422 ]; then - echo "${MACHINE}-qssl-qnx32" + + # IBM AIX + *:AIX:* ) + cpu_arch=rs6000 + if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then + cpu_id=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` + if [ ".`/usr/sbin/lsattr -El ${cpu_id} | grep -i powerpc`" != . ]; then + cpu_arch=powerpc + fi + fi + if [ -x /usr/bin/oslevel ]; then + os_level=`/usr/bin/oslevel` else - echo "${MACHINE}-qssl-qnx" + os_level="`uname -r`.`uname -v`" fi - exit 0 - ;; - Paragon*:*:*:*) - echo "i860-intel-osf1"; exit 0 - ;; - SunOS:5.*) - VERSION=`echo $RELEASE | sed -e 's;^5\.;;'` - echo "${MACHINE}-sun-solaris2.${VERSION}"; exit 0 - ;; - SunOS:*) - echo "${MACHINE}-sun-sunos4"; exit 0 - ;; - UNIX_System_V:4.*:*) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - unix:3.0.9*:*:88k) - echo "${MACHINE}-encore-sysv4"; exit 0 - ;; - *:4*:R4*:m88k) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - UnixWare:5:99*:*) - # Gemini, beta release of next rev of unixware - echo "${MACHINE}-whatever-unixware212"; exit 0 - ;; - DYNIX/ptx:4*:*) - echo "${MACHINE}-whatever-sysv4"; exit 0 - ;; - *:4.0:3.0:[345][0-9]?? | *:4.0:3.0:3[34]??[/,]* | library:*) - echo "x86-ncr-sysv4"; exit 0 - ;; - ULTRIX:*) - echo "${MACHINE}-unknown-ultrix"; exit 0 + os_level=`echo "${os_level}" |\ + sed -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(\.[0-9][0-9]*\)\(.*\)$;<\1>\2[\3];' \ + -e 's;^\([0-9][0-9]*\.[0-9][0-9]*\)\(.*\)$;<\1>\2;'` + AT="${cpu_arch}" + AP="${AT}" + AC="${AP}" + ST="[IBM ]AIX ${os_level}" + SP="${ST}" + case "${os_level}" in + [12]* ) SC="SVR2" ;; + * ) SC="SVR4" ;; + esac ;; - SINIX-?:* | ReliantUNIX-?:*) - echo "${MACHINE}-siemens-sysv4"; exit 0 + + # Apple MacOS X Darwin + *:Darwin:* ) + AT=`uname -p` + case "${AT}" in + powerpc ) AT="PPC" ;; + esac + AP="${AT}" + AC="${AP}" + case "${AC}" in + i?86 ) AC="iX86" ;; + esac + ST="[Apple ]${UNAME_SYSTEM} ${UNAME_RELEASE}" + SP="${ST}" + SC="4.4BSD/Mach3" ;; - POSIX*BS2000) - echo "${MACHINE}-siemens-sysv4"; exit 0 + + # TODO ...ADD YOUR NEW PLATFORM CHECK HERE... TODO + # *:XXX:* ) + # ... + # ;; + + # ...A STILL UNKNOWN PLATFORM... + * ) + AT=`echo "${UNAME_MACHINE}" | sed -e "s; ;${opt_C};g"` + AP="${AT}" + AC="${AP}" + v=`echo "${UNAME_RELEASE}" |\ + sed -e 's/^/#/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*$/\1/' \ + -e 's/^#[^0-9]*\([0-9][0-9]*\).*$/\1/' \ + -e 's/^#.*$/?/'` + ST="${UNAME_SYSTEM} ${v}" + SP="${ST}" + SC="${SP}" ;; - machten:*) - echo "${MACHINE}-tenon-${SYSTEM}"; exit 0; - ;; - ConvexOS:*:11.*:*) - echo "${MACHINE}-v11-${SYSTEM}"; exit 0; - ;; - UNIX_SV:*:*:maxion) - echo "${MACHINE}-ccur-sysv4"; exit 0; - ;; - PowerMAX_OS:*:*:Night_Hawk) - MACHINE=`uname -p` - echo "${MACHINE}-concurrent-powermax"; exit 0; - ;; - UNIX_SV:*) - if [ -d /usr/nec ];then - echo "mips-nec-sysv4"; exit 0; - fi - ;; - NonStop-UX:4.[02]*:[BC]*:*) - echo "${MACHINE}-tandem-sysv4"; exit 0; - ;; - Rhapsody:*:*:*) - case "${MACHINE}" in - "Power Macintosh") MACHINE=powerpc ;; - esac - echo "${MACHINE}-apple-rhapsody${RELEASE}"; exit 0 - ;; - "Mac OS":*:*:*) - MACHINE=`uname -p` - echo "${MACHINE}-apple-macos${RELEASE}"; exit 0 - ;; - "RISC iX":*) - echo "arm-whatever-riscix"; exit 0; - ;; - *:4.0:2:*) - echo "whatever-unisys-sysv4"; exit 0; - ;; - *:*:dcosx:NILE*) - echo "pyramid-pyramid-svr4"; exit 0; - ;; - *:*:*:"DRS 6000") - echo "drs6000-whatever-whatever"; exit 0; - ;; - esac - - # Now NeXT - ISNEXT=`(hostinfo) 2>/dev/null` - case "$ISNEXT" in - *NeXT*) - # Swiped from a friendly uname clone for NEXT/OPEN Step. - NEXTOSVER="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" - if [ "$NEXTOSVER" -gt 3.3 ]; then - NEXTOS="openstep" - else - NEXTOS="nextstep" - fi - NEXTREL="`hostinfo | sed -n 's/.*NeXT Mach \([0-9\.]*\).*/\1/p'`" - NEXTARCH=`arch` - echo "${NEXTARCH}-next-${NEXTOS}${NEXTREL}" ; exit 0 - ;; + esac - - # Fallback - echo "${MACHINE}-whatever-${SYSTEM}|${RELEASE}|${VERSION}" - ;; -arx ) - ## - ## arx -- Extended archive command - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for shtool - ## - - ar_prg="$opt_C" - ar_cmd="$1"; shift - archive="$1"; shift - files="$*" - - # walk through the file list and expand archives members - tmpdir=`echo $archive | sed -e 's;[^/]*$;.arx;'` - nfiles='' - if [ ".$files" != . ]; then - for file in $files; do - if [ ! -f $file ]; then - echo "$msgprefix:Error: input file not found: $file" 1>&2 - exit 1 - fi - case $file in - *.a ) - if [ ! -d $tmpdir ]; then - if [ ".$opt_t" = .yes ]; then - echo "mkdir $tmpdir" 1>&2 - fi - mkdir $tmpdir - fi - case $tmpdir in - .arx ) - from="../$file" - ;; - * ) - dir=`echo $file | sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' -e 's;^$;.;'` - base=`echo $file | sed -e 's;.*/\([^/]*\)$;\1;'` - from="`cd $dir; pwd`/$base" - ;; - esac - if [ ".$opt_t" = .yes ]; then - echo "(cd $tmpdir && $ar_prg x $from)" 1>&2 - fi - (cd $tmpdir && eval $ar_prg x $from) - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: member extraction failed for archive: $file" 1>&2 - exit 1 - fi - for member in - `eval $ar_prg t $file`; do - [ ".$member" = .- ] && continue - nfiles="$nfiles $tmpdir/$member" - done + # provide fallback values + [ ".$AT" = . ] && AT="${AP:-${AC}}" + [ ".$AP" = . ] && AP="${AT:-${AC}}" + [ ".$AC" = . ] && AC="${AP:-${AT}}" + [ ".$ST" = . ] && ST="${SP:-${SC}}" + [ ".$SP" = . ] && SP="${ST:-${SC}}" + [ ".$SC" = . ] && SC="${SP:-${ST}}" + + # support explicit enforced verbose/concise output + if [ ".$opt_v" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%[\1]/g'` + elif [ ".$opt_c" = .yes ]; then + opt_F=`echo ":$opt_F" | sed -e 's/^://' -e 's/%\([as][cpt]\)/%<\1>/g'` + fi + + # provide verbose and concise variants + AC_V=""; AC_N=""; AC_C="" + AP_V=""; AP_N=""; AP_C="" + AT_V=""; AT_N=""; AT_C="" + SC_V=""; SC_N=""; SC_C="" + SP_V=""; SP_N=""; SP_C="" + ST_V=""; ST_N=""; ST_C="" + for var_lc in at ap ac st sp sc; do + case "$opt_F" in + *"%[${val_lc}]"* | *"%{${val_lc}}"* | *"%${val_lc}"* | *"%<${val_lc}>"* ) + var_uc=`util_upper "$var_lc"` + eval "val=\"\$${var_uc}\"" + val_V=""; val_N=""; val_C="" + case "$opt_F" in + *"%[${var_lc}]"* ) + val_V=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];\1;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_V=\"\${val_V}\"" ;; - * ) - nfiles="$nfiles $file" + esac + case "$opt_F" in + *"%{${var_lc}}"* | *"%${var_lc}"* ) + val_N=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;<\([^>]*\)>;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_N=\"\${val_N}\"" ;; esac - done - fi - - # run the final archive command - if [ ".$opt_t" = .yes ]; then - echo "$ar_prg $ar_cmd $archive $nfiles" 1>&2 - fi - eval $ar_prg $ar_cmd $archive $nfiles - if [ $? -ne 0 ]; then - echo "$msgprefix:Error: archive command failed" 1>&2 - exit $? - fi - - # cleanup and die gracefully - if [ -d $tmpdir ]; then - if [ ".$opt_t" = .yes ]; then - echo "rm -rf $tmpdir" 1>&2 - fi - rm -rf $tmpdir - fi - ;; - -slo ) - ## - ## slo -- Separate linker options by library class - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - DIFS="$IFS" - - # parse out -L and -l options from command line - DIRS='' - LIBS='' - ARGV='' - optprev='' - for opt - do - # concatenate with previous option if exists - if [ ".$optprev" != . ]; then - opt="${optprev}${opt}"; - optprev='' - fi - # remember options for arg when used stand-alone - if [ ".$opt" = ".-L" -o ".$opt" = ".-l" ]; then - optprev="$opt" - continue; - fi - # split argument into option plus option argument - arg="`echo $opt | cut -c3-`" - opt="`echo $opt | cut -c1-2`" - # store into containers - case $opt in - -L) DIRS="$DIRS:$arg" ;; - -l) LIBS="$LIBS:$arg" ;; - *) ARGV="$ARGV $opt" ;; + case "$opt_F" in + *"%<${var_lc}>"* ) + val_C=`echo ":$val" | \ + sed -e 's/^://' \ + -e 's;\[\([^]]*\)\];;g' \ + -e 's;[^<]*<\([^>]*\)>[^<]*;\1;g' \ + -e "s; ;§§;g" \ + -e "s;/;%%;g" \ + -e "s;§§;${opt_S};g" \ + -e "s;%%;${opt_C};g"` + eval "${var_uc}_C=\"\${val_C}\"" + ;; + esac + ;; esac done - - # set linker default directories - DIRS_DEFAULT='/lib:/usr/lib' - if [ ".$LD_LIBRARY_PATH" != . ]; then - DIRS_DEFAULT="$DIRS_DEFAULT:$LD_LIBRARY_PATH" - fi - - # sort options by class - DIRS_OBJ='' - LIBS_OBJ='' - DIRS_PIC='' - LIBS_PIC='' - DIRS_DSO='' - LIBS_DSO='' - - # for each library... - OIFS="$IFS" IFS=':' - for lib in $LIBS; do - [ ".$lib" = . ] && continue - - found='no' - found_indefdir='no' - found_type='' - found_dir='' - - # for each directory... - OIFS2="$IFS" IFS=":$DIFS" - for dir in ${DIRS} switch-to-defdirs ${DIRS_DEFAULT}; do - [ ".$dir" = . ] && continue - [ ".$dir" = .switch-to-defdirs ] && found_indefdir=yes - [ ! -d $dir ] && continue - - # search the file - OIFS3="$IFS" IFS="$DIFS" - for file in '' `cd $dir && ls lib${lib}.* 2>/dev/null`; do - [ ".$file" = . ] && continue - case $file in - *.so|*.so.[0-9]*|*.sl|*.sl.[0-9]* ) - found=yes; - found_type=DSO; - break - ;; - *.lo|*.la ) - found=yes; - found_type=PIC - ;; - *.a ) - if [ ".$found_type" = . ]; then - found=yes - found_type=OBJ - fi - ;; - esac - done - IFS="$OIFS3" - if [ ".$found" = .yes ]; then - found_dir="$dir" - break - fi - done - IFS="$OIFS2" - - if [ ".$found" = .yes ]; then - if [ ".$found_indefdir" != .yes ]; then - eval "dirlist=\"\${DIRS_${found_type}}:\"" - if [ ".`echo \"$dirlist\" | fgrep :$found_dir:`" = . ]; then - eval "DIRS_${found_type}=\"\$DIRS_${found_type}:${found_dir}\"" - fi - eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" - else - eval "LIBS_${found_type}=\"\$LIBS_${found_type}:$lib\"" - fi - else - LIBS_OBJ="$LIBS_OBJ:$lib" - #dirlist="`echo $DIRS $DIRS_DEFAULT | sed -e 's/:/ /g'`" - #echo "slo:Warning: library \"$lib\" not found in any of the following dirs:" 2>&1 - #echo "slo:Warning: $dirlist" 1>&1 - fi - done - IFS="$OIFS" - - # also pass-through unused dirs even if it's useless - OIFS="$IFS" IFS=':' - for dir in $DIRS; do - dirlist="${DIRS_OBJ}:${DIRS_PIC}:${DIRS_DSO}:" - if [ ".`echo \"$dirlist\" | fgrep :$dir:`" = . ]; then - DIRS_OBJ="$DIRS_OBJ:$dir" - fi - done - IFS="$OIFS" - - # reassemble the options but seperated by type - for type in OBJ PIC DSO; do - OIFS="$IFS" IFS=':' - eval "libs=\"\$LIBS_${type}\"" - opts='' - for lib in $libs; do - [ ".$lib" = . ] && continue - opts="$opts -l$lib" - done - eval "LIBS_${type}=\"$opts\"" - - eval "dirs=\"\$DIRS_${type}\"" - opts='' - for dir in $dirs; do - [ ".$dir" = . ] && continue - opts="$opts -L$dir" - done - eval "DIRS_${type}=\"$opts\"" - IFS="$OIFS" - done - - # give back results - for var in ARGV DIRS_OBJ LIBS_OBJ DIRS_PIC LIBS_PIC DIRS_DSO LIBS_DSO; do - eval "val=\"\$${var}\"" - val="`echo $val | sed -e 's/^ *//'`" - echo "SLO_${var}=\"${val}\"" - done - ;; -scpp ) - ## - ## scpp -- Sharing C Pre-Processor - ## Copyright (c) 1999 Ralf S. Engelschall - ## Originally written for NPS - ## - - srcs="$*" - output="${opt_o}.n" - - # parse source file(s) - if [ ".$opt_v" = .yes ]; then - echo "Parsing:" | awk '{ printf("%s", $0); }' 1>&2 - fi - for src in $srcs; do - if [ ".$opt_v" = .yes ]; then - echo $src | awk '{ printf(" %s", $0); }' 1>&2 - fi - awk <$src ' - BEGIN { - ln = 0; - fln = 0; - level = 0; - mode = ""; - store = ""; - } - { - ln++; - } - /^#if.*/ { - level++; - } - /^#if [a-zA-Z_][a-zA-Z0-9_]* *$/ { - if ($2 == define) { - mode = "D"; - printf("D:#line %d \"%s\"\n", ln, src); - next; - } - } - /^#endif.*/ { - level--; - if (mode == "D" && level == 0) { - mode = ""; - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_].*;.*/ || /^[a-zA-Z_][a-zA-Z0-9_].*=.*/ { - if ($1 == class) { - printf("V:#line %d \"%s\"\n", ln, src); - printf("V:%s\n", $0); - printf("J:%s\n", $0); - next; - } - } - /^[a-zA-Z_][a-zA-Z0-9_]*/ { - if ($1 == class) { - fln = ln; - store = $0; - mode = "F"; - next; - } - } - /^\{ *$/ { - if (mode == "F") { - printf("F:#line %d \"%s\"\n", fln, src); - printf("F:%s;\n", store); - printf("I:%s;\n", store); - store = ""; - mode = ""; - next; - } - } - { - if (mode == "D") - printf("D:%s\n", $0); - else if (mode == "F") - store = store " " $0; - } - ' "src=$src" "define=$opt_D" "class=$opt_C" >>$tmpfile - done - if [ ".$opt_v" = .yes ]; then - echo "" 1>&2 + # create output string + output=`echo ":$opt_F" |\ + sed -e "s/^://" \ + -e "s;%\\[ac\\];${AC_V};g" \ + -e "s;%{ac};${AC_N};g" \ + -e "s;%ac;${AC_N};g" \ + -e "s;%;${AC_C};g" \ + -e "s;%\\[ap\\];${AP_V};g" \ + -e "s;%{ap};${AP_N};g" \ + -e "s;%ap;${AP_N};g" \ + -e "s;%;${AP_C};g" \ + -e "s;%\\[at\\];${AT_V};g" \ + -e "s;%{at};${AT_N};g" \ + -e "s;%at;${AT_N};g" \ + -e "s;%;${AT_C};g" \ + -e "s;%\\[sc\\];${SC_V};g" \ + -e "s;%{sc};${SC_N};g" \ + -e "s;%sc;${SC_N};g" \ + -e "s;%;${SC_C};g" \ + -e "s;%\\[sp\\];${SP_V};g" \ + -e "s;%{sp};${SP_N};g" \ + -e "s;%sp;${SP_N};g" \ + -e "s;%;${SP_C};g" \ + -e "s;%\\[st\\];${ST_V};g" \ + -e "s;%{st};${ST_N};g" \ + -e "s;%st;${ST_N};g" \ + -e "s;%;${ST_C};g" \ + -e 's/\\\\n/^/g' |\ + tr '^' '\012'` + + # support lower/upper-case mapping + if [ ".$opt_L" = .yes ]; then + output=`util_lower "$output"` + elif [ ".$opt_U" = .yes ]; then + output=`util_upper "$output"` fi - - # start generating output header - echo "/* $opt_o -- autogenerated from $opt_t, DO NOT EDIT! */" >$output - echo "#line 1 \"$opt_t\"" >>$output - sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd' |\ - sed -e "/^${opt_M} *\$/d" >>$output - - # merge in the define blocks - grep '^D:' $tmpfile | sed -e 's/^D://' >>$output - - # generate standard prolog - echo "#line 1 \"_ON_THE_FLY_\"" >>$output - echo "" >>$output - echo "/* make sure the scpp source extensions are skipped */" >>$output - echo "#define $opt_D 0" >>$output - echo "#define $opt_C /**/" >>$output - - # generate namespace hiding for variables - echo "" >>$output - echo "/* move intern variables to hidden namespace */" >>$output - grep '^J:' $tmpfile | sed >>$output \ - -e 's/^J://' \ - -e 's/ */ /g' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\];.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\)\[\] =.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\);.*$/#define \1 __\1/' \ - -e 's/^[^=;]*[ *]\([a-zA-Z0-9_]*\) =.*$/#define \1 __\1/' - - # generate namespace hiding for functions - echo "" >>$output - echo "/* move intern functions to hidden namespace */" >>$output - grep '^I:' $tmpfile | sed >>$output \ - -e 's/^I://' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e 's/^[^(]*[ *]\([a-zA-Z0-9_]*\)(.*$/#define \1 __\1/' - - # generate prototypes for variables - echo "" >>$output - echo "/* prototypes for intern variables */" >>$output - grep '^V:' $tmpfile | sed >>$output \ - -e 's/^V://' \ - -e 's/ */ /g' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\);.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\[\]\) =.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\);.*$/\1;/' \ - -e 's/^\([^=;]*[ *][a-zA-Z0-9_]*\) =.*$/\1;/' \ - -e 's/ ;/;/g' \ - -e "s/^$opt_C /extern /" - - # generate prototypes for functions - echo "" >>$output - echo "/* prototypes for intern functions */" >>$output - grep '^F:' $tmpfile | sed >>$output \ - -e 's/^F://' \ - -e 's/\([ (]\) */\1/g' \ - -e 's/ *\([),]\)/\1/g' \ - -e "s/^$opt_C /extern /" - - # finish generating output header - n=`(echo ''; sed <$opt_t -e "1,/^${opt_M} *\$/p" -e 'd') |\ - wc -l | sed -e 's;^ *\([0-9]*\) *$;\1;'` - echo "#line $n \"$opt_t\"" >>$output - sed <$opt_t -e "/^${opt_M} *\$/,\$p" -e 'd' |\ - sed -e "/^${opt_M} *\$/d" >>$output - - # create final output file - if [ -f $opt_o ]; then - if [ ".$opt_p" = .yes ]; then - grep -v '^#line' $opt_o >$tmpfile.o - grep -v '^#line' $output >$tmpfile.n - out_old="$tmpfile.o" - out_new="$tmpfile.n" - else - out_old="$opt_o" - out_new="$output" - fi - if cmp -s $out_old $out_new; then - : - else - cp $output $opt_o - fi + + # display output string + if [ ".$opt_n" = .yes ]; then + echo . | awk '{ printf("%s", output); }' output="$output" else - cp $output $opt_o + echo "$output" fi - rm -f $output - rm -f $tmpfile $tmpfile.* >/dev/null 2>&1 + + shtool_exit 0 ;; version ) ## - ## version -- Generate and maintain a version information file - ## Copyright (c) 1994-1999 Ralf S. Engelschall - ## Originally written for ePerl + ## version -- Maintain a version information file + ## Copyright (c) 1994-2004 Ralf S. Engelschall ## - - LANGUAGE="$opt_l" - NAME="$opt_n" - PREFIX="$opt_p" - FULLVERSION="$opt_s" - INCREASE="$opt_i" - REPORT="$opt_d" - FILE="$1" - - # determine language - if [ ".$LANGUAGE" = .unknown ]; then - case $FILE in - *.txt ) LANGUAGE=txt ;; - *.c ) LANGUAGE=c ;; - *.pl | *.pm ) LANGUAGE=perl ;; - * ) echo "$tool:Error: unknown language type" 1>&2; exit 1 ;; - esac - fi - - # determine prefix from name and vice versa - if [ ".$PREFIX" = . -o ".$PREFIX" = .unknown ]; then - if [ ".$NAME" != . -a ".$NAME" != .unknown ]; then - PREFIX="$NAME" + + file="$1" + + # determine prefix and name + name="$opt_n" + prefix="$opt_p" + + # determine current version + triple="$opt_s" + if [ ".$triple" != . ]; then + # use given triple + if [ ".`echo $triple | grep '[0-9]*.[0-9]*[sabp.][0-9]*'`" = . ]; then + echo "$msgprefix:Error: invalid argument to option \`-s': \`$opt_s'" 1>&2 + shtool_exit 1 fi + eval `echo $triple |\ + sed -e 's%\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\).*%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc + elif [ -r $file ]; then + # determine triple from given file + eval `grep 'Version [0-9]*.[0-9]*[sabp.][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $file |\ + sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\ + ver="\1";rev="\2";typ="\3";lev="\4";tim="\5"%' -e 'q'` + else + # intialise to first version + ver=0 + rev=1 + typ=. + lev=0 + tim=calc fi - if [ ".$NAME" = . -o ".$NAME" = .unknown ]; then - if [ ".$PREFIX" != . -a ".$PREFIX" != .unknown ]; then - NAME="$PREFIX" - fi + + # determine new version in batch + if [ ".$opt_i" != . ]; then + case $opt_i in + v ) ver=`expr $ver + 1` + rev=0 + lev=0 + ;; + r ) rev=`expr $rev + 1` + lev=0 + ;; + l ) lev=`expr $lev + 1` + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-i': \`$opt_i'" 1>&2 + shtool_exit 1 + ;; + esac + tim=calc fi - - # determine version - date=unknown - version=0 - revision=0 - bplevel=0 - if [ ".$FULLVERSION" = .unknown ]; then - if [ -r "$FILE" ]; then - # grep out current information - id=`grep 'Version [0-9]*.[0-9]*[.abps][0-9]* ([0-9]*-[a-zA-Z]*-[0-9]*)' $FILE | \ - head -1 | \ - sed -e 's%.*Version \([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\) (\([0-9]*-[a-zA-Z]*-[0-9]*\)).*%\1:\2:\3:\4:\5%'` - version=`echo $id | awk -F: '{ print $1 }'` - revision=`echo $id | awk -F: '{ print $2 }'` - bptype=`echo $id | awk -F: '{ print $3 }'` - bplevel=`echo $id | awk -F: '{ print $4 }'` - date=`echo $id | awk -F: '{ print $5 }'` - if [ .$REPORT = .NO ]; then - case $INCREASE in - b ) bplevel=`expr $bplevel + 1` - bptype=b - ;; - a ) bplevel=`expr $bplevel + 1` - bptype=a - ;; - s ) bplevel=`expr $bplevel + 1` - bptype=s - ;; - P ) bplevel=`expr $bplevel + 1` - bptype=. - ;; - p ) bplevel=`expr $bplevel + 1` - bptype=p - ;; - r ) revision=`expr $revision + 1` - bptype=. - bplevel=0 - ;; - v ) version=`expr $version + 1` - revision=0 - bptype=. - bplevel=0 - ;; - esac - date=calc - fi - FULLVERSION="$version.$revision$bptype$bplevel" - else - # intialise to first version - version=0 - revision=5 - bptype=b - bplevel=0 - date=calc - fi - else - # take given version - V=`echo $FULLVERSION | sed -e 's%\([0-9]*\)\.\([0-9]*\)\([.abps]\)\([0-9]*\).*%\1:\2:\3:\4%'` - version=`echo $V | awk -F: '{ print $1 }'` - revision=`echo $V | awk -F: '{ print $2 }'` - bptype=`echo $V | awk -F: '{ print $3 }'` - bplevel=`echo $V | awk -F: '{ print $4 }'` - date=calc + + # determine new version interactively + if [ ".$opt_e" = .yes ]; then + echo "old version: ${ver}.${rev}${typ}${lev}" + while [ 1 ]; do + echo dummy | awk '{ printf("new version: "); }' + read triple + case $triple in + [0-9]*.[0-9]*[sabp.][0-9]* ) + ;; + * ) echo "$msgprefix:Error: invalid version string entered: \`$triple'" 1>&2 + continue + ;; + esac + break + done + eval `echo $triple |\ + sed -e 's%^\([0-9]*\)\.\([0-9]*\)\([sabp.]\)\([0-9]*\)$%\ + ver="\1";rev="\2";typ="\3";lev="\4"%'` + tim=calc fi - - # determine hex value of version - case $FULLVERSION in - *.*a* ) - HEX=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*a//' | awk '{ printf("0%02d", $1); }'` - ;; - *.*b* ) - HEX=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d%02d", $1, $2); }' && - echo "$FULLVERSION" | sed -e 's/.*b//' | awk '{ printf("1%02d", $1); }'` - ;; - *.*.* ) - HEX=`echo "$FULLVERSION" | awk -F. '{ printf("%d%02d2%02d", $1, $2, $3); }'` - ;; - esac - - # determine libtool version - case $FULLVERSION in - *.*a* ) - LTV=`echo "$FULLVERSION" | sed -e 's/a.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*b* ) - LTV=`echo "$FULLVERSION" | sed -e 's/b.*//' | awk -F. '{ printf("%d:0", $1*10+$2); }'` - ;; - *.*.* ) - LTV=`echo "$FULLVERSION" | awk -F. '{ printf("%d:%d", $1*10+$2, $3); }'` - ;; + + # determine hexadecimal and libtool value of version + case $typ in + a ) typnum=0; levnum=$lev ;; + b ) typnum=1; levnum=$lev ;; + p | . ) typnum=2; levnum=$lev ;; + s ) typnum=15; levnum=255 ;; # snapshots are special esac - - # determine string out of filename - # (don't try to optimize this in any way - portability!) - FILESTR=`echo "$FILE" |\ - tr 'abcdefghijklmnopqrstuvwxyz./%+' \ - 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` - + hex=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("0x%x%02x%1x%02x", $1, $2, $3, $4); }' |\ + tr 'abcdef' 'ABCDEF'` + ltv=`echo "$ver:$rev:$typnum:$levnum" |\ + awk -F: '{ printf("%d:%d", $1*10 + $2, $3*10 + $4); }'` + # determine date - if [ ".$date" = .calc ]; then + if [ ".$tim" = .calc ]; then day=`date '+%d'` month=`date '+%m'` year=`date '+%Y' 2>/dev/null` @@ -2215,264 +1242,185 @@ version ) 11) month='Nov' ;; 12) month='Dec' ;; esac - date="${day}-${month}-${year}" + tim="${day}-${month}-${year}" fi - - if [ .$REPORT != .NO ]; then - case $REPORT in - long ) - echo "$version.$revision$bptype$bplevel ($date)" - ;; + + # perform result actions + mode=show + if [ ".$opt_i" != . ]; then + mode=edit + elif [ ".$opt_e" = .yes ]; then + mode=edit + elif [ ".$opt_s" != . ]; then + mode=edit + fi + if [ ".$mode" = .show ]; then + # just display the current version + case $opt_d in short ) - echo "$version.$revision$bptype$bplevel" + echo "${ver}.${rev}${typ}${lev}" + ;; + long ) + echo "${ver}.${rev}${typ}${lev} ($tim)" ;; libtool ) - echo "$LTV" + echo "${ltv}" ;; hex ) - echo "0x$HEX" + echo "${hex}" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-d': \`$opt_d'" 1>&2 + shtool_exit 1 ;; esac - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - fi - - # create the version file according the the selected language - echo "new version: $version.$revision$bptype$bplevel ($date)" - case $LANGUAGE in - txt ) - cat >$tmpfile <<'EOT' - - This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@) -EOT - ;; - c ) - cat >$tmpfile <<'EOT' -/* -** @FILE@ -- Version Information -** [automatically generated and maintained by shtool] -*/ - -#ifdef _AS_HEADER - -#ifndef _@FILESTR@ -#define _@FILESTR@ -#define @PREFIX@_VERSION 0x@HEX@ -extern const int @PREFIX@_Version; -extern const char @PREFIX@_VersionStr[]; -extern const char @PREFIX@_Hello[]; -extern const char @PREFIX@_GNUVersion[]; -extern const char @PREFIX@_WhatID[]; -extern const char @PREFIX@_RCSIdentID[]; -extern const char @PREFIX@_WebID[]; -extern const char @PREFIX@_PlainID[]; -#endif /* _@FILESTR@ */ - -#else - -const int @PREFIX@_Version = 0x@HEX@; -const char @PREFIX@_VersionStr[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_Hello[] = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_GNUVersion[] = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_WhatID[] = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -const char @PREFIX@_RCSIdentID[] = "$Id: shtool 1.1 Tue, 27 Jan 2004 11:46:36 -0800 shawnw $"; -const char @PREFIX@_WebID[] = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -const char @PREFIX@_PlainID[] = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -#endif -EOT - ;; - perl ) - cat >$tmpfile <<'EOT' -## -## @FILE@ -- Version Information -## [automatically generated and maintained by shtool] -## + else + # update the version file -$@PREFIX@_Version = 0x@HEX@; -$@PREFIX@_VersionStr = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_Hello = "This is @NAME@, Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_GNUVersion = "@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_WhatID = "@(#)@NAME@ Version @VERSION@.@REVISION@@BPTYPE@@BPLEVEL@ (@DAY@-@MONTH@-@YEAR@)"; -$@PREFIX@_RCSIdentID = "\$Id: shtool 1.1 Tue, 27 Jan 2004 11:46:36 -0800 shawnw $/"; -$@PREFIX@_WebID = "@NAME@/@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; -$@PREFIX@_PlainID = "@VERSION@.@REVISION@@BPTYPE@@BPLEVEL@"; - -1; -EOT - ;; - esac - - # now create the version file - rm -f $FILE >/dev/null 2>&1 - sed \ - -e "s|@FILE@|$FILE|g" \ - -e "s|@FILESTR@|$FILESTR|g" \ - -e "s|@PREFIX@|$PREFIX|g" \ - -e "s|@NAME@|$NAME|g" \ - -e "s|@HEX@|$HEX|g" \ - -e "s|@VERSION@|$version|g" \ - -e "s|@REVISION@|$revision|g" \ - -e "s|@BPTYPE@|$bptype|g" \ - -e "s|@BPLEVEL@|$bplevel|g" \ - -e "s|@YEAR@|$year|g" \ - -e "s|@MONTH@|$month|g" \ - -e "s|@DAY@|$day|g" <$tmpfile >$FILE - rm -f $tmpfile >/dev/null 2>&1 - exit 0 - ;; + # pre-generate various strings + triple="${ver}.${rev}${typ}${lev}" + vHex="$hex" + vShort="${triple}" + vLong="${triple} (${tim})" + vTeX="This is ${name}, Version ${triple} (${tim})" + vGNU="${name} ${triple} (${tim})" + vWeb="${name}/${triple}" + vSCCS="@(#)${name} ${triple} (${tim})" + vRCS="\$Id: ${name} ${triple} (${tim}) \$" -path ) - ## - ## path -- Deal with program paths - ## Copyright (c) 1998-1999 Ralf S. Engelschall - ## Originally written for Apache - ## - - namelist="$*" - - # check whether the test command supports the -x option - cat >$tmpfile </dev/null; then - minusx="-x" - else - minusx="-r" - fi - rm -f $tmpfile - - # split path string - paths="`echo $opt_p |\ - sed -e 's/^:/.:/' \ - -e 's/::/:.:/g' \ - -e 's/:$/:./' \ - -e 's/:/ /g'`" - - # SPECIAL REQUEST - # translate forward to reverse path - if [ ".$opt_r" = .yes ]; then - if [ "x$namelist" = "x." ]; then - rp='.' - else - rp='' - for pe in `IFS="$IFS/"; echo $namelist`; do - rp="../$rp" - done - fi - echo $rp | sed -e 's:/$::' - exit 0 - fi - - # SPECIAL REQUEST - # strip out directory or base name - if [ ".$opt_d" = .yes ]; then - echo "$namelist" |\ - sed -e 's;[^/]*$;;' -e 's;\(.\)/$;\1;' - exit 0 - fi - if [ ".$opt_b" = .yes ]; then - echo "$namelist" |\ - sed -e 's;.*/\([^/]*\)$;\1;' - exit 0 - fi - - # MAGIC SITUATION - # Perl Interpreter (perl) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .perl ]; then - rm -f $tmpfile - touch $tmpfile - c=0 - found=0 - for dir in $paths; do - dir=`echo $dir | sed -e 's;/*$;;'` - for perl in perl5 perl miniperl; do - if [ $minusx "$dir/$perl" ]; then - perl="$dir/$perl" - version=`$perl -v | grep version |\ - sed -e 's/.* version //' -e 's/ built.*//' -e 's/ with.*//'` - versionnum="`echo $version | sed -e 's/\.//g' -e 's/_//g'`" - versionnum=`expr $versionnum - $c` - echo "$versionnum $perl" >>$tmpfile - found=1 - fi - done - c=`expr $c + 1` - done - if [ $found = 1 ]; then - perl="`cat $tmpfile | sort -u | tail -1 | cut '-d ' -f2`" - rm -f $tmpfile - echo "$perl" - exit 0 - fi - exit 1 - fi - - # MAGIC SITUATION - # C pre-processor (cpp) - if [ ".$opt_m" = .yes ] && [ ".$namelist" = .cpp ]; then - cat >$tmpfile.c < - Syntax Error -EOT - # 1. try the standard cc -E approach - cpp="${CC-cc} -E" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 2. try the cc -E approach and GCC's -traditional-ccp option - cpp="${CC-cc} -E -traditional-cpp" - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # 3. try a standalone cpp command in path and lib dirs - for path in $paths /lib /usr/lib /usr/local/lib; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/cpp" ] && [ ! -d "$path/cpp" ]; then - cpp="$path/cpp" - break - fi - done - if [ ".$cpp" != . ]; then - (eval "$cpp $tmpfile.c >/dev/null") 2>$tmpfile.out - my_error=`grep -v '^ *+' $tmpfile.out` - if [ ".$my_error" != . ]; then - # ok, we gave up... - cpp='' - fi - fi - fi - fi - rm -f $tmpfile.c $tmpfile.out - if [ ".$cpp" != . ]; then - echo "$cpp" - exit 0 - fi - exit 1 + # determine string out of filename + # (do NOT try to optimize this in any way because of portability) + filestr=`echo $file |\ + tr 'abcdefghijklmnopqrstuvwxyz./%+' \ + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ____' | sed -e 's/-/_/g'` + + # generate uppercase prefix + prefixupper=`echo $prefix |\ + tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + + # create the version file according the the selected language + echo "new version: ${vLong}" + + cp /dev/null $file + case $opt_l in + txt ) + echo >>$file "" + echo >>$file " ${file} -- Version Information for ${name} (syntax: Text)" + echo >>$file " [automatically generated and maintained by GNU shtool]" + echo >>$file "" + echo >>$file " $vTeX" + echo >>$file "" + ;; + c ) + echo >>$file "/*" + echo >>$file "** ${file} -- Version Information for ${name} (syntax: C/C++)" + echo >>$file "** [automatically generated and maintained by GNU shtool]" + echo >>$file "*/" + echo >>$file "" + echo >>$file "#ifdef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "#ifndef _${filestr}_" + echo >>$file "#define _${filestr}_" + echo >>$file "" + echo >>$file "#define ${prefixupper}VERSION ${vHex}" + echo >>$file "" + echo >>$file "typedef struct {" + echo >>$file " const int v_hex;" + echo >>$file " const char *v_short;" + echo >>$file " const char *v_long;" + echo >>$file " const char *v_tex;" + echo >>$file " const char *v_gnu;" + echo >>$file " const char *v_web;" + echo >>$file " const char *v_sccs;" + echo >>$file " const char *v_rcs;" + echo >>$file "} ${prefix}version_t;" + echo >>$file "" + echo >>$file "extern ${prefix}version_t ${prefix}version;" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_ */" + echo >>$file "" + echo >>$file "#else /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + echo >>$file "#define _${filestr}_AS_HEADER_" + echo >>$file "#include \"${file}\"" + echo >>$file "#undef _${filestr}_AS_HEADER_" + echo >>$file "" + echo >>$file "${prefix}version_t ${prefix}version = {" + echo >>$file " ${vHex}," + echo >>$file " \"${vShort}\"," + echo >>$file " \"${vLong}\"," + echo >>$file " \"${vTeX}\"," + echo >>$file " \"${vGNU}\"," + echo >>$file " \"${vWeb}\"," + echo >>$file " \"${vSCCS}\"," + echo >>$file " \"${vRCS}\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "#endif /* _${filestr}_AS_HEADER_ */" + echo >>$file "" + ;; + m4 ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: M4)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "m4_define([v_hex], [${vHex}])" + echo >>$file "m4_define([v_short], [${vShort}])" + echo >>$file "m4_define([v_long], [${vLong}])" + echo >>$file "m4_define([v_tex], [${vTeX}])" + echo >>$file "m4_define([v_gnu], [${vGNU}])" + echo >>$file "m4_define([v_web], [${vWeb}])" + echo >>$file "m4_define([v_sccs], [${vSCCS}])" + echo >>$file "m4_define([v_rcs], [${vRCS}])" + echo >>$file "" + ;; + perl ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Perl)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "my \$${prefix}version = {" + echo >>$file " 'v_hex' => ${vHex}," + echo >>$file " 'v_short' => \"${vShort}\"," + echo >>$file " 'v_long' => \"${vLong}\"," + echo >>$file " 'v_tex' => \"${vTeX}\"," + echo >>$file " 'v_gnu' => \"${vGNU}\"," + echo >>$file " 'v_web' => \"${vWeb}\"," + echo >>$file " 'v_sccs' => \"${vSCCS}\"," + echo >>$file " 'v_rcs' => \"\\${vRCS}/\"" + echo >>$file "};" + echo >>$file "" + echo >>$file "1;" + echo >>$file "" + ;; + python ) + echo >>$file "##" + echo >>$file "## ${file} -- Version Information for ${name} (syntax: Python)" + echo >>$file "## [automatically generated and maintained by GNU shtool]" + echo >>$file "##" + echo >>$file "" + echo >>$file "class ${prefix}version:" + echo >>$file " v_hex = ${vHex}" + echo >>$file " v_short = \"${vShort}\"" + echo >>$file " v_long = \"${vLong}\"" + echo >>$file " v_tex = \"${vTeX}\"" + echo >>$file " v_gnu = \"${vGNU}\"" + echo >>$file " v_web = \"${vWeb}\"" + echo >>$file " v_sccs = \"${vSCCS}\"" + echo >>$file " v_rcs = \"${vRCS}\"" + echo >>$file "" + ;; + * ) echo "$msgprefix:Error: invalid argument to option \`-l': \`$opt_l'" 1>&2 + shtool_exit 1 + ;; + esac fi - - # STANDARD SITUATION - # iterate over names - for name in $namelist; do - # iterate over paths - for path in $paths; do - path=`echo $path | sed -e 's;/*$;;'` - if [ $minusx "$path/$name" ] && [ ! -d "$path/$name" ]; then - if [ ".$opt_s" != .yes ]; then - echo "$path/$name" 2>&1 - fi - exit 0 - fi - done - done - exit 1 + + shtool_exit 0 ;; esac -exit 0 +shtool_exit 0 -##EOF## -- cgit v1.2.3 From b05cf9ef9a780a32ce0127bde8f9218d396679a2 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 31 Dec 2021 09:06:59 +0100 Subject: configure_in Gbp-Pq: Name 05_configure_in.diff --- Makefile.in | 2 +- configure.in | 204 ++++++++++++++++++------------------------------------ tests/Makefile.in | 4 +- 3 files changed, 69 insertions(+), 141 deletions(-) diff --git a/Makefile.in b/Makefile.in index c1f41c0..b2f802d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,7 +4,7 @@ RESULT=pcap LIBINSTALL_FILES=$(wildcard *.mli *.cmi *.cma *.cmx *.cmxa *.a *.so) CC=@CC@ -CFLAGS=@CFLAGS@ +CFLAGS=@CFLAGS@ @cp4flag@ CLIBS=$(foreach lib, @LIBS@, $(subst -l,,${lib})) LDFLAGS=@LDFLAGS@ IDLFLAGS=-no-include diff --git a/configure.in b/configure.in index 0211f96..0ace885 100644 --- a/configure.in +++ b/configure.in @@ -1,162 +1,90 @@ +dnl Standard configuration + AC_INIT(pcap.idl) -AC_MSG_CHECKING(for version) +AC_MSG_CHECKING([for version]) VERSION="`etc/shtool version -l txt -d short VERSION`" -AC_MSG_RESULT "Configuring Version $VERSION" +AC_MSG_RESULT([Configuring Version $VERSION]) AC_SUBST(VERSION) - -AC_MSG_CHECKING(for platform) -ARCH="`etc/shtool guessos`" -AC_MSG_RESULT "$ARCH" +AC_MSG_CHECKING([for platform]) +ARCH="`etc/shtool platform`" +AC_MSG_RESULT([$ARCH]) AC_SUBST(ARCH) -AC_CHECKING(for ocaml compiler and tools) -AC_CHECK_PROG(ocamlc,ocamlc,ocamlc) -AC_CHECK_PROG(ocamlopt,ocamlopt,ocamlopt) -AC_CHECK_PROG(ocamlfind,ocamlfind,ocamlfind,ocamlidl) AC_PROG_INSTALL AC_SUBST(INSTALL) -AC_CHECKING(for C compiler) AC_PROG_CC - -AC_CHECKING(for C header files) AC_HEADER_STDC -# -camlidldir="" -camlidllibdir="" -ffcalldir="" -ffcallarchive="" -libpcapdir="" -cp4flag="" -# - -AC_ARG_ENABLE(examples, - [ --enable-examples build example programs [default=no]],,enable_examples="no") - -# -AC_CHECKING(libraries) - -#AC_CHECKING(for pcap library) -#if test "$ac_cv_lib_pcap" == "no"; then -# #dirs="/usr/local/lib -# # /usr/local/lib -# # /usr/lib -# # /lib" -# dirs="/home/x25/code/MLpcap/libpcap-0.8.3" -# for d in $dirs; do -# test -f "$d/libpcap.a" && LDFLAGS="-L$d" -# done -# AC_CHECKING(in more locations) -# unset ac_cv_lib_pcap -#fi - -if test "x$enable_examples" = "xyes"; then - -AC_ARG_WITH(camlidl-lib, -[ --with-camlidl-lib[=DIR] libcamlidl.a location], -[ - camlidllibdir=$withval - if ! test -f "$camlidllibdir/libcamlidl.a"; then - AC_MSG_ERROR(can't find libcamlidl.a in $camlidllibdir) - fi -], -[ - AC_MSG_ERROR(missing --with-camlidl-lib) -]) - -AC_CHECKING(for ffcall callback library) - dirs="/usr/local/lib - /usr/lib - /lib" - for d in $dirs; do - test -f "$d/libcallback.a" && ffcallarchive="$d/libcallback.a" - done +dnl Ocaml + +AC_CHECK_PROG(ocamlc,ocamlc,ocamlc,no) +if test "x$ocamlc" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlc.]) fi -AC_ARG_WITH(libpcap, -[ --with-libpcap[=DIR] libpcap.a/.so location], -[ - libpcapdir=$withval - if ! test -f "$libpcapdir/libpcap.a"; then - AC_MSG_ERROR(can't find libpcap.a in $libpcapdir) - fi - - # check for libpcap >=0.8, set CFLAGS and camlp4 flag - `which strings` "$libpcapdir/libpcap.a"|grep to_descr 2>&1 >/dev/null - test $? && CFLAGS="$CFLAGS -DHAVE_PCAP08" && cp4flag="HAVE_PCAP08" -], -[ - #AC_MSG_ERROR(missing --with-libpcap) - # try the default - libpcapdir="/usr/lib" -]) - - -AC_CHECKING(for pcap header files) - -AC_ARG_WITH(pcap-header, -[ --with-pcap-header[=DIR] pcap header installation directory], -[ - pcapheaderdir=$withval - AC_CHECK_HEADER($pcapheaderdir/pcap.h, - [ CFLAGS="$CFLAGS -I$pcapheaderdir"; HAVE_PCAP_HEADER="yes" ]) -], -[ - AC_CHECK_HEADER(pcap.h, [HAVE_PCAP_HEADER="yes"]) -]) - -if test -z "$HAVE_PCAP_HEADER"; then - AC_MSG_ERROR(can't find pcap.h) +AC_CHECK_PROG(ocamlopt,ocamlopt,ocamlopt) +if test "x$ocamlopt" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlopt.]) fi -AC_CHECKING(for camlidl header) - -AC_ARG_WITH(camlidl, -[ --with-camlidl[=DIR] camlidl installation directory], -[ - camlidldir=$withval - AC_CHECK_HEADER($camlidldir/caml/camlidlruntime.h, - [ CFLAGS="$CFLAGS -I$camlidldir"; HAVE_CAMLIDLRUNTIME_H="yes" ]) -], -[ - AC_CHECK_HEADER(caml/camlidlruntime.h, [HAVE_CAMLIDLRUNTIME_H="yes"]) -]) - -if test -z "$HAVE_CAMLIDLRUNTIME_H"; then - AC_MSG_ERROR(can't find camlidlruntime.h) +AC_CHECK_PROG(ocamlfind,ocamlfind,ocamlfind) +if test "x$ocamlfind" = "xno"; then + AC_MSG_ERROR([Cannot find ocamlfind.]) fi -AC_CHECKING(for ffcall callback header) - -AC_ARG_WITH(ffcall, -[ --with-ffcall[=DIR] ffcall installation directory], -[ - ffcalldir=$withval - AC_CHECK_HEADER($ffcalldir/callback.h, - [ CFLAGS="$CFLAGS -I$ffcalldir"; HAVE_CALLBACK_H="yes" ]) -], -[ - AC_CHECK_HEADER(callback.h,[HAVE_CALLBACK_H="yes"]) -]) - -if test -z "$HAVE_CALLBACK_H"; then - AC_MSG_ERROR(can't find callback.h) +dnl ------- +dnl Camlidl +dnl ------- + +AC_CHECK_PROG(camlidl,camlidl,camlidl) +if test "x$camlidl" = "xno"; then + AC_MSG_ERROR([Cannot find camlidl.]) fi -AC_SUBST(camlidldir) -AC_SUBST(camlidllibdir) -AC_SUBST(ffcalldir) -AC_SUBST(ffcallarchive) -AC_SUBST(libpcapdir) -AC_SUBST(cp4flag) +dnl Header + +AC_CHECK_HEADER(caml/camlidlruntime.h,, + AC_MSG_ERROR([can't find camlidlruntime.h])) + +dnl ------- +dnl Libpcap +dnl ------- -if test "x$enable_examples" = "xyes"; then - output="[Makefile tests/Makefile]" -else - output="Makefile" +dnl Version 0.8 +AC_CHECK_LIB(pcap, + pcap_datalink_val_to_description, + [AC_DEFINE(HAVE_PCAP08) + cp4flag="-DHAVE_PCAP08" + LIBS="-lpcap $LIBS"]) + +if test "x$cp4flag" = "x"; then + AC_CHECK_LIB(pcap, + pcap_open_live,, + AC_MSG_ERROR([can't find pcap library].)) fi -AC_OUTPUT($output) +AC_SUBST(cp4flag) + +dnl Header + +AC_CHECK_HEADER(pcap.h,, + AC_MSG_ERROR(can't find pcap.h)) + +dnl --------------- +dnl Ffcall callback +dnl --------------- + +AC_CHECK_LIB(callback, + alloc_trampoline_r,, + AC_MSG_ERROR([can't find callback library.])) + +dnl Header + +AC_CHECK_HEADER(callback.h) + +dnl Makefile generation + +AC_OUTPUT([Makefile tests/Makefile]) diff --git a/tests/Makefile.in b/tests/Makefile.in index ea6abce..9c3b4ab 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -12,7 +12,7 @@ pcap_open_offline all: $(TARGETS) $(TARGETS): $(OBJECTS) - $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma -I @camlidllibdir@ -ccopt -L@libpcapdir@ -cclib -lpcap @ffcallarchive@ + $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma clean: rm -f *.cmo *.cmi $(TARGETS) @@ -20,5 +20,5 @@ clean: .SUFFIXES: .ml .cmo .cmi .ml.cmo: - $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo -D@cp4flag@' -I .. -c $< + $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -I .. -c $< -- cgit v1.2.3 From 6bd6897cf4a24f539157bafb95067abeb3001a31 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 31 Dec 2021 09:06:59 +0100 Subject: configure Gbp-Pq: Name 06_configure.diff --- configure | 4928 +++++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 2825 insertions(+), 2103 deletions(-) diff --git a/configure b/configure index 4812885..bdf9387 100755 --- a/configure +++ b/configure @@ -1,9 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.57. +# Generated by GNU Autoconf 2.60a. # -# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -# Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -17,20 +17,80 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -41,21 +101,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -63,206 +124,436 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` +# CDPATH. +$as_unset CDPATH -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no fi + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +for as_dir in /usr/bin/posix$PATH_SEPARATOR/bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= @@ -274,42 +565,109 @@ ac_unique_file="pcap.idl" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS VERSION ARCH ocamlc ocamlopt ocamlfind INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA INSTALL CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP camlidldir camlidllibdir ffcalldir ffcallarchive libpcapdir cp4flag LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +VERSION +ARCH +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +INSTALL +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +ocamlc +ocamlopt +ocamlfind +camlidl +cp4flag +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -336,34 +694,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -385,12 +757,18 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. @@ -398,7 +776,17 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` @@ -407,11 +795,7 @@ do { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -438,6 +822,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -462,13 +852,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -533,6 +926,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -589,11 +992,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` @@ -602,7 +1001,7 @@ do { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -633,8 +1032,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -654,27 +1052,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -701,74 +1091,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -797,14 +1189,11 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -817,15 +1206,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -836,113 +1232,99 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-examples build example programs default=no - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-camlidl-lib=DIR libcamlidl.a location - --with-libpcap=DIR libpcap.a/.so location - --with-pcap-header=DIR pcap header installation directory - --with-camlidl=DIR camlidl installation directory - --with-ffcall=DIR ffcall installation directory - Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF +configure +generated by GNU Autoconf 2.60a -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.60a. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -961,7 +1343,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -975,6 +1357,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -996,7 +1379,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1007,7 +1389,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1015,23 +1397,21 @@ do 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. + ac_must_keep_next=false # Got value, back to normal. else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac + case $ac_arg in + *=* | --config-cache | -C | -disable-* | --disable-* \ + | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ + | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ + | -with-* | --with-* | -without-* | --without-* | --x) + case "$ac_configure_args0 " in + "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; + esac + ;; + -* ) ac_must_keep_next=true ;; + esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1042,8 +1422,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1056,20 +1436,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1080,22 +1474,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1107,26 +1507,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1157,14 +1555,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1180,8 +1581,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1193,12 +1594,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1211,20 +1611,19 @@ echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1241,12 +1640,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - @@ -1263,156 +1656,58 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for version" >&5 -echo $ECHO_N "checking for version... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for version" >&5 +echo $ECHO_N "checking for version... $ECHO_C" >&6; } VERSION="`etc/shtool version -l txt -d short VERSION`" -echo "$as_me:$LINENO: result: " >&5 -echo "${ECHO_T}" >&6 "Configuring Version $VERSION" - - - -echo "$as_me:$LINENO: checking for platform" >&5 -echo $ECHO_N "checking for platform... $ECHO_C" >&6 -ARCH="`etc/shtool guessos`" -echo "$as_me:$LINENO: result: " >&5 -echo "${ECHO_T}" >&6 "$ARCH" - -{ echo "$as_me:$LINENO: checking for ocaml compiler and tools..." >&5 -echo "$as_me: checking for ocaml compiler and tools..." >&6;} -# Extract the first word of "ocamlc", so it can be a program name with args. -set dummy ocamlc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlc"; then - ac_cv_prog_ocamlc="$ocamlc" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlc="ocamlc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ocamlc=$ac_cv_prog_ocamlc -if test -n "$ocamlc"; then - echo "$as_me:$LINENO: result: $ocamlc" >&5 -echo "${ECHO_T}$ocamlc" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -# Extract the first word of "ocamlopt", so it can be a program name with args. -set dummy ocamlopt; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlopt+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlopt"; then - ac_cv_prog_ocamlopt="$ocamlopt" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlopt="ocamlopt" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ocamlopt=$ac_cv_prog_ocamlopt -if test -n "$ocamlopt"; then - echo "$as_me:$LINENO: result: $ocamlopt" >&5 -echo "${ECHO_T}$ocamlopt" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +{ echo "$as_me:$LINENO: result: Configuring Version $VERSION" >&5 +echo "${ECHO_T}Configuring Version $VERSION" >&6; } -# Extract the first word of "ocamlfind", so it can be a program name with args. -set dummy ocamlfind; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ocamlfind+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ocamlfind"; then - ac_cv_prog_ocamlfind="$ocamlfind" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ocamlfind="ocamlfind" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - test -z "$ac_cv_prog_ocamlfind" && ac_cv_prog_ocamlfind="ocamlidl" -fi -fi -ocamlfind=$ac_cv_prog_ocamlfind -if test -n "$ocamlfind"; then - echo "$as_me:$LINENO: result: $ocamlfind" >&5 -echo "${ECHO_T}$ocamlfind" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi +{ echo "$as_me:$LINENO: checking for platform" >&5 +echo $ECHO_N "checking for platform... $ECHO_C" >&6; } +ARCH="`etc/shtool platform`" +{ echo "$as_me:$LINENO: result: $ARCH" >&5 +echo "${ECHO_T}$ARCH" >&6; } ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do + if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or @@ -1425,9 +1720,10 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1441,6 +1737,7 @@ do case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. @@ -1448,40 +1745,41 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; }; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi done done ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1493,8 +1791,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' -{ echo "$as_me:$LINENO: checking for C compiler..." >&5 -echo "$as_me: checking for C compiler..." >&6;} ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1503,8 +1799,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1517,32 +1813,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1555,36 +1853,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1597,74 +1910,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi + fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1678,7 +1951,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -1689,6 +1962,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -1706,22 +1980,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1734,36 +2009,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1776,29 +2053,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -1811,27 +2104,40 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -1851,47 +2157,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output" >&5 -echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. - ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + ;; [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; + # We found the default executable, but exeext='' is most + # certainly right. + break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext - break;; + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. + break;; * ) - break;; + break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -1903,19 +2239,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -1934,22 +2272,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 - -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } + +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -1960,10 +2303,9 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; + break;; * ) break;; esac done @@ -1976,19 +2318,18 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2004,14 +2345,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2029,17 +2376,16 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2058,14 +2404,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2074,25 +2442,28 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2108,14 +2479,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2124,239 +2517,278 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_stdc=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; + int main () { -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + ; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.$ac_objext -done -rm -f conftest.$ac_ext conftest.$ac_objext -CC=$ac_save_CC - -fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; - *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; esac - -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' \ - '#include ' -do - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -$ac_declaration + int main () { -exit (42); + ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - : + ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -continue + fi -rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_prog_cc_c89=no +ac_save_CC=$CC +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_declaration +#include +#include +#include +#include +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} + +/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has + function prototypes and stuff, but not '\xHH' hex character constants. + These don't provoke an error unfortunately, instead are silently treated + as 'x'. The following induces an error, until -std is added to get + proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an + array size at least. It's necessary to write '\x00'==0 to get something + that's true only with -std. */ +int osf4_cc_array ['\x00' == 0 ? 1 : -1]; + +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; int main () { -exit (42); +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - break + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h +rm -f conftest.$ac_ext +CC=$ac_save_CC + fi +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; + *) + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; +esac -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -fi -rm -f conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2364,16 +2796,13 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for C header files..." >&5 -echo "$as_me: checking for C header files..." >&6;} - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -2395,7 +2824,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2406,10 +2834,15 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2418,6 +2851,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2433,12 +2867,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2446,8 +2880,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2456,6 +2895,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2473,6 +2913,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2490,8 +2931,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -2502,7 +2943,6 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2513,10 +2953,15 @@ cat >>conftest.$ac_ext <<_ACEOF #else # include #endif - Syntax error + Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2525,6 +2970,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2540,12 +2986,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2553,8 +2999,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -2563,6 +3014,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -2580,6 +3032,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -2602,28 +3055,174 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_executable_p "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP +fi + + +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_executable_p "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2643,14 +3242,36 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2659,14 +3280,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2688,7 +3309,6 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2713,21 +3333,21 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif @@ -2738,19 +3358,28 @@ main () int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + || toupper (i) != TOUPPER (i)) + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2763,12 +3392,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core core.* *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + + fi fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -2778,100 +3409,181 @@ _ACEOF fi -# -camlidldir="" -camlidllibdir="" -ffcalldir="" -ffcallarchive="" -libpcapdir="" -cp4flag="" -# - -# Check whether --enable-examples or --disable-examples was given. -if test "${enable_examples+set}" = set; then - enableval="$enable_examples" +# Extract the first word of "ocamlc", so it can be a program name with args. +set dummy ocamlc; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - enable_examples="no" -fi; - -# -{ echo "$as_me:$LINENO: checking libraries..." >&5 -echo "$as_me: checking libraries..." >&6;} - -#AC_CHECKING(for pcap library) -#if test "$ac_cv_lib_pcap" == "no"; then -# #dirs="/usr/local/lib -# # /usr/local/lib -# # /usr/lib -# # /lib" -# dirs="/home/x25/code/MLpcap/libpcap-0.8.3" -# for d in $dirs; do -# test -f "$d/libpcap.a" && LDFLAGS="-L$d" -# done -# AC_CHECKING(in more locations) -# unset ac_cv_lib_pcap -#fi - -if test "x$enable_examples" = "xyes"; then - - -# Check whether --with-camlidl-lib or --without-camlidl-lib was given. -if test "${with_camlidl_lib+set}" = set; then - withval="$with_camlidl_lib" - - camlidllibdir=$withval - if ! test -f "$camlidllibdir/libcamlidl.a"; then - { { echo "$as_me:$LINENO: error: can't find libcamlidl.a in $camlidllibdir" >&5 -echo "$as_me: error: can't find libcamlidl.a in $camlidllibdir" >&2;} - { (exit 1); exit 1; }; } - fi - + if test -n "$ocamlc"; then + ac_cv_prog_ocamlc="$ocamlc" # Let the user override the test. else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlc="ocamlc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS - { { echo "$as_me:$LINENO: error: missing --with-camlidl-lib" >&5 -echo "$as_me: error: missing --with-camlidl-lib" >&2;} - { (exit 1); exit 1; }; } - -fi; - -{ echo "$as_me:$LINENO: checking for ffcall callback library..." >&5 -echo "$as_me: checking for ffcall callback library..." >&6;} - dirs="/usr/local/lib - /usr/lib - /lib" - for d in $dirs; do - test -f "$d/libcallback.a" && ffcallarchive="$d/libcallback.a" - done + test -z "$ac_cv_prog_ocamlc" && ac_cv_prog_ocamlc="no" +fi +fi +ocamlc=$ac_cv_prog_ocamlc +if test -n "$ocamlc"; then + { echo "$as_me:$LINENO: result: $ocamlc" >&5 +echo "${ECHO_T}$ocamlc" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -# Check whether --with-libpcap or --without-libpcap was given. -if test "${with_libpcap+set}" = set; then - withval="$with_libpcap" - - libpcapdir=$withval - if ! test -f "$libpcapdir/libpcap.a"; then - { { echo "$as_me:$LINENO: error: can't find libpcap.a in $libpcapdir" >&5 -echo "$as_me: error: can't find libpcap.a in $libpcapdir" >&2;} +if test "x$ocamlc" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlc." >&5 +echo "$as_me: error: Cannot find ocamlc." >&2;} { (exit 1); exit 1; }; } - fi - - # check for libpcap >=0.8, set CFLAGS and camlp4 flag - `which strings` "$libpcapdir/libpcap.a"|grep to_descr 2>&1 >/dev/null - test $? && CFLAGS="$CFLAGS -DHAVE_PCAP08" && cp4flag="HAVE_PCAP08" - -else - - #AC_MSG_ERROR(missing --with-libpcap) - # try the default - libpcapdir="/usr/lib" +fi -fi; +# Extract the first word of "ocamlopt", so it can be a program name with args. +set dummy ocamlopt; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlopt+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ocamlopt"; then + ac_cv_prog_ocamlopt="$ocamlopt" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlopt="ocamlopt" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS +fi +fi +ocamlopt=$ac_cv_prog_ocamlopt +if test -n "$ocamlopt"; then + { echo "$as_me:$LINENO: result: $ocamlopt" >&5 +echo "${ECHO_T}$ocamlopt" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$ocamlopt" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlopt." >&5 +echo "$as_me: error: Cannot find ocamlopt." >&2;} + { (exit 1); exit 1; }; } +fi + +# Extract the first word of "ocamlfind", so it can be a program name with args. +set dummy ocamlfind; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_ocamlfind+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ocamlfind"; then + ac_cv_prog_ocamlfind="$ocamlfind" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_ocamlfind="ocamlfind" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +ocamlfind=$ac_cv_prog_ocamlfind +if test -n "$ocamlfind"; then + { echo "$as_me:$LINENO: result: $ocamlfind" >&5 +echo "${ECHO_T}$ocamlfind" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$ocamlfind" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find ocamlfind." >&5 +echo "$as_me: error: Cannot find ocamlfind." >&2;} + { (exit 1); exit 1; }; } +fi + + +# Extract the first word of "camlidl", so it can be a program name with args. +set dummy camlidl; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_camlidl+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$camlidl"; then + ac_cv_prog_camlidl="$camlidl" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_camlidl="camlidl" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +camlidl=$ac_cv_prog_camlidl +if test -n "$camlidl"; then + { echo "$as_me:$LINENO: result: $camlidl" >&5 +echo "${ECHO_T}$camlidl" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + +if test "x$camlidl" = "xno"; then + { { echo "$as_me:$LINENO: error: Cannot find camlidl." >&5 +echo "$as_me: error: Cannot find camlidl." >&2;} + { (exit 1); exit 1; }; } +fi -{ echo "$as_me:$LINENO: checking for pcap header files..." >&5 -echo "$as_me: checking for pcap header files..." >&6;} # On IRIX 5.3, sys/types and inttypes.h are conflicting. @@ -2884,16 +3596,15 @@ echo "$as_me: checking for pcap header files..." >&6;} for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h + inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2904,14 +3615,36 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2920,12 +3653,14 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -2936,44 +3671,58 @@ fi done - -# Check whether --with-pcap-header or --without-pcap-header was given. -if test "${with_pcap_header+set}" = set; then - withval="$with_pcap_header" - - pcapheaderdir=$withval - as_ac_Header=`echo "ac_cv_header_$pcapheaderdir/pcap.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $pcapheaderdir/pcap.h" >&5 -echo $ECHO_N "checking for $pcapheaderdir/pcap.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then + { echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 +echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6; } +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 +echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $pcapheaderdir/pcap.h usability" >&5 -echo $ECHO_N "checking $pcapheaderdir/pcap.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking caml/camlidlruntime.h usability" >&5 +echo $ECHO_N "checking caml/camlidlruntime.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include <$pcapheaderdir/pcap.h> +#include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2982,26 +3731,31 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $pcapheaderdir/pcap.h presence" >&5 -echo $ECHO_N "checking $pcapheaderdir/pcap.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking caml/camlidlruntime.h presence" >&5 +echo $ECHO_N "checking caml/camlidlruntime.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include <$pcapheaderdir/pcap.h> +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3010,6 +3764,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3024,383 +3779,294 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $pcapheaderdir/pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: caml/camlidlruntime.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for $pcapheaderdir/pcap.h" >&5 -echo $ECHO_N "checking for $pcapheaderdir/pcap.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 +echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6; } +if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + ac_cv_header_caml_camlidlruntime_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 +echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$pcapheaderdir"; HAVE_PCAP_HEADER="yes" +if test $ac_cv_header_caml_camlidlruntime_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: can't find camlidlruntime.h" >&5 +echo "$as_me: error: can't find camlidlruntime.h" >&2;} + { (exit 1); exit 1; }; } fi -else - if test "${ac_cv_header_pcap_h+set}" = set; then - echo "$as_me:$LINENO: checking for pcap.h" >&5 -echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6 -if test "${ac_cv_header_pcap_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for pcap_datalink_val_to_description in -lpcap" >&5 +echo $ECHO_N "checking for pcap_datalink_val_to_description in -lpcap... $ECHO_C" >&6; } +if test "${ac_cv_lib_pcap_pcap_datalink_val_to_description+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 -echo "${ECHO_T}$ac_cv_header_pcap_h" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking pcap.h usability" >&5 -echo $ECHO_N "checking pcap.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcap_datalink_val_to_description (); +int +main () +{ +return pcap_datalink_val_to_description (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_header_compiler=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 - -# Is the header present? -echo "$as_me:$LINENO: checking pcap.h presence" >&5 -echo $ECHO_N "checking pcap.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes + (exit $ac_status); }; }; then + ac_cv_lib_pcap_pcap_datalink_val_to_description=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: pcap.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: pcap.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: pcap.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for pcap.h" >&5 -echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6 -if test "${ac_cv_header_pcap_h+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_header_pcap_h=$ac_header_preproc + ac_cv_lib_pcap_pcap_datalink_val_to_description=no fi -echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 -echo "${ECHO_T}$ac_cv_header_pcap_h" >&6 +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test $ac_cv_header_pcap_h = yes; then - HAVE_PCAP_HEADER="yes" -fi - - - -fi; +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcap_pcap_datalink_val_to_description" >&5 +echo "${ECHO_T}$ac_cv_lib_pcap_pcap_datalink_val_to_description" >&6; } +if test $ac_cv_lib_pcap_pcap_datalink_val_to_description = yes; then + cat >>confdefs.h <<\_ACEOF +#define HAVE_PCAP08 1 +_ACEOF -if test -z "$HAVE_PCAP_HEADER"; then - { { echo "$as_me:$LINENO: error: can't find pcap.h" >&5 -echo "$as_me: error: can't find pcap.h" >&2;} - { (exit 1); exit 1; }; } + cp4flag="-DHAVE_PCAP08" + LIBS="-lpcap $LIBS" fi -{ echo "$as_me:$LINENO: checking for camlidl header..." >&5 -echo "$as_me: checking for camlidl header..." >&6;} - -# Check whether --with-camlidl or --without-camlidl was given. -if test "${with_camlidl+set}" = set; then - withval="$with_camlidl" +if test "x$cp4flag" = "x"; then - camlidldir=$withval - as_ac_Header=`echo "ac_cv_header_$camlidldir/caml/camlidlruntime.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $camlidldir/caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for $camlidldir/caml/camlidlruntime.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for pcap_open_live in -lpcap" >&5 +echo $ECHO_N "checking for pcap_open_live in -lpcap... $ECHO_C" >&6; } +if test "${ac_cv_lib_pcap_pcap_open_live+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $camlidldir/caml/camlidlruntime.h usability" >&5 -echo $ECHO_N "checking $camlidldir/caml/camlidlruntime.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lpcap $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$camlidldir/caml/camlidlruntime.h> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char pcap_open_live (); +int +main () +{ +return pcap_open_live (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_pcap_pcap_open_live=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_cv_lib_pcap_pcap_open_live=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $camlidldir/caml/camlidlruntime.h presence" >&5 -echo $ECHO_N "checking $camlidldir/caml/camlidlruntime.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$camlidldir/caml/camlidlruntime.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_pcap_pcap_open_live" >&5 +echo "${ECHO_T}$ac_cv_lib_pcap_pcap_open_live" >&6; } +if test $ac_cv_lib_pcap_pcap_open_live = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBPCAP 1 +_ACEOF - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 + LIBS="-lpcap $LIBS" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $camlidldir/caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $camlidldir/caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for $camlidldir/caml/camlidlruntime.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" + { { echo "$as_me:$LINENO: error: can't find pcap library." >&5 +echo "$as_me: error: can't find pcap library." >&2;} + { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$camlidldir"; HAVE_CAMLIDLRUNTIME_H="yes" -fi -else - if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then - echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6 -if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then +if test "${ac_cv_header_pcap_h+set}" = set; then + { echo "$as_me:$LINENO: checking for pcap.h" >&5 +echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pcap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 -echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 +echo "${ECHO_T}$ac_cv_header_pcap_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking caml/camlidlruntime.h usability" >&5 -echo $ECHO_N "checking caml/camlidlruntime.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pcap.h usability" >&5 +echo $ECHO_N "checking pcap.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -#include +#include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3409,26 +4075,31 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking caml/camlidlruntime.h presence" >&5 -echo $ECHO_N "checking caml/camlidlruntime.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking pcap.h presence" >&5 +echo $ECHO_N "checking pcap.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include +#include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3437,6 +4108,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3451,229 +4123,164 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: pcap.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: pcap.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: caml/camlidlruntime.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: pcap.h: present but cannot be compiled" >&5 +echo "$as_me: WARNING: pcap.h: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: pcap.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: pcap.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: pcap.h: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: pcap.h: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: pcap.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: pcap.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for caml/camlidlruntime.h" >&5 -echo $ECHO_N "checking for caml/camlidlruntime.h... $ECHO_C" >&6 -if test "${ac_cv_header_caml_camlidlruntime_h+set}" = set; then +{ echo "$as_me:$LINENO: checking for pcap.h" >&5 +echo $ECHO_N "checking for pcap.h... $ECHO_C" >&6; } +if test "${ac_cv_header_pcap_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_header_caml_camlidlruntime_h=$ac_header_preproc + ac_cv_header_pcap_h=$ac_header_preproc fi -echo "$as_me:$LINENO: result: $ac_cv_header_caml_camlidlruntime_h" >&5 -echo "${ECHO_T}$ac_cv_header_caml_camlidlruntime_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_pcap_h" >&5 +echo "${ECHO_T}$ac_cv_header_pcap_h" >&6; } fi -if test $ac_cv_header_caml_camlidlruntime_h = yes; then - HAVE_CAMLIDLRUNTIME_H="yes" -fi - - - -fi; - -if test -z "$HAVE_CAMLIDLRUNTIME_H"; then - { { echo "$as_me:$LINENO: error: can't find camlidlruntime.h" >&5 -echo "$as_me: error: can't find camlidlruntime.h" >&2;} +if test $ac_cv_header_pcap_h = yes; then + : +else + { { echo "$as_me:$LINENO: error: can't find pcap.h" >&5 +echo "$as_me: error: can't find pcap.h" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking for ffcall callback header..." >&5 -echo "$as_me: checking for ffcall callback header..." >&6;} -# Check whether --with-ffcall or --without-ffcall was given. -if test "${with_ffcall+set}" = set; then - withval="$with_ffcall" - ffcalldir=$withval - as_ac_Header=`echo "ac_cv_header_$ffcalldir/callback.h" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ffcalldir/callback.h" >&5 -echo $ECHO_N "checking for $ffcalldir/callback.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then + +{ echo "$as_me:$LINENO: checking for alloc_trampoline_r in -lcallback" >&5 +echo $ECHO_N "checking for alloc_trampoline_r in -lcallback... $ECHO_C" >&6; } +if test "${ac_cv_lib_callback_alloc_trampoline_r+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else - # Is the header compilable? -echo "$as_me:$LINENO: checking $ffcalldir/callback.h usability" >&5 -echo $ECHO_N "checking $ffcalldir/callback.h usability... $ECHO_C" >&6 + ac_check_lib_save_LIBS=$LIBS +LIBS="-lcallback $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -$ac_includes_default -#include <$ffcalldir/callback.h> + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char alloc_trampoline_r (); +int +main () +{ +return alloc_trampoline_r (); + ; + return 0; +} _ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - ac_header_compiler=yes + ac_cv_lib_callback_alloc_trampoline_r=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_cv_lib_callback_alloc_trampoline_r=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 -# Is the header present? -echo "$as_me:$LINENO: checking $ffcalldir/callback.h presence" >&5 -echo $ECHO_N "checking $ffcalldir/callback.h presence... $ECHO_C" >&6 -cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ffcalldir/callback.h> -_ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS fi -if test -z "$ac_cpp_err"; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_callback_alloc_trampoline_r" >&5 +echo "${ECHO_T}$ac_cv_lib_callback_alloc_trampoline_r" >&6; } +if test $ac_cv_lib_callback_alloc_trampoline_r = yes; then + cat >>confdefs.h <<_ACEOF +#define HAVE_LIBCALLBACK 1 +_ACEOF - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 + LIBS="-lcallback $LIBS" -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ffcalldir/callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -echo "$as_me:$LINENO: checking for $ffcalldir/callback.h" >&5 -echo $ECHO_N "checking for $ffcalldir/callback.h... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 else - eval "$as_ac_Header=$ac_header_preproc" -fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - CFLAGS="$CFLAGS -I$ffcalldir"; HAVE_CALLBACK_H="yes" + { { echo "$as_me:$LINENO: error: can't find callback library." >&5 +echo "$as_me: error: can't find callback library." >&2;} + { (exit 1); exit 1; }; } fi -else - - if test "${ac_cv_header_callback_h+set}" = set; then - echo "$as_me:$LINENO: checking for callback.h" >&5 -echo $ECHO_N "checking for callback.h... $ECHO_C" >&6 +if test "${ac_cv_header_callback_h+set}" = set; then + { echo "$as_me:$LINENO: checking for callback.h" >&5 +echo $ECHO_N "checking for callback.h... $ECHO_C" >&6; } if test "${ac_cv_header_callback_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 -echo "${ECHO_T}$ac_cv_header_callback_h" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 +echo "${ECHO_T}$ac_cv_header_callback_h" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking callback.h usability" >&5 -echo $ECHO_N "checking callback.h usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking callback.h usability" >&5 +echo $ECHO_N "checking callback.h usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3683,14 +4290,36 @@ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3699,17 +4328,17 @@ else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking callback.h presence" >&5 -echo $ECHO_N "checking callback.h presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking callback.h presence" >&5 +echo $ECHO_N "checking callback.h presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF -#line $LINENO "configure" /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -3717,8 +4346,13 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 @@ -3727,6 +4361,7 @@ if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag else ac_cpp_err= fi @@ -3741,82 +4376,53 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? -case $ac_header_compiler:$ac_header_preproc in - yes:no ) +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) { echo "$as_me:$LINENO: WARNING: callback.h: accepted by the compiler, rejected by the preprocessor!" >&5 echo "$as_me: WARNING: callback.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: callback.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes ;; - no:yes ) + no:yes:* ) { echo "$as_me:$LINENO: WARNING: callback.h: present but cannot be compiled" >&5 echo "$as_me: WARNING: callback.h: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: callback.h: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: callback.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: callback.h: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: callback.h: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: callback.h: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: callback.h: section \"Present But Cannot Be Compiled\"" >&2;} { echo "$as_me:$LINENO: WARNING: callback.h: proceeding with the preprocessor's result" >&5 echo "$as_me: WARNING: callback.h: proceeding with the preprocessor's result" >&2;} - ( - cat <<\_ASBOX -## ------------------------------------ ## -## Report this to bug-autoconf@gnu.org. ## -## ------------------------------------ ## -_ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + { echo "$as_me:$LINENO: WARNING: callback.h: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: callback.h: in the future, the compiler will take precedence" >&2;} + ;; esac -echo "$as_me:$LINENO: checking for callback.h" >&5 -echo $ECHO_N "checking for callback.h... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for callback.h" >&5 +echo $ECHO_N "checking for callback.h... $ECHO_C" >&6; } if test "${ac_cv_header_callback_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_header_callback_h=$ac_header_preproc -fi -echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 -echo "${ECHO_T}$ac_cv_header_callback_h" >&6 - -fi -if test $ac_cv_header_callback_h = yes; then - HAVE_CALLBACK_H="yes" -fi - - - -fi; - -if test -z "$HAVE_CALLBACK_H"; then - { { echo "$as_me:$LINENO: error: can't find callback.h" >&5 -echo "$as_me: error: can't find callback.h" >&2;} - { (exit 1); exit 1; }; } -fi - - - +fi +{ echo "$as_me:$LINENO: result: $ac_cv_header_callback_h" >&5 +echo "${ECHO_T}$ac_cv_header_callback_h" >&6; } +fi -if test "x$enable_examples" = "xyes"; then - output="Makefile tests/Makefile" -else - output="Makefile" -fi +ac_config_files="$ac_config_files Makefile tests/Makefile" - ac_config_files="$ac_config_files $output" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -3835,39 +4441,58 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -3876,63 +4501,48 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that -# take arguments), then we branch to the quote section. Otherwise, +# take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. -cat >confdef2opt.sed <<\_ACEOF +ac_script=' t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\),-D\1=\2,g +:clear +s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\),-D\1=\2,g +s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote -d -: quote -s,[ `~#$^&*(){}\\|;'"<>?],\\&,g -s,\[,\\&,g -s,\],\\&,g -s,\$,$$,g -p -_ACEOF -# We use echo to avoid assuming a particular line-breaking character. -# The extra dot is to prevent the shell from consuming trailing -# line-breaks from the sub-command output. A line-break within -# single-quotes doesn't work because, if this script is created in a -# platform that uses two characters for line-breaks (e.g., DOS), tr -# would break. -ac_LF_and_DOT=`echo; echo .` -DEFS=`sed -n -f confdef2opt.sed confdefs.h | tr "$ac_LF_and_DOT" ' .'` -rm -f confdef2opt.sed +b any +:quote +s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g +s/\[/\\&/g +s/\]/\\&/g +s/\$/$$/g +H +:any +${ + g + s/^\n// + s/\n/ /g + p +} +' +DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -3970,20 +4580,80 @@ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + + +# PATH needs CR +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. -if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done +IFS=$as_save_IFS + + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + # Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done PS1='$ ' PS2='> ' PS4='+ ' @@ -3994,21 +4664,22 @@ for as_var in \ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ LC_TELEPHONE LC_TIME do - if (set +x; test -n "`(eval $as_var=C; export $as_var) 2>&1`"); then + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then eval $as_var=C; export $as_var else - $as_unset $as_var + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi done # Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false @@ -4016,200 +4687,157 @@ fi # Name of the executable. -as_me=`$as_basename "$0" || +as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi +# CDPATH. +$as_unset CDPATH - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else + test -d ./-p && rmdir ./-p as_mkdir_p=false fi -as_executable_p="test -f" +# Find out whether ``test -x'' works. Don't use a zero-byte file, as +# systems may use methods other than mode bits to determine executability. +cat >conf$$.file <<_ASEOF +#! /bin/sh +exit 0 +_ASEOF +chmod +x conf$$.file +if test -x conf$$.file >/dev/null 2>&1; then + as_executable_p="test -x" +else + as_executable_p=: +fi +rm -f conf$$.file # Sed expression to map a string onto a valid CPP name. -as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" +as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. -as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.57. Invocation command line was +generated by GNU Autoconf 2.60a. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -4217,30 +4845,18 @@ generated by GNU Autoconf 2.57. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -4248,31 +4864,32 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] - instantiate the configuration file FILE + instantiate the configuration file FILE Configuration files: $config_files Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.57, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.60a, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 -Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -4283,60 +4900,42 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; + --he | --h | --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -4352,28 +4951,43 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 - - - +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "$output" ) CONFIG_FILES="$CONFIG_FILES $output" ;; + case $ac_config_target in + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -4383,277 +4997,374 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@VERSION@,$VERSION,;t t -s,@ARCH@,$ARCH,;t t -s,@ocamlc@,$ocamlc,;t t -s,@ocamlopt@,$ocamlopt,;t t -s,@ocamlfind@,$ocamlfind,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@INSTALL@,$INSTALL,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@camlidldir@,$camlidldir,;t t -s,@camlidllibdir@,$camlidllibdir,;t t -s,@ffcalldir@,$ffcalldir,;t t -s,@ffcallarchive@,$ffcallarchive,;t t -s,@libpcapdir@,$libpcapdir,;t t -s,@cp4flag@,$cp4flag,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +VERSION!$VERSION$ac_delim +ARCH!$ARCH$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +INSTALL!$INSTALL$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +ocamlc!$ocamlc$ac_delim +ocamlopt!$ocamlopt$ac_delim +ocamlfind!$ocamlfind$ac_delim +camlidl!$camlidl$ac_delim +cp4flag!$cp4flag$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 60; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi -fi # test -n "$CONFIG_FILES" +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end _ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; +fi # test -n "$CONFIG_FILES" + + +for ac_tag in :F $CONFIG_FILES +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac -# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be -# absolute. -ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` -ac_abs_top_builddir=`cd "$ac_dir" && cd ${ac_top_builddir}. && pwd` -ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` -ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix + + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac +_ACEOF - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac _ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -4661,29 +5372,40 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out + +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" + case $ac_file in + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac + ;; -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + + esac + +done # for ac_tag + { (exit 0); exit 0; } _ACEOF -- cgit v1.2.3 From 7a86c30247671e9b57a187831c4f273c19e9586c Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 31 Dec 2021 09:06:59 +0100 Subject: Use ocamlfind to compile the project Gbp-Pq: Name 02_ocamlfind_for_example.diff --- tests/Makefile.in | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/Makefile.in b/tests/Makefile.in index 9c3b4ab..316060f 100644 --- a/tests/Makefile.in +++ b/tests/Makefile.in @@ -1,4 +1,3 @@ -OCAMLC=ocamlc CAMLP4O=camlp4o OBJECTS = misc.cmo pcap_next.cmo pcap_loop.cmo \ @@ -12,7 +11,7 @@ pcap_open_offline all: $(TARGETS) $(TARGETS): $(OBJECTS) - $(OCAMLC) -g -o $@ $@.cmo -I .. pcap.cma + ocamlfind ocamlc -package pcap -linkpkg -o $@ $@.cmo clean: rm -f *.cmo *.cmi $(TARGETS) @@ -20,5 +19,5 @@ clean: .SUFFIXES: .ml .cmo .cmi .ml.cmo: - $(OCAMLC) -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -I .. -c $< + ocamlfind ocamlc -package pcap -pp '$(CAMLP4O) pa_macro.cmo @cp4flag@' -c $< -- cgit v1.2.3 From bf54d9efcb0bcb91e699c4008a7c62789ca3c7ba Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 31 Dec 2021 09:06:59 +0100 Subject: Fix META file Gbp-Pq: Name 03_correct_META.diff --- META | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/META b/META index cf95b64..c787ef1 100644 --- a/META +++ b/META @@ -1,7 +1,6 @@ name="pcap" -version="0.8" +version="0.9" description="Ocaml bindings to libpcap" requires="" archive(byte) = "pcap.cma" -archive(opt) = "pcap.cmxa" -linkopts = "-cclib -lpcap -cclib -lcallback" +archive(native) = "pcap.cmxa" -- cgit v1.2.3 From 0ab25895ad9dc21700a28be5bc7ac3485499c415 Mon Sep 17 00:00:00 2001 From: Sylvain Le Gall Date: Fri, 31 Dec 2021 09:06:59 +0100 Subject: Use system's libcamlidl.a Gbp-Pq: Name 07_dll_with_camlidl.diff --- OCamlMakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/OCamlMakefile b/OCamlMakefile index 0d20314..eed3443 100644 --- a/OCamlMakefile +++ b/OCamlMakefile @@ -774,7 +774,7 @@ endif ifndef MSVC $(DLLSONAME): $(OBJ_LINK) $(CC) -shared $(CINCFLAGS) $(CLIBFLAGS) \ - -o $@ $(OBJ_LINK) $(CLIBS:%=-l%) + -o $@ $(OBJ_LINK) $(shell ocamlc -where)/libcamlidl.a $(CLIBS:%=-l%) endif $(RESULT).cma: $(REAL_IMPL_INTF) $(MAKEDLL) $(EXTRADEPS) $(RESULTDEPS) -- cgit v1.2.3 From bda999019f80367c9a772c8ee27d3b97e365c531 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= Date: Fri, 31 Dec 2021 09:06:59 +0100 Subject: Fix detection of callback library Forwarded: no Last-Update: 2017-11-09 The callback library is now embedded in libffcall, and the symbol names have changed, hence fix the configure test. Last-Update: 2017-11-09 Gbp-Pq: Name 08_ffcall.diff --- configure.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index 0ace885..ffcc4d1 100644 --- a/configure.in +++ b/configure.in @@ -77,9 +77,9 @@ dnl --------------- dnl Ffcall callback dnl --------------- -AC_CHECK_LIB(callback, - alloc_trampoline_r,, - AC_MSG_ERROR([can't find callback library.])) +AC_CHECK_LIB(ffcall, + callback_trampoline_alloc,, + AC_MSG_ERROR([can't find ffcall library.])) dnl Header -- cgit v1.2.3