This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Assume dist-git will merge our PR's
[metaconfig.git] / dist / configure
CommitLineData
d8875586
MBT
1#! /bin/sh
2#
3# $Id: configure,v 3.0.1.2 1997/02/28 16:28:49 ram Exp ram $
4#
5# GNU configure-like front end to metaconfig's Configure.
6#
7# Written by Andy Dougherty <doughera@lafcol.lafayette.edu>
8# Matthew Green <mrg@mame.mu.oz.au> and Tom Tromey <tromey@cygnus.com>.
9#
10# Reformatted and modified for inclusion in the dist-3.0 package by
11# Raphael Manfredi <Raphael_Manfredi@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.2 1997/02/28 16:28:49 ram
20# patch61: added the srcdir support now that we have src.U
21# patch61: random cleanup for nicer help message
22#
23# Revision 3.0.1.1 1995/07/25 14:16:21 ram
24# patch56: created
25#
26
27(exit $?0) || exec sh $0 $argv:q
28opts=''
29verbose=''
30create='-e'
31srcdir=''
32while test $# -gt 0; do
33 case $1 in
34 --help)
35 cat <<EOM
36Usage: configure [options]
37This is GNU configure-like front end for a metaconfig-generated Configure.
38It emulates the following GNU configure options (must be fully spelled out):
39
40 --help --srcdir=DIRECTORY
41 --no-create --silent
42 --prefix=PREFIX --verbose
43 --quiet --version
44
45And it honours these environment variables: CC, CFLAGS and DEFS.
46
47Furthermore, it ignores the following arguments, when supplied:
48
49 --cache-file=FILE --target=TARGET
50 --enable-* --with-*
51 --host=HOST
52EOM
53 exit 0
54 ;;
55 --no-create)
56 create='-E'
57 shift
58 ;;
59 --prefix=*)
60 arg=`echo $1 | sed 's/--prefix=/-Dprefix=/'`
61 opts="$opts $arg"
62 shift
63 ;;
64 --prefix)
65 shift
66 opts="$opts -Dprefix=$1"
67 shift
68 ;;
69 --srcdir=*)
70 arg=`echo $1 | sed 's/--srcdir=//'`
71 srcdir=$arg
72 shift
73 ;;
74 --srcdir)
75 shift
76 srcdir=$1
77 shift
78 ;;
79 --quiet|--silent)
80 exec >/dev/null 2>&1
81 shift
82 ;;
83 --verbose)
84 verbose=true
85 shift
86 ;;
87 --version)
88 copt="$copt -V"
89 shift
90 ;;
91 --host=*|--target=*|--cache-file=*|--enable-*|--with-*)
92 shift
93 ;;
94 --*)
95 opt=`echo $1 | sed 's/=.*//'`
96 echo "This GNU configure front end does not understand $opt"
97 exit 1
98 ;;
99 *)
100 opts="$opts $1"
101 shift
102 ;;
103 esac
104done
105
106case "$CC" in
107'') ;;
108*) opts="$opts -Dcc='$CC'";;
109esac
110
111# Join DEFS and CFLAGS together.
112ccflags=''
113case "$DEFS" in
114'') ;;
115*) ccflags=$DEFS;;
116esac
117case "$CFLAGS" in
118'') ;;
119*) ccflags="$ccflags $CFLAGS";;
120esac
121case "$ccflags" in
122'') ;;
123*) opts="$opts -Dccflags='$ccflags'";;
124esac
125
126# Don't use -s if they want verbose mode
127case "$verbose" in
128'') copt="$copt -ds";;
129*) copt="$copt -d";;
130esac
131
132# Figure out srcdir if not set already
133case "$srcdir" in
134'') srcdir=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
135esac
136case "$srcdir" in
137".") ;;
138*) opts="$opts -Dsrc=$srcdir";;
139esac
140
141set X sh $srcdir/Configure $copt $create $opts
142shift
143echo "$@"
144exec "$@"