~ubuntu-branches/ubuntu/maverick/mpop/maverick

« back to all changes in this revision

Viewing changes to gnulib/m4/stdint.m4

  • Committer: Bazaar Package Importer
  • Author(s): Emmanuel Bouthenot
  • Date: 2009-08-14 18:08:48 UTC
  • mfrom: (1.1.5 upstream)
  • Revision ID: james.westby@ubuntu.com-20090814180848-f31eii74n1dnzimr
Tags: 1.0.17-1
* New upstream release (Closes: #513223)
* Adopting the package: setting me as maintainer.
* Add a Homepage field.
* Bump Standards-Version to 3.8.2.
* Update debian/copyright:
  - point to the GPLv3 licence from /usr/share/common-licences
    instead of including the whole licence.
  - Add new copyright holders.
  - Cleaning and refactoring.
* Add Vcs-Git and Vcs-Browser fields.
* Switch packaging from CDBS to "plain debhelper".
* Update debian/compat to version 7.
* New binary package mpop-gnome (mpop with GNOME keyring support)
  which depends on "standard" mpop package and diverts /usr/bin/mpop.
* Update patch which fixes lintian warnings about hyphens in mpop
  manpage.
* Add DM-Upload-Allowed field.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# stdint.m4 serial 27
2
 
dnl Copyright (C) 2001-2007 Free Software Foundation, Inc.
 
1
# stdint.m4 serial 34
 
2
dnl Copyright (C) 2001-2009 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
9
9
 
10
10
AC_DEFUN([gl_STDINT_H],
11
11
[
12
 
  AC_PREREQ(2.59)dnl
 
12
  AC_PREREQ([2.59])dnl
13
13
 
14
14
  dnl Check for long long int and unsigned long long int.
15
15
  AC_REQUIRE([AC_TYPE_LONG_LONG_INT])
59
59
      [gl_cv_header_working_stdint_h],
60
60
      [gl_cv_header_working_stdint_h=no
61
61
       AC_COMPILE_IFELSE([
62
 
         AC_LANG_PROGRAM([gl_STDINT_INCLUDES
63
 
         [
 
62
         AC_LANG_PROGRAM([[
64
63
#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
65
64
#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
66
65
#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
67
66
#include <stdint.h>
 
67
/* Dragonfly defines WCHAR_MIN, WCHAR_MAX only in <wchar.h>.  */
 
68
#if !(defined WCHAR_MIN && defined WCHAR_MAX)
 
69
#error "WCHAR_MIN, WCHAR_MAX not defined in <stdint.h>"
 
70
#endif
 
71
]
 
72
gl_STDINT_INCLUDES
 
73
[
68
74
#ifdef INT8_MAX
69
75
int8_t a1 = INT8_MAX;
70
76
int8_t a1min = INT8_MIN;
195
201
  int check_size: (size_t) -1 == SIZE_MAX ? 1 : -1;
196
202
};
197
203
         ]])],
198
 
         [gl_cv_header_working_stdint_h=yes])])
 
204
         [dnl Determine whether the various *_MIN, *_MAX macros are usable
 
205
          dnl in preprocessor expression. We could do it by compiling a test
 
206
          dnl program for each of these macros. It is faster to run a program
 
207
          dnl that inspects the macro expansion.
 
208
          dnl This detects a bug on HP-UX 11.23/ia64.
 
209
          AC_RUN_IFELSE([
 
210
            AC_LANG_PROGRAM([[
 
211
#define __STDC_LIMIT_MACROS 1 /* to make it work also in C++ mode */
 
212
#define __STDC_CONSTANT_MACROS 1 /* to make it work also in C++ mode */
 
213
#define _GL_JUST_INCLUDE_SYSTEM_STDINT_H 1 /* work if build isn't clean */
 
214
#include <stdint.h>
 
215
]
 
216
gl_STDINT_INCLUDES
 
217
[
 
218
#include <stdio.h>
 
219
#include <string.h>
 
220
#define MVAL(macro) MVAL1(macro)
 
221
#define MVAL1(expression) #expression
 
222
static const char *macro_values[] =
 
223
  {
 
224
#ifdef INT8_MAX
 
225
    MVAL (INT8_MAX),
 
226
#endif
 
227
#ifdef INT16_MAX
 
228
    MVAL (INT16_MAX),
 
229
#endif
 
230
#ifdef INT32_MAX
 
231
    MVAL (INT32_MAX),
 
232
#endif
 
233
#ifdef INT64_MAX
 
234
    MVAL (INT64_MAX),
 
235
#endif
 
236
#ifdef UINT8_MAX
 
237
    MVAL (UINT8_MAX),
 
238
#endif
 
239
#ifdef UINT16_MAX
 
240
    MVAL (UINT16_MAX),
 
241
#endif
 
242
#ifdef UINT32_MAX
 
243
    MVAL (UINT32_MAX),
 
244
#endif
 
245
#ifdef UINT64_MAX
 
246
    MVAL (UINT64_MAX),
 
247
#endif
 
248
    NULL
 
249
  };
 
250
]], [[
 
251
  const char **mv;
 
252
  for (mv = macro_values; *mv != NULL; mv++)
 
253
    {
 
254
      const char *value = *mv;
 
255
      /* Test whether it looks like a cast expression.  */
 
256
      if (strncmp (value, "((unsigned int)"/*)*/, 15) == 0
 
257
          || strncmp (value, "((unsigned short)"/*)*/, 17) == 0
 
258
          || strncmp (value, "((unsigned char)"/*)*/, 16) == 0
 
259
          || strncmp (value, "((int)"/*)*/, 6) == 0
 
260
          || strncmp (value, "((signed short)"/*)*/, 15) == 0
 
261
          || strncmp (value, "((signed char)"/*)*/, 14) == 0)
 
262
        return 1;
 
263
    }
 
264
  return 0;
 
265
]])],
 
266
              [gl_cv_header_working_stdint_h=yes],
 
267
              [],
 
268
              [dnl When cross-compiling, assume it works.
 
269
               gl_cv_header_working_stdint_h=yes
 
270
              ])
 
271
         ])
 
272
      ])
199
273
  fi
200
274
  if test "$gl_cv_header_working_stdint_h" = yes; then
201
275
    STDINT_H=
223
297
    gl_STDINT_TYPE_PROPERTIES
224
298
    STDINT_H=stdint.h
225
299
  fi
226
 
  AC_SUBST(STDINT_H)
 
300
  AC_SUBST([STDINT_H])
227
301
])
228
302
 
229
303
dnl gl_STDINT_BITSIZEOF(TYPES, INCLUDES)
234
308
  dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
235
309
  dnl   config.h.in,
236
310
  dnl - extra AC_SUBST calls, so that the right substitutions are made.
237
 
  AC_FOREACH([gltype], [$1],
 
311
  m4_foreach_w([gltype], [$1],
238
312
    [AH_TEMPLATE([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
239
313
       [Define to the number of bits in type ']gltype['.])])
240
314
  for gltype in $1 ; do
259
333
    AC_DEFINE_UNQUOTED([BITSIZEOF_${GLTYPE}], [$result])
260
334
    eval BITSIZEOF_${GLTYPE}=\$result
261
335
  done
262
 
  AC_FOREACH([gltype], [$1],
 
336
  m4_foreach_w([gltype], [$1],
263
337
    [AC_SUBST([BITSIZEOF_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
264
338
])
265
339
 
272
346
  dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
273
347
  dnl   config.h.in,
274
348
  dnl - extra AC_SUBST calls, so that the right substitutions are made.
275
 
  AC_FOREACH([gltype], [$1],
 
349
  m4_foreach_w([gltype], [$1],
276
350
    [AH_TEMPLATE([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]),
277
351
       [Define to 1 if ']gltype[' is a signed integer type.])])
278
352
  for gltype in $1 ; do
286
360
    eval result=\$gl_cv_type_${gltype}_signed
287
361
    GLTYPE=`echo $gltype | tr 'abcdefghijklmnopqrstuvwxyz ' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`
288
362
    if test "$result" = yes; then
289
 
      AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], 1)
 
363
      AC_DEFINE_UNQUOTED([HAVE_SIGNED_${GLTYPE}], [1])
290
364
      eval HAVE_SIGNED_${GLTYPE}=1
291
365
    else
292
366
      eval HAVE_SIGNED_${GLTYPE}=0
293
367
    fi
294
368
  done
295
 
  AC_FOREACH([gltype], [$1],
 
369
  m4_foreach_w([gltype], [$1],
296
370
    [AC_SUBST([HAVE_SIGNED_]translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_]))])
297
371
])
298
372
 
305
379
  dnl - extra AH_TEMPLATE calls, so that autoheader knows what to put into
306
380
  dnl   config.h.in,
307
381
  dnl - extra AC_SUBST calls, so that the right substitutions are made.
308
 
  AC_FOREACH([gltype], [$1],
 
382
  m4_foreach_w([gltype], [$1],
309
383
    [AH_TEMPLATE(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX],
310
384
       [Define to l, ll, u, ul, ull, etc., as suitable for
311
385
        constants of type ']gltype['.])])
331
405
           ui64)gltype1='unsigned __int64';;
332
406
         esac
333
407
         AC_COMPILE_IFELSE(
334
 
           [AC_LANG_PROGRAM([$2
 
408
           [AC_LANG_PROGRAM([$2[
335
409
              extern $gltype foo;
336
 
              extern $gltype1 foo;])],
 
410
              extern $gltype1 foo;]])],
337
411
           [eval gl_cv_type_${gltype}_suffix=\$glsuf])
338
412
         eval result=\$gl_cv_type_${gltype}_suffix
339
413
         test "$result" != no && break
342
416
    eval result=\$gl_cv_type_${gltype}_suffix
343
417
    test "$result" = no && result=
344
418
    eval ${GLTYPE}_SUFFIX=\$result
345
 
    AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], $result)
 
419
    AC_DEFINE_UNQUOTED([${GLTYPE}_SUFFIX], [$result])
346
420
  done
347
 
  AC_FOREACH([gltype], [$1],
 
421
  m4_foreach_w([gltype], [$1],
348
422
    [AC_SUBST(translit(gltype,[abcdefghijklmnopqrstuvwxyz ],[ABCDEFGHIJKLMNOPQRSTUVWXYZ_])[_SUFFIX])])
349
423
])
350
424
 
364
438
 
365
439
dnl gl_STDINT_TYPE_PROPERTIES
366
440
dnl Compute HAVE_SIGNED_t, BITSIZEOF_t and t_SUFFIX, for all the types t
367
 
dnl of interest to stdint_.h.
 
441
dnl of interest to stdint.in.h.
368
442
AC_DEFUN([gl_STDINT_TYPE_PROPERTIES],
369
443
[
370
 
  gl_STDINT_BITSIZEOF([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
 
444
  AC_REQUIRE([gl_MULTIARCH])
 
445
  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
446
    gl_STDINT_BITSIZEOF([ptrdiff_t size_t],
 
447
      [gl_STDINT_INCLUDES])
 
448
  fi
 
449
  gl_STDINT_BITSIZEOF([sig_atomic_t wchar_t wint_t],
371
450
    [gl_STDINT_INCLUDES])
372
451
  gl_CHECK_TYPES_SIGNED([sig_atomic_t wchar_t wint_t],
373
452
    [gl_STDINT_INCLUDES])
374
453
  gl_cv_type_ptrdiff_t_signed=yes
375
454
  gl_cv_type_size_t_signed=no
376
 
  gl_INTEGER_TYPE_SUFFIX([ptrdiff_t sig_atomic_t size_t wchar_t wint_t],
 
455
  if test $APPLE_UNIVERSAL_BUILD = 0; then
 
456
    gl_INTEGER_TYPE_SUFFIX([ptrdiff_t size_t],
 
457
      [gl_STDINT_INCLUDES])
 
458
  fi
 
459
  gl_INTEGER_TYPE_SUFFIX([sig_atomic_t wchar_t wint_t],
377
460
    [gl_STDINT_INCLUDES])
378
461
])
379
462