From a7cc133f058fc75c9fdc4e42a9d430ea2d430ba6 Mon Sep 17 00:00:00 2001 From: jgarcia Date: Sun, 3 Jun 2007 13:43:44 +0000 Subject: [PATCH] Remove trailing slashes in directories to keep MINGW's compiler happy --- src/CHANGELOG | 3 +++ src/cmp/cmpmain.lsp | 29 +++++++++++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/src/CHANGELOG b/src/CHANGELOG index 1a08421e1..929786a9e 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -58,6 +58,9 @@ ECL 1.0: * Bugs fixed: + - MINGW's compiler is broken: it does not accept directories with trailing + slashes as an argument to "-I". We include a hack in cmpmain.lsp for that. + - STREAMP signals an error for Gray streams. - ENOUGH-NAMESTRING provided too large directory names (Contributed by Tim S) diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index 39b757a1b..bd26b3837 100644 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -62,9 +62,18 @@ *ld-format* *cc* (si::coerce-to-filename o-pathname) - (ecl-library-directory) + (fix-for-mingw (ecl-library-directory)) options - *ld-flags* (ecl-library-directory)))) + *ld-flags* (fix-for-mingw (ecl-library-directory))))) + +#-mingw32 +(defmacro fix-for-mingw (directory-namestring) + directory-namestring) + +#+minwg32 +(defun fix-for-mingw (directory-namestring) + (let ((x (string-right-trim '(#\\ #/) directory-namestring))) + (if (zerop (length x)) "/" x))) #+dlopen (defun shared-cc (o-pathname &rest options) @@ -74,19 +83,19 @@ *ld-format* *cc* (si::coerce-to-filename o-pathname) - (ecl-library-directory) + (fix-for-mingw (ecl-library-directory)) options - *ld-shared-flags* (ecl-library-directory))) + *ld-shared-flags* (fix-for-mingw (ecl-library-directory)))) #+(or mingw32) (let ((lib-file (compile-file-pathname o-pathname :type :lib))) (safe-system (format nil "dllwrap --export-all-symbols -o ~S -L~S ~{~S ~} ~@?" (si::coerce-to-filename o-pathname) - (ecl-library-directory) + (fix-for-mingw (ecl-library-directory)) options *ld-shared-flags* - (ecl-library-directory))))) + (fix-for-mingw (ecl-library-directory)))))) #+dlopen (defun bundle-cc (o-pathname init-name &rest options) @@ -96,7 +105,7 @@ *ld-format* *cc* (si::coerce-to-filename o-pathname) - (ecl-library-directory) + (fix-for-mingw (ecl-library-directory)) options #-msvc *ld-bundle-flags* #+msvc (concatenate 'string *ld-bundle-flags* " /EXPORT:" @@ -107,10 +116,10 @@ (format nil "dllwrap -o ~A --export-all-symbols -L~S ~{~S ~} ~@?" (si::coerce-to-filename o-pathname) - (ecl-library-directory) + (fix-for-mingw (ecl-library-directory)) options *ld-bundle-flags* - (ecl-library-directory)))) + (fix-for-mingw (ecl-library-directory))))) (defconstant +lisp-program-header+ " #include @@ -846,7 +855,7 @@ Cannot compile ~a." (format nil *cc-format* *cc* *cc-flags* (>= *speed* 2) *cc-optimize* - (ecl-include-directory) + (fix-for-mingw (ecl-include-directory)) (si::coerce-to-filename c-pathname) (si::coerce-to-filename o-pathname)) ; Since the SUN4 assembler loops with big files, you might want to use this: