Commit b8739e10 authored by Roland Levillain's avatar Roland Levillain
Browse files

Improve support for the FreeImagePlus library.

	* build-aux/freeimageplus.m4: New.
	Provide the Autoconf macro OLN_WITH_FREEIMAGEPLUS.
	Inspired by Olena 0.11's macros AC_WITH_CXX_ZLIB and
	AC_WITH_CXX_FFTW.
	Use this macro...
	* configure.ac: ...here, instead of the previous ad hoc solution.
	Rename the Automake conditional FREE_IMAGE_PLUS as FREEIMAGEPLUS,
	and adjust it.
	* Makefile.am (ACLOCAL_AMFLAGS): New.
	Set it to `-I build-aux' to have aclocal visit
	build-aux/freeimageplus.m4.


git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@1409 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent a81b812a
2007-10-30 Roland Levillain <roland@lrde.epita.fr>
Improve support for the FreeImagePlus library.
* build-aux/freeimageplus.m4: New.
Provide the Autoconf macro OLN_WITH_FREEIMAGEPLUS.
Inspired by Olena 0.11's macros AC_WITH_CXX_ZLIB and
AC_WITH_CXX_FFTW.
Use this macro...
* configure.ac: ...here, instead of the previous ad hoc solution.
Rename the Automake conditional FREE_IMAGE_PLUS as FREEIMAGEPLUS,
and adjust it.
* Makefile.am (ACLOCAL_AMFLAGS): New.
Set it to `-I build-aux' to have aclocal visit
build-aux/freeimageplus.m4.
2007-10-22 Roland Levillain <roland@lrde.epita.fr>
Add support for the FreeImage library.
......
## Process this file through Automake to produce Makefile.in -*- Makefile -*-
ACLOCAL_AMFLAGS = -I build-aux
SUBDIRS = build-aux metalic extended static milena olena dynamic
# -*- Autoconf -*-
# OLN_WITH_FREEIMAGEPLUS
# ----------------------
# Checks whether the FreeImagePlus library is available from C++
# programs.
#
# This macro sets FREEIMAGEPLUS_CXXFLAGS and FREEIMAGEPLUS_LDFLAGS if
# the library is found and its functions available from C++.
AC_DEFUN([OLN_WITH_FREEIMAGEPLUS],
[dnl
AC_REQUIRE([AC_PROG_CXX])
AC_LANG_PUSH([C++])
AC_ARG_WITH([freeimageplus],
[AC_HELP_STRING([--with-freeimageplus@<:@=DIR@:>@],
[using FreeImage (DIR = prefix for FreeImage installation)])])
FREEIMAGEPLUS_CXXFLAGS=''
FREEIMAGEPLUS_LDFLAGS=''
if test "x$with_freeimageplus" != xno; then
if test -n "$with_freeimageplus"; then
FREEIMAGEPLUS_CXXFLAGS="-I${with_freeimageplus}/include"
FREEIMAGEPLUS_LDFLAGS="-L${with_freeimageplus}/lib"
fi
oln_save_CXXFLAGS=$CXXFLAGS
oln_save_LDFLAGS=$LDFLAGS
CXXFLAGS="$CXXFLAGS $FREEIMAGEPLUS_CXXFLAGS"
LDFLAGS="$LDFLAGS $FREEIMAGEPLUS_LDFLAGS"
oln_have_freeimageplus=no
AC_CHECK_HEADER([FreeImagePlus.h],
[AC_CHECK_LIB([freeimageplus],
[main],
[oln_have_freeimageplus=yes
FREEIMAGEPLUS_LDFLAGS="$FREEIMAGEPLUS_LDFLAGS -lfreeimageplus"
AC_DEFINE([HAVE_FREEIMAGEPLUS], 1,
[Define to 1 if we can use FreeImage])
]
)]
)
CXXFLAGS=$oln_save_CXXFLAGS
LDFLAGS=$oln_save_LDFLAGS
TOOLS_LDFLAGS="$TOOLS_LDFLAGS $FREEIMAGEPLUS_LDFLAGS"
fi
AC_SUBST([FREEIMAGEPLUS_CXXFLAGS])
AC_SUBST([FREEIMAGEPLUS_LDFLAGS])
AC_LANG_POP([C++])
])
......@@ -59,9 +59,8 @@ AC_CHECK_PROGS([CONCEPTCXX], [conceptg++ conceptc++])
## -------------- ##
# FreeImage library.
AC_CHECK_HEADERS([FreeImagePlus.h],
[AM_CONDITIONAL([FREE_IMAGE_PLUS], [true])])
AC_CHECK_LIB([freeimageplus], [main])
OLN_WITH_FREEIMAGEPLUS
AM_CONDITIONAL([FREEIMAGEPLUS], [test x$oln_have_freeimageplus = xyes])
## ------- ##
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment