Commit 5d0f0d7494c2032cf0dbdb2ad03845ea788e3686

Authored by knodlseder
1 parent d5bc6961

support cfitsio headers in cfitsio/fitsio.h

configure.ac
... ... @@ -312,26 +312,47 @@ if test "x$with_cfitsio" = "xyes"; then
312 312 *) cfitsio_deps="-lm" ;;
313 313 esac
314 314  
315   - # First search for cfitsio in the standard paths using the AC_CHECK_LIB
316   - # macro. This allows also search in paths that are eventually specified by LDFAGS.
  315 + # First search for cfitsio in the standard paths using AC_CHECK_LIB
  316 + # and check for appropriate headers using AC_CHECK_HEADERS. This allows
  317 + # also to search in paths that are eventually specified by LDFAGS and
  318 + # CPPFLAGS.
317 319 AC_CHECK_LIB([cfitsio], [ffpss],
318 320 [has_cfitsio="yes"
319 321 AC_MSG_NOTICE([cfitsio found])],
320 322 [], [${cfitsio_deps}])
  323 + AC_CHECK_HEADERS([fitsio.h cfitsio/fitsio.h], [break])
  324 + if test x"$ac_cv_header_fitsio_h" != "xyes" -a x"$ac_cv_header_cfitsio_fitsio_h" != "xyes"; then
  325 + has_cfitsio="no"
  326 + AC_MSG_NOTICE([cfitsio headers not found or not usable])
  327 + fi
321 328  
322 329 # If cfitsio has not been found then search for cfitsio shared library in a some
323 330 # default directories
324 331 if test "x$has_cfitsio" = "xno"; then
325 332 for i in "$gammalib_prefix" /opt/local /usr/local /usr ; do
326   - if test -f $i/lib64/libcfitsio.so -o -f $i/lib64/libcfitsio.dylib -a -f $i/include/fitsio.h; then
327   - LIBDIR_CFITSIO=$i/lib64
328   - INCDIR_CFITSIO=$i/include
329   - break
  333 + if test -f $i/lib64/libcfitsio.so -o -f $i/lib64/libcfitsio.dylib; then
  334 + if test -f $i/include/fitsio.h; then
  335 + LIBDIR_CFITSIO=$i/lib64
  336 + INCDIR_CFITSIO=$i/include
  337 + break
  338 + fi
  339 + if test -f $i/include/cfitsio/fitsio.h; then
  340 + LIBDIR_CFITSIO=$i/lib64
  341 + INCDIR_CFITSIO=$i/include/cfitsio/
  342 + break
  343 + fi
330 344 fi
331   - if test -f $i/lib/libcfitsio.so -o -f $i/lib/libcfitsio.dylib -a -f $i/include/fitsio.h; then
332   - LIBDIR_CFITSIO=$i/lib
333   - INCDIR_CFITSIO=$i/include
334   - break
  345 + if test -f $i/lib/libcfitsio.so -o -f $i/lib/libcfitsio.dylib; then
  346 + if test -f $i/include/fitsio.h; then
  347 + LIBDIR_CFITSIO=$i/lib
  348 + INCDIR_CFITSIO=$i/include
  349 + break
  350 + fi
  351 + if test -f $i/include/cfitsio/fitsio.h; then
  352 + LIBDIR_CFITSIO=$i/lib
  353 + INCDIR_CFITSIO=$i/include/cfitsio
  354 + break
  355 + fi
335 356 fi
336 357 done
337 358 if test -n "$LIBDIR_CFITSIO" -a -n "$INCDIR_CFITSIO"; then
... ...
src/fits/GFitsCfitsio.hpp
... ... @@ -4,10 +4,18 @@
4 4 * copyright (C) 2008-2011 by Jurgen Knodlseder *
5 5 * ----------------------------------------------------------------------- *
6 6 * *
7   - * This program is free software; you can redistribute it and/or modify *
8   - * it under the terms of the GNU General Public License as published by *
9   - * the Free Software Foundation; either version 2 of the License, or *
10   - * (at your option) any later version. *
  7 + * This program is free software: you can redistribute it and/or modify *
  8 + * it under the terms of the GNU General Public License as published by *
  9 + * the Free Software Foundation, either version 3 of the License, or *
  10 + * (at your option) any later version. *
  11 + * *
  12 + * This program is distributed in the hope that it will be useful, *
  13 + * but WITHOUT ANY WARRANTY; without even the implied warranty of *
  14 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
  15 + * GNU General Public License for more details. *
  16 + * *
  17 + * You should have received a copy of the GNU General Public License *
  18 + * along with this program. If not, see <http://www.gnu.org/licenses/>. *
11 19 * *
12 20 ***************************************************************************/
13 21 /**
... ... @@ -32,7 +40,13 @@
32 40 * CFITSIO is available *
33 41 ***************************************************************************/
34 42 #if defined(HAVE_LIBCFITSIO)
  43 +#if defined(HAVE_CFITSIO_FITSIO_H)
  44 +#include <cfitsio/fitsio.h>
  45 +#elif defined(HAVE_FITSIO_H)
35 46 #include <fitsio.h>
  47 +#else
  48 +#include <fitsio.h>
  49 +#endif
36 50  
37 51 /* __ Macros _____________________________________________________________ */
38 52 #define __ffclos(A, B) ffclos(A, B)
... ...