Raymond Toy pushed to branch master at cmucl / cmucl

Commits:

1 changed file:

Changes:

  • bin/make-dist.sh
    ... ... @@ -12,7 +12,7 @@
    12 12
     # $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/tools/make-dist.sh,v 1.20 2011/04/11 16:34:49 rtoy Exp $
    
    13 13
     
    
    14 14
     usage() {
    
    15
    -    echo "make-dist.sh: [-hbg] [-G group] [-O owner] [-I destdir] [-M mandir] dir [version arch os]"
    
    15
    +    echo "make-dist.sh: [-hbg] [-G group] [-O owner] [-I destdir] [-M mandir] [-A arch] [-V version] [-o OS] dir"
    
    16 16
         echo "  -h           This help"
    
    17 17
         echo "  -b           Use bzip2 compression"
    
    18 18
         echo "  -g           Use gzip compression"
    
    ... ... @@ -24,10 +24,10 @@ usage() {
    24 24
         echo "                 The compressed tar file is named cmucl-src-<VERSION>.tar.<ext>"
    
    25 25
         echo "                 If -I is also given, the -S means that the sources are "
    
    26 26
         echo "                 installed in the <destdir>/src"
    
    27
    +    echo "  -A arch      Architecture (x86, sparc, ppc, etc.)"
    
    28
    +    echo "  -o OS        OS (linux, solaris10, etc.)"
    
    29
    +    echo "  -V version   Version (usually date and/or other version info)"
    
    27 30
         echo "   dir         Directory where the build is located"
    
    28
    -    echo "   version     Version (usually date and/or other version info)"
    
    29
    -    echo "   arch        Architecture (x86, sparc, etc.)"
    
    30
    -    echo "   os          OS (linux, solaris8, etc.)"
    
    31 31
         echo ""
    
    32 32
         echo "If the -I option is given, directly install all of the files to the"
    
    33 33
         echo "specified directory.  Otherwise, Make a CMUCL distribution consisting"
    
    ... ... @@ -57,7 +57,7 @@ def_arch_os () {
    57 57
           SunOS)
    
    58 58
     	  case `uname -m` in
    
    59 59
     	    sun*)
    
    60
    -		ARCH=sparcv9 ;;
    
    60
    +		ARCH=sparc ;;
    
    61 61
     	    i*)
    
    62 62
     		ARCH=x86 ;;
    
    63 63
     	  esac
    
    ... ... @@ -90,7 +90,23 @@ def_arch_os () {
    90 90
           esac
    
    91 91
     }
    
    92 92
     
    
    93
    -while getopts "G:O:I:M:bghS?" arg
    
    93
    +# Figure out the architecture and OS in case options aren't given
    
    94
    +def_arch_os
    
    95
    +
    
    96
    +# Choose a version based on the git hash as the default version.  We
    
    97
    +# only compute a default if the git hash looks like a snapshot
    
    98
    +# ("snapshot-yyyy-mm") or a release number..
    
    99
    +GIT_HASH="`(cd src; git describe --dirty 2>/dev/null)`"
    
    100
    +
    
    101
    +if expr "X${GIT_HASH}" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]' > /dev/null; then
    
    102
    +    DEFAULT_VERSION=`expr "${GIT_HASH}" : "snapshot-\(.*\)"`
    
    103
    +fi
    
    104
    +
    
    105
    +if expr "X${GIT_HASH}" : 'X[0-9][0-9][a-f]' > /dev/null; then
    
    106
    +    DEFAULT_VERSION="${GIT_HASH}"
    
    107
    +fi
    
    108
    +
    
    109
    +while getopts "G:O:I:M:bghSA:o:V:?" arg
    
    94 110
     do
    
    95 111
         case $arg in
    
    96 112
     	G) GROUP=$OPTARG ;;
    
    ... ... @@ -100,46 +116,28 @@ do
    100 116
     	b) ENABLE_BZIP=-b ;;
    
    101 117
     	g) ENABLE_GZIP=-g  ;;
    
    102 118
             S) MAKE_SRC_DIST=yes ;;
    
    119
    +        A) ARCH=$OPTARG ;;
    
    120
    +        o) OS=$OPTARG ;;
    
    121
    +        V) VERSION=$OPTARG ;;
    
    103 122
     	h | \?) usage; exit 1 ;;
    
    104 123
         esac
    
    105 124
     done
    
    106 125
     
    
    107 126
     shift `expr $OPTIND - 1`
    
    108 127
     
    
    109
    -# Figure out the architecture and OS
    
    110
    -ARCH=
    
    111
    -OS=
    
    112
    -
    
    113
    -# Figure out the architecture and OS
    
    114
    -def_arch_os
    
    128
    +# Directory is required; exit if not given
    
    129
    +if [ $# -lt 1 ]; then
    
    130
    +    usage
    
    131
    +fi
    
    115 132
     
    
    116
    -if [ -n "${INSTALL_DIR}" ]; then
    
    117
    -    # Doing direct installation
    
    118
    -    if [ $# -lt 1 ]; then
    
    133
    +if [ -z "$VERSION" ]; then
    
    134
    +    # If a default version exists, use it. Otherwise this is an
    
    135
    +    # error---at least one of these must not be empty.
    
    136
    +    if [ -z "${DEFAULT_VERSION}" ]; then
    
    137
    +	echo "Version (-V) must be specified because default version cannot be determined."
    
    119 138
     	usage
    
    120 139
         else
    
    121
    -	def_arch_os
    
    122
    -    fi
    
    123
    -elif [ $# -lt 2 ]; then
    
    124
    -    # Version not specified so choose a version based on the git hash.
    
    125
    -    GIT_HASH="`(cd src; git describe --dirty 2>/dev/null)`"
    
    126
    -
    
    127
    -    if expr "X${GIT_HASH}" : 'Xsnapshot-[0-9][0-9][0-9][0-9]-[01][0-9]' > /dev/null; then
    
    128
    -	VERSION=`expr "${GIT_HASH}" : "snapshot-\(.*\)"`
    
    129
    -    fi
    
    130
    -
    
    131
    -    if expr "X${GIT_HASH}" : 'X[0-9][0-9][a-f]' > /dev/null; then
    
    132
    -	VERSION="${GIT_HASH}"
    
    133
    -    fi
    
    134
    -
    
    135
    -    echo "Defaulting version to $VERSION"
    
    136
    -else
    
    137
    -    VERSION="$2"
    
    138
    -    if [ $# -eq 3 ]; then
    
    139
    -	ARCH=$3
    
    140
    -    elif [ $# -eq 4 ]; then
    
    141
    -	ARCH=$3
    
    142
    -	OS=$4
    
    140
    +	VERSION=${DEFAULT_VERSION}
    
    143 141
         fi
    
    144 142
     fi
    
    145 143
     
    
    ... ... @@ -167,6 +165,7 @@ if [ -n "$INSTALL_DIR" ]; then
    167 165
         VERSION="today"
    
    168 166
     fi
    
    169 167
     
    
    168
    +echo cmucl-$VERSION-$ARCH-$OS
    
    170 169
     ROOT=`dirname $0`
    
    171 170
     
    
    172 171
     # If no compression options given, default to bzip