Steffen Goeldner wrote:
Sjoerd Mullender wrote:
Steffen Goeldner wrote:
Fabian wrote:
Update of /cvsroot/monetdb/MonetDB5/src/modules/atoms In directory sc8-pr-cvs16:/tmp/cvs-serv28157
Modified Files: Makefile.ag Log Message: color.mx uses floor, which (at least on my machine -- for as long as it's running) needs -lm during linking.
Have no libm on W2K. Other modules abuse LDFLAGS = -lm and this seems to be ignored be the Makefile.msc generator - so LDFLAGS works somehow as a workaround. Whats your policy in this regard?
We should probably do something similar to what we do for the socket libraries. That is, introduce a new make variable MATH_LIBS that is set by configure to contain -lm when needed, and on Windows it should be set to empty in rules.msc.
Sounds good! Here my proposed changes:
1. I'll add to buildtools/conf/MonetDB.m4
MATH_LIBS="" AC_CHECK_LIB(m, main, [ MATH_LIBS="-lm" ] ) AC_SUBST(MATH_LIBS)
2. I'll look after -lm in
MonetDB4/src/modules/calibrator/Makefile.ag: LDFLAGS = -lm MonetDB4/src/modules/calibrator/Makefile.ag: LIBS = -lm MonetDB4/src/modules/contrib/Makefile.ag: LDFLAGS = -lm MonetDB4/src/modules/contrib/Makefile.ag: LDFLAGS = -lm MonetDB4/src/modules/mnetcdf/Makefile.ag: LDFLAGS = -lm $(NETCDF_LIBS) MonetDB4/src/modules/plain/Makefile.ag: LDFLAGS = -lm MonetDB5/src/modules/atoms/Makefile.ag: LIBS = $(MONETDB_LIBS) -lbat -lstream -lm \ MonetDB5/src/modules/kernel/Makefile.ag: LDFLAGS = -lm MonetDB5/src/modules/mal/Makefile.ag: LIBS = ../../mal/libmal $(MONETDB_LIBS) -lbat -lstream -lm \ MonetDB5/src/optimizer/Makefile.ag: LDFLAGS = -lm
and substitute it with LIBS = ... $(MATH_LIBS)
3. I'll add to MonetDB/conf/rules.msc:
MATH_LIBS =
OK?
Sounds good. Of course, libraries should not be added to LDFLAGS since that comes too early in the commandline (before the object files). I've been bitten by this in the past. So make sure that you use LIBS or something like that. Only the function that you use to check the library is a bit weird, so maybe use AC_CHECK_LIB(m, sqrt, [ MATH_LIBS=-lm ]) -- Sjoerd Mullender