Subject: [Nel] libxml / configure problem

From: Ian Cahoon <[email-masked]>
Date: Thu, 10 Jan 2002 01:38:39 -0800

Hi,

I am new to NeL and was having some problems getting it to build.
I am on a stock Redhat 7.2, i686 box. I am trying to build off
of CVS HEAD.

When running configure I am running into the following problem...

[code.HEAD] nel: ./configure --with-stlport=/home/icahoon/ws/STLport-4.5.1
loading cache ./config.cache
checking for a BSD compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking whether make sets ${MAKE}... yes
checking for working aclocal... found
checking for working autoconf... found
checking for working automake... found
checking for working autoheader... found
checking for working makeinfo... found

...snip...

checking for python... /usr/bin/python
checking for Python headers... /usr/include/python1.5
checking for Python libraries... /usr/lib/python1.5/config
checking for xml2-config... /usr/bin/xml2-config
checking for libxml - version >= 2.0.0... no
*** Could not run libxml test program, checking why...
*** The test program failed to compile or link. See the file config.log for the
*** exact error that occured. This usually means LIBXML was incorrectly installed
*** or that you have moved LIBXML since it was installed. In the latter case, you
*** may want to edit the xml2-config script: /usr/bin/xml2-config
configure: error: libxml2 must be installed.

So I did a bit of digging. It seems in configure.in, line 138 there is

> dnl Use C++ compiler as a default for the compilation tests.
> AC_LANG_CPLUSPLUS

But looking at the macro AM_PATH_XML2 in /usr/share/aclocal/libxml.m4
it seems pretty clear it won't work with a C++ compiler since
it is only modifying the CFLAGS, not the CPPFLAGS or the CXXFLAGS.

I am in no way an autoconf expert, so I dont know what the "correct" solution
is, but in configure.in, I added the following macros, and it seems to work:

Index: configure.in
===================================================================
RCS file: /home/cvsroot/code/nel/configure.in,v
retrieving revision 1.56
diff -c -r1.56 configure.in
*** configure.in        7 Jan 2002 16:09:52 -0000       1.56
--- configure.in        10 Jan 2002 09:42:24 -0000
***************
*** 215,225 ****
--- 215,232 ----
  AM_PATH_PYTHON( $enable_ai )

+ 
+ dnl Use C++ compiler as a default for the compilation tests.
+ AC_LANG_C
+ 
  dnl ==========
  dnl LibXML
  dnl ==========
  
  AM_PATH_XML2( 2.0.0, , AC_MSG_ERROR(libxml2 must be installed.) )
+ 
+ dnl Use C++ compiler as a default for the compilation tests.
+ AC_LANG_CPLUSPLUS

  dnl ====================================================================

Thought you might like to know,

--Ian

---

From: Cedric Valignat <[email-masked]>
Date: Thu, 10 Jan 2002 11:52:42 +0100

Hi Ian,

I applied your patch and it will be on the public CVS tonigth.

Until then, you can run the 'configure' script with the '--disable-xmltest'
option to avoid that crash.

Thanks for your help :-)

Cedric.

According to Ian Cahoon:
> [...]
> [...]