rust/cargo-c: update to 0.10.7+cargo-0.84.0
[oi-userland.git] / components / runtime / ocaml / Makefile
blobdf7b5cf6f7feff21926d24cb17e82665379d001a
2 # CDDL HEADER START
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.
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.
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]
19 # CDDL HEADER END
23 # Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2017 Andreas Grueninger, Grueninger GmbH, (grueni). All rights reserved.
25 # Copyright 2023 Friedrich Kink. All rights reserved.
28 include ../../../make-rules/shared-macros.mk
30 COMPONENT_NAME= ocaml
31 COMPONENT_VERSION_MAJOR= 5.2
32 COMPONENT_VERSION= $(COMPONENT_VERSION_MAJOR).0
33 COMPONENT_SUMMARY= Objective Caml compiler and programming environment
34 COMPONENT_DESCRIPTION= Objective Caml is a high-level, strongly-typed, functional and object-oriented programming language \
35 from the ML family of languages. This package comprises two batch compilers \
36 (a fast bytecode compiler and an optimizing native-code compiler), an interactive toplevel system, \
37 parsing tools (Lex,Yacc,Camlp4), a replay debugger, documentation generator, and a comprehensive library.
38 COMPONENT_PROJECT_URL= https://ocaml.org
39 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
40 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
41 COMPONENT_ARCHIVE_SRC= $(COMPONENT_VERSION).tar.gz
42 COMPONENT_ARCHIVE_HASH= sha256:48554abfd530fcdaa08f23f801b699e4f74c320ddf7d0bd56b0e8c24e55fc911
43 COMPONENT_ARCHIVE_URL= https://github.com/$(COMPONENT_NAME)/$(COMPONENT_NAME)/archive/$(COMPONENT_ARCHIVE_SRC)
44 COMPONENT_FMRI= runtime/ocaml
45 COMPONENT_CLASSIFICATION= Development/System
46 COMPONENT_LICENSE= QPLv1, GPLv2
47 COMPONENT_LICENSE_FILE= LICENSE
49 # Documentation sources
50 COMPONENT_ARCHIVE_1= ocaml-$(COMPONENT_VERSION_MAJOR)-refman-html.tar.gz
51 COMPONENT_ARCHIVE_HASH_1= sha256:361b7096d0092b11b96f0beee217af2b8c6fe3981145a2c4b4d43d656e4dcaf5
52 COMPONENT_ARCHIVE_URL_1= https://caml.inria.fr/distrib/ocaml-$(COMPONENT_VERSION_MAJOR)/$(COMPONENT_ARCHIVE_1)
54 COMPONENT_ARCHIVE_2= ocaml-$(COMPONENT_VERSION_MAJOR)-refman.pdf
55 COMPONENT_ARCHIVE_HASH_2= sha256:898c1d57eff48fb4756e87a96af5a144686e8fd5413f44ca3f8b47831917d621
56 COMPONENT_ARCHIVE_URL_2= https://caml.inria.fr/distrib/ocaml-$(COMPONENT_VERSION_MAJOR)/$(COMPONENT_ARCHIVE_2)
58 COMPONENT_ARCHIVE_3= ocaml-$(COMPONENT_VERSION_MAJOR)-refman.info.tar.gz
59 COMPONENT_ARCHIVE_HASH_3= sha256:947d1f44d27a096b421e791dd2b46776e5bc87cee1f451bf701687d87d09553e
60 COMPONENT_ARCHIVE_URL_3= https://caml.inria.fr/distrib/ocaml-$(COMPONENT_VERSION_MAJOR)/$(COMPONENT_ARCHIVE_3)
62 include $(WS_MAKE_RULES)/common.mk
64 COMPONENT_BUILD_ARGS= -j1
66 # Set up some environment variables to make things look nicer.
67 # We make an 64 build and use /usr/bin/ for the commands
68 UL_OCAML_PDFDOC = $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_2)
70 CONFIGURE_OPTIONS = --bindir=$(CONFIGURE_BINDIR.$(BITS))
71 CONFIGURE_OPTIONS += --libdir=$(CONFIGURE_LIBDIR.$(BITS))/$(COMPONENT_NAME)
72 CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR)
73 CONFIGURE_OPTIONS += --datarootdir=$(CONFIGURE_PREFIX)/share/$(COMPONENT_NAME)
74 CONFIGURE_OPTIONS += --disable-debug-runtime
75 CONFIGURE_OPTIONS += --without-gnu-ld
76 CONFIGURE_OPTIONS += --enable-installing-bytecode-programs
77 CONFIGURE_OPTIONS += --enable-flambda
78 # otherwise no tests possible
79 CONFIGURE_OPTIONS += --enable-ocamltest
81 COMPONENT_PRE_CONFIGURE_ACTION= ($(CLONEY) $(SOURCE_DIR) $(@D))
83 # otherwise test run would not succeed
84 COMPONENT_POST_CONFIGURE_ACTION= $(GSED) -i -e 's:$(SOURCE_DIR):$(@D):' $(@D)/ocamltest/ocamltest_config.ml
86 COMPONENT_BUILD_TARGETS= world opt opt.opt
88 COMPONENT_POST_BUILD_ACTION= ( \
89 cd $(@D); \
90 $(GTAR) xf $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_1); \
91 $(GTAR) xf $(USERLAND_ARCHIVES)$(COMPONENT_ARCHIVE_3); )
93 # This action moves additional files we want to install into the proto area.
94 # I prefer using "cp -R" for copying the documentation tarball and example
95 # contents since it will make it easier to see new files need to be packaged
96 # when Ocaml is updated.
98 COMPONENT_POST_INSTALL_ACTION= ( \
99 cd $(@D) && \
100 $(MKDIR) $(PROTOUSRSHAREDIR)/info && \
101 $(MKDIR) $(PROTOUSRSHAREDOCDIR)/$(COMPONENT_NAME) && \
102 $(CP) $(@D)/infoman/ocaml*.gz $(PROTOUSRSHAREDIR)/info && \
103 $(CP) $(UL_OCAML_PDFDOC) $(PROTOUSRSHAREDOCDIR)/$(COMPONENT_NAME)/refman.pdf && \
104 $(CP) -R $(@D)/htmlman $(PROTOUSRSHAREDOCDIR)/$(COMPONENT_NAME))
106 # target all uses the new ocamltests, legacy uses the Makefile based tests.
107 # All tests succeed but the parsing of the ocamltest results is wrong and
108 # leads to erroneously failing tests.
109 # Only native tests are concerned.
110 COMPONENT_TEST_TARGETS= all
111 #COMPONENT_TEST_TARGETS = legacy
112 COMPONENT_TEST_ARGS += SHELL=$(SHELL)
113 COMPONENT_TEST_DIR= $(@D)/testsuite
114 COMPONENT_TEST_TRANSFORMER= $(NAWK)
115 COMPONENT_TEST_TRANSFORMS = "'/tests passed|tests skipped|tests failed|unexpected errors|tests considered/'"
117 ASLR_MODE= $(ASLR_ENABLE)
119 # Auto-generated dependencies
120 REQUIRED_PACKAGES += compress/zstd
121 REQUIRED_PACKAGES += system/library
122 REQUIRED_PACKAGES += system/library/math