... |
... |
@@ -32,7 +32,7 @@ do |
32
|
32
|
done
|
33
|
33
|
|
34
|
34
|
# Where the output should go.
|
35
|
|
-OUTPUT="src/code/errno.lisp"
|
|
35
|
+ERRNO_FILE="src/code/errno.lisp"
|
36
|
36
|
|
37
|
37
|
# Template file containing the default def-unix-error forms and other
|
38
|
38
|
# support code.
|
... |
... |
@@ -53,7 +53,7 @@ fi |
53
|
53
|
if [ -z "$ERRNO_FILES" ]; then
|
54
|
54
|
# Copy the main errno template to the output. The template is a lisp
|
55
|
55
|
# file so we can read and modify it more easily.
|
56
|
|
- cat "$TEMPLATE" > $OUTPUT
|
|
56
|
+ cat "$TEMPLATE" > $ERRNO_FILE
|
57
|
57
|
else
|
58
|
58
|
# We can autogenerate the def-unix-error forms. Copy just the
|
59
|
59
|
# initial part of the template, up to the first def-unix-error
|
... |
... |
@@ -73,10 +73,43 @@ EOF |
73
|
73
|
# The tail was also copied from code/unix.lisp. It's needed to tell
|
74
|
74
|
# Lisp about the errno values.
|
75
|
75
|
sed '1,/^;;; End of default/d' "$TEMPLATE"
|
76
|
|
- } > $OUTPUT
|
|
76
|
+ } > $ERRNO_FILE
|
77
|
77
|
fi
|
78
|
78
|
|
79
|
79
|
# If -S option given, cat the output file to stdout
|
80
|
80
|
if [ -n "$SHOW" ]; then
|
81
|
|
- cat $OUTPUT
|
|
81
|
+ cat $ERRNO_FILE
|
82
|
82
|
fi
|
|
83
|
+
|
|
84
|
+# Now generate the defpackage form for the ERRNO package.
|
|
85
|
+cat > src/code/exports-errno.lisp <<EOF
|
|
86
|
+;;; -*- Log: C.Log -*-
|
|
87
|
+;;;
|
|
88
|
+;;; **********************************************************************
|
|
89
|
+;;; This code was written as part of the CMU Common Lisp project at
|
|
90
|
+;;; Carnegie Mellon University, and has been placed in the public domain.
|
|
91
|
+;;;
|
|
92
|
+(ext:file-comment
|
|
93
|
+ ": src/code/exports-errno.lisp $")
|
|
94
|
+;;;
|
|
95
|
+;;; **********************************************************************
|
|
96
|
+;;;
|
|
97
|
+;;; All the stuff necessary to export various symbols from various packages.
|
|
98
|
+;;;
|
|
99
|
+
|
|
100
|
+(in-package "LISP")
|
|
101
|
+
|
|
102
|
+(intl:textdomain "cmucl")
|
|
103
|
+
|
|
104
|
+(if (find-package "ERRNO")
|
|
105
|
+ (rename-package "ERRNO" "ERRNO" 'nil)
|
|
106
|
+ (make-package "ERRNO" :nicknames 'nil :use nil))
|
|
107
|
+
|
|
108
|
+(defpackage "ERRNO"
|
|
109
|
+ (:export
|
|
110
|
+$(grep '(def-unix-error ' $ERRNO_FILE |
|
|
111
|
+ cut -d ' ' -f2 |
|
|
112
|
+ sed 's/\(.*\)/ "\1"/' |
|
|
113
|
+ sort)
|
|
114
|
+ ))
|
|
115
|
+EOF |