Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

374 lines (310 sloc) 14.282 kb
# __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 Vision Workbench], [2.0.alpha1], [vision-workbench@lists.nasa.gov], [VisionWorkbench])
AC_CONFIG_AUX_DIR(config)
AC_CANONICAL_HOST
AM_INIT_AUTOMAKE
AX_CONFIG_HEADER_PREFIX([src/vw/config.h], [VW_])
LIBTOOL_CURRENT=1
LIBTOOL_REVISION=0
LIBTOOL_AGE=0
LIBTOOL_VERSION=$LIBTOOL_CURRENT:$LIBTOOL_REVISION:$LIBTOOL_AGE
AC_SUBST(LIBTOOL_VERSION)
##################################################
# configuration options
##################################################
# This should be first, so everything else can use it
AC_ARG_ENABLE(verbose,
AC_HELP_STRING([--enable-verbose], [verbose configuration output @<:@no@:>@]),
[ ENABLE_VERBOSE=$enableval ],
[ if test -z $"ENABLE_VERBOSE"; then ENABLE_VERBOSE=no; fi ]
)
if test -f config.options; then
if test "yes" = "$ENABLE_VERBOSE" ; then
AC_MSG_NOTICE([sourcing config.options])
cat config.options
fi
source config.options
fi
AC_ARG_WITH(paths,
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
##################################################
CPPFLAGS="$CPPFLAGS -I\${top_srcdir}/src"
AC_ARG_ENABLE(debug,
AC_HELP_STRING([--enable-debug], [generate debugging symbols @<:@no@:>@]),
[ ENABLE_DEBUG=$enableval ],
[ if test -z "$ENABLE_DEBUG"; then ENABLE_DEBUG=no; fi ]
)
if test "yes" = "$ENABLE_DEBUG"; then
AX_CFLAGS="$AX_CFLAGS -g -DDEBUG"
else
AX_CFLAGS="$AX_CFLAGS -DNDEBUG"
fi
AC_ARG_ENABLE(optimize,
AC_HELP_STRING([--enable-optimize@<:@=LEVEL@:>@], [compiler optimization level @<:@yes@:>@]),
[ ENABLE_OPTIMIZE=$enableval ],
[ if test -z "$ENABLE_OPTIMIZE"; then ENABLE_OPTIMIZE=yes; fi ]
)
if test "yes" = "$ENABLE_OPTIMIZE" || test "3" = "$ENABLE_OPTIMIZE"; then
AX_CFLAGS="$AX_CFLAGS -O3"
elif test "2" = "$ENABLE_OPTIMIZE"; then
AX_CFLAGS="$AX_CFLAGS -O2"
elif test "1" = "$ENABLE_OPTIMIZE"; then
AX_CFLAGS="$AX_CFLAGS -O1"
elif test "coreduo" = "$ENABLE_OPTIMIZE"; then
AX_CFLAGS="$AX_CFLAGS -O4 -march=prescott -mtune=prescott -funroll-loops -msse -msse2 -msse3 -mfpmath=sse"
elif test "sse3" = "$ENABLE_OPTIMIZE"; then
AX_CFLAGS="$AX_CFLAGS -O4 -funroll-loops -msse -msse2 -msse3 -mfpmath=sse"
else
echo 'WARNING: *** The Vision Workbench may not work properly with optimization disabled! ***'
AX_CFLAGS="$AX_CFLAGS -O0"
fi
CFLAGS="$CFLAGS $AX_CFLAGS"
CXXFLAGS="$CXXFLAGS $AX_CFLAGS"
AC_ARG_ENABLE(exceptions,
AC_HELP_STRING([--enable-exceptions@<:@=yes@:>@], [enable the C++ exception mechanism]),
[ ENABLE_EXCEPTIONS=$enableval ],
[ if test -z "$ENABLE_EXCEPTIONS"; then ENABLE_EXCEPTIONS=yes; fi ]
)
if test "$ENABLE_EXCEPTIONS" = "yes"; then
no_exceptions=0
else
no_exceptions=1
fi
AM_CONDITIONAL(ENABLE_EXCEPTIONS, [test "$ENABLE_EXCEPTIONS" = "yes"])
AC_DEFINE_UNQUOTED(NO_EXCEPTIONS,
[$no_exceptions],
[Define to 1 to disable C++ exceptions.])
# We set up the include paths ourselves, so
# we ask autoconf to get out of the way.
DEFAULT_INCLUDES=
AC_SUBST(DEFAULT_INCLUDES)
##################################################
# installation options
##################################################
if test ${prefix} = NONE; then
if test ! -z ${PREFIX} ; then
prefix=${PREFIX}
AC_MSG_NOTICE([using installation prefix ${prefix}])
fi
fi
##################################################
# distribution options
##################################################
AC_ARG_WITH(dist-license,
AC_HELP_STRING([--with-dist-license=LICENSE], [special distribution license file to be included as the COPYING file in the distribution]),
[DIST_LICENSE=$withval]
)
AC_SUBST(DIST_LICENSE)
AM_CONDITIONAL(DIST_LICENSE, [test ! -z "$DIST_LICENSE"])
if test ! -z "$DIST_LICENSE" ; then
AC_MSG_NOTICE([using distribution license file $DIST_LICENSE])
fi
AC_ARG_WITH(dist-license-summary,
AC_HELP_STRING([--with-dist-license-summary=SUMMARY], [special distribution license summary file to be included in the headers of source files in the distribution]),
[DIST_LICENSE_SUMMARY=$withval]
)
AC_SUBST(DIST_LICENSE_SUMMARY)
AM_CONDITIONAL(DIST_LICENSE_SUMMARY, [test ! -z "$DIST_LICENSE_SUMMARY"])
if test ! -z "$DIST_LICENSE_SUMMARY" ; then
AC_MSG_NOTICE([using distribution license summary file $DIST_LICENSE_SUMMARY])
fi
AC_ARG_WITH(dist-config-options-default,
AC_HELP_STRING([--with-dist-config-options-default@<:@=FILE@:>@], [special distribution config.options.default file]),
[DIST_CONFIG_OPTIONS_DEFAULT=$withval]
)
AC_SUBST(DIST_CONFIG_OPTIONS_DEFAULT)
AM_CONDITIONAL(DIST_CONFIG_OPTIONS_DEFAULT, [test ! -z "$DIST_CONFIG_OPTIONS_DEFAULT"])
if test ! -z "$DIST_CONFIG_OPTIONS_DEFAULT" ; then
if test "yes" = "$DIST_CONFIG_OPTIONS_DEFAULT" ; then
DIST_CONFIG_OPTIONS_DEFAULT="config/config.options.default"
fi
AC_MSG_NOTICE([using distribution config.options.default file: $DIST_CONFIG_OPTIONS_DEFAULT])
fi
AC_ARG_WITH(dist-remove-modules,
AC_HELP_STRING([--with-dist-remove-modules="MODULE @<:@MODULE...@:>@"], [remove certain modules from the distribution]),
[DIST_REMOVE_MODULES=$withval], [DIST_REMOVE_MODULES="Geometry InterestPoint Python"]
)
AC_SUBST(DIST_REMOVE_MODULES)
AM_CONDITIONAL(DIST_REMOVE_MODULES, [test ! -z "$DIST_REMOVE_MODULES"])
##################################################
# 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
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
##################################################
# Make sure these are set so AC_PROG_CC doesn't initialize them with
# its defaults, since we take care of setting debug and optimization
# levels ourselves.
CFLAGS="$CFLAGS"
CXXFLAGS="$CXXFLAGS"
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AX_PROG_AR
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
if test "yes" = "$ENABLE_VERBOSE"; then
AC_MSG_NOTICE([using PKG_PATHS=$PKG_PATHS])
fi
AX_PKG_PTHREADS
AX_PKG_BOOST
AX_PKG_BOOST_LIB(PROGRAM_OPTIONS, [-lboost_program_options], [boost/program_options.hpp])
AX_PKG_BOOST_LIB(FILESYSTEM, [-lboost_filesystem], [boost/filesystem/path.hpp])
AX_PKG_BOOST_LIB(THREAD, [-lboost_thread], [boost/thread/thread.hpp])
# 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_LAPACK
AX_PKG(QHULL, [], [-lqhull], [qhull/qhull.h])
AX_PKG(GMP, [], [-lgmpxx -lgmp], [gmpxx.h gmp.h])
AX_PKG(MPFR, [], [-lmpfr], [mpfr.h])
AX_PKG(PPL, [GMP], [-lppl], [ppl.hh])
AX_PKG(APRON, [GMP MPFR], [-lpolkag -lapron -litvmpq -litvdbl], [ap_global0.h ap_global1.h pk.h])
AX_PKG(M, [], [-lm], [math.h])
AX_PKG(Z, [], [-lz], [zlib.h])
AX_PKG(PNG, [], [-lpng], [png.h])
AX_PKG(JPEG, [], [-ljpeg], [stdio.h jpeglib.h]) # jpeglib.h requires stdio.h to have been included
AX_PKG(TIFF, [], [-ltiff], [tiff.h])
AX_PKG(OPENEXR, [Z PTHREADS], [-lImath -lHalf -lIex -lIlmImf], [ImfOutputFile.h], [OpenEXR])
AX_PKG(HDF, [], [-ldf -lmfhdf], [mfhdf.h])
AX_PKG(X11, [], [-lXext -lX11 -lXmu -lXi -lXt], [])
AX_PKG(GL, [X11], [-lGL -lGLU], [GL/gl.h GL/glu.h])
AX_PKG(GLUT, [X11 GL], [-lglut], [GL/glut.h])
AX_PKG(GLEW, [GL M], [-lGLEW], [GL/glew.h])
AX_PKG(CG, [], [-lCg -lCgGL], [Cg/cg.h])
AX_PKG(GDAL, [], [-lgdal], [gdal.h])
AX_PKG(PROJ4, [], [-lproj], [projects.h])
# These are here (instead of inside the PKG macro where they belong)
# for backwards compatability with older versions of automake.
AM_CONDITIONAL(HAVE_PKG_LAPACK, [test "$HAVE_PKG_LAPACK" = "yes"])
AM_CONDITIONAL(HAVE_PKG_QHULL, [test "$HAVE_PKG_QHULL" = "yes"])
AM_CONDITIONAL(HAVE_PKG_GMP, [test "$HAVE_PKG_GMP" = "yes"])
AM_CONDITIONAL(HAVE_PKG_MPFR, [test "$HAVE_PKG_MPFR" = "yes"])
AM_CONDITIONAL(HAVE_PKG_PPL, [test "$HAVE_PKG_PPL" = "yes"])
AM_CONDITIONAL(HAVE_PKG_APRON, [test "$HAVE_PKG_APRON" = "yes"])
AM_CONDITIONAL(HAVE_PKG_PNG, [test "$HAVE_PKG_PNG" = "yes"])
AM_CONDITIONAL(HAVE_PKG_JPEG, [test "$HAVE_PKG_JPEG" = "yes"])
AM_CONDITIONAL(HAVE_PKG_TIFF, [test "$HAVE_PKG_TIFF" = "yes"])
AM_CONDITIONAL(HAVE_PKG_OPENEXR, [test "$HAVE_PKG_OPENEXR" = "yes"])
AM_CONDITIONAL(HAVE_PKG_HDF, [test "$HAVE_PKG_HDF" = "yes"])
AM_CONDITIONAL(HAVE_PKG_GDAL, [test "$HAVE_PKG_GDAL" = "yes"])
##################################################
# module definitions
##################################################
AX_MODULE(CORE, [src/vw/Core], [libvwCore.la], yes, [], [BOOST THREADS M], [PTHREADS])
AX_MODULE(MATH, [src/vw/Math], [libvwMath.la], yes, [CORE], [], [LAPACK])
AX_MODULE(IMAGE, [src/vw/Image], [libvwImage.la], yes, [MATH])
AX_MODULE(FILEIO, [src/vw/FileIO], [libvwFileIO.la], yes, [IMAGE], [], [Z PNG JPEG TIFF OPENEXR HDF GDAL])
AX_MODULE(VW, [src/vw], [libvw.la], yes, [], [CORE MATH IMAGE], [FILEIO])
if test ${MAKE_MODULE_VW} != "yes"; then
AC_MSG_ERROR([cannot build the Vision Workbench core modules!])
fi
AX_MODULE(CAMERA, [src/vw/Camera], [libvwCamera.la], yes, [VW])
AX_MODULE(MOSAIC, [src/vw/Mosaic], [libvwMosaic.la], yes, [VW])
AX_MODULE(INTERESTPOINT, [src/vw/InterestPoint], [libvwInterestPoint.la], yes, [VW])
AX_MODULE(CARTOGRAPHY, [src/vw/Cartography], [libvwCartography.la], yes, [VW], [PROJ4], [GDAL])
AX_MODULE(HDR, [src/vw/HDR], [libvwHDR.la], yes, [VW], [CAMERA LAPACK])
AX_MODULE(STEREO, [src/vw/Stereo], [libvwStereo.la], yes, [VW], [])
if test $host_vendor = apple; then
AX_MODULE(GPU, [src/vw/GPU], [libvwGPU.la], yes, [VW], [GL GLU GLUT], [CG])
else
AX_MODULE(GPU, [src/vw/GPU], [libvwGPU.la], yes, [VW], [GL GLU GLUT GLEW], [CG])
fi
AX_MODULE(GEOMETRY, [src/vw/Geometry], [libvwGeometry.la], yes, [VW], [], [GMP PPL APRON QHULL])
# These are here (instead of inside the MODULE macro where they belong)
# for backwards compatability with older versions of automake.
AM_CONDITIONAL(MAKE_MODULE_CORE, [test "$MAKE_MODULE_CORE" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_MATH, [test "$MAKE_MODULE_MATH" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_IMAGE, [test "$MAKE_MODULE_IMAGE" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_FILEIO, [test "$MAKE_MODULE_FILEIO" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_VW, [test "$MAKE_MODULE_VW" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_CAMERA, [test "$MAKE_MODULE_CAMERA" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_MOSAIC, [test "$MAKE_MODULE_MOSAIC" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_INTERESTPOINT, [test "$MAKE_MODULE_INTERESTPOINT" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_CARTOGRAPHY, [test "$MAKE_MODULE_CARTOGRAPHY" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_HDR, [test "$MAKE_MODULE_HDR" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_STEREO, [test "$MAKE_MODULE_STEREO" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_GPU, [test "$MAKE_MODULE_GPU" = "yes"])
AM_CONDITIONAL(MAKE_MODULE_GEOMETRY, [test "$MAKE_MODULE_GEOMETRY" = "yes"])
##################################################
# final processing
##################################################
if test "yes" = "$ENABLE_VERBOSE" ; then
AC_MSG_NOTICE([using CPPFLAGS=$CPPFLAGS $VW_CPPFLAGS])
AC_MSG_NOTICE([using CFLAGS=$CFLAGS])
AC_MSG_NOTICE([using CXXFLAGS=$CXXFLAGS])
AC_MSG_NOTICE([using LDFLAGS=$LDFLAGS $VW_LDFLAGS])
AC_MSG_NOTICE([using VW_NO_EXCEPTIONS=$no_exceptions])
fi
AC_SUBST(VW_CPPFLAGS)
AC_SUBST(VW_LDFLAGS)
##################################################
# makefiles to process
##################################################
AC_CONFIG_FILES([ \
Makefile \
src/Makefile \
src/vw/Makefile \
src/vw/tests/Makefile \
src/vw/tools/Makefile \
src/vw/Core/Makefile \
src/vw/Core/tests/Makefile \
src/vw/Math/Makefile \
src/vw/Math/tests/Makefile \
src/vw/Image/Makefile \
src/vw/Image/tests/Makefile \
src/vw/FileIO/Makefile \
src/vw/FileIO/tests/Makefile \
src/vw/Camera/Makefile \
src/vw/Camera/tests/Makefile \
src/vw/Mosaic/Makefile \
src/vw/Mosaic/tests/Makefile \
src/vw/Cartography/Makefile \
src/vw/Cartography/tests/Makefile \
src/vw/HDR/Makefile \
src/vw/HDR/tests/Makefile \
src/vw/Stereo/Makefile \
src/vw/Stereo/tests/Makefile \
src/vw/GPU/Makefile \
src/vw/GPU/tests/Makefile \
src/vw/InterestPoint/Makefile \
src/vw/InterestPoint/tests/Makefile \
src/vw/Geometry/Makefile \
src/vw/Geometry/tests/Makefile \
Python/Makefile \
])
AC_OUTPUT
Jump to Line
Something went wrong with that request. Please try again.