Changeset 12956 in project for chicken


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

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

Location:
chicken/trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • chicken/trunk/Makefile.mingw

    r12937 r12956  
    128128        echo /* generated */ >$@
    129129        echo #define C_BUILD_TAG "$(BUILD_TAG)" >>$@
     130        echo #define C_CHICKEN_PROGRAM "chicken.exe" >>$@
     131        echo #define C_WINDOWS_SHELL 1 >>$@
    130132        echo #ifndef C_INSTALL_CC >>$@
    131133        echo # define C_INSTALL_CC "$(C_COMPILER)" >>$@
     
    167169        echo # define C_DEFAULT_TARGET_STACK_SIZE $(NURSERY) >>$@
    168170        echo #endif >>$@
     171        echo #ifndef C_DEFAULT_TARGET_HEAP_SIZE >>$@
     172        echo # define C_DEFAULT_TARGET_HEAP_SIZE 0 >>$@
     173        echo #endif >>$@
    169174        echo #ifndef C_STACK_GROWS_DOWNWARD >>$@
    170175        echo # define C_STACK_GROWS_DOWNWARD $(STACKDIRECTION) >>$@
     
    191196        echo # define C_CROSS_CHICKEN $(CROSS_CHICKEN) >>$@
    192197        echo #endif >>$@
     198        echo #ifndef C_TARGET_BIN_HOME >>$@
     199        echo # define C_TARGET_BIN_HOME "$(TARGET_PREFIX)/bin" >>$@
     200        echo #endif >>$@
    193201        echo #ifndef C_TARGET_LIB_HOME >>$@
    194202        echo # define C_TARGET_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
     
    206214        echo # define C_TARGET_STATIC_LIB_HOME "$(TARGET_PREFIX)/lib" >>$@
    207215        echo #endif >>$@
     216        echo #ifndef C_CSC_PROGRAM" >>$@
     217        echo # define C_CSC_PROGRAM "$(CSC_PROGRAM)" >>$@
     218        echo #endif" >>$@
     219        echo #ifndef C_CSI_PROGRAM" >>$@
     220        echo # define C_CSI_PROGRAM "$(CSI_PROGRAM)" >>$@
     221        echo #endif" >>$@
     222        echo #ifndef C_CHICKEN_BUG_PROGRAM" >>$@
     223        echo # define C_CHICKEN_BUG_PROGRAM "$(CHICKEN_BUG_PROGRAM)" >>$@
     224        echo #endif" >>$@
    208225        echo #ifndef C_BINARY_VERSION >>$@
    209226        echo # define C_BINARY_VERSION $(BINARYVERSION) >>$@
  • chicken/trunk/chicken-bug.scm

    r12937 r12956  
    2626
    2727(require-extension srfi-13 posix tcp data-structures utils extras)
    28 
    29 
    30 #>
    31 #ifndef C_TARGET_CC
    32 # define C_TARGET_CC  C_INSTALL_CC
    33 #endif
    34 
    35 #ifndef C_TARGET_CXX
    36 # define C_TARGET_CXX  C_INSTALL_CXX
    37 #endif
    38 <#
    3928
    4029
  • chicken/trunk/chicken-install.scm

    r12934 r12956  
    2828(require-library srfi-1 posix data-structures utils ports regex ports extras
    2929                 srfi-13 files)
    30 
    31 
    32 (foreign-declare #<<EOF
    33 #ifndef C_INSTALL_BIN_HOME
    34 # define C_INSTALL_BIN_HOME   NULL
    35 #endif
    36 EOF
    37 )
    3830
    3931
     
    8981  (define *default-location* #f)
    9082  (define *default-transport* 'http)
     83  (define *windows-shell* (foreign-value "C_WINDOWS_SHELL" bool))
    9184
    9285  (define-constant +module-db+ "modules.db")
     
    107100  (define (init-repository dir)
    108101    (let ((src (repository-path))
    109           (copy (if (or (feature? 'mingw32) (feature? 'msvc))
     102          (copy (if *windows-shell*
    110103                    "copy"
    111104                    "cp -r")))
     
    113106      (for-each
    114107       (lambda (f)
    115          (system* "~a ~a ~a" copy (make-pathname src f) dir))
     108         ($system (sprintf "~a ~a ~a" copy (shellpath (make-pathname src f)) (shellpath dir))))
    116109       +default-repository-files+)))
    117 
     110 
    118111  (define (ext-version x)
    119112    (cond ((or (eq? x 'chicken)
     
    285278                         (shellpath (make-pathname (cdr e+d) (car e+d) "setup")))))
    286279               (print "  " cmd)
    287                (system* "~a" cmd)
     280               ($system cmd))
    288281             (when (and *run-tests*
    289282                        (file-exists? "tests")
     
    293286               (let ((cmd (sprintf "~a -s run.scm ~a" *csi* (car e+d))))
    294287                 (print "  " cmd)
    295                  (system* "~a" cmd))))) )
     288                 ($system cmd)))))
    296289         *eggs+dirs*)))
    297290
     
    334327        (remove-directory tmpdir))))
    335328
     329  (define ($system str)
     330    (let ((r (system
     331              (if *windows-shell*
     332                  (string-append "\"" str "\"")
     333                  str))))
     334      (unless (zero? r)
     335        (error "shell command terminated with nonzero exit code" r str))))
     336
    336337  (define (usage code)
    337338    (print #<<EOF
  • chicken/trunk/compiler.scm

    r12948 r12956  
    252252 (unit compiler)
    253253 (disable-warning var) )
    254 
    255 #>
    256 #ifndef C_INSTALL_SHARE_HOME
    257 # define C_INSTALL_SHARE_HOME NULL
    258 #endif
    259 
    260 #ifndef C_DEFAULT_TARGET_STACK_SIZE
    261 # define C_DEFAULT_TARGET_STACK_SIZE 0
    262 #endif
    263 
    264 #ifndef C_DEFAULT_TARGET_HEAP_SIZE
    265 # define C_DEFAULT_TARGET_HEAP_SIZE 0
    266 #endif
    267 <#
    268254
    269255
  • 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)
  • chicken/trunk/defaults.make

    r12936 r12956  
    354354        echo "/* generated */" >$@
    355355        echo "#define C_BUILD_TAG \"$(BUILD_TAG)\"" >>$@
     356        echo "#define C_CHICKEN_PROGRAM \"chicken.exe\"" >>$@
    356357        echo "#define C_SVN_REVISION $(shell cat buildsvnrevision)" >>$@
    357358        echo "#ifndef C_INSTALL_CC" >>$@
     
    394395        echo "# define C_DEFAULT_TARGET_STACK_SIZE $(NURSERY)" >>$@
    395396        echo "#endif" >>$@
     397        echo "#ifndef C_DEFAULT_TARGET_HEAP_SIZE" >>$@
     398        echo "# define C_DEFAULT_TARGET_HEAP_SIZE 0" >>$@
     399        echo "#endif" >>$@
    396400        echo "#ifndef C_STACK_GROWS_DOWNWARD" >>$@
    397401        echo "# define C_STACK_GROWS_DOWNWARD $(STACKDIRECTION)" >>$@
     
    418422        echo "# define C_CROSS_CHICKEN $(CROSS_CHICKEN)" >>$@
    419423        echo "#endif" >>$@
     424        echo "#ifndef C_TARGET_BIN_HOME" >>$@
     425        echo "# define C_TARGET_BIN_HOME \"$(TARGET_PREFIX)/bin\"" >>$@
     426        echo "#endif" >>$@
    420427        echo "#ifndef C_TARGET_LIB_HOME" >>$@
    421428        echo "# define C_TARGET_LIB_HOME \"$(TARGET_PREFIX)/lib\"" >>$@
     
    445452        echo "# define C_CHICKEN_BUG_PROGRAM \"$(CHICKEN_BUG_PROGRAM)\"" >>$@
    446453        echo "#endif" >>$@
     454        echo "#ifndef C_WINDOWS_SHELL" >>$@
     455ifdef WINDOWS_SHELL
     456        echo "# define C_WINDOWS_SHELL 1" >>$@
     457else
     458        echo "# define C_WINDOWS_SHELL 0" >>$@
     459endif
     460        echo "#endif" >>$@
    447461        echo "#ifndef C_BINARY_VERSION" >>$@
    448462        echo "# define C_BINARY_VERSION $(BINARYVERSION)" >>$@
  • chicken/trunk/manual/Acknowledgements

    r12949 r12956  
    1313Cuervo, Linh Dang, Brian Denheyer, dgym, Don, Chris Double, Brown
    1414Dragon, Jarod Eells, Petter Egesund, Steve Elkins, Daniel B. Faken,
    15 Will Farr, Graham Fawcett, Marc Feeley, Fizzie, Kimura Fuyuki, Tony
    16 Garnock-Jones, Martin Gasbichler, Joey Gibson, Stephen C. Gilardi,
    17 Joshua Griffith, Johannes Groedem, Damian Gryski, Mario Domenech
    18 Goulart, Andreas Gustafsson, Sven Hartrumpf, Jun-ichiro itojun Hagino,
    19 Ahdi Hargo, Matthias Heiler, Karl M. Hegbloom, William P. Heinemann,
    20 Bill Hoffman, Bruce Hoult, Hans Huebner, Markus Huelsmann, Goetz
    21 Isenmann, Paulo Jabardo, Wietse Jacobs, David Janssens, Christian
    22 Jaeger, Dale Jordan, Valentin Kamyshenko, Daishi Kato, Peter Keller,
    23 Brad Kind, Ron Kneusel, Matthias Koeppe, Krysztof Kowa&#322;czyk,
    24 Andre Kuehne, Todd R. Kueny Sr, Goran Krampe, David Krentzlin, Ben
    25 Kurtz, Micky Latowicki, John Lenz, Kirill Lisovsky, Juergen Lorenz,
    26 Kon Lovett, Dennis Marti, Charles Martin, Bob McIsaac, Alain Mellan,
    27 Eric Merrit, Perry Metzger, Scott G. Miller, Mikael, Bruce Mitchener,
    28 Chris Moline, Eric E. Moore, Julian Morrison, Dan Muresan, Lars
    29 Nilsson, Ian Oversby, o.t., Gene Pavlovsky, Levi Pearson, Nicolas
    30 Pelletier, Carlos Pita, Robin Lee Powell, Pupeno, Davide Puricelli,
    31 Doug Quale, Eric Raible, Ivan Raikov, Joel Reymont, Eric Rochester,
    32 Andreas Rottman, David Rush, Lars Rustemeier, Daniel Sadilek, Oskar
    33 Schirmer, Burton Samograd, Reed Sheridan, Ronald Schroeder, Spencer
    34 Schumann, Ivan Shcheklein, Alex Shinn, Ivan Shmakov, Shmul, Tony
    35 Sidaway, Jeffrey B. Siegal, Andrey Sidorenko, Michele Simionato,
    36 Volker Stolz, Jon Strait, Dorai Sitaram, Robert Skeels, Jason
    37 Songhurst, Clifford Stein, Sunnan, Zbigniew Szadkowski, Rick Taube,
    38 Nathan Thern, Mike Thomas, Minh Thu, Christian Tismer, Andre van
    39 Tonder, John Tobey, Henrik Tramberend, Vladimir Tsichevsky, Neil van
    40 Dyke, Sander Vesik, Jaques Vidrine, Panagiotis Vossos, Shawn Wagner,
    41 Peter Wang, Ed Watkeys, Brad Watson, Thomas Weidner, Goeran Weinholt,
    42 Matthew Welland, Drake Wilson, Joerg Wittenberger, Peter Wright, Mark
    43 Wutka, Richard Zidlicky and Houman Zolfaghari for bug-fixes, tips and
    44 suggestions.
     15Will Farr, Graham Fawcett, Marc Feeley, Fizzie, Matthew Flatt, Kimura
     16Fuyuki, Tony Garnock-Jones, Martin Gasbichler, Joey Gibson, Stephen
     17C. Gilardi, Joshua Griffith, Johannes Groedem, Damian Gryski, Mario
     18Domenech Goulart, Andreas Gustafsson, Sven Hartrumpf, Jun-ichiro
     19itojun Hagino, Ahdi Hargo, Matthias Heiler, Karl M. Hegbloom, William
     20P. Heinemann, Bill Hoffman, Bruce Hoult, Hans Huebner, Markus
     21Huelsmann, Goetz Isenmann, Paulo Jabardo, Wietse Jacobs, David
     22Janssens, Christian Jaeger, Dale Jordan, Valentin Kamyshenko, Daishi
     23Kato, Peter Keller, Brad Kind, Ron Kneusel, Matthias Koeppe, Krysztof
     24Kowa&#322;czyk, Andre Kuehne, Todd R. Kueny Sr, Goran Krampe, David
     25Krentzlin, Ben Kurtz, Micky Latowicki, John Lenz, Kirill Lisovsky,
     26Juergen Lorenz, Kon Lovett, Dennis Marti, Charles Martin, Bob McIsaac,
     27Alain Mellan, Eric Merrit, Perry Metzger, Scott G. Miller, Mikael,
     28Bruce Mitchener, Chris Moline, Eric E. Moore, Julian Morrison, Dan
     29Muresan, Lars Nilsson, Ian Oversby, o.t., Gene Pavlovsky, Levi
     30Pearson, Nicolas Pelletier, Carlos Pita, Robin Lee Powell, Pupeno,
     31Davide Puricelli, Doug Quale, Eric Raible, Ivan Raikov, Joel Reymont,
     32Eric Rochester, Andreas Rottman, David Rush, Lars Rustemeier, Daniel
     33Sadilek, Oskar Schirmer, Burton Samograd, Reed Sheridan, Ronald
     34Schroeder, Spencer Schumann, Ivan Shcheklein, Alex Shinn, Ivan
     35Shmakov, Shmul, Tony Sidaway, Jeffrey B. Siegal, Andrey Sidorenko,
     36Michele Simionato, Volker Stolz, Jon Strait, Dorai Sitaram, Robert
     37Skeels, Jason Songhurst, Clifford Stein, Sunnan, Zbigniew Szadkowski,
     38Rick Taube, Nathan Thern, Mike Thomas, Minh Thu, Christian Tismer,
     39Andre van Tonder, John Tobey, Henrik Tramberend, Vladimir Tsichevsky,
     40Neil van Dyke, Sander Vesik, Jaques Vidrine, Panagiotis Vossos, Shawn
     41Wagner, Peter Wang, Ed Watkeys, Brad Watson, Thomas Weidner, Goeran
     42Weinholt, Matthew Welland, Drake Wilson, Joerg Wittenberger, Peter
     43Wright, Mark Wutka, Richard Zidlicky and Houman Zolfaghari for
     44bug-fixes, tips and suggestions.
    4545
    4646CHICKEN uses the "irregex" regular expression package written by Alex Shinn.
  • chicken/trunk/setup-api.scm

    r12934 r12956  
    6262;;; Constants, variables and parameters
    6363
    64 #>
    65 #ifndef C_INSTALL_BIN_HOME
    66 # define C_INSTALL_BIN_HOME   NULL
    67 #endif
    68 
    69 #ifndef C_INSTALL_SHARE_HOME
    70 # define C_INSTALL_SHARE_HOME   NULL
    71 #endif
    72 
    73 #ifndef C_INSTALL_CC
    74 # ifdef _MSC_VER
    75 #  define C_INSTALL_CC                "cl"
    76 # else
    77 #  ifdef __GNUC__
    78 #   define C_INSTALL_CC                "gcc"
    79 #  else
    80 #   define C_INSTALL_CC                "cc"
    81 #  endif
    82 # endif
    83 #endif
    84 
    85 #ifndef C_TARGET_CC
    86 # define C_TARGET_CC  C_INSTALL_CC
    87 #endif
    88 
    89 #ifndef C_TARGET_CXX
    90 # define C_TARGET_CXX  C_INSTALL_CXX
    91 #endif
    92 
    93 #ifndef C_TARGET_CFLAGS
    94 # define C_TARGET_CFLAGS  C_INSTALL_CFLAGS
    95 #endif
    96 
    97 #ifndef C_TARGET_MORE_LIBS
    98 # define C_TARGET_MORE_LIBS  C_INSTALL_LIB_HOME
    99 #endif
    100 
    101 #ifndef C_TARGET_LIB_HOME
    102 # define C_TARGET_LIB_HOME  C_INSTALL_LIB_HOME
    103 #endif
    104 
    105 #ifndef C_CHICKEN_PROGRAM
    106 # define C_CHICKEN_PROGRAM   "chicken"
    107 #endif
    108 
    109 #ifndef C_CSC_PROGRAM
    110 # define C_CSC_PROGRAM   "csc"
    111 #endif
    112 
    113 #ifndef C_CSI_PROGRAM
    114 # define C_CSI_PROGRAM   "csi"
    115 #endif
    116 
    117 #ifndef C_CHICKEN_BUG_PROGRAM
    118 # define C_CHICKEN_BUG_PROGRAM   "chicken-bug"
    119 #endif
    120 <#
    121 
    122 
    12364(define-constant setup-file-extension "setup-info")
    12465
     
    13576(define *target-lib-home* (foreign-value "C_TARGET_LIB_HOME" c-string))
    13677(define *sudo* #f)
     78(define *windows-shell* (foreign-value "C_WINDOWS_SHELL" bool))
    13779
    13880(define *windows*
    13981  (and (eq? (software-type) 'windows)
    14082       (build-platform) ) )
    141 
    142 (define *windows-shell* (or (eq? *windows* 'mingw32)
    143                             (eq? *windows* 'msvc)))
    14483
    14584(register-feature! 'chicken-setup)
     
    251190        (lambda (dir)
    252191          (verb dir)
    253           (system* "mkdir -p ~a" (shellpath dir) ) ) ) ) )
     192          ($system (sprintf "mkdir -p ~a" (shellpath dir) ) ) ) ) ) )
    254193
    255194(define abort-setup
     
    285224      (let ((tmp (create-temporary-file)))
    286225        (patch (list tmp tmp) rx subst)
    287         (system* "~A ~A ~A" *move-command* (shellpath tmp)
    288                  (shellpath which)))))
     226        ($system
     227         (sprintf "~A ~A ~A" *move-command* (shellpath tmp)
     228                  (shellpath which))))))
    289229
    290230(define run-verbose (make-parameter #t))
     
    318258   (lambda (cmd)
    319259     (when (run-verbose) (printf "  ~A~%~!" cmd))
    320      (system* "~a" cmd) )
     260     ($system cmd))
    321261   (map smooth explist) ) )
    322262
     
    676616                 cmd) ) ) ) )
    677617    (when verb (print (if (zero? r) "succeeded." "failed.")))
    678     (system (sprintf "~A ~A" *remove-command* (shellpath fname)))
     618    ($system (sprintf "~A ~A" *remove-command* (shellpath fname)))
    679619    (zero? r) ) )
    680620
     
    761701             #f))
    762702        (*sudo*
    763          (system* "sudo rm -fr '~a'" dir))
     703         ($system (sprintf "sudo rm -fr ~a" (shellpath dir))))
    764704        (else
    765705         (let walk ((dir dir))
     
    780720  (remove-file* (make-pathname (repository-path) egg "setup-info")))
    781721
     722(define ($system str)
     723  (let ((r (system
     724            (if *windows-shell*
     725                (string-append "\"" str "\"")   ; double quotes, yes - thanks to Matthew Flatt
     726                str))))
     727    (unless (zero? r)
     728      (error "shell command failed with nonzero exit status" r str))))
     729
    782730)
Note: See TracChangeset for help on using the changeset viewer.