Bug 365 - Unable to build lib/md5.c -- GCC found wrong md5.h
Unable to build lib/md5.c -- GCC found wrong md5.h
Product: Samba 3.0
Classification: Unclassified
Component: Build environment
All Linux
: P3 normal
: none
Assigned To: Tim Potter
Depends on:
  Show dependency treegraph
Reported: 2003-08-28 09:12 UTC by Mark H. Wood
Modified: 2005-11-14 09:31 UTC (History)
0 users

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Mark H. Wood 2003-08-28 09:12:02 UTC
I have an md5.h in /usr/local/include, which seems to have come with Cyrus SASL
2.1.10, and it looks as though lib/md5.c is picking that up rather than the
include/md5.c that came in the Samba kit.  I temporarily renamed the one in
/usr/local/include and now compilation is proceeding past that file.

I'm building Samba using GCC 3.2.  I did not give configure any options.

mhw:~/build/samba-3.0.0rc1/source$ make
Using FLAGS =  -g -O2 -I/usr/local/include  -Iinclude
-I/home/mwood/build/samba-3.0.0rc1/source/smbwrapper  -I. -D_LARGEFILE64_SOURCE
-D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE -I/usr/local/include
      LIBS = -lcrypt -lresolv -lnsl -ldl
      LDSHFLAGS = -shared 
      LDFLAGS = 
Compiling lib/md5.c
cc1: warning: changing search order for system directory "/usr/local/include"
cc1: warning:   as it has already been specified as a non-system directory
In file included from lib/md5.c:23:
/usr/local/include/md5.h:27: parse error before "UINT4"
/usr/local/include/md5.h:27: warning: no semicolon at end of struct or union
/usr/local/include/md5.h:28: warning: data definition has no type or storage class
/usr/local/include/md5.h:30: parse error before '}' token
/usr/local/include/md5.h:30: warning: useless keyword or type name in empty
/usr/local/include/md5.h:30: warning: empty declaration
/usr/local/include/md5.h:38: parse error before "PROTO_LIST"
/usr/local/include/md5.h:39: parse error before "PROTO_LIST"
/usr/local/include/md5.h:41: parse error before "PROTO_LIST"
/usr/local/include/md5.h:43: parse error before "PROTO_LIST"
make: *** [lib/md5.o] Error 1
Comment 1 Tim Potter 2003-08-28 16:40:58 UTC
I am curious where the '-g -O2 -I/usr/local/include' comes from in your build
output.  According to the Makefile the first -I line should be -Iinclude.

Do you have the CFLAGS environment variable set?  Try configuring with:

$ CFLAGS="" ./configure

and see if that fixes the problem.
Comment 2 Mark H. Wood 2003-08-29 09:33:46 UTC
I tried "CFLAGS="" ./configure" and got the same result, except that now make
doesn't display the commands it is executing.

For grins I updated my 3-year-old GNU make 3.79 to 3.80 and saw no changes.

> I am curious where the '-g -O2 -I/usr/local/include' comes from in your build
> output.  According to the Makefile the first -I line should be -Iinclude.

It's in the generated Makefile here:

mhw:~/build/samba-3.0.0rc1/source$ grep /usr/local/include Makefile
CFLAGS= -O -I/usr/local/include

BTW "make CFLAGS=-O" allows the build to proceed.  Much better than moving
header files around.

Before you ask:  I *do* have an /etc/config.site and *no* it does not have any
traces of this path in it.  See:

mhw:~/build/samba-3.0.0rc1/source$ cat /etc/config.site
# Site defaults for GNU autoconf

#test "$prefix" = NONE && prefix=/usr
#test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var
test "$localstatedir" = '${prefix}/var' && localstatedir=/var
test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
Comment 3 Tim Potter 2003-08-29 22:44:55 UTC
OK next theory.  Is there some package like CUPS or OpenLDAP that is installed
locally (i.e in /usr/local instead of /usr)?

There are a couple of places in configure.in where something is appended to
CFLAGS.  i.e cups-config --cflags, locally installed iconv(3), kerberos.

Come to think of it, there has been a bunch of changes to iconv detection
recently so this might be the cause of your problem.
Comment 4 Mark H. Wood 2003-08-30 06:04:09 UTC
Yes, there are scads of packages in /usr/local.  Nearly every source kit wants
to install itself there, and I got tired of adding --prefix=/usr over and over
and over....  (I don't run any distro; I'm on the ten or twelve bits remaining
from Slackware 1.2 plus all the packages I've individually upgraded over the
years.)  In particular, OpenLDAP and Kerberos are installed there.  (iconv is in
/usr .)
Comment 5 Gerald (Jerry) Carter 2004-03-04 08:11:28 UTC
I think this should be fixed in the latest 
3.0 release (probably fixed in 3.0.1)
Comment 6 Gerald (Jerry) Carter 2005-02-07 09:06:17 UTC
originally reported against one of the 3.0.0rc[1-4] releases.
Cleaning up non-production versions.
Comment 7 Gerald (Jerry) Carter 2005-08-24 10:19:55 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.
Comment 8 Gerald (Jerry) Carter 2005-11-14 09:31:21 UTC
database cleanup