Commit
ede3963a0c4a13a69c3de2175e7f4cfe7b1f2828
by Oliver Smithcontrib/jenkins: fix running "make distcheck"
Fix for the following, seen with debian 13 and CFLAGS=-g:
/usr/bin/ld: rtl_test.o: undefined reference to symbol 'round@@GLIBC_2.2.5'
/usr/bin/ld: /lib/x86_64-linux-gnu/libm.so.6: error adding symbols: DSO missing from command line
This happens, because "make distcheck" runs ./configure with -Werror and
then gets an incorrect result at "checking for sqrt in -lm". Afterwards
it tries to link rtl_test without -lm.
Correct:
configure:14090: checking for sqrt in -lm
configure:14119: gcc -o conftest -g -I/usr/include/libusb-1.0 conftest.c -lm -lusb-1.0 -lpthread -lm >&5
conftest.c:35:6: warning: conflicting types for built-in function 'sqrt'; expected 'double(double)' [-Wbuiltin-declaration-mismatch]
35 | char sqrt (void);
| ^~~~
conftest.c:1:1: note: 'sqrt' is declared in header '<math.h>'
1 | /* confdefs.h */
configure:14119: $? = 0
configure:14131: result: yes
Failing in "make distcheck" due to -Werror:
configure:14041: checking for atan2 in -lm
configure:14070: gcc -o conftest -g -I/usr/include/libusb-1.0 -fsanitize=address -fsanitize=undefined -Werror -Wno-error=deprecated -Wno-error=deprecated-declarations -Wno-error=cpp -Wall -Wextra -Wno-unused-parameter -Wno-unused -Wsign-compare -Wdeclaration-after-statement -I/usr/include/libusb-1.0 conftest.c -lm -lusb-1.0 -lpthread >&5
conftest.c:35:6: error: conflicting types for built-in function 'atan2'; expected 'double(double, double)' [-Werror=builtin-declaration-mismatch]
35 | char atan2 (void);
| ^~~~~
conftest.c:1:1: note: 'atan2' is declared in header '<math.h>'
1 | /* confdefs.h */
cc1: all warnings being treated as errors
configure:14070: $? = 1
configure: failed program was:
…
configure:14082: result: no
Fix this by running ./configure without --enable-werror before running
"make distcheck".
Related: https://bug-libtool.gnu.narkive.com/YrSM40bs/lt-lib-m-and-gcc
Change-Id: I3aaf21f9fb9ee20409968c7a9160a252d65c8d57