0.8.6.14:
authorChristophe Rhodes <csr21@cam.ac.uk>
Sat, 29 Nov 2003 20:41:47 +0000 (20:41 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Sat, 29 Nov 2003 20:41:47 +0000 (20:41 +0000)
Ouch.  That was hard work.
... contrib fix primarily for SunOS but also I think for Darwin;
at least, if it was working it was only by accident.
... uname -m never returns either "solaris" or "darwin", so that
code was wrong to start with;
... change the protocol so that we do EXTRA_CFLAGS rather than
a complete override; now we don't need the solaris or
darwin clauses in asdf-module.mk that weren't being used
anyway;
... delete more stuff in make-target-contrib.sh so that we can
actually see the effect of these changes rather than
blindly reusing an old alien.so (which explains why I
hadn't noticed this before, *sigh*; I ran a completely
clean build on Solaris for the first time in months
yesterday)
... now sb-bsd-sockets and dependents work again.  I hope I haven't
broken x86-64 in the process.

contrib/asdf-module.mk
contrib/sb-bsd-sockets/sb-bsd-sockets.asd
contrib/sb-grovel/def-to-lisp.lisp
contrib/sb-posix/sb-posix.asd
make-target-contrib.sh
version.lisp-expr

index c646b9d..8087ab9 100644 (file)
@@ -1,29 +1,19 @@
 CC=gcc
 
-# Need to set CFLAGS and LDFLAGS here. sb-posix, sb-grovel, and
-# sb-bsd-sockets depends upon these being set on x86_64. Setting these
-# in their Makefile's is not adequate since their asd files are
-# invoked when loaded from other modules which don't require these
-# environmental values in their Makefile's.
+# We need to extend flags to the C compiler and the linker
+# here. sb-posix, sb-grovel, and sb-bsd-sockets depends upon these
+# being set on x86_64. Setting these in their Makefiles is not
+# adequate since, while we're building contrib, they can be compiled
+# directly via ASDF from a non-C-aware module which has these tricky
+# ones as dependencies.
 
 UNAME:=$(shell uname -m)
-export CFLAGS=-fPIC
-ifeq (solaris,$(UNAME))
-  export LDFLAGS=-shared -lresolv -lsocket -lnsl
-else
-  ifeq (Darwin,$(UNAME))
-    export LDFLAGS=-bundle
-  else
-    ifeq (x86_64,$(UNAME))
-      export LDFLAGS=-m32 -shared
-      export CFLAGS+= -m32
-    else
-      export LDFLAGS=-shared
-    endif
-  endif
+ifeq (x86_64,$(UNAME))
+    export EXTRA_LDFLAGS=-m32 -shared
+    export EXTRA_CFLAGS+=-m32
 endif
 
-export CC SBCL CFLAGS LDFLAGS
+export CC SBCL EXTRA_CFLAGS EXTRA_LDFLAGS
 
 all: $(EXTRA_ALL_TARGETS)
        $(MAKE) -C ../asdf
index 6056a5a..fd251d6 100644 (file)
     (unless (zerop
             (run-shell-command
              "gcc ~A -o ~S ~{~S ~}"
-             (if (sb-ext:posix-getenv "LDFLAGS")
-                 (sb-ext:posix-getenv "LDFLAGS")
-               #+sunos "-shared -lresolv -lsocket -lnsl"
-               #+darwin "-bundle"
-               #-(or darwin sunos) "-shared")
+             (concatenate 'string
+                          (sb-ext:posix-getenv "EXTRA_LDFLAGS")
+                          " "
+                          #+sunos "-shared -lresolv -lsocket -lnsl"
+                          #+darwin "-bundle"
+                          #-(or darwin sunos) "-shared")
              dso-name
              (mapcar #'unix-name
                      (mapcan (lambda (c)
 (defmethod perform ((op compile-op) (c c-source-file))
   (unless
       (= 0 (run-shell-command "gcc ~A -o ~S -c ~S"
-                             (if (sb-ext:posix-getenv "CFLAGS")
-                                 (sb-ext:posix-getenv "CFLAGS")
-                               "-fPIC")
+                             (concatenate 'string
+                                          (sb-ext:posix-getenv "EXTRA_CFLAGS")
+                                          " "
+                                          "-fPIC")
                              (unix-name (car (output-files op c)))
                              (unix-name (component-pathname c))))
     (error 'operation-error :operation op :component c)))
index 88e4bae..b16560b 100644 (file)
@@ -105,8 +105,8 @@ printf(\"(in-package ~S)\\\n\");~%" package-name)
             filename tmp-c-source (constants-package component))
     (and               
      (= (run-shell-command "gcc ~A -o ~S ~S"
-                          (if (sb-ext:posix-getenv "CFLAGS")
-                              (sb-ext:posix-getenv "CFLAGS")
+                          (if (sb-ext:posix-getenv "EXTRA_CFLAGS")
+                              (sb-ext:posix-getenv "EXTRA_CFLAGS")
                                "")
                           (namestring tmp-a-dot-out)
                           (namestring tmp-c-source)) 0)
index 3fd109a..b2a87ab 100644 (file)
     (unless (zerop
             (run-shell-command
              "gcc ~A -o ~S ~{~S ~}"
-             (if (sb-ext:posix-getenv "LDFLAGS")
-                 (sb-ext:posix-getenv "LDFLAGS")
-               #+sunos "-shared -lresolv -lsocket -lnsl"
-               #+darwin "-bundle"
-               #-(or darwin sunos) "-shared")
+             (concatenate 'string
+                          (sb-ext:posix-getenv "EXTRA_LDFLAGS")
+                          " "
+                          #+sunos "-shared -lresolv -lsocket -lnsl"
+                          #+darwin "-bundle"
+                          #-(or darwin sunos) "-shared")
              dso-name
              (mapcar #'unix-name
                      (mapcan (lambda (c)
 (defmethod perform ((op compile-op) (c c-source-file))
   (unless
       (= 0 (run-shell-command "gcc ~A -o ~S -c ~S"
-                             (if (sb-ext:posix-getenv "CFLAGS")
-                                 (sb-ext:posix-getenv "CFLAGS")
-                               "-fPIC")
+                             (concatenate
+                              'string
+                              (sb-ext:posix-getenv "EXTRA_CFLAGS")
+                              " "
+                              "-fPIC")
                              (unix-name (car (output-files op c)))
                              (unix-name (component-pathname c))))
     (error 'operation-error :operation op :component c)))
@@ -70,7 +73,6 @@
       #+cmu (ext:load-foreign filename)
       #+sbcl (sb-alien:load-1-foreign filename))))
 
-
 (defsystem sb-posix
     :depends-on (sb-grovel)
     #+sb-building-contrib :pathname
index 2af8c5f..d541ea9 100644 (file)
@@ -30,7 +30,7 @@ export SBCL SBCL_BUILDING_CONTRIB
 # as SB-RT and SB-GROVEL, but FIXME: there's probably a better
 # solution.  -- CSR, 2003-05-30
 
-find contrib/ \( -name '*.fasl' -o -name 'foo.c' -o -name 'a.out' \) \
+find contrib/ \( -name '*.fasl' -o -name 'foo.c' -o -name 'a.out' -o -name 'alien.so' -o -name '*.o' \) \
   -print | xargs rm -f
 
 mkdir -p contrib/systems
index 4081e2c..051ada2 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.6.13"
+"0.8.6.14"