Page MenuHome GnuPG

gpa: configure bug
Closed, ResolvedPublic

Description

configure does not make use of CFLAGS correctly.

if I try CFLAGS='-march=i686' ./configure, I fail early in make:
/usr/bin/make all-recursive

make[1]: Entering directory `/usr/src/gpa-0.8.0'

Making all in m4

make[2]: Entering directory `/usr/src/gpa-0.8.0/m4'

make[2]: Nothing to be done for `all'.

make[2]: Leaving directory `/usr/src/gpa-0.8.0/m4'

Making all in src

make[2]: Entering directory `/usr/src/gpa-0.8.0/src'

/usr/bin/make all-am

make[3]: Entering directory `/usr/src/gpa-0.8.0/src'

gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -I../pixmaps -D_REENTRANT
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/directfb -I/usr/include/libpng12 -march=i686 -pipe -mtune=core2
-Wall -MT get-path.o -MD -MP -MF .deps/get-path.Tpo -c -o get-path.o get-path.c
mv -f .deps/get-path.Tpo .deps/get-path.Po
gcc -DHAVE_CONFIG_H -I. -I.. -I../intl -I../pixmaps -D_REENTRANT
-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0
-I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0
-I/usr/lib/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2
-I/usr/include/directfb -I/usr/include/libpng12 -march=i686 -pipe -mtune=core2
-Wall -MT gpa.o -MD -MP -MF .deps/gpa.Tpo -c-o gpa.o gpa.c
gpa.c: In function 'main':
gpa.c:342: error: 'LC_CTYPE' undeclared (first use in this function)
gpa.c:342: error: (Each undeclared identifier is reported only once
gpa.c:342: error: for each function it appears in.)
gpa.c:342: warning: implicit declaration of function 'setlocale'
gpa.c:342: warning: passing argument 3 of 'gpgme_set_locale' makes pointer from
integer without a cast
gpa.c:343: error: 'LC_MESSAGES' undeclared (first use in this function)
gpa.c:343: warning: passing argument 3 of 'gpgme_set_locale' makes pointer from
integer without a cast
make[3]: * [gpa.o] Error 1
make[2]:
* [all] Error 2
make[1]: * [all-recursive] Error 1
make[3]: Leaving directory `/usr/src/gpa-0.8.0/src'
make[2]: Leaving directory `/usr/src/gpa-0.8.0/src'
make[1]: Leaving directory `/usr/src/gpa-0.8.0'
make:
* [all] Error 2

but if I merely run ./configure then manually modify CFLAGS in Makefile,
everything's fine.

Details

Version
0.8.0

Event Timeline

chp set Version to 0.8.0.
chp added a subscriber: chp.

The file INSTALL tells how to do this correctly:

./configure CFLAGS='-march=i686'

this is required so that configure knows which envvars are changed and can pass
them to make.

However, if CFLAGS is set in the environment previously, configure will fail.
This is especially inconveniently for those who set CFLAGS in bashrc etc and
those who uses source-based package manager doing this.
Setting CFLAGS as an environment variable should be universally correct,
shouldn't it?

No. CFLAGS is used to override default flags. It might be that in a BSD system
CFLAGS can be used in the way you describe it; with the GNU system this is not
the case.

See the INSTALL file for another way to share defaults (section "Sharing Defaults").

well. I tried.

./configure CFLAGS='-march=i686'

doesn't solve the problem either.

It appears to me that only setting CFLAGS='-g -O2' and other warning switches
doesn't cause the problem. Another issue is that even if I suppress my own
CFLAGS during configure and resurrect it before make, it has no influence on
make. CFLAGS is still '-g -O2 -Wall' as set by configure.
The only way to use custom CFLAGS seems to be manually modify Makefile after
configure. This of course discourage any kinds of automation.

Well, I have no more excuses at hand to actually look at the problem ;-).

Can you please send me the config.log file by private mail to wk@gnupg.org - no
HTML, no zip but gzip is okay. Run configure as described in your last report.
config.status and src/Makefile.in would also be helpful.

werner claimed this task.
werner added projects: Info Needed, Too Old.