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.
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
(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)))
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)
(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)))
#+cmu (ext:load-foreign filename)
#+sbcl (sb-alien:load-1-foreign filename))))
-
(defsystem sb-posix
:depends-on (sb-grovel)
#+sb-building-contrib :pathname
# 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
;;; 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"