Raymond Toy pushed to branch issue-363-add-version-number at cmucl / cmucl

Commits:

2 changed files:

Changes:

  • bin/make-dist.sh
    ... ... @@ -94,11 +94,6 @@ def_arch_os () {
    94 94
     # Figure out the architecture and OS in case options aren't given
    
    95 95
     def_arch_os
    
    96 96
     
    
    97
    -# Choose a version based on the git hash as the default version.  We
    
    98
    -# only compute a default if the git hash looks like a snapshot
    
    99
    -# ("snapshot-yyyy-mm") or a release number..
    
    100
    -DEFAULT_VERSION="`bin/git-version.sh`"
    
    101
    -
    
    102 97
     # Default compression is -J (xz).  These variables are passed to the
    
    103 98
     # other scripts via the environmen, so export them.
    
    104 99
     COMPRESS=-J
    
    ... ... @@ -149,17 +144,6 @@ if [ -n "$COMPRESS_ARG" ]; then
    149 144
         esac
    
    150 145
     fi
    
    151 146
     
    
    152
    -if [ -z "$VERSION" ]; then
    
    153
    -    # If a default version exists, use it. Otherwise this is an
    
    154
    -    # error---at least one of these must not be empty.
    
    155
    -    if [ -z "${DEFAULT_VERSION}" ]; then
    
    156
    -	echo "Version (-V) must be specified because default version cannot be determined."
    
    157
    -	usage
    
    158
    -    else
    
    159
    -	VERSION=${DEFAULT_VERSION}
    
    160
    -    fi
    
    161
    -fi
    
    162
    -
    
    163 147
     if [ ! -d "$1" ]
    
    164 148
     then
    
    165 149
     	echo "$1 isn't a directory"
    
    ... ... @@ -180,6 +164,22 @@ fi
    180 164
     
    
    181 165
     TARGET="`echo $1 | sed 's:/*$::'`"
    
    182 166
     
    
    167
    +# Choose a version based on the git hash as the default version.  We
    
    168
    +# only compute a default if the git hash looks like a snapshot
    
    169
    +# ("snapshot-yyyy-mm") or a release number..
    
    170
    +DEFAULT_VERSION="`$TARGET/lisp/lisp -print-version`"
    
    171
    +
    
    172
    +if [ -z "$VERSION" ]; then
    
    173
    +    # If a default version exists, use it. Otherwise this is an
    
    174
    +    # error---at least one of these must not be empty.
    
    175
    +    if [ -z "${DEFAULT_VERSION}" ]; then
    
    176
    +	echo "Version (-V) must be specified because default version cannot be determined."
    
    177
    +	usage
    
    178
    +    else
    
    179
    +	VERSION=${DEFAULT_VERSION}
    
    180
    +    fi
    
    181
    +fi
    
    182
    +
    
    183 183
     echo INSTALL_DIR = $INSTALL_DIR
    
    184 184
     
    
    185 185
     echo cmucl-$VERSION-$ARCH-$OS
    

  • src/lisp/lisp.c
    ... ... @@ -95,6 +95,9 @@ alloc_str_list(const char *list[])
    95 95
     }
    
    96 96
     
    
    97 97
     /* Default paths for CMUCLLIB */
    
    98
    +
    
    99
    +static char cmucl_version[] = CMUCL_VERSION;
    
    100
    +
    
    98 101
     static char *cmucllib_search_list[] = {
    
    99 102
         "./../lib/cmucl/" CMUCL_VERSION "/lib",
    
    100 103
         NULL
    
    ... ... @@ -676,7 +679,14 @@ main(int argc, const char *argv[], const char *envp[])
    676 679
     	    debug_lisp_search = TRUE;
    
    677 680
             } else if (strcmp(arg, "-unidata") == 0) {
    
    678 681
               unidata = *++argptr;
    
    679
    -        }
    
    682
    +        } else if (strcmp(arg, "-print-version") == 0) {
    
    683
    +	    /*
    
    684
    +	     * Print the version and exit; we don't want to do
    
    685
    +	     * anything else!
    
    686
    +	     */
    
    687
    +	    printf("%s\n", cmucl_version);
    
    688
    +	    return 0;
    
    689
    +	}
    
    680 690
         }
    
    681 691
     
    
    682 692
         default_core = arch_init(fpu_mode);