--- Makefile.am 1970-01-01 01:00:00.000000000 +0100 +++ Makefile.am 2008-01-24 14:48:14.000000000 +0000 @@ -0,0 +1,44 @@ +lib_LTLIBRARIES = libcfitsio.la + +C_SOURCES = \ + buffers.c cfileio.c checksum.c compress.c drvrfile.c drvrmem.c \ + drvrnet.c drvrsmem.c drvrgsiftp.c editcol.c edithdu.c eval_l.c \ + eval_y.c eval_f.c fitscore.c getcol.c getcolb.c getcold.c getcole.c \ + getcoli.c getcolj.c getcolk.c getcoll.c getcols.c getcolsb.c \ + getcoluk.c getcolui.c getcoluj.c getkey.c group.c grparser.c \ + histo.c iraffits.c \ + modkey.c putcol.c putcolb.c putcold.c putcole.c putcoli.c \ + putcolj.c putcolk.c putcoluk.c putcoll.c putcols.c putcolsb.c \ + putcolu.c putcolui.c putcoluj.c putkey.c region.c scalnull.c \ + swapproc.c wcssub.c wcsutil.c imcompress.c quantize.c ricecomp.c \ + pliocomp.c fits_hcompress.c fits_hdecompress.c + +F77_SOURCES= +if ENABLE_FORTRAN +F77_SOURCES += f77_wrap1.c f77_wrap2.c f77_wrap3.c f77_wrap4.c f77_wrap.h +endif + +include_HEADERS = fitsio.h fitsio2.h longnam.h drvrsmem.h +libcfitsio_la_SOURCES = $(C_SOURCES) $(F77_SOURCES) $(include_HEADERS) +libcfitsio_la_LDFLAGS = -no-undefined -version-info 3:0:0 + +pkgconfigdir = $(libdir)/pkgconfig +pkgconfig_DATA = cfitsio.pc + +LDADD = libcfitsio.la +noinst_PROGRAMS = testprog speed cookbook smem +bin_PROGRAMS = fitscopy imcopy listhead + +testprog_SOURCES = testprog.c +speed_SOURCES = speed.c +cookbook_SOURCES = cookbook.c +smem_SOURCES = smem.c + +fitscopy_SOURCES = fitscopy.c +listhead_SOURCES = listhead.c +imcopy_SOURCES = imcopy.c + +if ENABLE_FORTRAN +noinst_PROGRAMS += testf77 +testf77_SOURCES = testf77.f +endif --- configure.ac 1970-01-01 01:00:00.000000000 +0100 +++ configure.ac 2008-01-24 14:46:39.000000000 +0000 @@ -0,0 +1,230 @@ +AC_PREREQ(2.59) +AC_INIT(cfitsio, 3.060, pence@tetra.gsfc.nasa.gov) +AC_CONFIG_SRCDIR([fitscore.c]) +AM_INIT_AUTOMAKE([foreign]) + +AC_PROG_LIBTOOL +SHARED_VERSION_INFO="3:0:0" +AC_MSG_CHECKING([whether to enable fortran api]) +AC_ARG_ENABLE([fortran], + AS_HELP_STRING([--enable-fortran], [Build the fortran API]), + [ENABLE_FORTRAN=$enableval + AC_MSG_RESULT([$enableval])], + [ENABLE_FORTRAN=no + AC_MSG_RESULT([no])]) + +if test x"$ENABLE_FORTRAN" = "xyes" ; then + AC_PROG_F77 + if test $F77 = 'g77'; then + cfortran_def=g77Fortran + elif test $F77 = 'ifort' ; then + cfortran_def=INTEL_COMPILER + elif test $F77 = 'gfortran' ; then + cfortran_def=gFortran + elif test $F77 = 'pgif77' ; then + cfortran_def=pgiFortran + else + cfortran_def=f2cFortran + fi + CFORTRAN_CPPFLAGS="-D$cfortran_def" +fi + +AC_SUBST([ENABLE_FORTRAN]) +AM_CONDITIONAL([ENABLE_FORTRAN], test "x$ENABLE_FORTRAN" = "xyes") + +# taken from original configure.in +# determine system type +#-------------------------------------------------------------------- + +AC_PROGRAM_CHECK(uname_found, uname, 1, 0) +if test $uname_found -eq 0 ; then + echo "cfitsio: No uname found; setting system type to unknown." + system="unknown" +else + system=`uname -s`-`uname -r` +fi +case $system in + Darwin-*) + # For large file support (but may break Absoft compilers): + AC_DEFINE(_LARGEFILE_SOURCE) + AC_DEFINE(_FILE_OFFSET_BITS,64) + ;; + HP-UX-*) + if test x"$CFORTRAN_CPPFLAGS" = x ; then + CFORTRAN_CPPFLAGS="-Dappendus" + fi + CPPFLAGS="$CPPFLAGS -DPG_PPU" + LIBPRE="-Wl," + ;; + SunOS-5*) + if test x"$CFORTRAN_CPPFLAGS" = x ; then + CFORTRAN_CPPFLAGS="-Dsolaris" + fi + # For large file support: + AC_DEFINE(_LARGEFILE_SOURCE) + AC_DEFINE(_FILE_OFFSET_BITS, 64) + ;; + IRIX*) + CPPFLAGS="$CPPFLAGS -DHAVE_POSIX_SIGNALS" + ;; + Linux*) + AC_DEFINE(_LARGEFILE_SOURCE) + AC_DEFINE(_FILE_OFFSET_BITS,64) + ;; + CYGWIN*) + CPPFLAGS="$CPPFLAGS -DHAVE_POSIX_SIGNALS" + ;; + *) + ;; +esac + +if test x"$ENABLE_FORTRAN" = "xyes" ; then + CPPFLAGS="$CPPFLAGS $CFORTRAN_CPPFLAGS" +fi + +case $CC in + gcc) + GCCVERSION="`gcc -dumpversion 2>&1`" + AC_SUBST(GCCVERSION) + changequote(,) + if test `echo $GCCVERSION | grep -c '2\.[45678]'` -gt 0 + then + CFLAGS=`echo $CFLAGS | sed 's:-O[^ ]* *::'` +# AC_MSG_WARN(This gcc is pretty old. Disabling optimization to be safe.) + fi + changequote([,]) + ;; + cc) + echo "cfitsio: Old CFLAGS is $CFLAGS" + CFLAGS=`echo $CFLAGS | sed -e "s/-g/-O/"` + case $system in + SunOS-5*) + changequote(,) + if test `echo $CFLAGS | grep -c fast` -gt 0 + then + echo "cfitsio: Replacing -fast with -O3" + CFLAGS=`echo $CFLAGS | sed 's:-fast:-O3:'` + fi + changequote([,]) + CFLAGS="$CFLAGS -DHAVE_ALLOCA_H -DHAVE_POSIX_SIGNALS" + ;; + *) + echo "== No special changes for $system" + ;; + esac + echo "New CFLAGS is $CFLAGS" + ;; + *) + # Don't do anything now + ;; +esac + + +# ================= test for the unix ftruncate function ================ + +AC_MSG_CHECKING("whether ftruncate works") +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +]], [[ +ftruncate(0, 0); +]])],[ +AC_DEFINE(HAVE_FTRUNCATE) +AC_MSG_RESULT("yes") +],[AC_MSG_RESULT("no") ]) + +# --------------------------------------------------------- +# some systems define long long for 64-bit ints +# --------------------------------------------------------- + +AC_MSG_CHECKING("whether long long is defined") +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +]], [[ +long long filler; +]])],[ +AC_DEFINE(HAVE_LONGLONG) +AC_MSG_RESULT("yes") +],[AC_MSG_RESULT("no") ]) + +# ==================== SHARED MEMORY DRIVER SECTION ======================= +# +# 09-Mar-98 : modified by JB/ISDC +# 3 checks added to support autoconfiguration of shared memory +# driver. First generic check is made whether shared memory is supported +# at all, then 2 more specific checks are made (architecture dependent). +# Currently tested on : sparc-solaris, intel-linux, sgi-irix, dec-alpha-osf + +# ------------------------------------------------------------------------- +# check is System V IPC is supported on this machine +# ------------------------------------------------------------------------- + +AC_MSG_CHECKING("whether system V style IPC services are supported") +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include +#include +#include +]], [[ +shmat(0, 0, 0); +shmdt(0); +shmget(0, 0, 0); +semget(0, 0, 0); +]])], +[AC_DEFINE(HAVE_SHMEM_SERVICES) +AC_MSG_RESULT("yes")], +[AC_MSG_RESULT("no") ]) + + +# ------------------------------------------------------------------------- +# some systems define flock_t, for others we have to define it ourselves +# ------------------------------------------------------------------------- + +AC_MSG_CHECKING("do we have flock_t defined in sys/fcntl.h") +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +]], [[ +flock_t filler; +]])],[ +AC_DEFINE(HAVE_FLOCK_T) +AC_MSG_RESULT("yes") +],[AC_MSG_RESULT("no") ]) + +if test "$HAVE_FLOCK_T" != 1; then + AC_MSG_CHECKING("do we have flock_t defined in sys/flock.h") + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include + ]], [[ + flock_t filler; + ]])],[ + AC_DEFINE(HAVE_FLOCK_T) + AC_MSG_RESULT("yes") + ],[AC_MSG_RESULT("no") ]) +fi + +# ------------------------------------------------------------------------- +# there are some idiosyncrasies with semun defs (used in semxxx). Solaris +# does not define it at all +# ------------------------------------------------------------------------- + +AC_MSG_CHECKING("do we have union semun defined") +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include +#include +#include +]], [[ +union semun filler; +]])],[ +AC_DEFINE(HAVE_UNION_SEMUN) +AC_MSG_RESULT("yes") +],[AC_MSG_RESULT("no") ]) + +# ==================== END OF SHARED MEMORY DRIVER SECTION ================ +# ================= test for the unix networking functions ================ + +AC_SEARCH_LIBS([gethostbyname], [nsl], cfitsio_have_nsl=1, cfitsio_have_nsl=0) +AC_SEARCH_LIBS([connect], [socket], cfitsio_have_socket=1, + cfitsio_have_socket=0, [-lnsl]) + +if test "$cfitsio_have_nsl" = 1 -a "$cfitsio_have_socket" = 1; then + AC_DEFINE(HAVE_NET_SERVICES) +fi + +# ==================== END OF unix networking SECTION ================ + +# this quick check will add -lm to LIBS +AC_CHECK_LIB(m, cos) +AC_CONFIG_FILES([Makefile cfitsio.pc]) +AC_OUTPUT --- cfitsio.pc.in.orig 2006-07-24 15:35:56.000000000 +0100 +++ cfitsio.pc.in 2008-01-24 14:23:31.000000000 +0000 @@ -1,10 +1,10 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ -libdir=${exec_prefix}/lib -includedir=${prefix}/include +libdir=@libdir@ +includedir=@includedir@ -Name: cfitsio +Name: @PACKAGE_NAME@ Description: FITS File Subroutine Library -Version: 3.006 -Libs: -L${libdir} -lcfitsio @LIBS@ -lm +Version: @PACKAGE_VERSION@ +Libs: -L${libdir} -lcfitsio @LIBS@ Cflags: -I${includedir}