Bug 150592

Summary: AX_BOOST_FILESYSTEM macro from devel/autoconf-archive gives an error at configure
Product: Ports & Packages Reporter: Enrique <cquike>
Component: Individual Port(s)Assignee: Pav Lucistnik <pav>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   

Description Enrique 2010-09-15 16:00:02 UTC
 I am using the AX_BOOST_FILESYSTEM and AX_BOOST_UNIT_TEST_FRAMEWORK macros found in the autoconf-archive package. I have also installed boost itself from a package:

 pkg_add -r boost-all autoconf-archive

 I am using a very simple configure.ac that tests for Boost like:

..
AX_BOOST_BASE
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_THREAD
AX_BOOST_UNIT_TEST_FRAMEWORK
..

 When I run configure I get:

....
checking whether the Boost::System library is available... yes
checking whether the Boost::Filesystem library is available... yes
configure: error: Could not link against  !

However, I have successfully compiled and linked a program which uses the filesystem library. I have tried with the options provided by the configure:
./configure  --with-boost-filesystem=boost_filesystem --with-boost-unit-test-framework=boost-unit-test-framework

and then I get:

..
checking whether the Boost::System library is available... yes
checking whether the Boost::Filesystem library is available... yes
checking for exit in -lboost_filesystem... yes
checking whether the Boost::Thread library is available... yes
checking for exit in -lboost_thread... yes
checking whether the Boost::Unit_Test_Framework library is available... yes
configure: error: Could not link against boost-unit-test-framework !

So now it seems like Boost::Filesystem is properly found, but Boost::Unit_Test_Framework cannot be linked.
This behaviour is rather odd. I would just expect ./configure to work out of the box, and generate properly the  $(BOOST_CPPFLAGS), $(BOOST_FILESYSTEM_LIB) and $(BOOST_UNIT_TEST_FRAMEWORK_LIB) variables.

 I have tried exactly the same in several Linux distributions and it works fine.
 I have created a very small test case to show the problem, please see "How to repeat the problem"


 The versions of the packages I use:
autoconf-2.62
autoconf-wrapper-20071109
autoconf-archive-0.2009.04.19
automake-1.10.1
automake-wrapper-20071109
boost-all-1.43.0

How-To-Repeat: 
 1. Create a file configure.ac:
AC_INIT([Package],[0.1],[user@com],[pack])
AC_CONFIG_SRCDIR([Makefile.am])
AM_INIT_AUTOMAKE
AC_PROG_CXX
# Checks for boost libraries (the macros are found in the autoconf archive)
AX_BOOST_BASE
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_THREAD
AX_BOOST_UNIT_TEST_FRAMEWORK
AC_CONFIG_FILES([Makefile])
AC_OUTPUT

 2. Create a simple Makefile.am file:
AUTOMAKE_OPTIONS = 1.8 foreign

 3. Run autoreconf:
# autoreconf -i -f

 4. Run configure:
# ./configure

 5. Check the error reported:
checking whether the Boost::System library is available... yes
checking whether the Boost::Filesystem library is available... yes
configure: error: Could not link against  !
Comment 1 Jilles Tjoelker freebsd_committer freebsd_triage 2010-10-16 13:05:35 UTC
> [problem with AX_BOOST_FILESYSTEM autoconf macro]

To help debug, look at the config.log file generated by configure.
Possibly compare it to the config.log of a working configure.

-- 
Jilles Tjoelker
Comment 2 Pav Lucistnik freebsd_committer freebsd_triage 2010-10-29 14:52:11 UTC
State Changed
From-To: open->feedback

Do you have a fix? Perhaps newer version of autoconf-archive would work better? 


Comment 3 Pav Lucistnik freebsd_committer freebsd_triage 2010-10-29 14:52:11 UTC
Responsible Changed
From-To: freebsd-ports-bugs->pav

Track
Comment 4 Pav Lucistnik freebsd_committer freebsd_triage 2010-11-30 13:39:19 UTC
State Changed
From-To: feedback->closed

Feedback timeout