Changeset 12956 in project for chicken/trunk/csc.scm


Ignore:
Timestamp:
01/07/09 23:51:40 (12 years ago)
Author:
felix winkelmann
Message:

possibly fixed mingw quoting hell - a bow before Matthew Flatt, who is a master hacker

File:
1 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/csc.scm

    r12937 r12956  
    3030  (uses data-structures ports srfi-1 srfi-13 utils files extras))
    3131
    32 #>
    33 #ifndef C_TARGET_CC
    34 # define C_TARGET_CC  C_INSTALL_CC
    35 #endif
    36 
    37 #ifndef C_TARGET_CXX
    38 # define C_TARGET_CXX  C_INSTALL_CXX
    39 #endif
    40 
    41 #ifndef C_TARGET_CFLAGS
    42 # define C_TARGET_CFLAGS  C_INSTALL_CFLAGS
    43 #endif
    44 
    45 #ifndef C_TARGET_LDFLAGS
    46 # define C_TARGET_LDFLAGS  C_INSTALL_LDFLAGS
    47 #endif
    48 
    49 #ifndef C_TARGET_BIN_HOME
    50 # define C_TARGET_BIN_HOME  C_INSTALL_BIN_HOME
    51 #endif
    52 
    53 #ifndef C_TARGET_LIB_HOME
    54 # define C_TARGET_LIB_HOME  C_INSTALL_LIB_HOME
    55 #endif
    56 
    57 #ifndef C_TARGET_STATIC_LIB_HOME
    58 # define C_TARGET_STATIC_LIB_HOME  C_INSTALL_STATIC_LIB_HOME
    59 #endif
    60 
    61 #ifndef C_TARGET_INCLUDE_HOME
    62 # define C_TARGET_INCLUDE_HOME  C_INSTALL_INCLUDE_HOME
    63 #endif
    64 
    65 #ifndef C_TARGET_SHARE_HOME
    66 # define C_TARGET_SHARE_HOME  C_INSTALL_SHARE_HOME
    67 #endif
    68 
    69 #ifndef C_TARGET_RUN_LIB_HOME
    70 # define C_TARGET_RUN_LIB_HOME    C_TARGET_LIB_HOME
    71 #endif
    72 
    73 #ifndef C_CHICKEN_PROGRAM
    74 # define C_CHICKEN_PROGRAM     "chicken"
    75 #endif
    76 <#
    77 
    7832(define-foreign-variable INSTALL_BIN_HOME c-string "C_INSTALL_BIN_HOME")
    7933(define-foreign-variable INSTALL_CC c-string "C_INSTALL_CC")
     
    10054(define-foreign-variable TARGET_RUN_LIB_HOME c-string "C_TARGET_RUN_LIB_HOME")
    10155(define-foreign-variable CHICKEN_PROGRAM c-string "C_CHICKEN_PROGRAM")
     56(define-foreign-variable WINDOWS_SHELL bool "C_WINDOWS_SHELL")
    10257
    10358
     
    151106(define default-translation-optimization-options '())
    152107(define pic-options (if (or mingw msvc) '("-DPIC") '("-fPIC" "-DPIC")))
     108(define windows-shell WINDOWS_SHELL)
    153109
    154110(define default-library (string-append
     
    159115                                library-extension))
    160116
    161 (define cleanup-filename
    162   (if (not mingw)
    163       (lambda (s) (quotewrap s)) ; allow filenames w/ whitespace
    164       (lambda (s) s)))
     117(define cleanup-filename quotewrap)
    165118
    166119(define default-compilation-optimization-options (string-split (if host-mode INSTALL_CFLAGS TARGET_CFLAGS)))
     
    919872(define ($system str)
    920873  (when verbose (print str))
    921   (set! last-exit-code
    922     (if dry-run
    923         0
    924         (if (zero? (system str))
    925             0
    926             1)))
    927   (unless (zero? last-exit-code)
    928     (printf "*** Shell command terminated with exit status ~S: ~A~%" last-exit-code str) )
    929   last-exit-code)
     874  (let ((str (if windows-shell
     875                 (string-append "\"" str "\"")
     876                 str)))
     877    (set! last-exit-code
     878      (if dry-run
     879          0
     880          (system str)))
     881    (unless (zero? last-exit-code)
     882      (printf "Error: shell command terminated with non-zero exit status ~S: ~A~%" last-exit-code str) )
     883    last-exit-code))
    930884
    931885(define ($delete-file str)
Note: See TracChangeset for help on using the changeset viewer.