karlheyes / icecast-kh

KH branch of icecast
GNU General Public License v2.0
298 stars 106 forks source link

Problem compile kh9 - config_get_bool, config_get_int, config_get_long 'errno' undeclared #224

Closed sinfrecu closed 6 years ago

sinfrecu commented 6 years ago

hello karl, i have problems compiling kh9, kh8 compiles correct, i have the same error with git clone repository. im running on Digital ocean, Ubuntu Xenial

part of make command exit:

Making all in log
make[3]: Entering directory '/root/icecast-kh/src/log'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/icecast-kh/src/log'
Making all in timing
make[3]: Entering directory '/root/icecast-kh/src/timing'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/icecast-kh/src/timing'
make[3]: Entering directory '/root/icecast-kh/src'
  CC       cfgfile.o
cfgfile.c: In function 'config_get_bool':
cfgfile.c:119:9: error: 'errno' undeclared (first use in this function)
         errno = 0;
         ^
cfgfile.c:119:9: note: each undeclared identifier is reported only once for each function it appears in
cfgfile.c: In function 'config_get_int':
cfgfile.c:148:9: error: 'errno' undeclared (first use in this function)
         errno = 0;
         ^
cfgfile.c: In function 'config_get_long':
cfgfile.c:163:9: error: 'errno' undeclared (first use in this function)
         errno = 0;
         ^
Makefile:593: recipe for target 'cfgfile.o' failed
make[3]: *** [cfgfile.o] Error 1
make[3]: Leaving directory '/root/icecast-kh/src'
Makefile:626: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/root/icecast-kh/src'
Makefile:512: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/root/icecast-kh'
Makefile:423: recipe for target 'all' failed
make: *** [all] Error 2

thank you very much

patphobos commented 6 years ago

i've done this patch in order to package kh9.

--- a/src/cfgfile.c
+++ b/src/cfgfile.c
@@ -23,6 +23,8 @@
 #include <glob.h>
 #endif

+#include <errno.h>
+
 #include <fnmatch.h>
 #include "thread/thread.h"
 #include "cfgfile.h"
--- a/src/client.c
+++ b/src/client.c
@@ -27,6 +27,8 @@
 #include <string.h>
 #include <fcntl.h>

+#include <errno.h>
+
 #include "thread/thread.h"
 #include "avl/avl.h"
 #include "httpp/httpp.h"
sinfrecu commented 6 years ago

worked, thanks for the quick solution!, below attached the output of the make in case it helps.

patching file cfgfile.c
patching file client.c
root@tx:~/icecast-kh-icecast-2.4.0-kh9/src# cd ..
root@tx:~/icecast-kh-icecast-2.4.0-kh9# ./configure
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 whether to enable maintainer-specific portions of Makefiles... no
checking whether make supports nested variables... (cached) yes
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 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 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 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 g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for ld used by g++... /usr/bin/ld -m elf_x86_64
checking if the linker (/usr/bin/ld -m elf_x86_64) is GNU ld... yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking for g++ option to produce PIC... -fPIC -DPIC
checking if g++ PIC flag -fPIC -DPIC works... yes
checking if g++ static flag -static works... yes
checking if g++ supports -c -o file.o... yes
checking if g++ supports -c -o file.o... (cached) yes
checking whether the g++ linker (/usr/bin/ld -m elf_x86_64) supports shared libraries... yes
checking dynamic linker characteristics... (cached) GNU/Linux ld.so
checking how to hardcode library paths into programs... immediate
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 for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for ANSI C header files... (cached) yes
checking whether time.h and sys/time.h may both be included... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking fnmatch.h usability... yes
checking fnmatch.h presence... yes
checking for fnmatch.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking sys/wait.h usability... yes
checking sys/wait.h presence... yes
checking for sys/wait.h... yes
checking alloca.h usability... yes
checking alloca.h presence... yes
checking for alloca.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking glob.h usability... yes
checking glob.h presence... yes
checking for glob.h... yes
checking winsock2.h usability... no
checking winsock2.h presence... no
checking for winsock2.h... no
checking windows.h usability... no
checking windows.h presence... no
checking for windows.h... no
checking stdbool.h usability... yes
checking stdbool.h presence... yes
checking for stdbool.h... yes
checking pwd.h usability... yes
checking pwd.h presence... yes
checking for pwd.h... yes
checking for __func__... yes
checking for off_t... yes
checking for struct timespec... yes
checking for localtime_r... yes
checking for gmtime_r... yes
checking for FindFirstFile... no
checking for fseeko... yes
checking for fnmatch... yes
checking for chroot... yes
checking for fork... yes
checking for poll... yes
checking for atoll... yes
checking for strtoll... yes
checking for strsep... yes
checking for strcasecmp... yes
checking for getrlimit... yes
checking for gettimeofday... yes
checking for ftime... yes
checking for fsync... yes
checking for glob... yes
checking for pread... yes
checking for pipe2... yes
checking for setresuid... yes
checking for setresgid... yes
checking for struct signalfd_siginfo... yes
checking for uint32_t... yes
checking for SOCKET*... no
checking for library containing nanosleep... none required
checking for library containing clock_gettime... none required
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking for socklen_t... yes
checking for va_copy... va_copy
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking sys/uio.h usability... yes
checking sys/uio.h presence... yes
checking for sys/uio.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking netinet/tcp.h usability... yes
checking netinet/tcp.h presence... yes
checking for netinet/tcp.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking for winsock2.h inclusion... no
checking for library containing sethostent... none required
checking for library containing getnameinfo... none required
checking for endhostent... yes
checking for getaddrinfo... yes
checking for inet_aton... yes
checking for writev... yes
checking for struct sockaddr_storage.ss_family... yes
checking for inet_pton... yes
checking for xslt-config... /usr/bin/xslt-config
checking for xsltSaveResultToString... yes
checking for libogg... ok
checking for libvorbis... ok
checking for libtheora... ok
checking for libspeex... configure: WARNING: Speex support disabled!
checking for kate_decode_init in -lkate... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for pthread_spin_lock... yes
checking for curl-config... /usr/bin/curl-config
checking curl/curl.h usability... yes
checking curl/curl.h presence... yes
checking for curl/curl.h... yes
checking for libcurl... yes
checking whether CURLOPT_NOSIGNAL is declared... yes
checking for curl_global_init... yes
checking for pkg-config... no
configure: SSL disabled!
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating Makefile
config.status: creating conf/Makefile
config.status: creating src/Makefile
config.status: creating src/avl/Makefile
config.status: creating src/httpp/Makefile
config.status: creating src/thread/Makefile
config.status: creating src/log/Makefile
config.status: creating src/net/Makefile
config.status: creating src/timing/Makefile
config.status: creating doc/Makefile
config.status: creating web/Makefile
config.status: creating web/images/Makefile
config.status: creating admin/Makefile
config.status: creating win32/Makefile
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing libtool commands
root@tx:~/icecast-kh-icecast-2.4.0-kh9# make
GIT_VERSION=20180423212732
make  all-recursive
make[1]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9'
Making all in conf
make[2]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/conf'
sed -e 's,@pkgdatadir\@,/usr/local/share/icecast,g' -e 's,@localstatedir\@,/usr/local/var,g' -e 's,@PACKAGE\@,icecast,g' ./icecast.xml.in > icecast.xml.dist
sed -e 's,@pkgdatadir\@,/usr/local/share/icecast,g' -e 's,@localstatedir\@,/usr/local/var,g' -e 's,@PACKAGE\@,icecast,g' ./icecast_minimal.xml.in > icecast_minimal.xml.dist
sed -e 's,@pkgdatadir\@,/usr/local/share/icecast,g' -e 's,@localstatedir\@,/usr/local/var,g' -e 's,@PACKAGE\@,icecast,g' ./icecast_shoutcast_compat.xml.in > icecast_shoutcast_compat.xml.dist
make[2]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/conf'
Making all in doc
make[2]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/doc'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/doc'
Making all in web
make[2]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/web'
Making all in images
make[3]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/web/images'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/web/images'
make[3]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/web'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/web'
make[2]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/web'
Making all in admin
make[2]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/admin'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/admin'
Making all in src
make[2]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/src'
Making all in avl
make[3]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/src/avl'
  CC       libiceavl_la-avl.lo
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
  CCLD     libiceavl.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[3]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/src/avl'
Making all in thread
make[3]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/src/thread'
  CC       libicethread_la-thread.lo
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
  CCLD     libicethread.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[3]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/src/thread'
Making all in httpp
make[3]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/src/httpp'
  CC       libicehttpp_la-httpp.lo
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
  CCLD     libicehttpp.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[3]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/src/httpp'
Making all in net
make[3]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/src/net'
  CC       libicenet_la-sock.lo
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
  CC       libicenet_la-resolver.lo
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
  CCLD     libicenet.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[3]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/src/net'
Making all in log
make[3]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/src/log'
  CC       log.lo
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
  CCLD     libicelog.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[3]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/src/log'
Making all in timing
make[3]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/src/timing'
  CC       libicetiming_la-timing.lo
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
../../libtool: line 1762: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8)
  CCLD     libicetiming.la
ar: `u' modifier ignored since `D' is the default (see `U')
make[3]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/src/timing'
make[3]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9/src'
  CC       cfgfile.o
  CC       main.o
  CC       logging.o
  CC       sighandler.o
  CC       connection.o
  CC       global.o
  CC       util.o
  CC       slave.o
  CC       source.o
  CC       stats.o
  CC       refbuf.o
  CC       client.o
client.c: In function 'worker_wakeup':
client.c:564:21: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
  #define pipe_write write
                     ^
client.c:894:5: note: in expansion of macro 'pipe_write'
     pipe_write (worker->wakeup_fd[1], "W", 1);
     ^
client.c: In function 'logger_commits':
client.c:564:21: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
  #define pipe_write write
                     ^
client.c:900:5: note: in expansion of macro 'pipe_write'
     pipe_write (logger_fd[1], "L", 1);
     ^
  CC       xslt.o
  CC       fserve.o
  CC       event.o
  CC       admin.o
  CC       md5.o
  CC       format.o
  CC       format_ogg.o
  CC       format_mp3.o
  CC       format_midi.o
  CC       format_flac.o
  CC       format_ebml.o
  CC       format_opus.o
  CC       auth.o
  CC       auth_htpasswd.o
  CC       format_kate.o
  CC       format_skeleton.o
  CC       mpeg.o
  CC       flv.o
  CC       format_vorbis.o
  CC       format_theora.o
  CC       auth_url.o
  CC       yp.o
  CC       auth_cmd.o
auth_cmd.c: In function 'auth_cmd_client':
auth_cmd.c:330:13: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
             write (outfd[1], str, len);
             ^
  CCLD     icecast
make[3]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/src'
make[2]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9/src'
make[2]: Entering directory '/root/icecast-kh-icecast-2.4.0-kh9'
make[2]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9'
make[1]: Leaving directory '/root/icecast-kh-icecast-2.4.0-kh9'
patphobos commented 6 years ago

hi @fernandezma i think you should keep this issue open until @karlheyes approve the patch and fix the compilation issue in his repo.

best,

Patrice

karlheyes commented 6 years ago

the errno fix is in now