*** scsc/main.sc.orig Mon Feb 22 07:59:07 1993 --- scsc/main.sc Mon Jan 9 11:00:59 1995 *************** *** 59,65 **** readtext transform)) ! (define SCC-VERSION "15mar93jfb") ; Compiler version string. (define FORCE-LD-OF-REP read-eval-print) --- 59,67 ---- readtext transform)) ! (define scheme_dir "/usr/local/lib/schemetoc/") ! ! (define SCC-VERSION "15mar93-FreeBSD") ; Compiler version string. (define FORCE-LD-OF-REP read-eval-print) *************** *** 69,91 **** ;;; The following top-level variables define the implementation dependent ;;; information: ! (define PREDEF-DEFAULT "../scrt/predef.sc") ; File holding the declarations for predefined ; functions. (define C-INCLUDE-FILE "objects.h") ; #include file for the predefined functions. ! (define C-INCLUDE-DIR "../scrt") ; directory containing #include file for ; predefined functions. ! (define SC-LIBRARY "../scrt/libsc.a") ; Scheme->C library file. ! (define SC-LIBRARY_P "../scrt/libsc_p.a") ; Scheme->C profiled library file. ;;; When the compiler is invoked directly from the shell, the following ;;; function is invoked to control compilation. It will interprete the flags, ;;; invoke the compiler and then exit. Any compilation errors or Scheme errors --- 71,98 ---- ;;; The following top-level variables define the implementation dependent ;;; information: ! (define PREDEF-DEFAULT (string-append scheme_dir "predef.sc")) ! ; File holding the declarations for predefined ; functions. (define C-INCLUDE-FILE "objects.h") ; #include file for the predefined functions. ! (define C-INCLUDE-DIR scheme_dir) ; directory containing #include file for ; predefined functions. ! (define SC-LIBRARY (string-append scheme_dir "libsc.a")) ; Scheme->C library file. ! (define SCXL-LIBRARY (string-append scheme_dir "scxl.a")) ! ! (define SC-LIBRARY_P (string-append scheme_dir "libsc_p.a")) ; Scheme->C profiled library file. + (define compile-static #f) + ;;; When the compiler is invoked directly from the shell, the following ;;; function is invoked to control compilation. It will interprete the flags, ;;; invoke the compiler and then exit. Any compilation errors or Scheme errors *************** *** 123,128 **** --- 130,137 ---- ;;; ;;; -Ot optimize C code by omitting type checks. ;;; + ;;; -static compile static executable. + ;;; ;;; -pg compile for gprof profiling. ;;; ;;; -LIBDIR directory *************** *** 161,173 **** (c-flags '()) (sc-to-c.c "SC-TO-C.c") (sc-to-c.o "SC-TO-C.o") ! (directory-separator ! (if (equal? (list-ref (implementation-information) 5) ! "Microsoft Windows 3.x") ! "\\" ! "/")) (log '()) ! (cc "cc")) ;;; 1. Pick up the command line arguments. --- 170,178 ---- (c-flags '()) (sc-to-c.c "SC-TO-C.c") (sc-to-c.o "SC-TO-C.o") ! (directory-separator "/") (log '()) ! (cc "gcc")) ;;; 1. Pick up the command line arguments. *************** *** 233,238 **** --- 238,246 ---- (cons "(define-constant *type-check* #f)" flags)) (loop (cdr args))) + ((equal? arg "-static") + (set! compile-static #t) + (loop (cdr args))) ((equal? arg "-Ob") (set! flags (cons "(define-constant *bounds-check* #f)" *************** *** 295,314 **** ;;; C compiler to do the rest. (unless (eq? 0 ! (system (apply string-append ! `(,cc " -I" ,c-include-dir ! ,@(map (lambda (x) ! (string-append " " x)) ! (append (reverse c-flags) ! (if (member "-pg" ! c-flags) ! `(,sc-library_p ! "-lm") ! `(,sc-library ! "-lm")))))))) (reset)) (catch-error ! (lambda () (remove-file sc-to-c.c) (remove-file sc-to-c.o))))) --- 303,329 ---- ;;; C compiler to do the rest. (unless (eq? 0 ! (system (apply string-append ! `(,cc " -I" ,c-include-dir ! ,@(map (lambda (x) ! (string-append " " x)) ! (append (reverse c-flags) ! (if compile-static ! (if (member "-pg" c-flags) ! (list sc-library_p "-lm") ! (if (member "-c" c-flags) ! '() ! (if (member "xlib" with-modules) ! (list "-lm" sc-library scxl-library "-L/usr/X11R6/lib -lX11") ! (list "-lm" sc-library)))) ! (if (member "-c" c-flags) ! '() ! (if (member "xlib" with-modules) ! (list "-L/usr/X11R6/lib -lm -lsc -lscxl -lX11") ! (list "-lm -lsc")))))))))) (reset)) (catch-error ! (lambda () (remove-file sc-to-c.c) (remove-file sc-to-c.o))))) *************** *** 351,353 **** --- 366,369 ---- root.c) ;;; Pass argument to C. (else arg)))) +