From 58f1ef6e100afbb38cd8fed65ff12b7c1f500993 Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Tue, 22 Jun 2004 08:01:25 +0000 Subject: [PATCH] When invoking gcc, some of the pathnames might contain spaces. Enclose all pathnames in double-quotes to avoid problems. --- src/cmp/cmpcfg.lsp.in | 2 +- src/cmp/cmpmain.lsp | 12 +++++++----- src/compile.lsp.in | 9 +++++---- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/cmp/cmpcfg.lsp.in b/src/cmp/cmpcfg.lsp.in index 29b9af670..97c828280 100644 --- a/src/cmp/cmpcfg.lsp.in +++ b/src/cmp/cmpcfg.lsp.in @@ -6,7 +6,7 @@ (setq *cc* "@ECL_CC@") (setq *cc-flags* "@CFLAGS@ @ECL_CFLAGS@") (setq *ld-flags* "@LDRPATH@ @LDFLAGS@ -lecl -lgmp -lgc @CLIBS@") -(setq *ld-format* "~A -o ~A -L~A ~{~A ~} ~@?") +(setq *ld-format* "~S -o ~S -L~S ~{~S ~} ~@?") #+dlopen (setq *ld-shared-flags* "@LDRPATH@ @SHARED_LDFLAGS@ @LDFLAGS@ -lecl @CLIBS@") #+dlopen diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index bbb4724be..c041a70ea 100644 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -32,10 +32,9 @@ coprocessor).") (defvar *cc-flags* "-g -I.") (defvar *cc-optimize* "-O") ; C compiler otimization flag -(defvar *cc-format* "~A ~A ~:[~*~;~A~] -I~A/h -w -c ~A -o ~A")) -;(defvar *cc-format* "~A ~A ~:[~*~;~A~] -I~A/h -c ~A -o ~A")) +(defvar *cc-format* "\"~A\" ~A ~:[~*~;~A~] \"-I~A/h\" -w -c \"~A\" -o \"~A\"")) (defvar *ld-flags* "") -(defvar *ld-format* "~A -o ~A -L~A ~{~A ~} ~@?") +(defvar *ld-format* "~S -o ~S -L~S ~{~S ~} ~@?") #+dlopen (defvar *ld-shared-flags* "") #+dlopen @@ -282,6 +281,7 @@ cl_object Cblock; shared-data-file submodules epilogue-code) (close c-file) (si:system (format nil "cat ~A" (namestring c-name))) + (print o-name) (compiler-cc c-name o-name) (apply #'bundle-cc output-name o-name ld-flags))) (delete-file c-name) @@ -418,7 +418,8 @@ Cannot compile ~a." (format t "~&;;; Calling the C compiler... ")) (compiler-cc c-pathname o-pathname) #+dlopen - (unless system-p (bundle-cc so-pathname o-pathname)) + (unless system-p (bundle-cc (si::coerce-to-filename so-pathname) + (si::coerce-to-filename o-pathname))) (cond #+dlopen ((and (not system-p) (probe-file so-pathname)) (when load (load so-pathname)) @@ -539,7 +540,8 @@ Cannot compile ~a." (format t "~&;;; Calling the C compiler... ")) ;;(si::system (format nil "cat ~A" (namestring c-pathname))) (compiler-cc c-pathname o-pathname) - (bundle-cc so-pathname o-pathname) + (bundle-cc (si::coerce-to-filename so-pathname) + (si::coerce-to-filename o-pathname)) (delete-file c-pathname) (delete-file h-pathname) (delete-file o-pathname) diff --git a/src/compile.lsp.in b/src/compile.lsp.in index 4738e0b89..9cf44d115 100644 --- a/src/compile.lsp.in +++ b/src/compile.lsp.in @@ -36,11 +36,11 @@ ;;; with an already installed copy of ECL. ;;; (setq c::*cc-flags* - "@CFLAGS@ @ECL_CFLAGS@ -I@true_srcdir@/h -I@true_srcdir@/gmp -I@true_builddir@/h" + "@CFLAGS@ @ECL_CFLAGS@ -I\"@true_srcdir@\"/h -I\"@true_srcdir@\"/gmp -I\"@true_builddir@\"/h" c::*cc-format* - "~A ~A ~:[~*~;~A~] -I@true_builddir@/h~* -w -c ~A -o ~A" + "~S ~A ~:[~*~;~A~] -I\"@true_builddir@\"/h~* -w -c ~S -o ~S" c::*ld-format* - "~A -o ~A -L@true_builddir@~* ~{~A ~} ~@?") + "~S -o ~S -L\"@true_builddir@\"~* ~{~S ~} ~@?") #-dlopen (setf c::*ld-flags* "@LDFLAGS@ @LDRPATH@ @LIBPREFIX@ecl.@LIBEXT@ -lgmp @GCLIB@ @CLIBS@") @@ -89,7 +89,8 @@ ranlib ../@LIBPREFIX@ecl.@LIBEXT@") "c/main.@OBJEXT@" "@LIBPREFIX@lsp.@LIBEXT@" "@LIBPREFIX@eclmin.@LIBEXT@" - "-lgmp @GCLIB@" + "-lgmp" + "@GCLIB@" . #.(unless (equalp "@LDINSTALLNAME@" "") '("@LDINSTALLNAME@"))))