Though CFLAGS is not the issue, LIBS= is.
You are mistaken. Your configure check decides -pthread alone is
sufficient (which it is), and that is all it sets. If your configure put
-lpthread into LIBS, then you would not have a problem. The substitution
of LIBS into the makefile is working fine.
> So what would work is:
>
> %configure ... \
> CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE"
That fails with:
[...]
+ ./configure --build=i386-redhat-linux-gnu
--host=i386-redhat-linux-gnu --program-prefix= --disable-dependency-tracking --prefix=/usr
--exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
--datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/libexec
--localstatedir=/var --sharedstatedir=/var/lib --mandir=/usr/share/man
--infodir=/usr/share/info --with-ldns= --with-libevent --with-pthreads --with-ssl
--disable-rpath --enable-debug --disable-static --with-conf-file=/etc/unbound/unbound.conf
--with-pidfile=/var/run/unbound/unbound.pid --enable-sha2 'CFLAGS=-O2 -g -pipe -Wall
-Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32
-march=i686 -mtune=atom -fasynchronous-unwind-tables -D_GNU_SOURCE QUIET=no'
This indicates you wrote :
%configure ... \
CFLAGS="$RPM_OPT_FLAGS -D_GNU_SOURCE QUIET=no"
QUIET=no belongs outside of quotes. It also does not serve any purpose
there at all. Leave it on your make line as you had it before.
Thanks,
Roland