civetweb: fix static linking with openssl
authorPeter Korsgaard <jacmet@sunsite.dk>
Tue, 24 Sep 2013 12:16:17 +0000 (14:16 +0200)
committerPeter Korsgaard <jacmet@sunsite.dk>
Tue, 24 Sep 2013 12:16:17 +0000 (14:16 +0200)
Fixes http://autobuild.buildroot.net/results/acf/acfefc4f0f23ef646094ec427c9502eab7b86736/

Corrects a number of issues with the openssl handling:
 - Libraries have to be listed after the object files using them, so pass
   openssl linker statements in LIBS rather than COPT
 - Openssl support library is libcrypto, not libcrypt
 - Openssl need zlib

Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
package/civetweb/civetweb.mk

index e46856341f7203d9e3472d20604f3ccabcefc8a2..171ad0cf2915334406e31886ec84e4ebb7fb4581 100644 (file)
@@ -11,6 +11,7 @@ CIVETWEB_LICENSE_FILES = LICENSE.md
 
 CIVETWEB_CONF_OPT = TARGET_OS=LINUX
 CIVETWEB_COPT = $(TARGET_CFLAGS) -DHAVE_POSIX_FALLOCATE=0
+CIVETWEB_LIBS = -lpthread -lm -ldl
 CIVETWEB_SYSCONFDIR = /etc
 CIVETWEB_HTMLDIR = /var/www
 
@@ -27,7 +28,8 @@ ifeq ($(BR2_CIVETWEB_WITH_LUA),y)
 endif
 
 ifeq ($(BR2_PACKAGE_OPENSSL),y)
-       CIVETWEB_COPT += -DNO_SSL_DL -lcrypt -lssl
+       CIVETWEB_COPT += -DNO_SSL_DL
+       CIVETWEB_LIBS += -lssl -lcrypto -lz
        CIVETWEB_DEPENDENCIES += openssl
 else
        CIVETWEB_COPT += -DNO_SSL
@@ -36,7 +38,7 @@ endif
 define CIVETWEB_BUILD_CMDS
        $(MAKE) CC="$(TARGET_CC)" LDFLAGS="$(TARGET_LDFLAGS)" -C $(@D) build \
                $(CIVETWEB_CONF_OPT) \
-               COPT="$(CIVETWEB_COPT)"
+               COPT="$(CIVETWEB_COPT)" LIBS="$(CIVETWEB_LIBS)"
 endef
 
 define CIVETWEB_INSTALL_TARGET_CMDS