File: configure.ac

package info (click to toggle)
libmpcdec 1.2.2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, lenny
  • size: 2,900 kB
  • ctags: 4,893
  • sloc: sh: 8,435; ansic: 2,735; cpp: 237; makefile: 88
file content (202 lines) | stat: -rw-r--r-- 4,354 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
dnl Process this file with autoconf to produce a configure script.
AC_INIT(src/mpc_decoder.c)
AC_CONFIG_AUX_DIR(config)
AM_INIT_AUTOMAKE(libmpcdec,1.2.2)
AM_CONFIG_HEADER(include/config.h)

AM_PROG_LIBTOOL

CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fPIC"

AC_C_BIGENDIAN(,CFLAGS="$CFLAGS -DMPC_LITTLE_ENDIAN",)

AC_HEADER_STDC
AC_CHECK_HEADERS([inttypes.h string.h])

AC_HEADER_STDBOOL
AC_C_CONST
AC_C_INLINE
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_CHECK_TYPES([ptrdiff_t])

AC_FUNC_MEMCMP
AC_CHECK_FUNCS([memmove memset sqrt])

AC_MSG_CHECKING(for int16_t)
AC_CACHE_VAL(has_int16_t,
[AC_TRY_RUN([
int16_t foo;
int main() {return 0;}
],
has_int16_t=yes,
has_int16_t=no,
has_int16_t=no
)])
AC_MSG_RESULT($has_int16_t)

AC_MSG_CHECKING(for int32_t)
AC_CACHE_VAL(has_int32_t,
[AC_TRY_RUN([
int32_t foo;
int main() {return 0;}
],
has_int32_t=yes,
has_int32_t=no,
has_int32_t=no
)])
AC_MSG_RESULT($has_int32_t)

AC_MSG_CHECKING(for uint32_t)
AC_CACHE_VAL(has_uint32_t,
[AC_TRY_RUN([
uint32_t foo;
int main() {return 0;}
],
has_uint32_t=yes,
has_uint32_t=no,
has_uint32_t=no
)])
AC_MSG_RESULT($has_uint32_t)

AC_MSG_CHECKING(for uint16_t)
AC_CACHE_VAL(has_uint16_t,
[AC_TRY_RUN([
uint16_t foo;
int main() {return 0;}
],
has_uint16_t=yes,
has_uint16_t=no,
has_uint16_t=no
)])
AC_MSG_RESULT($has_uint16_t)

AC_MSG_CHECKING(for u_int32_t)
AC_CACHE_VAL(has_u_int32_t,
[AC_TRY_RUN([
u_int32_t foo;
int main() {return 0;}
],
has_u_int32_t=yes,
has_u_int32_t=no,
has_u_int32_t=no
)])
AC_MSG_RESULT($has_u_int32_t)

AC_MSG_CHECKING(for u_int16_t)
AC_CACHE_VAL(has_u_int16_t,
[AC_TRY_RUN([
u_int16_t foo;
int main() {return 0;}
],
has_u_int16_t=yes,
has_u_int16_t=no,
has_u_int16_t=no
)])
AC_MSG_RESULT($has_u_int16_t)

AC_MSG_CHECKING(for int64_t)
AC_CACHE_VAL(has_int64_t,
[AC_TRY_RUN([
int64_t foo;
int main() {return 0;}
],
has_int64_t=yes,
has_int64_t=no,
has_int64_t=no
)])
AC_MSG_RESULT($has_int64_t)

AC_CHECK_SIZEOF(short)
AC_CHECK_SIZEOF(int)
AC_CHECK_SIZEOF(long)
AC_CHECK_SIZEOF(long long)


if test x$has_int16_t = "xyes" ; then
        SIZE16="int16_t"
else
        case 2 in
                $ac_cv_sizeof_short) SIZE16="short";;
                $ac_cv_sizeof_int) SIZE16="int";;
        esac
fi

if test x$has_int32_t = "xyes" ; then
        SIZE32="int32_t"
else
        case 4 in
                $ac_cv_sizeof_short) SIZE32="short";;
                $ac_cv_sizeof_int) SIZE32="int";;
                $ac_cv_sizeof_long) SIZE32="long";;
        esac
fi

if test x$has_uint32_t = "xyes" ; then
        USIZE32="uint32_t"
else
        if test x$has_u_int32_t = "xyes" ; then
                USIZE32="u_int32_t"
        else
                case 4 in
                        $ac_cv_sizeof_short) USIZE32="unsigned short";;
                        $ac_cv_sizeof_int) USIZE32="unsigned int";;
                        $ac_cv_sizeof_long) USIZE32="unsigned long";;
                esac
        fi
fi

if test x$has_uint16_t = "xyes" ; then
        USIZE16="uint16_t"
else
        if test x$has_u_int16_t = "xyes" ; then
                USIZE16="u_int16_t"
        else
                case 2 in
                        $ac_cv_sizeof_short) USIZE16="unsigned short";;
                        $ac_cv_sizeof_int) USIZE16="unsigned int";;
                        $ac_cv_sizeof_long) USIZE16="unsigned long";;
                esac
        fi
fi

if test x$has_int64_t = "xyes" ; then
        SIZE64="int64_t"
else
case 8 in
        $ac_cv_sizeof_int) SIZE64="int";;
        $ac_cv_sizeof_long) SIZE64="long";;
        $ac_cv_sizeof_long_long) SIZE64="long long";;
esac
fi

if test -z "$SIZE16"; then
        AC_MSG_ERROR(No 16 bit type found on this platform!)
fi
if test -z "$USIZE16"; then
        AC_MSG_ERROR(No unsigned 16 bit type found on this platform!)
fi
if test -z "$SIZE32"; then
        AC_MSG_ERROR(No 32 bit type found on this platform!)
fi
if test -z "$USIZE32"; then
        AC_MSG_ERROR(No unsigned 32 bit type found on this platform!)
fi
if test -z "$SIZE64"; then
        AC_MSG_WARN(No 64 bit type found on this platform!)
fi

dnl Make substitutions

AC_SUBST(VERSION)
AC_SUBST(LIBTOOL_DEPS)
AC_SUBST(SIZE16)
AC_SUBST(USIZE16)
AC_SUBST(SIZE32)
AC_SUBST(USIZE32)
AC_SUBST(SIZE64)
AC_SUBST(OPT)
AC_SUBST(LIBS)

AC_OUTPUT(Makefile src/Makefile include/Makefile include/mpcdec/config_types.h)
AC_MSG_RESULT([=> libmpcdec $VERSION configured successfully])