File: native.l

package info (click to toggle)
picolisp 3.1.0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 4,100 kB
  • sloc: ansic: 14,205; lisp: 795; makefile: 290; sh: 13
file content (34 lines) | stat: -rw-r--r-- 1,172 bytes parent folder | download
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
# 24mar11abu
# (c) Software Lab. Alexander Burger

(de gcc (Nm L . Lst)
   (out (tmp Nm ".c") (here "/**/"))
   ~(case *OS
      (("Linux" "FreeBSD")
         (quote
            (apply call L 'gcc "-o" (tmp Nm)
               "-fPIC" "-m64" "-shared" "-export-dynamic"
               "-O" "-falign-functions" "-fomit-frame-pointer"
               "-W" "-Wimplicit" "-Wreturn-type" "-Wunused" "-Wformat"
               "-Wuninitialized" "-Wstrict-prototypes"
               "-pipe" "-D_GNU_SOURCE" (tmp Nm ".c") ) ) )
      ("SunOS"
         (quote
            (apply call L 'gcc "-o" (tmp Nm)
               "-fPIC" "-m64" "-shared"
               "-O" "-falign-functions" "-fomit-frame-pointer"
               "-W" "-Wimplicit" "-Wreturn-type" "-Wunused" "-Wformat"
               "-Wuninitialized" "-Wstrict-prototypes"
               "-pipe" "-D_GNU_SOURCE" (tmp Nm ".c") ) ) ) )
   (for L Lst
      (def (car L)
         (list
            (cadr L)
            (cons 'native (tmp Nm) (name (caddr L)) (cdddr L)) ) )
      (when (== '@ (fin (cadr L)))
         (push (cdaar L) 'pass) ) ) )

(de unsigned (N)
   (& `(dec (** 2 32)) (+ N `(** 2 32))) )

# vi:et:ts=3:sw=3