Re: [Sablevm-developer] building out-of-the-box on non-Linux platform
Brought to you by:
egagnon
From: David <db...@cs...> - 2004-01-22 16:15:25
|
On Mon, Jan 19, 2004 at 08:31:31AM +0100, Patrick Cernko wrote: > Also sprach Grzegorz B. Prokopski zu "17.01.2004 11:08" Anno Domini: > > W li?cie z sob, 17-01-2004, godz. 04:17, David B=E9langer pisze:=20 > >=20 > >>Hi, > >> > >>I think it would be great if SableVM could be built out-of-the-box on > >>all platforms including the non-Linuxian FreeBSD and OS X. It will > >>simplify my life as I want to build and test on these platforms. > >>Currently source code is not an issue, it is more a configure/Makefil= e > >>isssue. > >> > >>src/libsablevm/Makefile.am has some line like: > >>libsablevm_la_LIBADD =3D -lpthread -lm -lffi -lltdl -lrt > >> > >>FreeBSD does not like -lpthread. > >>OS X does not like -lrt. > >> ... > >=20 > > Ideally, I think we'd have in configure.ac sth. like: ... > >=20 > > +AC_MSG_CHECKING([if we need -lrt]) > > + > > +case "$host" in > > + *solaris*) > > + lrt=3D-lrt > > + AC_MSG_RESULT([yes]) > > + ;; > > + *) > > + AC_MSG_RESULT([no]) > > + ;; > > +esac > >=20 > > +AC_MSG_CHECKING([if we need -lpthread]) > > + > > +case "$host" in > > + *freebsd*) > > + AC_MSG_RESULT([no]) > > + ;; > > + *) > > + lpthread=3D-lpthread > > + AC_MSG_RESULT([yes]) > > + ;; > > +esac > >=20 >=20 > That's exactly what you should do in configure! For that reason, there > are more macros provided by autoconf that only "AC_MSG_*". Your last > case for example could be simpliefied to a simple one-liner using > AC_CHECK_LIB! Have a look at the autoconf info pages for a complete > overview. A call of autoscan in your sources could also be helpful (hav= e > a look at the generated configure.scan template). On Debian, there > exists a package named autobook with a quiet complete html documentatio= n > about auto*. Last but not least, three pointers: >=20 Hi, So if I understand well, we will use the AC_CHECK_LIB in two ways: 1) For system libraries such as: m, pthread, rt, ... To check their if we need to link them explicitly. 2) For non-system lib such as: ltdl, popt, ffi To check if the user have installed them like we are currently doing. Sounds good? David --- David B=E9langer Graduate Student School of Computer Science McGill University Office: MC226 Web page: http://www.cs.mcgill.ca/~dbelan2/ Public key: http://www.cs.mcgill.ca/~dbelan2/public_key.txt |