Skip to content

Commit

Permalink
Synchronize VW and Stereo build systems
Browse files Browse the repository at this point in the history
  • Loading branch information
novas0x2a committed Aug 20, 2009
1 parent 6c1add5 commit 545de6e
Show file tree
Hide file tree
Showing 10 changed files with 196 additions and 427 deletions.
113 changes: 58 additions & 55 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,25 +1,8 @@
# __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__
dnl __BEGIN_LICENSE__
dnl Copyright (C) 2006, 2007 United States Government as represented by
dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__

m4_pattern_forbid([^AX_])
m4_pattern_allow([AX_CFLAGS])
Expand All @@ -39,7 +22,7 @@ AC_CANONICAL_HOST
AM_INIT_AUTOMAKE([nostdinc])
AX_CONFIG_HEADER_PREFIX([src/asp_config.h], [ASP_])

dnl TODO BEFORE RELEASE: update libtool version
dnl TODO RIGHT BEFORE RELEASE: update libtool version
dnl if abi changes in any way:
dnl current++
dnl revision=0
Expand All @@ -55,15 +38,11 @@ dnl LIBTOOL_VERSION=current:revision:age
LIBTOOL_VERSION=1:0:0
AC_SUBST(LIBTOOL_VERSION)

# This should be first, so everything else can use it
AX_ARG_ENABLE(verbose, no, [none], [verbose configuration output])

# load the config.options
if test -f ./config.options; then
if test "yes" = "$ENABLE_VERBOSE" ; then
AC_MSG_NOTICE([sourcing ./config.options])
cat ./config.options
fi
AX_LOG([using config.options << EOF])
AX_LOG([`cat ./config.options`])
AX_LOG([EOF])
source ./config.options
fi

Expand Down Expand Up @@ -91,24 +70,44 @@ AX_COMMON_OPTIONS




##################################################
# package checks
# Compilation options
##################################################

AX_ARG_ENABLE(strict-aliasing, no, [none], [allow strict aliasing (dangerous)])

##################################################
# Handle options
##################################################

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_ONE_OF(BOOST_FILESYSTEM,
BOOST_FILESYSTEM_PRE_1_35, [AX_PKG_BOOST_LIB(FILESYSTEM_PRE_1_35, [-lboost_filesystem], [boost/filesystem/path.hpp])],
BOOST_FILESYSTEM_POST_1_35, [AX_PKG_BOOST_LIB(FILESYSTEM_POST_1_35, [-lboost_filesystem -lboost_system], [boost/filesystem/path.hpp])])
##################################################
# distribution options
##################################################


AX_PKG_BOOST_LIB(THREAD, [-lboost_thread], [boost/thread/thread.hpp])
AX_PKG_BOOST_LIB(IOSTREAMS, [-lboost_iostreams], [boost/iostreams/stream_buffer.hpp])


##################################################
# package checks
##################################################

AX_PKG_PTHREADS

AX_PKG_BOOST
if test x"$HAVE_PKG_BOOST" == "xyes"; then
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(SYSTEM, [-lboost_system], [boost/system/error_code.hpp])
AX_PKG_BOOST_LIB(FILESYSTEM, [-lboost_filesystem], [boost/filesystem/path.hpp], [$PKG_BOOST_SYSTEM_LIBS])
AX_PKG_BOOST_LIB(THREAD, [-lboost_thread], [boost/thread/thread.hpp])
AX_PKG_BOOST_LIB(IOSTREAMS, [-lboost_iostreams], [boost/iostreams/stream_buffer.hpp])
fi

# This provides an easy way for users to override the threads options
# if they are replacing Boost threads with something else for their platform.
Expand Down Expand Up @@ -163,16 +162,16 @@ if test x"$HAVE_PKG_QT_BASE" != x"no:missing QT"; then
AT_REQUIRE_QT_VERSION([4.0], [HAVE_PKG_QT_BASE="no:wrong QT version"], [])
fi

# We seed QT_INCLUDE's cppflags with the ones qmake figured out
# We seed QT_BASE's cppflags and libs with the ones qmake figured out
PKG_QT_BASE_CPPFLAGS="$PKG_QT_BASE_CPPFLAGS $QT_CPPFLAGS"
AX_PKG(QT_BASE, [], [$QT_LIBS], [QVector])

AX_PKG_ONE_OF(QT,
APPLE_QT, [AX_PKG_APPLE(QT, [GL QT_BASE], [])],
LINUX_QT,
[AX_PKG(QT_OPENGL, [GL QT_BASE], [], [QtOpenGL])
AX_PKG(QT_GUI, [QT_BASE], [], [QLabel])
AX_PKG(QT_SQL, [QT_BASE], [], [QtSql])
[AX_PKG(QT_OPENGL, [QT_BASE], [], [QtOpenGL])
AX_PKG(QT_GUI, [QT_BASE], [], [QLabel])
AX_PKG(QT_SQL, [QT_BASE], [], [QtSql])
AX_GROUP_PKG(LINUX_QT, [QT_BASE QT_GUI QT_OPENGL QT_SQL])])

AX_PKG_ONE_OF(QWT,
Expand All @@ -191,13 +190,13 @@ if test x"$host_vendor" = "xapple"; then
AX_PKG(XERCESC, [], [-lxerces-c.28], [])
else
AX_PKG(GEOS, [], [-lgeos])
AX_PKG(SUPERLU, [LAPACK], [-lsuperlu])
AX_PKG(SUPERLU, [LAPACK], [-lsuperlu])
AX_PKG(XERCESC, [], [-lxerces-c])
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 dependent 3rd party libraries depend on (for whatever retarded reason).
dnl dependent 3rd party libraries depend on (for whatever reason).
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], [])
Expand Down Expand Up @@ -251,6 +250,7 @@ AM_CONDITIONAL(MAKE_APP_CTXIMAGE, [test "$MAKE_APP_CTXIMAGE" = "yes"])
AM_CONDITIONAL(MAKE_APP_RMAX2CAHVOR, [test "$MAKE_APP_RMAX2CAHVOR" = "yes"])
AM_CONDITIONAL(MAKE_APP_RMAXADJUST, [test "$MAKE_APP_RMAXADJUST" = "yes"])
AM_CONDITIONAL(MAKE_APP_BUNDLEVIS, [test "$MAKE_APP_BUNDLEVIS" = "yes"])
AM_CONDITIONAL(MAKE_APP_ISISADJUST, [test "$MAKE_APP_ISISADJUST" = "yes"])
AM_CONDITIONAL(MAKE_APP_RESULTS, [test "$MAKE_APP_RESULTS" = "yes"])
AM_CONDITIONAL(MAKE_APP_CUDATEST, [test "$MAKE_APP_CUDATEST" = "yes"])
AM_CONDITIONAL(MAKE_APP_RECONSTRUCT, [test "$MAKE_APP_RECONSTRUCT" = "yes"])
Expand All @@ -263,16 +263,19 @@ AM_CONDITIONAL(MAKE_APP_RECONSTRUCT, [test "$MAKE_APP_RECONSTRUCT" = "yes"])
ASP_CPPFLAGS="-I\${top_srcdir}/src $OTHER_CPPFLAGS"
ASP_LDFLAGS="$OTHER_LDFLAGS"

if test "yes" = "$ENABLE_VERBOSE" ; then
AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS])
AC_MSG_NOTICE([using ASP_CPPFLAGS=$ASP_CPPFLAGS])
AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
AC_MSG_NOTICE([using CXXFLAGS=$CXXFLAGS])
AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS])
AC_MSG_NOTICE([using ASP_LDFLAGS=$ASP_LDFLAGS])
AC_MSG_NOTICE([using ASP_ENABLE_EXCEPTIONS=$ENABLE_EXCEPTIONS])
# Do this last, to make sure it's not overridden
if test x"$ENABLE_STRICT_ALIASING" = x"no"; then
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
fi

AX_LOG([using CPPFLAGS=$CPPFLAGS])
AX_LOG([using ASP_CPPFLAGS=$ASP_CPPFLAGS])
AX_LOG([using CFLAGS=$CFLAGS])
AX_LOG([using CXXFLAGS=$CXXFLAGS])
AX_LOG([using LDFLAGS=$LDFLAGS])
AX_LOG([using ASP_LDFLAGS=$ASP_LDFLAGS])
AX_LOG([using ASP_ENABLE_EXCEPTIONS=$ENABLE_EXCEPTIONS])

AC_SUBST(ASP_CPPFLAGS)
AC_SUBST(ASP_LDFLAGS)

Expand Down
89 changes: 45 additions & 44 deletions m4/ax_app.m4
Original file line number Diff line number Diff line change
@@ -1,72 +1,69 @@
dnl __BEGIN_LICENSE__
dnl Copyright (C) 2006, 2007 United States Government as represented by
dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__

# Usage: AX_APP(<name>, <directory>, <default>, <required dependencies>[, <optional dependencies>])
AC_DEFUN([AX_APP],
[
# Silently ignore modules that don't exist in this distribution
if test -d $2 ; then
# Silently ignore apps that don't exist in this distribution
if test -d "$srcdir/$2" ; then
HAVE_PKG_$1_SRC=yes
if test -n "$ENABLE_APP_$1"; then
WANT_APP_$1="$ENABLE_APP_$1"
fi
AC_ARG_ENABLE([app-]m4_tolower([[$1]]),
AC_HELP_STRING([--enable-app-]m4_tolower([[$1]]), [enable the $1 app @<:@$3@:>@]),
[ ENABLE_APP_$1=$enableval ],
[ ENABLE_APP_$1=$enableval; WANT_APP_$1=$enableval; ],
[ if test "x$ENABLE_APP_$1" = x; then ENABLE_APP_$1=`/bin/echo -n $3 | tr [A-Z] [a-z]` ; fi ]
)
AC_MSG_CHECKING([whether to build app $1])
ax_app_enable=$ENABLE_APP_$1
if test "$ax_app_enable" != "yes" ; then
AC_MSG_RESULT([no (disabled)])
fi
ax_libs=""
# Create a variable to store missing
AS_VAR_PUSHDEF([missing], [ax_app_]$1[_missing])
# Check for required dependencies
if test "$ax_app_enable" = "yes" ; then
for ax_dependency in $4 ; do
ax_dependency_have="HAVE_PKG_${ax_dependency}"
if test x"${!ax_dependency_have}" = "xyes"; then
ax_dep_libs="PKG_${ax_dependency}_LIBS"
ax_libs="${ax_libs} ${!ax_dep_libs}"
else
AC_MSG_RESULT([no])
AC_MSG_NOTICE([warning: unable to build requested app $1 (needs ${ax_dependency})!])
ax_app_enable=no;
break;
fi
done
fi
if test "$ax_app_enable" = "yes" ; then
# Check for optional dependencies
for ax_dependency in $5 ; do
ax_dependency_have="HAVE_PKG_${ax_dependency}"
if test x"${!ax_dependency_have}" = "xyes"; then
ax_dep_libs="PKG_${ax_dependency}_LIBS"
ax_libs="${ax_libs} ${!ax_dep_libs}"
fi
done
# Load args 5 and 6 as required deps, and capture missing deps in missing var.
# If missing is populated, bail out. Then load the optional deps
AS_IF([test x"$ax_app_enable" != "xyes"], [AC_MSG_RESULT([no (disabled)])],
[AX_LOAD_DEPS([$1], [$4], [missing]) dnl Load required deps
AS_IF([test -n "$missing"], [AC_MSG_RESULT([no ([missing] $missing)]); ax_app_enable=no],
[AX_LOAD_DEPS([$1], [$5]) dnl Load optional deps
APP_$1_CPPFLAGS="$PKG_$1_CPPFLAGS"
APP_$1_LIBS="$PKG_$1_LIBS"
AC_MSG_RESULT([yes])])])
# Set up the variables
APP_$1_LIBS=$ax_libs
PKG_$1_LIBS=$ax_libs
AC_MSG_RESULT([yes])
fi
AS_VAR_POPDEF([missing])
else
HAVE_PKG_$1_SRC=no
ax_app_enable=no
APP_$1_LIBS=
PKG_$1_LIBS=
APP_$1_CPPFLAGS=
PKG_$1_CPPFLAGS=
fi
AC_SUBST(APP_$1_CPPFLAGS)
AC_SUBST(PKG_$1_CPPFLAGS)
AC_SUBST(APP_$1_LIBS)
AC_SUBST(PKG_$1_LIBS)
HAVE_PKG_$1=${ax_app_enable}
MAKE_APP_$1=${ax_app_enable}
AC_SUBST(MAKE_APP_$1)
if test -n "$WANT_APP_$1"; then
if test x"$MAKE_APP_$1" != x"$WANT_APP_$1"; then
AC_MSG_ERROR([You said ENABLE_APP_]$1[=$WANT_APP_]$1[, but I decided $MAKE_APP_]$1)
fi
fi
if test "${HAVE_PKG_$1}" = "yes" ; then
ax_have_pkg_bool=1
else
Expand All @@ -76,12 +73,16 @@ AC_DEFUN([AX_APP],
[$ax_have_pkg_bool],
[Define to 1 if the $1 app is available.])
if test "$ENABLE_VERBOSE" = "yes" && test "$HAVE_PKG_$1_SRC" = "yes" ; then
AC_MSG_NOTICE(MAKE_APP_$1 = ${MAKE_APP_$1})
AC_MSG_NOTICE(HAVE_PKG_$1 = ${HAVE_PKG_$1})
AC_MSG_NOTICE(APP_$1_LIBS = ${APP_$1_LIBS})
AC_MSG_NOTICE(PKG_$1_LIBS = ${PKG_$1_LIBS})
if test "$HAVE_PKG_$1_SRC" = "yes" ; then
AX_LOG([MAKE_APP_]$1[ = $MAKE_APP_]$1)
AX_LOG([HAVE_PKG_]$1[ = $HAVE_PKG_]$1)
AX_LOG([APP_]$1[_CPPFLAGS = $APP_]$1[_CPPFLAGS])
AX_LOG([PKG_]$1[_CPPFLAGS = $PKG_]$1[_CPPFLAGS])
AX_LOG([APP_]$1[_LIBS = $APP_]$1[_LIBS])
AX_LOG([PKG_]$1[_LIBS = $PKG_]$1[_LIBS])
fi
AM_CONDITIONAL([MAKE_APP_$1], [test "$MAKE_APP_$1" = "yes"])
# We're putting these in configure.ac manually by now, for
# backwards compatability with older versions of automake.
# AM_CONDITIONAL([MAKE_APP_$1], [test "$MAKE_APP_$1" = "yes"])
])
20 changes: 20 additions & 0 deletions m4/ax_common_options.m4
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,31 @@ AC_DEFUN([AX_COMMON_OPTIONS], [
AX_ARG_ENABLE(exceptions, yes, [am-yes cpp-bool], [enable the C++ exception mechanism])
AX_ARG_ENABLE(debug, no, [none], [generate debugging symbols])
AX_ARG_ENABLE(optimize, 3, [none], [compiler optimization level])
AX_ARG_ENABLE(profile, no, [none], [generate profiling data])
AX_ARG_ENABLE(arch-libs, no, [none], [force /lib64 (=64) or /lib32 (=32) instead of /lib])
AX_ARG_ENABLE(proper-libs, yes, [none], [useful linker options])
AX_ARG_ENABLE(ccache, no, [none], [try to use ccache, if available])
AX_ARG_ENABLE(multi-arch, [], [none], [build multi-arch (universal) binaries])
##################################################
# Handle options
##################################################
# Pass apple gcc options to build a universal binary
for arch in $ENABLE_MULTI_ARCH; do
AX_CFLAGS="$AX_CFLAGS -arch $arch"
done
if test x"$ENABLE_CCACHE" = x"yes"; then
AC_CHECK_PROGS(CCACHE, ccache, false)
if test x"$CCACHE" != "xfalse"; then
CC="$CCACHE $CC"
CXX="$CCACHE $CXX"
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.
Expand Down Expand Up @@ -63,6 +79,10 @@ case "$ENABLE_OPTIMIZE" in
*) AC_MSG_ERROR([Unknown optimize option: "$ENABLE_OPTIMIZE"]) ;;
esac
if test x"$ENABLE_PROFILE" = "xyes"; then
AX_TRY_CPPFLAGS([-pg], [AX_CFLAGS="$AX_CFLAGS -pg"], [AC_MSG_ERROR([Cannot enable profiling: compiler doesn't seem to support it])])
fi
CFLAGS="$AX_CFLAGS $CFLAGS"
CXXFLAGS="$AX_CFLAGS $CXXFLAGS"
Expand Down
12 changes: 3 additions & 9 deletions m4/ax_find_files.m4
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,12 @@ AC_DEFUN([AX_FIND_FILES],
ax_find_files_passed=yes
for filename in $1; do
pathname="$path/$filename"
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_CHECKING([for ${pathname}])
fi
AX_LOG([Find Files: Looking for ${filename} in ${path}])
ax_find_files_paths=`ls $pathname 2>/dev/null`
if test ! -z "$ax_find_files_paths" ; then
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_RESULT([found])
fi
AX_LOG([Find Files: Found ${ax_find_files_paths}])
else
if test "$ENABLE_VERBOSE" = "yes"; then
AC_MSG_RESULT([not found])
fi
AX_LOG([Fine Files: Not Found])
ax_find_files_passed=no
break
fi
Expand Down
Loading

0 comments on commit 545de6e

Please sign in to comment.