15 # If applicable, add the following below this CDDL HEADER, with the |
15 # If applicable, add the following below this CDDL HEADER, with the |
16 # fields enclosed by brackets "[]" replaced with your own identifying |
16 # fields enclosed by brackets "[]" replaced with your own identifying |
17 # information: Portions Copyright [yyyy] [name of copyright owner] |
17 # information: Portions Copyright [yyyy] [name of copyright owner] |
18 # |
18 # |
19 # CDDL HEADER END |
19 # CDDL HEADER END |
|
20 # |
20 |
21 |
21 # |
22 # |
22 # Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved. |
23 # Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved. |
23 # |
24 # |
24 |
25 BUILD_BITS= 64 |
|
26 # Currently only builds with gcc |
|
27 COMPILER= gcc |
25 include ../../make-rules/shared-macros.mk |
28 include ../../make-rules/shared-macros.mk |
26 |
29 |
27 COMPONENT_NAME= cmake |
30 COMPONENT_NAME= cmake |
28 COMPONENT_VERSION= 3.3.2 |
31 COMPONENT_VERSION= 3.3.2 |
29 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION) |
|
30 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz |
|
31 COMPONENT_ARCHIVE_HASH= \ |
32 COMPONENT_ARCHIVE_HASH= \ |
32 sha256:e75a178d6ebf182b048ebfe6e0657c49f0dc109779170bad7ffcb17463f2fc22 |
33 sha256:e75a178d6ebf182b048ebfe6e0657c49f0dc109779170bad7ffcb17463f2fc22 |
33 COMPONENT_ARCHIVE_URL= http://www.cmake.org/files/v3.3/$(COMPONENT_ARCHIVE) |
34 COMPONENT_ARCHIVE_URL= http://www.cmake.org/files/v3.3/$(COMPONENT_ARCHIVE) |
34 COMPONENT_PROJECT_URL= http://www.cmake.org/ |
35 COMPONENT_PROJECT_URL= http://www.cmake.org/ |
35 COMPONENT_BUGDB= utility/cmake |
|
36 |
36 |
37 TPNO= 25030 |
37 TPNO= 25030 |
38 |
38 |
39 include $(WS_MAKE_RULES)/prep.mk |
39 # configure in cmake does not accept many of the options set in |
40 include $(WS_MAKE_RULES)/configure.mk |
40 # configure.mk (CC=, CXX=, --bindir, --libdir, --sbindir). |
41 include $(WS_MAKE_RULES)/ips.mk |
41 CONFIGURE_DEFAULT_DIRS= no |
|
42 |
|
43 # expected failure for test: CTestTestUpload |
|
44 SYSTEM_TEST_TARGET= build $(SYSTEM_TEST_64) |
|
45 include $(WS_MAKE_RULES)/common.mk |
42 |
46 |
43 # Remove undesriable /opt/csw lines from the Modules/*.cmake files. |
47 # Remove undesriable /opt/csw lines from the Modules/*.cmake files. |
44 COMPONENT_PREP_ACTION += \ |
48 COMPONENT_PREP_ACTION += \ |
45 cd $(COMPONENT_SRC)/Modules; $(GNU_GREP) -l '/opt/csw' *.cmake | /usr/bin/xargs -I \{\} $(GSED) -i -e '/^[ ]*\/opt\/csw/d' \{\} |
49 cd $(COMPONENT_SRC)/Modules; $(GNU_GREP) -l '/opt/csw' *.cmake | /usr/bin/xargs -I \{\} $(GSED) -i -e '/^[ ]*\/opt\/csw/d' \{\} |
46 # Currently only builds with gcc, and since it's C++, we'll just force it to |
50 # Since it's C++, force it to build as C++11 for ABI compatibility. |
47 # build as C++11 for ABI compatibility. |
|
48 COMPILER=gcc |
|
49 CXXFLAGS += -std=c++11 |
51 CXXFLAGS += -std=c++11 |
50 |
52 |
51 # Need to remove this option from LD_OPTIONS (only affects sparc build); |
53 # Need to remove this option from LD_OPTIONS (only affects sparc build); |
52 # it causes a SegFault failure in kwsys/testSystemInformation |
54 # it causes a SegFault failure in kwsys/testSystemInformation |
53 # when testing on sparc |
55 # when testing on sparc |
54 LD_MAP_NOEXBSS= |
56 LD_MAP_NOEXBSS.sparc= |
55 |
57 |
56 LDFLAGS += $($(COMPILER)_NORUNPATH) |
58 LDFLAGS += $($(COMPILER)_NORUNPATH) |
57 |
59 |
58 # We need these in the environment, although they are already passed |
60 # We need these in the environment, although they are already passed |
59 # as CONFIGURE_OPTIONS; otherwise the correct compilers are not used |
61 # as CONFIGURE_OPTIONS; otherwise the correct compilers are not used |
60 CONFIGURE_ENV += LDFLAGS="$(LDFLAGS)" |
|
61 CONFIGURE_ENV += MAKE="$(GMAKE)" |
62 CONFIGURE_ENV += MAKE="$(GMAKE)" |
62 CONFIGURE_ENV += CFLAGS="$(CFLAGS)" |
|
63 CONFIGURE_ENV += CXXFLAGS="$(CXXFLAGS)" |
|
64 |
|
65 # configure in cmake does not accept many of the options set in |
|
66 # configure.mk (CC=, CXX=, --bindir, --libdir, --sbindir). Clear those |
|
67 # out and just include the default options it does accept. |
|
68 CONFIGURE_OPTIONS = |
|
69 CONFIGURE_OPTIONS += --prefix=$(CONFIGURE_PREFIX) |
|
70 CONFIGURE_OPTIONS += --mandir=$(CONFIGURE_MANDIR) |
|
71 |
63 |
72 # Use system-installed third-party libraries, rather than the private |
64 # Use system-installed third-party libraries, rather than the private |
73 # copies in the cmake source. |
65 # copies in the cmake source. |
74 CONFIGURE_OPTIONS += --system-curl |
66 CONFIGURE_OPTIONS += --system-curl |
75 CONFIGURE_OPTIONS += --system-expat |
67 CONFIGURE_OPTIONS += --system-expat |
106 # symlinks to the system-installed binaries in /usr/bin, |
96 # symlinks to the system-installed binaries in /usr/bin, |
107 # which will be executed for the system-test target |
97 # which will be executed for the system-test target |
108 COMPONENT_PRE_SYSTEM_TEST_ACTION += \ |
98 COMPONENT_PRE_SYSTEM_TEST_ACTION += \ |
109 $(MV) $(BUILD_DIR_64)/bin $(BUILD_DIR_64)/bin-save; \ |
99 $(MV) $(BUILD_DIR_64)/bin $(BUILD_DIR_64)/bin-save; \ |
110 $(MKDIR) $(BUILD_DIR_64)/bin; cd $(BUILD_DIR_64)/bin; \ |
100 $(MKDIR) $(BUILD_DIR_64)/bin; cd $(BUILD_DIR_64)/bin; \ |
111 $(LN) -s /usr/bin/cmake; $(LN) -s /usr/bin/ctest; \ |
101 $(LN) -s $(USRBINDIR)/cmake; $(LN) -s /usr/bin/ctest; \ |
112 $(LN) -s /usr/bin/ccmake; $(LN) -s /usr/bin/cpack |
102 $(LN) -s $(USRBINDIR)/ccmake; $(LN) -s /usr/bin/cpack |
113 |
103 |
114 # Restore the built binaries after system-test is done |
104 # Restore the built binaries after system-test is done |
115 COMPONENT_POST_SYSTEM_TEST_ACTION += \ |
105 COMPONENT_POST_SYSTEM_TEST_ACTION += \ |
116 $(RM) -r $(BUILD_DIR_64)/bin; \ |
106 $(RM) -r $(BUILD_DIR_64)/bin; \ |
117 $(MV) $(BUILD_DIR_64)/bin-save $(BUILD_DIR_64)/bin |
107 $(MV) $(BUILD_DIR_64)/bin-save $(BUILD_DIR_64)/bin |
118 |
|
119 |
|
120 # common targets |
|
121 |
|
122 configure: $(CONFIGURE_64) |
|
123 |
|
124 build: $(BUILD_64) |
|
125 |
|
126 install: $(INSTALL_64) |
|
127 |
|
128 # expected failure: CTestTestUpload |
|
129 test: $(TEST_64) |
|
130 |
|
131 system-test: $(BUILD_64) $(SYSTEM_TEST_64) |
|
132 |
108 |
133 REQUIRED_PACKAGES += compress/bzip2 |
109 REQUIRED_PACKAGES += compress/bzip2 |
134 REQUIRED_PACKAGES += compress/xz |
110 REQUIRED_PACKAGES += compress/xz |
135 REQUIRED_PACKAGES += library/expat |
111 REQUIRED_PACKAGES += library/expat |
136 REQUIRED_PACKAGES += library/libarchive |
112 REQUIRED_PACKAGES += library/libarchive |
137 REQUIRED_PACKAGES += library/ncurses |
113 REQUIRED_PACKAGES += library/ncurses |
138 REQUIRED_PACKAGES += library/zlib |
114 REQUIRED_PACKAGES += library/zlib |
139 REQUIRED_PACKAGES += system/library |
|
140 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime |
115 REQUIRED_PACKAGES += system/library/gcc/gcc-c-runtime |
141 REQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime |
116 REQUIRED_PACKAGES += system/library/gcc/gcc-c++-runtime |
142 REQUIRED_PACKAGES += system/library/math |
117 REQUIRED_PACKAGES += system/library/math |
143 REQUIRED_PACKAGES += web/curl |
118 REQUIRED_PACKAGES += web/curl |