conf.sh revision 7c2fbfb345896881c631598ee3852ce9ce33fb07
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin########################################################################
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# This software is part of the ast package #
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# Copyright (c) 1985-2008 AT&T Intellectual Property #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# and is licensed under the #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Common Public License, Version 1.0 #
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# by AT&T Intellectual Property #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# A copy of the License is available at #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# http://www.opensource.org/licenses/cpl1.0.txt #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# (with md5 checksum 059e8cd6165cb4c31e351f2b69388fd9) #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Information and Software Systems Research #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# AT&T Research #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Florham Park NJ #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Glenn Fowler <gsf@research.att.com> #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# David Korn <dgk@research.att.com> #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# Phong Vo <kpv@research.att.com> #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# #
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin########################################################################
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin: generate getconf and limits info
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# @(#)conf.sh (AT&T Research) 2008-01-31
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# this script generates these files from the table file in the first arg
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# the remaining args are the C compiler name and flags
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# conflim.h supplemental limits.h definitions
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# conftab.h readonly string table definitions
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# conftab.c readonly string table data
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# you may think it should be simpler
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# but you shall be confused anyway
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $-:$BASH_VERSION in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin*x*:[0123456789]*) : bash set -x is broken :; set +ex ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinLC_ALL=C
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexport LC_ALL
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincommand=conf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinshell=`eval 'x=123&&integer n=\${#x}\${x#1?}&&((n==330/(10)))&&echo ksh' 2>/dev/null`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinappend=0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindebug=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextra=0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinkeep_call='*'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinkeep_name='*'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintrace=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinverbose=0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinwhile :
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo case $1 in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -a) append=1 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -c*) keep_call=${1#-?} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -d*) debug=$1 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -l) extra=1 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -n*) keep_name=${1#-?} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -t) trace=1 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -v) verbose=1 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -*) echo "Usage: $command [-a] [-ccall-pattern] [-dN] [-l] [-nname_pattern] [-t] [-v] conf.tab" >&2; exit 2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) break ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinhead='#include "FEATURE/standards"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include "FEATURE/common"'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintail='#include "FEATURE/param"'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chingenerated="/* : : generated by $command from $1 : : */"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinhdr=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinifs=${IFS-'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinnl='
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsp=' '
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinob='{'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincb='}'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsym=[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintmp=conf.tmp
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $verbose:$debug$trace in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin1:?*) echo "$command: debug=$debug trace=$trace keep_call=$keep_call keep_name=$keep_name" >&2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $trace in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin1) PS4='+$LINENO+ '; set -x ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $# in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin0) case $extra in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 0) echo "$command: table argument expected" >&2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin exit 1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin tab=/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin*) tab=$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if test ! -f $tab
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then echo "$command: $tab: cannot read" >&2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin exit 1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $# in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin0) cc=cc ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin*) cc=$* ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinrm -f $tmp.*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin'') trap "code=\$?; rm -f $tmp.*; exit \$code" 0 1 2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# determine the intmax_t printf format
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincat > $tmp.c <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${head}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinint
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmain()
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#if _ast_intmax_long
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return 1;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#else
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return 0;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinif $cc -o $tmp.exe $tmp.c >/dev/null 2>&1 && ./$tmp.exe
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinthen LL_format='ll'
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinelse LL_format='l'
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinfi
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin# determine the intmax_t constant suffix
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chincat > $tmp.c <<!
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin${head}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinint
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinmain()
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin{
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin#if _ast_intmax_long
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin return 1;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin#else
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin _ast_intmax_t s = 0x7fffffffffffffffLL;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin unsigned _ast_intmax_t u = 0xffffffffffffffffLL;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin return 0;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin#endif
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin!
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinif $cc -o $tmp.exe $tmp.c >/dev/null 2>&1
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinthen if ./$tmp.exe
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin then LL_suffix='LL'
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin else LL_suffix='L'
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin fi
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinelse LL_suffix=''
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# set up the names and keys
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinkeys=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstandards=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $append$extra in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin00) case $verbose in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) echo "$command: read $tab" >&2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin exec < $tab
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while :
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do IFS=""
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin read line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eof=$?
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin IFS=$ifs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $eof in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 0) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) break ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $line in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ""|\#*) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) set x $line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift; name=$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift; standard=$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift; call=$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift; section=$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift; flags=$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin alternates=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin define=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin values=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin script=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin headers=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while :
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $# in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 0) break ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $1 in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ":") shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval script='$'script_$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *"{") case $1 in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "sh{") script="# $name" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) script= ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin args="$*"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin IFS=""
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while read line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $line in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "}") break ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin script=$script$nl$line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin IFS=$ifs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *.h) case $shell in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ksh) f=${1%.h} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) f=`echo $1 | sed 's,\.h$,,'` ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case " $hdr " in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *" $f "*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin headers=$headers$nl#include$sp'<'$1'>'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *" -$f- "*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *) if iffe -n - hdr $f | grep _hdr_$f >/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then hdr="$hdr $f"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin headers=$headers$nl#include$sp'<'$1'>'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin else hdr="$hdr -$f-"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) values=$values$sp$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $1 in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $sym) echo "$1" >> $tmp.v ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case " $standards " in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *" $standard "*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) standards="$standards $standard"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name:$flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *:*S*) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin VERSION)flags="${flags}S" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *VERSION*)key=${standard}${section} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) key= ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $key in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ''|*_) key=${key}${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) key=${key}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval sys='$'CONF_call_${key}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $sys in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) call=$sys ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SI) sys=CS ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) sys=$call ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin key=${sys}_${key}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin keys="$keys$nl$key"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_name_${key}='$'name
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_standard_${key}='$'standard
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_call_${key}='$'call
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_section_${key}='$'section
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_flags_${key}='$'flags
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_define_${key}='$'define
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_values_${key}='$'values
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_script_${key}='$'script
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_args_${key}='$'args
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_headers_${key}='$'headers
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_keys_${name}=\"'$'CONF_keys_${name} '$'key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin-d1) for key in $keys
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do eval name=\"'$'CONF_name_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) eval standard=\"'$'CONF_standard_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval call=\"'$'CONF_call_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval section=\"'$'CONF_section_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval flags=\"'$'CONF_flags_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval define=\"'$'CONF_define_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval values=\"'$'CONF_values_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval script=\"'$'CONF_script_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval args=\"'$'CONF_args_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval headers=\"'$'CONF_headers_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin printf "%29s %35s %8s %2s %1d %5s %s$nl" "$name" "$key" "$standard" "$call" "$section" "$flags" "$define${values:+$sp=$values}${headers:+$sp$headers$nl}${script:+$sp$ob$script$nl$cb}"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin exit
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsysteminfo='
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#if !defined(SYS_NMLEN)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define SYS_NMLEN 9
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <sys/systeminfo.h>'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinecho "$systeminfo" > $tmp.c
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin$cc -E $tmp.c >/dev/null 2>&1 || systeminfo=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# check for native getconf(1)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinCONF_getconf=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinCONF_getconf_a=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfor d in /usr/bin /bin /usr/sbin /sbin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo if test -x $d/getconf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then case `$d/getconf --?-version 2>&1` in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *"AT&T"*"Research"*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin : presumably an implementation also configured from conf.tab
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) CONF_getconf=$d/getconf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if $CONF_getconf -a >/dev/null 2>&1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then CONF_getconf_a=-a
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexport CONF_getconf CONF_getconf_a
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $verbose in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin1) echo "$command: check ${CONF_getconf:+$CONF_getconf(1),}confstr(2),pathconf(2),sysconf(2),sysinfo(2) configuration names" >&2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo "#include <unistd.h>$systeminfo
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinint i = 0;" > $tmp.c
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $cc -E $tmp.c
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin} |
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsed \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -e '/^#[^0123456789]*1[ ]*".*".*/!d' \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -e 's/^#[^0123456789]*1[ ]*"\(.*\)".*/\1/' |
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsort -u > $tmp.f
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsed \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -e 's/[^ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]/ /g' \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin -e 's/[ ][ ]*/\n/g' \
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin `cat $tmp.f` 2>/dev/null |
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin egrep '^(SI|_(CS|PC|SC|SI))_.'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $CONF_getconf_a in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) $CONF_getconf $CONF_getconf_a | sed 's,[=: ].*,,'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) case $CONF_getconf in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) for v in `strings $CONF_getconf | grep '^[ABCDEFGHIJKLMNOPQRSTUVWXYZ_][ABCDEFGHIJKLMNOPQRSTUVWXYZ_0123456789]*$'`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do if $CONF_getconf $v >/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then echo $v
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac 2>/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin} |
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinegrep -v '^_[ABCDEFGHIJKLMNOPQRSTUVWXYZ]+_(COUNT|LAST|N|STR)$' |
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsort -u > $tmp.g
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin grep '^_' $tmp.g
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin grep '^[^_]' $tmp.g
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin} > $tmp.t
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmv $tmp.t $tmp.g
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin-d2) exit ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinHOST=`package | sed -e 's,[0123456789.].*,,' | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $HOST in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin'') HOST=SYSTEM ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexec < $tmp.g
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinwhile read line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo flags=F
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin section=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin underscore=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin define=$line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin IFS=_
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin set $line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin IFS=$ifs
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $1 in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') case $# in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 0) continue ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $1 in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CS|PC|SC|SI)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin call=$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin standard=$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) flags=${flags}R
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin standard=$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while :
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $# in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 0) continue 2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $1 in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CS|PC|SC|SI)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin call=$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin O|o|OLD|old)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin continue 2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin standard=${standard}_$1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $1 in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SET) continue ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $standard in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin _*) standard=`echo $standard | sed 's,^_*,,'` ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case " $standards " in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *" $standard "*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) case $standard in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin [0123456789]*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin section=$standard
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin standard=POSIX
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *[0123456789])
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval `echo $standard | sed 's,\(.*\)\([0123456789]*\),standard=\1 section=\2,'`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *R*) case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SI) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) underscore=U ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) case " $standards " in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin " C ") shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *" $standard "*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SI) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) flags=${flags}P
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin underscore=U
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) standard=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $standard in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') standard=$HOST
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SI) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) underscore=U ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CS|PC|SC)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $define in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin _${call}_*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin standard=POSIX
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin part=$section
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $section in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') section=1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $standard in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin POSIX|XOPEN) part=$section ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin name=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while :
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $# in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 0) break ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') name=$1 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) name=${name}_$1 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin shift
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CONFORMANCE|FS_3D|HOSTTYPE|LIBPATH|LIBPREFIX|LIBSUFFIX|PATH_ATTRIBUTES|PATH_RESOLVE|UNIVERSE)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) values=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin script=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin args=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin headers=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin V[123456789]_*|V[123456789][0123456789]_*) underscore=VW ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CS|SI) key=CS ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) key=$call ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *VERSION*)key=${key}_${standard}${part} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin key=${key}_${name}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval x='$'CONF_keys_$name
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') eval x='$'CONF_name_$key
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SI) flags=O$flags ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $underscore in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) flags=${flags}${underscore} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin old=QQ
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *VERSION*)old=${old}_${standard}${part} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin old=${old}_${name}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval x='$'CONF_name_$old
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) eval CONF_name_$old=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval flags='$'flags'$'CONF_flags_$old
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval values='$'CONF_values_$old
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval script='$'CONF_script_$old
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval args='$'CONF_args_$old
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval headers='$'CONF_headers_$old
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin keys="$keys$nl$key"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_name_${key}='$'name
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_standard_${key}='$'standard
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_call_${key}='$'call
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_section_${key}='$'section
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_flags_${key}=d'$'flags
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_define_${key}='$'define
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_values_${key}='$'values
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_script_${key}='$'script
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_args_${key}='$'args
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_headers_${key}='$'headers
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval x='$'CONF_define_$key
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CS) eval x='$'CONF_call_$key
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SI) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) define= ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) define=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $define in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) eval CONF_define_${key}='$'define
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_call_${key}='$'call
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval x='$'CONF_call_${key}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin QQ) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *R*) flags=R ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) flags= ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SI) flags=O$flags ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_flags_${key}=d'$'flags'$'CONF_flags_${key}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin old=QQ
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *VERSION*)old=${old}_${standard}${part} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin old=${old}_${name}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_name_$old=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) for key in $x
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do eval x='$'CONF_call_${key}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin XX) eval CONF_call_${key}=QQ
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_flags_${key}=S'$'CONF_flags_${key}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# sort keys by name
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinkeys=`for key in $keys
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo eval echo '$'CONF_name_$key '$'key
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone | sort -u | sed 's,.* ,,'`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin-d3) for key in $keys
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do eval name=\"'$'CONF_name_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) eval standard=\"'$'CONF_standard_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval call=\"'$'CONF_call_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval section=\"'$'CONF_section_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval flags=\"'$'CONF_flags_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval define=\"'$'CONF_define_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval values=\"'$'CONF_values_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval script=\"'$'CONF_script_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval headers=\"'$'CONF_headers_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin printf "%29s %35s %8s %2s %1d %5s %s$nl" "$name" "$key" "$standard" "$call" "$section" "$flags" "$define${values:+$sp=$values}${headers:+$sp$headers$nl}${script:+$sp$ob$script$nl$cb}"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin exit
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# mark the dups CONF_PREFIXED
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprev_key=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprev_name=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfor key in $keys
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo eval name=\"'$'CONF_name_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') continue
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $prev_name)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval p='$'CONF_flags_${prev_key}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval c='$'CONF_flags_${key}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $p:$c in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *L*:*L*);;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *L*:*) c=L${c} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *:*L*) p=L${p} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) p=P$p c=P$c ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_flags_${prev_key}=$p
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval CONF_flags_${key}=$c
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin prev_name=$name
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin prev_key=$key
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# collect all the macros/enums
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfor key in $keys
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo eval name=\"'$'CONF_name_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') continue ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $keep_name) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) continue ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval call=\"'$'CONF_call_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $keep_call) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) continue ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval standard=\"'$'CONF_standard_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval section=\"'$'CONF_section_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval flags=\"'$'CONF_flags_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval define=\"'$'CONF_define_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval values=\"'$'CONF_values_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval script=\"'$'CONF_script_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval args=\"'$'CONF_args_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval headers=\"'$'CONF_headers_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_name=$name
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin QQ) call=XX
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for c in SC PC CS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *S*) case $section in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) eval x='$'CONF_call_${c}_${standard}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval x='$'CONF_call_${c}_${standard}${section}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval x='$'CONF_call_${c}_${name}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) call=$x
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin XX) for c in SC PC CS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do echo "_${c}_${name}"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *S*) case $section in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) echo "_${c}_${standard}_${name}" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) echo "_${c}_${standard}${section}_${name}" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CS|PC|SC|SI|XX)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) echo "$command: $name: $call: invalid call" >&2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin exit 1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *[ABEGHIJQTYZabcefghijklmnopqrstuvwxyz_123456789]*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo "$command: $name: $flags: invalid flag(s)" >&2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin exit 1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $section in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin [01]) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *N*) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) name=${section}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin standard=${standard}${section}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin XX) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *d*) conf_op=${define} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *O*) conf_op=${call}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *R*) conf_op=_${standard}_${call}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *S*) conf_op=_${call}_${standard}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) conf_op=_${call}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo "${conf_op}"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $standard:$flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin C:*) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *:*L*) echo "${conf_name}"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo "_${standard}_${conf_name}"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *:*M*) case $section in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) echo "_${standard}_${conf_name}" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) echo "_${standard}${section}_${conf_name}" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone > $tmp.q
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsort -u < $tmp.q > $tmp.t
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmv $tmp.t $tmp.q
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsort -u < $tmp.v > $tmp.t
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmv $tmp.t $tmp.v
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin-d4) exit ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# test all the macros in a few batches (some compilers have an error limit)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindefined() # list-file
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin : > $tmp.p
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin while :
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin cat <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${head}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <sys/types.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <limits.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <unistd.h>$systeminfo$headers
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${tail}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#undef conf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinunsigned int conf[] = {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin sed 's/$/,/' $1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo "};"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin } > $tmp.c
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin [ -f $tmp.1.c ] || cp $tmp.c $tmp.1.c
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if $cc -c $tmp.c > $tmp.e 2>&1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin [ -f $tmp.1.e ] || cp $tmp.e $tmp.1.e
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin snl='\
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin'
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin sed "s/[^_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789][^_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789]*/${snl}/g" $tmp.e |
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin grep '^[_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz][_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789]*$' |
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin sort -u > $tmp.n
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin cmp -s $tmp.n $tmp.p && break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fgrep -x -v -f $tmp.n $1 > $tmp.y
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin mv $tmp.y $1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin mv $tmp.n $tmp.p
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin {
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin cat <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${head}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <sys/types.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <limits.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <unistd.h>$systeminfo$headers
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${tail}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#undef conf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin sed 's/.*/conf "&" = &/' $1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin } > $tmp.c
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $cc -E $tmp.c 2>/dev/null |
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin sed -e '/conf[ ]*".*"[ ]*=[ ]*/!d' -e '/[_ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789][ ]*(/!d' -e 's/.*"\(.*\)".*/\1/' > $tmp.n
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if test -s $tmp.n
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then fgrep -x -v -f $tmp.n $1 > $tmp.y
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin mv $tmp.y $1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $verbose in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin1) echo "$command: check macros/enums as static initializers" >&2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindefined $tmp.q
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindefined $tmp.v
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin-d5) exit ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# mark the constant macros/enums
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexec < $tmp.q
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinwhile read line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo eval CONF_const_${line}=1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexec < $tmp.v
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinwhile read line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo eval CONF_const_${line}=1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# mark the string literal values
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin cat <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${head}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <sys/types.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <limits.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <unistd.h>$systeminfo$headers
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${tail}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#undef conf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin sed 's/.*/conf "&" = &/' $tmp.q
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin} > $tmp.c
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin$cc -E $tmp.c 2>/dev/null |
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinsed -e '/conf[ ]*".*"[ ]*=[ ]*"/!d' -e 's/.*"\([^"]*\)".*/\1/' > $tmp.e
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexec < $tmp.e
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinwhile read line
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo eval CONF_string_${line}=1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# walk through the table
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $shell in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinksh) integer len name_max ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinname_max=1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexport tmp name standard call cc
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinexec > $tmp.t
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfor key in $keys
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo eval name=\"'$'CONF_name_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') continue ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $keep_name) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) continue ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval call=\"'$'CONF_call_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $keep_call) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) continue ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval standard=\"'$'CONF_standard_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval section=\"'$'CONF_section_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval flags=\"'$'CONF_flags_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval define=\"'$'CONF_define_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval values=\"'$'CONF_values_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval script=\"'$'CONF_script_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval args=\"'$'CONF_args_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin eval headers=\"'$'CONF_headers_$key\"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_name=$name
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin QQ) call=XX
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for c in SC PC CS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *S*) case $section in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) eval x='$'CONF_call_${c}_${standard}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval x='$'CONF_call_${c}_${standard}${section}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval x='$'CONF_call_${c}_${name}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) call=$x
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin XX) for c in SC PC CS
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *S*) case $section in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) eval x='$'CONF_const__${c}_${standard}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval x='$'CONF_const__${c}_${standard}${section}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval x='$'CONF_const__${c}_${name}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) call=$c
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin XX) case $standard in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin C) standard=POSIX ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *L*) flags=lFU ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) flags=FU ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case " $standards " in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *" $standard "*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) standards="$standards $standard"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_standard=CONF_${standard}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CS) conf_call=CONF_confstr
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin PC) conf_call=CONF_pathconf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SC) conf_call=CONF_sysconf
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SI) conf_call=CONF_sysinfo
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin XX) conf_call=CONF_nop
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_op=-1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for s in _${call}_${standard}${section}_${name} _${call}_${standard}_${name} _${call}_${section}_${name} _${call}_${name} ${call}_${name}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do eval x='$'CONF_const_${s}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) conf_op=${s}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_section=$section
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_flags=0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *C*) conf_flags="${conf_flags}|CONF_DEFER_CALL" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *D*) conf_flags="${conf_flags}|CONF_DEFER_MM" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *F*) conf_flags="${conf_flags}|CONF_FEATURE" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *L*) conf_flags="${conf_flags}|CONF_LIMIT" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *M*) conf_flags="${conf_flags}|CONF_MINMAX" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *N*) conf_flags="${conf_flags}|CONF_NOSECTION" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *P*) conf_flags="${conf_flags}|CONF_PREFIXED" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *S*) conf_flags="${conf_flags}|CONF_STANDARD" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *U*) conf_flags="${conf_flags}|CONF_UNDERSCORE" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *V*) conf_flags="${conf_flags}|CONF_NOUNDERSCORE" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *W*) conf_flags="${conf_flags}|CONF_PREFIX_ONLY" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) case $standard in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ????) sep=" " ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ???) sep=" " ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ??) sep=" " ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?) sep=" " ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) sep="" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo "$command: test: $sep$standard $call $name" >&2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin CS|SI) conf_flags="${conf_flags}|CONF_STRING"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin string=1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval string='$'CONF_string_${key}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_limit=0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *[Ll]*) d=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case ${conf_name} in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin LONG_MAX|SSIZE_MAX)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin x=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval x='$'CONF_const_${conf_name}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') for s in ${values}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $s in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $sym) eval x='$'CONF_const_${s}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) eval a='$'CONF_const_${standard}_${s}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $a in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $x) x= ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) x=$s ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin [0123456789]*|[-+][0123456789]*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin d=$s
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case ${x:+1}:$flags:$conf_op in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin :*:-1|:*X*:*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $verbose in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) echo "$command: probe for ${conf_name} <limits.h> value" >&2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin x=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $CONF_getconf in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) if $CONF_getconf $conf_name > $tmp.x 2>/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then x=`cat $tmp.x`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin undefined) x= ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case ${x:+1} in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') case $script in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '#'*) echo "$script" > $tmp.sh
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin chmod +x $tmp.sh
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin x=`./$tmp.sh 2>/dev/null`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') case $conf_name in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin SIZE_*|U*|*_MAX)
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin f="%${LL_format}u"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin t="unsigned _ast_intmax_t"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *) f="%${LL_format}d"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin t="_ast_intmax_t"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin cat > $tmp.c <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${head}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <stdio.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <sys/types.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <limits.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <unistd.h>$systeminfo$headers
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${tail}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinint
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinmain()
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin printf("$f\n", ($t)$conf_name);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin return 0;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) cat > $tmp.c <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${head}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <sys/types.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <limits.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <unistd.h>$systeminfo$headers
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${tail}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${script}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $args in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') set "" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval set '""' '"'$args'"'; shift ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for a
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $script in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '#'*) ./$tmp.sh $a > $tmp.x 2>/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin x=$?
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) $cc $a -o $tmp.exe $tmp.c >/dev/null 2>&1 && ./$tmp.exe > $tmp.x 2>/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin x=$?
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 0) x=`cat $tmp.x`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "-") x=$a ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) x=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') x=$d ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case ${x:+1}:$flags:$conf_op in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1:*:-1|1:*X*:*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_limit=$x
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *L*) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) conf_flags="${conf_flags}|CONF_LIMIT" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_flags="${conf_flags}|CONF_LIMIT_DEF"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $string:$x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1:*) cat >> $tmp.l <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#ifndef ${conf_name}\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#define ${conf_name} \"${x}\"\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#endif\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *:U*) cat >> $tmp.l <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#ifndef ${conf_name}\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#ifndef ${x}\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#define ${x} %lu\n", ${x});
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#endif\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#define ${conf_name} ${x}\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#endif\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *:$sym) cat >> $tmp.l <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#ifndef ${conf_name}\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#ifndef ${x}\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#define ${x} %ld\n", ${x});
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#endif\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#define ${conf_name} ${x}\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#endif\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) cat >> $tmp.l <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#ifndef ${conf_name}\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#define ${conf_name} ${x}\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinprintf("#endif\n");
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $section in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin [01]) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *N*) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) name=${section}_${name} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin standard=${standard}${section}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_minmax=0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $call:$standard:$flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *:C:*M*)for s in _${standard}_${conf_name} ${values}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $s in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $sym) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) conf_minmax=$s
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_flags="${conf_flags}|CONF_MINMAX_DEF"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *:C:*) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin [CPSX][CSX]:*:*[FM]*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin x=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for s in _${standard}_${conf_name} ${values}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $s in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin $sym) eval x='$'CONF_const_${s} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) x=1 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) conf_minmax=$s
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *M*) conf_flags="${conf_flags}|CONF_MINMAX_DEF" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case ${x:+1}:${script:+1} in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin :1) case $verbose in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) echo "$command: probe for _${standard}_${conf_name} minmax value" >&2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $CONF_getconf in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) if $CONF_getconf _${standard}_${conf_name} > $tmp.x 2>/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then x=`cat $tmp.x`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin undefined) x= ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') case $script in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '#'*) echo "$script" > $tmp.sh
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin chmod +x $tmp.sh
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin x=`./$tmp.sh 2>/dev/null`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) cat > $tmp.c <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${head}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <sys/types.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <limits.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <unistd.h>$systeminfo$headers
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${tail}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${script}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $args in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '') set "" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) eval set '""' "$args"; shift ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin for a
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin do case $script in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin '#'*) ./$tmp.sh $a > $tmp.x 2>/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin x=$?
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) $cc $a -o $tmp.exe $tmp.c >/dev/null 2>&1 && ./$tmp.exe > $tmp.x 2>/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin x=$?
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 0) x=`cat $tmp.x`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "-") x=$a ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin break
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) x=
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin done
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $x in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) conf_minmax=$x
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $flags in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *M*) conf_flags="${conf_flags}|CONF_MINMAX_DEF" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $string in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 1) conf_limit="{ 0, $conf_limit }" conf_minmax="{ 0, $conf_minmax }"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) case $conf_limit in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 0[xX]*|-*|+*|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *[!0123456789abcdefABCDEF]*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_limit=0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *[!0123456789]*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_limit=0x$conf_limit
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $conf_minmax in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin 0[xX]*|-*|+*|[ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz_]*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *[!0123456789abcdefABCDEF]*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_minmax=0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *[!0123456789]*)
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_minmax=0x$conf_minmax
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin case $conf_limit in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ?*[-+]*|*['()']*)
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *[lLuU])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin case $LL_suffix in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ??) case $conf_limit in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *[!lL][lL]|*[!lL][lL][uU])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin conf_limit=${conf_limit}L
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin -*[2468])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin case $shell in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ksh) p=${conf_limit%?}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin s=${conf_limit#$p}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ((s=s-1))
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *) eval `echo '' $conf_limit | sed 's/ *\(.*\)\(.\) */p=\1 s=\2/'`
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin s=`expr $s - 1`
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin conf_limit=${p}${s}${LL_suffix}-1${LL_suffix}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin 0[xX]*[abcdefABCDEF])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin conf_limit=${conf_limit}${LL_suffix}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin -*[0123456789])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin conf_limit=${conf_limit}${LL_suffix}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *[0123456789])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin conf_limit=${conf_limit}U${LL_suffix}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin case $conf_minmax in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ?*[-+]*|*['()']*)
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *[lLuU])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin case $LL_suffix in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ??) case $conf_minmax in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *[!lL][lL]|*[!lL][lL][uU])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin conf_minmax=${conf_minmax}L
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin -*[2468])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin case $shell in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ksh) p=${conf_minmax%?}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin s=${conf_minmax#$p}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ((s=s-1))
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *) eval `echo '' $conf_minmax | sed 's/ *\(.*\)\(.\) */p=\1 s=\2/'`
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin s=`expr $s - 1`
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin conf_minmax=${p}${s}${LL_suffix}-1${LL_suffix}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin 0[xX]*[abcdefABCDEF])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin conf_minmax=${conf_minmax}${LL_suffix}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin -*[0123456789])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin conf_minmax=${conf_minmax}${LL_suffix}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *[0123456789])
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin conf_minmax=${conf_minmax}U${LL_suffix}
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin conf_limit="{ $conf_limit, 0 }" conf_minmax="{ $conf_minmax, 0 }"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin case $conf_flags in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin '0|'*) case $shell in
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ksh) conf_flags=${conf_flags#0?} ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin *) conf_flags=`echo "$conf_flags" | sed 's/^0.//'` ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin ;;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo "{ \"$conf_name\", $conf_limit, $conf_minmax, $conf_flags, $conf_standard, $conf_section, $conf_call, $conf_op },"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $shell in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ksh) len=${#conf_name}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if ((len>=name_max))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then ((name_max=len+1))
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) len=`echo ${conf_name} | wc -c`
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin if expr \( $len - 1 \) \>= ${name_max} >/dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin then name_max=$len
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin fi
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chindone
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chinexec > /dev/null
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin-d6) exit ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# conf string table
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinbase=conftab
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $verbose in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin1) echo "$command: generate ${base}.h string table header" >&2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $shell in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinksh) ((name_max=name_max+3)); ((name_max=name_max/4*4)) ;; # bsd /bin/sh !
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin*) name_max=`expr \( $name_max + 3 \) / 4 \* 4` ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincat <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#ifndef _CONFTAB_H
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define _CONFTAB_H
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin$systeminfo
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${generated}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin#if !defined(const) && !defined(__STDC__) && !defined(__cplusplus) && !defined(c_plusplus)
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin#define const
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin#endif
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define conf _ast_conf_data
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define conf_elements _ast_conf_ndata
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define prefix _ast_conf_prefix
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define prefix_elements _ast_conf_nprefix
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_nop 0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_confstr 1
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_pathconf 2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_sysconf 3
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_sysinfo 4
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinindex=0
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfor standard in $standards
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo echo "#define CONF_${standard} ${index}"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $shell in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ksh) ((index=index+1)) ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) index=`expr ${index} + 1` ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinecho "#define CONF_call ${index}"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $CONF_getconf in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin?*) echo
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo "#define _pth_getconf \"$CONF_getconf\""
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin case $CONF_getconf_a in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ?*) echo "#define _pth_getconf_a \"$CONF_getconf_a\"" ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincat <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_DEFER_CALL 0x0001
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_DEFER_MM 0x0002
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_FEATURE 0x0004
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_LIMIT 0x0008
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_LIMIT_DEF 0x0010
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_MINMAX 0x0020
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_MINMAX_DEF 0x0040
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_NOSECTION 0x0080
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_NOUNDERSCORE 0x0100
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_PREFIX_ONLY 0x0200
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_PREFIXED 0x0400
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_STANDARD 0x0800
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_STRING 0x1000
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_UNDERSCORE 0x2000
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#define CONF_USER 0x4000
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstruct Conf_s; typedef struct Conf_s Conf_t;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintypedef struct Value_s
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin intmax_t number;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin const char* string;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin} Value_t;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinstruct Conf_s
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin const char name[${name_max}];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Value_t limit;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin Value_t minmax;
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin unsigned int flags;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin short standard;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin short section;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin short call;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin short op;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin};
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintypedef struct Prefix_s
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin const char name[16];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin short length;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin short standard;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin short call;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin} Prefix_t;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const Conf_t conf[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int conf_elements;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern const Prefix_t prefix[];
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinextern int prefix_elements;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#endif
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin} > $tmp.2
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin-d7) echo $command: $tmp.2 ${base}.h ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin*) cmp -s $tmp.2 ${base}.h 2>/dev/null || mv $tmp.2 ${base}.h ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $verbose in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin1) echo "$command: generate ${base}.c string table" >&2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincat <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${head}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <sys/types.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <limits.h>
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include <unistd.h>$systeminfo$headers
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${tail}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin#include "${base}.h"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${generated}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * prefix strings -- the first few are indexed by Conf_t.standard
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinconst Prefix_t prefix[] =
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinfor standard in $standards
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindo case $shell in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin ksh) len=${#standard} ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin *) len=`echo ${standard} | wc -c`; len=`expr $len - 1` ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin esac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin echo " \"${standard}\", ${len}, CONF_${standard}, -1,"
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chindone
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincat <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "XX", 2, CONF_POSIX, CONF_nop,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "CS", 2, CONF_POSIX, CONF_confstr,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "PC", 2, CONF_POSIX, CONF_pathconf,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "SC", 2, CONF_POSIX, CONF_sysconf,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin "SI", 2, CONF_SVID, CONF_sysinfo,
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin};
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinint prefix_elements = (int)sizeof(prefix) / (int)sizeof(prefix[0]);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * conf strings sorted in ascending order
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinconst Conf_t conf[] =
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincat $tmp.t
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincat <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin};
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinint conf_elements = (int)sizeof(conf) / (int)sizeof(conf[0]);
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
7c2fbfb345896881c631598ee3852ce9ce33fb07April Chin} > $tmp.4
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin-d7) echo $command: $tmp.4 ${base}.c ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin*) cmp -s $tmp.4 ${base}.c 2>/dev/null || mv $tmp.4 ${base}.c ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin# limits.h generation code
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinbase=conflim
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $verbose in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin1) echo "$command: generate ${base}.h supplemental <limits.h> values" >&2 ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin{
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincat <<!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin${generated}
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin/*
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin * supplemental <limits.h> values
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin */
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin!
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chintest -f $tmp.l && cat $tmp.l
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin} > $tmp.5
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chincase $debug in
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin-d7) echo $command: $tmp.5 ${base}.h ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chin*) cmp -s $tmp.5 ${base}.h 2>/dev/null || mv $tmp.5 ${base}.h ;;
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinesac
da2e3ebdc1edfbc5028edf1354e7dd2fa69a7968chinexit 0