New variables c:*user-ld-flags* and c:*user-cc-flags*

This commit is contained in:
Juan Jose Garcia Ripoll 2010-02-03 22:14:07 +01:00
parent 6c77033ad6
commit 092ca8a165
3 changed files with 30 additions and 7 deletions

View file

@ -23,6 +23,8 @@
"*COMPILE-VERBOSE*"
"*CC*"
"*CC-OPTIMIZE*"
"*USER-CC-FLAGS*"
"*USER-LD-FLAGS*"
"BUILD-ECL"
"BUILD-PROGRAM"
"BUILD-FASL"
@ -453,11 +455,11 @@ coprocessor).")
(defvar *cc-optimize* #-msvc "-O"
#+msvc "@CFLAGS_OPTIMIZE@")
(defvar *ld-format* #-msvc "~A -o ~S -L~S ~{~S ~} ~@[~S~] ~A"
#+msvc "~A -Fe~S~* ~{~S ~} ~@[~S~] ~A")
(defvar *ld-format* #-msvc "~A -o ~S -L~S ~{~S ~} ~@[~S~]~{ '~A'~} ~A"
#+msvc "~A -Fe~S~* ~{~S ~} ~@[~S~]~{ '~A'~} ~A")
(defvar *cc-format* #-msvc "~A \"-I~A\" ~A ~:[~*~;~A~] -w -c \"~A\" -o \"~A\""
#+msvc "~A -I\"~A\" ~A ~:[~*~;~A~] -w -c \"~A\" -Fo\"~A\"")
(defvar *cc-format* #-msvc "~A \"-I~A\" ~A ~:[~*~;~A~] -w -c \"~A\" -o \"~A\"~{ '~A'~}"
#+msvc "~A -I\"~A\" ~A ~:[~*~;~A~] -w -c \"~A\" -Fo\"~A\"~{ '~A'~}")
#-dlopen
(defvar *ld-flags* "@LDFLAGS@ -lecl @CORE_LIBS@ @FASL_LIBS@ @LIBS@")
@ -471,6 +473,16 @@ coprocessor).")
(defvar *ld-bundle-flags* #-msvc "@BUNDLE_LDFLAGS@ @LDFLAGS@ -lecl @FASL_LIBS@ @LIBS@"
#+msvc "@BUNDLE_LDFLAGS@ @LDFLAGS@ ecl.lib @CLIBS@")
(defvar *user-ld-flags* '()
"Flags and options to be passed to the linker when building FASL, shared libraries
and standalone programs. It is not required to surround values with quotes or use
slashes before special characters.")
(defvar *user-cc-flags* '()
"Flags and options to be passed to the C compiler when building FASL, shared libraries
and standalone programs. It is not required to surround values with quotes or use
slashes before special characters.")
(defvar +shared-library-prefix+ "@SHAREDPREFIX@")
(defvar +shared-library-extension+ "@SHAREDEXT@")
(defvar +shared-library-format+ "@SHAREDPREFIX@~a.@SHAREDEXT@")

View file

@ -116,6 +116,7 @@ the environment variable TMPDIR to a different value." template)))
(fix-for-mingw (ecl-library-directory))
options
*ld-rpath*
*user-ld-flags*
*ld-flags*))
#+msvc
(embed-manifest-file o-pathname :program)
@ -146,6 +147,7 @@ the environment variable TMPDIR to a different value." template)))
(fix-for-mingw (ecl-library-directory))
options
*ld-rpath*
*user-ld-flags*
(dll-extra-flags o-pathname)))
#+msvc
(embed-manifest-file o-pathname :dll)
@ -155,11 +157,12 @@ the environment variable TMPDIR to a different value." template)))
(let ((lib-file (compile-file-pathname o-pathname :type :lib)))
(safe-system
(format nil
"gcc -shared -o ~S -L~S ~{~S ~} ~@[~S~] ~@?"
"gcc -shared -o ~S -L~S ~{~S ~} ~@[~S~]~{ '~A'~} ~@?"
(si::coerce-to-filename o-pathname)
(fix-for-mingw (ecl-library-directory))
options
*ld-rpath*
*user-ld-flags*
*ld-shared-flags*))))
#+dlopen
@ -188,6 +191,7 @@ the environment variable TMPDIR to a different value." template)))
(fix-for-mingw (ecl-library-directory))
options
*ld-rpath*
*user-ld-flags*
(bundle-extra-flags init-name o-pathname)))
#+msvc
(embed-manifest-file o-pathname :fasl)
@ -196,11 +200,12 @@ the environment variable TMPDIR to a different value." template)))
#+(or mingw32)
(safe-system
(format nil
"gcc -shared -o ~S -Wl,--export-all-symbols -L~S ~{~S ~} ~@[~S~] ~A"
"gcc -shared -o ~S -Wl,--export-all-symbols -L~S ~{~S ~} ~@[~S~]~{ '~A'~} ~A"
(si::coerce-to-filename o-pathname)
(fix-for-mingw (ecl-library-directory))
options
*ld-rpath*
*user-ld-flags*
*ld-bundle-flags*)))
(defconstant +lisp-program-header+ "
@ -922,7 +927,8 @@ from the C language code. NIL means \"do not create the file\"."
(fix-for-mingw (ecl-include-directory))
*cc-flags* (>= (cmp-env-optimization 'speed) 2) *cc-optimize*
(si::coerce-to-filename c-pathname)
(si::coerce-to-filename o-pathname))
(si::coerce-to-filename o-pathname)
*user-cc-flags*)
; Since the SUN4 assembler loops with big files, you might want to use this:
; (format nil
; "~A ~@[~*-O1~] -S -I. -I~A -w ~A ; as -o ~A ~A"