/[pkgs]/devel/ETL/ETL-0.04.12-build.patch
ViewVC logotype

Contents of /devel/ETL/ETL-0.04.12-build.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download) (as text)
Sun Mar 1 10:44:41 2009 UTC (8 months, 3 weeks ago) by lkundrak
Branch: MAIN
CVS Tags: F-11-split, ETL-0_04_12-2_fc12, ETL-0_04_12-1_fc11, F-12-split, HEAD
File MIME type: text/x-patch
Import ETL
1 Upstream review:
2 http://patches.synfig.org/r/12/
3
4 * Replace autoconf-generated etl_profile.h with custom one
5 - Do not use the HAVE_* autoconf macros so that we don't conflict
6 - Include only necessary defines
7 * Abort if mandatory checks don't pass
8 * Do not redefine v*printf
9
10 Lubomir Rintel <lkundrak@v3.sk>
11
12 diff -urp ETL-0.04.12.orig/configure.ac ETL-0.04.12/configure.ac
13 --- ETL-0.04.12.orig/configure.ac 2008-10-17 17:21:58.000000000 +0200
14 +++ ETL-0.04.12/configure.ac 2009-01-09 16:00:42.000000000 +0100
15 @@ -6,7 +6,7 @@ AC_INIT([Extended Template Library],[0.0
16 AC_REVISION
17
18 AC_CONFIG_AUX_DIR(config)
19 -AC_CONFIG_HEADERS([ETL/etl_profile_.h])
20 +AC_CONFIG_HEADERS([config.h])
21 AC_CANONICAL_HOST
22 AC_CANONICAL_TARGET
23
24 @@ -44,27 +44,14 @@ AC_WIN32_QUIRKS
25 # -- H E A D E R S --------------------------------------------
26
27 AH_TOP([
28 -// We want to be autoconf/autoheader friendly, so
29 -// if the developer has already included an
30 -// autoheader-generated configuration script,
31 -// we can assume that the user knew what they
32 -// were doing and let them use their own config.h.
33 -//#ifndef PACKAGE_TARNAME
34 +// This is not used anywhere
35 ])
36
37 -AH_BOTTOM([
38 -//#endif // ifndef PACKAGE_TARNAME
39 -])
40 -
41 -
42 # -- T Y P E S & S T R U C T S --------------------------------
43
44 # -- F U N C T I O N S ----------------------------------------
45
46 ETL_DEPS
47 -AC_CHECK_FUNCS([fork])
48 -AC_CHECK_FUNCS([kill])
49 -AC_CHECK_FUNCS([pipe])
50
51 # -- O U T P U T ----------------------------------------------
52
53 diff -urp ETL-0.04.12.orig/ETL/clock ETL-0.04.12/ETL/clock
54 --- ETL-0.04.12.orig/ETL/clock 2007-10-30 11:53:52.000000000 +0100
55 +++ ETL-0.04.12/ETL/clock 2009-01-09 16:00:42.000000000 +0100
56 @@ -29,7 +29,7 @@
57
58 #include "etl_config.h"
59
60 -#ifdef HAVE_GETTIMEOFDAY
61 +#ifdef ETL_HAS_GETTIMEOFDAY
62 #include "_clock_gettimeofday.h"
63 #ifndef ETL_CLOCK_DEFAULT_DESC_CLASS
64 #define ETL_CLOCK_DEFAULT_DESC_CLASS _ETL::clock_desc_gettimeofday
65 diff -urp ETL-0.04.12.orig/ETL/Makefile.am ETL-0.04.12/ETL/Makefile.am
66 --- ETL-0.04.12.orig/ETL/Makefile.am 2008-02-23 12:09:53.000000000 +0100
67 +++ ETL-0.04.12/ETL/Makefile.am 2009-01-09 16:00:42.000000000 +0100
68 @@ -2,14 +2,11 @@
69
70 MAINTAINERCLEANFILES=Makefile.in
71
72 -CLEANFILES=$(top_builddir)/ETL/etl_profile.h
73 +DISTCLEANFILES=$(top_builddir)/ETL/etl_profile.h
74
75 etldir = $(includedir)/ETL
76
77 etl_HEADERS= value _value.h rect _rect.h misc _misc.h ref_count _ref_count.h angle fastangle handle ipc thread fixed random clock hermite calculus stringf trivial spline _stringf.h _bspline.h _calculus.h _mutex_null.h _hermite.h _curve_func.h _clock_base.h _clock_system.h _clock_gettimeofday.h _random.h _angle.h _fastangle.h _curve.h _handle.h _thread.h _mutex_pthreads.h _mutex_win32.h _condition.h _rwlock.h smach _smach.h _trivial.h _fixed.h etl_config.h $(top_builddir)/ETL/etl_profile.h _fastangle_tables.h bezier _bezier.h _bezier_angle.h _status.h status pen _pen.h boxblur _boxblur.h gaussian _gaussian.h surface _surface.h smart_ptr _smart_ptr.h _clock_win32hpcount.h mutex _mutex_pthreads_simple.h
78
79 -$(top_builddir)/ETL/etl_profile.h:$(top_builddir)/ETL/etl_profile_.h
80 - sed "s/PACKAGE/ETL/g;" < $(top_builddir)/ETL/etl_profile_.h > $(top_builddir)/ETL/etl_profile.h
81 -
82 # FIXME: figure out why this is in SVN, but isn't installed
83 EXTRA_DIST=_bit_rotate.h
84 diff -urp ETL-0.04.12.orig/ETL/mutex ETL-0.04.12/ETL/mutex
85 --- ETL-0.04.12.orig/ETL/mutex 2008-02-23 12:09:53.000000000 +0100
86 +++ ETL-0.04.12/ETL/mutex 2009-01-09 16:00:42.000000000 +0100
87 @@ -29,7 +29,7 @@
88
89 #include "etl_config.h"
90
91 -#ifdef HAVE_LIBPTHREAD
92 +#ifdef ETL_HAS_LIBPTHREAD
93 # include "_mutex_pthreads_simple.h"
94 #else
95 #ifdef _WIN32
96 diff -urp ETL-0.04.12.orig/ETL/_mutex_pthreads.h ETL-0.04.12/ETL/_mutex_pthreads.h
97 --- ETL-0.04.12.orig/ETL/_mutex_pthreads.h 2007-03-16 01:37:48.000000000 +0100
98 +++ ETL-0.04.12/ETL/_mutex_pthreads.h 2009-01-09 16:00:42.000000000 +0100
99 @@ -33,7 +33,7 @@
100
101 #include <pthread.h>
102
103 -#ifdef HAVE_SCHED_H
104 +#ifdef ETL_HAS_SCHED_H
105 # include <sched.h>
106 #endif
107
108 diff -urp ETL-0.04.12.orig/ETL/_stringf.h ETL-0.04.12/ETL/_stringf.h
109 --- ETL-0.04.12.orig/ETL/_stringf.h 2008-01-25 13:23:29.000000000 +0100
110 +++ ETL-0.04.12/ETL/_stringf.h 2009-01-09 16:00:42.000000000 +0100
111 @@ -48,6 +48,13 @@
112 #define POPEN_BINARY_WRITE_TYPE "w"
113 #endif
114
115 +#ifdef ETL_HAS__VSNPRINTF
116 +#ifndef ETL_HAS_VSNPRINTF
117 +#define vnsprintf _vnsprintf
118 +#define ETL_HAS_VSNPRINTF 1
119 +#endif
120 +#endif
121 +
122 /* === T Y P E D E F S ===================================================== */
123
124 _ETL_BEGIN_CDECLS
125 @@ -58,24 +65,39 @@ _ETL_BEGIN_CDECLS
126 #define ETL_NO_THROW throw()
127 #endif
128
129 -#ifdef HAVE_VASPRINTF // This is the preferred method
130 +#ifdef __GLIBC__
131 +// We prefer prototypes from GLIBC, since defining them ourselves
132 +// works around its security mechanisms
133 +#define _GNU_SOURCE
134 +#include <stdio.h>
135 +#endif
136 +
137 +#ifdef ETL_HAS_VASPRINTF // This is the preferred method
138 +#ifndef __GLIBC__
139 extern int vasprintf(char **,const char *,va_list)ETL_NO_THROW;
140 +#endif
141 #else
142
143 -# ifdef HAVE_VSNPRINTF // This is the secondary method
144 +# ifdef ETL_HAS_VSNPRINTF // This is the secondary method
145 +#ifndef __GLIBC__
146 extern int vsnprintf(char *,size_t,const char*,va_list)ETL_NO_THROW;
147 +#endif
148 # endif
149
150 #endif
151
152 -#ifdef HAVE_VSSCANF
153 +#ifdef ETL_HAS_VSSCANF
154 +#ifndef __GLIBC__
155 extern int vsscanf(const char *,const char *,va_list)ETL_NO_THROW;
156 +#endif
157 #else
158 #define ETL_NO_VSTRSCANF
159 -#ifdef HAVE_SSCANF
160 +#ifdef ETL_HAS_SSCANF
161 +#ifndef __GLIBC__
162 extern int sscanf(const char *buf, const char *format, ...)ETL_NO_THROW;
163 #endif
164 #endif
165 +#endif
166
167 #include <unistd.h>
168
169 @@ -88,7 +110,7 @@ _ETL_BEGIN_NAMESPACE
170 inline std::string
171 vstrprintf(const char *format, va_list args)
172 {
173 -#ifdef HAVE_VASPRINTF // This is the preferred method (and safest)
174 +#ifdef ETL_HAS_VASPRINTF // This is the preferred method (and safest)
175 char *buffer;
176 std::string ret;
177 vasprintf(&buffer,format,args);
178 @@ -96,7 +118,7 @@ vstrprintf(const char *format, va_list a
179 free(buffer);
180 return ret;
181 #else
182 -#ifdef HAVE_VSNPRINTF // This is the secondary method (Safe, but bulky)
183 +#ifdef ETL_HAS_VSNPRINTF // This is the secondary method (Safe, but bulky)
184 #warning etl::vstrprintf() has a maximum size of ETL_STRPRINTF_MAX_LENGTH in this configuration.
185 #ifdef ETL_THREAD_SAFE
186 char buffer[ETL_STRPRINTF_MAX_LENGTH];
187 @@ -145,7 +167,7 @@ strscanf(const std::string &data, const
188 }
189 #else
190
191 -#if defined (HAVE_SSCANF) && defined (__GNUC__)
192 +#if defined (ETL_HAS_SSCANF) && defined (__GNUC__)
193 #define strscanf(data,format,...) sscanf(data.c_str(),format,__VA_ARGS__)
194 #endif
195 #endif
196 diff -urp ETL-0.04.12.orig/ETL/_thread.h ETL-0.04.12/ETL/_thread.h
197 --- ETL-0.04.12.orig/ETL/_thread.h 2007-03-16 01:37:48.000000000 +0100
198 +++ ETL-0.04.12/ETL/_thread.h 2009-01-09 16:00:42.000000000 +0100
199 @@ -31,21 +31,21 @@
200
201 #define __USE_GNU
202
203 -#ifdef HAVE_PTHREAD_H
204 +#ifdef ETL_HAS_PTHREAD_H
205 # include <pthread.h>
206 #endif
207
208 -#ifdef HAVE_SCHED_H
209 +#ifdef ETL_HAS_SCHED_H
210 # include <sched.h>
211 #endif
212
213 -#ifdef HAVE_CREATETHREAD
214 +#ifdef ETL_HAS_CREATETHREAD
215 # include <windows.h>
216 #endif
217
218 /* === M A C R O S ========================================================= */
219
220 -#if ( defined (HAVE_PTHREAD_CREATE) || defined (HAVE_CLONE) || defined (HAVE_CREATETHREAD) ) && !defined (NO_THREADS)
221 +#if ( defined (ETL_HAS_PTHREAD_CREATE) || defined (ETL_HAS_CLONE) || defined (ETL_HAS_CREATETHREAD) ) && !defined (NO_THREADS)
222 # define CALLISTO_THREADS
223 #endif
224
225 @@ -53,7 +53,7 @@
226
227 /* === C L A S S E S & S T R U C T S ======================================= */
228
229 -#if defined(CALLISTO_THREADS) && defined(HAVE_PTHREAD_CREATE)
230 +#if defined(CALLISTO_THREADS) && defined(ETL_HAS_PTHREAD_CREATE)
231 static inline void Yield(void)
232 {
233 sched_yield();
234 @@ -68,7 +68,7 @@ inline void Yield(void) { }
235
236 #ifdef CALLISTO_THREADS
237
238 -#ifdef HAVE_PTHREAD_CREATE
239 +#ifdef ETL_HAS_PTHREAD_CREATE
240
241 class Thread
242 {
243 @@ -207,7 +207,7 @@ public:
244 }
245 };
246
247 -#ifdef HAVE_PTHREAD_RW_LOCK_INIT
248 +#ifdef ETL_HAS_PTHREAD_RW_LOCK_INIT
249 class ReadWriteLock
250 {
251 pthread_rwlock_t rwlock;
252 @@ -290,8 +290,8 @@ public:
253 };
254 */
255
256 -#else // if defined HAVE_PTHREAD
257 -#ifdef HAVE_CREATETHREAD
258 +#else // if defined ETL_HAS_PTHREAD
259 +#ifdef ETL_HAS_CREATETHREAD
260
261
262 #ifdef THREAD_ENTRYPOINT
263 @@ -448,8 +448,8 @@ public:
264 };
265
266
267 -#endif // if defined HAVE_CREATETHREAD
268 -#endif // if defined HAVE_PTHREAD_CREATE
269 +#endif // if defined ETL_HAS_CREATETHREAD
270 +#endif // if defined ETL_HAS_PTHREAD_CREATE
271 #endif // if defined CALLISTO_THREADS
272
273
274 diff -urp ETL-0.04.12.orig/m4/ETL.m4 ETL-0.04.12/m4/ETL.m4
275 --- ETL-0.04.12.orig/m4/ETL.m4 2007-11-07 12:05:28.000000000 +0100
276 +++ ETL-0.04.12/m4/ETL.m4 2009-01-09 16:00:42.000000000 +0100
277 @@ -3,43 +3,71 @@
278 # $Id: ETL.m4 1115 2007-11-07 11:05:28Z pabs $
279 #
280 # By Robert B. Quattlebaum Jr. <darco@users.sf.net>
281 +# Errors are Lubomir Rintel's <lkundrak@v3.sk> fault
282 #
283
284 +AC_DEFUN([ETL_PROFILE], [
285 + etl_profile=$1
286 + echo "/* Configuration profile of ETL */" >$etl_profile
287 +])
288 +
289 +AC_DEFUN([ETL_CHECK_HEADER], [
290 + etl_header_name=AS_TR_CPP($1)
291 + AC_CHECK_HEADER($1,
292 + [echo "#define ETL_HAS_$etl_header_name 1" >> $etl_profile],
293 + [echo "/* #undef ETL_HAS_$etl_header_name */" >> $etl_profile])
294 +])
295 +
296 +AC_DEFUN([ETL_CHECK_FUNC], [
297 + etl_func_name=AS_TR_CPP($1)
298 + AC_CHECK_FUNC($1,
299 + [echo "#define ETL_HAS_$etl_func_name 1" >> $etl_profile],
300 + [echo "/* #undef ETL_HAS_$etl_func_name */" >> $etl_profile])
301 +])
302 +
303 +AC_DEFUN([ETL_CHECK_LIB], [
304 + etl_lib_name=AS_TR_CPP($1)
305 + AC_CHECK_LIB($1, $2,
306 + [echo "#define ETL_HAS_LIB$etl_lib_name 1" >> $etl_profile
307 + LIBS="$LIBS -l$1"],
308 + [echo "/* #undef ETL_HAS_LIB$etl_lib_name */" >> $etl_profile])
309 +])
310 +
311 AC_DEFUN([ETL_DEPS],
312 [
313 - AC_C_BIGENDIAN
314 -
315 - AC_CHECK_LIB(user32, main)
316 - AC_CHECK_LIB(kernel32, main)
317 - AC_CHECK_LIB(pthread, main)
318 -
319 - AC_HEADER_STDC
320 -
321 - AC_CHECK_HEADERS(pthread.h)
322 - AC_CHECK_HEADERS(sched.h)
323 - AC_CHECK_HEADERS(sys/times.h)
324 - AC_CHECK_HEADERS(sys/time.h)
325 - AC_CHECK_HEADERS(unistd.h)
326 - AC_CHECK_HEADERS(windows.h)
327 - AC_CHECK_FUNCS([pthread_create])
328 - AC_CHECK_FUNCS([pthread_rwlock_init])
329 - AC_CHECK_FUNCS([pthread_yield])
330 - AC_CHECK_FUNCS([sched_yield])
331 - AC_CHECK_FUNCS([CreateThread])
332 - AC_CHECK_FUNCS([__clone])
333 - AC_CHECK_FUNCS([QueryPerformanceCounter])
334 -
335 - AC_CHECK_FUNCS([gettimeofday])
336 - AC_CHECK_FUNCS([sscanf])
337 - AC_CHECK_FUNCS([vsscanf])
338 - AC_CHECK_FUNCS([vsprintf])
339 - AC_CHECK_FUNCS([vasprintf])
340 - AC_CHECK_FUNCS([vsnprintf],[],[
341 - AC_CHECK_FUNC([_vsnprintf],[
342 - AC_DEFINE(vsnprintf,_vsnprintf,[define if the vsnprintf function is mangled])
343 - AC_DEFINE(HAVE_VSNPRINTF,1)
344 - ])
345 - ])
346 + ETL_PROFILE(ETL/etl_profile.h)
347 +
348 + # Common mandatory
349 + AC_CHECK_HEADERS(sys/time.h, [],
350 + AC_MSG_ERROR([sys/time.h is needed]))
351 + AC_CHECK_HEADERS(unistd.h, [],
352 + AC_MSG_ERROR([unistd.h is needed]))
353 +
354 + # Mandatory on Windows
355 + if echo $host |grep -q win; then
356 + AC_CHECK_LIB(user32, main,
357 + AC_MSG_ERROR([user32 is needed]))
358 + AC_CHECK_LIB(kernel32, main,
359 + AC_MSG_ERROR([kernel32 is needed]))
360 + AC_CHECK_HEADERS(windows.h,
361 + AC_MSG_ERROR([windows.h is needed]))
362 + AC_CHECK_FUNCS([QueryPerformanceCounter],
363 + AC_MSG_ERROR([QueryPerformanceCounter is needed]))
364 + fi
365 +
366 + # Optional
367 + ETL_CHECK_HEADER(sched.h)
368 + ETL_CHECK_HEADER(pthread.h)
369 + ETL_CHECK_LIB(pthread, main)
370 + ETL_CHECK_FUNC([pthread_create])
371 + ETL_CHECK_FUNC([pthread_rwlock_init])
372 + ETL_CHECK_FUNC([CreateThread])
373 + ETL_CHECK_FUNC([gettimeofday])
374 + ETL_CHECK_FUNC([sscanf])
375 + ETL_CHECK_FUNC([vsscanf])
376 + ETL_CHECK_FUNC([vasprintf])
377 + ETL_CHECK_FUNC([vsnprintf])
378 + ETL_CHECK_FUNC([_vsnprintf])
379 ])
380
381 AC_DEFUN([USING_ETL],
382 diff -urp ETL-0.04.12.orig/Makefile.am ETL-0.04.12/Makefile.am
383 --- ETL-0.04.12.orig/Makefile.am 2008-02-03 02:38:12.000000000 +0100
384 +++ ETL-0.04.12/Makefile.am 2009-01-09 16:00:42.000000000 +0100
385 @@ -1,6 +1,6 @@
386 # $Id: Makefile.am 1558 2008-02-03 01:38:12Z pabs $
387
388 -MAINTAINERCLEANFILES=COPYING INSTALL config/config.guess config/config.sub config/ltmain.sh config/install-sh config/mkinstalldirs config/aclocal.m4 config/missing config/texinfo.tex config/depcomp aclocal.m4 config.h.in configure stamp-h.in Makefile.in config.log config.status .doc_stamp .DS_Store include/etl_profile.h.in doxygen.cfg
389 +MAINTAINERCLEANFILES=COPYING INSTALL config/config.guess config/config.sub config/ltmain.sh config/install-sh config/mkinstalldirs config/aclocal.m4 config/missing config/texinfo.tex config/depcomp aclocal.m4 config.h.in configure stamp-h.in Makefile.in config.log config.status .doc_stamp .DS_Store doxygen.cfg
390
391 SUBDIRS=ETL test
392
393 @@ -14,7 +14,7 @@ aclocaldir = $(prefix)/share/aclocal
394
395 ACLOCAL_AMFLAGS = -I m4
396
397 -EXTRA_DIST=COPYING m4/subs.m4 config/depcomp m4/cxx_macros.m4 ETL.pbproj/project.pbxproj ETL.pbproj/etl_profile.h ETL.pbproj/frameworkfix.cpp ETL-config.in m4/ETL.m4 doxygen.cfg.in doxygen.cfg ETL.pc.in
398 +EXTRA_DIST=COPYING m4/subs.m4 config/depcomp m4/cxx_macros.m4 ETL.pbproj/project.pbxproj ETL.pbproj/frameworkfix.cpp ETL-config.in m4/ETL.m4 doxygen.cfg.in doxygen.cfg ETL.pc.in
399
400 CVS=cvs
401 SVN=svn

admin@fedoraproject.org
ViewVC Help
Powered by ViewVC 1.1.2