瀏覽代碼

package/libwebsock: allow building without SSL

libwebsock can optionally use SL, and defaults to using it without
checking for its presence first.

Just disable SSL support if openssl is not enabled, and ensure it is
built before libwebsock if it is enabled.

Add a patch to fix SSL conditional build.

Fixes:
    http://autobuild.buildroot.org/results/2c4/2c49e45667aaf2f2a59ace94885b9d4ed98038d7/
    http://autobuild.buildroot.org/results/517/517bc814732f86dc6dd1a5c91148ce52ec9803f7/
    http://autobuild.buildroot.org/results/951/95109c7e37aa21228bc71c69e9c66a6821f3174a/
    ...

Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Gregory Dymarek <gregd72002@gmail.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Yann E. MORIN 10 年之前
父節點
當前提交
2967f17c52
共有 2 個文件被更改,包括 33 次插入0 次删除
  1. 26 0
      package/libwebsock/0002-fix-ssl.patch
  2. 7 0
      package/libwebsock/libwebsock.mk

+ 26 - 0
package/libwebsock/0002-fix-ssl.patch

@@ -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

+ 7 - 0
package/libwebsock/libwebsock.mk

@@ -12,4 +12,11 @@ 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))