[SCM] ESO library for automated astronomical data-reduction branch, master, updated. upstream/5.3.1-17-ge465d0d

Ole Streicher debian at liska.ath.cx
Tue Mar 20 15:29:36 UTC 2012


The following commit has been merged in the master branch:
commit 1e06303e84cb1e0e57f0f282d0247711257ad6e3
Author: Ole Streicher <debian at liska.ath.cx>
Date:   Tue Mar 20 15:52:01 2012 +0100

    Adjust patches for release 6.0

diff --git a/debian/patches/build-cpljava.patch b/debian/patches/build-cpljava.patch
index 54fcc62..6421480 100644
--- a/debian/patches/build-cpljava.patch
+++ b/debian/patches/build-cpljava.patch
@@ -4,7 +4,7 @@ Description: Allow building that JNI interface without having Gasgano
  is non-free. 
 --- a/acinclude.m4
 +++ b/acinclude.m4
-@@ -625,7 +625,6 @@
+@@ -620,7 +620,6 @@ AC_DEFUN([CPL_ENABLE_GASGANO],
  [
  
      AC_REQUIRE([CPL_PATH_JAVA])
@@ -12,7 +12,7 @@ Description: Allow building that JNI interface without having Gasgano
  
      AC_ARG_ENABLE(gasgano,
                    AC_HELP_STRING([--enable-gasgano],
-@@ -639,7 +638,7 @@
+@@ -634,7 +633,7 @@ AC_DEFUN([CPL_ENABLE_GASGANO],
          cpl_gasgano_support="no"
          AC_MSG_RESULT([no])
      else
@@ -23,7 +23,7 @@ Description: Allow building that JNI interface without having Gasgano
          else
 --- a/cpljava/Makefile.am
 +++ b/cpljava/Makefile.am
-@@ -31,26 +31,10 @@
+@@ -31,26 +31,10 @@ endif
  
  INCLUDES = $(CPLCORE_INCLUDES) $(CPLUI_INCLUDES) $(CPLDFS_INCLUDES) $(CX_INCLUDES) $(JAVA_INCLUDES) $(INCLTDL)
  
@@ -41,9 +41,9 @@ Description: Allow building that JNI interface without having Gasgano
 -
  libcplgasgano_la_SOURCES = cpl_gasgano.c
  
- libcplgasgano_la_LDFLAGS = $(GASGANO_SHREXT) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
+ libcplgasgano_la_LDFLAGS = $(CX_LDFLAGS) $(GASGANO_SHREXT) -version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
  libcplgasgano_la_LIBADD =  $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLCORE) $(LIBCEXT) $(LIBLTDL)
- libcplgasgano_la_DEPENDENCIES = $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLCORE) $(LIBCEXT) $(LIBLTDL)
+ libcplgasgano_la_DEPENDENCIES = $(LIBCPLDFS) $(LIBCPLUI) $(LIBCPLCORE) $(LIBLTDL)
 -
 -
 -$(GASGANO_NATIVE_INCLUDES):
diff --git a/debian/patches/check_for_TIOCGWINSZ.patch b/debian/patches/check_for_TIOCGWINSZ.patch
deleted file mode 100644
index a86ff9b..0000000
--- a/debian/patches/check_for_TIOCGWINSZ.patch
+++ /dev/null
@@ -1,27 +0,0 @@
-Author: Ole Streicher <debian at liska.ath.cx>
-Description: On kfreebsd and hurd, TIOCGWINSZ requires sys/ioctl.h. This patch
- adds a autoconf check for that case.
-Forwarded: <mailto:cpl-help at eso.org>
---- a/configure.ac
-+++ b/configure.ac
-@@ -83,6 +83,7 @@
- AC_CHECK_HEADERS([fcntl.h stdlib.h string.h stropts.h sys/ioctl.h termios.h \
-                   sys/times.h sys/time.h omp.h \
-                   termio.h unistd.h])
-+AC_HEADER_TIOCGWINSZ
- 
- # Checks for typedefs, structures, and compiler characteristics.
- AC_C_CONST
---- a/cplcore/cpl_msg.c
-+++ b/cplcore/cpl_msg.c
-@@ -46,6 +46,10 @@
- #  endif
- #endif
- 
-+#ifdef GWINSZ_IN_SYS_IOCTL
-+# include <sys/ioctl.h>
-+#endif
-+
- #include <signal.h>
- 
- #ifdef HAVE_STROPTS_H
diff --git a/debian/patches/disable-stat-tests.patch b/debian/patches/disable-stat-tests.patch
index 4d783d3..cf15a47 100644
--- a/debian/patches/disable-stat-tests.patch
+++ b/debian/patches/disable-stat-tests.patch
@@ -1,9 +1,9 @@
 Author: Ole Streicher <debian at liska.ath.cx>
 Description: Disable mystic test failures on i386 (agreed with upstream).
 Forwarded: <mailto:cpl-help at eso.org>
---- libcpl-5.3.1.orig/cplcore/tests/cpl_stats-test.c
-+++ libcpl-5.3.1/cplcore/tests/cpl_stats-test.c
-@@ -245,9 +245,9 @@ int main(void)
+--- a/cplcore/tests/cpl_stats-test.c
++++ b/cplcore/tests/cpl_stats-test.c
+@@ -251,9 +251,9 @@ int main(void)
  
          }
  
@@ -14,7 +14,7 @@ Forwarded: <mailto:cpl-help at eso.org>
          CPL_STAT_CMP(MIN, min);
          CPL_STAT_CMP(MAX, max);
          CPL_STAT_CMP(MEAN, mean);
-@@ -275,7 +275,7 @@ int main(void)
+@@ -281,7 +281,7 @@ int main(void)
          CPL_STAT_CMP_IMAGE(sqflux);
          CPL_STAT_CMP_IMAGE(centroid_x);
          CPL_STAT_CMP_IMAGE(centroid_y);
diff --git a/debian/patches/remove-cfitsio-version-check.patch b/debian/patches/remove-cfitsio-version-check.patch
index f6b6e89..91a612b 100644
--- a/debian/patches/remove-cfitsio-version-check.patch
+++ b/debian/patches/remove-cfitsio-version-check.patch
@@ -7,11 +7,10 @@ Description: ESO is paranoid against the binary incompability of cfitsio
 Forwarded: <mailto:cpl-help at eso.org>
 --- a/cplcore/cpl_init.c
 +++ b/cplcore/cpl_init.c
-@@ -95,47 +95,15 @@
-  *    of invalid pointers.
-  * Any other value (including NULL) will leave the default memory mode
-  * unchanged.
-- * 
+@@ -111,11 +111,6 @@
+  * threaded environment to the extent that the underlying FITS library
+  * (CFITSIO) supports it.
+  * 
 - * Possible #_cpl_error_code_ set in this function:
 - * - CPL_ERROR_INCOMPATIBLE_INPUT if there is an inconsistency between the run-
 - *   time and compile-time versions of a library that CPL depends on internally,
@@ -20,9 +19,11 @@ Forwarded: <mailto:cpl-help at eso.org>
   */
  
  void
+@@ -121,38 +121,11 @@
+ void
  cpl_init(unsigned self)
  {
- 
+-
 -#ifndef CPL_CFITSIO_MAX_VERSION
 -#define CPL_CFITSIO_MAX_VERSION 4.0
 -#endif
@@ -49,13 +50,15 @@ Forwarded: <mailto:cpl-help at eso.org>
 -
      int memory_mode = CPL_XMEMORY_MODE; /* Default from configure */
      const char * memory_mode_string = getenv("CPL_MEMORY_MODE");
+     const char * io_fits_mode_string = getenv("CPL_IO_MODE");
+     const cpl_boolean use_io_fits = io_fits_mode_string != NULL &&
+         strcmp("1", io_fits_mode_string) == 0;
 -    char       * err_msg = NULL;
- 
 -
+ 
      if (memory_mode_string != NULL) {
          if (strcmp("0", memory_mode_string) == 0) {
-             memory_mode = 0;
-@@ -154,87 +123,6 @@
+@@ -172,85 +145,6 @@
          cpl_msg_warning(cpl_func, "Illegal input ignored");
      }
  
@@ -68,19 +71,17 @@ Forwarded: <mailto:cpl-help at eso.org>
 -       are representable by floats with an accuracy better than 100 multiples
 -       of FLT_EPSILON. :-(((((((((((((((((((((((((((((((((((((((((((((((((((( */
 -    if (cfitsio_version_diff < -100.0 * FLT_EPSILON) {
--        (void)cpl_error_set_message(cpl_func,
--                                    CPL_ERROR_INCOMPATIBLE_INPUT,
--                                    "Run-time version %.3f of CFITSIO "
--                                    "is lower than compile-time version "
--                                    "%.3f", cfitsio_version,
--                                    CPL_CFITSIO_VERSION);
+-        (void)cpl_error_set_message_(CPL_ERROR_INCOMPATIBLE_INPUT,
+-                                     "Run-time version %.3f of CFITSIO "
+-                                     "is lower than compile-time version "
+-                                     "%.3f", cfitsio_version,
+-                                     CPL_CFITSIO_VERSION);
 -    } else if (cfitsio_version_diff > 100.0 * FLT_EPSILON) {
--        (void)cpl_error_set_message(cpl_func,
--                                    CPL_ERROR_INCOMPATIBLE_INPUT,
--                                    "Run-time version %.3f of CFITSIO is "
--                                    "higher than compile-time version "
--                                    "%.3f", cfitsio_version,
--                                    CPL_CFITSIO_VERSION);
+-        (void)cpl_error_set_message_(CPL_ERROR_INCOMPATIBLE_INPUT,
+-                                     "Run-time version %.3f of CFITSIO is "
+-                                     "higher than compile-time version "
+-                                     "%.3f", cfitsio_version,
+-                                     CPL_CFITSIO_VERSION);
 -    }
 -
 -    if (cfitsio_version < cfitsio_version_supported_min - 100.0 * FLT_EPSILON) {
@@ -98,9 +99,8 @@ Forwarded: <mailto:cpl-help at eso.org>
 -        if (cpl_error_get_code()) {
 -            /* There is already an existing CPL error code, so this additional
 -               problem is communicated via the CPL error state */
--            (void)cpl_error_set_message(cpl_func,
--                                        CPL_ERROR_INCOMPATIBLE_INPUT, "%s",
--                                        err_msg);
+-            (void)cpl_error_set_message_(CPL_ERROR_INCOMPATIBLE_INPUT, "%s",
+-                                         err_msg);
 -        } else {
 -            /* This condition is not in itself an error, so issue a warning */
 -            cpl_msg_warning(cpl_func, "%s. Continue at your own risk.",
@@ -116,18 +116,19 @@ Forwarded: <mailto:cpl-help at eso.org>
 -       dependeing on how it was built. Detection ? */
 -    if (cfitsio_version < CPL_CFITSIO_THREAD_UNSAFE) {
 -        const char * omp_num_threads_string = getenv(CPL_OMP_NUM_THREADS);
--        const int npe = atoi(omp_num_threads_string);
+-        const int npe = omp_num_threads_string ? atoi(omp_num_threads_string)
+-            : 1;
 -        char * npe_warn = npe > 1 ? cpl_sprintf(" " CPL_OMP_NUM_THREADS " is "
 -                                                "%d!", npe) : cpl_strdup("");
 -        if (cpl_error_get_code()) {
--            (void)cpl_error_set_message(cpl_func, CPL_ERROR_INCOMPATIBLE_INPUT,
--                                        "CPL was built with OpenMP (v. "
--                                        CPL_STRINGIFY(_OPENMP) "), but with a "
--                                        "non-thread-safe version of CFITSIO: "
--                                        "%g < "
--                                        CPL_STRINGIFY(CPL_CFITSIO_THREAD_UNSAFE)
--                                        ".%s Continue at your own risk.",
--                                        cfitsio_version, npe_warn);
+-            (void)cpl_error_set_message_(CPL_ERROR_INCOMPATIBLE_INPUT,
+-                                         "CPL was built with OpenMP (v. "
+-                                         CPL_STRINGIFY(_OPENMP) "), but with a "
+-                                         "non-thread-safe version of CFITSIO: "
+-                                         "%g < "
+-                                         CPL_STRINGIFY(CPL_CFITSIO_THREAD_UNSAFE)
+-                                         ".%s Continue at your own risk.",
+-                                         cfitsio_version, npe_warn);
 -        } else {
 -            cpl_msg_warning(cpl_func, "CPL was built with OpenMP (v. "
 -                            CPL_STRINGIFY(_OPENMP) "), but with a non-thread-"
diff --git a/debian/patches/remove-private-ltdl.patch b/debian/patches/remove-private-ltdl.patch
index e7a8573..8442d6f 100644
--- a/debian/patches/remove-private-ltdl.patch
+++ b/debian/patches/remove-private-ltdl.patch
@@ -2,7 +2,7 @@ Author: Ole Streicher <debian at liska.ath.cx>
 Subject: Remove private library libltdl and use the installed one.
 --- a/Makefile.am
 +++ b/Makefile.am
-@@ -25,11 +25,10 @@
+@@ -25,11 +25,10 @@ ACLOCAL_AMFLAGS = -I m4
  DISTCLEANFILES = *~
  
  if GASGANO_SUPPORT
@@ -10,14 +10,14 @@ Subject: Remove private library libltdl and use the installed one.
  cpljava = cpljava
  endif
  
--SUBDIRS = $(libltdl) libcext cplcore cplui cpldrs cpldfs $(cpljava)
-+SUBDIRS = libcext cplcore cplui cpldrs cpldfs $(cpljava)
+-SUBDIRS = $(libltdl) $(libcext) cplcore cplui cpldrs cpldfs $(cpljava)
++SUBDIRS = $(libcext) cplcore cplui cpldrs cpldfs $(cpljava)
  
- HTML_SUBDIRS = libcext
+ HTML_SUBDIRS = 
  
 --- a/configure.ac
 +++ b/configure.ac
-@@ -54,7 +54,9 @@
+@@ -57,7 +57,9 @@
  AC_ENABLE_STATIC(yes)
  AC_ENABLE_SHARED(yes)
  
@@ -28,11 +28,11 @@ Subject: Remove private library libltdl and use the installed one.
  AC_PROG_LIBTOOL
  AC_SUBST(INCLTDL)
  AC_SUBST(LIBLTDL)
-@@ -112,7 +114,6 @@
- 
- ESO_FUNC_SYSCONF
+@@ -128,7 +130,6 @@
+ CPL_CONFIG_FUNC
  
+ # Configure subpackages
 -AC_CONFIG_SUBDIRS(libltdl)
- AC_CONFIG_SUBDIRS(libcext)
  
- AC_CONFIG_FILES([Makefile
+ if test ! x$"cpl_cv_with_system_cext" = xyes; then
+         AC_CONFIG_SUBDIRS([libcext])
diff --git a/debian/patches/remove-wcs-versioninfo.patch b/debian/patches/remove-wcs-versioninfo.patch
index cf5abc2..a2efb38 100644
--- a/debian/patches/remove-wcs-versioninfo.patch
+++ b/debian/patches/remove-wcs-versioninfo.patch
@@ -6,7 +6,7 @@ Description: Since wcslib does not provide a version string at runtime, CPL
 Forwarded: <mailto:cpl-help at eso.org>
 --- a/cplcore/cpl_init.c
 +++ b/cplcore/cpl_init.c
-@@ -39,11 +39,6 @@
+@@ -47,11 +47,6 @@
  /* strcmp() */
  #include <string.h>
  
@@ -15,10 +15,10 @@ Forwarded: <mailto:cpl-help at eso.org>
 -#include <wcslib.h>
 -#endif                      /* End If WCS is installed */
 -
- #include "cpl_memory_impl.h"
- #include "cpl_error_impl.h"
- #include "cpl_msg.h"
-@@ -265,11 +260,7 @@
+ #if defined CPL_FFTWF_INSTALLED || defined CPL_FFTW_INSTALLED
+ #include <fftw3.h>
+ #endif
+@@ -283,11 +278,7 @@ const char * cpl_get_description(unsigned self)
         only, or both */
  
  #ifdef CPL_WCS_INSTALLED
diff --git a/debian/patches/replace-exit-by-abort.patch b/debian/patches/replace-exit-by-abort.patch
deleted file mode 100644
index 785b9d7..0000000
--- a/debian/patches/replace-exit-by-abort.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Author: Ole Streicher <debian at liska.ath.cx>
-Description: Replace calling exit() in cpl_test_init() by abort. 
- This should make lintian happy, but is also better behaviour when called 
- from an external program (strack traces etc.). The patch is agreed 
- upstream and will be there in the next version of CPL.
-Forwarded: <mailto:cpl-help at eso.org>
-Applied-Upstream: Yes
---- a/cplcore/cpl_test.c
-+++ b/cplcore/cpl_test.c
-@@ -442,7 +442,7 @@
-     if (cpl_error_get_code() != CPL_ERROR_NONE) {
-         cpl_errorstate_dump_one(1, 1, 1); /* Dump the most recent error */
-         assert(cpl_error_get_code() == CPL_ERROR_NONE);
--        exit(EXIT_FAILURE); /* exit also on -DNDEBUG */
-+	abort();
-     }
- 
- #ifdef OFF_T
diff --git a/debian/patches/series b/debian/patches/series
index 1463008..24903a8 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,8 +1,6 @@
 disable-stat-tests.patch
-replace-exit-by-abort.patch
 remove-wcs-versioninfo.patch
 remove-cfitsio-version-check.patch
 use-std-paths-for-libs.patch
 remove-private-ltdl.patch
 build-cpljava.patch
-check_for_TIOCGWINSZ.patch
diff --git a/debian/patches/use-std-paths-for-libs.patch b/debian/patches/use-std-paths-for-libs.patch
index e61a240..edfdda4 100644
--- a/debian/patches/use-std-paths-for-libs.patch
+++ b/debian/patches/use-std-paths-for-libs.patch
@@ -6,274 +6,18 @@ Description: Check cfitsio, wcs, and fftw in the standard paths if
  installed in the standard directory.
 --- a/m4/cpl.m4
 +++ b/m4/cpl.m4
-@@ -3,11 +3,9 @@
- # Checks for the cfitsio library and header files.
- AC_DEFUN([CPL_CHECK_CFITSIO],
- [
--    AC_MSG_CHECKING([for cfitsio])
--
+@@ -8,7 +8,7 @@ AC_DEFUN([CPL_CHECK_CFITSIO],
+         
+     cpl_cfitsio_check_version="$1"
      cpl_cfitsio_check_header="fitsio.h"
-     # FIXME: Check first for the dynamic library...
 -    cpl_cfitsio_check_lib="libcfitsio.a"
 +    cpl_cfitsio_check_lib="libcfitsio.so"
  
-     cpl_cfitsio_dir=""
      cpl_cfitsio_incdirs=""
-@@ -29,56 +27,65 @@
- 
-     # Check for the cfitsio includes, either in include/, include/cfitsio/
-     # or include/libcfitsio0/
--    cpl_cfitsio_incdirs="$cpl_cfitsio_dir/include"
--    ESO_FIND_FILE($cpl_cfitsio_check_header, $cpl_cfitsio_incdirs, cpl_cfitsio_includes)
--    if test x"$cpl_cfitsio_includes" = xno; then
--      # include/cfitsio/ is seen on a 64-bit Fedora 10
--      cpl_cfitsio_incdirs="$cpl_cfitsio_dir/include/cfitsio"
-+    if test -n "$cpl_cfitsio_dir" ; then
-+      AC_MSG_CHECKING([for cfitsio in $cpl_cfitsio_dir])
-+      cpl_cfitsio_incdirs="$cpl_cfitsio_dir/include"
-       ESO_FIND_FILE($cpl_cfitsio_check_header, $cpl_cfitsio_incdirs, cpl_cfitsio_includes)
-       if test x"$cpl_cfitsio_includes" = xno; then
--        # include/libcfitsio0/ is seen on a 64-bit Suse
--        cpl_cfitsio_incdirs="$cpl_cfitsio_dir/include/libcfitsio0"
-+        # include/cfitsio/ is seen on a 64-bit Fedora 10
-+        cpl_cfitsio_incdirs="$cpl_cfitsio_dir/include/cfitsio"
-         ESO_FIND_FILE($cpl_cfitsio_check_header, $cpl_cfitsio_incdirs, cpl_cfitsio_includes)
-+        if test x"$cpl_cfitsio_includes" = xno; then
-+          # include/libcfitsio0/ is seen on a 64-bit Suse
-+          cpl_cfitsio_incdirs="$cpl_cfitsio_dir/include/libcfitsio0"
-+          ESO_FIND_FILE($cpl_cfitsio_check_header, $cpl_cfitsio_incdirs, cpl_cfitsio_includes)
-+        fi
-       fi
--    fi
- 
--    # Check for the cfitsio library, either in lib64/, lib32/ or lib/
--    cpl_cfitsio_libdirs="$cpl_cfitsio_dir/lib64"
--    ESO_FIND_FILE($cpl_cfitsio_check_lib, $cpl_cfitsio_libdirs, cpl_cfitsio_libraries)
--
--    if test x"$cpl_cfitsio_libraries" = xno; then
--      cpl_cfitsio_libdirs="$cpl_cfitsio_dir/lib32"
-+      # Check for the cfitsio library, either in lib64/, lib32/ or lib/
-+      cpl_cfitsio_libdirs="$cpl_cfitsio_dir/lib64"
-       ESO_FIND_FILE($cpl_cfitsio_check_lib, $cpl_cfitsio_libdirs, cpl_cfitsio_libraries)
-+
-       if test x"$cpl_cfitsio_libraries" = xno; then
--        cpl_cfitsio_libdirs="$cpl_cfitsio_dir/lib"
-+        cpl_cfitsio_libdirs="$cpl_cfitsio_dir/lib32"
-         ESO_FIND_FILE($cpl_cfitsio_check_lib, $cpl_cfitsio_libdirs, cpl_cfitsio_libraries)
-+        if test x"$cpl_cfitsio_libraries" = xno; then
-+          cpl_cfitsio_libdirs="$cpl_cfitsio_dir/lib"
-+          ESO_FIND_FILE($cpl_cfitsio_check_lib, $cpl_cfitsio_libdirs, cpl_cfitsio_libraries)
-+        fi
-       fi
--    fi
- 
--    if test x"$cpl_cfitsio_includes" = xno || test x"$cpl_cfitsio_libraries" = xno; then
--        AC_MSG_ERROR([cfitsio was not found on your system. Please check!])
--    else
--        AC_MSG_RESULT([libraries $cpl_cfitsio_libraries, headers $cpl_cfitsio_includes])
--        # Attempt to check the version via CFITSIO_VERSION in the include file
--        cpl_cfitsio_check_vers=`perl -nle 's/^#\s*define\s+CFITSIO_VERSION\s+\b// and s/\s.*//, print' $cpl_cfitsio_includes/fitsio.h`
--       if test -z "$cpl_cfitsio_check_vers" ; then
--         # Attempt to check the version by checking the include files
--         cpl_cfitsio_check_vers=`grep "Version Info: This file is distributed with version 2.510 of CFITSIO" $cpl_cfitsio_includes/fitsio.h`
-+      if test x"$cpl_cfitsio_includes" = xno || test x"$cpl_cfitsio_libraries" = xno; then
-+          AC_MSG_ERROR([cfitsio was not found on your system. Please check!])
-+      else
-+          AC_MSG_RESULT([libraries $cpl_cfitsio_libraries, headers $cpl_cfitsio_includes])
-+          # Attempt to check the version via CFITSIO_VERSION in the include file
-+          cpl_cfitsio_check_vers=`perl -nle 's/^#\s*define\s+CFITSIO_VERSION\s+\b// and s/\s.*//, print' $cpl_cfitsio_inclu
-+des/fitsio.h`
-          if test -z "$cpl_cfitsio_check_vers" ; then
--             AC_MSG_WARN([cfitsio version seems to be different from 2.510 and less than 3.X.])
--	 else
--             AC_MSG_WARN([cfitsio version seems to be 2.510])
-+           # Attempt to check the version by checking the include files
-+           cpl_cfitsio_check_vers=`grep "Version Info: This file is distributed with version 2.510 of CFITSIO" $cpl_cfitsio
-+_includes/fitsio.h`
-+           if test -z "$cpl_cfitsio_check_vers" ; then
-+               AC_MSG_WARN([cfitsio version seems to be different from 2.510 and less than 3.X.])
-+           else
-+               AC_MSG_WARN([cfitsio version seems to be 2.510])
-+           fi
-+         else
-+            CFLAGS="-D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 $CFLAGS"
-          fi
--       else
--          CFLAGS="-D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 $CFLAGS"
--       fi
-+      fi
-+
-+      # Set up the symbols
-+      CFITSIO_INCLUDES="-I$cpl_cfitsio_includes"
-+      CFITSIO_LDFLAGS="-L$cpl_cfitsio_libraries"
-+    else
-+      AC_CHECK_HEADERS($cpl_cfitsio_check_header,,AC_MSG_ERROR([fitsio.h was not found on your system. Please check!]))
-+      AC_SEARCH_LIBS([fits_get_cwd], [cfitsio],,AC_MSG_ERROR([libcfitsio was not found on your system. Please check!]),)
-+      CFLAGS="-D_LARGEFILE_SOURCE=1 -D_FILE_OFFSET_BITS=64 $CFLAGS"
-     fi
- 
--    # Set up the symbols
--    CFITSIO_INCLUDES="-I$cpl_cfitsio_includes"
--    CFITSIO_LDFLAGS="-L$cpl_cfitsio_libraries"
-     LIBCFITSIO="-lcfitsio"
--
-     AC_SUBST(CFITSIO_INCLUDES)
-     AC_SUBST(CFITSIO_LDFLAGS)
-     AC_SUBST(LIBCFITSIO)
-@@ -105,48 +112,63 @@
-                     cpl_with_wcs_libs=$withval/lib
-                 ])
- 
--    # Check for the wcs includes
-     if test -z "$cpl_with_wcs_includes"; then
-         test -n "$WCSDIR" && cpl_wcs_incdirs="$WCSDIR/include"
-     else
-         cpl_wcs_incdirs="$cpl_with_wcs_includes"
-     fi
--    ESO_FIND_FILE($cpl_wcs_check_header, $cpl_wcs_incdirs, cpl_wcs_includes)
- 
--    # Check for the wcs library
-     if test -z "$cpl_with_wcs_libs"; then
-         test -n "$WCSDIR" && cpl_wcs_libdirs="$WCSDIR/lib"
-     else
-         cpl_wcs_libdirs="$cpl_with_wcs_libs"
-     fi
--    ESO_FIND_FILE($cpl_wcs_check_lib, $cpl_wcs_libdirs, cpl_wcs_libraries)
-+
-+    if test -n "$cpl_with_wcs_includes"; then
-+      # Check for the wcs includes
-+      ESO_FIND_FILE($cpl_wcs_check_header, $cpl_wcs_incdirs, cpl_wcs_includes)
-+    else
-+      AC_CHECK_HEADERS($cpl_wcs_check_header,,cpl_wcs_includes="no")
-+    fi
-+
-+    # Check for the wcs library
-+    if test -n "$cpl_with_wcs_libs"; then
-+      ESO_FIND_FILE($cpl_wcs_check_lib, $cpl_wcs_libdirs, cpl_wcs_libraries)
-+    else
-+      AC_SEARCH_LIBS([wcsini], [wcs],,cpl_wcs_libraries="no",)
-+    fi
- 
-     if test x"$cpl_wcs_includes" = xno || test x"$cpl_wcs_libraries" = xno; then
-         AC_MSG_WARN([wcs was not found on your system.])
-     else
-         AC_MSG_RESULT([libraries $cpl_wcs_libraries, headers $cpl_wcs_includes])
--        # Attempt to check the version by checking the include files
--        cpl_wcs_check_vers43=`grep "WCSLIB 4.3 - an implementation of the FITS WCS standard" $cpl_wcs_includes/wcslib/wcslib.h`
--        if test -z "$cpl_wcs_check_vers43" ; then
--            cpl_wcs_check_vers44=`grep "WCSLIB 4.4 - an implementation of the FITS WCS standard" $cpl_wcs_includes/wcslib/wcslib.h`
--            if test -z "$cpl_wcs_check_vers44" ; then
--                AC_MSG_WARN([wcs version seems to be older than 4.3])
--            fi
-+        if test -n "$cpl_wcs_includes" ; then
-+          # Attempt to check the version by checking the include files
-+          cpl_wcs_check_vers43=`grep "WCSLIB 4.3 - an implementation of the FITS WCS standard" $cpl_wcs_includes/wcslib/wcslib.h`
-+          if test -z "$cpl_wcs_check_vers43" ; then
-+              cpl_wcs_check_vers44=`grep "WCSLIB 4.4 - an implementation of the FITS WCS standard" $cpl_wcs_includes/wcslib/wcslib.h`
-+              if test -z "$cpl_wcs_check_vers44" ; then
-+                  AC_MSG_WARN([wcs version seems to be older than 4.3])
-+              fi
-+          fi
-         fi
-         AC_DEFINE_UNQUOTED(CPL_WCS_INSTALLED, 1, [Defined if WCS is available])
-         # Set up the symbols
--        WCS_INCLUDES="-I$cpl_wcs_includes/wcslib"
--        WCS_LDFLAGS="-L$cpl_wcs_libraries"
-+        if test -n "$cpl_wcs_includes" ; then
-+          WCS_INCLUDES="-I$cpl_wcs_includes"
-+        fi
-+        if test -n "$cpl_wcs_libraries" ; then
-+          WCS_LDFLAGS="-L$cpl_wcs_libraries"
-+        fi
-         LIBWCS="-lwcs"
- 
-         AC_SUBST(WCS_INCLUDES)
-         AC_SUBST(WCS_LDFLAGS)
-         AC_SUBST(LIBWCS)
-     fi
--
- ])
- 
--# CPL_CHECK_WCS
-+# CPL_CHECK_FFTW
- #--------------
- # Checks for the wcs library and header files.
- AC_DEFUN([CPL_CHECK_FFTW],
-@@ -171,23 +195,34 @@
-                     cpl_with_fftw_libs=$withval/lib
-                 ])
- 
--    # Check for the fftw includes
-     if test -z "$cpl_with_fftw_includes"; then
-         test -n "$FFTWDIR" && cpl_fftw_incdirs="$FFTWDIR/include"
-     else
-         cpl_fftw_incdirs="$cpl_with_fftw_includes"
-     fi
--    ESO_FIND_FILE($cpl_fftw_check_header, $cpl_fftw_incdirs, cpl_fftw_includes)
--    ESO_FIND_FILE($cpl_fftwf_check_header, $cpl_fftw_incdirs, cpl_fftwf_includes)
--
--    # Check for the fftw library
-     if test -z "$cpl_with_fftw_libs"; then
-         test -n "$FFTWDIR" && cpl_fftw_libdirs="$FFTWDIR/lib"
-     else
-         cpl_fftw_libdirs="$cpl_with_fftw_libs"
-     fi
--    ESO_FIND_FILE($cpl_fftw_check_lib, $cpl_fftw_libdirs, cpl_fftw_libraries)
--    ESO_FIND_FILE($cpl_fftwf_check_lib, $cpl_fftw_libdirs, cpl_fftwf_libraries)
-+
-+    # Check for the fftw includes
-+    if test -n "$cpl_fftw_incdirs"; then
-+      ESO_FIND_FILE($cpl_fftw_check_header, $cpl_fftw_incdirs, cpl_fftw_includes)
-+      ESO_FIND_FILE($cpl_fftwf_check_header, $cpl_fftw_incdirs, cpl_fftwf_includes)
-+    else
-+      AC_CHECK_HEADERS($cpl_fftw_check_header,,cpl_fftw_includes="no")
-+      AC_CHECK_HEADERS($cpl_fftwf_check_header,,cpl_fftwf_includes="no")
-+    fi
-+
-+    # Check for the fftw library
-+    if test -n "$cpl_fftw_libdirs"; then
-+      ESO_FIND_FILE($cpl_fftw_check_lib, $cpl_fftw_libdirs, cpl_fftw_libraries)
-+      ESO_FIND_FILE($cpl_fftwf_check_lib, $cpl_fftw_libdirs, cpl_fftwf_libraries)
-+    else
-+      AC_SEARCH_LIBS([fftw_version], [fftw3],,cpl_fftw_libraries="no",)
-+      AC_SEARCH_LIBS([fftwf_version], [fftw3f],,cpl_fftwf_libraries="no",)
-+    fi
- 
-     if test x"$cpl_fftw_includes" = xno || test x"$cpl_fftw_libraries" = xno; then
-         AC_MSG_WARN([fftw (normal-precision) was not found on your system.])
-@@ -197,8 +232,12 @@
- 
-         AC_DEFINE_UNQUOTED(CPL_FFTW_INSTALLED, 1, [Defined if FFTW (normal-precision) is available])
-         # Set up the symbols
--        FFTW_INCLUDES="-I$cpl_fftw_includes"
--        FFTW_LDFLAGS="-L$cpl_fftw_libraries"
-+        if test -n "$cpl_fftw_includes"; then
-+          FFTW_INCLUDES="-I$cpl_fftw_includes"
-+        fi
-+        if test -n "$cpl_fftw_libraries"; then
-+          FFTW_LDFLAGS="-L$cpl_fftw_libraries"
-+        fi
-         LIBFFTW="-lfftw3"
- 
-         AC_SUBST(FFTW_INCLUDES)
-@@ -214,8 +253,12 @@
- 
-         AC_DEFINE_UNQUOTED(CPL_FFTWF_INSTALLED, 1, [Defined if FFTW (single-precision) is available])
-         # Set up the symbols
--        FFTWF_INCLUDES="-I$cpl_fftwf_includes"
--        FFTWF_LDFLAGS="-L$cpl_fftwf_libraries"
-+        if test -n "$cpl_fftwf_includes"; then
-+          FFTWF_INCLUDES="-I$cpl_fftwf_includes"
-+        fi
-+        if test -n "$cpl_fftwf_libraries"; then
-+          FFTWF_LDFLAGS="-L$cpl_fftwf_libraries"
-+        fi
-         LIBFFTWF="-lfftw3f"
- 
-         AC_SUBST(FFTWF_INCLUDES)
+     cpl_cfitsio_libdirs=""
 --- a/cplcore/cpl_test.c
 +++ b/cplcore/cpl_test.c
-@@ -66,7 +66,7 @@
+@@ -84,7 +84,7 @@
  
  #if defined CPL_WCS_INSTALLED && CPL_WCS_INSTALLED == 1
  /* Used for WCSLIB_VERSION */
@@ -281,18 +25,18 @@ Description: Check cfitsio, wcs, and fftw in the standard paths if
 +#include <wcslib/wcslib.h>
  #endif
  
- #include "cpl_init.h"
+ #ifndef inline
 --- a/cpldrs/cpl_wcs.c
 +++ b/cpldrs/cpl_wcs.c
 @@ -48,7 +48,7 @@
- #include "cpl_wcs.h"
+ #include <fitsio.h>
  
  #ifdef CPL_WCS_INSTALLED    /* If WCS is installed */
 -#include <wcslib.h>
 +#include <wcslib/wcslib.h>
  #endif                      /* End If WCS is installed */
  
- /* Remove this when cfitsio is upgraded */
+ /*---------------------------------------------------------------------------*/
 --- a/cpldrs/tests/cpl_wcs-test.c
 +++ b/cpldrs/tests/cpl_wcs-test.c
 @@ -47,7 +47,7 @@

-- 
ESO library for automated astronomical data-reduction



More information about the debian-science-commits mailing list