ffmpeg-6: fix COMPONENT_REVISION
[oi-userland.git] / components / runtime / lua / Makefile
blob7cd89694b7be49e666bbfb4b3b6e6b5744f3e180
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
21 # Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
22 # Copyright (c) 2016. Adam Stevko. All rights reserved.
24 include ../../../make-rules/shared-macros.mk
26 COMPONENT_NAME= lua
27 COMPONENT_VERSION= 5.2.4
28 COMPONENT_REVISION= 3
29 COMPONENT_PROJECT_URL= http://www.lua.org/
30 COMPONENT_SRC= $(COMPONENT_NAME)-$(COMPONENT_VERSION)
31 COMPONENT_ARCHIVE= $(COMPONENT_SRC).tar.gz
32 COMPONENT_ARCHIVE_HASH= \
33 sha256:b9e2e4aad6789b3b63a056d442f7b39f0ecfca3ae0f1fc0ae4e9614401b69f4b
34 COMPONENT_ARCHIVE_URL= $(COMPONENT_PROJECT_URL)ftp/$(COMPONENT_ARCHIVE)
35 COMPONENT_BUGDB= utility/lua
37 LUA_TESTS= lua-5.2.2-tests
38 COMPONENT_ARCHIVE_1= $(LUA_TESTS).tar.gz
39 COMPONENT_ARCHIVE_HASH_1= \
40 sha256:07c1071c66d9cb4dc80200ed430fc21ebbbccf1f55148b87eb0b9522932e4eb6
41 COMPONENT_ARCHIVE_URL_1= $(COMPONENT_PROJECT_URL)tests/$(COMPONENT_ARCHIVE_1)
43 CLEAN_PATHS += $(LUA_TESTS)
46 include $(WS_MAKE_RULES)/prep.mk
47 include $(WS_MAKE_RULES)/justmake.mk
48 include $(WS_MAKE_RULES)/ips.mk
50 PATCH_LEVEL= 0
52 # This is because lua uses $(CC) to build it's shared libraries.
53 CC += $(CC_BITS)
55 CFLAGS += $(CC_PIC) $(CPP_LARGEFILES)
57 # Original patch from userland-gate used LD_OPTIONS_SO and LD_OPTIONS directly in the src/Makefile
58 # of Lua SOURCE_DIR. This caused that gcc picked wrong linking flags and liblua.so would not be
59 # created. Till there is a better way, let's stick to this.
60 MYLDFLAGS= $(shell echo $(LD_OPTIONS_SO) $(LD_OPTIONS) | $(GSED) -e 's/^/-Wl,/g' -e 's/ /,'/g)
62 COMPONENT_BUILD_ARGS += CC="$(CC)"
63 COMPONENT_BUILD_ARGS += MYCFLAGS="$(CFLAGS)"
64 COMPONENT_BUILD_ARGS += MYLDFLAGS="$(MYLDFLAGS)"
65 COMPONENT_INSTALL_ARGS += INSTALL=$(INSTALL)
66 COMPONENT_INSTALL_ARGS += INSTALL_TOP=$(PROTOUSRDIR)
67 $(INSTALL_64): COMPONENT_INSTALL_ARGS += INSTALL_LIB=$(PROTOUSRLIBDIR64)
68 $(INSTALL_64): COMPONENT_INSTALL_ARGS += INSTALL_BIN=$(PROTOUSRBINDIR64)
70 $(BUILD_DIR)/lua-64.pc: files/lua-64.pc
71 /bin/sed -e "s#MACH64#$(MACH64)#g" < $< > $@
73 # common targets
74 build: $(BUILD_32_and_64)
76 install: $(INSTALL_32_and_64) $(BUILD_DIR)/lua-64.pc
78 test: install
79 (gzip -dc $(USERLAND_ARCHIVES)$(LUA_TESTS).tar.gz | tar xopf -; \
80 cd $(LUA_TESTS); $(ENV) LD_LIBRARY_PATH=$(PROTOUSRLIBDIR) \
81 $(PROTOUSRBINDIR)/$(COMPONENT_NAME) -e"_U=true" all.lua; \
82 $(ENV) LD_LIBRARY_PATH=$(PROTOUSRLIBDIR64) \
83 $(PROTOUSRBINDIR64)/$(COMPONENT_NAME) -e"_U=true" all.lua)
85 REQUIRED_PACKAGES += system/library
86 REQUIRED_PACKAGES += system/library/math