[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] libevent-2.1.4-alpha: implicit declaration of function 'SSL_set_tlsext_host_name'



Brilliantov Kirill Vladimirovich wrote on 04/14/14 13:17:
> Hello!
> I try cross-compile libevent-2.1.4-alpha for ARM CPU.
> Follow my configuration options:
> ./configure --prefix=/tmp/libevent --host=arm-fsl-linux-gnueabi
> --disable-debug-mode --disable-libevent-install
> --disable-libevent-regress --enable-function-sections
> --enable-gcc-hardening
> CC=/opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-fsl-linux-gnueabi-gcc
> CFLAGS=-I/opt/IMX53/ltib/rpm/BUILD/openssl-0.9.8g/include
> LDFLAGS=-L/opt/IMX53/ltib/rpm/BUILD/openssl-0.9.8g -lssl -lcrypto
> 
> Unfortunately compilation stopped on samples:
>   CCLD     sample/le-proxy
>   CC       sample/https-client.o
> sample/https-client.c: In function 'main':
> sample/https-client.c:350: warning: implicit declaration of function
> 'SSL_set_tlsext_host_name'
> sample/https-client.c:350: warning: nested extern declaration of
> 'SSL_set_tlsext_host_name'
>   CC       sample/hostcheck.o
>   CC       sample/openssl_hostname_validation.o
>   CCLD     sample/https-client
> sample/https-client.o: In function `main':
> https-client.c:(.text+0xa78): undefined reference to
> `SSL_set_tlsext_host_name'
> collect2: ld returned 1 exit status
> make[2]: *** [sample/https-client] Error 1
> 
> I think I found possible reason - configure search OpenSSL in system:
> $ grep SSL_INCS libevent-2.1.4-alpha/configure
> OPENSSL_INCS
>         OPENSSL_INCS=`$PKG_CONFIG --cflags openssl 2>/dev/null`
> 
> I think problem will be solved after added OpenSSL configuration options
> in configuration, e.g. OPENSSL_INCLUDE_DIR and OPENSSK_LIB_DIR.
> 
> Or may by I have another way for solving this problem?
> Thank you and excuse me for my bad english.
> 

I disable build sample and this solve problem, please see attached patches.

-- 
Best regards,
Brilliantov Kirill Vladimirovich
--- libevent-2.1.4-alpha/configure.ac.org	2014-04-14 13:41:58.646258921 +0400
+++ libevent-2.1.4-alpha/configure.ac	2014-04-14 13:57:07.364411533 +0400
@@ -117,7 +117,9 @@
 AC_ARG_ENABLE([verbose-debug],
 		AS_HELP_STRING([--enable-verbose-debug, verbose debug logging]),
 	[], [enable_verbose_debug=no])
-
+AC_ARG_ENABLE([build-samples],
+	AS_HELP_STRING([--disable-samples, disable build samples]),
+	[], [build_samples=yes])
 
 AC_PROG_LIBTOOL
 
@@ -128,6 +130,7 @@
 AC_SUBST(LIBTOOL_DEPS)
 
 AM_CONDITIONAL([BUILD_REGRESS], [test "$enable_libevent_regress" = "yes"])
+AM_CONDITIONAL([BUILD_SAMPLES], [test "$enable_build_samples" = "yes"])
 
 dnl Checks for libraries.
 AC_SEARCH_LIBS([inet_ntoa], [nsl])
--- libevent-2.1.4-alpha/sample/include.am.org	2014-04-14 13:59:06.551978237 +0400
+++ libevent-2.1.4-alpha/sample/include.am	2014-04-14 13:59:31.356374799 +0400
@@ -4,6 +4,7 @@
 #
 # See LICENSE for copying information.
 
+if BUILD_SAMPLES
 SAMPLES = \
 	sample/dns-example				\
 	sample/event-read-fifo			\
@@ -46,5 +47,5 @@
 sample_hello_world_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
 sample_http_server_SOURCES = sample/http-server.c
 sample_http_server_LDADD = $(LIBEVENT_GC_SECTIONS) libevent.la
-
+endif