Cacti / spine

Spine C Based Poller for Cacti
GNU Lesser General Public License v2.1
80 stars 45 forks source link

make throws tons of undefined net-snmp references #27

Closed emeidi closed 7 years ago

emeidi commented 7 years ago

Trying to compile cacti-spine-1.1.16:

  1. cd /tmp
  2. Download spine-1.1.16.tar.gz
  3. tar xvzf cacti-spine-1.1.16.tar.gz
  4. cd cacti-spine-1.1.16
  5. run CFLAGS="-I/usr/include/mariadb -I/usr/include/net-snmp" ./configure
  6. Edit Makefile replace LIBS = -lmysqlclient -lcrypto -lz -lpthread -lm with LIBS = -lmariadbclient -lcrypto -lz -lpthread -lm replace CFLAGS = -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -g -O2 with CFLAGS = -I/usr/include/mariadb -I/usr/include/net-snmp -g -O2
  7. make failes with tons of messages like this snmp.c:(.text+0x1c): undefined reference to 'netsnmp_ds_set_boolean'

Output of ./configure:

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
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... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gawk... (cached) gawk
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 for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... yes
checking how to print strings... printf
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 the maximum length of command line arguments... 1572864
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-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 a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
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) 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 whether to enable -Wall... no
checking for help2man... false // No help2man //
checking for help2man... false // No help2man //
./configure: line 12242: test: too many arguments
checking for threadsafe gethostbyname()... no
checking for gethostbyname_r in -lnls... no
checking for socket in -lsocket... no
checking for floor in -lm... yes
checking for pthread_exit in -lpthread... yes
checking for deflate in -lz... yes
checking for kstat_close in -lkstat... no
checking for CRYPTO_realloc in -lcrypto... yes
checking for ANSI C header files... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking assert.h usability... yes
checking assert.h presence... yes
checking for assert.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for signal.h... (cached) yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for netinet/in_systm.h... yes
checking for netinet/in.h... yes
checking for netinet/ip.h... yes
checking for netinet/ip_icmp.h... yes
checking for unsigned long long... yes
checking for long long... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking return type of signal handlers... void
checking for malloc... yes
checking for calloc... yes
checking for gettimeofday... yes
checking for strerror... yes
checking for strtoll... yes
checking priv.h usability... no
checking priv.h presence... no
checking for priv.h... no
checking whether we are using Solaris privileges... no
checking sys/capability.h usability... no
checking sys/capability.h presence... no
checking for sys/capability.h... no
checking whether we are using Linux Capabilities... no
checking if Net-SNMP needs crypto support... yes
checking for snmp_timeout in -lnetsnmp... no
checking for the spine results buffer size... 1024 bytes
checking for the maximum simultaneous spine scripts... 20
checking for the maximum MySQL buffer size... 65536
checking whether we are using traditional popen... no
checking whether to verify net-snmp library vs header versions... no
checking for glibc gethostbyname_r... no
checking for Solaris/Irix gethostbyname_r... no
checking for HP-UX gethostbyname_r... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

Output of make:

gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT sql.o -MD -MP -MF .deps/sql.Tpo -c -o sql.o sql.c
mv -f .deps/sql.Tpo .deps/sql.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT spine.o -MD -MP -MF .deps/spine.Tpo -c -o spine.o spine.c
mv -f .deps/spine.Tpo .deps/spine.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT util.o -MD -MP -MF .deps/util.Tpo -c -o util.o util.c
mv -f .deps/util.Tpo .deps/util.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT snmp.o -MD -MP -MF .deps/snmp.Tpo -c -o snmp.o snmp.c
mv -f .deps/snmp.Tpo .deps/snmp.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT locks.o -MD -MP -MF .deps/locks.Tpo -c -o locks.o locks.c
mv -f .deps/locks.Tpo .deps/locks.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT poller.o -MD -MP -MF .deps/poller.Tpo -c -o poller.o poller.c
mv -f .deps/poller.Tpo .deps/poller.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT nft_popen.o -MD -MP -MF .deps/nft_popen.Tpo -c -o nft_popen.o nft_popen.c
mv -f .deps/nft_popen.Tpo .deps/nft_popen.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT php.o -MD -MP -MF .deps/php.Tpo -c -o php.o php.c
mv -f .deps/php.Tpo .deps/php.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT ping.o -MD -MP -MF .deps/ping.Tpo -c -o ping.o ping.c
mv -f .deps/ping.Tpo .deps/ping.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT keywords.o -MD -MP -MF .deps/keywords.Tpo -c -o keywords.o keywords.c
mv -f .deps/keywords.Tpo .deps/keywords.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mariadb -I/usr/include/net-snmp -MT error.o -MD -MP -MF .deps/error.Tpo -c -o error.o error.c
mv -f .deps/error.Tpo .deps/error.Po
/bin/sh ./libtool  --tag=CC   --mode=link gcc  -I/usr/include/mariadb -I/usr/include/net-snmp  -lpthread -lssl -lm  -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o  -lmariadbclient -lcrypto -lz -lpthread -lm 
libtool: link: gcc -I/usr/include/mariadb -I/usr/include/net-snmp -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o  -lssl -lmariadbclient -lcrypto -lz -lpthread -lm
snmp.o: In function `snmp_spine_init':
snmp.c:(.text+0x1c): undefined reference to `netsnmp_ds_set_boolean'
snmp.c:(.text+0x2d): undefined reference to `netsnmp_ds_set_boolean'
snmp.c:(.text+0x3e): undefined reference to `netsnmp_ds_set_boolean'
snmp.c:(.text+0x4f): undefined reference to `netsnmp_ds_set_boolean'
snmp.c:(.text+0x60): undefined reference to `netsnmp_ds_set_boolean'
snmp.o:snmp.c:(.text+0x71): more undefined references to `netsnmp_ds_set_boolean' follow
snmp.o: In function `snmp_spine_init':
snmp.c:(.text+0xcb): undefined reference to `init_snmp'
snmp.o: In function `snmp_spine_close':
snmp.c:(.text+0xf6): undefined reference to `snmp_shutdown'
snmp.o: In function `snmp_host_init':
snmp.c:(.text+0x12b): undefined reference to `snmp_sess_init'
snmp.c:(.text+0x16d): undefined reference to `netsnmp_ds_set_boolean'
snmp.c:(.text+0x17e): undefined reference to `netsnmp_ds_set_boolean'
snmp.c:(.text+0x18f): undefined reference to `netsnmp_ds_set_boolean'
snmp.c:(.text+0x1a0): undefined reference to `netsnmp_ds_set_boolean'
snmp.c:(.text+0x1b1): undefined reference to `netsnmp_ds_set_boolean'
snmp.o:snmp.c:(.text+0x1c2): more undefined references to `netsnmp_ds_set_boolean' follow
snmp.o: In function `snmp_host_init':
snmp.c:(.text+0x3de): undefined reference to `usmHMACMD5AuthProtocol'
snmp.c:(.text+0x3e4): undefined reference to `snmp_duplicate_objid'
snmp.c:(.text+0x404): undefined reference to `usmHMACSHA1AuthProtocol'
snmp.c:(.text+0x40a): undefined reference to `snmp_duplicate_objid'
snmp.c:(.text+0x461): undefined reference to `generate_Ku'
snmp.c:(.text+0x4a8): undefined reference to `usmNoPrivProtocol'
snmp.c:(.text+0x4ae): undefined reference to `snmp_duplicate_objid'
snmp.c:(.text+0x4f2): undefined reference to `usmDESPrivProtocol'
snmp.c:(.text+0x4f8): undefined reference to `snmp_duplicate_objid'
snmp.c:(.text+0x520): undefined reference to `usmAESPrivProtocol'
snmp.c:(.text+0x526): undefined reference to `snmp_duplicate_objid'
snmp.c:(.text+0x585): undefined reference to `generate_Ku'
snmp.c:(.text+0x5ba): undefined reference to `snmp_sess_open'
snmp.o: In function `snmp_host_cleanup':
snmp.c:(.text+0x653): undefined reference to `snmp_sess_close'
snmp.o: In function `snmp_get':
snmp.c:(.text+0x6e7): undefined reference to `snmp_pdu_create'
snmp.c:(.text+0x703): undefined reference to `snmp_parse_oid'
snmp.c:(.text+0x752): undefined reference to `snmp_add_null_var'
snmp.c:(.text+0x76e): undefined reference to `snmp_sess_synch_response'
snmp.c:(.text+0x833): undefined reference to `snmp_free_pdu'
snmp.o: In function `snmp_getnext':
snmp.c:(.text+0x8fb): undefined reference to `snmp_pdu_create'
snmp.c:(.text+0x917): undefined reference to `snmp_parse_oid'
snmp.c:(.text+0x966): undefined reference to `snmp_add_null_var'
snmp.c:(.text+0x982): undefined reference to `snmp_sess_synch_response'
snmp.c:(.text+0xa78): undefined reference to `snmp_free_pdu'
snmp.o: In function `snmp_count':
snmp.c:(.text+0xb8c): undefined reference to `snmp_parse_oid'
snmp.c:(.text+0xbf2): undefined reference to `snmp_pdu_create'
snmp.c:(.text+0xc0d): undefined reference to `snmp_add_null_var'
snmp.c:(.text+0xc29): undefined reference to `snmp_sess_synch_response'
snmp.c:(.text+0xcec): undefined reference to `snmp_oid_compare'
snmp.c:(.text+0xdcf): undefined reference to `snmp_free_pdu'
snmp.o: In function `snmp_snprint_value':
snmp.c:(.text+0xe64): undefined reference to `sprint_realloc_by_type'
snmp.o: In function `snmp_get_multi':
snmp.c:(.text+0xf0d): undefined reference to `snmp_pdu_create'
snmp.c:(.text+0xf54): undefined reference to `snmp_parse_oid'
snmp.c:(.text+0xfca): undefined reference to `snmp_add_null_var'
snmp.c:(.text+0x1004): undefined reference to `snmp_sess_synch_response'
snmp.c:(.text+0x11e1): undefined reference to `snmp_fix_pdu'
snmp.c:(.text+0x11f3): undefined reference to `snmp_free_pdu'
snmp.c:(.text+0x1274): undefined reference to `snmp_free_pdu'
ping.o: In function `ping_snmp':
ping.c:(.text+0x55a): undefined reference to `snmp_api_errstring'
ping.c:(.text+0x59d): undefined reference to `snmp_api_errstring'
collect2: error: ld returned 1 exit status
Makefile:465: recipe for target 'spine' failed
make: *** [spine] Error 1

Versions net-snmp ii libsnmp-dev 5.7.3+dfsg-1.7 i386 SNMP (Simple Network Management Protocol) development files

Files present in /etc/include/net-snmp:

ls -l /usr/include/net-snmp/
total 192
drwxr-xr-x 3 root root 12288 Mar  5 14:57 agent
-rw-r--r-- 1 root root  4043 Jan 24  2017 config_api.h
-rw-r--r-- 1 root root   947 Jan 24  2017 definitions.h
drwxr-xr-x 2 root root 12288 Mar  5 14:57 library
drwxr-xr-x 2 root root  4096 Mar  5 14:57 machine
-rw-r--r-- 1 root root  3476 Jan 24  2017 mib_api.h
-rw-r--r-- 1 root root 76978 Jan 24  2017 net-snmp-config.h
-rw-r--r-- 1 root root   927 Jan 24  2017 net-snmp-features.h
-rw-r--r-- 1 root root  1575 Jan 24  2017 net-snmp-includes.h
-rw-r--r-- 1 root root  5539 Jan 24  2017 output_api.h
-rw-r--r-- 1 root root  1280 Jan 24  2017 pdu_api.h
-rw-r--r-- 1 root root 11204 Jan 24  2017 session_api.h
-rw-r--r-- 1 root root  1178 Jan 24  2017 snmpv3_api.h
drwxr-xr-x 2 root root  4096 Mar  5 14:57 system
-rw-r--r-- 1 root root 12342 Jan 24  2017 types.h
-rw-r--r-- 1 root root  3318 Dec  8  2014 util_funcs.h
-rw-r--r-- 1 root root  2036 Jan 24  2017 utilities.h
-rw-r--r-- 1 root root  4159 Jan 24  2017 varbind_api.h
-rw-r--r-- 1 root root   329 Jan 24  2017 version.h
cigamit commented 7 years ago

Review the config.log and search for snmp_timeout and fix that issue, then re-configure and make. Here is the important check that should not have failed:

checking for snmp_timeout in -lnetsnmp... no

cigamit commented 7 years ago

Also, why are you altering the auto-detection of net-snmp libraries and headers? On any real Linux system you should never need to do this unless you are installing a custom binary.

emeidi commented 7 years ago

Here's the line from the log:

1553 configure:13252: checking for snmp_timeout in -lnetsnmp
1554 configure:13277: gcc -o conftest -I/usr/include/mysql -I/usr/include/mariadb  -lpthread -lssl      -lm  conftest.c -lnetsnmp  -lmysqlclient -lcrypto -lz -lpthread -lm  >&5
1555 /usr/bin/ld: cannot find -lmysqlclient
1556 collect2: error: ld returned 1 exit status
1557 configure:13277: $? = 1

The check fails because on my Debian system, I don't have MySQL installed but MariaDB.

emeidi commented 7 years ago

Regarding the auto-detection:

Trying to compile cacti-spine-1.1.16:

  1. cd /tmp
  2. Download spine-1.1.16.tar.gz
  3. tar xvzf cacti-spine-1.1.16.tar.gz
  4. cd cacti-spine-1.1.16
  5. run ./configure
  6. make fails with the following message: /usr/bin/ld: cannot find -lmysqlclient

Output of ./configure:

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
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... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gawk... (cached) gawk
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 for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking whether ln -s works... yes
checking how to print strings... printf
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 the maximum length of command line arguments... 1572864
checking how to convert i686-pc-linux-gnu file names to i686-pc-linux-gnu format... func_convert_file_noop
checking how to convert i686-pc-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 a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for mt... mt
checking if mt is a manifest tool... no
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) 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 whether to enable -Wall... no
checking for help2man... false // No help2man //
checking for help2man... false // No help2man //
./configure: line 12242: test: too many arguments
checking for threadsafe gethostbyname()... no
checking for gethostbyname_r in -lnls... no
checking for socket in -lsocket... no
checking for floor in -lm... yes
checking for pthread_exit in -lpthread... yes
checking for deflate in -lz... yes
checking for kstat_close in -lkstat... no
checking for CRYPTO_realloc in -lcrypto... yes
checking for ANSI C header files... (cached) yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking assert.h usability... yes
checking assert.h presence... yes
checking for assert.h... yes
checking ctype.h usability... yes
checking ctype.h presence... yes
checking for ctype.h... yes
checking errno.h usability... yes
checking errno.h presence... yes
checking for errno.h... yes
checking signal.h usability... yes
checking signal.h presence... yes
checking for signal.h... yes
checking math.h usability... yes
checking math.h presence... yes
checking for math.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for signal.h... (cached) yes
checking stdarg.h usability... yes
checking stdarg.h presence... yes
checking for stdarg.h... yes
checking stdio.h usability... yes
checking stdio.h presence... yes
checking for stdio.h... yes
checking syslog.h usability... yes
checking syslog.h presence... yes
checking for syslog.h... yes
checking for netinet/in_systm.h... yes
checking for netinet/in.h... yes
checking for netinet/ip.h... yes
checking for netinet/ip_icmp.h... yes
checking for unsigned long long... yes
checking for long long... yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking return type of signal handlers... void
checking for malloc... yes
checking for calloc... yes
checking for gettimeofday... yes
checking for strerror... yes
checking for strtoll... yes
checking priv.h usability... no
checking priv.h presence... no
checking for priv.h... no
checking whether we are using Solaris privileges... no
checking sys/capability.h usability... no
checking sys/capability.h presence... no
checking for sys/capability.h... no
checking whether we are using Linux Capabilities... no
checking if Net-SNMP needs crypto support... no
checking for snmp_timeout in -lnetsnmp... no
checking for the spine results buffer size... 1024 bytes
checking for the maximum simultaneous spine scripts... 20
checking for the maximum MySQL buffer size... 65536
checking whether we are using traditional popen... no
checking whether to verify net-snmp library vs header versions... no
checking for glibc gethostbyname_r... no
checking for Solaris/Irix gethostbyname_r... no
checking for HP-UX gethostbyname_r... no
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating config/config.h
config.status: executing depfiles commands
config.status: executing libtool commands

Output of make:

gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT sql.o -MD -MP -MF .deps/sql.Tpo -c -o sql.o sql.c
mv -f .deps/sql.Tpo .deps/sql.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT spine.o -MD -MP -MF .deps/spine.Tpo -c -o spine.o spine.c
mv -f .deps/spine.Tpo .deps/spine.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT util.o -MD -MP -MF .deps/util.Tpo -c -o util.o util.c
mv -f .deps/util.Tpo .deps/util.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT snmp.o -MD -MP -MF .deps/snmp.Tpo -c -o snmp.o snmp.c
mv -f .deps/snmp.Tpo .deps/snmp.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT locks.o -MD -MP -MF .deps/locks.Tpo -c -o locks.o locks.c
mv -f .deps/locks.Tpo .deps/locks.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT poller.o -MD -MP -MF .deps/poller.Tpo -c -o poller.o poller.c
mv -f .deps/poller.Tpo .deps/poller.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT nft_popen.o -MD -MP -MF .deps/nft_popen.Tpo -c -o nft_popen.o nft_popen.c
mv -f .deps/nft_popen.Tpo .deps/nft_popen.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT php.o -MD -MP -MF .deps/php.Tpo -c -o php.o php.c
mv -f .deps/php.Tpo .deps/php.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT ping.o -MD -MP -MF .deps/ping.Tpo -c -o ping.o ping.c
mv -f .deps/ping.Tpo .deps/ping.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT keywords.o -MD -MP -MF .deps/keywords.Tpo -c -o keywords.o keywords.c
mv -f .deps/keywords.Tpo .deps/keywords.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -g -O2 -MT error.o -MD -MP -MF .deps/error.Tpo -c -o error.o error.c
mv -f .deps/error.Tpo .deps/error.Po
/bin/sh ./libtool  --tag=CC   --mode=link gcc  -I/usr/include/mysql -g -O2  -lpthread -lssl -lm  -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o  -lmysqlclient -lcrypto -lz -lpthread -lm 
libtool: link: gcc -I/usr/include/mysql -g -O2 -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o  -lssl -lmysqlclient -lcrypto -lz -lpthread -lm
/usr/bin/ld: cannot find -lmysqlclient
collect2: error: ld returned 1 exit status
Makefile:465: recipe for target 'spine' failed
make: *** [spine] Error 1
emeidi commented 7 years ago

Okey @cigamit , getting further now that I have changed the configure script:

Before:

if test $MYSQL_REENTRANT = 0 ; then
  LIBS="-lmysqlclient $LIBS"
else
  LIBS="-lmysqlclient_r $LIBS"
fi

After:

if test $MYSQL_REENTRANT = 0 ; then
  LIBS="-lmariadbclient $LIBS"
else
  LIBS="-lmysqlclient_r $LIBS"
fi

Next I run CFLAGS="-I/usr/include/mariadb -I/usr/include/net-snmp" ./configure, then make. Now the following error message pops up:

Output of make:

gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT sql.o -MD -MP -MF .deps/sql.Tpo -c -o sql.o sql.c
mv -f .deps/sql.Tpo .deps/sql.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT spine.o -MD -MP -MF .deps/spine.Tpo -c -o spine.o spine.c
mv -f .deps/spine.Tpo .deps/spine.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT util.o -MD -MP -MF .deps/util.Tpo -c -o util.o util.c
mv -f .deps/util.Tpo .deps/util.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT snmp.o -MD -MP -MF .deps/snmp.Tpo -c -o snmp.o snmp.c
mv -f .deps/snmp.Tpo .deps/snmp.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT locks.o -MD -MP -MF .deps/locks.Tpo -c -o locks.o locks.c
mv -f .deps/locks.Tpo .deps/locks.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT poller.o -MD -MP -MF .deps/poller.Tpo -c -o poller.o poller.c
mv -f .deps/poller.Tpo .deps/poller.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT nft_popen.o -MD -MP -MF .deps/nft_popen.Tpo -c -o nft_popen.o nft_popen.c
mv -f .deps/nft_popen.Tpo .deps/nft_popen.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT php.o -MD -MP -MF .deps/php.Tpo -c -o php.o php.c
mv -f .deps/php.Tpo .deps/php.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT ping.o -MD -MP -MF .deps/ping.Tpo -c -o ping.o ping.c
mv -f .deps/ping.Tpo .deps/ping.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT keywords.o -MD -MP -MF .deps/keywords.Tpo -c -o keywords.o keywords.c
mv -f .deps/keywords.Tpo .deps/keywords.Po
gcc -DHAVE_CONFIG_H -I. -I./config     -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -MT error.o -MD -MP -MF .deps/error.Tpo -c -o error.o error.c
mv -f .deps/error.Tpo .deps/error.Po
/bin/sh ./libtool  --tag=CC   --mode=link gcc  -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp  -lpthread -lssl -lm  -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o  -lnetsnmp -lmariadbclient -lcrypto -lz -lpthread -lm 
libtool: link: gcc -I/usr/include/mysql -I/usr/include/mariadb -I/usr/include/net-snmp -o spine sql.o spine.o util.o snmp.o locks.o poller.o nft_popen.o php.o ping.o keywords.o error.o  -lssl -lnetsnmp -lmariadbclient -lcrypto -lz -lpthread -lm
/usr/bin/ld: warning: libcrypto.so.1.0.2, needed by /usr/lib/gcc/i686-linux-gnu/6/../../../i386-linux-gnu/libnetsnmp.so, may conflict with libcrypto.so.1.1
false // No help2man // --output=spine.1 --name='Data Collector for Cacti' --no-info --version-option='--version' ./spine
Makefile:939: recipe for target 'spine.1' failed
make: *** [spine.1] Error 1
emeidi commented 7 years ago

I just realized I actually ended up with a working spine binary, despite the warnings and error messages.

Copied it to /usr/local/spine/bin, symlinked it and gave it SUID permissions; seems to properly work now:

lrwxrwxrwx 1 root staff     12 Aug 12 16:00 spine -> spine.1.1.16
-rwsr-sr-x 1 root root  273080 Mar  5 16:51 spine.0.8.8h
-rwsr-sr-x 1 root root  342288 Mar  5 16:51 spine.1.0.4
-rwsr-sr-x 1 root root  135020 Aug 12 15:59 spine.1.1.16