~ubuntu-branches/ubuntu/intrepid/ecl/intrepid

« back to all changes in this revision

Viewing changes to src/cmp/cmpmain.lsp

  • Committer: Bazaar Package Importer
  • Author(s): Peter Van Eynde
  • Date: 2006-06-21 09:21:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20060621092121-txz1f21lj0wh0f67
Tags: 0.9h-20060617-1
* New upstream version
* Updated standards version without real changes. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
174
174
        ~A
175
175
}")
176
176
 
 
177
#+:win32
 
178
(defconstant +lisp-program-winmain+ "
 
179
#include <windows.h>
 
180
int
 
181
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
 
182
{
 
183
        char *fake_argv = \"ecl.exe\";
 
184
        ~A
 
185
        cl_boot(1, &fake_argv);
 
186
        read_VV(OBJNULL, ~A);
 
187
        ~A
 
188
}")
 
189
 
177
190
(defun init-function-name (s &optional (si::*init-function-prefix* si::*init-function-prefix*))
178
191
  (flet ((translate-char (c)
179
192
           (cond ((and (char>= c #\a) (char<= c #\z))
199
212
(defun builder (target output-name &key lisp-files ld-flags shared-data-file
200
213
                (init-name nil)
201
214
                (prologue-code "")
202
 
                (epilogue-code (when (eq target :program) '(SI::TOP-LEVEL))))
 
215
                (epilogue-code (when (eq target :program) '(SI::TOP-LEVEL)))
 
216
                #+:win32 (system :console))
203
217
  ;;
204
218
  ;; The epilogue-code can be either a string made of C code, or a
205
219
  ;; lisp form.  In the latter case we add some additional C code to
218
232
                   (wt-filtered-data (write-to-string epilogue-code) stream)
219
233
                   (princ ";
220
234
cl_object output;
221
 
si_select_package(make_simple_string(\"CL-USER\"));
 
235
si_select_package(make_simple_base_string(\"CL-USER\"));
222
236
output = cl_safe_eval(c_string_to_object(lisp_code), Cnil, OBJNULL);
223
237
" stream)
224
238
                   (when (eq target :program)
279
293
         (setf init-name (init-function-name (pathname-name output-name) nil)))
280
294
       (format c-file +lisp-program-init+ init-name "" shared-data-file
281
295
               submodules "")
282
 
       (format c-file +lisp-program-main+ prologue-code init-name epilogue-code)
 
296
       (format c-file #+:win32 (ecase system (:console +lisp-program-main+)
 
297
                                             (:windows +lisp-program-winmain+))
 
298
                      #-:win32 +lisp-program-main+
 
299
                      prologue-code init-name epilogue-code)
283
300
       (close c-file)
284
301
       (compiler-cc c-name o-name)
285
302
       (apply #'linker-cc output-name (namestring o-name) ld-flags))
465
482
        (when *compile-verbose* (format t "~&;;; End of Pass 1.  "))
466
483
        (compiler-pass2 c-pathname h-pathname data-pathname system-p
467
484
                        (if system-p
468
 
                            (pathname-name input-pathname)
 
485
                            (pathname-name output-file)
469
486
                            "code")
470
487
                        shared-data-file))
471
488