openexr: make architecture independent
[oi-userland.git] / components / sysutils / coreutils / Makefile
bloba6df1938caeffe37c5f570bff42a6733c5266ddf
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) 2011, 2017, Oracle and/or its affiliates. All rights reserved.
24 # Copyright 2017 Gary Mills
25 # Copyright 2017 Aurelien Larcher
26 # Copyright 2019 Michal Nowak
27 # Copyright 2020-2021 Nona Hansel
30 include ../../../make-rules/shared-macros.mk
32 COMPONENT_NAME= coreutils
33 COMPONENT_VERSION= 9.1
34 COMPONENT_FMRI= file/gnu-coreutils
35 COMPONENT_SUMMARY= GNU Core Utilities
36 COMPONENT_DESCRIPTION= GNU Core Utilities are the basic file, shell and text manipulation utilities
37 COMPONENT_CLASSIFICATION=Applications/System Utilities
38 COMPONENT_PROJECT_URL= https://www.gnu.org/software/coreutils/
39 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
40 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.xz
41 COMPONENT_ARCHIVE_HASH= sha256:61a1f410d78ba7e7f37a5a4f50e6d1320aca33375484a3255eddf17a38580423
42 COMPONENT_ARCHIVE_URL= https://ftp.gnu.org/gnu/coreutils/$(COMPONENT_ARCHIVE)
43 COMPONENT_LICENSE= GPLv3, FDLv1.3
45 include $(WS_MAKE_RULES)/common.mk
47 # We need the GNU grep command to configure/build.
48 PATH = $(PATH.gnu)
50 PATCH_LEVEL= 0
52 # Prevent gcc register spill error on 32-bit SPARC
53 gcc_OPT.sparc.32 = -O1
55 # Recreate configure and Makefile to pick up changes in .../src/local.mk
56 COMPONENT_PREP_ACTION = (cd $(@D) ; autoreconf -f -i)
58 CONFIGURE_PREFIX = $(GNUDIR)
59 CONFIGURE_BINDIR.64 = $(GNUBIN)
60 CONFIGURE_OPTIONS += CPPFLAGS=" -I$(USRINCDIR)/gmp"
61 CONFIGURE_OPTIONS += --libdir=$(USRLIBDIR.$(BITS))
62 # Put libstdbuf in the library directory
63 CONFIGURE_OPTIONS += --libexecdir=$(USRLIBDIR.$(BITS))
64 CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
66 # Enable ASLR for this component
67 ASLR_MODE = $(ASLR_ENABLE)
69 # OS as reported by `uname -o`
70 CONFIGURE_ENV += gl_cv_host_operating_system=illumos
72 COMPONENT_POST_INSTALL_ACTION += ( cp $(COMPONENT_DIR)/files/*.1 \
73 $(PROTOGNUSHAREMAN1) )
75 # Build 32-bit for libstdbuf only, then overwrite with 64bit binaries
76 build: $(BUILD_32_and_64)
78 # Make sure 32-bit binaries are installed first
79 $(INSTALL_64): $(INSTALL_32)
81 install: $(INSTALL_32_and_64)
83 # Needed for "gmake test" to work successfully.
84 # If SHELLOPTS is exported (as it is by the userland makefiles),
85 # then all shell options get exported to child invocations of bash,
86 # which results in test failures due to nounset and xtrace being
87 # set unexpectedly, and errors such as "$1: unbound variable" and
88 # diffs failing due to script tracing in output files.
89 unexport SHELLOPTS
91 # Get the binaries to test from the component proto area.
92 COMPONENT_TEST_ENV += PATH=$(PROTOGNUBIN):$(USRBINDIR)
94 # Always show the build and link lines for easier debugging.
95 # COMPONENT_TEST_ARGS += V=1
98 # Master test results are different between x86 and SPARC (different # of
99 # tests run).
100 COMPONENT_TEST_MASTER = \
101 $(COMPONENT_TEST_RESULTS_DIR)/results-$(MACH).master
103 # Some tests pass or are skip depending on the host.
104 # Let us just check for failed tests.
105 COMPONENT_TEST_TRANSFORMS += \
106 '-n ' \
107 '-e "/TOTAL/p" ' \
108 '-e "/FAIL/p" ' \
109 '-e "/ERROR/p" '
111 test: install $(TEST_64)
113 # Auto-generated dependencies
114 REQUIRED_PACKAGES += library/gmp
115 REQUIRED_PACKAGES += system/library