[patch] vorbis-tools-1.4.0 has missing linkage to mathlib
Fix building with ./configure --enable-ogg123 --without-flac --without-speex --without-kate
and make
:
libtool: link: gcc -Wall -ffast-math -fsigned-char -O2 -pipe -march=native -Wl,-O1 -Wl,--hash-style=gnu -o oggenc oggenc.o audio.o encode.o platform.o resample.o skeleton.o -Wl,--as-needed ../share/libutf8.a ../share/libgetopt.a -lvorbisenc -lvorbis -logg resample.o:resample.c:function res_init: error: undefined reference to 'sin' collect2: error: ld returned 1 exit status
libtool: link: gcc -Wall -ffast-math -fsigned-char -O2 -pipe -march=native -Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu -o ogg123 audio.o buffer.o callbacks.o cfgfile_options.o cmdline_options.o file_transport.o format.o http_transport.o ogg123.o oggvorbis_format.o playlist.o status.o remote.o transport.o vorbis_comments.o vgfilter.o ../share/libutf8.a ../share/libgetopt.a -lvorbisfile -lvorbis -logg -lao -lnsl -lcurl -lpthread vgfilter.o:vgfilter.c:function vg_init: error: undefined reference to '__pow_finite' vgfilter.o:vgfilter.c:function vg_init: error: undefined reference to '__pow_finite' vgfilter.o:vgfilter.c:function vg_filter: error: undefined reference to 'tanh' vgfilter.o:vgfilter.c:function vg_filter: error: undefined reference to 'tanh' collect2: error: ld returned 1 exit status
This is using the new GNU gold linker:
$ ld -v GNU gold (GNU Binutils 2.24) 1.11
Happens because -lm gets appended to the libraries list only with, for example, --with-flac but vgfilter.c and resample.c are always using functions from the mathlib.
Therefore, always link to mathlib.