File: configure.in

package info (click to toggle)
xwrits 2.19-1
  • links: PTS
  • area: main
  • in suites: woody
  • size: 564 kB
  • ctags: 641
  • sloc: ansic: 5,242; sh: 330; makefile: 93
file content (102 lines) | stat: -rw-r--r-- 2,392 bytes parent folder | download
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
dnl Process this file with autoconf to produce a configure script.
AC_INIT(xwrits.h)
AM_INIT_AUTOMAKE(xwrits, 2.19)
AM_CONFIG_HEADER(config.h)

AC_PROG_CC
AC_C_CONST
AC_C_INLINE

AC_ARG_ENABLE(warnings,
[  --enable-warnings       compile with -Wall],
if test "$enableval" = yes ; then
  CC="$CC -Wall"
fi)

AC_PATH_XTRA

dnl
dnl strerror()?
dnl

AC_REPLACE_FUNCS(strerror)

dnl
dnl gettimeofday()
dnl

AC_CACHE_CHECK(for gettimeofday prototype, ac_cv_gettimeofday,
[AC_TRY_COMPILE([#include <time.h>
#include <sys/time.h>],
[gettimeofday((void *)0, (void *)0);],
[AC_TRY_COMPILE([#include <time.h>
#include <sys/time.h>],
[gettimeofday((void *)0);],
ac_cv_gettimeofday=0,
ac_cv_gettimeofday=2)],
ac_cv_gettimeofday=1)])
AC_DEFINE_UNQUOTED(GETTIMEOFDAY_PROTO, $ac_cv_gettimeofday)

dnl
dnl Integer typedefs
dnl

AC_CHECK_HEADERS(inttypes.h)

AC_CACHE_CHECK(for integer typedefs, ac_cv_int_types,
[AC_EGREP_HEADER(uint32_t, sys/types.h, ac_cv_int_types=yes,
  AC_EGREP_HEADER(u_int32_t, sys/types.h, ac_cv_int_types=close,
   ac_cv_int_types=no))])

if test "$ac_cv_int_types" = no ;
then
  # Define our own versions
  AC_CACHE_CHECK(for a 16-bit value, ac_cv_int16,
  [AC_TRY_RUN([#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
  FILE *f = fopen("conftestval", "w");
  if (!f) exit(1);
  if (sizeof(short) == 2) fprintf(f, "short\n");
  else exit(1);
  fclose(f);
  exit(0);
}], ac_cv_int16=`cat conftestval`,
  AC_MSG_ERROR(no 16-bit value found),
  ac_cv_int16=short)])

  AC_CACHE_CHECK(for a 32-bit value, ac_cv_int32,
  [AC_TRY_RUN([#include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
  FILE *f = fopen("conftestval", "w");
  if (!f) exit(1);
  if (sizeof(int) == 4) fprintf(f, "int\n");
  else if (sizeof(long) == 4) fprintf(f, "long\n");
  else exit(1);
  fclose(f);
  exit(0);
}], ac_cv_int32=`cat conftestval`, 
  AC_MSG_ERROR(no 32-bit value found),
  ac_cv_int32=int)])
fi

if test "$ac_cv_header_inttypes_h" = yes; then
  :
elif test "$ac_cv_int_types" = no; then
  AC_DEFINE_UNQUOTED(uint16_t, unsigned $ac_cv_int16)
  AC_DEFINE_UNQUOTED(uint32_t, unsigned $ac_cv_int32)
  AC_DEFINE_UNQUOTED(int32_t, $ac_cv_int32)
elif test "$ac_cv_int_types" = close; then
  AC_DEFINE(NEED_SYS_TYPES_H)
  AC_DEFINE(uint16_t, u_int16_t)
  AC_DEFINE(uint32_t, u_int32_t)
else
  AC_DEFINE(NEED_SYS_TYPES_H)
fi

dnl
dnl Output
dnl

AC_OUTPUT(Makefile)