|
1 # |
|
2 # CDDL HEADER START |
|
3 # |
|
4 # The contents of this file are subject to the terms of the |
|
5 # Common Development and Distribution License (the "License"). |
|
6 # You may not use this file except in compliance with the License. |
|
7 # |
|
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE |
|
9 # or http://www.opensolaris.org/os/licensing. |
|
10 # See the License for the specific language governing permissions |
|
11 # and limitations under the License. |
|
12 # |
|
13 # When distributing Covered Code, include this CDDL HEADER in each |
|
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE. |
|
15 # If applicable, add the following below this CDDL HEADER, with the |
|
16 # fields enclosed by brackets "[]" replaced with your own identifying |
|
17 # information: Portions Copyright [yyyy] [name of copyright owner] |
|
18 # |
|
19 # CDDL HEADER END |
|
20 # |
|
21 |
|
22 # |
|
23 # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. |
|
24 # |
|
25 |
|
26 include ../../make-rules/shared-macros.mk |
|
27 |
|
28 PATH=/usr/bin:/usr/gnu/bin:/usr/sbin:$(SPRO_VROOT)/bin |
|
29 |
|
30 COMPONENT_NAME= ocaml |
|
31 COMPONENT_VERSION= 3.11.2 |
|
32 COMPONENT_PROJECT_URL= http://www.ocaml.org |
|
33 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION) |
|
34 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.bz2 |
|
35 COMPONENT_ARCHIVE_HASH= \ |
|
36 sha256:86f3387a0d7e7c8be2a3c53af083a5a726e333686208d5ea0dd6bb5ac3f58143 |
|
37 COMPONENT_ARCHIVE_URL= http://caml.inria.fr/distrib/ocaml-3.11/$(COMPONENT_ARCHIVE) |
|
38 |
|
39 # Documentation sources |
|
40 # |
|
41 COMPONENT_ARCHIVE_1= ocaml-3.11-refman.html.tar.gz |
|
42 COMPONENT_ARCHIVE_HASH_1= \ |
|
43 sha256:1c65b334ccb155aefa1e5e930a91f816d843d37e26b27d3a0351c57149005a5c |
|
44 COMPONENT_ARCHIVE_URL_1= http://caml.inria.fr/distrib/ocaml-3.11/$(COMPONENT_ARCHIVE_1) |
|
45 |
|
46 COMPONENT_ARCHIVE_2= ocaml-3.11-refman.pdf |
|
47 COMPONENT_ARCHIVE_HASH_2= \ |
|
48 sha256:35f5adfeb92817f7e3ef66dec6b4ca910f48a3a2cf0bfa34bd155fe6866de405 |
|
49 COMPONENT_ARCHIVE_URL_2= http://caml.inria.fr/distrib/ocaml-3.11/$(COMPONENT_ARCHIVE_2) |
|
50 |
|
51 COMPONENT_ARCHIVE_3= ocaml-3.11-refman.info.tar.gz |
|
52 COMPONENT_ARCHIVE_HASH_3= \ |
|
53 sha256:48eedc6a870bef84562b2d0ed25d9c3b15ab646f72ecfb4c6c2cbaccc6b4081d |
|
54 COMPONENT_ARCHIVE_URL_3= http://caml.inria.fr/distrib/ocaml-3.11/$(COMPONENT_ARCHIVE_3) |
|
55 |
|
56 COMPONENT_BUGDB= utility/ocaml |
|
57 |
|
58 include ../../make-rules/prep.mk |
|
59 include ../../make-rules/configure.mk |
|
60 include ../../make-rules/ips.mk |
|
61 |
|
62 CONFIGURE_ENV += CFLAGS="$(CFLAGS)" |
|
63 |
|
64 # We don't support 64-bit yet, but this will be needed when we do. |
|
65 CONFIGURE_ENV.64 += UL_LDFLAGS="-m64" |
|
66 |
|
67 # Ocaml does not use a standard configure script, but has its own handwritten |
|
68 # one. So we must specify the arguments it accepts by hand. |
|
69 # |
|
70 CONFIGURE_OPTIONS = --bindir $(CONFIGURE_BINDIR.$(BITS)) |
|
71 CONFIGURE_OPTIONS += --libdir $(CONFIGURE_LIBDIR.$(BITS))/ocaml |
|
72 CONFIGURE_OPTIONS += --x11lib $(CONFIGURE_LIBDIR.$(BITS)) |
|
73 CONFIGURE_OPTIONS += --x11include $(CONFIGURE_INCLUDEDIR) |
|
74 CONFIGURE_OPTIONS += --mandir $(CONFIGURE_MANDIR) |
|
75 CONFIGURE_OPTIONS += -cc cc |
|
76 CONFIGURE_OPTIONS += -aspp "/usr/bin/as -P" |
|
77 CONFIGURE_OPTIONS += -as "/usr/bin/as" |
|
78 |
|
79 COMPONENT_PRE_CONFIGURE_ACTION = \ |
|
80 ($(CLONEY) $(SOURCE_DIR) $(@D)) |
|
81 |
|
82 COMPONENT_BUILD_TARGETS = world opt opt.opt |
|
83 |
|
84 # Set up some environment variables to make things look nicer. |
|
85 # |
|
86 UL_OCAML_PDFDOC = $(COMPONENT_DIR)/$(COMPONENT_ARCHIVE_2) |
|
87 UL_OCAML_INCLUDES = -nostdlib -I stdlib -I utils -I parsing -I typing -I bytecomp -I asmcomp -I driver |
|
88 UL_OCAML_ALLINCLUDES = $(UL_OCAML_INCLUDES) -I otherlibs/unix -I otherlibs/str -I otherlibs/dynlink |
|
89 UL_PROTO_BINDIR = $(PROTO_DIR)/$(CONFIGURE_BINDIR.$(BITS)) |
|
90 UL_PROTO_LIBDIR = $(PROTO_DIR)/$(CONFIGURE_LIBDIR.$(BITS)) |
|
91 UL_PROTO_INFODIR = $(PROTO_DIR)/$(CONFIGURE_INFODIR) |
|
92 UL_PROTO_DATADIR = $(PROTO_DIR)/$(CONFIGURE_PREFIX)/share |
|
93 COMPONENT_INSTALL_ARGS += EMACSDIR="$(UL_PROTO_DATADIR)/emacs/site-lisp" |
|
94 UL_PROTO_DOCDIR = $(UL_PROTO_DATADIR)/doc/ocaml |
|
95 UL_PROTO_EXAM = $(UL_PROTO_DOCDIR)/otherlibs/labltk |
|
96 |
|
97 # This action unpacks the additional tarballs and builds some additional |
|
98 # useful programs. For example, the ocamlbyteinfo and ocamlplugininfo |
|
99 # utilities are useful additions from Debian, and also included in RHEL. |
|
100 # http://git.debian.org/?p=pkg-ocaml-maint/packages/ocaml.git;a=tree;f=debian/ocamlbyteinfo;hb=HEAD |
|
101 # |
|
102 |
|
103 COMPONENT_POST_BUILD_ACTION = (cd $(@D); \ |
|
104 export LD_EXEC_OPTIONS="-z aslr=disable"; \ |
|
105 $(UNPACK) $(UNPACK_ARGS) ../../$(COMPONENT_ARCHIVE_1); \ |
|
106 $(UNPACK) $(UNPACK_ARGS) ../../$(COMPONENT_ARCHIVE_3); \ |
|
107 $(CP) $(COMPONENT_DIR)/files/ocamlbyteinfo.ml $(@D); \ |
|
108 $(CP) $(COMPONENT_DIR)/files/ocamlplugininfo.ml $(@D); \ |
|
109 $(CP) ./otherlibs/dynlink/natdynlink.ml .; \ |
|
110 ($(ENV) $(COMPONENT_BUILD_ENV) $(GMAKE) \ |
|
111 $(COMPONENT_BUILD_ARGS) -C emacs ocamltags); \ |
|
112 ($(ENV) $(COMPONENT_BUILD_ENV) \ |
|
113 boot/ocamlrun ./ocamlc $(UL_OCAML_ALLINCLUDES) \ |
|
114 dynlinkaux.cmo ocamlbyteinfo.ml -o ocamlbyteinfo); \ |
|
115 ($(ENV) $(COMPONENT_BUILD_ENV) \ |
|
116 boot/ocamlrun ./ocamlopt $(UL_OCAML_ALLINCLUDES) \ |
|
117 unix.cmxa str.cmxa natdynlink.ml ocamlplugininfo.ml \ |
|
118 -o ocamlplugininfo); \ |
|
119 ($(ENV) $(COMPONENT_BUILD_ENV) \ |
|
120 boot/ocamlrun ./ocamlopt $(UL_OCAML_INCLUDES) \ |
|
121 -o objinfo config.cmx tools/objinfo.ml)) |
|
122 |
|
123 COMPONENT_INSTALL_ARGS += BINDIR="$(UL_PROTO_BINDIR)" |
|
124 COMPONENT_INSTALL_ARGS += LIBDIR="$(UL_PROTO_LIBDIR)/ocaml" |
|
125 COMPONENT_INSTALL_ARGS += MANDIR="$(PROTOUSRSHAREMANDIR)" |
|
126 COMPONENT_INSTALL_ARGS += EMACSDIR="$(UL_PROTO_DATADIR)/emacs/site-lisp" |
|
127 |
|
128 # This action moves additional files we want to install into the proto area. |
|
129 # I prefer using "cp -R" for copying the documentation tarball and example |
|
130 # contents since it will make it easier to see new files need to be packaged |
|
131 # when Ocaml is updated. |
|
132 # |
|
133 COMPONENT_POST_INSTALL_ACTION = (cd $(@D)/emacs ; \ |
|
134 $(ENV) $(COMPONENT_BUILD_ENV) $(GMAKE) install install-ocamltags $(COMPONENT_INSTALL_ARGS); \ |
|
135 cd $(@D); \ |
|
136 $(MKDIR) -p $(UL_PROTO_INFODIR); \ |
|
137 $(CP) $(@D)/infoman/ocaml*.gz $(UL_PROTO_INFODIR); \ |
|
138 $(MKDIR) -p $(UL_PROTO_EXAM); \ |
|
139 $(CP) $(UL_OCAML_PDFDOC) $(UL_PROTO_DOCDIR)/refman.pdf; \ |
|
140 $(CP) -R $(@D)/htmlman $(UL_PROTO_DOCDIR); \ |
|
141 $(CP) -R $(@D)/otherlibs/labltk/examples_* $(UL_PROTO_EXAM); \ |
|
142 $(RM) $(UL_PROTO_EXAM)/examples_*/.cvsignore) |
|
143 |
|
144 # ASLR should be enabled when 64-bit support is enabled, which is planned as |
|
145 # a follow-on step. |
|
146 # |
|
147 ASLR_MODE = $(ASLR_DISABLE) |
|
148 |
|
149 # Files built in the COMPONENT_POST_INSTALL_ACTION are found by setting |
|
150 # PKG_PROTO_DIRS as follows: |
|
151 # |
|
152 PKG_PROTO_DIRS += $(BUILD_DIR_$(BITS)) |
|
153 |
|
154 # common targets |
|
155 build: $(BUILD_32) |
|
156 |
|
157 install: $(INSTALL_32) |
|
158 |
|
159 test: $(TEST_32) |
|
160 |
|
161 BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS) |
|
162 |
|
163 include ../../make-rules/depend.mk |