* m4/cfitsio.m4, m4/freeimageplus.m4: Remove.
* configure: Use OLN_WITH_LIB instead of OLN_WITH_FREEIMAGEPLUS
and OLN_WITH_CFITSIO.
---
ChangeLog | 8 ++++++++
configure.ac | 6 ++----
m4/cfitsio.m4 | 48 ------------------------------------------------
m4/freeimageplus.m4 | 48 ------------------------------------------------
4 files changed, 10 insertions(+), 100 deletions(-)
delete mode 100644 m4/cfitsio.m4
delete mode 100644 m4/freeimageplus.m4
diff --git a/ChangeLog b/ChangeLog
index 46cd626..7b81428 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,13 @@
2009-06-03 Roland Levillain <roland(a)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(a)lrde.epita.fr>
+
Add an Automake macro OLN_WITH_LIB to factor common code.
* m4/oln-with-lib.m4: New.
diff --git a/configure.ac b/configure.ac
index 3480481..071aff6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -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])
## ---------------------------- ##
diff --git a/m4/cfitsio.m4 b/m4/cfitsio.m4
deleted file mode 100644
index 0660968..0000000
--- a/m4/cfitsio.m4
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*- 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++])
-])
diff --git a/m4/freeimageplus.m4 b/m4/freeimageplus.m4
deleted file mode 100644
index 660b77b..0000000
--- a/m4/freeimageplus.m4
+++ /dev/null
@@ -1,48 +0,0 @@
-# -*- 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++])
-])
--
1.6.1.2