2 changed files with 97 additions and 110 deletions
@ -1,85 +1,74 @@
|
||||
Index: Makefile
|
||||
--- Makefile.orig 2008-10-25 17:26:26 +0200
|
||||
+++ Makefile 2010-02-08 12:01:53 +0100
|
||||
@@ -1,37 +1,35 @@
|
||||
# TODO: support for abi&libtool, installation of lua-curl.h
|
||||
|
||||
-LIBNAME=liblua5.1-curl
|
||||
+LIBNAME=libcurl
|
||||
LIBTOOL=libtool --silent --tag=CC
|
||||
-HEADER=/usr/include/curl/curl.h
|
||||
+HEADER=$(PREFIX)/include/curl/curl.h
|
||||
PREFIX=/usr/local/
|
||||
#LUA=lua50
|
||||
-LUA=lua5.1
|
||||
-LUADOC= luadoc
|
||||
+LUA=$(PREFIX)/bin/lua
|
||||
+LUADOC= $(PREFIX)/bin/luadoc
|
||||
VERSION_INFO=0:0:0
|
||||
|
||||
CONSTANTS:= curlopt.h curl_netrcopt.h \
|
||||
curl_form.h curl_authopt.h curl_ftpauthopt.h curl_ftpmethods.h
|
||||
-CURL_CFLAGS:= $(shell curl-config --cflags 2>/dev/null) $(shell getconf LFS_CFLAGS)
|
||||
+CURL_CFLAGS:= $(shell curl-config --cflags 2>/dev/null)
|
||||
CURL_LDFLAGS:= $(shell curl-config --libs 2>/dev/null)
|
||||
REALSO:=$(LIBNAME).so.$(subst :,.,$(VERSION_INFO))
|
||||
|
||||
# ------------------------------ lua5.1 stuff ---------------------------------
|
||||
-ifeq "$(LUA)" "lua5.1"
|
||||
-LUA_CFLAGS := $(shell pkg-config lua5.1 --cflags) $(shell getconf LFS_CFLAGS)
|
||||
+LUA_CFLAGS := $(shell pkg-config lua --cflags)
|
||||
# This retrieves the name of the libtool convenience library for Lua
|
||||
# (e.g. "/usr/lib/liblua5.1.la") used by --mode=link.
|
||||
-LUA_LIBTOOL_S := $(shell pkg-config lua5.1 --variable=libtool_lib)
|
||||
+LUA_LIBTOOL_S := $(shell pkg-config lua --variable=libtool_lib)
|
||||
LUA_LIBTOOL_D := $(LUA_LIBTOOL_S)
|
||||
# this is the path where you'll eventually install the module
|
||||
-LUA_RPATH:=$(shell pkg-config lua5.1 --define-variable=prefix=$(PREFIX) \
|
||||
+LUA_RPATH:=$(shell pkg-config lua --define-variable=prefix=$(PREFIX) \
|
||||
--variable=INSTALL_CMOD)
|
||||
# this is the path where you'll eventually install the C header file
|
||||
-LUA_HPATH:=$(shell pkg-config lua5.1 --define-variable=prefix=$(PREFIX) \
|
||||
+LUA_HPATH:=$(shell pkg-config lua --define-variable=prefix=$(PREFIX) \
|
||||
--variable=includedir)/lua5.1
|
||||
LUA_DPATH:=$(PREFIX)/share/doc/luacurl/
|
||||
LUA_LPATH:=$(PREFIX)/lib/
|
||||
-OBJS:= lua-curl.lo luabind.lo
|
||||
-endif
|
||||
+OBJS:= lua-curl.o luabind.o
|
||||
|
||||
# ------------------------------ lua50 stuff ---------------------------------
|
||||
ifeq "$(LUA)" "lua50"
|
||||
@@ -47,7 +45,7 @@
|
||||
endif
|
||||
|
||||
# ------------------------- Here the Makefile --------------------------------
|
||||
-all: $(LIBNAME).la
|
||||
+all: curl.so
|
||||
constants:$(CONSTANTS)
|
||||
doc: doc/curl.html
|
||||
doc/curl.html: lua-curl.luadoc
|
||||
@@ -55,20 +53,16 @@
|
||||
$(LUADOC) -d `pwd`/doc/ `pwd`/doc/*.lua
|
||||
rm -f doc/*.lua doc/index.html
|
||||
|
||||
-%.lo: %.c
|
||||
- $(LIBTOOL) --mode=compile $(CC) -c -Wall -O2 $(LUA_CFLAGS) $<
|
||||
+%.o: %.c
|
||||
+ $(CC) -c -Wall -O2 -fPIC $(CURL_CFLAGS) $(LUA_CFLAGS) $<
|
||||
|
||||
# link objects to make static and dynamic libraries. The .so will be
|
||||
# left in "./.libs/". Note that the Lua library and its dependencies are
|
||||
# not called out on the link line since they are assumed to be part of
|
||||
# whatever our library is linked to. We want to avoid duplicate library
|
||||
# copies, which is a waste of space and can cause run-time problems.
|
||||
-$(LIBNAME).la curl.so: constants $(OBJS)
|
||||
- $(LIBTOOL) --mode=link $(CC) \
|
||||
- -rpath $(LUA_RPATH) -o $(LIBNAME).la \
|
||||
- -version-info $(VERSION_INFO) \
|
||||
- $(CURL_LDFLAGS) $(OBJS)
|
||||
- ln -sf ./.libs/$(REALSO) curl.so
|
||||
+curl.so: constants $(OBJS)
|
||||
+ $(CC) -shared -o curl.so $(OBJS) $(CURL_LDFLAGS) -llua
|
||||
|
||||
# If all went well, we can dynamically load the module into Lua. The
|
||||
# following will load the library into the interpreter and call a function.
|
||||
Index: CMakeLists.txt
|
||||
--- CMakeLists.txt.orig 2008-05-01 04:02:57.000000000 +0200
|
||||
+++ CMakeLists.txt 2015-01-12 21:37:34.636616892 +0100
|
||||
@@ -1,32 +1,27 @@
|
||||
# src/CMakeLists.txt
|
||||
|
||||
+cmake_minimum_required(VERSION 3.1)
|
||||
+
|
||||
+if(COMMAND cmake_policy)
|
||||
+ cmake_policy(SET CMP0003 NEW)
|
||||
+endif(COMMAND cmake_policy)
|
||||
+
|
||||
FIND_LIBRARY(LIB_LUA lua PATHS
|
||||
- /usr/local/lib
|
||||
- /usr/lib
|
||||
+ @l_prefix@/lib
|
||||
)
|
||||
|
||||
-IF(NOT LIB_LUA)
|
||||
- FIND_LIBRARY(LIB_LUA lua5.1 PATHS
|
||||
- /usr/local/lib
|
||||
- /usr/lib
|
||||
- )
|
||||
-ENDIF(NOT LIB_LUA)
|
||||
-
|
||||
FIND_PATH( CURL_INCLUDE_DIR curl/curl.h
|
||||
- /usr/include
|
||||
- /usr/local/include
|
||||
+ @l_prefix@/include
|
||||
)
|
||||
|
||||
FIND_LIBRARY( LIB_CURL curl
|
||||
- /usr/lib
|
||||
- /usr/local/lib
|
||||
+ @l_prefix@/lib
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${${PROJECT_NAME}_SOURCE_DIR}/src
|
||||
${CURL_INCLUDE_DIR}
|
||||
- /usr/local/include/lua5.1
|
||||
- /usr/include/lua5.1
|
||||
+ @l_prefix@/include/lua
|
||||
)
|
||||
|
||||
SET(${PROJECT_NAME}_LIBRARIES
|
||||
@@ -39,5 +34,5 @@
|
||||
)
|
||||
|
||||
LINK_LIBRARIES(${${PROJECT_NAME}_LIBRARIES} m)
|
||||
-ADD_LIBRARY(${PROJECT_NAME} ${${PROJECT_NAME}_SOURCES})
|
||||
+ADD_LIBRARY(${PROJECT_NAME} SHARED ${${PROJECT_NAME}_SOURCES})
|
||||
INSTALL_TARGETS(/lib ${PROJECT_NAME})
|
||||
Index: luacurl.c
|
||||
--- luacurl.c.orig 2008-05-05 15:14:55.000000000 +0200
|
||||
+++ luacurl.c 2015-01-12 21:37:16.246671033 +0100
|
||||
@@ -810,7 +810,7 @@
|
||||
}
|
||||
|
||||
|
||||
-static const struct luaL_reg luacurl_meths[] =
|
||||
+static const struct luaL_Reg luacurl_meths[] =
|
||||
{
|
||||
{"close", lcurl_easy_close},
|
||||
{"setopt", lcurl_easy_setopt},
|
||||
@@ -820,7 +820,7 @@
|
||||
{0, 0}
|
||||
};
|
||||
|
||||
-static const struct luaL_reg luacurl_funcs[] =
|
||||
+static const struct luaL_Reg luacurl_funcs[] =
|
||||
{
|
||||
{"new", lcurl_easy_init},
|
||||
{"escape", lcurl_escape},
|
||||
|
Loading…
Reference in new issue