Changeset 12932 in project for chicken


Ignore:
Timestamp:
01/03/09 02:53:14 (11 years ago)
Author:
felix winkelmann
Message:

attempts at fixing mingw build; probably everything broken now

Location:
chicken/trunk
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/Makefile.mingw

    r12021 r12932  
    2626
    2727
    28 SRCDIR = .\\
     28SEP = \\
     29SRCDIR =.$(SEP)
    2930
    3031# platform configuration
     
    3435HACKED_APPLY = 1
    3536WINDOWS = 1
    36 NO_UNIX_SHELL = 1
     37WINDOWS_SHELL = 1
    3738
    3839# file extensions
     
    8081all: libchicken$(A) libuchicken$(A) chicken$(EXE) csi$(EXE) chicken-profile$(EXE) \
    8182        csc$(EXE) libchicken$(SO) \
    82         libuchicken$(SO) libchickengui$(SO) libchickengui$(A) chicken-setup$(EXE) \
    83         chicken.info
     83        libuchicken$(SO) libchickengui$(SO) libchickengui$(A) chicken-install$(EXE) \
     84        chicken-status$(EXE) chicken-uninstall$(EXE) chicken.info
    8485
    8586chicken-config.h: chicken-defaults.h
     
    140141        echo #endif >>$@
    141142        echo #ifndef C_INSTALL_SHARE_HOME >>$@
    142         echo # define C_INSTALL_SHARE_HOME "$(IDATADIR)" >>$@
     143        echo # define C_INSTALL_SHARE_HOME "$(DATADIR)" >>$@
    143144        echo #endif >>$@
    144145        echo #ifndef C_INSTALL_BIN_HOME >>$@
    145         echo # define C_INSTALL_BIN_HOME "$(IBINDIR)" >>$@
     146        echo # define C_INSTALL_BIN_HOME "$(BINDIR)" >>$@
    146147        echo #endif >>$@
    147148        echo #ifndef C_INSTALL_EGG_HOME >>$@
    148         echo # define C_INSTALL_EGG_HOME "$(IEGGDIR)" >>$@
     149        echo # define C_INSTALL_EGG_HOME "$(EGGDIR)" >>$@
    149150        echo #endif >>$@
    150151        echo #ifndef C_INSTALL_LIB_HOME >>$@
    151         echo # define C_INSTALL_LIB_HOME "$(ILIBDIR)" >>$@
     152        echo # define C_INSTALL_LIB_HOME "$(LIBDIR)" >>$@
    152153        echo #endif >>$@
    153154        echo #ifndef C_INSTALL_STATIC_LIB_HOME >>$@
    154         echo # define C_INSTALL_STATIC_LIB_HOME "$(ILIBDIR)" >>$@
     155        echo # define C_INSTALL_STATIC_LIB_HOME "$(LIBDIR)" >>$@
    155156        echo #endif >>$@
    156157        echo #ifndef C_INSTALL_INCLUDE_HOME >>$@
    157         echo # define C_INSTALL_INCLUDE_HOME "$(IINCDIR)" >>$@
     158        echo # define C_INSTALL_INCLUDE_HOME "$(INCDIR)" >>$@
    158159        echo #endif >>$@
    159160        echo #ifndef C_INSTALL_MORE_LIBS >>$@
     
    191192        echo #endif >>$@
    192193        echo #ifndef C_TARGET_LIB_HOME >>$@
    193         echo # define C_TARGET_LIB_HOME "$(TARGET_PREFIX)\\lib" >>$@
     194        echo # define C_TARGET_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
    194195        echo #endif >>$@
    195196        echo #ifndef C_TARGET_RUN_LIB_HOME >>$@
    196         echo # define C_TARGET_RUN_LIB_HOME "$(TARGET_PREFIX)\\lib" >>$@
     197        echo # define C_TARGET_RUN_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
    197198        echo #endif >>$@
    198199        echo #ifndef C_TARGET_SHARE_HOME >>$@
    199         echo # define C_TARGET_SHARE_HOME "$(TARGET_PREFIX)\\share" >>$@
     200        echo # define C_TARGET_SHARE_HOME "$(TARGET_PREFIX)/share" >>$@
    200201        echo #endif >>$@
    201202        echo #ifndef C_TARGET_INCLUDE_HOME >>$@
    202         echo # define C_TARGET_INCLUDE_HOME "$(TARGET_PREFIX)\\include" >>$@
     203        echo # define C_TARGET_INCLUDE_HOME "$(TARGET_PREFIX)/include" >>$@
    203204        echo #endif >>$@
    204205        echo #ifndef C_TARGET_STATIC_LIB_HOME >>$@
    205         echo # define C_TARGET_STATIC_LIB_HOME "$(TARGET_PREFIX)\\lib" >>$@
     206        echo # define C_TARGET_STATIC_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
    206207        echo #endif >>$@
    207208        echo #ifndef C_BINARY_VERSION >>$@
  • chicken/trunk/Makefile.mingw-msys

    r12021 r12932  
    1 # Makefile.mingw - configuration for MinGW (no MSYS) -*- Makefile -*-
     1# Makefile.mingw - configuration for MinGW (MSYS) -*- Makefile -*-
    22#
    33# Copyright (c) 2007, Felix L. Winkelmann
    4 # Copyright (c) 2008, The Chicken Team
     4# Copyright (c) 2008-2009, The Chicken Team
    55# All rights reserved.
    66#
  • chicken/trunk/Makefile.msvc

    r12819 r12932  
    22#
    33# Copyright (c) 2007, Felix L. Winkelmann
     4# Copyright (c) 2008-2009 The Chicken Team
    45# All rights reserved.
    56#
     
    3334# Germany
    3435
    35 PREFIX = c:\\msvc-devtools
    36 SRCDIR = .\\
     36SEP = \\
     37SRCDIR = .$(SEP)
    3738
    3839# platform configuration
     
    4243HACKED_APPLY =
    4344WINDOWS = 1
     45WINDOWS_SHELL = 1
    4446
    4547# file extensions
  • chicken/trunk/TODO

    r12929 r12932  
    2929    compile-/expansion-time), when import is #t and o import lib
    3030    exists.
    31 
    32 ** setup/install
    33 *** qs: automatically quote with #\" and replace #\/ with #\\ on windows?
    3431
    3532** build
     
    9996    .SECONDARY help?
    10097
     98** documentation
     99*** document qs, normalize-pathname
     100
    101101** "weak" gc roots (as suggested by Alejo)
    102102
  • chicken/trunk/chicken-install.scm

    r12922 r12932  
    171171    (define *eggs+dirs* '())
    172172    (define *checked* '())
     173    (define *csi* (shellpath (make-pathname *program-path* "csi")))
    173174
    174175    (define (try name version)
     
    273274           (parameterize ((current-directory (cdr e+d)))
    274275             (let ((cmd (sprintf
    275                          "~a/csi -bnq -e \"(require-library setup-api)\" -e \"(import setup-api)\" ~a ~a ~a ~a ~a ~a"
    276                          *program-path*
     276                         "~a -bnq -e \"(require-library setup-api)\" -e \"(import setup-api)\" ~a ~a ~a ~a ~a ~a"
     277                         *csi*
    277278                         (if (sudo-install) "-e \"(sudo-install #t)\"" "")
    278279                         (if *keep* "-e \"(keep-intermediates #t)\"" "")
     
    283284                             "")
    284285                         (make-pathname (cdr e+d) (car e+d) "setup"))))
    285                (system* cmd))
     286               (print cmd)
     287               (system* (sprintf "~a" cmd)))
    286288             (when (and *run-tests*
    287289                        (file-exists? "tests")
     
    289291                        (file-exists? "tests/run.scm") )
    290292               (current-directory "tests")
    291                (let ((cmd (sprintf "~a/csi -s run.scm ~a" *program-path* (car e+d))))
     293               (let ((cmd (sprintf "~a -s run.scm ~a" *csi* (car e+d))))
    292294                 (print cmd)
    293                  (system* cmd)))))
     295                 (system* (sprintf "~a" cmd))))))
    294296         *eggs+dirs*)))
    295297
  • chicken/trunk/csc.scm

    r12896 r12932  
    2828(declare
    2929  (block)
    30   (uses data-structures ports srfi-1 srfi-13 utils files extras ))
     30  (uses data-structures ports srfi-1 srfi-13 utils files extras))
    3131
    3232#>
     
    125125
    126126(define (quotewrap str)
    127   (if (string-any char-whitespace? str)
    128       (string-append "\"" str "\"")
    129       str) )
     127  (qs (normalize-pathname str)))
    130128
    131129(define home
     
    536534                 (printf "Warning: output file will overwrite source file `~A' - renaming source to `~A.old'~%"
    537535                         target-filename target-filename)
    538                  (unless (zero? ($system (sprintf "mv ~A ~A.old" target-filename target-filename)))
     536                 (unless (zero? ($system (sprintf "~A ~A ~A"
     537                                                  (if (or msvc mingw) "move" "mv")
     538                                                  (quotewrap target-filename)
     539                                                  (quotewrap (string-append target-filename ".old")))))
    539540                   (exit last-exit-code) ) )
    540541               (run-linking)) ) ]
  • chicken/trunk/defaults.make

    r12920 r12932  
    4040# directories
    4141
    42 SRCDIR ?= ./
    43 
     42SEP ?= /
     43SRCDIR ?= .$(SEP)
    4444DESTDIR ?=
    45 
    46 ifeq ($(PLATFORM),mingw-msys)
    47 PREFIX ?= c:/devtools
    48 else
    49 ifeq ($(PLATFORM),mingw)
    50 PREFIX ?= c:\\devtools
    51 else
    5245PREFIX ?= /usr/local
    53 endif
    54 endif
    5546
    5647BINDIR = $(PREFIX)/bin
     
    6657EGGDIR = $(CHICKENLIBDIR)/$(BINARYVERSION)
    6758
    68 ifeq ($(PLATFORM),mingw)
    69 IBINDIR = $(PREFIX)\\bin
    70 ILIBDIR = $(PREFIX)\\lib
    71 ISHAREDIR = $(PREFIX)\\share
    72 IDATADIR = $(ISHAREDIR)\\chicken
    73 ITOPMANDIR = $(ISHAREDIR)\\man
    74 IMANDIR = $(ITOPMANDIR)\\man1
    75 IINFODIR = $(ISHAREDIR)\\info
    76 IINCDIR = $(PREFIX)\\include
    77 IDOCDIR = $(IDATADIR)\\doc
    78 ICHICKENLIBDIR = $(ILIBDIR)\\chicken
    79 IEGGDIR = $(ICHICKENLIBDIR)\\$(BINARYVERSION)
    80 else
     59ifdef WINDOWS_SHELL
     60SPREFIX = $(subst /,\\,$(PREFIX))
     61IBINDIR = $(SPREFIX)$(SEP)bin
     62ILIBDIR = $(SPREFIX)$(SEP)lib
     63ISHAREDIR = $(SPREFIX)$(SEP)share
     64IDATADIR = $(ISHAREDIR)$(SEP)chicken
     65ITOPMANDIR = $(ISHAREDIR)$(SEP)man
     66IMANDIR = $(ITOPMANDIR)$(SEP)man1
     67IINFODIR = $(ISHAREDIR)$(SEP)info
     68IINCDIR = $(SPREFIX)$(SEP)include
     69IDOCDIR = $(IDATADIR)$(SEP)doc
     70ICHICKENLIBDIR = $(ILIBDIR)$(SEP)chicken
     71IEGGDIR = $(ICHICKENLIBDIR)$(SEP)$(BINARYVERSION)
     72else
     73SPREFIX = $(PREFIX)
    8174IBINDIR = $(BINDIR)
    8275ILIBDIR = $(LIBDIR)
     
    10699endif
    107100LINKER ?= $(C_COMPILER)
    108 ifeq ($(PLATFORM),mingw)
     101ifdef WINDOWS_SHELL
    109102REMOVE_COMMAND ?= del
    110103else
     
    113106ASSEMBLER ?= $(C_COMPILER)
    114107MAKEINFO_PROGRAM ?= -makeinfo
    115 ifeq ($(PLATFORM),mingw)
     108ifdef WINDOWS_SHELL
    116109INSTALL_PROGRAM ?= copy
    117110MAKEDIR_COMMAND ?= -mkdir
     
    188181LIBRARIAN_OUTPUT ?= $(LIBRARIAN_OUTPUT_OPTION) $@
    189182LIBRARIES ?= -lm
    190 ifeq ($(PLATFORM),mingw)
     183ifdef WINDOWS_SHELL
    191184REMOVE_COMMAND_OPTIONS ?= /f /q
    192185REMOVE_COMMAND_RECURSIVE_OPTIONS ?= /f /s /q
     
    198191endif
    199192MAKEINFO_PROGRAM_OPTIONS ?= --no-split
    200 ifneq ($(PLATFORM),mingw)
     193ifndef WINDOWS_SHELL
    201194INSTALL_PROGRAM_SHARED_LIBRARY_OPTIONS ?= -m755
    202195INSTALL_PROGRAM_STATIC_LIBRARY_OPTIONS ?= -m644
     
    250243
    251244HOSTNAME ?= $(shell hostname)
    252 ifeq ($(PLATFORM),mingw)
     245ifdef WINDOWS_SHELL
    253246BUILD_TIME ?= $(shell date /t)
    254247UNAME_SYS ?= MinGW
     
    258251endif
    259252BUILD_TAG ?= compiled $(BUILD_TIME) on $(HOSTNAME) ($(UNAME_SYS))
    260 
    261 ifdef LOCKTOSPACE
    262 C_COMPILER_BUILD_RUNTIME_OPTIONS += -DC_LOCK_TOSPACE
    263 endif
     253COPYMANY =
    264254
    265255
     
    349339.PHONY: all
    350340
    351 ifdef NO_UNIX_SHELL
     341ifdef WINDOWS_SHELL
    352342all: $(TARGETS)
    353343else
     
    378368        echo "#endif" >>$@
    379369        echo "#ifndef C_INSTALL_SHARE_HOME" >>$@
    380         echo "# define C_INSTALL_SHARE_HOME \"$(IDATADIR)\"" >>$@
     370        echo "# define C_INSTALL_SHARE_HOME \"$(DATADIR)\"" >>$@
    381371        echo "#endif" >>$@
    382372        echo "#ifndef C_INSTALL_BIN_HOME" >>$@
    383         echo "# define C_INSTALL_BIN_HOME \"$(IBINDIR)\"" >>$@
     373        echo "# define C_INSTALL_BIN_HOME \"$(BINDIR)\"" >>$@
    384374        echo "#endif" >>$@
    385375        echo "#ifndef C_INSTALL_EGG_HOME" >>$@
    386         echo "# define C_INSTALL_EGG_HOME \"$(IEGGDIR)\"" >>$@
     376        echo "# define C_INSTALL_EGG_HOME \"$(EGGDIR)\"" >>$@
    387377        echo "#endif" >>$@
    388378        echo "#ifndef C_INSTALL_LIB_HOME" >>$@
    389         echo "# define C_INSTALL_LIB_HOME \"$(ILIBDIR)\"" >>$@
     379        echo "# define C_INSTALL_LIB_HOME \"$(LIBDIR)\"" >>$@
    390380        echo "#endif" >>$@
    391381        echo "#ifndef C_INSTALL_STATIC_LIB_HOME" >>$@
    392         echo "# define C_INSTALL_STATIC_LIB_HOME \"$(ILIBDIR)\"" >>$@
     382        echo "# define C_INSTALL_STATIC_LIB_HOME \"$(LIBDIR)\"" >>$@
    393383        echo "#endif" >>$@
    394384        echo "#ifndef C_INSTALL_INCLUDE_HOME" >>$@
    395         echo "# define C_INSTALL_INCLUDE_HOME \"$(IINCDIR)\"" >>$@
     385        echo "# define C_INSTALL_INCLUDE_HOME \"$(INCDIR)\"" >>$@
    396386        echo "#endif" >>$@
    397387        echo "#ifndef C_INSTALL_MORE_LIBS" >>$@
     
    428418        echo "# define C_CROSS_CHICKEN $(CROSS_CHICKEN)" >>$@
    429419        echo "#endif" >>$@
    430 ifdef WINDOWS
    431         echo "#ifndef C_TARGET_LIB_HOME" >>$@
    432         echo "# define C_TARGET_LIB_HOME \"$(TARGET_PREFIX)\\lib\"" >>$@
    433         echo "#endif" >>$@
    434         echo "#ifndef C_TARGET_RUN_LIB_HOME" >>$@
    435         echo "# define C_TARGET_RUN_LIB_HOME \"$(TARGET_RUN_PREFIX)\\lib\"" >>$@
    436         echo "#endif" >>$@
    437         echo "#ifndef C_TARGET_SHARE_HOME" >>$@
    438         echo "# define C_TARGET_SHARE_HOME \"$(TARGET_PREFIX)\\share\"" >>$@
    439         echo "#endif" >>$@
    440         echo "#ifndef C_TARGET_INCLUDE_HOME" >>$@
    441         echo "# define C_TARGET_INCLUDE_HOME \"$(TARGET_PREFIX)\\include\"" >>$@
    442         echo "#endif" >>$@
    443         echo "#ifndef C_TARGET_STATIC_LIB_HOME" >>$@
    444         echo "# define C_TARGET_STATIC_LIB_HOME \"$(TARGET_PREFIX)\\lib\"" >>$@
    445         echo "#endif" >>$@
    446 else
    447420        echo "#ifndef C_TARGET_LIB_HOME" >>$@
    448421        echo "# define C_TARGET_LIB_HOME \"$(TARGET_PREFIX)/lib\"" >>$@
     
    460433        echo "# define C_TARGET_STATIC_LIB_HOME \"$(TARGET_PREFIX)/lib\"" >>$@
    461434        echo "#endif" >>$@
    462 endif
    463435        echo "#ifndef C_CHICKEN_PROGRAM" >>$@
    464436        echo "# define C_CHICKEN_PROGRAM \"$(CHICKEN_PROGRAM)\"" >>$@
  • chicken/trunk/files.import.scm

    r11680 r12932  
    4343   pathname-replace-file
    4444   pathname-strip-directory
    45    pathname-strip-extension))
     45   pathname-strip-extension
     46   normalize-pathname))
  • chicken/trunk/files.scm

    r12920 r12932  
    3737(declare
    3838  (unit files)
    39   (uses regex)
     39  (uses regex data-structures)
    4040  (usual-integrations)
    4141  (fixnum)
     
    342342                (call-with-output-file pn (lambda (p) pn)) ) ) ) ) ) ) )
    343343
     344
     345;;; normalize pathname for a particular platform
     346
     347(define (normalize-pathname path #!optional (platform (build-platform)))
     348  (case platform
     349    ((mingw32 msvc)
     350     (string-translate path "/" "\\"))
     351    (else path)))
     352
     353
    344354;; Directory string or list only contains path-separators
    345355;; and/or current-directory names.
  • chicken/trunk/rules.make

    r12920 r12932  
    774774
    775775chicken.info: chicken.texi
    776         $(MAKEINFO_PROGRAM) $(MAKEINFO_PROGRAM_OPTIONS) $<
     776        -$(MAKEINFO_PROGRAM) $(MAKEINFO_PROGRAM_OPTIONS) $<
    777777
    778778# installation
     
    920920ifneq ($(CROSS_CHICKEN),1)
    921921ifeq ($(DESTDIR),)
    922         -$(DESTDIR)$(IBINDIR)/$(CHICKEN_INSTALL_PROGRAM) -update-db
     922        -$(DESTDIR)$(IBINDIR)$(SEP)$(CHICKEN_INSTALL_PROGRAM) -update-db
    923923else
    924924        @echo
     
    936936        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-profile.1 $(DESTDIR)$(IMANDIR)
    937937        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken-bug.1 $(DESTDIR)$(IMANDIR)
    938         $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IDOCDIR)/html
    939         -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)html/* $(DESTDIR)$(IDOCDIR)/html
     938        $(MAKEDIR_COMMAND) $(MAKEDIR_COMMAND_OPTIONS) $(DESTDIR)$(IDOCDIR)$(SEP)html
     939        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)html$(SEP)* $(DESTDIR)$(IDOCDIR)$(SEP)html
    940940        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)chicken.pdf $(DESTDIR)$(IDOCDIR)
    941941        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)README $(DESTDIR)$(IDOCDIR)
    942942        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(SRCDIR)LICENSE $(DESTDIR)$(IDOCDIR)
    943943        -$(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.info $(DESTDIR)$(IINFODIR)
    944         $(INSTALLINFO_PROGRAM) $(INSTALLINFO_PROGRAM_OPTIONS) --infodir=$(DESTDIR)$(IINFODIR) chicken.info
    945 ifdef WINDOWS
     944        -$(INSTALLINFO_PROGRAM) $(INSTALLINFO_PROGRAM_OPTIONS) --infodir=$(DESTDIR)$(IINFODIR) chicken.info
     945ifdef WINDOWS_SHELL
    946946        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(SRCDIR)csibatch.bat $(DESTDIR)$(IBINDIR)
    947947endif
     
    949949
    950950ifdef STATICBUILD
     951# copy/xcopy is too dumb on Windows
    951952install-import-libs:
    952         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) $(IMPORT_LIBRARIES:=.import.scm) $(DESTDIR)$(IEGGDIR)
     953        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) scheme.import.scm $(DESTDIR)$(IEGGDIR)
     954        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.import.scm $(DESTDIR)$(IEGGDIR)
     955        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) lolevel.import.scm $(DESTDIR)$(IEGGDIR)
     956        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-1.import.scm $(DESTDIR)$(IEGGDIR)
     957        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-4.import.scm $(DESTDIR)$(IEGGDIR)
     958        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) data-structures.import.scm $(DESTDIR)$(IEGGDIR)
     959        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) ports.import.scm $(DESTDIR)$(IEGGDIR)
     960        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) files.import.scm $(DESTDIR)$(IEGGDIR)
     961        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) posix.import.scm $(DESTDIR)$(IEGGDIR)
     962        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-13.import.scm $(DESTDIR)$(IEGGDIR)
     963        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-69.import.scm $(DESTDIR)$(IEGGDIR)
     964        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) extras.import.scm $(DESTDIR)$(IEGGDIR)
     965        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) regex.import.scm $(DESTDIR)$(IEGGDIR)
     966        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-14.import.scm $(DESTDIR)$(IEGGDIR)
     967        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) tcp.import.scm $(DESTDIR)$(IEGGDIR)
     968        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) foreign.import.scm $(DESTDIR)$(IEGGDIR)
     969        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) compiler.import.scm $(DESTDIR)$(IEGGDIR)
     970        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-18.import.scm $(DESTDIR)$(IEGGDIR)
     971        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) utils.import.scm $(DESTDIR)$(IEGGDIR)
     972        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) csi.import.scm $(DESTDIR)$(IEGGDIR)
     973        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) irregex.import.scm $(DESTDIR)$(IEGGDIR)
     974        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) setup-api.import.scm $(DESTDIR)$(IEGGDIR)
     975        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) setup-download.import.scm $(DESTDIR)$(IEGGDIR)
    953976else
    954977install-import-libs:
    955         $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_EXECUTABLE_OPTIONS) $(IMPORT_LIBRARIES:=.import.so) $(DESTDIR)$(IEGGDIR)
     978        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) scheme.import.so $(DESTDIR)$(IEGGDIR)
     979        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) chicken.import.so $(DESTDIR)$(IEGGDIR)
     980        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) lolevel.import.so $(DESTDIR)$(IEGGDIR)
     981        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-1.import.so $(DESTDIR)$(IEGGDIR)
     982        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-4.import.so $(DESTDIR)$(IEGGDIR)
     983        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) data-structures.import.so $(DESTDIR)$(IEGGDIR)
     984        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) ports.import.so $(DESTDIR)$(IEGGDIR)
     985        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) files.import.so $(DESTDIR)$(IEGGDIR)
     986        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) posix.import.so $(DESTDIR)$(IEGGDIR)
     987        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-13.import.so $(DESTDIR)$(IEGGDIR)
     988        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-69.import.so $(DESTDIR)$(IEGGDIR)
     989        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) extras.import.so $(DESTDIR)$(IEGGDIR)
     990        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) regex.import.so $(DESTDIR)$(IEGGDIR)
     991        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-14.import.so $(DESTDIR)$(IEGGDIR)
     992        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) tcp.import.so $(DESTDIR)$(IEGGDIR)
     993        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) foreign.import.so $(DESTDIR)$(IEGGDIR)
     994        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) compiler.import.so $(DESTDIR)$(IEGGDIR)
     995        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) srfi-18.import.so $(DESTDIR)$(IEGGDIR)
     996        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) utils.import.so $(DESTDIR)$(IEGGDIR)
     997        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) csi.import.so $(DESTDIR)$(IEGGDIR)
     998        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) irregex.import.so $(DESTDIR)$(IEGGDIR)
     999        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) setup-api.import.so $(DESTDIR)$(IEGGDIR)
     1000        $(INSTALL_PROGRAM) $(INSTALL_PROGRAM_FILE_OPTIONS) setup-download.import.so $(DESTDIR)$(IEGGDIR)
    9561001endif
    9571002
     
    9891034        $(REMOVE_COMMAND) $(REMOVE_COMMAND_RECURSIVE_OPTIONS) $(DESTDIR)$(IDATADIR)
    9901035        $(UNINSTALLINFO_PROGRAM) $(UNINSTALLINFO_PROGRAM_OPTIONS) --infodir=$(DESTDIR)$(IINFODIR) chicken.info
    991         $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IINFODIR)/chicken.info
    992 ifdef WINDOWS
    993         $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)/csibatch.bat
     1036        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IINFODIR)$(SEP)chicken.info
     1037ifdef WINDOWS_SHELL
     1038        $(REMOVE_COMMAND) $(REMOVE_COMMAND_OPTIONS) $(DESTDIR)$(IBINDIR)$(SEP)csibatch.bat
    9941039endif
    9951040
  • chicken/trunk/setup-api.scm

    r12838 r12932  
    4444     find-library find-header
    4545     program-path remove-file*
    46      patch yes-or-no? abort-setup qs
     46     patch yes-or-no? abort-setup
    4747     setup-root-directory create-directory/parents
    4848     test-compile try-compile copy-file run-verbose
     
    5353     remove-directory
    5454     remove-extension
    55      read-info)
     55     read-info
     56     shellpath)
    5657 
    5758  (import scheme chicken foreign
     
    165166            "/usr/local") ) ) )
    166167
     168(define (shellpath str)
     169  (qs (normalize-pathname str)))
     170
    167171(define (cross-chicken) (##sys#fudge 39))
    168172
     
    230234
    231235
    232 (define create-directory-0
    233   (let ([create-directory create-directory])
    234     (lambda (dir)
    235       (let loop ([dir dir])
    236         (when (and dir (not (directory? dir)))
    237           (loop (pathname-directory dir))
    238           (create-directory dir))) ) ) )
    239 
    240236(define create-directory/parents
    241237  (let ()
     238    (define create-directory-0
     239      (let ([create-directory create-directory])
     240        (lambda (dir)
     241          (let loop ([dir dir])
     242            (when (and dir (not (directory? dir)))
     243              (loop (pathname-directory dir))
     244              (create-directory dir))) ) ) )
    242245    (define (verb dir)
    243246      (when (setup-verbose-flag) (printf "  creating directory `~a'~%~!" dir)) )
     
    248251        (lambda (dir)
    249252          (verb dir)
    250           (system* "mkdir -p ~a" (qs dir) ) ) ) ) )
    251 
    252 (define (qs str)
    253   (string-concatenate
    254    (map (lambda (c)
    255           (if (or (char-whitespace? c)
    256                   (memq c '(#\# #\" #\' #\` #\Ž #\~ #\& #\% #\$ #\! #\* #\; #\< #\> #\\
    257                             #\( #\) #\[ #\] #\{ #\})))
    258               (string #\\ c)
    259               (string c)))
    260         (string->list str))))
     253          (system* "mkdir -p ~a" (shellpath dir) ) ) ) ) )
    261254
    262255(define abort-setup
     
    292285      (let ((tmp (create-temporary-file)))
    293286        (patch (list tmp tmp) rx subst)
    294         (system* "~A ~A ~A" *move-command* (qs tmp)
    295                  (qs which)))))
     287        (system* "~A ~A ~A" *move-command* (shellpath tmp)
     288                 (shellpath which)))))
    296289
    297290(define run-verbose (make-parameter #t))
     
    300293  (cond ((string=? prg "csc")
    301294         (string-intersperse
    302           (cons* (qs
     295          (cons* (shellpath
    303296                  (make-pathname
    304297                   *chicken-bin-path*
     
    309302          " ") )
    310303        ((assoc prg *installed-executables*) =>
    311          (lambda (a) (qs (make-pathname *chicken-bin-path* (cdr a)))))
     304         (lambda (a) (shellpath (make-pathname *chicken-bin-path* (cdr a)))))
    312305        (else prg) ) )
    313306
     
    508501             (let ((tmp (create-temporary-file)))
    509502               (with-output-to-file tmp (cut pp info))
    510                (run (,*move-command* ,(qs tmp) ,(qs setup-file)))))
     503               (run (,*move-command* ,(shellpath tmp) ,(shellpath setup-file)))))
    511504            (else (with-output-to-file setup-file (cut pp info))))
    512       (unless *windows-shell* (run (,*chmod-command* a+r ,(qs setup-file)))))))
     505      (unless *windows-shell* (run (,*chmod-command* a+r ,(shellpath setup-file)))))))
    513506
    514507(define (copy-file from to #!optional (err #t) (prefix (installation-prefix)))
     
    520513    (cond ((or (glob? from) (file-exists? from))
    521514           (begin
    522              (run (,*copy-command* ,(qs from) ,(qs to)))
     515             (run (,*copy-command* ,(shellpath from) ,(shellpath to)))
    523516             to))
    524517          (err (error "file does not exist" from))
     
    529522        (to    (if (pair? from) (make-pathname to (cadr from)) to)))
    530523    (ensure-directory to)
    531     (run (,*move-command* ,(qs from) ,(qs to)) ) ) )
     524    (run (,*move-command* ,(shellpath from) ,(shellpath to)) ) ) )
    532525
    533526(define (remove-file* dir)
    534   (run (,*remove-command* ,(qs dir)) ) )
     527  (run (,*remove-command* ,(shellpath dir)) ) )
    535528
    536529(define (make-dest-pathname path file)
     
    570563                           (when (and (not *windows*)
    571564                                      (equal? "so" (pathname-extension to)))
    572                              (run (,*remove-command* ,(qs to)) ))
     565                             (run (,*remove-command* ,(shellpath to)) ))
    573566                           (copy-file from to)
    574567                           (unless *windows-shell*
    575                              (run (,*chmod-command* a+r ,(qs to))))
     568                             (run (,*chmod-command* a+r ,(shellpath to))))
    576569                           (and-let* ((static (assq 'static info)))
    577570                             (when (and (eq? (software-version) 'macosx)
    578571                                        (equal? (cadr static) from)
    579572                                        (equal? (pathname-extension to) "a"))
    580                                (run (,*ranlib-command* ,(qs to)) ) ))
     573                               (run (,*ranlib-command* ,(shellpath to)) ) ))
    581574                           (make-dest-pathname rpath f)))
    582575                       files) ) )
     
    621614                           (copy-file from to)
    622615                           (unless *windows-shell*
    623                                    (run (,*chmod-command* a+r ,(qs to))))
     616                                   (run (,*chmod-command* a+r ,(shellpath to))))
    624617                           to) )
    625618                       files) ) )
     
    636629                            (copy-file from to)
    637630                            (unless *windows-shell*
    638                                     (run (,*chmod-command* a+r ,(qs to))))
     631                                    (run (,*chmod-command* a+r ,(shellpath to))))
    639632                            to) )
    640633                        files) ) )
     
    661654          (create-directory dir)
    662655          (unless *windows-shell*
    663                   (run (,*chmod-command* a+x ,(qs dir))))))))
     656                  (run (,*chmod-command* a+x ,(shellpath dir))))))))
    664657
    665658(define (try-compile code #!key c++ (cc (if c++ *cxx* *cc*)) (cflags "") (ldflags "")
     
    683676                 cmd) ) ) ) )
    684677    (when verb (print (if (zero? r) "succeeded." "failed.")))
    685     (system (sprintf "~A ~A" *remove-command* (qs fname)))
     678    (system (sprintf "~A ~A" *remove-command* (shellpath fname)))
    686679    (zero? r) ) )
    687680
  • chicken/trunk/utils.import.scm

    r11646 r12932  
    3232   for-each-line
    3333   read-all
    34    system*))
     34   system*
     35   qs))
  • chicken/trunk/utils.scm

    r11646 r12932  
    2828(declare
    2929  (unit utils)
    30   (uses regex data-structures extras files)
     30  (uses regex data-structures extras files srfi-13)
    3131  (usual-integrations)
    3232  (fixnum)
     
    210210        (read-string #f file)
    211211        (with-input-from-file file (cut read-string #f)) ) ) )
     212
     213
     214;;; Quote string for shell
     215
     216(define (qs str #!optional (platform (build-platform)))
     217  (case platform
     218    ((mingw32 msvc)
     219     (string-append "\"" str "\""))
     220    (else
     221     (if (zero? (string-length str))
     222         "''"
     223         (string-concatenate
     224          (map (lambda (c)
     225                 (if (or (char-whitespace? c)
     226                         (memq c '(#\# #\" #\' #\` #\Ž #\~ #\& #\% #\$ #\! #\* #\; #\< #\> #\\
     227                                   #\( #\) #\[ #\] #\{ #\})))
     228                     (string #\\ c)
     229                     (string c)))
     230               (string->list str)))))))
Note: See TracChangeset for help on using the changeset viewer.