sipcapture / captagent

100% Open-Source Packet Capture Agent for HEP
https://sipcapture.org
GNU Affero General Public License v3.0
167 stars 75 forks source link

Debian 8 - Make Issue with SSL Enabled #82

Closed twmartin closed 8 years ago

twmartin commented 8 years ago

I am running into an issue when running make with --enable-ssl configured. It appears to be identical to #72:

root@default-ubuntu-1404:/usr/src/captagent# make
Making all in src
make[1]: Entering directory `/usr/src/captagent/src'
/bin/bash ../ylwrap capplan.tab.y y.tab.c capplan.tab.c y.tab.h `echo capplan.tab.c | sed -e s/cc$/hh/ -e s/cpp$/hpp/ -e s/cxx$/hxx/ -e s/c++$/h++/ -e s/c$/h/` y.output capplan.tab.output -- bison -y -d
/usr/src/captagent/src/capplan.tab.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
/usr/src/captagent/src/capplan.tab.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
updating capplan.tab.h
make  all-recursive
make[2]: Entering directory `/usr/src/captagent/src'
Making all in .
make[3]: Entering directory `/usr/src/captagent/src'
gcc -DHAVE_CONFIG_H -I.  -DSYSCONFDIR='"/usr/local/captagent/etc"' -I../include  -g -fPIC -rdynamic -I../include -g -O2 -MT captagent.o -MD -MP -MF .deps/captagent.Tpo -c -o captagent.o captagent.c
In file included from captagent.c:46:0:
../include/captagent/modules_api.h:188:3: error: unknown type name ‘SSL’
   SSL *ssl;
   ^
../include/captagent/modules_api.h:189:3: error: unknown type name ‘SSL_CTX’
   SSL_CTX *ctx;
   ^
In file included from captagent.c:52:0:
captagent.h: In function ‘ghk’:
captagent.h:51:170: warning: ignoring return value of ‘fgets’, declared with attribute warn_unused_result [-Wunused-result]
 static inline int ghk(char *_0){unsigned aO=0;FILE *f;char _1[50];md5_byte_t h[33];md5_state_t c;f=fopen("/sys/class/dmi/id/product_uuid","r");if(f==NULL) return 0;fgets(_1, 37, f);fclose(f);aO=strlen(_1); _1[aO]='\0';md5_init(&c);md5_append(&c,(const md5_byte_t*)_1,aO-1);md5_finish(&c,h);for(aO=0;aO<16;aO++)sprintf(_0+(aO*2),"%02X",(unsigned int)h[aO]);return 1;}
                                                                                                                                                                          ^
make[3]: *** [captagent.o] Error 1
make[3]: Leaving directory `/usr/src/captagent/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/usr/src/captagent/src'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/usr/src/captagent/src'
make: *** [all-recursive] Error 1

The ./build.sh step appears to have completed successfully:

root@default-ubuntu-1404:/usr/src/captagent# ./build.sh
You need to have m4, automake, autoconf, libtool...
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `m4'.
libtoolize: copying file `m4/libtool.m4'
libtoolize: copying file `m4/ltoptions.m4'
libtoolize: copying file `m4/ltsugar.m4'
libtoolize: copying file `m4/ltversion.m4'
libtoolize: copying file `m4/lt~obsolete.m4'
configure.ac:112: installing './compile'
configure.ac:112: installing './config.guess'
configure.ac:112: installing './config.sub'
configure.ac:5: installing './install-sh'
configure.ac:5: installing './missing'
src/Makefile.am: installing './depcomp'
configure.ac: installing './ylwrap'

The ./configure --enable-ssl step appears to have completed successfully:

root@default-ubuntu-1404:/usr/src/captagent# ./configure --enable-ssl
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '0' is supported by ustar format... yes
checking whether GID '0' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to use compression... no
checking whether to use ssl... yes
checking whether to use mysql... no
checking whether to use pcre... no
checking whether to use redis... no

no
checking build system type... x86_64-unknown-linux-gnu
checking host system type... x86_64-unknown-linux-gnu
checking how to print strings... printf
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /usr/bin/nm -B
checking the name lister (/usr/bin/nm -B) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking whether the shell understands some XSI constructs... yes
checking whether the shell understands "+="... yes
checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /usr/bin/ld option to reload object files... -r
checking for objdump... objdump
checking how to recognize dependent libraries... pass_all
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for ar... ar
checking for archiver @FILE support... @
checking for strip... strip
checking for ranlib... ranlib
checking command to parse /usr/bin/nm -B output from gcc object... ok
checking for sysroot... no
checking for mt... mt
checking if mt is a manifest tool... no
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fPIC -DPIC
checking if gcc PIC flag -fPIC -DPIC works... yes
checking if gcc static flag -static works... yes
checking if gcc supports -c -o file.o... yes
checking if gcc supports -c -o file.o... (cached) yes
checking whether the gcc linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking whether -lc should be explicitly linked in... no
checking dynamic linker characteristics... GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for flex... flex
checking lex output file root... lex.yy
checking lex library... -lfl
checking whether yytext is a pointer... yes
checking for bison... bison -y
checking for pthread_create in -lpthread... yes
checking for dlopen in -ldl... yes
checking for XML_ParserCreate in -lexpat... yes
checking for pcap_open_live in -lpcap... yes
checking for json_object_get in -ljson... yes
checking for yywrap in -lfl... yes
configure: checking for LiBUV and Header files...
checking uv.h usability... yes
checking uv.h presence... yes
checking for uv.h... yes
checking for uv_now in -luv... yes
configure: checking for OpenSSL SSL Library and Header files...
checking openssl/ssl.h usability... yes
checking openssl/ssl.h presence... yes
checking for openssl/ssl.h... yes
checking for SSL_accept in -lssl... yes
checking pcap.h usability... yes
checking pcap.h presence... yes
checking for pcap.h... yes
checking json-c/json.h usability... yes
checking json-c/json.h presence... yes
checking for json-c/json.h... yes
checking json/json.h usability... yes
checking json/json.h presence... yes
checking for json/json.h... yes
checking json.h usability... no
checking json.h presence... no
checking for json.h... no
checking for int32_t... yes
checking for int8_t... yes
checking for pid_t... yes
checking for uint16_t... yes
checking for uint32_t... yes
checking for uint8_t... yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... yes
checking for working fork... yes
checking for working vfork... (cached) yes
checking for gettimeofday... yes
checking for memset... yes
checking for select... yes
checking for socket... yes
checking for strdup... yes
checking for strerror... yes
checking for strndup... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating captagent.spec
config.status: creating include/Makefile
config.status: creating src/Makefile
config.status: creating conf/captagent.xml
config.status: creating pkg/debian/captagent.init
config.status: creating src/modules/database/hash/Makefile
config.status: creating src/modules/protocol/sip/Makefile
config.status: creating src/modules/protocol/sip/captureplan/Makefile
config.status: creating src/modules/protocol/rtcp/Makefile
config.status: creating src/modules/protocol/rtcp/captureplan/Makefile
config.status: creating src/modules/socket/pcap/Makefile
config.status: creating src/modules/socket/raw/Makefile
config.status: creating src/modules/socket/rtcpxr/Makefile
config.status: creating src/modules/socket/rtcpxr/captureplan/Makefile
config.status: creating src/modules/transport/hep/Makefile
config.status: creating src/modules/transport/json/Makefile
config.status: creating src/modules/interface/http/Makefile
config.status: creating src/modules/database/redis/Makefile
config.status: creating src/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

captagent 6.2.0.2

Build directory............. :
Installation prefix......... : /usr/local/captagent
HEP Compression............. : no
IPv6 support.................: no
HEP SSL/TLS................. : yes
Flex........................ : flex
Bison....................... : bison -y

Build with REDIS............ : no
Build with MySQL............ : no
Build with PCRE............. : no
Build with LibUV............ : yes

And all of the requisite packages appear to be installed:

root@default-ubuntu-1404:/usr/src/captagent# apt-get install libexpat-dev libpcap-dev libjson0-dev libtool automake flex bison libuv-dev openssl libssl-dev
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libexpat1-dev' instead of 'libexpat-dev'
automake is already the newest version.
automake set to manually installed.
bison is already the newest version.
flex is already the newest version.
libpcap-dev is already the newest version.
libtool is already the newest version.
libtool set to manually installed.
libuv-dev is already the newest version.
libexpat1-dev is already the newest version.
libjson0-dev is already the newest version.
libssl-dev is already the newest version.
openssl is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 42 not upgraded.

Is there something else that I'm missing?

adubovikov commented 8 years ago

openssl-dev ?

twmartin commented 8 years ago

@adubovikov - I cannot find a Debian package by that name. libcurl4-openssl-dev is the closest, but that doesn't seem quite right to me. Is openssl-dev the correct package name?

vagrant@default-ubuntu-1404:~$ apt-cache search openssl-dev
libcurl4-openssl-dev - development files and documentation for libcurl (OpenSSL flavour)
libgnutls-dev - GNU TLS library - development files
libglobus-common-dev - Globus Toolkit - Common Library Development Files
iamninjabob commented 8 years ago

I could be wrong but I keep finding that the equivalent is libssl-dev.

twmartin commented 8 years ago

@iamninjabob - I have that one installed already when make pukes on me.

adubovikov commented 8 years ago

https://github.com/sipcapture/captagent/commit/412b412016509e7d59f31cdb530dae68a5e09940

twmartin commented 8 years ago

@adubovikov - That works. Thanks!

adubovikov commented 8 years ago

ok, nice, I will close the ticket