1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
--- configure.ac.absent 1970-01-01 01:00:00.000000000 +0100
+++ configure.ac 2008-06-02 01:08:32.000000000 +0100
@@ -0,0 +1,158 @@
+AC_PREREQ(2.59)
+AC_INIT([cfitsio], [3.080], [pence@tetra.gsfc.nasa.gov])
+AC_CONFIG_SRCDIR([fitscore.c])
+AM_INIT_AUTOMAKE([foreign])
+
+
+AC_PROG_LIBTOOL
+dnl no api version info, so simply copy package version
+SHARED_VERSION_INFO="3:0:0"
+AC_SUBST(SHARED_VERSION_INFO)
+
+AC_PROG_YACC
+AC_PROG_LEX
+
+AC_MSG_CHECKING([whether to enable fortran interface])
+AC_ARG_ENABLE([fortran],
+ AS_HELP_STRING([--enable-fortran], [Build the fortran interface]),
+ [ENABLE_FORTRAN=$enableval
+ AC_MSG_RESULT([$enableval])],
+ [ENABLE_FORTRAN=no
+ AC_MSG_RESULT([no])]
+)
+
+if test x"$ENABLE_FORTRAN" = x"yes" ; then
+ AC_PROG_F77
+ if test x$F77 = xg77; then
+ cfortran_def=g77Fortran
+ elif test x$F77 = xifort ; then
+ cfortran_def=INTEL_COMPILER
+ elif test x$F77 = xgfortran ; then
+ cfortran_def=gFortran
+ elif test x$F77 = xpgf77 ; then
+ cfortran_def=pgiFortran
+ else
+ cfortran_def=f2cFortran
+ fi
+ CPPFLAGS_FORTRAN="-D$cfortran_def"
+ AC_SUBST(CPPFLAGS_FORTRAN)
+fi
+AC_SUBST([ENABLE_FORTRAN])
+AM_CONDITIONAL([ENABLE_FORTRAN], test "x$ENABLE_FORTRAN" = "xyes")
+
+AC_CANONICAL_HOST
+case $host in
+ *apple*darwin*)
+ dnl may break Absoft compilers
+ AC_DEFINE(_LARGEFILE_SOURCE, [1],
+ [Define to 1 if you have large file support])
+ AC_DEFINE(_FILE_OFFSET_BITS, [64],
+ [Offsets bits in files])
+ ;;
+ *hppa*)
+ CPPFLAGS_EXTRA="-DPG_PPU"
+ ;;
+ *sunos5*)
+ AC_DEFINE(_LARGEFILE_SOURCE, [1],
+ [Define to 1 if you have large file support])
+ AC_DEFINE(_FILE_OFFSET_BITS, [64],
+ [Offsets bits in files])
+ CPPFLAGS_EXTRA="-DHAVE_ALLOCA_H -DHAVE_POSIX_SIGNALS"
+ ;;
+ *irix*)
+ CPPFLAGS_EXTRA="-DHAVE_POSIX_SIGNALS"
+ ;;
+ *linux*)
+ AC_DEFINE(_LARGEFILE_SOURCE, [1],
+ [Define to 1 if you have large file support])
+ AC_DEFINE(_FILE_OFFSET_BITS, [64],
+ [Offsets bits in files])
+ ;;
+ *cygwin*)
+ CPPFLAGS_EXTRA="-DHAVE_POSIX_SIGNALS"
+ ;;
+ *)
+ ;;
+esac
+AC_SUBST(CPPFLAGS_EXTRA)
+
+AC_CHECK_FUNCS([ftruncate])
+AC_CHECK_FUNCS([shmat shmdt shmget],
+ AC_DEFINE(HAVE_SHMEM_SERVICES, [1],
+ [Define to yes if you have shared memory functions])
+)
+AC_CHECK_FUNCS([gethostbyname connect],
+ [AC_DEFINE(HAVE_NET_SERVICES, [1],
+ [Define to 1 if you have network functions])]
+)
+AC_CHECK_TYPE(long long,
+ [AC_DEFINE(HAVE_LONGLONG, [1],
+ [Define to 1 if your compiler supports long long])]
+)
+dnl check for flock_t
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+#include <sys/fcntl.h>
+ ]], [[
+flock_t filler;
+ ]])],
+ [AC_DEFINE(HAVE_FLOCK_T, 1, [if you have flock_t])
+ AC_MSG_RESULT("yes")],
+ [AC_MSG_RESULT("no") ])
+
+if test "$HAVE_FLOCK_T" != 1; then
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+#include <sys/flock.h>
+ ]], [[
+flock_t filler;
+ ]])],
+ [AC_DEFINE(HAVE_FLOCK_T, 1, [if you have flock_t])
+ AC_MSG_RESULT("yes")],
+ [AC_MSG_RESULT("no") ])
+fi
+
+# check for union semun type
+AC_CHECK_TYPE(union semun,
+ AC_DEFINE(HAVE_UNION_SEMUN, [1],
+ [Define to 1 if you have semun in sys/sem.h]),,[
+#include <sys/types.h>
+#include <sys/ipc.h>
+#include <sys/sem.h>
+ ]
+)
+
+dnl this quick check will add -lm to LIBS
+AC_CHECK_LIB(m, cos)
+
+AC_ARG_WITH(gsiftp-flavour,
+ [ --with-gsiftp-flavour[[=PATH]] Enable Globus Toolkit gsiftp protocol support ],
+ [ if test "x$withval" != "xno"; then
+
+ if test "x$withval" != "xyes" ; then
+ GSIFTP_FLAVOUR=${withval}
+ fi
+ AC_DEFINE(GSIFTP_FLAVOUR, [1],
+ [Define to 1 if you want Globus Toolkit architecture])
+ fi
+ ]
+)
+
+AC_ARG_WITH(gsiftp,
+ [ --with-gsiftp[[=PATH]] Enable Globus Toolkit gsiftp protocol support ],
+ [ if test "x$withval" != "xno"; then
+ if test "x$withval" != "xyes" ; then
+ CPPFLAGS_GLOBUS="-I${withval}/include/${GSIFTP_FLAVOUR}"
+ LIBS_GLOBUS="-L${withval}/lib -lglobus_ftp_client_${GSIFTP_FLAVOUR}"
+ HAVE_GSIFTP=yes
+ fi
+ AC_DEFINE(HAVE_GSIFTP, [1],
+ [Define if you want Globus Toolkit gsiftp protocol support])
+ fi
+ ]
+)
+
+AC_SUBST(CPPFLAGS_GLOBUS)
+AC_SUBST(LIBS_GLOBUS)
+AC_CONFIG_FILES([Makefile cfitsio.pc])
+AC_OUTPUT
--- Makefile.am.absent 1970-01-01 01:00:00.000000000 +0100
+++ Makefile.am 2008-06-02 01:07:45.000000000 +0100
@@ -0,0 +1,79 @@
+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
+AM_YFLAGS = -d -v
+
+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 @SHARED_VERSION_INFO@
+libcfitsio_la_CPPFLAGS = @CPPFLAGS_FORTRAN@ @CPPFLAGS_EXTRA@ @CPPFLAGS_GLOBUS@
+libcfitsio_la_LIBADD = @LIBS_GLOBUS@
+
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = cfitsio.pc
+
+LDADD = libcfitsio.la
+bin_PROGRAMS = fitscopy imcopy listhead
+fitscopy_SOURCES = fitscopy.c
+listhead_SOURCES = listhead.c
+imcopy_SOURCES = imcopy.c
+
+# tests
+check_PROGRAMS = testprog
+noinst_PROGRAMS = speed cookbook smem
+testprog_SOURCES = testprog.c
+speed_SOURCES = speed.c
+cookbook_SOURCES = cookbook.c
+smem_SOURCES = smem.c
+
+if ENABLE_FORTRAN
+check_PROGRAMS += testf77
+testf77_SOURCES = testf77.f
+endif
+
+check-local: $(check_PROGRAMS)
+ @total=0; failed=0; \
+ for i in $(check_PROGRAMS); do \
+ echo "--- Testing $$i ---"; \
+ ./$$i${EXEEXT} > my_$$i.out; \
+ diff $$i.out my_$$i.out; \
+ cmp $$i.fit $$i.std; \
+ if [ "x$$?" = "x0" ]; then \
+ echo "Test \`$$i' PASSED."; \
+ else \
+ echo "Test \`$$i' FAILED!!!"; \
+ failed=$$(($$failed + 1)); \
+ fi; \
+ total=$$(($$total + 1)); \
+ done; \
+ if [ $$failed -gt 0 ]; then \
+ echo "*** ERROR: $$failed/$$total tests failed!!!"; \
+ echo ""; \
+ exit 1; \
+ fi
+
+eval:
+ @$(LEX) -t eval.l > eval_l.c1; \
+ sed -e 's/yy/ff/g' -e 's/YY/FF/g' eval_l.c1 > eval_l.c; \
+ rm -f eval_l.c1; \
+ $(YACC) -d -v -y eval.y; \
+ sed -e 's/yy/ff/g' -e 's/YY/FF/g' y.tab.c > eval_y.c; \
+ sed -e 's/yy/ff/g' -e 's/YY/FF/g' y.tab.h > eval_tab.h; \
+ rm -f y.tab.c y.tab.h
--- cfitsio.pc.in.orig 2008-06-02 01:20:50.000000000 +0100
+++ cfitsio.pc.in 2008-06-02 01:22:14.000000000 +0100
@@ -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}
|