win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key cheap Win 7 key win 7 professional Windows 7 key windows-7-ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key store Windows 7 Professional Product Key Windows-7-Ultimate-Product-Key windows-7-home-premium buy Windows 7 key Office-2013-key office-professional-plus-2013 Office-2010-key Office-2016-key windows 8 key windows-8-key-sale windows 8.1 key windows 8.1 product key windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key win 7 key Win 7 key product key Win 7 ultimate key Win 7 key sale Windows 7 professional windows 7 Pro key Windows 7 key windows 7 ultimate Windows 7 ultimate key Windows 7 product key Windows 7 key sale Windows 7 iso windows 7 home premium windows 7 home Office 2013 key Office 2013 Professional Office 2010 key office 2010 product key Office 2016 key office 2016 product key office 2016 pro key windows 8 key windows 8 key sale Windows 8 pro windows 8.1 key windows 8.1 product key windows 8.1 professional windows 10 key windows 10 product key Windows 10 product key Windows 10 Pro Product Key windows 7 home Windows 7 professional windows 7 pro windows 7 key Windows 7 professional windows 10 product key windows 10 key windows 8 key Windows 8.1 professional windows 8.1 pro office 2013 key office-2010 serial key office 2010 key windows 10 key windows 7 home premium windows 7 ultimate windows 8.1 key windows 8 professional windows 7 ultimate windows 7 key windows 7 home windows 7 activation key win 10 professional office 2010 key Windows 7 Product Key Windows 7 Key Windows 7 iso Windows 7 ultimate

Adding Boost to your Autotools Project

Do you want to take your existing autotools project and to add support for the Boost libraries?  I want to specifically use Boost Threading, so I have included everything that I did to make my project as well as the full source code included at the bottom of this article.

If you want to read a nice guide on how to use threading in Boost visit this link:

 http://antonym.org/2009/05/threading-with-boost—part-i-creating-threads.html

Step 1 – Download Boost M4 Macros

Modify your configure.ac file to use some Boost macros.  In order for autotools to find these macros you will have to download them from the GNU autoconf archive.  For Boost Threading support you will need to download:

Place those files into the m4 sub-directory of your project.

Step 2 – Reference M4 Macros Directory

Your configure.ac should now reference the m4 macros directory by adding the AC_CONFIG_MACRO_DIR macro call like so:

AC_CONFIG_MACRO_DIR([m4])

Your Makefile.am file should also have a call to another macro to enable these changes as well:

ACLOCAL_AMFLAGS = -I m4

Step 3 – Call the Boost Macros from your configure.ac file

Now we have to make another change to your configure.ac file, we need to call the actual Boost Macros provided by the m4 files which you added to your project before. Make sure you add these calls after the call to the AC_CONFIG_MACRO_DIR (obviously):

AX_BOOST_BASE([1.53],,[AC_MSG_ERROR([projectX needs Boost, but it was not found in your system])])

AX_BOOST_SYSTEM
AX_BOOST_THREAD

Step 4 – Modify your Makefile.am file to add the bootstrap directory

Add a reference to a variable named EXTRA_DIST so that your project will find the necessary Boost files when building.

EXTRA_DIST = bootstrap

Step 5 – Modify your src/Makefile.am to add some link parameters to allow your linker to properly find the Boost libraries.

Modify your src/Makefile.am file to include some parameters to cause it to link to the proper boost libraries as well:

AM_CPPFLAGS = $(BOOST_CPPFLAGS)
AM_LDFLAGS = $(BOOST_LDFLAGS)

<app_name>_LDADD = \
   $(BOOST_THREAD_LIB)

Step 6 – Recreate your config files by running the same steps as you normally do and rebuild your code, now with Boost Threading support!

autoreconf -fvi
./configure
make

You can download the associated source code here:

myBoostProject

Note to cygwin users:

If you want to download the boost libraries, you will have to use a mirror that has the boost-devel package.  You can use the truefunny.com mirror here: http://truefunny.com/cygwin while running the cygwin installer.  If you are using apt-cyg, run the following command:

apt-cyg -m http://truefunny.com/cygwin install boost-devel

Do you want to take your existing autotools project and to add support for the Boost libraries?  I want to specifically use Boost Threading, so I have included everything that I did to make my project as well as the full source code included at the bottom of this article.

If you want to read a nice guide on how to use threading in Boost visit this link:

 http://antonym.org/2009/05/threading-with-boost—part-i-creating-threads.html

Step 1 – Download Boost M4 Macros

Modify your configure.ac file to use some Boost macros.  In order for autotools to find these macros you will have to download them from the GNU autoconf archive.  For Boost Threading support you will need to download:

Place those files into the m4 sub-directory of your project.

Step 2 – Reference M4 Macros Directory

Your configure.ac should now reference the m4 macros directory by adding the AC_CONFIG_MACRO_DIR macro call like so:

AC_CONFIG_MACRO_DIR([m4])

Your Makefile.am file should also have a call to another macro to enable these changes as well:

ACLOCAL_AMFLAGS = -I m4

Step 3 – Call the Boost Macros from your configure.ac file

Now we have to make another change to your configure.ac file, we need to call the actual Boost Macros provided by the m4 files which you added to your project before. Make sure you add these calls after the call to the AC_CONFIG_MACRO_DIR (obviously):

AX_BOOST_BASE([1.53],,[AC_MSG_ERROR([projectX needs Boost, but it was not found in your system])])

AX_BOOST_SYSTEM
AX_BOOST_THREAD

Step 4 – Modify your Makefile.am file to add the bootstrap directory

Add a reference to a variable named EXTRA_DIST so that your project will find the necessary Boost files when building.

EXTRA_DIST = bootstrap

Step 5 – Modify your src/Makefile.am to add some link parameters to allow your linker to properly find the Boost libraries.

Modify your src/Makefile.am file to include some parameters to cause it to link to the proper boost libraries as well:

AM_CPPFLAGS = $(BOOST_CPPFLAGS)
AM_LDFLAGS = $(BOOST_LDFLAGS)

<app_name>_LDADD = \
   $(BOOST_THREAD_LIB)

Step 6 – Recreate your config files by running the same steps as you normally do and rebuild your code, now with Boost Threading support!

autoreconf -fvi
./configure
make

You can download the associated source code here:

myBoostProject

Note to cygwin users:

If you want to download the boost libraries, you will have to use a mirror that has the boost-devel package.  You can use the truefunny.com mirror here: http://truefunny.com/cygwin while running the cygwin installer.  If you are using apt-cyg, run the following command:

apt-cyg -m http://truefunny.com/cygwin install boost-devel

Leave a Comment