Gentoo Archives: gentoo-commits

From: "Sebastien Fabbro (bicatali)" <bicatali@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo-x86 commit in sci-libs/cfitsio/files: cfitsio-2.510-autotools.patch
Date: Mon, 02 Jun 2008 08:21:51
Message-Id: E1K35IY-0002lV-6x@stork.gentoo.org
1 bicatali 08/06/02 08:21:46
2
3 Added: cfitsio-2.510-autotools.patch
4 Log:
5 Better autotoolization with libtool for cfitsio-2.510, for consistency with newer versions. Fix license (mainly BSD with pieces of GPL-2). Dropped alpha, ppc and ppc64 keywords because of use of dev-lang/cfortran.
6 (Portage version: 2.1.5.2)
7
8 Revision Changes Path
9 1.1 sci-libs/cfitsio/files/cfitsio-2.510-autotools.patch
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/cfitsio/files/cfitsio-2.510-autotools.patch?rev=1.1&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo-x86/sci-libs/cfitsio/files/cfitsio-2.510-autotools.patch?rev=1.1&content-type=text/plain
13
14 Index: cfitsio-2.510-autotools.patch
15 ===================================================================
16 --- configure.ac.absent 1970-01-01 01:00:00.000000000 +0100
17 +++ configure.ac 2008-06-02 00:52:50.000000000 +0100
18 @@ -0,0 +1,129 @@
19 +AC_PREREQ(2.59)
20 +AC_INIT([cfitsio], [2.510], [pence@×××××××××××××××.gov])
21 +AC_CONFIG_SRCDIR([fitscore.c])
22 +AM_INIT_AUTOMAKE([foreign])
23 +
24 +
25 +AC_PROG_LIBTOOL
26 +dnl no api version info, so simply copy package version
27 +SHARED_VERSION_INFO="2:5:0"
28 +AC_SUBST(SHARED_VERSION_INFO)
29 +
30 +AC_PROG_YACC
31 +AC_PROG_LEX
32 +
33 +AC_MSG_CHECKING([whether to enable fortran interface])
34 +AC_ARG_ENABLE([fortran],
35 + AS_HELP_STRING([--enable-fortran], [Build the fortran interface]),
36 + [ENABLE_FORTRAN=$enableval
37 + AC_MSG_RESULT([$enableval])],
38 + [ENABLE_FORTRAN=no
39 + AC_MSG_RESULT([no])]
40 +)
41 +
42 +if test x"$ENABLE_FORTRAN" = x"yes" ; then
43 + AC_PROG_F77
44 + if test x$F77 = xg77; then
45 + cfortran_def=g77Fortran
46 + elif test x$F77 = xifort ; then
47 + cfortran_def=INTEL_COMPILER
48 + elif test x$F77 = xgfortran ; then
49 + cfortran_def=gFortran
50 + elif test x$F77 = xpgf77 ; then
51 + cfortran_def=pgiFortran
52 + else
53 + cfortran_def=f2cFortran
54 + fi
55 + CPPFLAGS_FORTRAN="-D$cfortran_def"
56 + AC_SUBST(CPPFLAGS_FORTRAN)
57 +fi
58 +AC_SUBST([ENABLE_FORTRAN])
59 +AM_CONDITIONAL([ENABLE_FORTRAN], test "x$ENABLE_FORTRAN" = "xyes")
60 +
61 +AC_CANONICAL_HOST
62 +case $host in
63 + *apple*darwin*)
64 + dnl may break Absoft compilers
65 + AC_DEFINE(_LARGEFILE_SOURCE, [1],
66 + [Define to 1 if you have large file support])
67 + AC_DEFINE(_FILE_OFFSET_BITS, [64],
68 + [Offsets bits in files])
69 + ;;
70 + *hppa*)
71 + CPPFLAGS_EXTRA="-DPG_PPU"
72 + ;;
73 + *sunos5*)
74 + AC_DEFINE(_LARGEFILE_SOURCE, [1],
75 + [Define to 1 if you have large file support])
76 + AC_DEFINE(_FILE_OFFSET_BITS, [64],
77 + [Offsets bits in files])
78 + CPPFLAGS_EXTRA="-DHAVE_ALLOCA_H -DHAVE_POSIX_SIGNALS"
79 + ;;
80 + *irix*)
81 + CPPFLAGS_EXTRA="-DHAVE_POSIX_SIGNALS"
82 + ;;
83 + *linux*)
84 + AC_DEFINE(_LARGEFILE_SOURCE, [1],
85 + [Define to 1 if you have large file support])
86 + AC_DEFINE(_FILE_OFFSET_BITS, [64],
87 + [Offsets bits in files])
88 + ;;
89 + *cygwin*)
90 + CPPFLAGS_EXTRA="-DHAVE_POSIX_SIGNALS"
91 + ;;
92 + *)
93 + ;;
94 +esac
95 +AC_SUBST(CPPFLAGS_EXTRA)
96 +
97 +AC_CHECK_FUNCS([ftruncate])
98 +AC_CHECK_FUNCS([shmat shmdt shmget],
99 + AC_DEFINE(HAVE_SHMEM_SERVICES, [1],
100 + [Define to yes if you have shared memory functions])
101 +)
102 +AC_CHECK_FUNCS([gethostbyname connect],
103 + [AC_DEFINE(HAVE_NET_SERVICES, [1],
104 + [Define to 1 if you have network functions])]
105 +)
106 +AC_CHECK_TYPE(long long,
107 + [AC_DEFINE(HAVE_LONGLONG, [1],
108 + [Define to 1 if your compiler supports long long])]
109 +)
110 +# check for flock_t
111 +AC_COMPILE_IFELSE(
112 + [AC_LANG_PROGRAM([[
113 +#include <sys/fcntl.h>
114 + ]], [[
115 +flock_t filler;
116 + ]])],
117 + [AC_DEFINE(HAVE_FLOCK_T, 1, [if you have flock_t])
118 + AC_MSG_RESULT("yes")],
119 + [AC_MSG_RESULT("no") ])
120 +
121 +if test "$HAVE_FLOCK_T" != 1; then
122 + AC_COMPILE_IFELSE([
123 + AC_LANG_PROGRAM([[
124 +#include <sys/flock.h>
125 + ]], [[
126 +flock_t filler;
127 + ]])],
128 + [AC_DEFINE(HAVE_FLOCK_T, 1, [if you have flock_t])
129 + AC_MSG_RESULT("yes")],
130 + [AC_MSG_RESULT("no") ])
131 +fi
132 +
133 +# check for union semun type
134 +AC_CHECK_TYPE(union semun,
135 + AC_DEFINE(HAVE_UNION_SEMUN, [1],
136 + [Define to 1 if you have semun in sys/sem.h]),,[
137 +#include <sys/types.h>
138 +#include <sys/ipc.h>
139 +#include <sys/sem.h>
140 + ]
141 +)
142 +
143 +# this quick check will add -lm to LIBS
144 +AC_CHECK_LIB(m, cos)
145 +
146 +AC_CONFIG_FILES([Makefile cfitsio.pc])
147 +AC_OUTPUT
148 --- Makefile.am.absent 1970-01-01 01:00:00.000000000 +0100
149 +++ Makefile.am 2008-06-02 00:54:40.000000000 +0100
150 @@ -0,0 +1,76 @@
151 +lib_LTLIBRARIES = libcfitsio.la
152 +
153 +C_SOURCES = buffers.c cfileio.c checksum.c compress.c drvrfile.c drvrmem.c \
154 + drvrnet.c drvrsmem.c editcol.c edithdu.c eval_l.c eval_y.c \
155 + eval_f.c fitscore.c getcol.c getcolb.c getcold.c getcole.c \
156 + getcoli.c getcolj.c getcolk.c getcoll.c getcols.c getcolsb.c \
157 + getcoluk.c getcolui.c getcoluj.c getkey.c group.c grparser.c \
158 + histo.c iraffits.c \
159 + modkey.c putcol.c putcolb.c putcold.c putcole.c putcoli.c \
160 + putcolj.c putcolk.c putcoluk.c putcoll.c putcols.c putcolsb.c \
161 + putcolu.c putcolui.c putcoluj.c putkey.c region.c scalnull.c \
162 + swapproc.c wcssub.c wcsutil.c imcompress.c quantize.c ricecomp.c \
163 + pliocomp.c
164 +
165 +F77_SOURCES=
166 +if ENABLE_FORTRAN
167 +F77_SOURCES += f77_wrap1.c f77_wrap2.c f77_wrap3.c f77_wrap4.c f77_wrap.h
168 +endif
169 +AM_YFLAGS = -d -v
170 +
171 +include_HEADERS = fitsio.h fitsio2.h longnam.h drvrsmem.h
172 +libcfitsio_la_SOURCES = $(C_SOURCES) $(F77_SOURCES) $(include_HEADERS)
173 +libcfitsio_la_LDFLAGS = -no-undefined -version-info @SHARED_VERSION_INFO@
174 +libcfitsio_la_CPPFLAGS = @CPPFLAGS_FORTRAN@ @CPPFLAGS_EXTRA@
175 +
176 +pkgconfigdir = $(libdir)/pkgconfig
177 +pkgconfig_DATA = cfitsio.pc
178 +
179 +LDADD = libcfitsio.la
180 +bin_PROGRAMS = fitscopy imcopy listhead
181 +fitscopy_SOURCES = fitscopy.c
182 +listhead_SOURCES = listhead.c
183 +imcopy_SOURCES = imcopy.c
184 +
185 +# tests
186 +check_PROGRAMS = testprog
187 +noinst_PROGRAMS = speed cookbook smem
188 +testprog_SOURCES = testprog.c
189 +speed_SOURCES = speed.c
190 +cookbook_SOURCES = cookbook.c
191 +smem_SOURCES = smem.c
192 +
193 +if ENABLE_FORTRAN
194 +check_PROGRAMS += testf77
195 +testf77_SOURCES = testf77.f
196 +endif
197 +
198 +check-local: $(check_PROGRAMS)
199 + @total=0; failed=0; \
200 + for i in $(check_PROGRAMS); do \
201 + echo "--- Testing $$i ---"; \
202 + ./$$i${EXEEXT} > my_$$i.out; \
203 + diff $$i.out my_$$i.out; \
204 + cmp $$i.fit $$i.std; \
205 + if [ "x$$?" = "x0" ]; then \
206 + echo "Test \`$$i' PASSED."; \
207 + else \
208 + echo "Test \`$$i' FAILED!!!"; \
209 + failed=$$(($$failed + 1)); \
210 + fi; \
211 + total=$$(($$total + 1)); \
212 + done; \
213 + if [ $$failed -gt 0 ]; then \
214 + echo "*** ERROR: $$failed/$$total tests failed!!!"; \
215 + echo ""; \
216 + exit 1; \
217 + fi
218 +
219 +eval:
220 + @$(LEX) -t eval.l > eval_l.c1; \
221 + sed -e 's/yy/ff/g' -e 's/YY/FF/g' eval_l.c1 > eval_l.c; \
222 + rm -f eval_l.c1; \
223 + $(YACC) -d -v -y eval.y; \
224 + sed -e 's/yy/ff/g' -e 's/YY/FF/g' y.tab.c > eval_y.c; \
225 + sed -e 's/yy/ff/g' -e 's/YY/FF/g' y.tab.h > eval_tab.h; \
226 + rm -f y.tab.c y.tab.h
227 --- cfitsio.pc.in.absent 1970-01-01 01:00:00.000000000 +0100
228 +++ cfitsio.pc.in 2008-06-02 01:24:58.000000000 +0100
229 @@ -0,0 +1,10 @@
230 +prefix=@prefix@
231 +exec_prefix=@exec_prefix@
232 +libdir=@libdir@
233 +includedir=@includedir@
234 +
235 +Name: @PACKAGE_NAME@
236 +Description: FITS File Subroutine Library
237 +Version: @PACKAGE_VERSION@
238 +Libs: -L${libdir} -lcfitsio @LIBS@
239 +Cflags: -I${includedir}
240
241
242
243 --
244 gentoo-commits@l.g.o mailing list