-;;; code partially ported from CMU CL to SBCL, but needs RUN-PROGRAM
-#|
-(defun load-foreign (files &key
- (libraries '("-lc"))
- (base-file nil)
- ;; Note: Since SBCL has no *ENVIRONMENT-LIST*
- ;; variable, if this code is ever restored,
- ;; the default should be taken from the alien
- ;; "environ" variable.
- ,, ; do it!
- (env sb-ext:*environment-list*))
+;;; Dan Barlow's quick summary from IRC 2003-06-21:
+;;; fwiw, load-foreign does random stuff with ld so that you can use
+;;; it with static libraries
+;;; if you have shared objects, load-1-foreign will do fine
+;;; and
+;;; I think my position on this matter is consistent with Tim Moore's:
+;;; use (cmucl equivalent of) load-1-foreign, load-foreign is arse
+;;; though he may say ass
+(defun load-foreign (files
+ &key
+ (libraries '("-lc"))
+ ;; FIXME: The old documentation said
+ ;; The BASE-FILE argument is used to specify a
+ ;; file to use as the starting place for
+ ;; defined symbols. The default is the C start
+ ;; up code for Lisp.
+ ;; But the code ignored the BASE-FILE argument.
+ ;; The comment above
+ ;; (DECLARE (IGNORE BASE-FILE))
+ ;; said
+ ;; dlopen() remembers the name of an object,
+ ;; when dlopen()ing the same name twice, the
+ ;; old object is reused.
+ ;; So I deleted all reference to BASE-FILE,
+ ;; including the now-bogus reference to the
+ ;; BASE-FILE argument in the documentation. But
+ ;; are there any other subtleties of the new code
+ ;; which need to be documented in its place?
+ (env nil env-p)
+ (environment (if env-p
+ (unix-environment-sbcl-from-cmu env)
+ (posix-environ))
+ environment-p))