add --with-<feature> and --without-<feature> support to make.sh
[sbcl.git] / make-config.sh
1 #!/bin/sh
2 set -e
3
4 # The make-config.sh script uses information about the target machine
5 # to set things up for compilation. It's vaguely like a stripped-down
6 # version of autoconf. It's intended to be run as part of make.sh. The
7 # only time you'd want to run it by itself is if you're trying to
8 # cross-compile the system or if you're doing some kind of
9 # troubleshooting.
10
11 # This software is part of the SBCL system. See the README file for
12 # more information.
13 #
14 # This software is derived from the CMU CL system, which was
15 # written at Carnegie Mellon University and released into the
16 # public domain. The software is in the public domain and is
17 # provided with absolutely no warranty. See the COPYING and CREDITS
18 # files for more information.
19
20 print_help="no"
21
22 # The classic form here was to use --userinit $DEVNULL --sysinit
23 # $DEVNULL, but that doesn't work on Win32 because SBCL doesn't handle
24 # device names properly. We still need $DEVNULL to be NUL on Win32
25 # because it's used elsewhere (such as canonicalize-whitespace), so we
26 # need an alternate solution for the init file overrides. --no-foos
27 # have now been available long enough that this should not stop anyone
28 # from building.
29 if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ]
30 then
31     SBCL_PREFIX="$PROGRAMFILES/sbcl"
32 else
33     SBCL_PREFIX="/usr/local"
34 fi
35 SBCL_XC_HOST="sbcl --disable-debugger --no-userinit --no-sysinit"
36 export SBCL_XC_HOST
37
38 # Parse command-line options.
39 bad_option() {
40     echo $1
41     echo "Enter \"$0 --help\" for list of valid options."
42     exit 1
43 }
44
45 WITH_FEATURES=""
46 WITHOUT_FEATURES=""
47
48 some_options=false
49 for option
50 do
51   optarg_ok=true
52   # Split --foo=bar into --foo and bar.
53   case $option in
54       *=*)
55         # For ease of scripting skip valued options with empty
56         # values.
57         optarg=`expr "X$option" : '[^=]*=\(.*\)'` || optarg_ok=false
58         option=`expr "X$option" : 'X\([^=]*=\).*'`
59         ;;
60       --with*)
61         optarg=`expr "X$option" : 'X--[^-]*-\(.*\)'` \
62             || bad_option "Malformed feature toggle: $option"
63         option=`expr "X$option" : 'X\(--[^-]*\).*'`
64         ;;
65       *)
66         optarg=""
67         ;;
68   esac
69
70   case $option in
71       --help | -help | -h)
72         print_help="yes" ;;
73       --prefix=)
74         $optarg_ok && SBCL_PREFIX=$optarg
75         ;;
76       --arch=)
77         $oparg_ok && SBCL_ARCH=$optarg
78         ;;
79       --xc-host=)
80         $optarg_ok && SBCL_XC_HOST=$optarg
81         ;;
82       --dynamic-space-size=)
83         $optarg_ok && SBCL_DYNAMIC_SPACE_SIZE=$optarg
84         ;;
85       --with)
86         WITH_FEATURES="$WITH_FEATURES :$optarg"
87         ;;
88       --without)
89         WITHOUT_FEATURES="$WITHOUT_FEATURES :$optarg"
90         ;;
91       -*)
92         bad_option "Unknown command-line option to $0: \"$option\""
93         ;;
94       *)
95         if $some_options
96         then
97             bad_option "Unknown command-line option to $0: \"$option\""
98         else
99             legacy_xc_spec=$option
100         fi
101         ;;
102   esac
103   some_options=true
104 done
105
106 if (test -f customize-target-features.lisp && \
107     (test -n "$WITH_FEATURES" || test -n "$WITHOUT_FEATURES"))
108 then
109     # Actually there's no reason why it would not work, but it would
110     # be confusing to say --with-thread only to have it turned off by
111     # customize-target-features.lisp...
112     echo "ERROR: Both customize-target-features.lisp, and feature-options"
113     echo "to make.sh present -- cannot use both at the same time."
114 fi
115
116 # Previously XC host was provided as a positional argument. 
117 if test -n "$legacy_xc_spec"
118 then
119     SBCL_XC_HOST="$legacy_xc_spec"
120 fi
121
122 if test "$print_help" = "yes"
123 then
124   cat <<EOF
125 \`make.sh' drives the SBCL build.
126
127 Usage: $0 [OPTION]...
128
129   Important: make.sh does not currently control the entirety of the
130   build: configuration file customize-target-features.lisp and certain
131   environment variables play a role as well. see file INSTALL for
132   details.
133
134 Options:
135   -h, --help           Display this help and exit.
136
137   --prefix=<path>      Specify the install location.
138
139       Script install.sh installs SBCL under the specified prefix
140       path: runtime as prefix/bin/sbcl, additional files under
141       prefix/lib/sbcl, and documentation under prefix/share.
142
143       This option also affects the binaries: built-in default for
144       SBCL_HOME is: prefix/lib/sbcl/
145
146       Default prefix is: /usr/local
147
148   --dynamic-space-size=<size> Default dynamic-space size for target.
149
150       This specifies the default dynamic-space size for the SBCL
151       being built. If you need to control the dynamic-space size
152       of the host SBCL, use the --xc-host option.
153
154       If not provided, the default is platform-specific. <size> is
155       taken to be megabytes unless explicitly suffixed with Gb in
156       order to specify the size in gigabytes.
157
158   --with-<feature>     Build with specified feature.
159   --without-<feature>  Build wihout the specfied feature.
160
161   --arch=<string>      Specify the architecture to build for.
162
163       Mainly for doing x86 builds on x86-64.
164
165   --xc-host=<string>   Specify the Common Lisp compilation host.
166
167       The string provided should be a command to invoke the
168       cross-compilation Lisp system in such a way, that it reads
169       commands from standard input, and terminates when it reaches end
170       of file on standard input.
171
172       Examples:
173
174        "sbcl --disable-debugger --no-sysinit --no-userinit"
175                   Use an existing SBCL binary as a cross-compilation
176                   host even though you have stuff in your
177                   initialization files which makes it behave in such a
178                   non-standard way that it keeps the build from
179                   working. Also disable the debugger instead of
180                   waiting endlessly for a programmer to help it out
181                   with input on *DEBUG-IO*. (This is the default.)
182
183        "sbcl"
184                   Use an existing SBCL binary as a cross-compilation
185                   host, including your initialization files and
186                   building with the debugger enabled. Not recommended
187                   for casual users.
188
189        "lisp -noinit -batch"
190                   Use an existing CMU CL binary as a cross-compilation
191                   host when you have weird things in your .cmucl-init
192                   file.
193 EOF
194   exit 1
195 fi
196
197 mkdir -p output
198 # Save prefix for make and install.sh.
199 echo "SBCL_PREFIX='$SBCL_PREFIX'" > output/prefix.def
200 echo "$SBCL_DYNAMIC_SPACE_SIZE" > output/dynamic-space-size.txt
201
202 # FIXME: Tweak this script, and the rest of the system, to support
203 # a second bootstrapping pass in which the cross-compilation host is
204 # known to be SBCL itself, so that the cross-compiler can do some
205 # optimizations (especially specializable arrays) that it doesn't
206 # know how to implement how in a portable way. (Or maybe that wouldn't
207 # require a second pass, just testing at build-the-cross-compiler time
208 # whether the cross-compilation host returns suitable values from
209 # UPGRADED-ARRAY-ELEMENT-TYPE?)
210
211 if [ "$OSTYPE" = "cygwin" -o "$OSTYPE" = "msys" ] ; then
212     DEVNULL=NUL
213 else
214     DEVNULL=/dev/null
215 fi
216 export DEVNULL
217
218 . ./find-gnumake.sh
219 find_gnumake
220
221 . ./generate-version.sh
222 generate_version
223
224 # Now that we've done our option parsing and found various
225 # dependencies, write them out to a file to be sourced by other
226 # scripts.
227
228 echo "DEVNULL=\"$DEVNULL\"; export DEVNULL" > output/build-config
229 echo "GNUMAKE=\"$GNUMAKE\"; export GNUMAKE" >> output/build-config
230 echo "SBCL_XC_HOST=\"$SBCL_XC_HOST\"; export SBCL_XC_HOST" >> output/build-config
231 echo "legacy_xc_spec=\"$legacy_xc_spec\"; export legacy_xc_spec" >> output/build-config
232
233 # And now, sorting out the per-target dependencies...
234
235 case `uname` in
236     Linux)
237         sbcl_os="linux"
238         ;;
239     OSF1)
240         # it's changed name twice since it was called OSF/1: clearly
241         # the marketers forgot to tell the engineers about Digital Unix
242         # _or_ OSF/1 ...
243         sbcl_os="osf1"
244         ;;
245     *BSD)
246         case `uname` in
247             FreeBSD)
248                 sbcl_os="freebsd"
249                 ;;
250             OpenBSD)
251                 sbcl_os="openbsd"
252                 ;;
253             NetBSD)
254                 sbcl_os="netbsd"
255                 ;;
256             *)
257                 echo unsupported BSD variant: `uname`
258                 exit 1
259                 ;;
260         esac
261         ;;
262     Darwin)
263         sbcl_os="darwin"
264         ;;
265     SunOS)
266         sbcl_os="sunos"
267         ;;
268     CYGWIN* | WindowsNT | MINGW*)
269         sbcl_os="win32"
270         ;;
271     HP-UX)
272         sbcl_os="hpux"
273         ;;
274     *)
275         echo unsupported OS type: `uname`
276         exit 1
277         ;;
278 esac
279
280 link_or_copy() {
281    if [ "$sbcl_os" = "win32" ] ; then
282        cp -r "$1" "$2"
283    else
284        ln -s "$1" "$2"
285    fi
286 }
287
288 remove_dir_safely() {
289    if [ "$sbcl_os" = "win32" ] ; then
290         if [ -d "$1" ] ; then
291             rm -rf "$1"
292         elif [ -e "$1" ] ; then
293             echo "I'm afraid to remove non-directory $1."
294             exit 1
295         fi
296     else
297         if [ -h "$1" ] ; then
298             rm "$1"
299         elif [ -w "$1" ] ; then
300             echo "I'm afraid to replace non-symlink $1 with a symlink."
301             exit 1
302         fi
303     fi
304 }
305
306 echo //entering make-config.sh
307
308 echo //ensuring the existence of output/ directory
309 if [ ! -d output ] ; then mkdir output; fi
310
311 ltf=`pwd`/local-target-features.lisp-expr
312 echo //initializing $ltf
313 echo ';;;; This is a machine-generated file.' > $ltf
314 echo ';;;; Please do not edit it by hand.' >> $ltf
315 echo ';;;; See make-config.sh.' >> $ltf
316 echo "((lambda (features) (set-difference features (list$WITHOUT_FEATURES)))" >> $ltf
317 printf " (union (list$WITH_FEATURES) (list " >> $ltf
318
319 echo //guessing default target CPU architecture from host architecture
320 case `uname -m` in
321     *86) guessed_sbcl_arch=x86 ;;
322     i86pc) guessed_sbcl_arch=x86 ;;
323     *x86_64) guessed_sbcl_arch=x86-64 ;;
324     amd64) guessed_sbcl_arch=x86-64 ;;
325     [Aa]lpha) guessed_sbcl_arch=alpha ;;
326     sparc*) guessed_sbcl_arch=sparc ;;
327     sun*) guessed_sbcl_arch=sparc ;;
328     *ppc) guessed_sbcl_arch=ppc ;;
329     ppc64) guessed_sbcl_arch=ppc ;;
330     Power*Macintosh) guessed_sbcl_arch=ppc ;;
331     parisc) guessed_sbcl_arch=hppa ;;
332     9000/800) guessed_sbcl_arch=hppa ;;
333     mips*) guessed_sbcl_arch=mips ;;
334     *)
335         # If we're not building on a supported target architecture, we
336         # we have no guess, but it's not an error yet, since maybe
337         # target architecture will be specified explicitly below.
338         guessed_sbcl_arch=''
339         ;;
340 esac
341
342 # Under Solaris, uname -m returns "i86pc" even if CPU is amd64.
343 if [ "$sbcl_os" = "sunos" ] && [ `isainfo -k` = "amd64" ]; then
344     guessed_sbcl_arch=x86-64
345 fi
346
347 # Under Darwin, uname -m returns "i386" even if CPU is x86_64.
348 if [ "$sbcl_os" = "darwin" ] && [ "`/usr/sbin/sysctl -n hw.optional.x86_64`" = "1" ]; then
349     guessed_sbcl_arch=x86-64
350 fi
351
352 echo //setting up CPU-architecture-dependent information
353 sbcl_arch=${SBCL_ARCH:-$guessed_sbcl_arch}
354 echo sbcl_arch=\"$sbcl_arch\"
355 if [ "$sbcl_arch" = "" ] ; then
356     echo "can't guess target SBCL architecture, please specify --arch=<name>"
357     exit 1
358 fi
359 printf ":%s" "$sbcl_arch" >> $ltf
360
361 echo //setting up OS-dependent information
362
363 # Under Darwin x86-64, guess whether Darwin 9+ or below.
364 if [ "$sbcl_os" = "darwin" ] && [ "$sbcl_arch" = "x86-64" ]; then
365     darwin_version=`uname -r`
366     darwin_version_major=${DARWIN_VERSION_MAJOR:-${darwin_version%%.*}}
367     if (( 8 < $darwin_version_major )); then
368         printf ' :inode64 :darwin9-or-better' >> $ltf
369     fi
370 fi
371
372 original_dir=`pwd`
373 cd ./src/runtime/
374 rm -f Config target-arch-os.h target-arch.h target-os.h target-lispregs.h
375 # KLUDGE: these two logically belong in the previous section
376 # ("architecture-dependent"); it seems silly to enforce this in terms
377 # of the shell script, though. -- CSR, 2002-02-03
378 link_or_copy $sbcl_arch-arch.h target-arch.h
379 link_or_copy $sbcl_arch-lispregs.h target-lispregs.h
380 case "$sbcl_os" in
381     linux)
382         printf ' :unix' >> $ltf
383         printf ' :elf' >> $ltf
384         printf ' :linux' >> $ltf
385
386         # If you add other platforms here, don't forget to edit
387         # src/runtime/Config.foo-linux too.
388         case "$sbcl_arch" in
389             mips)
390                 printf ' :largefile' >> $ltf
391                 ;;
392             x86 | x86-64)
393                 printf ' :sb-thread :sb-futex :largefile' >> $ltf
394                 ;;
395             ppc)
396                 printf ' :sb-futex' >> $ltf
397                 ;;
398         esac
399
400         if [ $sbcl_arch = "x86-64" ]; then
401             link_or_copy Config.x86_64-linux Config
402         else
403             link_or_copy Config.$sbcl_arch-linux Config
404         fi
405         link_or_copy $sbcl_arch-linux-os.h target-arch-os.h
406         link_or_copy linux-os.h target-os.h
407         ;;
408     osf1)
409         printf ' :unix' >> $ltf
410         printf ' :elf' >> $ltf
411         printf ' :osf1' >> $ltf
412         link_or_copy Config.$sbcl_arch-osf1 Config
413         link_or_copy $sbcl_arch-osf1-os.h target-arch-os.h
414         link_or_copy osf1-os.h target-os.h
415         ;;
416     hpux)
417         printf ' :unix' >> $ltf
418         printf ' :elf' >> $ltf
419         printf ' :hpux' >> $ltf
420         link_or_copy Config.$sbcl_arch-hpux Config
421         link_or_copy $sbcl_arch-hpux-os.h target-arch-os.h
422         link_or_copy hpux-os.h target-os.h
423         ;;
424     *bsd)
425         printf ' :unix' >> $ltf
426         printf ' :bsd' >> $ltf
427         link_or_copy $sbcl_arch-bsd-os.h target-arch-os.h
428         link_or_copy bsd-os.h target-os.h
429         case "$sbcl_os" in
430             freebsd)
431                 printf ' :elf' >> $ltf
432                 printf ' :freebsd' >> $ltf
433                 printf ' :gcc-tls' >> $ltf
434                 if [ $sbcl_arch = "x86" ]; then
435                     printf ' :restore-tls-segment-register-from-context' >> $ltf
436                 fi
437                 link_or_copy Config.$sbcl_arch-freebsd Config
438                 ;;
439             openbsd)
440                 printf ' :elf' >> $ltf
441                 printf ' :openbsd' >> $ltf
442                 link_or_copy Config.$sbcl_arch-openbsd Config
443                 ;;
444             netbsd)
445                 printf ' :netbsd' >> $ltf
446                 printf ' :elf' >> $ltf
447                 link_or_copy Config.$sbcl_arch-netbsd Config
448                 ;;
449             *)
450                 echo unsupported BSD variant: `uname`
451                 exit 1
452                 ;;
453         esac
454         ;;
455     darwin)
456         printf ' :unix' >> $ltf
457         printf ' :mach-o' >> $ltf
458         printf ' :bsd' >> $ltf
459         printf ' :darwin' >> $ltf
460         if [ $sbcl_arch = "x86" ]; then
461             printf ' :mach-exception-handler :restore-fs-segment-register-from-tls :ud2-breakpoints' >> $ltf
462         fi
463         if [ $sbcl_arch = "x86-64" ]; then
464             printf ' :mach-exception-handler :ud2-breakpoints' >> $ltf
465         fi
466         link_or_copy $sbcl_arch-darwin-os.h target-arch-os.h
467         link_or_copy bsd-os.h target-os.h
468         link_or_copy Config.$sbcl_arch-darwin Config
469         ;;
470     sunos)
471         printf ' :unix' >> $ltf
472         printf ' :elf' >> $ltf
473         printf ' :sunos' >> $ltf
474         if [ $sbcl_arch = "x86-64" ]; then
475             printf ' :largefile' >> $ltf
476         fi
477         link_or_copy Config.$sbcl_arch-sunos Config
478         link_or_copy $sbcl_arch-sunos-os.h target-arch-os.h
479         link_or_copy sunos-os.h target-os.h
480         ;;
481     win32)
482         printf ' :win32' >> $ltf
483         link_or_copy Config.$sbcl_arch-win32 Config
484         link_or_copy $sbcl_arch-win32-os.h target-arch-os.h
485         link_or_copy win32-os.h target-os.h
486         ;;
487     *)
488         echo unsupported OS type: `uname`
489         exit 1
490         ;;
491 esac
492 cd "$original_dir"
493
494 # FIXME: Things like :c-stack-grows-..., etc, should be
495 # *derived-target-features* or equivalent, so that there was a nicer
496 # way to specify them then sprinkling them in this file. They should
497 # still be tweakable by advanced users, though, but probably not
498 # appear in *features* of target. #!+/- should be adjusted to take
499 # them in account as well. At minimum the nicer specification stuff,
500 # though:
501 #
502 # (define-feature :dlopen (features)
503 #   (union '(:bsd :linux :darwin :sunos) features))
504 #
505 # (define-feature :c-stack-grows-downwards-not-upwards (features)
506 #   (member :x86 features))
507
508 # KLUDGE: currently the x86 only works with the generational garbage
509 # collector (indicated by the presence of :GENCGC in *FEATURES*) and
510 # alpha, sparc and ppc with the stop'n'copy collector (indicated by
511 # the absence of :GENCGC in *FEATURES*). This isn't a great
512 # separation, but for now, rather than have :GENCGC in
513 # base-target-features.lisp-expr, we add it into local-target-features
514 # if we're building for x86. -- CSR, 2002-02-21 Then we do something
515 # similar with :STACK-GROWS-FOOWARD, too. -- WHN 2002-03-03
516 if [ "$sbcl_arch" = "x86" ]; then
517     printf ' :gencgc :stack-grows-downward-not-upward :c-stack-is-control-stack' >> $ltf
518     printf ' :compare-and-swap-vops :unwind-to-frame-and-call-vop :raw-instance-init-vops' >> $ltf
519     printf ' :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
520     printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
521     printf ' :alien-callbacks :cycle-counter :inline-constants ' >> $ltf
522     printf ' :memory-barrier-vops :multiply-high-vops' >> $ltf
523     case "$sbcl_os" in
524     linux | freebsd | netbsd | openbsd | sunos | darwin | win32)
525         printf ' :linkage-table' >> $ltf
526     esac
527     if [ "$sbcl_os" = "win32" ]; then
528         # of course it doesn't provide dlopen, but there is
529         # roughly-equivalent magic nevertheless.
530         printf ' :os-provides-dlopen' >> $ltf
531     fi
532     if [ "$sbcl_os" = "openbsd" ]; then
533         rm -f src/runtime/openbsd-sigcontext.h
534         sh tools-for-build/openbsd-sigcontext.sh > src/runtime/openbsd-sigcontext.h
535     fi
536 elif [ "$sbcl_arch" = "x86-64" ]; then
537     printf ' :gencgc :stack-grows-downward-not-upward :c-stack-is-control-stack :linkage-table' >> $ltf
538     printf ' :compare-and-swap-vops :unwind-to-frame-and-call-vop :raw-instance-init-vops' >> $ltf
539     printf ' :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
540     printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
541     printf ' :alien-callbacks :cycle-counter :complex-float-vops' >> $ltf
542     printf ' :float-eql-vops :inline-constants :memory-barrier-vops' >> $ltf
543     printf ' :multiply-high-vops' >> $ltf
544 elif [ "$sbcl_arch" = "mips" ]; then
545     printf ' :linkage-table' >> $ltf
546     printf ' :stack-allocatable-closures :stack-allocatable-vectors' >> $ltf
547     printf ' :stack-allocatable-lists :stack-allocatable-fixed-objects' >> $ltf
548     printf ' :alien-callbacks' >> $ltf
549     # Use a little C program to try to guess the endianness.  Ware
550     # cross-compilers!
551     #
552     # FIXME: integrate to grovel-features, mayhaps
553     $GNUMAKE -C tools-for-build determine-endianness -I ../src/runtime
554     tools-for-build/determine-endianness >> $ltf
555 elif [ "$sbcl_arch" = "ppc" ]; then
556     printf ' :gencgc :stack-allocatable-closures :stack-allocatable-lists' >> $ltf
557     printf ' :linkage-table :raw-instance-init-vops :memory-barrier-vops' >> $ltf
558     printf ' :compare-and-swap-vops :multiply-high-vops' >> $ltf
559     if [ "$sbcl_os" = "linux" ]; then
560         # Use a C program to detect which kind of glibc we're building on,
561         # to bandage across the break in source compatibility between
562         # versions 2.3.1 and 2.3.2
563         #
564         # FIXME: integrate to grovel-features, mayhaps
565         $GNUMAKE -C tools-for-build where-is-mcontext -I ../src/runtime
566         tools-for-build/where-is-mcontext > src/runtime/ppc-linux-mcontext.h || (echo "error running where-is-mcontext"; exit 1)
567     elif [ "$sbcl_os" = "darwin" ]; then
568         # We provide a dlopen shim, so a little lie won't hurt
569         printf " :os-provides-dlopen :alien-callbacks" >> $ltf
570         # The default stack ulimit under darwin is too small to run PURIFY.
571         # Best we can do is complain and exit at this stage
572         if [ "`ulimit -s`" = "512" ]; then
573             echo "Your stack size limit is too small to build SBCL."
574             echo "See the limit(1) or ulimit(1) commands and the README file."
575             exit 1
576         fi
577     fi
578 elif [ "$sbcl_arch" = "sparc" ]; then
579     # Test the compiler in order to see if we are building on Sun
580     # toolchain as opposed to GNU binutils, and write the appropriate
581     # FUNCDEF macro for assembler. No harm in running this on sparc-linux
582     # as well.
583     sh tools-for-build/sparc-funcdef.sh > src/runtime/sparc-funcdef.h
584     if [ "$sbcl_os" = "sunos" ] || [ "$sbcl_os" = "linux" ]; then
585         printf ' :linkage-table' >> $ltf
586     fi
587     printf ' :stack-allocatable-closures :stack-allocatable-lists' >> $ltf
588 elif [ "$sbcl_arch" = "alpha" ]; then
589     printf ' :stack-allocatable-closures :stack-allocatable-lists' >> $ltf
590 elif [ "$sbcl_arch" = "hppa" ]; then
591     printf ' :stack-allocatable-vectors :stack-allocatable-fixed-objects' >> $ltf
592     printf ' :stack-allocatable-lists' >> $ltf
593 else
594     # Nothing need be done in this case, but sh syntax wants a placeholder.
595     echo > /dev/null
596 fi
597
598 export sbcl_os sbcl_arch
599 sh tools-for-build/grovel-features.sh >> $ltf
600
601 echo //finishing $ltf
602 echo ')))' >> $ltf
603
604 # FIXME: The version system should probably be redone along these lines:
605 #
606 # echo //setting up version information.
607 # versionfile=version.txt
608 # cp base-version.txt $versionfile
609 # echo " (built `date -u` by `whoami`@`hostname`)" >> $versionfile
610 # echo 'This is a machine-generated file and should not be edited by hand.' >> $versionfile
611
612 # Make a unique ID for this build (to discourage people from
613 # mismatching sbcl and *.core files).
614 if [ `uname` = "SunOS" ] ; then
615   # use /usr/xpg4/bin/id instead of /usr/bin/id
616   PATH=/usr/xpg4/bin:$PATH
617 fi
618 echo '"'`hostname`-`id -un`-`date +%Y-%m-%d-%H-%M-%S`'"' > output/build-id.tmp