Sidney reported some problems on MacOS. His fix proposal may generate
trouble with the "dist" target. Could you try to analyse his problems:
3) On MacOS there is some difference between gcc and g++ that requires
you to link using g++ if any of the source files are in C++. This causes
the link step of the build of the tools directory to break now that LUA
is C++ because tolua.c and toluabind.c both have '.c' extensions and gcc
was being used. I have attached a patch to configure.ac and
tools/Makefile.am that when the C++ version of LUA is being used creates
an empty file tools/dummy.cc and adds that to the list tolua.c and
toluabind.c to compile and link. The result builds and runs fine on my
Intel MacBook running MacOS 10.4.8.
Hmm... Interesting. I know that on linux it is generally better to use
g++ to link
c++ .o files than to use gcc. For example it automatically links in the
standard c++
library.
I'd be interested in knowing what other differences there are on OS X.
I am concerned about that patch causing problems.
If I recall correctly, _SOURCES is a bit special compaired to the others,
and if possible should not be conditionalized.
Is there a problem with making the dummy.cc non-conditional?
After all, a c++ linker should hapily link a bunch of c .o files.
In fact it would brobably have no net effect, as the linker would
notice that no symbols from the c++ library are actually used, and
thus omit it. Ironically, that solution would have fixed the recent
problem,
without requiring the use of CPPFLAGS. It would also let us drop
the LDADD line.