Raymond Toy pushed to branch issue-386-generate-def-unix-error at cmucl / cmucl

Commits:

3 changed files:

Changes:

  • bin/build.sh
    ... ... @@ -157,14 +157,8 @@ buildit ()
    157 157
         fi
    
    158 158
     }
    
    159 159
     
    
    160
    -# Create src/code/errno.lisp by reading the errno definitions from the
    
    161
    -# header files.
    
    162
    -case `uname -s` in
    
    163
    -    Linux) ERRNO_FILES=/usr/include/asm-generic/errno*.h
    
    164
    -	   ;;
    
    165
    -esac
    
    166
    -
    
    167
    -bin/create-errno.sh ${ERRNO_FILES} > src/code/errno.lisp
    
    160
    +# Create the errno file containing all the def-unix-error forms.
    
    161
    +bin/create-errno.sh
    
    168 162
     
    
    169 163
     BUILDWORLD="$TOOLDIR/build-world.sh"
    
    170 164
     BUILD_POT="yes"
    

  • bin/create-errno.sh
    ... ... @@ -5,11 +5,14 @@
    5 5
     # definitions of all the Unix errno values.
    
    6 6
     #
    
    7 7
     
    
    8
    +# Where the output should go.
    
    9
    +OUTPUT="src/code/errno.lisp"
    
    10
    +
    
    8 11
     # The header was copied from code/unix.lisp.  This includes all the
    
    9 12
     # support code for DEF-UNIX-ERROR and for all OSes that don't use the
    
    10 13
     # awk script to create the DEF-UNIX-ERROR forms.
    
    11 14
     #
    
    12
    -cat <<EOF
    
    15
    +cat > $OUTPUT <<EOF
    
    13 16
     ;;; -*- Package: ERRNO -*-
    
    14 17
     ;;;
    
    15 18
     ;;; **********************************************************************
    
    ... ... @@ -51,7 +54,11 @@ cat <<EOF
    51 54
            (declaim (simple-vector *unix-errors*)))))
    
    52 55
     
    
    53 56
     ) ;eval-when
    
    57
    +EOF
    
    54 58
     
    
    59
    +# Output the default def-unix-error forms for the OSes where we don't
    
    60
    +# grovel the include files to get the errno definitions.
    
    61
    +cat >> $OUTPUT <<EOF
    
    55 62
     ;;; 
    
    56 63
     ;;; From <errno.h>
    
    57 64
     ;;; 
    
    ... ... @@ -249,13 +256,20 @@ EOF
    249 256
     
    
    250 257
     # Create appropriate DEF-UNIX-ERROR forms by reading header files
    
    251 258
     # containing the C definitions.
    
    259
    +
    
    260
    +# Set ERRNO_FILES to the files where we can find errno definitions.
    
    261
    +case `uname -s` in
    
    262
    +    Linux) ERRNO_FILES=/usr/include/asm-generic/errno*.h
    
    263
    +	   ;;
    
    264
    +esac
    
    265
    +
    
    252 266
     awk '/^#define[ \t]+(E[A-Z0-9]+)[ \t]+([A-Z0-9]+).*$/ {
    
    253 267
         printf "(def-unix-error %s %s)\n", $2, $3;
    
    254
    -}' "$@"
    
    268
    +}' "$@" ${ERRNO_FILES} >> $OUTPUT
    
    255 269
     
    
    256 270
     # The tail was also copied from code/unix.lisp.  It's needed to tell
    
    257 271
     # Lisp about the errno values.
    
    258
    -cat <<EOF
    
    272
    +cat >>$OUTPUT <<EOF
    
    259 273
     ;;; End auto-generated forms, if any.
    
    260 274
     
    
    261 275
     ;;;
    

  • bin/cross-build-world.sh
    ... ... @@ -84,13 +84,8 @@ then
    84 84
     		sed "s:^src:$CROSS:g" | xargs mkdir
    
    85 85
     fi
    
    86 86
     
    
    87
    -# Create unix-errno.lisp
    
    88
    -case `uname -s` in
    
    89
    -    Linux) ERRNO_FILES=/usr/include/asm-generic/errno*.h
    
    90
    -	   ;;
    
    91
    -esac
    
    92
    -
    
    93
    -bin/create-errno.sh ${ERRNO_FILES} > src/code/errno.lisp
    
    87
    +# Create the errno file containing all the def-unix-error forms.
    
    88
    +bin/create-errno.sh
    
    94 89
     
    
    95 90
     echo cross boot = $CROSSBOOT
    
    96 91
     $LISP "$@" -noinit -nositeinit <<EOF