forked from fernandotcl/monkeys-audio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
179 lines (146 loc) · 3.85 KB
/
configure.ac
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
#AC_PREREQ(2.57)
AC_INIT(mac, 3.99-u4-b6)
AC_CONFIG_SRCDIR([src/Shared/GlobalFunctions.cpp])
AM_INIT_AUTOMAKE([foreign])
AC_CONFIG_HEADERS(src/Shared/config.h)
AM_MAINTAINER_MODE
# Checks for programs.
CXXFLAGS="$CXXFLAGS -O3 -Wall -Werror -pedantic -Wno-long-long"
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LIBTOOL
AC_PROG_MAKE_SET
AM_MAINTAINER_MODE
CONFIGURE_STYLE=gnu
# Checks for libraries.
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h memory.h stdlib.h string.h sys/ioctl.h sys/time.h unistd.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_C_INLINE
# Checks for library functions.
AC_FUNC_MEMCMP
AC_FUNC_STAT
#AC_CHECK_FUNCS([ftruncate memmove memset strrchr strstr])
# Checks for whether the architecture is in big endian or not.
# will define WORDS_BIGENDIAN if the arch is in big endian.
AC_C_BIGENDIAN
AC_CHECK_FUNCS(wcscasecmp)
# AC_SEARCH_LIBS (nanosleep, [rt,posix4])
# copied from videolan
AC_CHECK_FUNC(nanosleep,,[
AC_CHECK_LIB(rt,nanosleep,LIBS="${LIBS} -lrt",[
AC_CHECK_LIB(posix4,nanosleep,LIBS="${LIBS} -lposix4")
])
])
AC_MSG_CHECKING(for assembly enabled)
AC_ARG_ENABLE(assembly,
[ --enable-assembly=yes,no enable assembly or not],
assembly="$enableval", assembly="yes")
if test "$assembly" = "yes"; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
AM_CONDITIONAL(ENABLE_ASSEMBLY, test "$assembly" = "yes")
if test "$assembly" = "yes"; then
YASM=
AC_PATH_PROG(YASM, yasm, "not found")
fi
AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
*-*-mingw*|*-*-cygwin*)
os_win=yes
;;
*)
os_win=no
;;
esac
AC_MSG_RESULT([$os_win])
if test "$os_win" != "yes"; then
AC_DEFINE(BUILD_CROSS_PLATFORM,,[Build cross platform])
fi
AM_CONDITIONAL(OS_WIN, test "$os_win" = "yes")
case "$host_os" in
*bsd*|linux*|beos|irix*|solaris*)
YASM_FORMAT="-f elf"
;;
darwin*)
YASM_FORMAT="-f macho"
;;
[[cC]][[yY]][[gG]][[wW]][[iI]][[nN]]*|mingw32*|mks*)
YASM_FORMAT="-f win32"
;;
esac
case "$host" in
i386-*-* | i486-*-* | i586-*-* | i686-*-* | i86pc-*-*)
arch_type=X86
YASM_ARCH="-m x86"
AC_DEFINE(ARCH_X86,,[Architecture is x86])
;;
x86_64-*-*)
arch_type=X86_64
YASM_ARCH="-m amd64"
AC_DEFINE(ARCH_X86_64,,[Architecture is x86_64])
;;
powerpc-*-* )
arch_type=PowerPC
AC_DEFINE(ARCH_PPC,,[Architecture is powerpc])
;;
sparc-*-* )
arch_type=SPARC
AC_DEFINE(ARCH_SPARC,,[Architecture is sparc])
;;
*)
arch_type=other
;;
esac
AM_CONDITIONAL(HAS_YASM, test "x$YASM" != "x")
AM_CONDITIONAL(ARCH_X86, test "$arch_type" = "X86")
AM_CONDITIONAL(ARCH_X86_64, test "$arch_type" = "X86_64")
AM_CONDITIONAL(ARCH_SPARC, test "$arch_type" = "SPARC")
AM_CONDITIONAL(ARCH_PPC, test "$arch_type" = "PowerPC")
if test "x$YASM" != "x"; then
AC_MSG_RESULT("enable_assembly = yes")
AC_DEFINE(ENABLE_ASSEMBLY,,[with assembly enabled])
else
AC_MSG_RESULT("enable_assembly = no")
assembly=no;
fi
AC_SUBST(YASM_ARCH)
AC_SUBST(YASM_FORMAT)
AC_CHECK_SIZEOF([int *])
case "$ac_cv_sizeof_int_p" in
8)
AC_DEFINE(IS_64BIT,,[64bit])
;;
esac
AC_OUTPUT([Makefile
man/Makefile
src/Makefile
src/Console/Makefile
src/Shared/Makefile
src/MACLib/Makefile
src/MACLib/Assembly/Makefile
src/Examples/Makefile
src/Examples/Analyze/Makefile
src/Examples/Analyze/Sample1/Makefile
])
AC_MSG_RESULT([
Build options:
$PACKAGE $VERSION
archtecture $arch_type
Win $os_win
enable-assembly $assembly
])
if test "$assembly" = "yes"; then
AC_MSG_RESULT([
Yasm $YASM
YASM_ARCH $YASM_ARCH
YASM_FORMAT $YASM_FORMAT
])
fi