forked from superpea/xbmc-fork
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
326 lines (288 loc) · 11.8 KB
/
configure.in
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT("xbmc", 2.1, [email protected])
AC_CONFIG_HEADER([config.h])
AC_CANONICAL_HOST
AC_ARG_ENABLE([debug],
[AS_HELP_STRING([--enable-debug],
[enable debugging information (default is yes)])],
[use_debug=$enableval],
[use_debug=yes])
AC_ARG_ENABLE([gl],
[AS_HELP_STRING([--enable-gl],
[enable OpenGL rendering (default is yes)])],
[use_gl=$enableval],
[use_gl=yes])
AC_ARG_ENABLE([profiling],
[AS_HELP_STRING([--enable-profiling],
[enable gprof profiling (default is no)])],
[use_profiling=$enableval],
[use_profiling=no])
AC_ARG_ENABLE([joystick],
[AS_HELP_STRING([--enable-joystick],
[enable SDL joystick support (default is yes)])],
[use_joystick=$enableval],
[use_joystick=yes])
AC_ARG_ENABLE([xrandr],
[AS_HELP_STRING([--enable-xrandr],
[enable XRandR support (default is yes)])],
[use_xrandr=$enableval],
[use_xrandr=yes])
AC_ARG_ENABLE([mms],
[AS_HELP_STRING([--enable-mms],
[enable libmms support (default is yes)])],
[use_mms=$enableval],
[use_mms=yes])
AC_ARG_ENABLE([pcre],
[AS_HELP_STRING([--enable-pcre],
[enable PCRE based regular expression support (default is yes)])],
[use_pcre=$enableval],
[use_pcre=yes])
AC_ARG_ENABLE([halmount],
[AS_HELP_STRING([--enable-halmount],
[enable automounting feature (default is no)])],
[use_halmount=$enableval],
[use_halmount=no])
AC_PATH_PROG(CCACHE,ccache,none)
AC_ARG_ENABLE([ccache],
[AS_HELP_STRING([--enable-ccache],
[enable building with ccache feature (default is yes if ccache is installed)])],
[use_ccache=$enableval],
[use_ccache=yes])
# Checks for programs.
AC_PROG_AWK
AC_PROG_CXX
AC_PROG_CC
AC_PROG_LN_S
AC_PROG_MAKE_SET
if test "$host_vendor" = "apple" ; then
AC_SUBST(CFLAGS, "-L/System/Library/Frameworks/OpenGL.framework/Libraries -L/opt/local/lib -L/opt/local/lib/mysql5/mysql -I/opt/local/include")
AC_SUBST(CXXFLAGS, "-L/System/Library/Frameworks/OpenGL.framework/Libraries -L/opt/local/lib -L/opt/local/lib/mysql5/mysql -I/opt/local/include")
AC_SUBST(LDFLAGS, "-L/System/Library/Frameworks/OpenGL.framework/Libraries -L/opt/local/lib -L/opt/local/lib/mysql5/mysql")
AC_SUBST(INCLUDES, "-I/opt/local/include -I/opt/local/include/freetype2 -I/opt/local/include/mysql5 -I../xbmc -I../xbmc/lib -I../xbmc/osx -Ixbmc/lib -Ixbmc/osx -Ilib/libffmpeg-OSX/libavutil -I../xbmc/lib/libffmpeg-OSX -Ilib -Iosx -I.")
fi
# Checks for libraries.
if test "$use_gl" = "yes"; then
AC_CHECK_LIB([GL], [main],, AC_MSG_ERROR(libGL is required. Please see README.linux))
AC_CHECK_LIB([GLEW], [main],, AC_MSG_ERROR(libGLEW is required. Please see README.linux))
AC_CHECK_LIB([GLU], [main],, AC_MSG_ERROR(libGLU is required. Please see README.linux))
fi
if test "$host_vendor" != "apple"; then
AC_CHECK_LIB([Xinerama], [main],, AC_MSG_ERROR(libXinerama is required. Please see README.linux))
fi
AC_CHECK_LIB([mad], [main],, AC_MSG_ERROR(libmad is required. Please see README.linux))
if test "$host_vendor" != "apple"; then
AC_CHECK_LIB([tre], [main],, AC_MSG_ERROR(libtre is required. Please see README.linux))
fi
AC_CHECK_LIB([ogg], [main],, AC_MSG_ERROR(libogg is required. Please see README.linux))
AC_CHECK_LIB([vorbis], [main],, AC_MSG_ERROR(libvorbis is required. Please see README.linux))
AC_CHECK_LIB([SDL], [main])
if test "$use_gl" = "no"; then
AC_MSG_RESULT(== WARNING: OpenGL support is disabled. XBMC will run VERY slow. ==)
AC_CHECK_LIB([SDL_gfx], [main])
fi
AC_CHECK_LIB([SDL_image], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux))
AC_CHECK_LIB([SDL_mixer], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux))
AC_CHECK_LIB([dl], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux) )
AC_CHECK_LIB([freetype], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux))
AC_CHECK_LIB([fontconfig], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux))
AC_CHECK_LIB([bz2], [main],, AC_MSG_ERROR(== Could not find a required library (bz2). Please see README.linux))
AC_CHECK_LIB([fribidi], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux))
#AC_CHECK_LIB([lzo], [main],, AC_MSG_ERROR(== Could not find liblzo))
AC_CHECK_LIB([lzo2], [main],,
AC_CHECK_LIB([lzo], [main],, AC_MSG_ERROR(== Could not find either liblzo or liblzo2 - one of these must be present))
)
AC_CHECK_LIB([sqlite3], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux))
AC_CHECK_LIB([mysqlclient], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux))
AC_CHECK_LIB([asound], [main]) # check for asound library, fedora
AC_CHECK_LIB([rt], [clock_gettime]) # check for rt library, required for clock_gettime
AC_CHECK_LIB([resolv], [main]) # check for resolv library
AC_CHECK_LIB([png12], [main]) # check for cximage library
AC_CHECK_LIB([jasper], [main]) # check for cximage library
AC_CHECK_LIB([jpeg], [main]) # check for cximage library
if test "$host_vendor" != "apple" ; then
if test "$use_xrandr" = "yes" ; then
AC_CHECK_LIB([Xrandr], [main],, use_xrandr="no";AC_MSG_RESULT(== Could not find libXRandR. SDL will be used for resolution support. ==))
else
AC_MSG_RESULT(== XRandR support disabled. SDL will be used for resolution support. ==)
fi
fi
if test "$use_mms" = "yes"; then
AC_CHECK_LIB([mms], [main],AC_CHECK_LIB([mms], [mms_seek],,use_mms="no";AC_MSG_RESULT(== Your libmms doesn't have mms_seek. MMS support disabled ==)), use_mms="no";AC_MSG_RESULT(== Could not find libmms. MMS support disabled. ==))
else
AC_MSG_RESULT(== MMS support disabled. ==)
fi
if test "$use_pcre" = "yes"; then
AC_CHECK_LIB([pcre], [main],, use_pcre="no";AC_MSG_RESULT(== Could not find libpcre. PCRE support disabled. ==))
else
AC_MSG_RESULT(== PCRE support disabled. ==)
fi
if test "$host_vendor" != "apple" ; then
AC_CHECK_LIB([hal], [main],LZO_INCLUDES="$LZO_INCLUDES -DDBUS_API_SUBJECT_TO_CHANGE -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include -I/usr/include/hal"
, AC_MSG_ERROR(== Could not find a required library. Please see README.linux) )
AC_CHECK_LIB([dbus-1], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux) )
AC_CHECK_LIB([hal-storage], [main],, AC_MSG_ERROR(== Could not find a required library. Please see README.linux) )
fi
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([arpa/inet.h fcntl.h float.h inttypes.h limits.h locale.h malloc.h memory.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h strings.h sys/file.h sys/ioctl.h sys/mount.h sys/param.h sys/socket.h sys/time.h sys/timeb.h sys/vfs.h termios.h unistd.h utime.h wchar.h wctype.h])
AC_CHECK_HEADERS([lzo/lzo1.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STAT
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_UID_T
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_C_RESTRICT
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_CHECK_MEMBERS([struct stat.st_rdev])
AC_HEADER_TIME
AC_STRUCT_TM
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_CHOWN
AC_FUNC_CLOSEDIR_VOID
AC_FUNC_ERROR_AT_LINE
AC_FUNC_FSEEKO
AC_PROG_GCC_TRADITIONAL
AC_FUNC_LSTAT
AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
AC_FUNC_MEMCMP
AC_FUNC_MKTIME
AC_FUNC_MMAP
AC_FUNC_REALLOC
AC_FUNC_SELECT_ARGTYPES
AC_FUNC_SETVBUF_REVERSED
AC_TYPE_SIGNAL
AC_FUNC_STAT
AC_FUNC_STRCOLL
AC_FUNC_STRFTIME
AC_FUNC_STRTOD
AC_FUNC_UTIME_NULL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([atexit dup2 fdatasync floor fs_stat_dev ftime ftruncate getcwd gethostbyaddr gethostbyname gethostname getpagesize getpass gettimeofday inet_ntoa lchown localeconv memchr memmove memset mkdir modf munmap pow rmdir select setenv setlocale socket sqrt strcasecmp strchr strcspn strdup strerror strncasecmp strpbrk strrchr strspn strstr strtol strtoul sysinfo tzset utime])
dashes="------------------------"
final_message="\n XBMC Configuration:"
final_message="\n$dashes$final_message\n$dashes"
if test "$use_debug" = "yes"; then
final_message="$final_message\n Debugging:\tYes"
if test "$use_profiling" = "yes"; then
final_message="$final_message\n Profiling:\tYes"
DEBUG_FLAGS="-g -pg -D_DEBUG -Wall"
else
final_message="$final_message\n Profiling:\tNo"
DEBUG_FLAGS="-g -D_DEBUG -Wall"
fi
else
final_message="$final_message\n Debugging:\tNo"
if test "$use_profiling" = "yes"; then
final_message="$final_message\n Profiling:\tYes"
DEBUG_FLAGS="-pg -O2"
else
final_message="$final_message\n Profiling:\tNo"
DEBUG_FLAGS="-O2"
fi
fi
if test "$use_gl" = "yes"; then
final_message="$final_message\n OpenGL:\tYes"
SDL_DEFINES=""
else
final_message="$final_message\n OpenGL:\tNo (Very Slow)"
SDL_DEFINES="-DHAS_SDL_2D"
fi
if test "$use_joystick" = "yes"; then
final_message="$final_message\n Joystick:\tYes"
SDL_DEFINES="$SDL_DEFINES -DHAS_SDL_JOYSTICK"
else
final_message="$final_message\n Joystick:\tNo"
fi
if test "$use_xrandr" = "yes"; then
final_message="$final_message\n XRandR:\tYes"
SDL_DEFINES="$SDL_DEFINES -DHAS_XRANDR"
else
final_message="$final_message\n XRandR:\tNo"
fi
if test "$use_mms" = "yes"; then
final_message="$final_message\n MMS:\t\tYes"
SDL_DEFINES="$SDL_DEFINES -DHAS_MMS"
else
final_message="$final_message\n MMS:\t\tNo"
fi
if test "$use_pcre" = "yes"; then
final_message="$final_message\n PCRE Support:\tYes"
SDL_DEFINES="$SDL_DEFINES -DHAS_PCRE"
else
final_message="$final_message\n PCRE Support:\tNo"
fi
if test -d "/usr/include/lzo"; then
LZO_INCLUDES="$LZO_INCLUDES -I/usr/include/lzo"
else
LZO_INCLUDES="$LZO_INCLUDES"
fi
case $host in
i*86-*-linux-gnu)
ARCH="i486-linux"
;;
x86_64-*-linux-gnu)
ARCH="x86_64-linux"
;;
i386-apple-darwin9.2.2)
ARCH="x86-osx"
;;
*)
AC_MSG_ERROR(==unsupported host)
esac
AC_SUBST([ARCH])
# check for where libpython is
if test "$host_vendor" != "apple" ; then
AC_CHECK_FILE(/usr/lib/python2.4/config/libpython2.4-pic.a,
AC_SUBST(python_lib_a,/usr/lib/python2.4/config/libpython2.4-pic.a),
AC_CHECK_FILE(/usr/lib/python2.4/config/libpython2.4.a,
AC_SUBST(python_lib_a,/usr/lib/python2.4/config/libpython2.4.a),
AC_MSG_ERROR(==Can not find libPython anywhere))
)
fi
if test "$use_halmount" = "yes"; then
final_message="$final_message\n Automount:\tYes"
SDL_DEFINES="$SDL_DEFINES -DHAL_HANDLEMOUNT"
else
final_message="$final_message\n Automount:\tNo"
fi
if test "$use_ccache" = "yes"; then
if test "$ac_cv_path_CCACHE" = "none"; then
echo "ccache not found. Falling back to default CC"
final_message="$final_message\n ccache:\tNo"
else
CC="$ac_cv_path_CCACHE $CC"
CXX="$ac_cv_path_CCACHE $CXX"
AC_MSG_NOTICE(enabling ccache)
final_message="$final_message\n ccache:\tYes"
fi
else
final_message="$final_message\n ccache:\tNo"
fi
if test -x "/usr/bin/svnversion"; then
SDL_DEFINES="$SDL_DEFINES -D'SVN_REV=\"$(svnversion -n .)\"'"
fi
AC_SUBST(DEBUG_FLAGS)
AC_SUBST(SDL_DEFINES)
AC_SUBST(LZO_INCLUDES)
AC_CONFIG_FILES([Makefile Makefile.include xbmc/lib/libPython/linux/Makefile xbmc/lib/libUPnP/Makefile tools/Linux/xbmc.sh])
AC_OUTPUT
final_message="$final_message\n prefix:\t$prefix\n$dashes"
echo -e "$final_message\n"