97N/A#
97N/A# CDDL HEADER START
97N/A#
97N/A# The contents of this file are subject to the terms of the
97N/A# Common Development and Distribution License (the "License").
97N/A# You may not use this file except in compliance with the License.
97N/A#
97N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97N/A# or http://www.opensolaris.org/os/licensing.
97N/A# See the License for the specific language governing permissions
97N/A# and limitations under the License.
97N/A#
97N/A# When distributing Covered Code, include this CDDL HEADER in each
97N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
97N/A# If applicable, add the following below this CDDL HEADER, with the
97N/A# fields enclosed by brackets "[]" replaced with your own identifying
97N/A# information: Portions Copyright [yyyy] [name of copyright owner]
97N/A#
97N/A# CDDL HEADER END
97N/A#
5680N/A
97N/A#
5680N/A# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
5680N/A#
5680N/ABUILD_BITS= 64_and_32
97N/Ainclude ../../make-rules/shared-macros.mk
97N/A
97N/ACOMPONENT_NAME= lua
1119N/ACOMPONENT_VERSION= 5.2.1
618N/ACOMPONENT_PROJECT_URL= http://www.lua.org/
844N/ACOMPONENT_ARCHIVE_HASH= \
1119N/A sha256:64304da87976133196f9e4c15250b70f444467b6ed80d7cfd7b3b982b5177be5
618N/ACOMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)ftp/$(COMPONENT_ARCHIVE)
1119N/A
1119N/ALUA_TESTS= lua-5.2.1-tests
1119N/ACOMPONENT_ARCHIVE_1= $(LUA_TESTS).tar.gz
1119N/ACOMPONENT_ARCHIVE_HASH_1= \
1119N/A sha256:2346d635ee392c8d8024b07beaa10b7b66a3f861c41d575753d03155751cf114
1119N/ACOMPONENT_ARCHIVE_URL_1= $(COMPONENT_PROJECT_URL)/tests/5.2/$(COMPONENT_ARCHIVE_1)
1119N/A
2899N/ATPNO= 5814
1119N/A
5680N/ABUILD_STYLE= justmake
5680N/AINSTALL_32_and_64 += $(BUILD_DIR)/lua-64.pc
5680N/ASYSTEM_TEST_TARGET= $(SYSTEM_TEST_32_and_64)
5680N/Ainclude $(WS_MAKE_RULES)/common.mk
97N/A
1119N/APATCH_LEVEL= 0
1119N/A
5680N/A# This is because lua uses $(CC) to build its shared libraries.
99N/ACC += $(CC_BITS)
97N/A
99N/ACFLAGS += $(CC_PIC) $(CPP_LARGEFILES)
99N/A
151N/ACOMPONENT_BUILD_ARGS += CC="$(CC)"
1184N/ACOMPONENT_BUILD_ARGS += USRCFLAGS="$(CFLAGS)"
151N/ACOMPONENT_INSTALL_ARGS += INSTALL=$(INSTALL)
151N/ACOMPONENT_INSTALL_ARGS += INSTALL_TOP=$(PROTOUSRDIR)
5841N/A$(INSTALL_32): COMPONENT_INSTALL_ARGS += INSTALL_BIN=$(PROTOUSRBINDIR)/$(MACH32)
181N/A$(INSTALL_64): COMPONENT_INSTALL_ARGS += INSTALL_LIB=$(PROTOUSRLIBDIR64)
97N/A
1607N/A$(BUILD_DIR)/lua-64.pc: files/lua-64.pc
5680N/A $(GSED) -e "s#MACH64#$(MACH64)#g" < $< > $@
2036N/A
3205N/ACLEAN_PATHS += $(LUA_TESTS)
3205N/A
3205N/ALUA_EXE_32 = $(BUILD_DIR)/$(MACH32)/src/$(COMPONENT_NAME)
3205N/ALUA_EXE_64 = $(BUILD_DIR)/$(MACH64)/src/$(COMPONENT_NAME)
3205N/ALUA_EXE = $(LUA_EXE_$(BITS))
3205N/A
3205N/A# Unpack and patch the tests once, and work around CR #19661394, which is
3205N/A# causing the lua self-tests to fail.
3205N/ACOMPONENT_PRE_TEST_ACTION = \
3205N/A (if ! test -d $(LUA_TESTS) ; then \
3205N/A $(UNPACK) $(UNPACK_ARGS) $(LUA_TESTS).tar.gz ; \
3205N/A (cd $(LUA_TESTS); $(GPATCH) $(GPATCH_FLAGS) \
3205N/A <$(COMPONENT_DIR)/files/fix-tests.patch) ; \
3205N/A fi)
3205N/A
3205N/ACOMPONENT_TEST_DIR = $(LUA_TESTS)
3205N/ACOMPONENT_TEST_CMD = $(LUA_EXE)
3205N/ACOMPONENT_TEST_ARGS = -e"_U=true"
3205N/ACOMPONENT_TEST_TARGETS = all.lua
3205N/A
3643N/A# Master test results are the same for both 32-bit and 64-bit, so override
3643N/A# here, rather than create multiple identical master files.
3643N/ACOMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
3643N/A
3643N/A# The additional lua specific set of transforms to be applied to the
3643N/A# test results to try to normalize them.
3643N/ACOMPONENT_TEST_TRANSFORMS += \
3643N/A '-e "/---- total memory:/d" ' \
3643N/A '-e "s|elements in .\... sec|elements in x.xx sec|g" ' \
3643N/A '-e "s|\(total time:\).*|\1|" ' \
3643N/A '-e "s|\(test done on\).*|\1|" '
3643N/A
4760N/A# Unpack and patch the tests once, and work around CR #19661394, which is
4760N/A# causing the lua self-tests to fail.
4760N/ACOMPONENT_PRE_SYSTEM_TEST_ACTION = \
4760N/A (if ! test -d $(LUA_TESTS) ; then \
4760N/A $(UNPACK) $(UNPACK_ARGS) $(LUA_TESTS).tar.gz ; \
4760N/A (cd $(LUA_TESTS); $(GPATCH) $(GPATCH_FLAGS) \
4760N/A <$(COMPONENT_DIR)/files/fix-tests.patch) ; \
4760N/A fi)
4760N/A
4760N/ACOMPONENT_SYSTEM_TEST_DIR = $(LUA_TESTS)
5680N/ACOMPONENT_SYSTEM_TEST_CMD = $(USRBINDIR)/lua
4760N/ACOMPONENT_SYSTEM_TEST_ARGS = -e"_U=true"
4760N/ACOMPONENT_SYSTEM_TEST_TARGETS = all.lua
4760N/A
3817N/AREQUIRED_PACKAGES += system/library/math