URL:
https://svn.lrde.epita.fr/svn/oln/trunk
ChangeLog:
2007-12-04 Matthieu Garrigues <garrigues(a)lrde.epita.fr>
Improve support for the cfitsio library.
* build-aux/cfitsio.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.
This macro is used...
* configure.ac: ...here.
---
build-aux/cfitsio.m4 | 48 ++++++++++++++++++++++++++++++++++++++++++++++++
configure.ac | 4 ++++
2 files changed, 52 insertions(+)
Index: trunk/configure.ac
===================================================================
--- trunk/configure.ac (revision 1589)
+++ trunk/configure.ac (revision 1590)
@@ -54,6 +54,10 @@
OLN_WITH_FREEIMAGEPLUS
AM_CONDITIONAL([FREEIMAGEPLUS], [test x$oln_have_freeimageplus = xyes])
+# Cfitsio library.
+OLN_WITH_CFITSIO
+AM_CONDITIONAL([CFITSIO], [test x$oln_have_cfitsio = xyes])
+
## --------------- ##
## Configuration. ##
Index: trunk/build-aux/cfitsio.m4
===================================================================
--- trunk/build-aux/cfitsio.m4 (revision 0)
+++ trunk/build-aux/cfitsio.m4 (revision 1590)
@@ -0,0 +1,48 @@
+# -*- 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 FreeImage (DIR = prefix for FreeImage 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 FreeImage])
+ ]
+ )]
+ )
+ 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++])
+])