Hi
I'm trying to build ejabberd on an OpenBSD 4.1 box. I've installed erlang/OTP and libexpat on the system (both from source). When I try to build ejabberd it fails right away with the error:
expat_erl.c:7:19: expat.h: No such file or directory. expat.h is installed in /usr/local/include
and I exported CPPFLAGS="-I/usr/local/include" (as well as LDFLAGS="-L/usr/local/lib") before I ran the configure script.
What am I doing wrong and how do I fix it?
TIA
P.
It's a bug in the configure
It's a bug in the configure script. You need to set CFLAGS to the same value as CPPFLAGS.
It does not seem a bug in
It does not seem a bug in configure. To me it does the right thing. if you pass CFLAGS (expat is a C program), it works correctly.
I do not know if it is the job of configure to look into /usr/local for expat.
what do you think ?
--
Process-one
Mickaël Rémond
The bug is that the
The bug is that the configure script doesn't properly distinguish between CPPFLAGS and CFLAGS. CPPFLAGS names the flags that are necessary for both preprocessing and compiling, while CFLAGS names the flags that are only needed for compiling, i.e:
cpp $CPPFLAGS foo.c
cc $CFLAGS $CPPFLAGS foo.c
However, the configure tests for expat don't include CPPFLAGS when using the compiler.
Ireported this to the expat people four years ago, and was a bit surprised by their response (they basically misunderstood what the bug report was about), but didn't bother responding as most people never will understand autoconf anyway, and my workaround is good enough for me.
So yes, the bug is really in expat, but ejabberd does include the erroneous code in
src/aclocal.m4
.Hm… memory is hazy.
Hm… memory is hazy. Apparently I just commented on that bug, which seemed to be about the same problem…
I am not sure to understand
I am not sure to understand right now. However, I can consider a fix proposal.https://support.process-one.net/browse/EJAB-204
Do you have a suggestion ?
How is it related to this fix:
It the patch incomplete ?
--
Process-one
Mickaël Rémond
The patch is complete, at
The patch is complete, at least concerning the expat part. Seems I never bothered to look at the SVN version ☺
And this patch should really be applied to
conftools/expat.m4
in expat CVS. I'll try to write them a more coherent bug report some day.But the patch does confuse me a bit.automake manual ), but it seems that the
aclocal.m4
is supposed to be automatically generated byaclocal
, using bits and pieces from all the libraries that the program in question uses (this is described in theaclocal.m4
of ejabberd is very much handcrafted, having grown lots of local hacks over the years.Now I'm really confused ☺