1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
|
$NetBSD: patch-ag,v 1.2 2015/12/29 23:34:55 dholland Exp $
Dragonfly support.
--- build.scm.orig 2006-02-19 17:31:59.000000000 +0000
+++ build.scm
@@ -483,6 +483,7 @@
(gnu-win32 i386 unix gcc ) ;gcc
(djgpp i386 ms-dos gcc ) ;gcc
(freebsd i386 unix cc ) ;cc
+ (dragonfly i386 unix cc ) ;cc
(gcc *unknown* unix gcc ) ;gcc
(highc i386 ms-dos hc386 ) ;bind386
(hp-ux hp-risc hp-ux cc ) ;cc
@@ -647,6 +648,14 @@
(dlll freebsd "-DSUN_DL" "-export-dynamic" "" () ())
(nostart freebsd "" "-e start -dc -dp -Bstatic -lgnumalloc" #f ("pre-crt0.c") ())
(dump freebsd "" "/usr/lib/crt0.o" "" ("unexsunos4.c") ())
+ (c dragonfly "" "-export-dynamic" #f () ())
+ (m dragonfly "" "-lm" #f () ())
+ (curses dragonfly "" "-lncurses" "/usr/lib/libncurses.a" () ())
+ (regex dragonfly "-I/usr/include/gnu" "-lgnuregex" "" () ())
+ (editline dragonfly "" "-lreadline" "" () ())
+ (dlll dragonfly "-DSUN_DL" "-export-dynamic" "" () ())
+ (nostart dragonfly "" "-e start -dc -dp -Bstatic -lgnumalloc" #f ("pre-crt0.c") ())
+ (dump dragonfly "" "/usr/lib/crt0.o" "" ("unexsunos4.c") ())
(curses netbsd "-I/usr/pkg/include" "-lncurses" "-Wl,-rpath -Wl,/usr/pkg/lib -L/usr/pkg/lib" () ())
(editline netbsd "-I/usr/pkg/include" "-lreadline" "-Wl,-rpath -Wl,/usr/pkg/lib -L/usr/pkg/lib" () ())
(graphics netbsd "-I/usr/X11R6/include -DX11" "-lX11" "-Wl,-rpath -Wl,/usr/X11R6/lib -L/usr/X11R6/lib" () ())
@@ -1626,6 +1635,62 @@
(car (parameter-list-ref parms 'implvic))
oname ".so"))))
+(defcommand compile-c-files dragonfly
+ (lambda (files parms)
+ (and (batch:try-chopped-command
+ parms
+;;; 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"
+ (c-includes parms)
+ (c-flags parms)
+ files)
+ (map c->o files))))
+(defcommand link-c-program dragonfly
+ (lambda (oname objects libs parms)
+ (batch:rename-file parms
+ oname (string-append oname "~"))
+ (and (batch:try-command parms
+ "cc" "-o" oname
+ (must-be-first
+ '("-nostartfiles"
+ "pre-crt0.o" "crt0.o"
+ "/usr/lib/crt0.o")
+ (append objects libs)))
+ oname)))
+(defcommand compile-dll-c-files dragonfly
+ (lambda (files parms)
+ (and (batch:try-chopped-command
+ parms "cc" "-O3 -pipe " "-fPIC" "-c"
+ (c-includes parms) (c-flags parms) files)
+ (let ((fnames (truncate-up-to (map c-> files) #\/)))
+ (and (batch:try-command
+ parms "cc" "-shared"
+ (cond
+ ((equal? (car fnames) "edline") "-lreadline")
+ ((equal? (car fnames) "x") "-L/usr/X11R6/lib -lSM -lICE -lXext -lX11 -lxpg4")
+ (else ""))
+ "-o" (string-append (car fnames) ".so")
+ (map (lambda (fname) (string-append fname ".o")) fnames))
+ (for-each (lambda (fname)
+ (batch:delete-file
+ parms (string-append fname ".o")))
+ fnames)
+ (list (string-append (car fnames) ".so")))))))
+(defcommand make-dll-archive dragonfly
+ (lambda (oname objects libs parms)
+ (and (batch:try-command
+ parms
+ "cc" "-shared" "-o"
+ (string-append
+ (car (parameter-list-ref parms 'implvic))
+ oname ".so")
+ objects)
+ (batch:rebuild-catalog parms)
+ (string-append
+ (car (parameter-list-ref parms 'implvic))
+ oname ".so"))))
+
(defcommand compile-c-files darwin
(lambda (files parms)
(and (batch:try-chopped-command
|