|
From: <tim...@en...> - 2006-05-02 00:14:34
|
>> Configuration fails if wxWidgets is disabled: >> >> lascaux [27] ./configure --disable-wxwidgets >> checking for a BSD-compatible install... /usr/bin/install -c >> checking whether build environment is sane... yes >> checking for gawk... gawk >> checking whether make sets $(MAKE)... yes >> [...snip...] >> checking for pdflib.h... yes >> checking for PDF_begin_pattern in -lpdf... yes >> checking for PDF_setdashpattern in -lpdf... yes >> checking for PDF_begin_document in -lpdf... yes >> checking for multi-byte support in x11... checking for XmbDrawString i= n >> -lX11... yes >> configure: error: conditional "am__fastdepCXX" was never defined. >> Usually this means the macro was only invoked conditionally. >> lascaux [28] > > The error is pretty explicit. The problem is that I put the following > checks in 'if' block : > > AC_PROG_CXX > AC_PROG_CXXCPP > > I did that because C++ is not needed if the wxWidgets terminal is not > compiled. But I have not found any information about such a case on the > web. > Obviously this doesn't work, so I will have to put them > unconditionnally... at the risk of breaking a platform where there's no > C++ compiler. Is it acceptable ? I have been in big trouble ! The autotools are definitely not designed to make a language optional. As reported above, the checks must be done unconditionally or Autoconf won't work. If I put the two checks unconditionally, and execute the resulting 'configure' on a system without any C++ compiler, the script itself will succeed, and I can even disable the wxWidgets terminal, but it will fail at compile time, because the autotools still think that the project contains some C++ files, and tries to link with g++ by default, even when it can't find it ! So this would oblige to have a C++ compiler to build gnuplot, even withou= t the wxWidgets terminal. I respond to my question above : this is obviousl= y not acceptable. I have finally found a workaround : if the C++ compiler is really absent (that can be tested easily), set CXX to $CC, so that automake will finall= y use $CC to do the link. I have tested it, and it seems to work as expected. (but I am not really happy with that, and it made me wonder once again if I should throw wxWidgets in favor of gtk+, which is written in C...) Timoth=E9e |