# This file is part of MXE.
# See index.html for further information.
PKG := lua
$(PKG)_IGNORE :=
$(PKG)_VERSION := 5.2.2
$(PKG)_CHECKSUM := 0857e41e5579726a4cb96732e80d7aa47165eaf5
$(PKG)_SUBDIR := lua-$($(PKG)_VERSION)
$(PKG)_FILE := lua-$($(PKG)_VERSION).tar.gz
$(PKG)_URL := http://www.lua.org/ftp/$($(PKG)_FILE)
$(PKG)_DEPS := gcc
define $(PKG)_UPDATE
$(WGET) -q -O- 'http://www.lua.org/download.html' | \
$(SED) -n 's,.*lua-\([0-9][^>]*\)\.tar.*,\1,p' | \
head -1
endef
define $(PKG)_BUILD
$(MAKE) -C '$(1)/src' -j '$(JOBS)' \
INSTALL_TOP='$(PREFIX)/$(TARGET)' \
CC='$(TARGET)-gcc' \
AR='$(TARGET)-ar rcu' \
RANLIB='$(TARGET)-ranlib' \
a
$(MAKE) -C '$(1)' -j 1 \
INSTALL_TOP='$(PREFIX)/$(TARGET)' \
INSTALL_BIN='$(1)/noinstall' \
INSTALL_MAN='$(1)/noinstall' \
TO_BIN='lua.h' \
INSTALL='$(INSTALL)' \
install
#pkg-config file
(echo 'Name: $(PKG)'; \
echo 'Version: $($(PKG)_VERSION)'; \
echo 'Description: $(PKG)'; \
echo 'Libs: -l$(PKG)';) \
> '$(PREFIX)/$(TARGET)/lib/pkgconfig/$(PKG).pc'
'$(TARGET)-gcc' \
-W -Wall -Werror -ansi -pedantic \
'$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-lua.exe' \
`$(TARGET)-pkg-config --libs lua`
endef