From 879f4fa041cfdefee655eb877f1a91f86a9c62b7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 3 Mar 2017 00:56:40 -0800 Subject: New upstream version 5f2 --- build.scm | 114 ++++++++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 85 insertions(+), 29 deletions(-) mode change 100644 => 100755 build.scm (limited to 'build.scm') diff --git a/build.scm b/build.scm old mode 100644 new mode 100755 index 28a768e..ae1dd7c --- a/build.scm +++ b/build.scm @@ -23,9 +23,10 @@ (require 'object->string) (require 'filename) (require 'batch) +(require-if 'compiling 'alist-table) (require-if 'compiling 'posix-time) ;@ -(set! OPEN_WRITE "w") ; Because MS-DOS scripts need ^M +(define OPEN_WRITE "w") ; Because MS-DOS scripts need ^M ;@ (define build (add-command-tables (create-database #f 'alist-table))) @@ -144,7 +145,7 @@ ("unexalpha.c" c-source platform-specific "Convert a running program into an Alpha executable file.") ("unexsgi.c" c-source platform-specific "Convert a running program into an IRIX executable file.") ("unexsunos4.c" c-source platform-specific "Convert a running program into an executable file.") - ("macos-config.h" c-header platform-specific "Included by unexmacosx.c and lastfile.c.") + ("macosx-config.h" c-header platform-specific "Included by unexmacosx.c and lastfile.c.") ("unexmacosx.c" c-source platform-specific "Convert a running program into an executable file under MacOS X.") ("lastfile.c" c-source platform-specific "find the point in data space between data and libraries.") )) @@ -436,9 +437,19 @@ #;WB database with relational wrapper. (define-build-feature 'wb - '((c-file "../wb/blink.c" "../wb/blkio.c" "../wb/del.c" "../wb/ents.c" - "../wb/handle.c" "../wb/prev.c" "../wb/scan.c" "../wb/segs.c" - "../wb/stats.c" "../wb/wbsys.c" "../wb/db.c") + '((c-file + "../wb/c/blink.c" "../wb/c/blkio.c" "../wb/c/del.c" "../wb/c/ents.c" + "../wb/c/handle.c" "../wb/c/prev.c" "../wb/c/scan.c" "../wb/c/segs.c" + "../wb/c/stats.c" "../wb/c/wbsys.c" "../wb/c/wbscm.c") + (c-lib pthread) + (scm-srcdir "../scm") + (compiled-init "init_db"))) +(define-build-feature + 'wb-no-threads + '((c-file + "../wb/c/blink.c" "../wb/c/blkio.c" "../wb/c/del.c" "../wb/c/ents.c" + "../wb/c/handle.c" "../wb/c/prev.c" "../wb/c/scan.c" "../wb/c/segs.c" + "../wb/c/stats.c" "../wb/c/wbsys.c" "../wb/c/wbscm.c") (scm-srcdir "../scm") (compiled-init "init_db"))) @@ -545,6 +556,7 @@ (lib *unknown* "" "" #f () ("scmmain.c")) (mysql *unknown* "-I/usr/include/mysql" "-L/usr/lib/mysql -lmysqlclient" "/usr/lib/mysql/libmysqlclient.a" () ()) + (pthread *unknown* "" "-lpthread" #f () ()) (m gnu-win32 "" "" #f () ()) (c gnu-win32 "" "" #f () ()) @@ -824,6 +836,7 @@ (and (batch:try-chopped-command parms "qcl" "/AH" "/W1" "/Ze" "/O" "/Ot" "/DNDEBUG" + (include-spec "-I" parms) (c-includes parms) (c-flags parms) files) @@ -851,6 +864,7 @@ parms "wcc386p" "/mf" "/d2" "/ze" "/oxt" "/3s" "/zq" "/w3" + (include-spec "-I" parms) (c-includes parms) (c-flags parms) files) @@ -905,7 +919,8 @@ parms "gcc" "-c" (include-spec "-I" parms) - (c-includes parms) (c-flags parms) + (c-includes parms) + (c-flags parms) files) (truncate-up-to (map c->o files) "\\/")))) (defcommand link-c-program djgpp @@ -1077,14 +1092,17 @@ (append objects libs))) oname))) +(define (build-continue-ia64 parms) + (and (batch:try-command + parms "gcc -o get-contoffset-ia64 get-contoffset-ia64.c") + (batch:try-command + parms "./get-contoffset-ia64 contoffset-ia64.S") + (batch:try-command + parms "gcc -c continue-ia64.S"))) + (defcommand link-c-program linux-ia64 (lambda (oname objects libs parms) - (and (and (batch:try-command - parms "gcc -o get-contoffset-ia64 get-contoffset-ia64.c") - (batch:try-command - parms "./get-contoffset-ia64 contoffset-ia64.S") - (batch:try-command - parms "gcc -c continue-ia64.S")) + (and (build-continue-ia64 parms) (batch:try-command parms "gcc" "-rdynamic" "-o" oname "continue-ia64.o" (must-be-first @@ -1187,8 +1205,11 @@ (define c-files (remove-if (lambda (file) (member file suppressors)) files)) (and (batch:try-chopped-command - parms "gcc" "-c" (include-spec "-I" parms) - (c-includes parms) (c-flags parms) c-files) + parms "gcc" "-c" + (include-spec "-I" parms) + (c-includes parms) + (c-flags parms) + c-files) (let ((fnames (map c-> c-files))) (and (batch:try-command parms "dllwrap" @@ -1240,10 +1261,10 @@ (lambda (files parms) (and (batch:try-chopped-command parms - "cc" "-std1" + "cc" "-std1" "-c" ;;(if (member "-g" (c-includes parms)) "" "-O") - "-c" (c-includes parms) (include-spec "-I" parms) + (c-includes parms) (c-flags parms) files) (truncate-up-to (map c->o files) #\/)))) @@ -1251,8 +1272,11 @@ (lambda (files parms) (and (batch:try-chopped-command - parms "cc" "-std1" "-c" (c-includes parms) - (include-spec "-I" parms) (c-flags parms) files) + parms "cc" "-std1" "-c" + (include-spec "-I" parms) + (c-includes parms) + (c-flags parms) + files) (let* ((platform (car (parameter-list-ref parms 'platform))) (fnames (truncate-up-to (map c-> files) #\/))) (and (batch:try-command @@ -1307,7 +1331,9 @@ (and (batch:try-chopped-command parms "gcc" "-fpic" "-c" (include-spec "-I" parms) - (c-includes parms) (c-flags parms) files) + (c-includes parms) + (c-flags parms) + files) (let* ((platform (car (parameter-list-ref parms 'platform))) (fnames (truncate-up-to (map c-> files) #\/))) (and (batch:try-command @@ -1488,6 +1514,7 @@ (and (batch:try-chopped-command parms "cc" + (include-spec "-I" parms) (c-includes parms) (c-flags parms) (map c-> files)) @@ -1568,6 +1595,15 @@ (and (batch:try-command parms "ar rc" aname objects) (batch:try-command parms "ranlib" aname) aname)))) + +(defcommand make-archive linux-ia64 + (lambda (oname objects libs parms) + (let ((aname (string-append "lib" oname ".a"))) + (and (build-continue-ia64 parms) + (batch:try-command parms "ar rc" aname objects "continue-ia64.o") + (batch:try-command parms "ranlib" aname) + aname)))) + (defcommand compile-dll-c-files *unknown* (lambda (files parms) (and (batch:try-chopped-command parms @@ -1595,6 +1631,7 @@ ;;; gcc 3.4.2 for FreeBSD does not allow options other than default i.e. -O0 if NO -DGCC_SPARC_BUG - dai 2004-10-30 ;;"cc" "-O3 -pipe -DGCC_SPARC_BUG " "-c" "cc" "-O3 -pipe " "-c" + (include-spec "-I" parms) (c-includes parms) (c-flags parms) files) @@ -1615,7 +1652,10 @@ (lambda (files parms) (and (batch:try-chopped-command parms "cc" "-O3 -pipe " "-fPIC" "-c" - (c-includes parms) (c-flags parms) files) + (include-spec "-I" parms) + (c-includes parms) + (c-flags parms) + files) (let ((fnames (truncate-up-to (map c-> files) #\/))) (and (batch:try-command parms "cc" "-shared" @@ -1649,6 +1689,7 @@ (and (batch:try-chopped-command parms "cc" "-O3" "-c" + (include-spec "-I" parms) (c-includes parms) (c-flags parms) files) @@ -1664,11 +1705,18 @@ (defcommand compile-dll-c-files darwin (lambda (files parms) (and (batch:try-chopped-command - parms "gcc" "-c" - (c-includes parms) (c-flags parms) files) + parms + "env MACOSX_DEPLOYMENT_TARGET=10.3" + "gcc" "-c" + (include-spec "-I" parms) + (c-includes parms) + (c-flags parms) + files) (let ((fnames (truncate-up-to (map c-> files) #\/))) (and (batch:try-command - parms "gcc" "-dynamiclib" "-single_module" "-L." "-undefined" "dynamic_lookup" + parms + "env MACOSX_DEPLOYMENT_TARGET=10.3" + "gcc" "-dynamiclib" "-single_module" "-L." "-undefined" "dynamic_lookup" "-o" (string-append (car fnames) ".so") (map (lambda (fname) (string-append fname ".o")) fnames)) (for-each (lambda (fname) @@ -1681,6 +1729,7 @@ (let ((platform (car (parameter-list-ref parms 'platform)))) (and (batch:try-command parms + "env MACOSX_DEPLOYMENT_TARGET=10.3" "gcc" "-dynamiclib" "-L." "-undefined" "dynamic_lookup" "-o" (string-append (car (parameter-list-ref parms 'implvic)) @@ -1698,6 +1747,7 @@ (and (batch:try-chopped-command parms "cc" "-c" (include-spec "-I" parms) + (include-spec "-I" parms) (c-includes parms) (c-flags parms) files) @@ -1717,8 +1767,11 @@ (defcommand compile-dll-c-files netbsd (lambda (files parms) (and (batch:try-chopped-command - parms "cc" "-fPIC" "-c" (include-spec "-I" parms) - (c-includes parms) (c-flags parms) files) + parms "cc" "-fPIC" "-c" + (include-spec "-I" parms) + (c-includes parms) + (c-flags parms) + files) (let ((objs (map c->o files))) (and (batch:try-command parms "gcc" "-shared" "-fPIC" objs) (batch:try-command parms "mv" "a.out" (car objs)) @@ -1741,7 +1794,8 @@ (lambda (files parms) (and (batch:try-chopped-command parms - "cc" "-c" (include-spec "-I" parms) + "cc" "-c" + (include-spec "-I" parms) (c-includes parms) (c-flags parms) files) @@ -1761,8 +1815,11 @@ (defcommand compile-dll-c-files openbsd (lambda (files parms) (and (batch:try-chopped-command - parms "cc" "-fPIC" "-c" (include-spec "-I" parms) - (c-includes parms) (c-flags parms) files) + parms "cc" "-fPIC" "-c" + (include-spec "-I" parms) + (c-includes parms) + (c-flags parms) + files) (let ((objs (map c->o files))) (and (batch:try-command parms "gcc" "-shared" "-fPIC" objs) (batch:try-command parms "mv" "a.out" (car objs)) @@ -1940,7 +1997,6 @@ (in-vicinity (car (parameter-list-ref parms 'scm-srcdir)) "patchlvl.h")) ".scm"))) - ;;,@`(if (equal? "" implvic) '() (...)) ,@(if (string=? "" init=) '() `((define "INITS" ,init=))) ,@(if (string=? "" compiled-init=) '() -- cgit v1.2.3