Andreas Wacknitz
2024-03-25 46e90f2ec3893ee70dfcd2bb4dde52268312d7fb
commit | author | age
3cad62 1 #
AC 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 #
485742 22 # Copyright (c) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
e8579e 23 # Copyright 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
082e69 24 # Copyright 2016, 2022 Andreas Wacknitz <a.wacknitz@gmx.de>
db7734 25 # Copyright 2023 Niklas Poslovski
3cad62 26 #
e58f9c 27
024d19 28 USE_PARALLEL_BUILD= yes
3e9dd0 29 USE_COMMON_TEST_MASTER= no
9d45d0 30 include ../../../make-rules/shared-macros.mk
3cad62 31
e12e8f 32 COMPONENT_NAME=         cmake
46e90f 33 COMPONENT_MAJOR_VERSION= 3.29
AW 34 COMPONENT_VERSION=      $(COMPONENT_MAJOR_VERSION).0
e12e8f 35 COMPONENT_SUMMARY=      A cross-platform, open-source make system
485742 36 COMPONENT_DESCRIPTION= \
AL 37 CMake is a family of tools designed to build, test and package software. \
38 It is used to control the software compilation process using simple platform \
39 and compiler-independent configuration files. \
40 CMake generates native makefiles and workspaces that can be used in the \
33f4ef 41 workspaces that can be used in the compiler environment of your choice.
b3ecd2 42 COMPONENT_PROJECT_URL=  https://www.cmake.org
e12e8f 43 COMPONENT_SRC=          $(COMPONENT_NAME)-$(COMPONENT_VERSION)
AL 44 COMPONENT_ARCHIVE=      $(COMPONENT_SRC).tar.gz
46e90f 45 COMPONENT_ARCHIVE_HASH=    sha256:a0669630aae7baa4a8228048bf30b622f9e9fd8ee8cedb941754e9e38686c778
b3ecd2 46 COMPONENT_ARCHIVE_URL=    $(COMPONENT_PROJECT_URL)/files/v$(COMPONENT_MAJOR_VERSION)/$(COMPONENT_ARCHIVE)
9c4bc2 47 COMPONENT_FMRI=         developer/build/cmake
AW 48 COMPONENT_CLASSIFICATION=Development/Distribution Tools
46e90f 49 COMPONENT_LICENSE=      BSD 3 Clause, MIT, GPLv2, LGPLv2.1, LGPLv3, Curl, PD
3cad62 50
0024b0 51 include $(WS_MAKE_RULES)/common.mk
3cad62 52
AC 53 # Need to remove this option from LD_OPTIONS (only affects sparc build);
54 # it causes a SegFault failure in kwsys/testSystemInformation
55 # when testing on sparc
56 LD_MAP_NOEXBSS=
57
082e69 58 LDFLAGS += $($(COMPILER)_NORUNPATH)
3cad62 59
082e69 60 CONFIGURE_ENV += MAKE="$(GMAKE)"
3cad62 61
485742 62 # Remove undesriable /opt/csw lines from the Modules/*.cmake files.
AL 63 COMPONENT_PREP_ACTION += \
64     cd $(COMPONENT_SRC)/Modules; $(GNU_GREP) -l '/opt/csw' *.cmake | \
65     /usr/bin/xargs -I \{\} $(GSED) -i -e '/^[ ]*\/opt\/csw/d' \{\}
66
67 # Remove files polluting the generated manifest
68 COMPONENT_PRE_INSTALL_ACTION = \
69     $(FIND) $(SOURCE_DIR) -name '*.~1~' -exec $(RM) {} \;
30fa71 70
AW 71 # The default -O3 is *MUCH* too aggressive and will break things,
72 # not just in CMake but everywhere.
73 # CMake sets its own Language Standard flags in the Makefile it
74 # generates for itself. The Userland default Language Standard flags
75 # contradict cmake.
76 gcc_OPT = -O2
485742 77
024d19 78 CONFIGURE_OPTIONS  = --prefix=$(CONFIGURE_PREFIX)
AW 79 CONFIGURE_OPTIONS += --datadir=/share/cmake-$(COMPONENT_MAJOR_VERSION)
80 CONFIGURE_OPTIONS += --docdir=/share/doc/cmake-$(COMPONENT_MAJOR_VERSION)
81 CONFIGURE_OPTIONS += --mandir=/share/man
e8579e 82
5b42e7 83 # Use system-installed third-party libraries, rather than the private
485742 84 # copies in the cmake source.
024d19 85 CONFIGURE_OPTIONS += --system-bzip2
AW 86 CONFIGURE_OPTIONS += --system-curl
87 CONFIGURE_OPTIONS += --system-expat
88 CONFIGURE_OPTIONS += --system-jsoncpp
89 CONFIGURE_OPTIONS += --system-libarchive
90 CONFIGURE_OPTIONS += --system-liblzma
91 CONFIGURE_OPTIONS += --system-libuv
92 CONFIGURE_OPTIONS += --system-nghttp2
93 CONFIGURE_OPTIONS += --system-zlib
94 CONFIGURE_OPTIONS += --system-zstd
3cad62 95
024d19 96 COMPONENT_BUILD_ENV += CC="$(CC)"
AW 97 COMPONENT_BUILD_ENV += CXX="$(CXX)"
98 COMPONENT_BUILD_ENV += FC="$(FC)"
99 COMPONENT_BUILD_ENV += CFLAGS="$(CFLAGS)"
100 COMPONENT_BUILD_ENV += CXXFLAGS="$(CXXFLAGS)"
101 COMPONENT_BUILD_ENV += CFLAGS="$(FCFLAGS)"
102 COMPONENT_BUILD_ENV += LDFLAGS="$(LDFLAGS)"
103 COMPONENT_BUILD_ENV += MAKE="$(GMAKE)"
104 COMPONENT_BUILD_TARGETS= all
485742 105
59d033 106 ASLR_MODE = $(ASLR_ENABLE)
1d52aa 107
5b42e7 108 # Need C and C++ compiler locations for cmake tests
485742 109 COMPONENT_TEST_ENV += LANG=C
5b42e7 110 COMPONENT_TEST_ENV += CC="$(CC)"
AC 111 COMPONENT_TEST_ENV += CXX="$(CXX)"
e12e8f 112 COMPONENT_TEST_ENV += FC="$(FC)"
485742 113 COMPONENT_TEST_ENV += CFLAGS="$(CFLAGS)"
AL 114 COMPONENT_TEST_ENV += CXXFLAGS="$(CXXFLAGS)"
e12e8f 115 COMPONENT_TEST_ENV += FCFLAGS="$(FCFLAGS)"
485742 116 COMPONENT_TEST_ENV += LDFLAGS="$(LDFLAGS)"
30fa71 117 # Disable term colors to avoid test failures (actual and expected output mismatch).
AW 118 COMPONENT_TEST_ENV += CLICOLOR=0
485742 119
0024b0 120 # Most Fortran tests fail because -m64 they do not pass compiler flags as they should.
485742 121 # Results output is different on Intel vs. SPARC.
00ad30 122 # The tests should run by a user with default privileges. Otherwise some tests will fail.
485742 123 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master
9c4bc2 124 COMPONENT_TEST_TARGETS = test
3cad62 125
485742 126 COMPONENT_TEST_TRANSFORMS += \
057c2c 127     '-e "s/\s\s*[0-9][0-9]*\.[0-9][0-9]* sec//"' \
AW 128     '-e "s/\][0-9][0-9]*\.[0-9][0-9]* sec/\]/"' \
485742 129     '-e "/bin/ctest/d"' \
AL 130     '-e "/Test project/d"' \
131     '-e "/^[mM]ake/d"' \
132     '-e "s|^make.*: Leaving directory.*$$|XXX_REMOVE_XXX|g" ' \
133     '-e "s|^make.*: Entering directory.*$$|XXX_REMOVE_XXX|g" ' \
134     '-e "/^XXX_REMOVE_XXX$$/d" '
3cad62 135
485742 136 # Auto-generated dependencies
0024b0 137 REQUIRED_PACKAGES += $(GCC_RUNTIME_PKG)
AW 138 REQUIRED_PACKAGES += $(GXX_RUNTIME_PKG)
567766 139 REQUIRED_PACKAGES += library/expat
082e69 140 REQUIRED_PACKAGES += library/jsoncpp
567766 141 REQUIRED_PACKAGES += library/libarchive
082e69 142 REQUIRED_PACKAGES += library/libuv
567766 143 REQUIRED_PACKAGES += library/ncurses
AW 144 REQUIRED_PACKAGES += library/zlib
145 REQUIRED_PACKAGES += system/library
146 REQUIRED_PACKAGES += system/library/math
147 REQUIRED_PACKAGES += web/curl