summaryrefslogtreecommitdiff
path: root/mcon/configure
blob: 95b2d630ea426715d761740fb7e92d576d8ce07b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
#! /bin/sh
#
# $Id: configure,v 3.0.1.2 1997/02/28 16:28:49 ram Exp ram $
#
# GNU configure-like front end to metaconfig's Configure.
#
# Written by Andy Dougherty <doughera@lafcol.lafayette.edu>
# Matthew Green <mrg@mame.mu.oz.au> and Tom Tromey <tromey@cygnus.com>.
#
# Reformatted and modified for inclusion in the dist-3.0 package by
# Raphael Manfredi <Raphael_Manfredi@grenoble.hp.com>.
#
# This script belongs to the public domain and may be freely redistributed.
#
# The remaining of this leading shell comment may be removed if you
# include this script in your own package.
#
# $Log: configure,v $
# Revision 3.0.1.2  1997/02/28  16:28:49  ram
# patch61: added the srcdir support now that we have src.U
# patch61: random cleanup for nicer help message
#
# Revision 3.0.1.1  1995/07/25  14:16:21  ram
# patch56: created
#

(exit $?0) || exec sh $0 $argv:q
opts=''
verbose=''
create='-e'
srcdir=''
while test $# -gt 0; do
	case $1 in
    --help)
		cat <<EOM
Usage: configure [options]
This is GNU configure-like front end for a metaconfig-generated Configure.
It emulates the following GNU configure options (must be fully spelled out):

    --help               --srcdir=DIRECTORY
    --no-create          --silent
    --prefix=PREFIX      --verbose
    --quiet              --version

And it honours these environment variables: CC, CFLAGS and DEFS.

Furthermore, it ignores the following arguments, when supplied:

    --cache-file=FILE    --target=TARGET
    --enable-*           --with-*
    --host=HOST
EOM
		exit 0
		;;
	--no-create)
		create='-E'
		shift
		;;
	--prefix=*)
		arg=`echo $1 | sed 's/--prefix=/-Dprefix=/'`
		opts="$opts $arg"
		shift
		;;
	--prefix)
		shift
		opts="$opts -Dprefix=$1"
		shift
		;;
	--srcdir=*)
		arg=`echo $1 | sed 's/--srcdir=//'`
		srcdir=$arg
		shift
		;;
	--srcdir)
		shift
		srcdir=$1
		shift
		;;
	--quiet|--silent)
		exec >/dev/null 2>&1
		shift
		;;
	--verbose)
		verbose=true
		shift
		;;
	--version)
		copt="$copt -V"
		shift
		;;
	--host=*|--target=*|--cache-file=*|--enable-*|--with-*)
		shift
		;;
	--*)
		opt=`echo $1 | sed 's/=.*//'`
		echo "This GNU configure front end does not understand $opt"
		exit 1
		;;
	*)
		opts="$opts $1"
		shift
		;;
	esac
done

case "$CC" in
'') ;;
*) opts="$opts -Dcc='$CC'";;
esac

# Join DEFS and CFLAGS together.
ccflags=''
case "$DEFS" in
'') ;;
*) ccflags=$DEFS;;
esac
case "$CFLAGS" in
'') ;;
*) ccflags="$ccflags $CFLAGS";;
esac
case "$ccflags" in
'') ;;
*) opts="$opts -Dccflags='$ccflags'";;
esac

# Don't use -s if they want verbose mode
case "$verbose" in
'') copt="$copt -ds";;
*) copt="$copt -d";;
esac

# Figure out srcdir if not set already
case "$srcdir" in
'') srcdir=`echo $0 | sed -e 's%/[^/][^/]*$%%'`;;
esac
case "$srcdir" in
".") ;;
*) opts="$opts -Dsrc=$srcdir";;
esac

set X sh $srcdir/Configure $copt $create $opts
shift
echo "$@"
exec "$@"