This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
toke.c: Save a branch
[perl5.git] / configure.gnu
... / ...
CommitLineData
1#! /bin/sh
2#
3# GNU configure-like front end to metaconfig's Configure.
4#
5# Written by Andy Dougherty <doughera@lafayette.edu>
6# and Matthew Green <mrg@mame.mu.oz.au>.
7#
8# Reformatted and modified for inclusion in the dist-3.0 package by
9# Raphael Manfredi <ram@hptnos02.grenoble.hp.com>.
10#
11# This script belongs to the public domain and may be freely redistributed.
12#
13# The remaining of this leading shell comment may be removed if you
14# include this script in your own package.
15#
16# $Log: configure,v $
17# Revision 3.0.1.1 1995/07/25 14:16:21 ram
18# patch56: created
19#
20
21(exit $?0) || exec sh $0 $argv:q
22
23case "$0" in
24*configure)
25 if cmp $0 `echo $0 | sed -e s/configure/Configure/` >/dev/null; then
26 echo "Your configure and Configure scripts seem to be identical."
27 echo "This can happen on filesystems that aren't fully case sensitive."
28 echo "You'll have to explicitly extract Configure and run that."
29 exit 1
30 fi
31 ;;
32esac
33
34opts=''
35verbose=''
36create='-e'
37while test $# -gt 0; do
38 case $1 in
39 --help)
40 cat <<EOM
41Usage: configure.gnu [options]
42This is GNU configure-like front end for a metaconfig-generated Configure.
43It emulates the following GNU configure options (must be fully spelled out):
44 --help
45 --no-create
46 --prefix=PREFIX
47 --cache-file (ignored)
48 --quiet
49 --silent
50 --verbose
51 --version
52
53And it honours these environment variables: CC, CFLAGS and DEFS.
54EOM
55 exit 0
56 ;;
57 --no-create)
58 create='-E'
59 shift
60 ;;
61 --prefix=*)
62 arg=`echo $1 | sed 's/--prefix=/-Dprefix=/'`
63 opts="$opts $arg"
64 shift
65 ;;
66 --prefix)
67 shift
68 arg="-Dprefix=$1"
69 opts="$opts $arg"
70 shift
71 ;;
72 --cache-file=*)
73 shift # Just ignore it.
74 ;;
75 --quiet|--silent)
76 exec >/dev/null 2>&1
77 shift
78 ;;
79 --verbose)
80 verbose=true
81 shift
82 ;;
83 --version)
84 copt="$copt -V"
85 shift
86 ;;
87 --*)
88 opt=`echo $1 | sed 's/=.*//'`
89 echo "This GNU configure front end does not understand $opt"
90 exit 1
91 ;;
92 *)
93 opts="$opts '$1'"
94 shift
95 ;;
96 esac
97done
98
99case "$CC" in
100'') ;;
101*) opts="$opts -Dcc='$CC'";;
102esac
103
104# Join DEFS and CFLAGS together.
105ccflags=''
106case "$DEFS" in
107'') ;;
108*) ccflags=$DEFS;;
109esac
110case "$CFLAGS" in
111'') ;;
112*) ccflags="$ccflags $CFLAGS";;
113esac
114case "$ccflags" in
115'') ;;
116*) opts="$opts -Dccflags='$ccflags'";;
117esac
118case "$LDFLAGS" in
119'') ;;
120*) ldflags="$ldflags $LDFLAGS";;
121esac
122case "$ldflags" in
123'') ;;
124*) opts="$opts -Dldflags='$ldflags'";;
125esac
126
127# Don't use -s if they want verbose mode
128case "$verbose" in
129'') copt="$copt -ds";;
130*) copt="$copt -d";;
131esac
132
133eval "set X sh Configure $copt $create $opts"
134shift
135echo "$@"
136exec "$@"