| 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@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 explicitly 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.gnu [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 | --cache-file  (ignored) | 
|---|
| 50 | --quiet | 
|---|
| 51 | --silent | 
|---|
| 52 | --verbose | 
|---|
| 53 | --version | 
|---|
| 54 |  | 
|---|
| 55 | And it honours these environment variables: CC, CFLAGS and DEFS. | 
|---|
| 56 | EOM | 
|---|
| 57 | exit 0 | 
|---|
| 58 | ;; | 
|---|
| 59 | --no-create) | 
|---|
| 60 | create='-E' | 
|---|
| 61 | shift | 
|---|
| 62 | ;; | 
|---|
| 63 | --prefix=*) | 
|---|
| 64 | arg=`echo $1 | sed 's/--prefix=/-Dprefix=/'` | 
|---|
| 65 | opts="$opts $arg" | 
|---|
| 66 | shift | 
|---|
| 67 | ;; | 
|---|
| 68 | --prefix) | 
|---|
| 69 | shift | 
|---|
| 70 | arg="-Dprefix=$1" | 
|---|
| 71 | opts="$opts $arg" | 
|---|
| 72 | shift | 
|---|
| 73 | ;; | 
|---|
| 74 | --cache-file=*) | 
|---|
| 75 | shift           # Just ignore it. | 
|---|
| 76 | ;; | 
|---|
| 77 | --quiet|--silent) | 
|---|
| 78 | exec >/dev/null 2>&1 | 
|---|
| 79 | shift | 
|---|
| 80 | ;; | 
|---|
| 81 | --verbose) | 
|---|
| 82 | verbose=true | 
|---|
| 83 | shift | 
|---|
| 84 | ;; | 
|---|
| 85 | --version) | 
|---|
| 86 | copt="$copt -V" | 
|---|
| 87 | shift | 
|---|
| 88 | ;; | 
|---|
| 89 | --*) | 
|---|
| 90 | opt=`echo $1 | sed 's/=.*//'` | 
|---|
| 91 | echo "This GNU configure front end does not understand $opt" | 
|---|
| 92 | exit 1 | 
|---|
| 93 | ;; | 
|---|
| 94 | *) | 
|---|
| 95 | opts="$opts '$1'" | 
|---|
| 96 | shift | 
|---|
| 97 | ;; | 
|---|
| 98 | esac | 
|---|
| 99 | done | 
|---|
| 100 |  | 
|---|
| 101 | case "$CC" in | 
|---|
| 102 | '') ;; | 
|---|
| 103 | *) opts="$opts -Dcc='$CC'";; | 
|---|
| 104 | esac | 
|---|
| 105 |  | 
|---|
| 106 | # Join DEFS and CFLAGS together. | 
|---|
| 107 | ccflags='' | 
|---|
| 108 | case "$DEFS" in | 
|---|
| 109 | '') ;; | 
|---|
| 110 | *) ccflags=$DEFS;; | 
|---|
| 111 | esac | 
|---|
| 112 | case "$CFLAGS" in | 
|---|
| 113 | '') ;; | 
|---|
| 114 | *) ccflags="$ccflags $CFLAGS";; | 
|---|
| 115 | esac | 
|---|
| 116 | case "$ccflags" in | 
|---|
| 117 | '') ;; | 
|---|
| 118 | *) opts="$opts -Dccflags='$ccflags'";; | 
|---|
| 119 | esac | 
|---|
| 120 | case "$LDFLAGS" in | 
|---|
| 121 | '') ;; | 
|---|
| 122 | *) ldflags="$ldflags $LDFLAGS";; | 
|---|
| 123 | esac | 
|---|
| 124 | case "$ldflags" in | 
|---|
| 125 | '') ;; | 
|---|
| 126 | *) opts="$opts -Dldflags='$ldflags'";; | 
|---|
| 127 | esac | 
|---|
| 128 |  | 
|---|
| 129 | # Don't use -s if they want verbose mode | 
|---|
| 130 | case "$verbose" in | 
|---|
| 131 | '') copt="$copt -ds";; | 
|---|
| 132 | *) copt="$copt -d";; | 
|---|
| 133 | esac | 
|---|
| 134 |  | 
|---|
| 135 | eval "set X sh Configure $copt $create $opts" | 
|---|
| 136 | shift | 
|---|
| 137 | echo "$@" | 
|---|
| 138 | exec "$@" | 
|---|