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

Factor M4 code using OLN_WITH_LIB.

	* m4/cfitsio.m4, m4/freeimageplus.m4: Remove.
	* configure: Use OLN_WITH_LIB instead of OLN_WITH_FREEIMAGEPLUS
	and OLN_WITH_CFITSIO.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@3967 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent 22dc893e
2009-06-03 Roland Levillain <roland@lrde.epita.fr>
Factor M4 code using OLN_WITH_LIB.
* m4/cfitsio.m4, m4/freeimageplus.m4: Remove.
* configure: Use OLN_WITH_LIB instead of OLN_WITH_FREEIMAGEPLUS
and OLN_WITH_CFITSIO.
2009-06-02 Roland Levillain <roland@lrde.epita.fr>
Add an Automake macro OLN_WITH_LIB to factor common code.
* m4/oln-with-lib.m4: New.
......
......@@ -131,12 +131,10 @@ AM_CONDITIONAL([DARWIN], [echo "$host_os" | grep '^darwin'])
## -------------------- ##
### Support for FreeImagePlus has been disabled for Olena 1.0.
## OLN_WITH_FREEIMAGEPLUS
## AM_CONDITIONAL([HAVE_FREEIMAGEPLUS], [test x$oln_have_freeimageplus = xyes])
## OLN_WITH_LIB([FreeImagePlus], [FreeImagePlus.h], [freeimageplus])
# CFITSIO library.
OLN_WITH_CFITSIO
AM_CONDITIONAL([HAVE_CFITSIO], [test x$oln_have_cfitsio = xyes])
OLN_WITH_LIB([CFITSIO], [fitsio.h], [cfitsio])
## ---------------------------- ##
......
# -*- Autoconf -*-
# OLN_WITH_CFITSIO
# ----------------------
# Checks whether the CFITSIO library is available from C++
# programs.
#
# This macro sets CFITSIO_CXXFLAGS and CFITSIO_LDFLAGS if
# the library is found and its functions available from C++.
AC_DEFUN([OLN_WITH_CFITSIO],
[dnl
AC_REQUIRE([AC_PROG_CXX])
AC_LANG_PUSH([C++])
AC_ARG_WITH([cfitsio],
[AC_HELP_STRING([--with-cfitsio@<:@=DIR@:>@],
[using CFITSIO (DIR = prefix for CFITSIO installation)])])
CFITSIO_CXXFLAGS=''
CFITSIO_LDFLAGS=''
if test "x$with_cfitsio" != xno; then
if test -n "$with_cfitsio"; then
CFITSIO_CXXFLAGS="-I${with_cfitsio}/include"
CFITSIO_LDFLAGS="-L${with_cfitsio}/lib"
fi
oln_save_CXXFLAGS=$CXXFLAGS
oln_save_LDFLAGS=$LDFLAGS
CXXFLAGS="$CXXFLAGS $CFITSIO_CXXFLAGS"
LDFLAGS="$LDFLAGS $CFITSIO_LDFLAGS"
oln_have_cfitsio=no
AC_CHECK_HEADER([fitsio.h],
[AC_CHECK_LIB([cfitsio],
[main],
[oln_have_cfitsio=yes
CFITSIO_LDFLAGS="$CFITSIO_LDFLAGS -lcfitsio"
AC_DEFINE([HAVE_CFITSIO], 1,
[Define to 1 if we can use CFITSIO])
]
)]
)
CXXFLAGS=$oln_save_CXXFLAGS
LDFLAGS=$oln_save_LDFLAGS
TOOLS_LDFLAGS="$TOOLS_LDFLAGS $CFITSIO_LDFLAGS"
fi
AC_SUBST([CFITSIO_CXXFLAGS])
AC_SUBST([CFITSIO_LDFLAGS])
AC_LANG_POP([C++])
])
# -*- 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 FreeImagePlus (DIR = prefix for FreeImagePlus 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++])
])
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