Browse files

Mostly sync the macros between vw & stereo. This is good either if we…

… stick with autotools or if we switch to something else
  • Loading branch information...
1 parent 9ae12ae commit 22eabd4d74184bca069858597774badd20aa8229 @novas0x2a novas0x2a committed Nov 24, 2008
View
104 configure.ac
@@ -1,24 +1,24 @@
# __BEGIN_LICENSE__
-#
+#
# Copyright (C) 2006 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration
# (NASA). All Rights Reserved.
-#
+#
# Copyright 2006 Carnegie Mellon University. All rights reserved.
-#
+#
# This software is distributed under the NASA Open Source Agreement
# (NOSA), version 1.3. The NOSA has been approved by the Open Source
# Initiative. See the file COPYING at the top of the distribution
# directory tree for the complete NOSA document.
-#
+#
# THE SUBJECT SOFTWARE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY OF ANY
# KIND, EITHER EXPRESSED, IMPLIED, OR STATUTORY, INCLUDING, BUT NOT
# LIMITED TO, ANY WARRANTY THAT THE SUBJECT SOFTWARE WILL CONFORM TO
# SPECIFICATIONS, ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR
# A PARTICULAR PURPOSE, OR FREEDOM FROM INFRINGEMENT, ANY WARRANTY THAT
# THE SUBJECT SOFTWARE WILL BE ERROR FREE, OR ANY WARRANTY THAT
# DOCUMENTATION, IF PROVIDED, WILL CONFORM TO THE SUBJECT SOFTWARE.
-#
+#
# __END_LICENSE__
AC_INIT([NASA Ames Stereo Pipeline], [2.1], [asp@nx.arc.nasa.gov], [StereoPipeline])
@@ -41,7 +41,7 @@ AC_SUBST(LIBTOOL_VERSION)
# This should be first, so everything else can use it
AC_ARG_ENABLE(verbose,
- AC_HELP_STRING([--enable-verbose], [verbose configuration output @<:@no@:>@]),
+ AC_HELP_STRING([--enable-verbose], [verbose configuration output @<:@no@:>@]),
[ ENABLE_VERBOSE=$enableval ],
[ if test -z $"ENABLE_VERBOSE"; then ENABLE_VERBOSE=no; fi ]
)
@@ -55,19 +55,19 @@ if test -f config.options; then
fi
AC_ARG_WITH(paths,
- AC_HELP_STRING([--with-paths=PATHS], [additional search path(s) for packages]),
+ AC_HELP_STRING([--with-paths=PATHS], [additional search path(s) for packages]),
[ PKG_PATHS="$withval $PKG_PATHS" ]
)
PKG_PATHS="${PKG_PATHS} ${HOME} ${HOME}/local /sw /opt /opt/local /usr/local /usr/X11R6 /usr"
##################################################
-# compilation options
+# compilation options
##################################################
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug], [generate debugging symbols @<:@no@:>@]),
- [ ENABLE_DEBUG=$enableval ],
+ [ ENABLE_DEBUG=$enableval ],
[ if test -z "$ENABLE_DEBUG"; then ENABLE_DEBUG=no; fi ]
)
@@ -77,8 +77,33 @@ else
AX_CFLAGS="$AX_CFLAGS -DNDEBUG"
fi
+# For 64-bit machines, we'll generally want to autodetect if lib64 exists,
+# and use it. Sometimes the user will want to force use of lib64 or lib
+# instead of the autodetection. Thus we have this command line option.
+AC_ARG_ENABLE(lib64,
+ AC_HELP_STRING([--enable-lib64], [force configure to use the lib64 directory (yes) or the lib directory (no) to find libraries @<:@autodetect@:>@]),
+ [ USE_LIB64=$enableval ],
+ [ if test -z "$USE_LIB64"; then USE_LIB64="autodetect"; fi ]
+)
+if test x"$USE_LIB64" = "xautodetect"; then
+ if test -d "/lib64" -o -d "/usr/lib64"; then
+ USE_LIB64="yes"
+ else
+ USE_LIB64="no"
+ fi
+fi
+# Sometimes we have /foo/lib64 and /foo/lib confusion on 64-bit machines,
+# so we'll use possibly both if one doesn't appear for a certain
+# library path.
+if test x"$USE_LIB64" = "xyes"; then
+ AX_LIBDIR="lib64"
+ AX_OTHER_LIBDIR="lib"
+else
+ AX_LIBDIR="lib"
+ AX_OTHER_LIBDIR="lib64"
+fi
AC_ARG_ENABLE(optimize,
- AC_HELP_STRING([--enable-optimize@<:@=LEVEL@:>@], [compiler optimization level @<:@yes@:>@]),
+ AC_HELP_STRING([--enable-optimize@<:@=LEVEL@:>@], [compiler optimization level @<:@yes@:>@]),
[ ENABLE_OPTIMIZE=$enableval ],
[ if test -z "$ENABLE_OPTIMIZE"; then ENABLE_OPTIMIZE=yes; fi ]
)
@@ -103,7 +128,7 @@ CXXFLAGS="$CXXFLAGS -I\${top_srcdir}/src $AX_CFLAGS"
AC_ARG_ENABLE(exceptions,
- AC_HELP_STRING([--enable-exceptions@<:@=yes@:>@], [enable the C++ exception mechanism]),
+ AC_HELP_STRING([--enable-exceptions@<:@=yes@:>@], [enable the C++ exception mechanism]),
[ ENABLE_EXCEPTIONS=$enableval ],
[ if test -z "$ENABLE_EXCEPTIONS"; then ENABLE_EXCEPTIONS=yes; fi ]
)
@@ -120,7 +145,7 @@ AC_DEFINE_UNQUOTED(NO_EXCEPTIONS,
[$no_exceptions],
[Define to 1 to disable C++ exceptions.])
-# We set up the include paths ourselves, so
+# We set up the include paths ourselves, so
# we ask autoconf to get out of the way.
DEFAULT_INCLUDES=
AC_SUBST(DEFAULT_INCLUDES)
@@ -139,7 +164,7 @@ fi
##################################################
-# distribution options
+# distribution options
##################################################
AC_ARG_WITH(dist-license,
@@ -187,20 +212,20 @@ AM_CONDITIONAL(DIST_REMOVE_MODULES, [test ! -z "$DIST_REMOVE_MODULES"])
##################################################
-# library options
+# library options
##################################################
if test -z $NUM_THREADS ; then NUM_THREADS=4 ; fi
AH_TEMPLATE([NUM_THREADS],
- [Define to the default number of threads that the Vision
+ [Define to the default number of threads that the Vision
Workbench should spawn for multi-threaded operations.])
AC_ARG_WITH(num-threads,
AC_HELP_STRING([--with-num-threads[=4]], [set the default number of processing threads for multi-threaded operations]),
[NUM_THREADS=$withval])
AC_DEFINE_UNQUOTED([NUM_THREADS],[$NUM_THREADS])
##################################################
-# package checks
+# package checks
##################################################
# Make sure these are set so AC_PROG_CC doesn't initialize them with
@@ -228,27 +253,30 @@ fi
AX_PKG_PTHREADS
AX_PKG_BOOST
+AX_PKG_BOOST_CHECK_VERSION([ASP_])
+
+AC_MSG_NOTICE([Stereo will be built using Boost version $BOOST_VERSION])
AX_PKG_BOOST_LIB(PROGRAM_OPTIONS, [-lboost_program_options], [boost/program_options.hpp])
AX_PKG_BOOST_LIB(FILESYSTEM_PRE_1_35, [-lboost_filesystem], [boost/filesystem/path.hpp])
if test "$HAVE_PKG_BOOST_FILESYSTEM_PRE_1_35" = "no"; then
echo "Checking for BOOST_FILESYSTEM 1.35 or later..."
AX_PKG_BOOST_LIB(FILESYSTEM, [-lboost_filesystem -lboost_system], [boost/filesystem/path.hpp])
-else
+else
AX_PKG(BOOST_FILESYSTEM, [BOOST_FILESYSTEM_PRE_1_35], [], [])
fi
AX_PKG_BOOST_LIB(THREAD, [-lboost_thread], [boost/thread/thread.hpp])
-AX_PKG_LAPACK
-
-# This provides an easy way for users to override the threads options
+# This provides an easy way for users to override the threads options
# if they are replacing Boost threads with something else for their platform.
AX_PKG(THREADS, [BOOST_THREAD], [], [])
-AX_PKG(VW, [], [-lvw], [vw/Image/ImageView.h vw/Math/LinearAlgebra.h])
-AX_PKG(VW_STEREO, [], [-lvwStereo], [vw/Stereo/OptimizedCorrelator.h])
-AX_PKG(VW_CAMERA, [], [-lvwCamera], [vw/Camera/CAHVModel.h])
-AX_PKG(VW_CARTOGRAPHY, [], [-lvwCartography], [vw/Cartography/GeoReference.h])
-AX_PKG(VW_INTEREST_POINT, [], [-lvwInterestPoint])
+AX_PKG_LAPACK
+
+AX_PKG(VW, [BOOST], [-lvw], [vw/Image/ImageView.h vw/Math/LinearAlgebra.h])
+AX_PKG(VW_STEREO, [BOOST], [-lvwStereo], [vw/Stereo/OptimizedCorrelator.h])
+AX_PKG(VW_CAMERA, [BOOST], [-lvwCamera], [vw/Camera/CAHVModel.h])
+AX_PKG(VW_CARTOGRAPHY, [BOOST], [-lvwCartography], [vw/Cartography/GeoReference.h])
+AX_PKG(VW_INTEREST_POINT, [BOOST], [-lvwInterestPoint])
AX_PKG(OPENSCENEGRAPH, [], [-losg -losgDB -lOpenThreads -losgViewer -losgText -losgGA -losgFX -losgTerrain -losgUtil], [osg/ref_ptr])
AX_PKG(MBA10, [], [-lMBA_1.0_gpl_nopt], [MBA.h])
@@ -265,32 +293,34 @@ AX_PKG(SPICE, [], [-lcspice], [SpiceUsr.h SpiceZfc.h])
dnl ISIS includes QT headers without the proper qt module prefix, so
dnl we need to add this check here to force the build system to add an
dnl extra include path at the top level of the QTCore tree.
-AX_PKG(QT_INCLUDE, [], [], [QVector], [${QT_CPPFLAGS}])
+dnl We also seed QT_INCLUDE's cppflags with the ones qmake figured out
+ADD_QT_INCLUDE_CPPFLAGS="$ADD_QT_INCLUDE_CPPFLAGS $QT_CPPFLAGS"
+AX_PKG(QT_INCLUDE, [], [], [QVector])
if test x"$host_vendor" = "xapple"; then
AX_PKG(QWT, [QT_INCLUDE], [-lqwt.5])
AX_PKG(GEOS, [], [-lgeos-3.0.0], [])
AX_PKG(GSL, [LAPACK], [-lgsl -lgsl.0 -lgslcblas.0 ])
AX_PKG(SUPERLU, [], [-lsuperlu_3.0], [])
AX_PKG(XERCESC, [], [-lxerces-c.28], [])
- AX_PKG(QT, [QT_INCLUDE], [], [], [${QT_CPPFLAGS}])
+ AX_PKG(QT, [QT_INCLUDE], [], [])
else
AX_PKG(QWT, [QT_INCLUDE], [-lqwt])
AX_PKG(GEOS, [], [-lgeos])
AX_PKG(GSL, [LAPACK], [-lgsl -lgslcblas])
AX_PKG(SUPERLU, [], [-lsuperlu])
AX_PKG(XERCESC, [], [-lxerces-c])
- AX_PKG(QT_CORE, [QT_INCLUDE], [-lQtCore], [QVector], [${QT_CPPFLAGS}])
- AX_PKG(QT_GUI, [QT_INCLUDE], [-lQtGui], [QLabel], [${QT_CPPFLAGS}])
- AX_PKG(QT_SQL, [QT_INCLUDE], [-lQtSql], [QtSql], [${QT_CPPFLAGS}])
- AX_PKG(QT, [QT_INCLUDE QT_CORE QT_GUI QT_SQL], [], [], [${QT_CPPFLAGS}])
+ AX_PKG(QT_CORE, [QT_INCLUDE], [-lQtCore], [QVector])
+ AX_PKG(QT_GUI, [QT_INCLUDE], [-lQtGui], [QLabel])
+ AX_PKG(QT_SQL, [QT_INCLUDE], [-lQtSql], [QtSql])
+ AX_PKG(QT, [QT_INCLUDE QT_CORE QT_GUI QT_SQL], [], [])
fi
-dnl We need to link ISIS3RDPARTY against LAPACK because, on some systems,
-dnl the ISIS compilation does not resolve certain BLAS symbols that its
+dnl We need to link ISIS3RDPARTY against LAPACK because, on some systems,
+dnl the ISIS compilation does not resolve certain BLAS symbols that its
dnl dependent 3rd party libraries depend on (for whatever retarded reason).
-dnl Thus, we link against LAPACK here because it defines these missing
+dnl Thus, we link against LAPACK here because it defines these missing
dnl BLAS symbols in the event that we need them.
AX_PKG(ISIS3RDPARTY, [SUPERLU LAPACK GSL QWT GEOS SPICE XERCESC], [])
AX_PKG(ISIS, [QT ISIS3RDPARTY], [-lisis3])
@@ -337,8 +367,10 @@ AM_CONDITIONAL(MAKE_APP_RMAXADJUST, [test "$MAKE_APP_RMAXADJUST" = "yes"])
AM_CONDITIONAL(MAKE_APP_BUNDLEVIS, [test "$MAKE_APP_BUNDLEVIS" = "yes"])
##################################################
-# final processing
+# final processing
##################################################
+ASP_CPPFLAGS="$OTHER_CPPFLAGS"
+ASP_LDFLAGS="$OTHER_LDFLAGS"
if test "yes" = "$ENABLE_VERBOSE" ; then
AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS $ASP_CPPFLAGS])
@@ -353,7 +385,7 @@ AC_SUBST(ASP_LDFLAGS)
##################################################
-# makefiles to process
+# makefiles to process
##################################################
AC_CONFIG_FILES([ \
View
7 m4/ax_config_header_prefix.m4
@@ -1,10 +1,9 @@
dnl Usage: AX_CONFIG_HEADER_PREFIX(<filename>, <prefix>)
dnl Generates a configuration header file, adding a prefix to all symbols.
-dnl This is a two-step process. First we generate the usual header file
-dnl with a filename ending in ".pre". Then we process that file, adding
-dnl the prefix to all symbolx, and copy it into the final location if it
+dnl This is a two-step process. First we generate the usual header file
+dnl with a filename ending in ".pre". Then we process that file, adding
+dnl the prefix to all symbolx, and copy it into the final location if it
dnl has changed.
-
AC_DEFUN([AX_CONFIG_HEADER_PREFIX],
[
AM_CONFIG_HEADER([$1.pre],
View
4 m4/ax_find_files.m4
@@ -1,6 +1,6 @@
dnl Usage: AX_FIND_FILES(<filenames>, <search paths>)
-dnl Looks to see if all the given filenames (relative paths) are accessible
-dnl from one of the given base paths. Returns the path or the empty string
+dnl Looks to see if all the given filenames (relative paths) are accessible
+dnl from one of the given base paths. Returns the path or the empty string
dnl in ${ax_find_files_path}.
AC_DEFUN([AX_FIND_FILES],
[
View
105 m4/ax_pkg.m4
@@ -1,18 +1,11 @@
-dnl Usage: AX_PKG(<name>, <dependencies>, <libraries>, <headers>[, <additional cxxflags>])
+dnl Usage: AX_PKG(<name>, <dependencies>, <libraries>, <headers>[, <relative include path>])
AC_DEFUN([AX_PKG],
[
AC_ARG_WITH(translit($1,`A-Z',`a-z'),
AC_HELP_STRING([--with-]translit($1,`A-Z',`a-z'), [enable searching for the $1 package @<:@auto@:>@]),
[ HAVE_PKG_$1=$withval ]
)
- AC_ARG_WITH(translit($1,`A-Z',`a-z')[-cflags],
- AC_HELP_STRING([--with-]translit($1,`A-Z',`a-z')[-cppflags], [Add to $1_CPPFLAGS @<:@auto@:>@]),
- [ ADD_$1_CPPFLAGS=$withval ])
- AC_ARG_WITH(translit($1,`A-Z',`a-z')[-libs],
- AC_HELP_STRING([--with-]translit($1,`A-Z',`a-z')[-libs], [Override $1_LIBS and skip search @<:@auto@:>@]),
- [ FORCE_$1_LDFLAGS=$withval ])
-
if test x"$ENABLE_VERBOSE" = "xyes"; then
AC_MSG_CHECKING([for package $1 in current paths])
else
@@ -26,20 +19,24 @@ AC_DEFUN([AX_PKG],
AC_MSG_RESULT([no (disabled by user)])
else
- # Test for and inherit libraries from dependencies
if test -z "${FORCE_$1_LDFLAGS}"; then
PKG_$1_LIBS="$3"
else
PKG_$1_LIBS="${FORCE_$1_LDFLAGS}"
fi
+ # Test for and inherit from dependencies
for x in $2; do
ax_pkg_have_dep=HAVE_PKG_${x}
if test "${!ax_pkg_have_dep}" = "yes"; then
+ ax_pkg_dep_cxxflags="PKG_${x}_CPPFLAGS"
ax_pkg_dep_libs="PKG_${x}_LIBS"
+ PKG_$1_CPPFLAGS="$PKG_$1_CPPFLAGS ${!ax_pkg_dep_cxxflags}"
PKG_$1_LIBS="$PKG_$1_LIBS ${!ax_pkg_dep_libs}"
+ unset ax_pkg_dep_cxxflags
unset ax_pkg_dep_libs
else
+ unset PKG_$1_CPPFLAGS
unset PKG_$1_LIBS
HAVE_PKG_$1="no"
break
@@ -65,37 +62,33 @@ AC_DEFUN([AX_PKG],
elif test -n "${HAVE_PKG_$1}" && test "${HAVE_PKG_$1}" != "yes" && test "${HAVE_PKG_$1}" != "no"; then
PKG_PATHS_$1=${HAVE_PKG_$1}
else
- PKG_PATHS_$1=${PKG_PATHS}
+ PKG_PATHS_$1="none ${PKG_PATHS}"
fi
HAVE_PKG_$1=no
- # This is a gross hack that causes the AC_LINK_IFELSE macro use libtool to
- # link files rather that g++ alone. This in important for detecting
- # packages like the Vision Workbench which has many dependencies that
- # themselves have *.la files.
- OLD_CXX=$CXX
- if test "$host_vendor" = apple; then
- # Apple has lazy link-time dependencies and a different name for libtool,
- # so we turn off this hack on the mac platform.
- CXX=$CXX
- else
- CXX="libtool --mode=link --tag CXX $CXX"
- fi
+ AX_USE_LIBTOOL_LINKTEST([1])
+
+ ax_pkg_old_libs="$LIBS"
+ ax_pkg_old_cppflags="$CPPFLAGS"
+ ax_pkg_old_ldflags="$LDFLAGS"
+ ax_pkg_old_other_cppflags="$OTHER_CPPFLAGS"
+ ax_pkg_old_other_ldflags="$OTHER_LDFLAGS"
- ax_pkg_old_libs=$LIBS
LIBS="$PKG_$1_LIBS $LIBS"
- for path in none $PKG_PATHS_$1; do
- ax_pkg_old_cppflags=$CPPFLAGS
- ax_pkg_old_ldflags=$LDFLAGS
- ax_pkg_old_vw_cppflags=$ASP_CPPFLAGS
- ax_pkg_old_vw_ldflags=$ASP_LDFLAGS
+ for path in $PKG_PATHS_$1; do
+
+ CPPFLAGS="$PKG_$1_CPPFLAGS $ax_pkg_old_cppflags"
+ LDFLAGS="$ax_pkg_old_ldflags"
+ OTHER_CPPFLAGS="$ax_pkg_old_other_cppflags"
+ OTHER_LDFLAGS="$ax_pkg_old_other_ldflags"
+
echo > conftest.h
for header in $4 ; do
echo "#include <$header>" >> conftest.h
done
- CPPFLAGS="$ax_pkg_old_cppflags $ASP_CPPFLAGS"
- LDFLAGS="$ax_pkg_old_ldflags $ASP_LDFLAGS"
+ TRY_ADD_CPPFLAGS=""
+ TRY_ADD_LDFLAGS=""
if test "$path" != "none"; then
if test x"$ENABLE_VERBOSE" = "xyes"; then
AC_MSG_CHECKING([for package $1 in $path])
@@ -112,37 +105,48 @@ AC_DEFUN([AX_PKG],
fi
if test -z "$5"; then
- ASP_CPPFLAGS="-I$path/${AX_INCLUDE_DIR} $ASP_CPPFLAGS"
+ TRY_ADD_CPPFLAGS="$ADD_$1_CPPFLAGS -I$path/${AX_INCLUDE_DIR}"
else
- ASP_CPPFLAGS="$ADD_$1_CPPFLAGS $5 $ASP_CPPFLAGS"
+ TRY_ADD_CPPFLAGS="$ADD_$1_CPPFLAGS -I$path/${AX_INCLUDE_DIR}/$5"
fi
- CPPFLAGS="$ax_pkg_old_cppflags $ASP_CPPFLAGS"
- AC_LINK_IFELSE(
- AC_LANG_PROGRAM([#include "conftest.h"],[]),
- [ HAVE_PKG_$1=yes ; AC_MSG_RESULT([yes]) ; break ] )
- ASP_LDFLAGS="-L$path/lib $ASP_LDFLAGS"
- LDFLAGS="$ax_pkg_old_ldflags $ASP_LDFLAGS"
+
+ if test -d $path/${AX_LIBDIR}; then
+ TRY_ADD_LDFLAGS="-L$path/${AX_LIBDIR}"
+ elif test x"${AX_LIBDIR}" = "xlib64"; then
+ TRY_ADD_LDFLAGS="-L$path/${AX_OTHER_LIBDIR}"
+ fi
+
+ CPPFLAGS="$CPPFLAGS $TRY_ADD_CPPFLAGS"
+ LDFLAGS="$LDFLAGS $TRY_ADD_LDFLAGS"
+ else
+ # search in current paths
+ CPPFLAGS="$CPPFLAGS $OTHER_CPPFLAGS"
+ LDFLAGS="$LDFLAGS $OTHER_LDFLAGS"
fi
AC_LINK_IFELSE(
AC_LANG_PROGRAM([#include "conftest.h"],[]),
[ HAVE_PKG_$1=yes ; AC_MSG_RESULT([yes]) ; break ] )
+ TRY_ADD_CPPFLAGS=""
+ TRY_ADD_LDFLAGS=""
if test x"$ENABLE_VERBOSE" = "xyes"; then
AC_MSG_RESULT([no])
fi
- CPPFLAGS=$ax_pkg_old_cppflags
- LDFLAGS=$ax_pkg_old_ldflags
- ASP_CPPFLAGS=$ax_pkg_old_vw_cppflags
- ASP_LDFLAGS=$ax_pkg_old_vw_ldflags
done
- CPPFLAGS=$ax_pkg_old_cppflags
- LDFLAGS=$ax_pkg_old_ldflags
- LIBS=$ax_pkg_old_libs
+
+ PKG_$1_CPPFLAGS="$PKG_$1_CPPFLAGS $TRY_ADD_CPPFLAGS"
+ PKG_$1_LIBS="$PKG_$1_LIBS $TRY_ADD_LDFLAGS"
+
+ OTHER_CPPFLAGS="$OTHER_CPPFLAGS $TRY_ADD_CPPFLAGS"
+ OTHER_LDFLAGS="$OTHER_LDFLAGS $TRY_ADD_LDFLAGS"
+ CPPFLAGS="$ax_pkg_old_cppflags"
+ LDFLAGS="$ax_pkg_old_ldflags"
+ LIBS="$ax_pkg_old_libs"
if test "x$HAVE_PKG_$1" = "xno" -a "x$ENABLE_VERBOSE" != "xyes"; then
AC_MSG_RESULT([no (not found)])
fi
- CXX=$OLD_CXX
+ AX_USE_LIBTOOL_LINKTEST([])
fi
@@ -151,19 +155,24 @@ AC_DEFUN([AX_PKG],
ax_have_pkg_bool=1
else
ax_have_pkg_bool=0
+ PKG_$1_CPPFLAGS=
PKG_$1_LIBS=
fi
AC_DEFINE_UNQUOTED([HAVE_PKG_$1],
[$ax_have_pkg_bool],
[Define to 1 if the $1 package is available.])
+ AC_SUBST(PKG_$1_CPPFLAGS)
AC_SUBST(PKG_$1_LIBS)
AC_SUBST(HAVE_PKG_$1)
if test x"$ENABLE_VERBOSE" == "xyes"; then
AC_MSG_NOTICE([HAVE_PKG_$1 = ${HAVE_PKG_$1}])
+ AC_MSG_NOTICE([PKG_$1_CPPFLAGS= $PKG_$1_CPPFLAGS])
AC_MSG_NOTICE([PKG_$1_LIBS= $PKG_$1_LIBS])
- AC_MSG_NOTICE([ASP_CPPFLAGS= $ASP_CPPFLAGS])
- AC_MSG_NOTICE([ASP_LDFLAGS= $ASP_LDFLAGS])
+ AC_MSG_NOTICE([CPPFLAGS= $CPPFLAGS])
+ AC_MSG_NOTICE([LDFLAGS= $LDFLAGS])
+ AC_MSG_NOTICE([OTHER_CPPFLAGS= $OTHER_CPPFLAGS])
+ AC_MSG_NOTICE([OTHER_LDFLAGS= $OTHER_LDFLAGS])
fi
])
View
47 m4/ax_pkg_boost.m4
@@ -16,8 +16,9 @@ AC_DEFUN([AX_PKG_BOOST],
fi
# Skip testing if the user has overridden
- if test -z "${HAVE_PKG_BOOST}"; then
+ if test -z ${HAVE_PKG_BOOST}; then
+ PKG_BOOST_CPPFLAGS=
PKG_BOOST_LIBS=
HAVE_PKG_BOOST=no
@@ -28,7 +29,11 @@ AC_DEFUN([AX_PKG_BOOST],
fi
if test -d "${ax_boost_base_path}/include/boost" ; then
PKG_BOOST_INCDIR="${ax_boost_base_path}/include"
- PKG_BOOST_LIBDIR="${ax_boost_base_path}/lib"
+ PKG_BOOST_LIBDIR="${ax_boost_base_path}/${AX_LIBDIR}"
+ # In case it's not in lib64 despite specifying lib64...
+ if test ! -d $PKG_BOOST_LIBDIR -a x"${AX_LIBDIR}" = "xlib64"; then
+ PKG_BOOST_LIBDIR="${ax_boost_base_path}/${AX_OTHER_LIBDIR}"
+ fi
HAVE_PKG_BOOST="yes"
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_RESULT([found])
@@ -60,47 +65,47 @@ AC_DEFUN([AX_PKG_BOOST],
fi
if test "${HAVE_PKG_BOOST}" = "yes" ; then
- ax_pkg_old_vw_cppflags=$ASP_CPPFLAGS
- ax_pkg_old_vw_ldflags=$ASP_LDFLAGS
+ ax_pkg_old_other_cppflags=$OTHER_CPPFLAGS
+ ax_pkg_old_other_ldflags=$OTHER_LDFLAGS
ax_pkg_old_cppflags=$CPPFLAGS
ax_pkg_old_ldflags=$LDFLAGS
ax_pkg_old_libs=$LIBS
while true ; do
# First see if the current paths are sufficient
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
- AC_MSG_CHECKING([whether current paths are sufficient...])
+ AC_MSG_CHECKING([whether current paths are sufficient...])
fi
AC_LINK_IFELSE( AC_LANG_PROGRAM([#include <boost/version.hpp>],[]), [ax_result=yes], [ax_result=no] )
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
- AC_MSG_RESULT([$ax_result])
+ AC_MSG_RESULT([$ax_result])
fi
if test "$ax_result" = "yes" ; then break ; fi
# Try it with just the include path
- ASP_CPPFLAGS="-I${PKG_BOOST_INCDIR} $ASP_CPPFLAGS"
- CPPFLAGS="$ax_pkg_old_cppflags $ASP_CPPFLAGS"
+ OTHER_CPPFLAGS="-I${PKG_BOOST_INCDIR} $OTHER_CPPFLAGS"
+ CPPFLAGS="$ax_pkg_old_cppflags $OTHER_CPPFLAGS"
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
- AC_MSG_CHECKING([whether adding the include path is sufficient...])
+ AC_MSG_CHECKING([whether adding the include path is sufficient...])
fi
AC_LINK_IFELSE( AC_LANG_PROGRAM([#include <boost/version.hpp>],[]), [ax_result=yes], [ax_result=no] )
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
- AC_MSG_RESULT([$ax_result])
+ AC_MSG_RESULT([$ax_result])
fi
if test "$ax_result" = "yes" ; then break ; fi
# Finally, try it with the linker path
- ASP_LDFLAGS="-L${PKG_BOOST_LIBDIR} $ASP_LDFLAGS"
- LDFLAGS="$ax_pkg_old_ldflags $ASP_LDFLAGS"
+ OTHER_LDFLAGS="-L${PKG_BOOST_LIBDIR} $OTHER_LDFLAGS"
+ LDFLAGS="$ax_pkg_old_ldflags $OTHER_LDFLAGS"
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
- AC_MSG_CHECKING([whether adding the include and linker paths works...])
+ AC_MSG_CHECKING([whether adding the include and linker paths works...])
fi
AC_LINK_IFELSE( AC_LANG_PROGRAM([#include <boost/version.hpp>],[]), [ax_result=yes], [ax_result=no] )
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
- AC_MSG_RESULT([$ax_result])
+ AC_MSG_RESULT([$ax_result])
fi
if test "$ax_result" = "yes" ; then break ; fi
# The detected version of boost seems to be invalid!
HAVE_PKG_BOOST="no"
- ASP_CPPFLAGS="$ax_pkg_old_vw_cppflags"
- ASP_LDFLAGS="$ax_pkg_old_vw_ldflags"
+ OTHER_CPPFLAGS="$ax_pkg_old_other_cppflags"
+ OTHER_LDFLAGS="$ax_pkg_old_other_ldflags"
unset PKG_BOOST_INCDIR
unset PKG_BOOST_LIBDIR
break
@@ -111,19 +116,25 @@ AC_DEFUN([AX_PKG_BOOST],
if test "${HAVE_PKG_BOOST}" = "yes" ; then
ax_have_pkg_bool=1
+ PKG_BOOST_CPPFLAGS="-I${PKG_BOOST_INCDIR}"
+ PKG_BOOST_LIBS="-L${PKG_BOOST_LIBDIR}"
else
ax_have_pkg_bool=0
fi
AC_DEFINE_UNQUOTED([HAVE_PKG_BOOST],
[$ax_have_pkg_bool],
[Define to 1 if the BOOST package is available.])
+ AC_SUBST(PKG_BOOST_CPPFLAGS)
+ AC_SUBST(PKG_BOOST_LIBS)
AC_SUBST(HAVE_PKG_BOOST)
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_NOTICE([HAVE_PKG_BOOST= $HAVE_PKG_BOOST])
- AC_MSG_NOTICE([ASP_CPPFLAGS= $ASP_CPPFLAGS])
- AC_MSG_NOTICE([ASP_LDFLAGS= $ASP_LDFLAGS])
+ AC_MSG_NOTICE([OTHER_CPPFLAGS= $OTHER_CPPFLAGS])
+ AC_MSG_NOTICE([OTHER_LDFLAGS= $OTHER_LDFLAGS])
+ AC_MSG_NOTICE([CPPFLAGS= $CPPFLAGS])
+ AC_MSG_NOTICE([LDFLAGS= $LDFLAGS])
else
AC_MSG_RESULT([$HAVE_PKG_BOOST])
fi
View
28 m4/ax_pkg_boost_check_version.m4
@@ -0,0 +1,28 @@
+# Usage: AX_PKG_BOOST_CHECK_VERSION([config-prefix])
+# config-prefix should be the same as was used above
+AC_DEFUN([AX_PKG_BOOST_CHECK_VERSION],
+[
+ AC_LANG_CONFTEST(
+ [AC_LANG_PROGRAM([[
+#include <iostream>
+#include <boost/version.hpp>
+#define STR2(s) #s
+#define STR(s) STR2(s)
+]],[[
+std::cout << STR(BOOST_VERSION);
+]])])
+ $CXX $OTHER_CPPFLAGS -I${PKG_BOOST_INCDIR} -o conftest conftest.$ac_ext
+ BOOST_VERSION=`./conftest`
+ AC_DEFINE_UNQUOTED([BOOST_VERSION],
+ [$BOOST_VERSION],
+ [The version of Boost with which the software built.])
+
+ AH_VERBATIM([_OTHER_CHECK_BOOST_VERSION],
+[// Check to make sure the user is using the same version of Boost
+// headers that the software was built with.
+#include <boost/version.hpp>
+#if BOOST_VERSION != $1BOOST_VERSION
+#error You are using a different version of Boost than you used to build the software!
+#endif
+])
+])
View
71 m4/ax_pkg_boost_lib.m4
@@ -1,3 +1,17 @@
+dnl Here's a new version of AX_PKG_BOOST_LIB designed to find the
+dnl multithreaded boost libraries and boost libraries that are just weirdly
+dnl named in general. Boost libraries follow a weird naming convention
+dnl that makes our old logic not work. You can't just add -mt to the old
+dnl library you're looking for, because the -compiler part comes first.
+dnl IE, the non-multithreaded library would be named libboost_X-gcc41.so,
+dnl and the multithreaded library would be named libboost_X-gcc41-mt.so.
+dnl
+dnl For that reason, we've added an environment variable:
+dnl BOOST_LIBRARIES_SUFFIX. The function here tries to find a version of
+dnl Boost with the string in said variable somewhere inside the Boost
+dnl library names, but after the initial name of the library (specified
+dnl as the second parameter to this function). A blank value will give
+dnl normal behavior.
# Usage: AX_PKG_BOOST_LIB(<name>, <libraries>, <header>)
AC_DEFUN([AX_PKG_BOOST_LIB],
[
@@ -9,7 +23,7 @@ AC_DEFUN([AX_PKG_BOOST_LIB],
AC_LANG_ASSERT(C++)
# Skip testing if the user has overridden
- if test -z "${HAVE_PKG_BOOST_$1}"; then
+ if test -z ${HAVE_PKG_BOOST_$1}; then
HAVE_PKG_BOOST_$1=no
@@ -18,29 +32,40 @@ AC_DEFUN([AX_PKG_BOOST_LIB],
# Check for required headers
AX_FIND_FILES([$3],[${PKG_BOOST_INCDIR}])
if test ! -z "$ax_find_files_path" ; then
- # Check for required libraries with no suffix
- AX_FIND_FILES([`echo $2 | sed 's/-l\([[^[:space:]]]*\)/lib\1.*/g'`],[$PKG_BOOST_LIBDIR])
+ # Check for required libraries with no suffix, aside from the one
+ # given by environment variable.
+ AX_FIND_FILES([`echo $2 | sed "s/-l\([[^[:space:]]]*\)/lib\1${BOOST_LIBRARIES_SUFFIX}.*/g"`],[$PKG_BOOST_LIBDIR])
if test ! -z "$ax_find_files_path" ; then
HAVE_PKG_BOOST_$1="yes"
- PKG_BOOST_$1_LIBS="$2"
+ PKG_BOOST_$1_LIBS="$2${BOOST_LIBRARIES_SUFFIX}"
else
- # Check for required libraries with some suffix
+ # Check for required libraries with some suffix. We have to check
+ # for both a suffix before ${BOOST_LIBRARIES_SUFFIX} (pre-suffix)
+ # and a suffix after (for example) the -mt (post-suffix), because
+ # boost likes to stick the name of the compiler before the -mt.
+ # Extremely annoying.
+
ax_pkg_boost_lib=`echo $2 | awk '{print [$]1}' | sed 's/-l\([[^[:space:]-]]*\).*/lib\1/g'`
- ax_pkg_boost_lib_ext=`ls ${PKG_BOOST_LIBDIR}/${ax_pkg_boost_lib}-* | head -n 1 | sed "s,^${PKG_BOOST_LIBDIR}/${ax_pkg_boost_lib}\(-[[^.]]*\).*,\1,"`
- if test ! -z "$ax_pkg_boost_lib_ext" ; then
- AX_FIND_FILES([`echo $2 | sed "s/-l\([[^[:space:]]]*\)/lib\1${ax_pkg_boost_lib_ext}.*/g"`],[$PKG_BOOST_LIBDIR])
- if test ! -z "$ax_find_files_path" ; then
- HAVE_PKG_BOOST_$1="yes"
- PKG_BOOST_$1_LIBS=`echo $2 | sed "s/[[^ ]]*/&${ax_pkg_boost_lib_ext}/g"`
- fi
+ ax_pkg_boost_file=`ls ${PKG_BOOST_LIBDIR}/${ax_pkg_boost_lib}-*${BOOST_LIBRARIES_SUFFIX}* | head -n 1 | sed "s,^${PKG_BOOST_LIBDIR}/\(.*\),\1,"`
+
+ # The pre-suffix.
+ ax_pkg_boost_presuffix=`echo ${ax_pkg_boost_file} | sed "s/${ax_pkg_boost_lib}\([[^.]]*\)${BOOST_LIBRARIES_SUFFIX}.*/\1/"`
+
+ # The post-suffix.
+ ax_pkg_boost_postsuffix=`echo ${ax_pkg_boost_file} | sed "s/${ax_pkg_boost_lib}${ax_pkg_boost_presuffix}${BOOST_LIBRARIES_SUFFIX}\([[^.]]*\).*/\1/"`
+
+ AX_FIND_FILES([`echo $2 | sed "s/-l\([[^[:space:]]]*\)/lib\1${ax_pkg_boost_presuffix}${BOOST_LIBRARIES_SUFFIX}${ax_pkg_boost_postsuffix}.*/g"`],[$PKG_BOOST_LIBDIR])
+ if test ! -z $ax_find_files_path ; then
+ HAVE_PKG_BOOST_$1="yes"
+ PKG_BOOST_$1_LIBS=`echo $2 | sed "s/[[^ ]]*/&${ax_pkg_boost_presuffix}${BOOST_LIBRARIES_SUFFIX}${ax_pkg_boost_postsuffx}/g"`
fi
fi
fi
fi
fi
- ax_pkg_old_vw_cppflags=$ASP_CPPFLAGS
- ax_pkg_old_vw_ldflags=$ASP_LDFLAGS
+ ax_pkg_old_other_cppflags=$OTHER_CPPFLAGS
+ ax_pkg_old_other_ldflags=$OTHER_LDFLAGS
ax_pkg_old_cppflags=$CPPFLAGS
ax_pkg_old_ldflags=$LDFLAGS
ax_pkg_old_libs=$LIBS
@@ -53,8 +78,8 @@ AC_DEFUN([AX_PKG_BOOST_LIB],
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
AC_MSG_CHECKING([whether current paths are sufficient...])
fi
- CPPFLAGS="$ax_pkg_old_cppflags $ASP_CPPFLAGS"
- LDFLAGS="$ax_pkg_old_ldflags $ASP_LDFLAGS"
+ CPPFLAGS="$ax_pkg_old_cppflags $OTHER_CPPFLAGS"
+ LDFLAGS="$ax_pkg_old_ldflags $OTHER_LDFLAGS"
LIBS="$PKG_BOOST_$1_LIBS $ax_pkg_old_libs"
AC_LINK_IFELSE( AC_LANG_PROGRAM([#include "conftest.h"],[]), [ax_result=yes], [ax_result=no] )
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
@@ -65,8 +90,8 @@ AC_DEFUN([AX_PKG_BOOST_LIB],
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
AC_MSG_CHECKING([whether adding the include path is sufficient...])
fi
- ASP_CPPFLAGS="-I${PKG_BOOST_INCDIR} $ASP_CPPFLAGS"
- CPPFLAGS="$ax_pkg_old_cppflags $ASP_CPPFLAGS"
+ OTHER_CPPFLAGS="-I${PKG_BOOST_INCDIR} $OTHER_CPPFLAGS"
+ CPPFLAGS="$ax_pkg_old_cppflags $OTHER_CPPFLAGS"
AC_LINK_IFELSE( AC_LANG_PROGRAM([#include "conftest.h"],[]), [ax_result=yes], [ax_result=no] )
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
AC_MSG_RESULT([$ax_result])
@@ -76,17 +101,17 @@ AC_DEFUN([AX_PKG_BOOST_LIB],
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
AC_MSG_CHECKING([whether adding the include and linker paths works...])
fi
- ASP_LDFLAGS="-L${PKG_BOOST_LIBDIR} $ASP_LDFLAGS"
- LDFLAGS="$ax_pkg_old_ldflags $ASP_LDFLAGS"
+ OTHER_LDFLAGS="-L${PKG_BOOST_LIBDIR} $OTHER_LDFLAGS"
+ LDFLAGS="$ax_pkg_old_ldflags $OTHER_LDFLAGS"
AC_LINK_IFELSE( AC_LANG_PROGRAM([#include "conftest.h"],[]), [ax_result=yes], [ax_result=no] )
if test "x${ENABLE_VERBOSE}" = "xyes" ; then
AC_MSG_RESULT([$ax_result])
fi
if test "$ax_result" = "yes" ; then break ; fi
# The detected version of boost seems to be invalid!
HAVE_PKG_BOOST_$1="no"
- ASP_CPPFLAGS="$ax_pkg_old_vw_cppflags"
- ASP_LDFLAGS="$ax_pkg_old_vw_ldflags"
+ OTHER_CPPFLAGS="$ax_pkg_old_other_cppflags"
+ OTHER_LDFLAGS="$ax_pkg_old_other_ldflags"
break
done
@@ -109,6 +134,8 @@ AC_DEFUN([AX_PKG_BOOST_LIB],
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_NOTICE([HAVE_PKG_BOOST_$1 = ${HAVE_PKG_BOOST_$1}])
AC_MSG_NOTICE([PKG_BOOST_$1_LIBS= $PKG_BOOST_$1_LIBS])
+ AC_MSG_NOTICE([CPPFLAGS= $CPPFLAGS])
+ AC_MSG_NOTICE([LDFLAGS= $LDFLAGS])
else
AC_MSG_RESULT([${HAVE_PKG_BOOST_$1}])
fi
View
12 m4/ax_pkg_gl.m4
@@ -9,14 +9,14 @@ AC_DEFUN([AX_PKG_GL],
# If we are running MacOS X, we can use Apple's vecLib framework to
# provide us with GL and BLAS routines.
- if test "$host_vendor" = apple; then
+ if test $host_vendor = apple; then
AC_MSG_CHECKING(for package GL)
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_RESULT([])
fi
HAVE_PKG_GL="yes"
- PKG_GL_LIBS="$ASP_LDFLAGS -framework OpenGL -framework GLUT"
+ PKG_GL_LIBS="$OTHER_LDFLAGS -framework OpenGL -framework GLUT"
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_RESULT([found])
@@ -35,11 +35,13 @@ AC_DEFUN([AX_PKG_GL],
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_NOTICE([HAVE_PKG_GL = ${HAVE_PKG_GL}])
AC_MSG_NOTICE([PKG_GL_LIBS = ${PKG_GL_LIBS}])
- AC_MSG_NOTICE([ASP_CPPFLAGS = ${ASP_CPPFLAGS}])
- AC_MSG_NOTICE([ASP_LDFLAGS = ${ASP_LDFLAGS}])
+ AC_MSG_NOTICE([OTHER_CPPFLAGS = ${OTHER_CPPFLAGS}])
+ AC_MSG_NOTICE([OTHER_LDFLAGS = ${OTHER_LDFLAGS}])
+ AC_MSG_NOTICE([CPPFLAGS= $CPPFLAGS])
+ AC_MSG_NOTICE([LDFLAGS= $LDFLAGS])
else
AC_MSG_RESULT([${HAVE_PKG_GL}])
- fi
+ fi
# For all other platforms, we search for static GL libraries
# in the conventional manner.
View
16 m4/ax_pkg_lapack.m4
@@ -9,14 +9,14 @@ AC_DEFUN([AX_PKG_LAPACK],
# If we are running MacOS X, we can use Apple's vecLib framework to
# provide us with LAPACK and BLAS routines.
- if test "$host_vendor" = apple; then
+ if test $host_vendor = apple; then
AC_MSG_CHECKING(for package LAPACK)
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_RESULT([])
fi
HAVE_PKG_LAPACK="yes"
- PKG_LAPACK_LIBS="$ASP_LDFLAGS -framework vecLib"
+ PKG_LAPACK_LIBS="$OTHER_LDFLAGS -framework vecLib"
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_RESULT([found])
@@ -35,8 +35,10 @@ AC_DEFUN([AX_PKG_LAPACK],
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_NOTICE([HAVE_PKG_LAPACK = ${HAVE_PKG_LAPACK}])
AC_MSG_NOTICE([PKG_LAPACK_LIBS = ${PKG_LAPACK_LIBS}])
- AC_MSG_NOTICE([ASP_CPPFLAGS = ${ASP_CPPFLAGS}])
- AC_MSG_NOTICE([ASP_LDFLAGS = ${ASP_LDFLAGS}])
+ AC_MSG_NOTICE([OTHER_CPPFLAGS = ${OTHER_CPPFLAGS}])
+ AC_MSG_NOTICE([OTHER_LDFLAGS = ${OTHER_LDFLAGS}])
+ AC_MSG_NOTICE([CPPFLAGS= $CPPFLAGS])
+ AC_MSG_NOTICE([LDFLAGS= $LDFLAGS])
else
AC_MSG_RESULT([${HAVE_PKG_LAPACK}])
fi
@@ -63,16 +65,16 @@ AC_DEFUN([AX_PKG_LAPACK],
AX_PKG(STANDALONE_LAPACK, [], [-llapack], [])
AX_PKG(STANDALONE_LAPACK_AND_BLAS, [STANDALONE_LAPACK STANDALONE_BLAS], [], [])
- if test "$HAVE_PKG_STANDALONE_LAPACK_AND_BLAS" = "no"; then
+ if test "$HAVE_PKG_STANDALONE_LAPACK_AND_BLAS" = "no"; then
# On some systems, F2C, FBLAS and FLAPACK are installed in different places
AC_MSG_NOTICE(["trying to find F2C, FBLAS, and FLAPACK seperately."])
AX_PKG(STANDALONE_F2C, [], [-lf2c], [])
AX_PKG(STANDALONE_FBLAS, [STANDALONE_F2C], [-lblas], [])
AX_PKG(STANDALONE_FLAPACK, [STANDALONE_F2C], [-llapack], [])
AX_PKG(LAPACK, [STANDALONE_FLAPACK STANDALONE_FBLAS STANDALONE_F2C], [], [])
- else
+ else
AX_PKG(LAPACK, [STANDALONE_LAPACK_AND_BLAS], [], [])
- fi # FBLAS and FLAPACK
+ fi # FBLAS and FLAPACK
else
AX_PKG(LAPACK, [FLAPACK], [], [])
fi # BLAS and LAPACK
View
4 m4/ax_pkg_pthreads.m4
@@ -69,13 +69,17 @@ AC_DEFUN([AX_PKG_PTHREADS],
[Define to 1 if the PTHREADS package is available.])
AC_SUBST(HAVE_PKG_PTHREADS)
+ AC_SUBST(PKG_PTHREADS_CPPFLAGS)
AC_SUBST(PKG_PTHREADS_LIBS)
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_NOTICE([HAVE_PKG_PTHREADS = ${HAVE_PKG_PTHREADS}])
+ AC_MSG_NOTICE([PKG_PTHREADS_CPPFLAGS = ${PKG_PTHREADS_CPPFLAGS}])
AC_MSG_NOTICE([PKG_PTHREADS_LIBS = ${PKG_PTHREADS_LIBS}])
AC_MSG_NOTICE([CFLAGS= $CFLAGS])
AC_MSG_NOTICE([CXXFLAGS= $CXXFLAGS])
+ AC_MSG_NOTICE([CPPFLAGS= $CPPFLAGS])
+ AC_MSG_NOTICE([LDFLAGS= $LDFLAGS])
else
AC_MSG_RESULT([${HAVE_PKG_PTHREADS}])
fi
View
12 m4/ax_prog_ar.m4
@@ -1,15 +1,15 @@
dnl Usage: AX_PROG_AR
-dnl Provides a workaround for Mac OS X's unusual ar behavior, so that
-dnl it's possible to build static convenience libraries using libtool
-dnl on that platform. Basically, if we're on a Mac we introduce a
-dnl wrapper shell script for ar that detects when we're creating an
-dnl empty library and creates it by hand. In all other cases it just
+dnl Provides a workaround for Mac OS X's unusual ar behavior, so that
+dnl it's possible to build static convenience libraries using libtool
+dnl on that platform. Basically, if we're on a Mac we introduce a
+dnl wrapper shell script for ar that detects when we're creating an
+dnl empty library and creates it by hand. In all other cases it just
dnl relays the arguments to the user's AR.
AC_DEFUN([AX_PROG_AR],
[
AC_REQUIRE([AM_AUX_DIR_EXPAND])
AC_MSG_CHECKING([whether to use ar.sh wrapper script])
- if test "$host_vendor" = "apple"; then
+ if test $host_vendor = "apple"; then
AC_MSG_RESULT([yes])
if test -z "$AR" ; then
ax_ar_prog=ar;
View
23 m4/ax_use_libtool_linktest.m4
@@ -0,0 +1,23 @@
+dnl Usage: AX_USE_LIBTOOL_LINKTEST([enable])
+dnl This is a gross hack that causes the AC_LINK_IFELSE macro use libtool to
+dnl link files rather that g++ alone. This in important for detecting packages
+dnl like the Vision Workbench which has many dependencies that themselves have
+dnl *.la files. if enable is non-empty, it is enabled. if enable is empty, it
+dnl is disabled. NOT REENTRANT!
+AC_DEFUN([AX_USE_LIBTOOL_LINKTEST], [
+ if test -z "$1"; then
+ if test -n "$LIBTOOL_LINKTEST_OLD_CXX" ; then
+ CXX="$LIBTOOL_LINKTEST_OLD_CXX"
+ LIBTOOL_LINKTEST_OLD_CXX=""
+ fi
+ else
+ LIBTOOL_LINKTEST_OLD_CXX="$CXX"
+ if test "$host_vendor" = apple; then
+ # Apple has lazy link-time dependencies and a different name for libtool,
+ # so we turn off this hack on the mac platform.
+ CXX=$CXX
+ else
+ CXX="libtool --mode=link --tag CXX $CXX"
+ fi
+ fi
+])

0 comments on commit 22eabd4

Please sign in to comment.