Skip to content

Latest commit

 

History

History
162 lines (125 loc) · 4.12 KB

configure.in

File metadata and controls

162 lines (125 loc) · 4.12 KB
 
1
2
3
4
5
6
7
dnl Process this file with autoconf to produce a configure script
dnl ------------------------------------------------
dnl Initialization and Versioning
dnl ------------------------------------------------
AC_INIT(mdct.c)
Oct 6, 2019
Oct 6, 2019
8
AC_CONFIG_MACRO_DIR([m4])
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
AC_CANONICAL_HOST
AC_CANONICAL_TARGET
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE(libvorbisidec,1.2.1)
dnl AM_MAINTAINER_MODE only provides the option to configure to enable it
AM_MAINTAINER_MODE
dnl Library versioning
V_LIB_CURRENT=1
V_LIB_REVISION=3
V_LIB_AGE=0
AC_SUBST(V_LIB_CURRENT)
AC_SUBST(V_LIB_REVISION)
AC_SUBST(V_LIB_AGE)
dnl --------------------------------------------------
dnl Check for programs
dnl --------------------------------------------------
dnl save $CFLAGS since AC_PROG_CC likes to insert "-g -O2"
dnl if $CFLAGS is blank
cflags_save="$CFLAGS"
AC_PROG_CC
AC_PROG_CPP
CFLAGS="$cflags_save"
Oct 6, 2019
Oct 6, 2019
40
41
AC_LIBTOOL_WIN32_DLL
AC_PROG_LIBTOOL
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
dnl --------------------------------------------------
dnl Set build flags based on environment
dnl --------------------------------------------------
dnl Set some target options
cflags_save="$CFLAGS"
ldflags_save="$LDFLAGS"
if test -z "$GCC"; then
case $host in
arm-*-*)
DEBUG="-g -D_ARM_ASSEM_"
CFLAGS="-O -D_ARM_ASSEM_"
PROFILE="-p -g -O -D_ARM_ASSEM_" ;;
*)
DEBUG="-g"
CFLAGS="-O"
PROFILE="-g -p" ;;
esac
else
case $host in
arm-*-*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char -D_ARM_ASSEM_"
CFLAGS="-O2 -D_ARM_ASSEM_ -fsigned-char"
PROFILE="-W -pg -g -O2 -D_ARM_ASSEM_ -fsigned-char -fno-inline-functions";;
*)
DEBUG="-g -Wall -D__NO_MATH_INLINES -fsigned-char"
CFLAGS="-O2 -Wall -fsigned-char"
PROFILE="-Wall -pg -g -O2 -fsigned-char -fno-inline-functions";;
esac
fi
CFLAGS="$CFLAGS $cflags_save -D_REENTRANT"
LDFLAGS="$LDFLAGS $ldflags_save"
# Test whenever ld supports -version-script
AC_PROG_LD
AC_PROG_LD_GNU
Dec 1, 2019
Dec 1, 2019
84
85
86
# check endianism
AC_C_BIGENDIAN
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
dnl --------------------------------------------------
dnl Options
dnl --------------------------------------------------
AC_ARG_ENABLE(
low-accuracy,
[ --enable-low-accuracy enable 32 bit only multiply operations],
CFLAGS="$CFLAGS -D_LOW_ACCURACY_"
)
dnl --------------------------------------------------
dnl Check for headers
dnl --------------------------------------------------
AC_CHECK_HEADER(memory.h,CFLAGS="$CFLAGS -DUSE_MEMORY_H",:)
dnl --------------------------------------------------
dnl Check for typedefs, structures, etc
dnl --------------------------------------------------
dnl none
dnl --------------------------------------------------
dnl Check for libraries
dnl --------------------------------------------------
Dec 1, 2019
Dec 1, 2019
113
114
PKG_PROG_PKG_CONFIG
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
HAVE_OGG=no
if test "x$PKG_CONFIG" != "x"
then
PKG_CHECK_MODULES(OGG, ogg >= 1.0, HAVE_OGG=yes, HAVE_OGG=no)
fi
if test "x$HAVE_OGG" = "xno"
then
dnl fall back to the old school test
XIPH_PATH_OGG(, AC_MSG_ERROR(must have Ogg installed!))
libs_save=$LIBS
LIBS="$OGG_LIBS"
AC_CHECK_FUNC(oggpack_writealign, , AC_MSG_ERROR(Ogg >= 1.0 required !))
LIBS=$libs_save
fi
dnl --------------------------------------------------
dnl Check for library functions
dnl --------------------------------------------------
AC_FUNC_ALLOCA
AC_FUNC_MEMCMP
Oct 6, 2019
Oct 6, 2019
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
AC_MSG_CHECKING(for C99 variable-size arrays)
AC_TRY_COMPILE( [], [static int x; char a[++x]; a[sizeof a - 1] = 0; int N; return a[0];],
[has_var_arrays=yes;AC_DEFINE([VAR_ARRAYS], [], [Use C99 variable-size arrays])
],
has_var_arrays=no
)
AC_MSG_RESULT($has_var_arrays)
# do this last after all checks, because Version_script is not generated yet.
if test "x$lt_cv_prog_gnu_ld" = "xyes"; then
SHLIB_VERSION_ARG="-Wl,--version-script=Version_script"
LDFLAGS="$LDFLAGS $SHLIB_VERSION_ARG"
fi
152
153
154
155
156
157
158
159
160
161
162
dnl --------------------------------------------------
dnl Do substitutions
dnl --------------------------------------------------
LIBS="$LIBS"
AC_SUBST(LIBS)
AC_SUBST(DEBUG)
AC_SUBST(PROFILE)
AC_OUTPUT(Makefile Version_script vorbisidec.pc)