Move all to deprecated folder.
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
From a6c35dbab5a2a75c176e031122ee64152e50e5d3 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
Date: Thu, 1 Jan 2015 12:23:43 +0100
|
||||
Subject: [PATCH] Switch to use pkg-config to detect libevent and openssl
|
||||
|
||||
Switching to pkg-config fixes a number of problems when detecting the
|
||||
libraries. For example the detection of libpthread was failing,
|
||||
because libevent_threads was added to LIBS before libevent itself,
|
||||
causing the libpthread test to fail due to missing symbols. pkg-config
|
||||
is anyway nowadays the preferred way for detecting libraries. It also
|
||||
has the benefit of working properly in static library situations.
|
||||
|
||||
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
|
||||
---
|
||||
configure.ac | 36 ++++++++++++------------------------
|
||||
1 file changed, 12 insertions(+), 24 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index d4109ce..fc1cadc 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -27,35 +27,20 @@ AC_FUNC_MALLOC
|
||||
AC_FUNC_REALLOC
|
||||
AC_CHECK_FUNCS([memset socket strstr])
|
||||
|
||||
-AC_CHECK_HEADERS([event2/thread.h], [
|
||||
- LIBS="-levent_pthreads ${LIBS}"
|
||||
- ], [
|
||||
- echo "libevent_pthreads required, failing"
|
||||
- exit -1
|
||||
- ])
|
||||
-AC_CHECK_LIB(pthread, pthread_create, [LIBS="-lpthread ${LIBS}"], [
|
||||
+AC_CHECK_LIB(pthread, pthread_create, [PTHREAD_LIBS="-lpthread"], [
|
||||
echo "pthreads required, failing"
|
||||
exit -1
|
||||
])
|
||||
-AC_CHECK_LIB(event, event_base_dispatch, [], [
|
||||
- echo "libevent required, failing"
|
||||
- exit -1
|
||||
- ])
|
||||
+
|
||||
+PKG_CHECK_MODULES([EVENT], [libevent])
|
||||
+PKG_CHECK_MODULES([EVENT_PTHREAD], [libevent_pthreads])
|
||||
|
||||
AS_IF([test "x$with_ssl" != "xno"],
|
||||
[
|
||||
- AC_CHECK_LIB([ssl], [SSL_CTX_new],
|
||||
- [
|
||||
- LIBS="-lssl ${LIBS}"
|
||||
- AC_CHECK_LIB([event_openssl], [bufferevent_openssl_socket_new], [
|
||||
- LIBS="-levent_openssl ${LIBS}"
|
||||
- have_ssl=yes
|
||||
- ], [have_ssl=no])
|
||||
- ],
|
||||
- [have_ssl=no])
|
||||
- ],
|
||||
- [have_ssl=no])
|
||||
-
|
||||
+ PKG_CHECK_MODULES([SSL], [openssl], [have_ssl=yes], [have_ssl=no])
|
||||
+ AS_IF([test "x${have_ssl}" = "xyes"],
|
||||
+ [PKG_CHECK_MODULES([EVENT_OPENSSL], [libevent_openssl], [have_ssl=yes], [have_ssl=no])])])
|
||||
+
|
||||
AS_IF([test "x$have_ssl" = "xyes"],
|
||||
[
|
||||
AC_DEFINE([WEBSOCK_HAVE_SSL], [1], [Define if building SSL support])
|
||||
@@ -63,8 +48,11 @@ AS_IF([test "x$have_ssl" = "xyes"],
|
||||
[AS_IF([test "x$with_ssl" = "xyes"],
|
||||
[AC_MSG_ERROR([SSL support requested but not found])
|
||||
])])
|
||||
-
|
||||
+
|
||||
AM_CONDITIONAL([HAVE_SSL], [test "x$have_ssl" = "xyes"])
|
||||
+
|
||||
+LIBS="${EVENT_LIBS} ${EVENT_PTHREAD_LIBS} ${PTHREAD_LIBS} ${SSL_LIBS} ${EVENT_OPENSSL_LIBS}"
|
||||
+
|
||||
AC_DEFINE_UNQUOTED([WEBSOCK_PACKAGE_VERSION], ["$PACKAGE_VERSION"], [libwebsock version])
|
||||
AC_DEFINE_UNQUOTED([WEBSOCK_PACKAGE_STRING], ["$PACKAGE_STRING"], [libwebsock package string])
|
||||
AC_DEFINE_UNQUOTED([WEBSOCK_PACKAGE_NAME], ["$PACKAGE_NAME"], [libwebsock package name])
|
||||
--
|
||||
2.1.0
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
config: fix SSL detection
|
||||
|
||||
The @WEBSOCK_HAVE_SSL@ is not replaced at configure time, and even if
|
||||
it was, it would be replaced by an empty string if openssl is disabled,
|
||||
thus still defining WEBSOCK_HAVE_SSL when we would not want it.
|
||||
|
||||
Instead, rely on config.h, which is properly generated by ./configure,
|
||||
to provide the information about whether openssl is enabled or not.
|
||||
|
||||
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
|
||||
|
||||
diff -durN a/src/websock_config.h.in b/src/websock_config.h.in
|
||||
--- a/src/websock_config.h.in
|
||||
+++ b/src/websock_config.h.in
|
||||
@@ -1,9 +1,10 @@
|
||||
#ifndef WEBSOCK_CONFIG_H
|
||||
#define WEBSOCK_CONFIG_H 1
|
||||
|
||||
+#include "config.h"
|
||||
+
|
||||
#define WEBSOCK_PACKAGE_STRING @WEBSOCK_PACKAGE_STRING@
|
||||
#define WEBSOCK_PACKAGE_VERSION @WEBSOCK_PACKAGE_VERSION@
|
||||
#define WEBSOCK_PACKAGE_NAME @WEBSOCK_PACKAGE_NAME@
|
||||
-#define WEBSOCK_HAVE_SSL @WEBSOCK_HAVE_SSL@
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,66 @@
|
||||
utf: do not define decode() to be inline
|
||||
|
||||
Currently, decode() is prototyped in utf.h, its body is in utf.c and it
|
||||
is called from util.c.
|
||||
|
||||
However, decode() is defined to be inline, which can not work since,
|
||||
when compiling util.c, the body of decode() is out-of-scope for that
|
||||
compilation unit.
|
||||
|
||||
Furthermore, decode() uses a utf8d, which is a static defined in utf.c .
|
||||
So utf8d is not visible when compiling util.c either.
|
||||
|
||||
This means that the definition of decode() along with utf8d is basically
|
||||
wrong, and is now failing with gcc-5.x, with warnings like so:
|
||||
|
||||
libtool: compile: /home/ymorin/dev/buildroot/O/host/usr/bin/arm-linux-gcc -DHAVE_CONFIG_H -I. -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wmissing-prototypes -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -c utf.c -fPIC -DPIC -o .libs/libwebsock_la-utf.o
|
||||
utf.c:36:12: warning: ‘utf8d’ is static but used in inline function ‘decode’ which is not static
|
||||
*state = utf8d[256 + *state*16 + type];
|
||||
^
|
||||
utf.c:30:19: warning: ‘utf8d’ is static but used in inline function ‘decode’ which is not static
|
||||
uint32_t type = utf8d[byte];
|
||||
^
|
||||
libtool: compile: /home/ymorin/dev/buildroot/O/host/usr/bin/arm-linux-gcc -DHAVE_CONFIG_H -I. -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Wall -Wmissing-prototypes -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -c util.c -fPIC -DPIC -o .libs/libwebsock_la-util.o
|
||||
In file included from websock.h:73:0,
|
||||
from util.c:20:
|
||||
utf.h:25:17: warning: inline function ‘decode’ declared but never defined
|
||||
uint32_t inline decode(uint32_t *state, uint32_t *codep, uint32_t byte);
|
||||
^
|
||||
|
||||
This results in decode() to be omitted from libwebsock.so, and thus link
|
||||
failures when another program wants to link with -lwebsock.
|
||||
|
||||
The simplest solution is to not inline decode() at all.
|
||||
|
||||
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
|
||||
|
||||
---
|
||||
Note: an alternative would be to move both decode() and utf8d into
|
||||
decode.h nad ditch decode.c if decode really must be inline. This is
|
||||
left as an execise for an interested party. But since upstream hasn't
|
||||
seen a single commit in more than a year now... :-(
|
||||
|
||||
diff -durN a/src/utf.c b/src/utf.c
|
||||
--- a/src/utf.c 2014-07-15 01:43:20.000000000 +0200
|
||||
+++ b/src/utf.c 2015-08-22 22:29:38.667393786 +0200
|
||||
@@ -24,7 +24,7 @@
|
||||
1,3,1,1,1,1,1,3,1,3,1,1,1,1,1,1,1,3,1,1,1,1,1,1,1,1,1,1,1,1,1,1, // s7..s8
|
||||
};
|
||||
|
||||
-uint32_t inline
|
||||
+uint32_t
|
||||
decode(uint32_t* state, uint32_t* codep, uint32_t byte)
|
||||
{
|
||||
uint32_t type = utf8d[byte];
|
||||
diff -durN a/src/utf.h b/src/utf.h
|
||||
--- a/src/utf.h 2014-07-15 01:43:20.000000000 +0200
|
||||
+++ b/src/utf.h 2015-08-22 22:29:10.439227396 +0200
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
-uint32_t inline decode(uint32_t *state, uint32_t *codep, uint32_t byte);
|
||||
+uint32_t decode(uint32_t *state, uint32_t *codep, uint32_t byte);
|
||||
|
||||
|
||||
#endif /* UTF_H_ */
|
||||
16
deprecated/firmware/buildroot/package/libwebsock/Config.in
Normal file
16
deprecated/firmware/buildroot/package/libwebsock/Config.in
Normal file
@@ -0,0 +1,16 @@
|
||||
config BR2_PACKAGE_LIBWEBSOCK
|
||||
bool "libwebsock"
|
||||
select BR2_PACKAGE_LIBEVENT
|
||||
depends on BR2_TOOLCHAIN_HAS_THREADS
|
||||
help
|
||||
C library for easy WebSockets servers.
|
||||
|
||||
This library allows a developer to quickly develop WebSocket
|
||||
servers by focusing on the actual logic of your WebSocket
|
||||
implementation instead of the details of the WebSocket
|
||||
protocol or even specifics of C sockets.
|
||||
|
||||
https://github.com/payden/libwebsock
|
||||
|
||||
comment "libwebsock needs a toolchain w/ threads"
|
||||
depends on !BR2_TOOLCHAIN_HAS_THREADS
|
||||
@@ -0,0 +1,22 @@
|
||||
################################################################################
|
||||
#
|
||||
# libwebsock
|
||||
#
|
||||
################################################################################
|
||||
|
||||
LIBWEBSOCK_VERSION = 3c1615eeadb0b582b63851073bfe3e5132f31ebc
|
||||
LIBWEBSOCK_SITE = $(call github,payden,libwebsock,$(LIBWEBSOCK_VERSION))
|
||||
LIBWEBSOCK_DEPENDENCIES = libevent host-pkgconf
|
||||
LIBWEBSOCK_AUTORECONF = YES
|
||||
LIBWEBSOCK_INSTALL_STAGING = YES
|
||||
LIBWEBSOCK_LICENSE = LGPLv3
|
||||
LIBWEBSOCK_LICENSE_FILES = COPYING.lesser
|
||||
|
||||
ifeq ($(BR2_PACKAGE_OPENSSL),y)
|
||||
LIBWEBSOCK_DEPENDENCIES += openssl
|
||||
LIBWEBSOCK_CONF_OPTS += --with-ssl
|
||||
else
|
||||
LIBWEBSOCK_CONF_OPTS += --without-ssl
|
||||
endif
|
||||
|
||||
$(eval $(autotools-package))
|
||||
Reference in New Issue
Block a user