To save others the time I spent getting statically-linked cfengine 3 binaries 
on Solaris & Linux, I'm putting my instructions here. I did this against 
cfengine 3.0.4. On Solaris, I used sunfreeware.com packages for dependencies. 
Doing this, I was able to compile binaries once on RHEL 3 i386, and the 
resulting binaries work on all RHEL versions greater than it for 32 or 64-bit.

Solaris 10 x86 or SPARC:
gzcat /src/cfengine/cfengine-3.0.4.tar.gz | tar xvf -
cd cfengine-3.0.4
export PATH=/usr/sfw/bin:/usr/local/bin:/usr/bin:/usr/sbin:/usr/ccs/bin
export LD_LIBRARY_FLAGS=/usr/sfw/lib:/usr/local/lib:/usr/lib
export CC=/usr/sfw/bin/gcc
./configure --prefix=/local/cfengine-3.0.4/SunOS-5.10-`uname -p` 
--with-openssl=/usr/local/ssl --without-sql
cd src
# Do this so we don't have to rely on shared libraries
perl -p -i.sav -e "s:-ldb:/usr/local/BerkeleyDB.4.2/lib/libdb.a:" Makefile
perl -p -i.sav -e "s:-lcrypto:/usr/local/ssl/lib/libcrypto.a:" Makefile
perl -p -i.sav -e "s:-lldap:/usr/local/lib/libldap.a:" Makefile
perl -p -i.sav -e "s:-lpcre:/usr/local/lib/libpcre.a:" Makefile
# On Solaris its '-pthreads'!
perl -p -i.sav -e "s:-pthread:-pthreads:" Makefile
cd ..
make
make install


Red Hat Enterprise Linux 3 32-bit:
tar xzvf /src/cfengine/cfengine-3.0.4.tar.gz
cd cfengine-3.0.4
./configure --prefix=/local/cfengine-3.0.4/Linux-2.4-i386 --without-sql
# Had to do this as root: cd /lib; ln -s /usr/lib/libattr.la
cd src
perl -p -i.sav -e "s:-ldb-4.1:/usr/lib/libdb-4.1.a:" Makefile
perl -p -i.sav -e "s:-lgd:/usr/lib/libgd.a:" Makefile
perl -p -i.sav -e "s:-lpcre:/usr/lib/libpcre.a:" Makefile
perl -p -i.sav -e "s:-lldap:/usr/lib/libldap.a:" Makefile
perl -p -i.sav -e "s:-lcrypto:/usr/lib/libcrypto.a:" Makefile
cd ..
make
make install


RCA
--
UNIX Administrator, BAE Systems EIT
desk 763-572-6684  mobile 612-419-9362

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to