[go: up one dir, main page]

Menu

[r991]: / PluginHandler / configure.ac  Maximize  Restore  History

Download this file

262 lines (208 with data), 6.9 kB

dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)

# Making releases:
#   LIBMONAPH_MICRO_VERSION += 1;
#   LIBMONAPH_INTERFACE_AGE += 1;
#   LIBMONAPH_BINARY_AGE += 1;
# if any functions have been added, set LIBMONAPH_INTERFACE_AGE to 0.
# if backwards compatibility has been broken,
# set LIBMONAPH_BINARY_AGE and LIBMONAPH_INTERFACE_AGE to 0.

m4_define([mona_major_version], [0])
m4_define([mona_minor_version], [1])
m4_define([mona_micro_version], [0])
m4_define([mona_real_version],
          [mona_major_version.mona_minor_version.mona_micro_version])
m4_define([mona_version], [mona_real_version])
m4_define([mona_interface_age], [0])
m4_define([mona_binary_age], [0])

m4_define([mona_unstable],
          m4_if(m4_eval(mona_minor_version % 2), [1], [yes], [no]))
m4_define([mona_full_name], [The MONA library])

AC_INIT([mona], [mona_version], [gert@die.upm.es])
AC_CONFIG_SRCDIR([mona/core/defines.hh])

AM_INIT_AUTOMAKE(no-define)
AC_CONFIG_HEADER(config.h)

MONA_MAJOR_VERSION=mona_major_version
MONA_MINOR_VERSION=mona_minor_version
MONA_MICRO_VERSION=mona_micro_version
MONA_INTERFACE_AGE=mona_interface_age
MONA_BINARY_AGE=mona_binary_age
MONA_VERSION=mona_version
MONA_UNSTABLE=mona_unstable
AC_SUBST(MONA_MAJOR_VERSION)
AC_SUBST(MONA_MINOR_VERSION)
AC_SUBST(MONA_MICRO_VERSION)
AC_SUBST(MONA_INTERFACE_AGE)
AC_SUBST(MONA_BINARY_AGE)
AC_SUBST(MONA_VERSION)
AC_SUBST(MONA_UNSTABLE)

dnl The symbol MONA_UNSTABLE is defined above for substitution in
dnl Makefiles and conditionally defined here as a preprocessor symbol.
if test "x$MONA_UNSTABLE" = "xyes"; then
  AC_DEFINE(MONA_UNSTABLE,1,
            [Define to 1 if this is an unstable version of the mona])
fi

# libtool versioning
m4_define([lt_release], [mona_major_version.mona_minor_version])
m4_define([lt_current], [m4_eval(mona_micro_version - mona_interface_age)])
m4_define([lt_revision], [mona_interface_age])
m4_define([lt_age], [m4_eval(mona_binary_age - mona_interface_age)])
LT_RELEASE=lt_release
LT_CURRENT=lt_current
LT_REVISION=lt_revision
LT_AGE=lt_age
LT_VERSION_INFO="lt_current:lt_revision:lt_age"
LT_CURRENT_MINUS_AGE=m4_eval(lt_current - lt_age)
AC_SUBST(LT_RELEASE)
AC_SUBST(LT_CURRENT)
AC_SUBST(LT_REVISION)
AC_SUBST(LT_AGE)
AC_SUBST(LT_VERSION_INFO)


AC_DEFUN([MY_ARG_WITH],
         [AC_ARG_WITH([$1],
            [AS_HELP_STRING([--with-$1], [use $1 (default is $2)])],
             [use_[]$1=$withval],
             [use_[]$1=$2])])
     

MY_ARG_WITH(exr, yes)
MY_ARG_WITH(png, yes)
MY_ARG_WITH(tiff, yes)

dnl Initialize maintainer mode
AM_MAINTAINER_MODE

# some generic stuff
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET


AC_SUBST(define_DEBUG_OUTPUT)

# appreciate aclocal flags
ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS"

dnl Initialize CC
AC_PROG_CC
AM_PROG_CC_STDC

dnl Initialize CXX
AC_PROG_CXX

dnl Initialize libtool
AC_PROG_LIBTOOL

# Checks for system header files.
AC_HEADER_DIRENT
AC_HEADER_STDC

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_C_BIGENDIAN

# Check for doxygen
AC_CHECK_PROG(have_doxygen,doxygen,"yes","no")
if test "x$have_doxygen" = "xyes"; then
    AC_CHECK_PROG(HAVE_DOT,dot,"YES","NO")	
    AC_SUBST(HAVE_DOT)
else
    AC_MSG_ERROR([
    *** Doxygen is not installesd on your computer, though it is 
    ***	required to build the documentation of this package. 
    *** The latest version of doxygen is always available from 
    *** http://www.doxygen.org])
fi


PKG_CHECK_MODULES(GMODULE, "gmodule-2.0",, exit); 
CXXFLAGS="$CXXFLAGS $GMODULE_CFLAGS"
ACX_POPT_CONST


# Check for libpopt
AC_CHECK_HEADERS(popt.h)
SAVE_LIBS="$LIBS"
AC_CHECK_LIB(popt, poptGetContext,
	POPT_LIB="-lpopt"; LIBS="$LIBS -lpopt",
	POPT_LIB=""; AC_MSG_ERROR([popt library not found]))
AC_SUBST(POPT_LIB)
ACX_POPT_CONST
LIBS="$SAVE_LIBS"


if test "x$use_exr" = xyes ; then  
	PKG_CHECK_MODULES(EXR, OpenEXR >= 1.2.0 ,	[
		build_exrio_plugins=yes
		AC_DEFINE(HAVE_OPENEXR, 1, define if the OpenEXR library is available)
	],AC_ERROR(exr library not found))
	AC_SUBST(EXR_LIBS)
	AC_SUBST(EXR_CFLAGS)
	AM_CONDITIONAL(BUILD_EXRIO_PLUGINS, test x$build_exrio_plugins = xyes)
fi 

if test "x$use_png" = xyes ; then  
	PKG_CHECK_MODULES(PNG, libpng >= 1.2.0 ,	[
		build_pngio_plugins=yes
		AC_DEFINE(HAVE_PNG, 1, define if the libpng library is available)
	],AC_ERROR(png library not found))
	AM_CONDITIONAL(BUILD_PNGIO_PLUGINS, test x$build_pngio_plugins = xyes)
fi 

if test "x$use_tiff" = xyes ; then  
	#check for io plugin libraries
	AC_CHECK_LIB(tiff, TIFFOpen,[
		TIFF_LIB="-ltiff -lm"
		AC_SUBST(TIFF_LIB)
		build_tiffio_plugins=yes
	], [AC_ERROR(tiff library not found)], -lm)
	AC_CHECK_HEADER(tiffio.h,,[AC_ERROR(tiff header file  not found)])
	
	AM_CONDITIONAL(BUILD_TIFFIO_PLUGINS, test x$build_tiffio_plugins = xyes)
fi

dnl Checks some more functions.
AC_LANG(C++)

dnl check some boost functionality

AX_BOOST_BASE([1.33])
CXXFLAGS="$CXXFLAGS $BOOST_CPPFLAGS"

AX_BOOST_THREAD
AX_BOOST_FILESYSTEM
AX_BOOST_REGEX

LIBS="$LIBS $BOOST_LDFLAGS"

BOOST_LIBS="$BOOST_LDFLAGS $BOOST_THREAD_LIB $BOOST_FILESYSTEM_LIB $BOOST_REGEX_LIB"
AC_SUBST(BOOST_LIBS)

dnl Set PACKAGE PREFIX
if test "x${prefix}" = "xNONE"; then
	packageprefix=${ac_default_prefix}
else
	packageprefix=${prefix}
fi

dnl set the standard flags for this library
mona_cflags="-I$prefix/include/mona-${LT_RELEASE}"
mona_libs="-L$prefix/lib -lmonacore $GMODULE_LIBS $BOOST_LIBS $POPT_LIB"

AC_SUBST(mona_cflags)
AC_SUBST(mona_libs)


PLUGIN_SEARCH_P=${prefix}/lib/$PACKAGE_NAME/$PACKAGE_VERSION/plugins
PLUGIN_SEARCH_PATH=`echo $PLUGIN_SEARCH_P | sed -e "s/\/\/*/\//g"` 

PLUGIN_HOME_SEARCH_PATH=".$PACKAGE_NAME/plugins"

AC_DEFINE_UNQUOTED(PLUGIN_SEARCH_PATH, "$PLUGIN_SEARCH_PATH", [Package plugin search path])
AC_DEFINE_UNQUOTED(PLUGIN_HOME_SEARCH_PATH, "$PLUGIN_HOME_SEARCH_PATH", [Package plugin search path in home directory])
AC_SUBST(PLUGIN_SEARCH_PATH)


AC_CONFIG_FILES([Makefile
		 monacore.pc
		 mona3d.pc
		 mona.pc
                 mona/Makefile
		 mona/2d/Makefile
		 mona/3d/Makefile
		 mona/core/Makefile
		 plugins/Makefile
		 plugins/test/Makefile
		 plugins/io/Makefile
		 plugins/io/test/Makefile
		 plugins/io/2dimage/Makefile
		 plugins/io/2dvf/Makefile
		 plugins/io/3dimage/Makefile
		 plugins/io/3dvf/Makefile
		 plugins/filter/Makefile
		 plugins/filter/2d/Makefile
		 plugins/filter/3d/Makefile
		 plugins/kernel/Makefile
		 plugins/kernel/spacial/Makefile
		 plugins/combiner/Makefile
		 plugins/combiner/2dimage/Makefile
		 plugins/cost/Makefile
		 plugins/cost/2dimage/Makefile
		 src/Makefile
		 doc/Makefile
		 doc/version.tex	
		 doc/reference.dox
	])
AC_OUTPUT

echo "================================="

echo "Build 2D IO Plugins:"

echo "    exr......$build_exrio_plugins"
echo "    png......$build_pngio_plugins"
echo "    tiff.....$build_tiffio_plugins"

echo "================================="