File: configure.ac

package info (click to toggle)
libtcd 2.2.2-2.1
  • links: PTS
  • area: main
  • in suites: bookworm, bullseye
  • size: 1,652 kB
  • sloc: sh: 8,798; ansic: 3,795; makefile: 58
file content (101 lines) | stat: -rw-r--r-- 3,795 bytes parent folder | download | duplicates (2)
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
# $Id: configure.ac 1803 2007-01-22 15:29:56Z flaterco $

# Int types macros require autoconf 2.60 or later
AC_PREREQ([2.60])

# FIXME: Update version info on each release
AC_INIT([libtcd], [2.2.2], [dave@flaterco.com])
AC_SUBST([libtcd_rev_date], ["2007-01-22"])
AC_SUBST([libtcd_major_rev], ["2"])
AC_SUBST([libtcd_minor_rev], ["2"])
# NOTE patchlevel must include leading period if it is provided
AC_SUBST([libtcd_patchlevel], [".2"])

# The following is "bad" because "--enable-feature options should
# never make a feature behave differently or cause one feature to
# replace another.  They should only cause parts of the program to be
# built rather than left out."  COMPAT114 is bad for the same reason.
# Nobody should use it, but if they do, it may as well work like this.

AC_SUBST([def_COMPAT114], ["undef"])
AC_SUBST([ver_COMPAT114], [""])
AC_ARG_ENABLE([COMPAT114],
  [AS_HELP_STRING([--enable-COMPAT114],
                  [for emergency use only:  force API changes to enable old applications to build; break applications expecting the v2 API; disable build of shared library; see libtcd.html])],
  [
    AS_IF([test "$enable_COMPAT114" == yes], [
       AC_MSG_WARN([[COMPAT114 is enabled!]])
       AC_MSG_WARN([[This option is for emergency use ONLY!]])
       AC_MSG_WARN([[Forcing API changes to enable old applications to build!]])
       AC_MSG_WARN([[This will BREAK applications expecting the v2 API!]])
       AC_MSG_WARN([[Disabling build of shared library!]])
       AC_MSG_WARN([[Read libtcd.html!]])
       enable_shared=no
       AC_SUBST([def_COMPAT114], ["define"])
       AC_SUBST([ver_COMPAT114], ["-COMPAT114"])
    ])
  ])

AM_INIT_AUTOMAKE([-Wall])

# Disable automatic checks that are incompatible with how subversion
# sets timestamps.
AM_MAINTAINER_MODE

AC_LANG([C])
AC_PROG_CC
AC_PROG_LIBTOOL

# Portable, well-defined int types.  Finally.

AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T

AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T

# Unfortunately, we need to take this to the next level and generate a
# header file that will work outside of autoconf.  Evil:  relying on
# internals of autoconf macro definitions.

AS_IF([test "$ac_cv_header_sys_types_h" == yes],
      [AC_SUBST([sub_systypes], ["#include <sys/types.h>"])],
      [AC_SUBST([sub_systypes], [""])])
AS_IF([test "$ac_cv_header_inttypes_h" == yes],
        [AC_SUBST([sub_inttypes], ["#include <inttypes.h>"])],
      [test "$ac_cv_header_stdint_h" == yes],
        [AC_SUBST([sub_inttypes], ["#include <stdint.h>"])],
        [AC_SUBST([sub_inttypes], [""])])

AS_IF([test "$ac_cv_c_int8_t" == yes],
      [AC_SUBST([sub_int8_t], ["int8_t"])],
      [AC_SUBST([sub_int8_t], ["$ac_cv_c_int8_t"])])
AS_IF([test "$ac_cv_c_int16_t" == yes],
      [AC_SUBST([sub_int16_t], ["int16_t"])],
      [AC_SUBST([sub_int16_t], ["$ac_cv_c_int16_t"])])
AS_IF([test "$ac_cv_c_int32_t" == yes],
      [AC_SUBST([sub_int32_t], ["int32_t"])],
      [AC_SUBST([sub_int32_t], ["$ac_cv_c_int32_t"])])
AS_IF([test "$ac_cv_c_int64_t" == yes],
      [AC_SUBST([sub_int64_t], ["int64_t"])],
      [AC_SUBST([sub_int64_t], ["$ac_cv_c_int64_t"])])

AS_IF([test "$ac_cv_c_uint8_t" == yes],
      [AC_SUBST([sub_uint8_t], ["uint8_t"])],
      [AC_SUBST([sub_uint8_t], ["$ac_cv_c_uint8_t"])])
AS_IF([test "$ac_cv_c_uint16_t" == yes],
      [AC_SUBST([sub_uint16_t], ["uint16_t"])],
      [AC_SUBST([sub_uint16_t], ["$ac_cv_c_uint16_t"])])
AS_IF([test "$ac_cv_c_uint32_t" == yes],
      [AC_SUBST([sub_uint32_t], ["uint32_t"])],
      [AC_SUBST([sub_uint32_t], ["$ac_cv_c_uint32_t"])])
AS_IF([test "$ac_cv_c_uint64_t" == yes],
      [AC_SUBST([sub_uint64_t], ["uint64_t"])],
      [AC_SUBST([sub_uint64_t], ["$ac_cv_c_uint64_t"])])

AC_CONFIG_FILES([Makefile tcd.h])
AC_OUTPUT