~ chicken-core (chicken-5) 8eeff766ba4d2b3d437a49fd5f1b6f2ad9e4dbe8
commit 8eeff766ba4d2b3d437a49fd5f1b6f2ad9e4dbe8 Author: felix <felix@call-with-current-continuation.org> AuthorDate: Sun May 2 02:06:44 2010 +0200 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Sun May 2 02:06:44 2010 +0200 cross-build fixes diff --git a/Makefile.cygwin b/Makefile.cygwin index 39a9c287..af871af5 100644 --- a/Makefile.cygwin +++ b/Makefile.cygwin @@ -203,9 +203,6 @@ chicken-defaults.h: echo "#ifndef C_CROSS_CHICKEN" >>$@ echo "# define C_CROSS_CHICKEN $(CROSS_CHICKEN)" >>$@ echo "#endif" >>$@ - echo "#ifndef C_TARGET_DESTDIR" >>$@ - echo "# define C_TARGET_DESTDIR \"$(TARGET_DESTDIR)\"" >>$@ - echo "#endif" >>$@ echo "#ifndef C_TARGET_PREFIX" >>$@ echo "# define C_TARGET_PREFIX \"$(TARGET_PREFIX)\"" >>$@ echo "#endif" >>$@ diff --git a/Makefile.mingw b/Makefile.mingw index 53bb5811..c2a48a6a 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -214,9 +214,6 @@ endif echo #ifndef C_TARGET_PREFIX >>$@ echo # define C_TARGET_PREFIX "$(TARGET_PREFIX)" >>$@ echo #endif >>$@ - echo #ifndef C_TARGET_DESTDIR >>$@ - echo # define C_TARGET_DESTDIR "$(TARGET_DESTDIR)" >>$@ - echo #endif >>$@ echo #ifndef C_TARGET_BIN_HOME >>$@ echo # define C_TARGET_BIN_HOME "$(TARGET_PREFIX)/bin" >>$@ echo #endif >>$@ diff --git a/chicken-install.scm b/chicken-install.scm index 8995a724..1ad5f52b 100644 --- a/chicken-install.scm +++ b/chicken-install.scm @@ -87,16 +87,13 @@ (define *trunk* #f) (define *csc-features* '()) (define *prefix* #f) - (define *target-destdir* (foreign-value "C_TARGET_DESTDIR" c-string)) (define (get-prefix) (cond ((and (feature? #:cross-chicken) (not *host-extension*)) - *prefix*) - ((and *target-destdir* - (not (string=? *target-destdir* ""))) - *target-destdir*) - (else #f))) + (or *prefix* + (foreign-value "C_TARGET_PREFIX" c-string))) + (else *prefix*))) (define-constant +module-db+ "modules.db") (define-constant +defaults-file+ "setup.defaults") @@ -374,7 +371,7 @@ (let ((prefix (get-prefix))) (if prefix (sprintf " -e \"(destination-prefix \\\"~a\\\")\"" - (normalize-pathname *prefix* 'unix)) + (normalize-pathname prefix 'unix)) "")) (sprintf " -e \"(extra-features '~s)\"" *csc-features*) (if *deploy* " -e \"(deployment-mode #t)\"" "") diff --git a/config.make b/config.make index f1ad8fb9..04d7cf1a 100644 --- a/config.make +++ b/config.make @@ -45,7 +45,7 @@ #TARGETSYSTEM= # Where the install-location of a cross-build is -#TARGET_DESTDIR= +#TARGET_PREFIX= # Specify that the sources are in a different directory than ".": #SRCDIR= diff --git a/csc.scm b/csc.scm index 685efcfe..f5edc063 100644 --- a/csc.scm +++ b/csc.scm @@ -54,7 +54,6 @@ (define-foreign-variable TARGET_INCLUDE_HOME c-string "C_TARGET_INCLUDE_HOME") (define-foreign-variable TARGET_STATIC_LIB_HOME c-string "C_TARGET_STATIC_LIB_HOME") (define-foreign-variable TARGET_RUN_LIB_HOME c-string "C_TARGET_RUN_LIB_HOME") -(define-foreign-variable TARGET_DESTDIR c-string "C_TARGET_DESTDIR") (define-foreign-variable CHICKEN_PROGRAM c-string "C_CHICKEN_PROGRAM") (define-foreign-variable CSC_PROGRAM c-string "C_CSC_PROGRAM") (define-foreign-variable WINDOWS_SHELL bool "C_WINDOWS_SHELL") @@ -925,10 +924,11 @@ EOF TARGET_RUN_LIB_HOME)))) (define (target-lib-path) - (let ((tdir TARGET_DESTDIR)) + (let ((tdir TARGET_LIB_HOME)) (if (and (not (string=? tdir "")) - (or (not cross-chicken) host-mode)) - (make-pathname tdir "lib") + cross-chicken + (not host-mode)) + tdir (lib-path)))) (define (copy-libraries targetdir) diff --git a/defaults.make b/defaults.make index 264f1ca0..a1da1852 100644 --- a/defaults.make +++ b/defaults.make @@ -41,7 +41,7 @@ endif SEP ?= / SRCDIR ?= .$(SEP) -DESTDIR ?= $(TARGET_DESTDIR) +DESTDIR ?= PREFIX ?= /usr/local BRANCHNAME ?= $(shell sh identify-branch.sh $(SRCDIR)) @@ -446,9 +446,6 @@ endif echo "#ifndef C_TARGET_PREFIX" >>$@ echo "# define C_TARGET_PREFIX \"$(TARGET_PREFIX)\"" >>$@ echo "#endif" >>$@ - echo "#ifndef C_TARGET_DESTDIR" >>$@ - echo "# define C_TARGET_DESTDIR \"$(TARGET_DESTDIR)\"" >>$@ - echo "#endif" >>$@ echo "#ifndef C_TARGET_BIN_HOME" >>$@ echo "# define C_TARGET_BIN_HOME \"$(TARGET_PREFIX)/bin\"" >>$@ echo "#endif" >>$@Trap