[rtg] Compiling RTG

Matt Provost mprovost at termcap.net
Thu Apr 16 16:28:52 EDT 2009


On Thu, Apr 16, 2009 at 12:04:26PM -0400, John Center wrote:
> Hi Adrian,
> 
> Thanks! That generally works, but configure is putting in spurious -I's 
> that is making it fail:
> 
> configure:11123: checking png.h presence
> configure:11138: cc -xc99 -E -I/opt/db/include -I/opt/openssl/include 
> -I/opt/postgres/include -I/opt/mysql/include -I/opt/gnu/include 
> -I/opt/local/include -I/usr/sfw/include -I/usr/include -I conftest.c
> usage: cc [ options] files.  Use 'cc -flags' for details
> configure:11145: $? = 1
> 
> This happens if I don't define --with-png or define it as "yes".  Once 
> the -I's are removed, then make fails with spurious -L's:
> 
> LDFLAGS = -L/usr/local/ssl/lib -L -L/opt/mysql/lib -L/opt/local/lib 
> -L/usr/lib -L/usr/local/lib -L/opt/openssl/lib/sparcv9 
> -R/opt/openssl/lib/sparcv9 -L/opt/postgres/lib/sparcv9 
> -R/opt/postgres/lib/sparcv9 -L/opt/db/lib/sparcv9 -R/opt/db/lib/sparcv9 
> -L/opt/mysql/lib/sparcv9 -R/opt/mysql/lib/sparcv9 
> -L/opt/gnu/lib/sparcv9 -R/opt/gnu/lib/sparcv9 -L/opt/local/lib/sparcv9 
> -R/opt/local/lib/sparcv9 -L/usr/sfw/lib/sparcv9 -R/usr/sfw/lib/sparcv9 
> -L/usr/lib/sparcv9 -R/usr/lib/sparcv9
>  -Wl,-ztext -Wl,-Bdirect -Wl,-zlazyload -Wl,-zcombreloc -Wl,-zignore
> 
> 
> I'm trying to do a 64-bit build on Solaris 10 with Sun Studio 12, so 
> these types of things come out of the woodwork. :-)  What would really 
> be helpful would be --with-xxx-include & --with-xxx-lib, so I can point 
> everything to the correct 64-bit libraries.  Also, since it checks for 
> openssl, a --with-ssl-include & --with-ssl-lib would help, too.  Lastly, 
> configure adds -L flags to things it's found to the front of LDFLAGS, 
> even though I define the right locations later.  This means it finds the 
> 32-bit version, not the 64-bit version.
> 

The autoconf stuff is a bit of a mess in RTG. That was probably my
fault. It's really simple and it just chucks everything it finds onto
CPPFLAGS and LDFLAGS. I noticed that the memory usage of rtgpoll was
really high because it was linking to every library it could find.
Unfortunately the autotools aren't very friendly to this sort of thing
but I got it to work. Now it builds separate CPPFLAGS and LDFLAGS for
every binary. So the mysql driver doesn't link to the postgres library
and vice versa, and the poller doesn't link to either. I don't even know
what is looking for openssl anymore.

In any case all the new checks are in configure.in in rated which you
can see here:

http://github.com/mprovost/rated/blob/d41ac2079cd64ef749de7b4b0b4c18a360b70b95/configure.in

You'll also need to redo the automake stuff so it builds each binary
with the correct paths:

http://github.com/mprovost/rated/blob/d41ac2079cd64ef749de7b4b0b4c18a360b70b95/src/Makefile.am

It probably wouldn't be that hard to pull those changes back into RTG.
I'd also be interested to see if rated builds correctly for you.

Matt


More information about the RTG mailing list