wok-next view ucl/stuff/patches/02-Autoreconf.patch @ rev 20418

Add mdiedit, xlunch
author Aleksej Bobylev <al.bobylev@gmail.com>
date Wed Jan 10 17:32:40 2018 +0200 (2018-01-10)
parents
children
line source
1 From: Robert Luberda <robert@debian.org>
2 Date: Wed, 21 May 2014 23:23:49 +0200
3 Subject: 02 Autoreconf
5 Fix autoconf files to make it possible to call autoreconf, see bug #744671.
6 The acc[123].m4 files were extracted from the original aclocal.m4 file.
7 ---
8 Makefile.am | 2 +
9 configure.ac | 4 +-
10 examples/Makefile.am | 2 +-
11 m4/acc1.m4 | 97 ++++++++++++++++++++++++++++++++++
12 m4/acc2.m4 | 42 +++++++++++++++
13 m4/acc3.m4 | 143 +++++++++++++++++++++++++++++++++++++++++++++++++++
14 src/Makefile.am | 5 +-
15 7 files changed, 290 insertions(+), 5 deletions(-)
16 create mode 100644 m4/acc1.m4
17 create mode 100644 m4/acc2.m4
18 create mode 100644 m4/acc3.m4
20 diff --git a/Makefile.am b/Makefile.am
21 index 3570c33..f615f27 100644
22 --- a/Makefile.am
23 +++ b/Makefile.am
24 @@ -5,6 +5,8 @@
26 AUTOMAKE_OPTIONS = 1.8.5 foreign
28 +ACLOCAL_AMFLAGS = -I m4
29 +
30 SUBDIRS = include src examples
32 dist-hook:
33 diff --git a/configure.ac b/configure.ac
34 index 16adb1d..96ffde0 100644
35 --- a/configure.ac
36 +++ b/configure.ac
37 @@ -47,8 +47,10 @@ AC_CANONICAL_HOST
38 AC_CANONICAL_TARGET
39 AM_MAINTAINER_MODE
41 +AC_CONFIG_MACRO_DIR([m4])
42 +
43 if test -z "$ac_abs_top_srcdir"; then
44 - _AC_SRCPATHS(.)
45 + _AC_SRCDIRS(.)
46 fi
47 if test -r .Conf.settings1; then
48 . ./.Conf.settings1
49 diff --git a/examples/Makefile.am b/examples/Makefile.am
50 index 4f1be03..bd33c6a 100644
51 --- a/examples/Makefile.am
52 +++ b/examples/Makefile.am
53 @@ -3,7 +3,7 @@
54 # Copyright (C) 1996-2004 Markus F.X.J. Oberhumer
55 #
57 -INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
58 +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)
60 noinst_PROGRAMS = simple uclpack
62 diff --git a/m4/acc1.m4 b/m4/acc1.m4
63 new file mode 100644
64 index 0000000..d1ccb5b
65 --- /dev/null
66 +++ b/m4/acc1.m4
67 @@ -0,0 +1,97 @@
68 +# serial 1
69 +
70 +# /***********************************************************************
71 +# // standard ACC macros
72 +# ************************************************************************/
73 +
74 +AC_DEFUN([mfx_ACC_CHECK_ENDIAN], [
75 +AC_C_BIGENDIAN([AC_DEFINE(ACC_ENDIAN_BIG_ENDIAN,1,[Define to 1 if your machine is big endian.])],[AC_DEFINE(ACC_ENDIAN_LITTLE_ENDIAN,1,[Define to 1 if your machine is little endian.])])
76 +])#
77 +
78 +AC_DEFUN([mfx_ACC_CHECK_HEADERS], [
79 +AC_HEADER_TIME
80 +AC_CHECK_HEADERS([assert.h ctype.h dirent.h errno.h fcntl.h limits.h malloc.h memory.h setjmp.h signal.h stdarg.h stddef.h stdint.h stdio.h stdlib.h string.h strings.h time.h unistd.h utime.h sys/stat.h sys/time.h sys/types.h])
81 +])#
82 +
83 +AC_DEFUN([mfx_ACC_CHECK_FUNCS], [
84 +AC_CHECK_FUNCS(access alloca atexit atoi atol chmod chown ctime difftime fstat gettimeofday gmtime localtime longjmp lstat memcmp memcpy memmove memset mktime qsort raise setjmp signal snprintf strcasecmp strchr strdup strerror strftime stricmp strncasecmp strnicmp strrchr strstr time umask utime vsnprintf)
85 +])#
86 +
87 +
88 +AC_DEFUN([mfx_ACC_CHECK_SIZEOF], [
89 +AC_CHECK_SIZEOF(short)
90 +AC_CHECK_SIZEOF(int)
91 +AC_CHECK_SIZEOF(long)
92 +
93 +AC_CHECK_SIZEOF(ptrdiff_t)
94 +AC_CHECK_SIZEOF(size_t)
95 +AC_CHECK_SIZEOF(void *)
96 +AC_CHECK_SIZEOF(char *)
97 +
98 +AC_CHECK_SIZEOF(long long)
99 +AC_CHECK_SIZEOF(unsigned long long)
100 +AC_CHECK_SIZEOF(__int64)
101 +AC_CHECK_SIZEOF(unsigned __int64)
102 +])#
103 +
104 +
105 +# /***********************************************************************
106 +# // Check for ACC_conformance
107 +# ************************************************************************/
108 +
109 +AC_DEFUN([mfx_ACC_ACCCHK], [
110 +mfx_tmp=$1
111 +mfx_save_CPPFLAGS=$CPPFLAGS
112 +dnl in Makefile.in $(INCLUDES) will be before $(CPPFLAGS), so we mimic this here
113 +test "X$mfx_tmp" = "X" || CPPFLAGS="$mfx_tmp $CPPFLAGS"
114 +
115 +AC_MSG_CHECKING([whether your compiler passes the ACC conformance test])
116 +
117 +AC_LANG_CONFTEST([AC_LANG_PROGRAM(
118 +[[#define ACC_CONFIG_NO_HEADER 1
119 +#include "acc/acc.h"
120 +#include "acc/acc_incd.h"
121 +#undef ACCCHK_ASSERT
122 +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT_HEADER(expr)
123 +#include "acc/acc_chk.ch"
124 +#undef ACCCHK_ASSERT
125 +static void test_acc_compile_time_assert(void) {
126 +#define ACCCHK_ASSERT(expr) ACC_COMPILE_TIME_ASSERT(expr)
127 +#include "acc/acc_chk.ch"
128 +#undef ACCCHK_ASSERT
129 +}
130 +#undef NDEBUG
131 +#include <assert.h>
132 +static int test_acc_run_time_assert(int r) {
133 +#define ACCCHK_ASSERT(expr) assert(expr);
134 +#include "acc/acc_chk.ch"
135 +#undef ACCCHK_ASSERT
136 +return r;
137 +}
138 +]], [[
139 +test_acc_compile_time_assert();
140 +if (test_acc_run_time_assert(1) != 1) return 1;
141 +]]
142 +)])
143 +
144 +mfx_tmp=FAILED
145 +_AC_COMPILE_IFELSE([], [mfx_tmp=yes])
146 +rm -f conftest.$ac_ext conftest.$ac_objext
147 +
148 +CPPFLAGS=$mfx_save_CPPFLAGS
149 +
150 +AC_MSG_RESULT([$mfx_tmp])
151 +case x$mfx_tmp in
152 + xpassed | xyes) ;;
153 + *)
154 + AC_MSG_NOTICE([])
155 + AC_MSG_NOTICE([Your compiler failed the ACC conformance test - for details see ])
156 + AC_MSG_NOTICE([`config.log'. Please check that log file and consider sending])
157 + AC_MSG_NOTICE([a patch or bug-report to <${PACKAGE_BUGREPORT}>.])
158 + AC_MSG_NOTICE([Thanks for your support.])
159 + AC_MSG_NOTICE([])
160 + AC_MSG_ERROR([ACC conformance test failed. Stop.])
161 +dnl AS_EXIT
162 + ;;
163 +esac
164 +])# mfx_ACC_ACCCHK
165 diff --git a/m4/acc2.m4 b/m4/acc2.m4
166 new file mode 100644
167 index 0000000..f0ce59b
168 --- /dev/null
169 +++ b/m4/acc2.m4
170 @@ -0,0 +1,42 @@
171 +# serial 1
172 +
173 +AC_DEFUN([mfx_PROG_CPPFLAGS], [
174 +AC_MSG_CHECKING([whether the C preprocessor needs special flags])
175 +
176 +AC_LANG_CONFTEST([AC_LANG_PROGRAM(
177 +[[#include <limits.h>
178 +#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
179 +# include "your C preprocessor is broken 1"
180 +#elif (0xffffu == 0xfffffffful)
181 +# include "your C preprocessor is broken 2"
182 +#elif (32767 >= ULONG_MAX) || (65535u >= ULONG_MAX)
183 +# include "your C preprocessor is broken 3"
184 +#endif
185 +]], [[ ]]
186 +)])
187 +
188 +mfx_save_CPPFLAGS=$CPPFLAGS
189 +mfx_tmp=ERROR
190 +for mfx_arg in "" -no-cpp-precomp
191 +do
192 + CPPFLAGS="$mfx_arg $mfx_save_CPPFLAGS"
193 + _AC_COMPILE_IFELSE([],
194 +[mfx_tmp=$mfx_arg
195 +break])
196 +done
197 +CPPFLAGS=$mfx_save_CPPFLAGS
198 +rm -f conftest.$ac_ext conftest.$ac_objext
199 +case x$mfx_tmp in
200 + x)
201 + AC_MSG_RESULT([none needed]) ;;
202 + xERROR)
203 + AC_MSG_RESULT([ERROR])
204 + AC_MSG_ERROR([your C preprocessor is broken - for details see config.log])
205 + ;;
206 + *)
207 + AC_MSG_RESULT([$mfx_tmp])
208 + CPPFLAGS="$mfx_tmp $CPPFLAGS"
209 + ;;
210 +esac
211 +])# mfx_PROG_CPPFLAGS
212 +
213 diff --git a/m4/acc3.m4 b/m4/acc3.m4
214 new file mode 100644
215 index 0000000..a6ff628
216 --- /dev/null
217 +++ b/m4/acc3.m4
218 @@ -0,0 +1,143 @@
219 +# serial 3
220 +
221 +AC_DEFUN([mfx_CHECK_HEADER_SANE_LIMITS_H], [
222 +AC_CACHE_CHECK([whether limits.h is sane],
223 +mfx_cv_header_sane_limits_h,
224 +[AC_TRY_COMPILE([#include <limits.h>
225 +#if (32767 >= 4294967295ul) || (65535u >= 4294967295ul)
226 +# if defined(__APPLE__) && defined(__GNUC__)
227 +# error "your preprocessor is broken - use compiler option -no-cpp-precomp"
228 +# else
229 +# include "your preprocessor is broken"
230 +# endif
231 +#endif
232 +#define MFX_0xffff 0xffff
233 +#define MFX_0xffffffffL 4294967295ul
234 +#if !defined(CHAR_BIT) || (CHAR_BIT != 8)
235 +# include "error CHAR_BIT"
236 +#endif
237 +#if !defined(UCHAR_MAX)
238 +# include "error UCHAR_MAX 1"
239 +#endif
240 +#if !defined(USHRT_MAX)
241 +# include "error USHRT_MAX 1"
242 +#endif
243 +#if !defined(UINT_MAX)
244 +# include "error UINT_MAX 1"
245 +#endif
246 +#if !defined(ULONG_MAX)
247 +# include "error ULONG_MAX 1"
248 +#endif
249 +#if !defined(SHRT_MAX)
250 +# include "error SHRT_MAX 1"
251 +#endif
252 +#if !defined(INT_MAX)
253 +# include "error INT_MAX 1"
254 +#endif
255 +#if !defined(LONG_MAX)
256 +# include "error LONG_MAX 1"
257 +#endif
258 +#if (UCHAR_MAX < 1)
259 +# include "error UCHAR_MAX 2"
260 +#endif
261 +#if (USHRT_MAX < 1)
262 +# include "error USHRT_MAX 2"
263 +#endif
264 +#if (UINT_MAX < 1)
265 +# include "error UINT_MAX 2"
266 +#endif
267 +#if (ULONG_MAX < 1)
268 +# include "error ULONG_MAX 2"
269 +#endif
270 +#if (UCHAR_MAX < 0xff)
271 +# include "error UCHAR_MAX 3"
272 +#endif
273 +#if (USHRT_MAX < MFX_0xffff)
274 +# include "error USHRT_MAX 3"
275 +#endif
276 +#if (UINT_MAX < MFX_0xffff)
277 +# include "error UINT_MAX 3"
278 +#endif
279 +#if (ULONG_MAX < MFX_0xffffffffL)
280 +# include "error ULONG_MAX 3"
281 +#endif
282 +#if (USHRT_MAX > UINT_MAX)
283 +# include "error USHRT_MAX vs UINT_MAX"
284 +#endif
285 +#if (UINT_MAX > ULONG_MAX)
286 +# include "error UINT_MAX vs ULONG_MAX"
287 +#endif
288 +],[
289 +#if (USHRT_MAX == MFX_0xffff)
290 +{ typedef char a_short2a[1 - 2 * !(sizeof(short) == 2)]; }
291 +#elif (USHRT_MAX >= MFX_0xffff)
292 +{ typedef char a_short2b[1 - 2 * !(sizeof(short) > 2)]; }
293 +#endif
294 +#if (UINT_MAX == MFX_0xffff)
295 +{ typedef char a_int2a[1 - 2 * !(sizeof(int) == 2)]; }
296 +#elif (UINT_MAX >= MFX_0xffff)
297 +{ typedef char a_int2b[1 - 2 * !(sizeof(int) > 2)]; }
298 +#endif
299 +#if (ULONG_MAX == MFX_0xffff)
300 +{ typedef char a_long2a[1 - 2 * !(sizeof(long) == 2)]; }
301 +#elif (ULONG_MAX >= MFX_0xffff)
302 +{ typedef char a_long2b[1 - 2 * !(sizeof(long) > 2)]; }
303 +#endif
304 +#if (USHRT_MAX == MFX_0xffffffffL)
305 +{ typedef char a_short4a[1 - 2 * !(sizeof(short) == 4)]; }
306 +#elif (USHRT_MAX >= MFX_0xffffffffL)
307 +{ typedef char a_short4b[1 - 2 * !(sizeof(short) > 4)]; }
308 +#endif
309 +#if (UINT_MAX == MFX_0xffffffffL)
310 +{ typedef char a_int4a[1 - 2 * !(sizeof(int) == 4)]; }
311 +#elif (UINT_MAX >= MFX_0xffffffffL)
312 +{ typedef char a_int4b[1 - 2 * !(sizeof(int) > 4)]; }
313 +#endif
314 +#if (ULONG_MAX == MFX_0xffffffffL)
315 +{ typedef char a_long4a[1 - 2 * !(sizeof(long) == 4)]; }
316 +#elif (ULONG_MAX >= MFX_0xffffffffL)
317 +{ typedef char a_long4b[1 - 2 * !(sizeof(long) > 4)]; }
318 +#endif
319 +],
320 +mfx_cv_header_sane_limits_h=yes,
321 +mfx_cv_header_sane_limits_h=no)])
322 +])
323 +
324 +# /***********************************************************************
325 +# //
326 +# ************************************************************************/
327 +
328 +dnl more types which are not yet covered by ACC
329 +
330 +AC_DEFUN([mfx_CHECK_SIZEOF], [
331 +AC_CHECK_SIZEOF(__int32)
332 +AC_CHECK_SIZEOF(unsigned __int32)
333 +AC_CHECK_SIZEOF(intmax_t)
334 +AC_CHECK_SIZEOF(uintmax_t)
335 +AC_CHECK_SIZEOF(intptr_t)
336 +AC_CHECK_SIZEOF(uintptr_t)
337 +
338 +AC_CHECK_SIZEOF(float)
339 +AC_CHECK_SIZEOF(double)
340 +AC_CHECK_SIZEOF(long double)
341 +
342 +AC_CHECK_SIZEOF(dev_t)
343 +AC_CHECK_SIZEOF(fpos_t)
344 +AC_CHECK_SIZEOF(mode_t)
345 +AC_CHECK_SIZEOF(off_t)
346 +AC_CHECK_SIZEOF(ssize_t)
347 +AC_CHECK_SIZEOF(time_t)
348 +])#
349 +
350 +
351 +
352 +AC_DEFUN([mfx_CHECK_LIB_WINMM], [
353 +if test "X$GCC" = Xyes; then
354 +case $host_os in
355 +cygwin* | mingw* | pw32*)
356 + LIBS="$LIBS -lwinmm" ;;
357 +*)
358 + ;;
359 +esac
360 +fi
361 +])#
362 diff --git a/src/Makefile.am b/src/Makefile.am
363 index 78d0e51..bdb99a0 100644
364 --- a/src/Makefile.am
365 +++ b/src/Makefile.am
366 @@ -6,9 +6,8 @@
367 VPATH = @srcdir@@UCL_ASM_VPATH@
368 SUFFIXES = .S
370 -INCLUDES = -I$(top_srcdir)/include -I$(top_srcdir)
371 -CPPFLAGS = $(UCL_CPPFLAGS) $(configure_CPPFLAGS) $(UCL_EXTRA_CPPFLAGS)
372 -CFLAGS = $(UCL_CFLAGS) $(configure_CFLAGS) $(UCL_EXTRA_CFLAGS)
373 +AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir) $(UCL_CPPFLAGS) $(configure_CPPFLAGS) $(UCL_EXTRA_CPPFLAGS)
374 +AM_CFLAGS = $(UCL_CFLAGS) $(configure_CFLAGS) $(UCL_EXTRA_CFLAGS)
376 lib_LTLIBRARIES = libucl.la