Commit | Line | Data |
16d20bd9 |
1 | #! /bin/sh |
8e07c86e |
2 | # |
3 | # $Id: configure,v 3.0.1.1 1995/07/25 14:16:21 ram Exp $ |
4 | # |
16d20bd9 |
5 | # GNU configure-like front end to metaconfig's Configure. |
6 | # |
8e07c86e |
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 |
16d20bd9 |
21 | # |
16d20bd9 |
22 | |
8e07c86e |
23 | (exit $?0) || exec sh $0 $argv:q |
16d20bd9 |
24 | opts='' |
8e07c86e |
25 | verbose='' |
26 | create='-e' |
27 | while test $# -gt 0; do |
28 | case $1 in |
16d20bd9 |
29 | --help) |
8e07c86e |
30 | cat <<EOM |
31 | Usage: configure [options] |
32 | This is GNU configure-like front end for a metaconfig-generated Configure. |
33 | It emulates the following GNU configure options (must be fully spelled out): |
34 | --help |
35 | --no-create |
36 | --prefix=PREFIX |
37 | --quiet |
38 | --silent |
39 | --verbose |
40 | --version |
41 | |
42 | And it honours these environment variables: CC, CFLAGS and DEFS. |
43 | EOM |
44 | exit 0 |
45 | ;; |
46 | --no-create) |
47 | create='-E' |
48 | shift |
49 | ;; |
50 | --prefix=*) |
51 | arg=`echo $1 | sed 's/--prefix=/-Dprefix=/'` |
52 | opts="$opts $arg" |
53 | shift |
54 | ;; |
55 | --quiet|--silent) |
56 | exec >/dev/null 2>&1 |
57 | shift |
58 | ;; |
59 | --verbose) |
60 | verbose=true |
61 | shift |
62 | ;; |
63 | --version) |
64 | copt="$copt -V" |
65 | shift |
66 | ;; |
67 | --*) |
68 | opt=`echo $1 | sed 's/=.*//'` |
69 | echo "This GNU configure front end does not understand $opt" |
70 | exit 1 |
71 | ;; |
72 | *) |
73 | opts="$opts $1" |
74 | shift |
75 | ;; |
76 | esac |
16d20bd9 |
77 | done |
78 | |
79 | case "$CC" in |
8e07c86e |
80 | '') ;; |
81 | *) opts="$opts -Dcc='$CC'";; |
16d20bd9 |
82 | esac |
83 | |
8e07c86e |
84 | # Join DEFS and CFLAGS together. |
16d20bd9 |
85 | ccflags='' |
8e07c86e |
86 | case "$DEFS" in |
87 | '') ;; |
88 | *) ccflags=$DEFS;; |
89 | esac |
90 | case "$CFLAGS" in |
91 | '') ;; |
92 | *) ccflags="$ccflags $CFLAGS";; |
93 | esac |
94 | case "$ccflags" in |
95 | '') ;; |
96 | *) opts="$opts -Dccflags='$ccflags'";; |
97 | esac |
16d20bd9 |
98 | |
8e07c86e |
99 | # Don't use -s if they want verbose mode |
100 | case "$verbose" in |
101 | '') copt="$copt -ds";; |
102 | *) copt="$copt -d";; |
103 | esac |
16d20bd9 |
104 | |
f87d5507 |
105 | set X sh Configure $copt $create $opts |
8e07c86e |
106 | shift |
107 | echo "$@" |
108 | exec "$@" |