| 1 | #! /bin/sh |
|---|
| 2 | # |
|---|
| 3 | # $Id: configure,v 1.4 1996/01/15 21:47:07 dunemush Exp dunemush $ |
|---|
| 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 1.4 1996/01/15 21:47:07 dunemush |
|---|
| 20 | # *** empty log message *** |
|---|
| 21 | # |
|---|
| 22 | # Revision 1.3 1996/01/15 21:09:54 dunemush |
|---|
| 23 | # *** empty log message *** |
|---|
| 24 | # |
|---|
| 25 | # Revision 1.2 1996/01/15 20:38:05 dunemush |
|---|
| 26 | # *** empty log message *** |
|---|
| 27 | # |
|---|
| 28 | # Revision 1.1 1996/01/15 05:20:49 dunemush |
|---|
| 29 | # Initial revision |
|---|
| 30 | # |
|---|
| 31 | # Revision 3.0.1.1 1995/07/25 14:16:21 ram |
|---|
| 32 | # patch56: created |
|---|
| 33 | # |
|---|
| 34 | |
|---|
| 35 | (exit $?0) || exec sh $0 $argv:q |
|---|
| 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 ./Configure $copt $create $opts |
|---|
| 118 | shift |
|---|
| 119 | echo "$@" |
|---|
| 120 | exec "$@" |
|---|