########################################################################
# #
# This software is part of the ast package #
# Copyright (c) 1984-2011 AT&T Intellectual Property #
# and is licensed under the #
# Eclipse Public License, Version 1.0 #
# by AT&T Intellectual Property #
# #
# A copy of the License is available at #
# (with md5 checksum b35adb5213ca9657e911e9befb180842) #
# #
# Information and Software Systems Research #
# AT&T Research #
# Florham Park NJ #
# #
# Glenn Fowler <gsf@research.att.com> #
# #
########################################################################
# preprocess with pp-command then run cc-command
#
# @(#)ppcc (AT&T Research) 1997-02-14
case $-:$BASH_VERSION in
*) old= ;;
esac
command=ppcc
doti=
exec=1
multiopt=o
post=
ppld=
src1="*.[cCsS]"
src2="*.[cC][xX][xX]"
src3="*.[cC][pP][pP]"
src4="*.[aA][sS][mM]"
while :
do case $# in
0) break ;;
esac
case $1 in
-o*) # these are CC.DIALECT values from $(probe C make ...)
case $1 in
-o) case $# in
exit 2
;;
esac
shift
opt=$1
;;
esac
;;
esac
esac
;;
;;
esac
;;
*) value=1
;;
esac
;;
esac
C++|c++)
;;
;;
;;
"") multiopt=
;;
;;
esac
;;
;;
exec) exec=$value
;;
;;
;;
esac
;;
-*) case $1 in
-*[!iklnvO]*)
echo "$usage" >&2
exit 2
;;
esac
case $1 in
*i*) doti=1 ;;
esac
case $1 in
esac
case $1 in
*l*) ppld=1 ;;
esac
case $1 in
*n*) exec= ;;
esac
case $1 in
*v*) verbose=1 ;;
esac
case $1 in
*O*) old=1 ;;
esac
;;
*) break
;;
esac
shift
done
case $# in
exit 2
;;
esac
trap ' status=$?
trap "" 0
case $clobber in
?*) case $verbose in
1) echo + rm -rf $clobber ;;
esac
case $exec in
1) rm -rf $clobber ;;
esac
;;
esac
case $post in
?*) case $verbose in
1) echo + $post ;;
esac
case $exec in
1) eval "$post" ;;
esac
;;
esac
exit $status
' 0 1 2 3 15
ok2) ;;
*) old=1 ;;
esac
;;
esac
*:$RANDOM|1:*)
# the hard way -- it has not kept up with the easy way below
set '' "$@" '' "$1"
while :
do shift
shift
case $1 in
[-+]*) ;;
*) break ;;
esac
set '' "$@" "$1"
done
while :
do arg=$1
shift
'') break
;;
-[$multiopt])
case $1 in
?*) set '' "$@" "$arg"
shift
arg=$1
shift
;;
esac
;;
-E) ppstdout=1
doti=1
trap 0 1 2 3 15
;;
-P) ppfile=1
doti=1
trap 0 1 2 3 15
;;
[-+]*) ;;
esac
esac
;;
esac
;;
;;
esac
;;
esac
;;
esac
set '' "$@" "$arg"
shift
done
# sub-shell to split pp and cc arg lists
(
set '' "$@" '' "$1"
while :
do shift
shift
case $1 in
[-+]*) ;;
*) shift
break
;;
esac
set '' "$@" "$1"
done
"") set '' "$@" -D-L
shift
;;
esac
shift
while :
do arg=$1
shift
'') break
;;
-[$multiopt])
case $1 in
?*) shift ;;
esac
continue
;;
-[DIU]*|-[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*)
;;
-G) case $1 in
[0-9]*) shift ;;
esac
;;
[-+]*) continue
;;
break
;;
esac
set '' "$@" "$arg"
shift
done
?*) while :
do arg=$1
shift
'') break ;;
esac
done
n=
while :
do case $n in
$nfile) break ;;
esac
n=_$n
eval input='$input'$n
esac
esac
;;
1) echo + "$@" "$input" ;;
esac
1) "$@" "$input" || exit ;;
esac
;;
esac
done
;;
esac
) || exit
?*) exit ;;
esac
while :
do shift
case $1 in
[-+]*) ;;
*) break ;;
esac
done
set '' "$@" '' "$1"
shift
shift
n=
while :
do arg=$1
shift
'') break
;;
-[$multiopt])
case $1 in
?*) set '' "$@" "$arg"
shift
arg=$1
shift
;;
esac
;;
"") continue ;;
esac
;;
[-+]*) ;;
n=_$n
eval arg='$output'$n
;;
esac
set '' "$@" "$arg"
shift
done
1) echo + "$@" ;;
esac
1) "$@" ;;
esac
;;
set -A av "$@"
[-+]*) ;;
*) break ;;
esac
done
;;
esac
;;
;;
esac
fi
done
;;
-[DIU]*|-[abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ][abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_]*)
-[DIU]*) continue ;;
esac
;;
esac
-D-*) continue ;;
esac
;;
-E) ppstdout=1
doti=1
trap 0 1 2 3 15
continue
;;
;;
esac
;;
-P) ppfile=1
doti=1
trap 0 1 2 3 15
continue
;;
-#*|-dryrun|--dryrun|-verbose|--verbose)
verbose=1
;;
[-+]*) ;;
esac
esac
fi
esac
;;
esac
esac
;;
esac
;;
esac
;;
esac
1) print -r -- + "${pp[@]}" ;;
esac
1) "${pp[@]}" || exit ;;
esac
;;
esac
done
1) print -r -- + "${cc[@]}" ;;
esac
1) "${cc[@]}" ;;
esac
;;
esac
esac