Blame SOURCES/lua-5.3.0-autotoolize.patch

a8bfa3
diff -up lua-5.3.0/configure.ac.autoxxx lua-5.3.0/configure.ac
a8bfa3
--- lua-5.3.0/configure.ac.autoxxx	2015-01-15 10:20:03.826889574 -0500
a8bfa3
+++ lua-5.3.0/configure.ac	2015-01-15 10:20:03.826889574 -0500
a8bfa3
@@ -0,0 +1,69 @@
a8bfa3
+AC_PREREQ(2.59)
a8bfa3
+AC_INIT([lua], [5.3.0], [https://bugzilla.redhat.com/], [lua-at], [http://www.lua.org])
a8bfa3
+AC_SUBST([MAJOR_VERSION], [5.3])
a8bfa3
+
a8bfa3
+AC_CONFIG_HEADERS([config.h])
a8bfa3
+AC_CONFIG_SRCDIR([src/lapi.c])
a8bfa3
+
a8bfa3
+AM_INIT_AUTOMAKE([1.9 foreign])
a8bfa3
+
a8bfa3
+AC_PROG_CC
a8bfa3
+AC_PROG_LIBTOOL
a8bfa3
+
a8bfa3
+AC_ARG_WITH(
a8bfa3
+  [readline],
a8bfa3
+  [AC_HELP_STRING([--with-readline], [Use readline for interpreter input [default=yes]])],
a8bfa3
+  [use_readline=$withval],
a8bfa3
+  [use_readline=yes]
a8bfa3
+)
a8bfa3
+
a8bfa3
+LUA_LIBS="-lm"
a8bfa3
+
a8bfa3
+# Check for readline
a8bfa3
+READLINE_DEFS="#undef LUA_USE_READLINE"
a8bfa3
+if test "x$use_readline" == "xyes"; then
a8bfa3
+  AC_CHECK_LIB([readline], [readline], [:], [use_readline=no], [-lncurses])
a8bfa3
+  AC_CHECK_HEADERS([readline/readline.h readline/history.h], [], [use_readline=no])
a8bfa3
+  if test "x$use_readline" == "xno"; then
a8bfa3
+    AC_MSG_WARN([readline headers could not be found, disabling readline support])
a8bfa3
+  else
a8bfa3
+    READLINE_DEFS="#define LUA_USE_READLINE"
a8bfa3
+    READLINE_LIBS="-lreadline -lncurses"
a8bfa3
+  fi
a8bfa3
+fi
a8bfa3
+AC_SUBST(READLINE_DEFS)
a8bfa3
+AC_SUBST(READLINE_LIBS)
a8bfa3
+
a8bfa3
+case "$host" in
a8bfa3
+  *-mingw*)  use_os=win32  ;;
a8bfa3
+  *-darwin*) use_os=macosx ;;
a8bfa3
+  *)         use_os=posix  ;;
a8bfa3
+esac
a8bfa3
+
a8bfa3
+POSIX_DEFS="#undef LUA_USE_POSIX"
a8bfa3
+LUA_DL_DEFS="#undef LUA_USE_DLOPEN"
a8bfa3
+LUA_BUILD_AS_DLL_DEFS="#undef LUA_BUILD_AS_DLL"
a8bfa3
+
a8bfa3
+if test "x$use_os" == "xwin32"; then
a8bfa3
+  LUA_BUILD_AS_DLL_DEFS="#define LUA_BUILD_AS_DLL"
a8bfa3
+elif test "x$use_os" == "xmacosx"; then
a8bfa3
+  POSIX_DEFS="#define LUA_USE_POSIX"
a8bfa3
+  LUA_DL_DEFS="#define LUA_DL_DYLD"
a8bfa3
+elif test "x$use_os" == "xposix"; then
a8bfa3
+  POSIX_DEFS="#define LUA_USE_POSIX"
a8bfa3
+  LUA_DL_DEFS="#define LUA_DL_DLOPEN"
a8bfa3
+  LUA_LIBS="$LUA_LIBS -ldl"
a8bfa3
+fi
a8bfa3
+AC_SUBST(POSIX_DEFS)
a8bfa3
+AC_SUBST(LUA_DL_DEFS)
a8bfa3
+AC_SUBST(LUA_BUILD_AS_DLL_DEFS)
a8bfa3
+
a8bfa3
+AC_SUBST(LUA_LIBS)
a8bfa3
+
a8bfa3
+AC_CONFIG_FILES([Makefile
a8bfa3
+                 src/Makefile
a8bfa3
+                 src/lua.pc
a8bfa3
+                 src/luaconf.h.template
a8bfa3
+                 doc/Makefile
a8bfa3
+])
a8bfa3
+AC_OUTPUT
a8bfa3
diff -up lua-5.3.0/doc/Makefile.am.autoxxx lua-5.3.0/doc/Makefile.am
a8bfa3
--- lua-5.3.0/doc/Makefile.am.autoxxx	2015-01-15 10:20:03.826889574 -0500
a8bfa3
+++ lua-5.3.0/doc/Makefile.am	2015-01-15 10:20:03.826889574 -0500
a8bfa3
@@ -0,0 +1,4 @@
a8bfa3
+man1_MANS = lua.1 luac.1
a8bfa3
+
a8bfa3
+EXTRA_DIST = \
a8bfa3
+	contents.html logo.gif lua.1 luac.1 lua.css manual.css manual.html osi-certified-72x60.png readme.html
a8bfa3
diff -up lua-5.3.0/Makefile.am.autoxxx lua-5.3.0/Makefile.am
a8bfa3
--- lua-5.3.0/Makefile.am.autoxxx	2015-01-15 10:20:03.826889574 -0500
a8bfa3
+++ lua-5.3.0/Makefile.am	2015-01-15 10:20:03.826889574 -0500
a8bfa3
@@ -0,0 +1,3 @@
a8bfa3
+SUBDIRS = src doc
a8bfa3
+
a8bfa3
+EXTRA_DIST = README
a8bfa3
diff -up lua-5.3.0/src/.gitignore.autoxxx lua-5.3.0/src/.gitignore
a8bfa3
--- lua-5.3.0/src/.gitignore.autoxxx	2015-01-15 10:20:03.826889574 -0500
a8bfa3
+++ lua-5.3.0/src/.gitignore	2015-01-15 10:20:03.826889574 -0500
a8bfa3
@@ -0,0 +1,5 @@
a8bfa3
+lua
a8bfa3
+lua.pc
a8bfa3
+luac
a8bfa3
+luaconf.h
a8bfa3
+luaconf.h.template
a8bfa3
diff -up lua-5.3.0/src/luaconf.h.template.in.autoxxx lua-5.3.0/src/luaconf.h.template.in
a8bfa3
--- lua-5.3.0/src/luaconf.h.template.in.autoxxx	2015-01-15 10:20:03.828889562 -0500
a8bfa3
+++ lua-5.3.0/src/luaconf.h.template.in	2015-01-15 10:22:37.420027778 -0500
a8bfa3
@@ -11,6 +11,11 @@
a8bfa3
 #include <limits.h>
a8bfa3
 #include <stddef.h>
a8bfa3
 
a8bfa3
+@POSIX_DEFS@
a8bfa3
+@LUA_DL_DEFS@
a8bfa3
+@LUA_BUILD_AS_DLL_DEFS@
a8bfa3
+@READLINE_DEFS@
a8bfa3
+
a8bfa3
 
a8bfa3
 /*
a8bfa3
 ** ===================================================================
a8bfa3
@@ -175,9 +180,9 @@
a8bfa3
 
a8bfa3
 #else			/* }{ */
a8bfa3
 
a8bfa3
-#define LUA_ROOT	"/usr/local/"
a8bfa3
-#define LUA_LDIR	LUA_ROOT "share/lua/" LUA_VDIR "/"
a8bfa3
-#define LUA_CDIR	LUA_ROOT "lib/lua/" LUA_VDIR "/"
a8bfa3
+#define LUA_ROOT	"@prefix@/"
a8bfa3
+#define LUA_LDIR	"@pkgdatadir@/lua/" LUA_VDIR "/"
a8bfa3
+#define LUA_CDIR	"@libdir@/lua/" LUA_VDIR "/"
a8bfa3
 #define LUA_PATH_DEFAULT  \
a8bfa3
 		LUA_LDIR"?.lua;"  LUA_LDIR"?/init.lua;" \
a8bfa3
 		LUA_CDIR"?.lua;"  LUA_CDIR"?/init.lua;" \
a8bfa3
diff -up lua-5.3.0/src/lua.pc.in.autoxxx lua-5.3.0/src/lua.pc.in
a8bfa3
--- lua-5.3.0/src/lua.pc.in.autoxxx	2015-01-15 10:20:03.827889568 -0500
a8bfa3
+++ lua-5.3.0/src/lua.pc.in	2015-01-15 10:20:03.827889568 -0500
a8bfa3
@@ -0,0 +1,13 @@
a8bfa3
+V= @MAJOR_VERSION@
a8bfa3
+R= @VERSION@
a8bfa3
+prefix= @prefix@
a8bfa3
+exec_prefix=${prefix}
a8bfa3
+libdir= @libdir@
a8bfa3
+includedir=${prefix}/include
a8bfa3
+
a8bfa3
+Name: Lua
a8bfa3
+Description: An Extensible Extension Language
a8bfa3
+Version: ${R}
a8bfa3
+Requires:
a8bfa3
+Libs: -llua @LUA_LIBS@
a8bfa3
+Cflags: -I${includedir}
a8bfa3
diff -up lua-5.3.0/src/Makefile.am.autoxxx lua-5.3.0/src/Makefile.am
a8bfa3
--- lua-5.3.0/src/Makefile.am.autoxxx	2015-01-15 10:20:03.826889574 -0500
a8bfa3
+++ lua-5.3.0/src/Makefile.am	2015-01-15 10:20:03.826889574 -0500
a8bfa3
@@ -0,0 +1,46 @@
a8bfa3
+AM_CFLAGS = -Wall
a8bfa3
+
a8bfa3
+include_HEADERS = lua.h lualib.h lauxlib.h lua.hpp
a8bfa3
+
a8bfa3
+nodist_include_HEADERS = luaconf.h
a8bfa3
+
a8bfa3
+lib_LTLIBRARIES = liblua.la
a8bfa3
+liblua_la_LDFLAGS = -release @MAJOR_VERSION@
a8bfa3
+liblua_la_SOURCES = \
a8bfa3
+	lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c lcorolib.c lctype.c ldblib.c \
a8bfa3
+	ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c \
a8bfa3
+	loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c \
a8bfa3
+	ltable.c ltablib.c ltm.c lundump.c lutf8lib.c lvm.c lzio.c \
a8bfa3
+	lapi.h lcode.h lctype.h ldebug.h ldo.h lfunc.h lgc.h llex.h llimits.h \
a8bfa3
+	lmem.h lobject.h lopcodes.h lparser.h lstate.h lstring.h ltable.h ltm.h \
a8bfa3
+	lundump.h lvm.h lzio.h
a8bfa3
+
a8bfa3
+pkgconfigdir = $(libdir)/pkgconfig
a8bfa3
+pkgconfig_DATA = lua.pc
a8bfa3
+
a8bfa3
+bin_PROGRAMS = lua luac
a8bfa3
+
a8bfa3
+lua_SOURCES = lua.c
a8bfa3
+lua_LDADD = liblua.la @LUA_LIBS@ @READLINE_LIBS@
a8bfa3
+lua_DEPENDENCIES = liblua.la
a8bfa3
+
a8bfa3
+luac_SOURCES = luac.c
a8bfa3
+# Statically link liblua against luac since luac uses symbols not exported in liblua
a8bfa3
+luac_LDADD = .libs/liblua.a @LUA_LIBS@
a8bfa3
+luac_DEPENDENCIES = liblua.la
a8bfa3
+
a8bfa3
+EXTRA_DIST = luaconf.h.template
a8bfa3
+BUILT_SOURCES = luaconf.h
a8bfa3
+CLEANFILES = luaconf.h luaconf.h.template
a8bfa3
+
a8bfa3
+readline_defs = @READLINE_DEFS@
a8bfa3
+
a8bfa3
+edit = 	sed \
a8bfa3
+	  -e 's,%prefix%,$(prefix),g' \
a8bfa3
+	  -e 's,%lua_datadir%,$(datadir),g' \
a8bfa3
+	  -e 's,%lua_libdir%,$(libdir),g'
a8bfa3
+
a8bfa3
+luaconf.h : luaconf.h.template
a8bfa3
+	rm -f $@ $@.tmp
a8bfa3
+	$(edit) $< >$@.tmp
a8bfa3
+	mv $@.tmp $@