Build Configuration on FreeBSD

From BroWiki

Jump to: navigation, search

Contents

Introduction

This page describes the steps necessary to configure the tree for a build on FreeBSD, particularly FreeBSD 6.2. Generally, in order to obtain a working configure script, run ./autogen.sh in the toplevel directory of your tree.

Image:Caution.png Note: This only affects the configuration steps necessary to produce a configure script. If you have a tarball that you want to build, you don't care about what's described here, unless you want to modify the build setup and need to rebuild the configure script.

Issues

The main problem is that FreeBSD does not seem to provide a working default configuration of the autotools. It does, however, install multiple versions of autoconf/automake. By picking versions manually, you can get things to work. In addition, you might get this error when running autoheader/automake 2.59:

 autom4te259: cannot lock autom4te.cache/requests with mode 2 (perhaps you are running make -j on a lame NFS client?): Operation not supported
 aclocal: autom4te259 failed with exit status: 1

The proper fix for this is described here. Alternatively, you can edit autom4te259 as follows:

 --- /usr/local/bin/autom4te259  Sun Jan 14 14:40:12 2007
 +++ autom4te259 Tue Feb 20 12:50:56 2007
 @@ -965,7 +965,7 @@
  # files, but the index is the first and last file to be update, so
  # locking it is sufficient.
  $icache_file = new Autom4te::XFile $icache, O_RDWR|O_CREAT;
 -$icache_file->lock (LOCK_EX);
 +#$icache_file->lock (LOCK_EX);
 
  # Read the cache index if available and older than autom4te itself.
  # If autom4te is younger, then some structures such as C4che, might

Since this disables the locking, it might obviously be a Bad Idea.

Steps to get ./autogen.sh to work with SVN trunk or a release newer than 1.2.1

1. In a directory under your control and in your PATH (something like ~/inst/bin; I'll call it DIR from now on), create symlinks as follows:

 ln -s /usr/local/bin/aclocal19 aclocal
 ln -s /usr/local/bin/autoconf259 autoconf
 ln -s /usr/local/bin/autoheader259 autoheader
 ln -s /usr/local/bin/automake19 automake

2. Export the following environment variable, to ensure that libtool's m4 macros are found:

 setenv ACLOCAL_FLAGS "-I /usr/local/share/aclocal/"

Note that aclocal itself is unaware of ACLOCAL_FLAGS, however, the value of ACLOCAL_FLAGS is appended to the aclocal invocation by the autogen.sh scripts.

3. If you want to use the autom4te locking hack pointed out above, then also do the following:

3.1 Copy autom4te259 into the same directory in which you're creating the symlinks:

 cp /usr/local/bin/autom4te259 $DIR/autom4te

3.2 Apply the patch shown above.

3.3 Export the following environment variable, to ensure the autotools use your version:

 setenv AUTOM4TE $DIR/autom4te

Running autogen.sh in the toplevel Bro distribution directory should work now.

Steps to get ./autogen.sh to work with release 1.2.1

As described above, but in addition, remove the following line from aux/broccoli/autogen.sh as it prevents the use of the ACLOCAL_FLAGS environment variable:

 --- bro/aux/broccoli/autogen.sh   2007-02-18 01:09:42 UTC (rev 3994)
 +++ bro/aux/broccoli/autogen.sh   2007-02-20 21:05:24 UTC (rev 3995)
 @@ -8,8 +8,8 @@
  BLD_OFF=`./shtool echo -n -e %b`
 
  LT=libtoolize
 -ACLOCAL_FLAGS=
  DIE=0
Personal tools