Merge pull request #9 from zhaozg/master
Fix. Build with libcurl 7.19.7 (Close #8)
This commit is contained in:
commit
83595d7bea
50
Makefile
Normal file
50
Makefile
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
T=lcurl
|
||||||
|
|
||||||
|
#default installtion prefix
|
||||||
|
PREFIX=/usr/local
|
||||||
|
|
||||||
|
LUA_VERSION = $(shell pkg-config luajit --print-provides)
|
||||||
|
|
||||||
|
ifeq ($(LUA_VERSION),)
|
||||||
|
LUA_CFLAGS=$(shell pkg-config lua --cflags)
|
||||||
|
LUA_LIBS=$(shell pkg-config lua --libs)
|
||||||
|
else
|
||||||
|
LUA_CFLAGS=$(shell pkg-config luajit --cflags)
|
||||||
|
LUA_LIBS=$(shell pkg-config luajit --libs)
|
||||||
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
CURL_CFLAGS=$(shell pkg-config libcurl --cflags)
|
||||||
|
CURL_LIBS=$(shell pkg-config libcurl --libs)
|
||||||
|
|
||||||
|
# System's libraries directory (where binary libraries are installed)
|
||||||
|
LUA_LIBDIR= $(PREFIX)/lib/lua/5.1
|
||||||
|
|
||||||
|
# OS dependent
|
||||||
|
LIB_OPTION= -shared #for Linux
|
||||||
|
|
||||||
|
#LIB_OPTION= -bundle -undefined dynamic_lookup #for MacOS X
|
||||||
|
LIBNAME= $T.so.$V
|
||||||
|
|
||||||
|
# Compilation directives
|
||||||
|
WARN_MOST= -Wall -fPIC -W -Waggregate-return -Wcast-align -Wmissing-prototypes -Wnested-externs -Wshadow -Wwrite-strings -pedantic
|
||||||
|
WARN= -Wall -fPIC -Wno-unused-value
|
||||||
|
CFLAGS= $(WARN) -DPTHREADS $(LUA_CFLAGS) $(CURL_CFLAGS)
|
||||||
|
CC= gcc -g -shared -fPIC $(CFLAGS)
|
||||||
|
LIB_OPTION=$(LUA_LIBS) $(CURL_LIBS)
|
||||||
|
|
||||||
|
SRCS=$(shell echo src/*.c)
|
||||||
|
|
||||||
|
all: $T.so
|
||||||
|
|
||||||
|
$T.so: $(SRCS)
|
||||||
|
MACOSX_DEPLOYMENT_TARGET="10.3"; export MACOSX_DEPLOYMENT_TARGET; $(CC) $(CFLAGS) $(LIB_OPTION) -o $T.so $(SRCS) -lrt -ldl
|
||||||
|
|
||||||
|
install: all
|
||||||
|
mkdir -p $(LUA_LIBDIR)
|
||||||
|
cp $T.so $(LUA_LIBDIR)
|
||||||
|
|
||||||
|
clean:
|
||||||
|
rm -f $T.so $(OBJS)
|
||||||
|
|
||||||
|
|
@ -2,7 +2,9 @@ ERR_ENTRY ( OK )
|
|||||||
ERR_ENTRY ( UNSUPPORTED_PROTOCOL )
|
ERR_ENTRY ( UNSUPPORTED_PROTOCOL )
|
||||||
ERR_ENTRY ( FAILED_INIT )
|
ERR_ENTRY ( FAILED_INIT )
|
||||||
ERR_ENTRY ( URL_MALFORMAT )
|
ERR_ENTRY ( URL_MALFORMAT )
|
||||||
|
#if LCURL_CURL_VER_GE(7,21,5)
|
||||||
ERR_ENTRY ( NOT_BUILT_IN )
|
ERR_ENTRY ( NOT_BUILT_IN )
|
||||||
|
#endif
|
||||||
ERR_ENTRY ( COULDNT_RESOLVE_PROXY )
|
ERR_ENTRY ( COULDNT_RESOLVE_PROXY )
|
||||||
ERR_ENTRY ( COULDNT_RESOLVE_HOST )
|
ERR_ENTRY ( COULDNT_RESOLVE_HOST )
|
||||||
ERR_ENTRY ( COULDNT_CONNECT )
|
ERR_ENTRY ( COULDNT_CONNECT )
|
||||||
@ -90,11 +92,19 @@ ERR_ENTRY ( SSL_SHUTDOWN_FAILED )
|
|||||||
ERR_ENTRY ( AGAIN )
|
ERR_ENTRY ( AGAIN )
|
||||||
ERR_ENTRY ( SSL_CRL_BADFILE )
|
ERR_ENTRY ( SSL_CRL_BADFILE )
|
||||||
ERR_ENTRY ( SSL_ISSUER_ERROR )
|
ERR_ENTRY ( SSL_ISSUER_ERROR )
|
||||||
|
#if LCURL_CURL_VER_GE(7,20,0)
|
||||||
ERR_ENTRY ( FTP_PRET_FAILED )
|
ERR_ENTRY ( FTP_PRET_FAILED )
|
||||||
|
#endif
|
||||||
|
#if LCURL_CURL_VER_GE(7,21,0)
|
||||||
|
ERR_ENTRY ( FTP_BAD_FILE_LIST )
|
||||||
|
#endif
|
||||||
|
#if LCURL_CURL_VER_GE(7,20,0)
|
||||||
ERR_ENTRY ( RTSP_CSEQ_ERROR )
|
ERR_ENTRY ( RTSP_CSEQ_ERROR )
|
||||||
ERR_ENTRY ( RTSP_SESSION_ERROR )
|
ERR_ENTRY ( RTSP_SESSION_ERROR )
|
||||||
ERR_ENTRY ( FTP_BAD_FILE_LIST )
|
#endif
|
||||||
|
#if LCURL_CURL_VER_GE(7,21,0)
|
||||||
ERR_ENTRY ( CHUNK_FAILED )
|
ERR_ENTRY ( CHUNK_FAILED )
|
||||||
|
#endif
|
||||||
#if LCURL_CURL_VER_GE(7,30,0)
|
#if LCURL_CURL_VER_GE(7,30,0)
|
||||||
ERR_ENTRY ( NO_CONNECTION_AVAILABLE )
|
ERR_ENTRY ( NO_CONNECTION_AVAILABLE )
|
||||||
#endif
|
#endif
|
||||||
|
@ -96,20 +96,48 @@ FLG_ENTRY(PROTO_LDAPS )
|
|||||||
FLG_ENTRY(PROTO_DICT )
|
FLG_ENTRY(PROTO_DICT )
|
||||||
FLG_ENTRY(PROTO_FILE )
|
FLG_ENTRY(PROTO_FILE )
|
||||||
FLG_ENTRY(PROTO_TFTP )
|
FLG_ENTRY(PROTO_TFTP )
|
||||||
|
#ifdef CURLPROTO_IMAP
|
||||||
FLG_ENTRY(PROTO_IMAP )
|
FLG_ENTRY(PROTO_IMAP )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_IMAPS
|
||||||
FLG_ENTRY(PROTO_IMAPS )
|
FLG_ENTRY(PROTO_IMAPS )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_POP3
|
||||||
FLG_ENTRY(PROTO_POP3 )
|
FLG_ENTRY(PROTO_POP3 )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_POP3S
|
||||||
FLG_ENTRY(PROTO_POP3S )
|
FLG_ENTRY(PROTO_POP3S )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_SMTP
|
||||||
FLG_ENTRY(PROTO_SMTP )
|
FLG_ENTRY(PROTO_SMTP )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_SMTPS
|
||||||
FLG_ENTRY(PROTO_SMTPS )
|
FLG_ENTRY(PROTO_SMTPS )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_RTSP
|
||||||
FLG_ENTRY(PROTO_RTSP )
|
FLG_ENTRY(PROTO_RTSP )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_RTMP
|
||||||
FLG_ENTRY(PROTO_RTMP )
|
FLG_ENTRY(PROTO_RTMP )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_RTMPT
|
||||||
FLG_ENTRY(PROTO_RTMPT )
|
FLG_ENTRY(PROTO_RTMPT )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_RTMPE
|
||||||
FLG_ENTRY(PROTO_RTMPE )
|
FLG_ENTRY(PROTO_RTMPE )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_RTMPTE
|
||||||
FLG_ENTRY(PROTO_RTMPTE )
|
FLG_ENTRY(PROTO_RTMPTE )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_RTMPS
|
||||||
FLG_ENTRY(PROTO_RTMPS )
|
FLG_ENTRY(PROTO_RTMPS )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_RTMPTS
|
||||||
FLG_ENTRY(PROTO_RTMPTS )
|
FLG_ENTRY(PROTO_RTMPTS )
|
||||||
|
#endif
|
||||||
|
#ifdef CURLPROTO_GOPHER
|
||||||
FLG_ENTRY(PROTO_GOPHER )
|
FLG_ENTRY(PROTO_GOPHER )
|
||||||
|
#endif
|
||||||
FLG_ENTRY(PROTO_ALL )
|
FLG_ENTRY(PROTO_ALL )
|
||||||
|
|
||||||
FLG_ENTRY(PROXY_HTTP ) /* added in 7.10.0 */
|
FLG_ENTRY(PROXY_HTTP ) /* added in 7.10.0 */
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define _LCHTTPPOST_H_
|
#define _LCHTTPPOST_H_
|
||||||
|
|
||||||
#include "lcurl.h"
|
#include "lcurl.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
typedef struct lcurl_hpost_tag{
|
typedef struct lcurl_hpost_tag{
|
||||||
struct curl_httppost *post;
|
struct curl_httppost *post;
|
||||||
|
@ -74,8 +74,12 @@ static int lcurl_version_info(lua_State *L){
|
|||||||
lua_pushliteral(L, "SSPI"); lua_pushboolean(L, data->features & CURL_VERSION_SSPI ); lua_rawset(L, -3);
|
lua_pushliteral(L, "SSPI"); lua_pushboolean(L, data->features & CURL_VERSION_SSPI ); lua_rawset(L, -3);
|
||||||
lua_pushliteral(L, "CONV"); lua_pushboolean(L, data->features & CURL_VERSION_CONV ); lua_rawset(L, -3);
|
lua_pushliteral(L, "CONV"); lua_pushboolean(L, data->features & CURL_VERSION_CONV ); lua_rawset(L, -3);
|
||||||
lua_pushliteral(L, "CURLDEBUG"); lua_pushboolean(L, data->features & CURL_VERSION_CURLDEBUG ); lua_rawset(L, -3);
|
lua_pushliteral(L, "CURLDEBUG"); lua_pushboolean(L, data->features & CURL_VERSION_CURLDEBUG ); lua_rawset(L, -3);
|
||||||
|
#if LCURL_CURL_VER_GE(7,21,4)
|
||||||
lua_pushliteral(L, "TLSAUTH_SRP"); lua_pushboolean(L, data->features & CURL_VERSION_TLSAUTH_SRP ); lua_rawset(L, -3);
|
lua_pushliteral(L, "TLSAUTH_SRP"); lua_pushboolean(L, data->features & CURL_VERSION_TLSAUTH_SRP ); lua_rawset(L, -3);
|
||||||
|
#endif
|
||||||
|
#if LCURL_CURL_VER_GE(7,22,0)
|
||||||
lua_pushliteral(L, "NTLM_WB"); lua_pushboolean(L, data->features & CURL_VERSION_NTLM_WB ); lua_rawset(L, -3);
|
lua_pushliteral(L, "NTLM_WB"); lua_pushboolean(L, data->features & CURL_VERSION_NTLM_WB ); lua_rawset(L, -3);
|
||||||
|
#endif
|
||||||
#ifdef CURL_VERSION_HTTP2
|
#ifdef CURL_VERSION_HTTP2
|
||||||
lua_pushliteral(L, "HTTP2"); lua_pushboolean(L, data->features & CURL_VERSION_HTTP2 ); lua_rawset(L, -3);
|
lua_pushliteral(L, "HTTP2"); lua_pushboolean(L, data->features & CURL_VERSION_HTTP2 ); lua_rawset(L, -3);
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user