]> rtime.felk.cvut.cz Git - l4.git/blob - l4/pkg/ocaml/contrib/build/otherlibs-targets.sh
Inital import
[l4.git] / l4 / pkg / ocaml / contrib / build / otherlibs-targets.sh
1 #!/bin/sh
2 # $Id: otherlibs-targets.sh 9281 2009-05-26 12:50:41Z ertai $
3 OTHERLIBS_BYTE=""
4 OTHERLIBS_NATIVE=""
5 OTHERLIBS_UNIX_NATIVE=""
6 UNIXDIR="otherlibs/unix"
7
8 add_native() {
9   for native_file in $@; do
10     OTHERLIBS_NATIVE="$OTHERLIBS_NATIVE otherlibs/$lib/$native_file"
11     case $lib in
12     unix|win32unix)
13       OTHERLIBS_UNIX_NATIVE="$OTHERLIBS_UNIX_NATIVE otherlibs/$lib/$native_file";;
14     esac
15   done
16 }
17
18 add_byte() {
19   for byte_file in $@; do
20     OTHERLIBS_BYTE="$OTHERLIBS_BYTE otherlibs/$lib/$byte_file"
21   done
22 }
23
24 add_file() {
25   add_byte $@
26   add_native $@
27 }
28
29 add_bin() {
30   for bin_file in $@; do
31     add_byte $bin_file.byte$EXE
32     add_native $bin_file.native$EXE
33   done
34 }
35
36 add_c_lib() {
37   add_file "lib$1.$A"
38 }
39
40 add_ocaml_lib() {
41   add_native "$1.cmxa"
42   add_native "$1.$A"
43   add_byte "$1.cma"
44 }
45
46 add_dll() {
47   add_file "dll$1$EXT_DLL"
48 }
49
50 add() {
51   add_c_lib $1
52   add_ocaml_lib $1
53   add_dll $1
54 }
55
56 THREADS_CMIS="thread.cmi mutex.cmi condition.cmi event.cmi threadUnix.cmi"
57
58 for lib in $OTHERLIBRARIES; do
59   case $lib in
60   num)
61     add nums;;
62   systhreads)
63     add_ocaml_lib threads
64     add_dll threads
65     add_file $THREADS_CMIS
66     add_byte libthreads.$A
67     add_native libthreadsnat.$A;;
68   graph|win32graph)
69     add graphics;;
70   threads)
71     add_byte pervasives.cmi pervasives.mli \
72              $THREADS_CMIS marshal.cmi marshal.mli \
73              stdlib.cma unix.cma threads.cma libvmthreads.$A;;
74   labltk)
75     add_file      support/camltk.h
76     add_byte      support/byte.otarget
77     add_native    support/native.otarget
78     add_file      support/liblabltk.$A
79     add_byte      compiler/tkcompiler$EXE compiler/pp$EXE
80     add_file      labltk/tk.ml labltk/labltk.ml
81     add_byte      labltk/byte.otarget
82     add_native    labltk/native.otarget
83     add_byte      camltk/byte.otarget
84     add_native    camltk/native.otarget
85     add_ocaml_lib lib/labltk
86     add_byte      lib/labltktop$EXE lib/labltk$EXE
87     add_ocaml_lib jpf/jpflib
88     add_ocaml_lib frx/frxlib
89     add_ocaml_lib tkanim/tkanim
90     add_file      tkanim/libtkanim.$A
91     add_byte      browser/ocamlbrowser$EXE
92     ;;
93   dbm)
94     add_ocaml_lib dbm
95     add_c_lib mldbm;;
96   dynlink)
97     add_ocaml_lib dynlink
98     add_native dynlink.cmx dynlink.$O
99     add_file $lib.cmi extract_crc;;
100   win32unix)
101     UNIXDIR="otherlibs/win32unix"
102     add_file unixsupport.h cst2constr.h socketaddr.h
103     add unix;;
104   unix)
105     add_file unixsupport.h
106     add unix;;
107   *)
108     add $lib
109   esac
110 done