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