configure.in 15.3 KB
Newer Older
1
2
3
dnl Autoconf settings for vlc
AC_INIT(src/interface/main.c)
AC_CONFIG_HEADER(include/defs.h)
4

5
6
AC_CANONICAL_HOST

Henri Fallon's avatar
   
Henri Fallon committed
7
VLC_VERSION=0.2.73
8
AC_SUBST(VLC_VERSION)
Sam Hocevar's avatar
   
Sam Hocevar committed
9
VLC_CODENAME=Ourumov
10
11
AC_SUBST(VLC_CODENAME)

Sam Hocevar's avatar
   
Sam Hocevar committed
12
13
14
dnl Save CFLAGS
save_CFLAGS="${CFLAGS}"

15
16
dnl Check for tools
AC_PROG_MAKE_SET
Sam Hocevar's avatar
   
Sam Hocevar committed
17
18
AC_PROG_CC
AC_PROG_CPP
Sam Hocevar's avatar
   
Sam Hocevar committed
19
AC_PROG_RANLIB
20
21
22
23
24
25

dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL

dnl Check for compiler environment
AC_C_CONST
Sam Hocevar's avatar
   
Sam Hocevar committed
26
27
28
29
30

dnl Check for endianness if not cross-compiling
if test x${cross_compiling} != xyes; then
  AC_C_BIGENDIAN
fi
31
32
33
34

dnl Check for system libs needed
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol)
AC_CHECK_FUNCS(setenv putenv)
Sam Hocevar's avatar
   
Sam Hocevar committed
35
36
37
38
39
40
41
42
43
44
45
AC_CHECK_FUNC(connect,,[
  AC_CHECK_LIB(socket,connect,LIB="${LIB} -lsocket")
])
AC_CHECK_FUNC(gethostbyname,,[
  AC_CHECK_LIB(nsl,gethostbyname,LIB="${LIB} -lnsl")
])
AC_CHECK_FUNC(nanosleep,,[
  AC_CHECK_LIB(rt,nanosleep,LIB="${LIB} -lrt",[
    AC_CHECK_LIB(posix4,nanosleep,LIB="${LIB} -lposix4")
  ])
])
46
AC_CHECK_FUNCS(usleep)
Sam Hocevar's avatar
   
Sam Hocevar committed
47
48
49
AC_CHECK_FUNC(inet_aton,,[
  AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")
])
Sam Hocevar's avatar
   
Sam Hocevar committed
50
AC_CHECK_FUNCS(vasprintf)
Sam Hocevar's avatar
   
Sam Hocevar committed
51
AC_CHECK_FUNCS(swab)
Sam Hocevar's avatar
   
Sam Hocevar committed
52
53
54
55

AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
  AC_CHECK_LIB([gnugetopt],[getopt_long],
Sam Hocevar's avatar
   
Sam Hocevar committed
56
    [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB="${LIB} -lgnugetopt"],
Sam Hocevar's avatar
   
Sam Hocevar committed
57
    [GETOPT=1])])
Sam Hocevar's avatar
   
Sam Hocevar committed
58
59
AC_SUBST(GETOPT)

60
61
AC_FUNC_MMAP
AC_TYPE_SIGNAL
Sam Hocevar's avatar
   
Sam Hocevar committed
62
63
AC_CHECK_LIB(dl,dlopen,LIB="${LIB} -ldl")
AC_CHECK_LIB(m,pow,LIB_YUV="${LIB_YUV} -lm")
Sam Hocevar's avatar
   
Sam Hocevar committed
64
65
66
67
68
69
70
71
72
73
74

AC_CHECK_LIB(pthread,pthread_create,
  LIB="${LIB} -lpthread",
  AC_MSG_CHECKING(for old style FreeBSD -pthread flag)
  AC_EGREP_CPP(yes,
    [#if defined(__FreeBSD_cc_version) && __FreeBSD_cc_version <= 500001
      yes
     #endif],
    AC_MSG_RESULT(yes)
    DEFINE="${DEFINE} -D_THREAD_SAFE" LIB="${LIB} -pthread",
    AC_MSG_RESULT(no)))
Sam Hocevar's avatar
   
Sam Hocevar committed
75
AC_CHECK_LIB(threads,thread_create,LIB="${LIB} -lthreads")
76

Christophe Massiot's avatar
Christophe Massiot committed
77
CPPFLAGS="${CPPFLAGS} -I/usr/local/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
78
79
80
81

dnl Check for headers
AC_CHECK_HEADERS(stddef.h getopt.h strings.h)
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h unistd.h)
82
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
83
84
AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
Christophe Massiot's avatar
Christophe Massiot committed
85
AC_CHECK_HEADERS(machine/param.h)
86
87

dnl Check for threads library
88
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)
89

Sam Hocevar's avatar
   
Sam Hocevar committed
90
91
92
93
94
95
96
97
98
99
dnl Check for misc headers
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
  AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
            Define if <pthread.h> defines pthread_cond_t.)
])
AC_EGREP_HEADER(strncasecmp,strings.h,[
  AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
            Define if <strings.h> defines strncasecmp.)
])

Sam Hocevar's avatar
   
Sam Hocevar committed
100
dnl Check for ntohl, etc.
Christophe Massiot's avatar
Christophe Massiot committed
101
102
103
104
CFLAGS="${CFLAGS} -Wall -Werror"
AC_MSG_CHECKING([for ntohl in sys/param.h])
AC_TRY_COMPILE([#include <sys/param.h>
void foo() { int meuh; ntohl(meuh); }],,
Sam Hocevar's avatar
   
Sam Hocevar committed
105
 AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
Sam Hocevar's avatar
   
Sam Hocevar committed
106
107
108
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

dnl Check for -rdynamic flag
109
CFLAGS="${CFLAGS} -rdynamic -Wall -Werror"
Sam Hocevar's avatar
   
Sam Hocevar committed
110
AC_MSG_CHECKING([if \$CC miserably fails with the -rdynamic flag])
Sam Hocevar's avatar
   
Sam Hocevar committed
111
AC_TRY_COMPILE([],,
Sam Hocevar's avatar
   
Sam Hocevar committed
112
 LCFLAGS="${LCFLAGS} -rdynamic"
Sam Hocevar's avatar
   
Sam Hocevar committed
113
 AC_MSG_RESULT(no), AC_MSG_RESULT(yes))
Sam Hocevar's avatar
   
Sam Hocevar committed
114
115

dnl End of the bizarre compilation tests
Sam Hocevar's avatar
   
Sam Hocevar committed
116
CFLAGS="${save_CFLAGS}"
Christophe Massiot's avatar
Christophe Massiot committed
117

118
dnl Check for boolean_t
Sam Hocevar's avatar
   
Sam Hocevar committed
119
120
121
122
123
AC_MSG_CHECKING([for boolean_t in sys/types.h])
AC_TRY_COMPILE([#include <sys/types.h>
void quux() { boolean_t foo; }],,
 AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
124
125
126
127
128
AC_MSG_CHECKING([for boolean_t in pthread.h])
AC_TRY_COMPILE([#include <pthread.h>
void quux() { boolean_t foo; }],,
 AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
 AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
Sam Hocevar's avatar
   
Sam Hocevar committed
129

130
131
132
133
134
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME

Sam Hocevar's avatar
   
Sam Hocevar committed
135
136
137
138
139
ARCH=${host_cpu}

dnl
dnl  default modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
140
BUILTINS="${BUILTINS} es ps ts yuv idct idctclassic motion imdct downmix"
Sam Hocevar's avatar
   
Sam Hocevar committed
141
142
143
144

dnl
dnl  Accelerated modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
145
146
case x$host_os in
  xmingw32msvc)
Sam Hocevar's avatar
   
Sam Hocevar committed
147
    MMX_PLUGINS="idctmmx motionmmx"
Sam Hocevar's avatar
   
Sam Hocevar committed
148
149
    ;;
  *)
Sam Hocevar's avatar
   
Sam Hocevar committed
150
    MMX_PLUGINS="yuvmmx idctmmx motionmmx"
Sam Hocevar's avatar
   
Sam Hocevar committed
151
152
    ;;
esac
153

Sam Hocevar's avatar
   
Sam Hocevar committed
154
155
156
157
158
AC_MSG_CHECKING([if \$CC groks MMX inline assembly])
AC_TRY_COMPILE([void quux(){void *p;asm("packuswb %%mm1,%%mm2"::"r"(p));}],,
  ACCEL_PLUGINS="${ACCEL_PLUGINS} ${MMX_PLUGINS}"
  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

Sam Hocevar's avatar
   
Sam Hocevar committed
159
AC_MSG_CHECKING([if \$CC groks MMX EXT or SSE inline assembly])
Sam Hocevar's avatar
   
Sam Hocevar committed
160
AC_TRY_COMPILE([void quux(){void *p;asm("maskmovq %%mm1,%%mm2"::"r"(p));}],,
Sam Hocevar's avatar
   
Sam Hocevar committed
161
  ACCEL_PLUGINS="${ACCEL_PLUGINS} idctmmxext motionmmxext imdctsse downmix3dn downmixsse"
Sam Hocevar's avatar
   
Sam Hocevar committed
162
163
  AC_MSG_RESULT(yes), AC_MSG_RESULT(no))

Sam Hocevar's avatar
   
Sam Hocevar committed
164
165
166
167
dnl
dnl  DVD module: check for DVD ioctls
dnl
AC_CHECK_HEADERS(sys/ioctl.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
168
  BUILTINS="${BUILTINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
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
  AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h)
  BSD_DVD_STRUCT=0
  dnl
  dnl Old FreeBSD: sys/cdio.h
  dnl
  AC_EGREP_HEADER(dvd_struct,sys/dvdio.h,[
    AC_DEFINE(DVD_STRUCT_IN_SYS_DVDIO_H, 1,
              Define if <sys/dvdio.h> defines dvd_struct.)
    BSD_DVD_STRUCT=1
  ])
  dnl
  dnl Newer FreeBSD: sys/dvdio.h
  dnl
  AC_EGREP_HEADER(dvd_struct,sys/cdio.h,[
    AC_DEFINE(DVD_STRUCT_IN_SYS_CDIO_H, 1,
              Define if <sys/cdio.h> defines dvd_struct.)
    BSD_DVD_STRUCT=1
  ])
  if test x$BSD_DVD_STRUCT = x1; then
    AC_DEFINE(HAVE_BSD_DVD_STRUCT, 1,
              Define if BSD-like dvd_struct is defined.)
  fi
  dnl
  dnl Linux: linux/cdrom.h
  dnl
  AC_EGREP_HEADER(dvd_struct,linux/cdrom.h,[
    AC_DEFINE(DVD_STRUCT_IN_LINUX_CDROM_H, 1,
              Define if <linux/cdrom.h> defines DVD_STRUCT.)
Sam Hocevar's avatar
   
Sam Hocevar committed
197
198
199
200
201
202
  ])
])

dnl
dnl  dummy plugin
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
203
204
AC_ARG_ENABLE(dummy,
  [  --disable-dummy         dummy module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
205
if test x$enable_dummy != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
206
  BUILTINS="${BUILTINS} dummy"; fi
Sam Hocevar's avatar
   
Sam Hocevar committed
207
208
209
210

dnl
dnl  null plugin
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
211
212
AC_ARG_ENABLE(null,
  [  --disable-null          Null module (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
213
if test x$enable_null != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
214
  BUILTINS="${BUILTINS} null"; fi
Sam Hocevar's avatar
   
Sam Hocevar committed
215

Sam Hocevar's avatar
   
Sam Hocevar committed
216
217
218
219
220
221
222
223
dnl
dnl  rc plugin
dnl
AC_ARG_ENABLE(rc,
  [  --disable-rc            rc module (default enabled)])
if test x$enable_rc != xno; then
  BUILTINS="${BUILTINS} rc"; fi

Sam Hocevar's avatar
   
Sam Hocevar committed
224
225
226
dnl
dnl  PentiumPro acceleration
dnl
227
AC_ARG_ENABLE(ppro,
228
[  --disable-ppro          Disable PentiumPro optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
229
230
[ if test x$enableval = xyes; then ARCH="${ARCH} ppro"; fi ],
[ if test x${host_cpu} = xi686; then ARCH="${ARCH} ppro"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
231
232
233
234

dnl
dnl  MMX acceleration
dnl
235
AC_ARG_ENABLE(mmx,
Christophe Massiot's avatar
Christophe Massiot committed
236
[  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
Sam Hocevar's avatar
   
Sam Hocevar committed
237
238
[ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
  BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ],
Sam Hocevar's avatar
   
Sam Hocevar committed
239
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86 -o x${host_cpu} = xi386; then ARCH="${ARCH} mmx";
Sam Hocevar's avatar
   
Sam Hocevar committed
240
  BUILTINS="${BUILTINS} ${ACCEL_PLUGINS}"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
241
242
243
244

dnl
dnl  AltiVec acceleration
dnl
245
AC_ARG_ENABLE(altivec,
246
[  --enable-altivec        Enable altivec optimizations (default disabled since it is broken)],
Sam Hocevar's avatar
   
Sam Hocevar committed
247
248
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
    BUILTINS="${BUILTINS} idctaltivec"
Sam Hocevar's avatar
   
Sam Hocevar committed
249
250
    LIB_IDCTALTIVEC="-framework vecLib"
  fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
251
#[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
252
253
254
255

dnl
dnl  CSS DVD decryption
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
256
257
258
259
AC_ARG_ENABLE(css,
[  --disable-css           Disable DVD CSS decryption (default enabled)],
[ if test x$enableval = xyes; then CSS=1; else CSS=0; fi ], [ CSS=1; ])
if test x${CSS} = x1; then AC_DEFINE(HAVE_CSS, 1, Define if you want DVD CSS decryption.) fi
Sam Hocevar's avatar
   
Sam Hocevar committed
260
261
262
263

dnl
dnl  Debugging mode
dnl
264
AC_ARG_ENABLE(debug,
265
[  --enable-debug          Enable debug mode (default disabled)],
266
[ if test x$enableval = xyes; then DEBUG=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
267
268
269
270

dnl
dnl  Enable/disable statistics
dnl
271
AC_ARG_ENABLE(stats,
272
[  --enable-stats          Enable printing of statistics (default disabled)],
273
[ if test x$enableval = xyes; then STATS=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
274

275
276
277
278
279
280
281
dnl
dnl  Trace mode
dnl
AC_ARG_ENABLE(trace,
[  --enable-trace          Enable trace mode (default disabled)],
[ if test x$enableval = xyes; then TRACE=1; fi ])

Sam Hocevar's avatar
   
Sam Hocevar committed
282
283
284
dnl
dnl  Enable/disable optimizations
dnl
285
AC_ARG_ENABLE(optimizations,
286
[  --disable-optimizations Disable compiler optimizations (default enabled)],
287
288
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
289
290
291

SYS=${host_os}

Sam Hocevar's avatar
   
Sam Hocevar committed
292
dnl special case for BeOS
293
if test x$host_os = xbeos; then
Sam Hocevar's avatar
   
Sam Hocevar committed
294
    BUILTINS="${BUILTINS} beos"
Sam Hocevar's avatar
   
Sam Hocevar committed
295
    LIB_BEOS="-lbe -lgame -lroot -ltracker"
296
297
298
299

dnl default case
else

Sam Hocevar's avatar
   
Sam Hocevar committed
300
301
302
dnl
dnl  OSS /dev/dsp module
dnl
303
AC_ARG_ENABLE(dsp,
304
  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
305
if test x$enable_dsp != xno; then
306
  if test -c /dev/dsp; then
Sam Hocevar's avatar
   
Sam Hocevar committed
307
    PLUGINS="${PLUGINS} dsp"
308
309
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
310
311
312
313

dnl
dnl  Esound module
dnl
314
AC_ARG_ENABLE(esd,
315
  [  --enable-esd            Esound library support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
316
  [if test x$enable_esd = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
317
318
     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
     if test x${ESD_CONFIG} != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
319
       PLUGINS="${PLUGINS} esd"
Sam Hocevar's avatar
   
Sam Hocevar committed
320
321
       LIB_ESD="`${ESD_CONFIG} --libs`"
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
322
323
324
325
326
   fi])

dnl
dnl  Darwin module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
327
328
AC_ARG_ENABLE(darwin,
  [  --enable-darwin         Darwin sound support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
329
  [if test x$enable_darwin = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
330
     PLUGINS="${PLUGINS} darwin"
Sam Hocevar's avatar
   
Sam Hocevar committed
331
332
333
334
335
336
     LIB_DARWIN="-framework CoreAudio"
   fi])

dnl
dnl  MacOS X module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
337
AC_ARG_ENABLE(macosx,
338
  [  --enable-macosx         Mac OS X interface support (default enabled in Mac OS X)],
Sam Hocevar's avatar
   
Sam Hocevar committed
339
  [if test x$enable_macosx = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
340
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
   
Sam Hocevar committed
341
     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
Sam Hocevar's avatar
   
Sam Hocevar committed
342
343
     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
Sam Hocevar's avatar
   
Sam Hocevar committed
344
345
   fi],
  [AC_CHECK_HEADERS(Carbon/Carbon.h,
Sam Hocevar's avatar
   
Sam Hocevar committed
346
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
   
Sam Hocevar committed
347
     LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
Sam Hocevar's avatar
   
Sam Hocevar committed
348
349
     LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
     LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
Sam Hocevar's avatar
   
Sam Hocevar committed
350
351
352
353
354
   )])

dnl
dnl  Linux framebuffer module
dnl
355
356
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
357
  [if test x$enable_fb = xyes; then PLUGINS="${PLUGINS} fb"; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
358
359
360
361

dnl
dnl  GGI module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
362
363
AC_ARG_WITH(ggi,
  [  --with-ggi[=name]       GGI support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
364
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
365
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
366
      PLUGINS="${PLUGINS} ggi";
Sam Hocevar's avatar
   
Sam Hocevar committed
367
368
369
370
371
372
      if test "x$withval" != "xyes";
      then
        LIB_GGI="-l"$withval
      else
        LIB_GGI="-lggi"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
373
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
374
375
376
377

dnl
dnl  SDL module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
378
AC_ARG_WITH(sdl,
Sam Hocevar's avatar
   
Sam Hocevar committed
379
  [  --with-sdl[=name]       SDL support (default enabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
380
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
381
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
382
      PLUGINS="${PLUGINS} sdl";
Sam Hocevar's avatar
   
Sam Hocevar committed
383
384
      if test "x$withval" != "xyes";
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
385
        LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -L"$withval"/lib -lSDL"
Sam Hocevar's avatar
   
Sam Hocevar committed
386
        INCLUDE="${INCLUDE} -I"$withval"/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
387
      else
388
        AC_CHECK_HEADERS(SDL/SDL.h, , [echo "Cannot find SDL headers !"; exit])
Sam Hocevar's avatar
   
Sam Hocevar committed
389
        LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"
Sam Hocevar's avatar
   
Sam Hocevar committed
390
      fi
Christophe Massiot's avatar
Christophe Massiot committed
391
    fi ])
392
    if test "x$withval" = "x";
Sam Hocevar's avatar
   
Sam Hocevar committed
393
    then
394
      AC_CHECK_HEADERS(SDL/SDL.h,
Sam Hocevar's avatar
   
Sam Hocevar committed
395
396
      [PLUGINS="${PLUGINS} sdl"
       LIB_SDL="${LIB_SDL} -L/usr/X11R6/lib -lSDL"])
Sam Hocevar's avatar
   
Sam Hocevar committed
397
    fi
Sam Hocevar's avatar
   
Sam Hocevar committed
398
399
400
401

dnl
dnl  Glide module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
402
403
AC_ARG_WITH(glide,
  [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
404
  [ if test "x$withval" != "xno";
Christophe Massiot's avatar
Christophe Massiot committed
405
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
406
      PLUGINS="${PLUGINS} glide";
Sam Hocevar's avatar
   
Sam Hocevar committed
407
408
409
410
411
412
      if test "x$withval" != "xyes";
      then
        LIB_GLIDE="-l"$withval
      else
        LIB_GLIDE="-lglide2x"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
413
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
414
415
416
417

dnl
dnl  ncurses module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
418
419
AC_ARG_ENABLE(ncurses,
  [  --enable-ncurses        ncurses interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
420
  [if test x$enable_ncurses = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
421
     PLUGINS="${PLUGINS} ncurses"
Sam Hocevar's avatar
   
Sam Hocevar committed
422
423
424
425
426
427
     LIB_NCURSES="-lncurses"
   fi])

dnl
dnl  Qt module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
428
429
AC_ARG_ENABLE(qt,
  [  --enable-qt             Qt interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
430
  [if test x$enable_qt = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
431
432
     PLUGINS="${PLUGINS} qt"
     ALIASES="${ALIASES} qvlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
433
     LIB_QT="-lqt -L${QTDIR}/lib"
Sam Hocevar's avatar
   
Sam Hocevar committed
434
435
436
437
438
439
     if test -x ${QTDIR}/bin/moc ;
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
440
441
442
443
444
   fi])

dnl 
dnl  KDE module
dnl
445
446
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
447
  [if test x$enable_kde = xyes; then PLUGINS="${PLUGINS} kde"; ALIASES="${ALIASES} kvlc"; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
448
449
450
451

dnl
dnl  Gnome module
dnl
452
AC_ARG_ENABLE(gnome,
Sam Hocevar's avatar
   
Sam Hocevar committed
453
  [  --enable-gnome          Gnome interface support (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
454
  [if test x$enable_gnome = xyes; then
Sam Hocevar's avatar
   
Sam Hocevar committed
455
456
     PLUGINS="${PLUGINS} gnome"
     ALIASES="${ALIASES} gnome-vlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
457
458
459
460
461
462
     LIB_GNOME="`gnome-config --libs gnomeui | sed 's,-rdynamic,,'`"
   fi])

dnl
dnl  Gtk+ module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
463
464
AC_ARG_ENABLE(gtk,
  [  --disable-gtk           Gtk+ support (default enabled)])
465
if test x$enable_gtk != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
466
467
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
  if test x${GTK_CONFIG} != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
468
469
    PLUGINS="${PLUGINS} gtk"
    ALIASES="${ALIASES} gvlc"
Sam Hocevar's avatar
   
Sam Hocevar committed
470
471
    CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
    LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
472
473
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
474
475
476
477

dnl
dnl  X11 module
dnl
478
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
   
Sam Hocevar committed
479
  [  --disable-x11           X11 support (default enabled)])
480
if test x$enable_x11 != xno; then
Sam Hocevar's avatar
   
Sam Hocevar committed
481
482
483
484
485
486
487
488
  if test x$x_includes = xNONE; then
    x_includes=/usr/X11R6/include
  fi
  if test x$x_libraries = xNONE; then
    x_libraries=/usr/X11R6/lib
  fi
  saved_CPPFLAGS=$CPPFLAGS
  CPPFLAGS="$CPPFLAGS -I$x_includes"
Sam Hocevar's avatar
   
Sam Hocevar committed
489
  AC_CHECK_HEADERS(X11/Xlib.h, [
Sam Hocevar's avatar
   
Sam Hocevar committed
490
    PLUGINS="${PLUGINS} x11"
Sam Hocevar's avatar
   
Sam Hocevar committed
491
492
493
494
    LIB_X11="-L$x_libraries -lX11 -lXext"
    CFLAGS_X11="-I$x_includes"
  ]
  CPPFLAGS=$saved_CPPFLAGS)
495
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
496
497
498
499

dnl
dnl  XVideo module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
500
AC_ARG_ENABLE(xvideo,
Sam Hocevar's avatar
   
Sam Hocevar committed
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
  [  --disable-xvideo        XVideo support (default enabled)])
if test x$enable_xvideo != xno; then
  if test x$x_includes = xNONE; then
    x_includes=/usr/X11R6/include
  fi
  if test x$x_libraries = xNONE; then
    x_libraries=/usr/X11R6/lib
  fi
  saved_CPPFLAGS=$CPPFLAGS
  CPPFLAGS="$CPPFLAGS -I$x_includes"
  AC_CHECK_HEADERS(X11/extensions/Xv.h, [
    PLUGINS="${PLUGINS} xvideo"
    LIB_XVIDEO="-L$x_libraries -lX11 -lXext -lXv"
    CFLAGS_X11="-I$x_includes"
  ]
  CPPFLAGS=$saved_CPPFLAGS)
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
518
519
520
521

dnl
dnl  ALSA module
dnl
Henri Fallon's avatar
   
Henri Fallon committed
522
AC_ARG_ENABLE(alsa,
523
  [  --enable-alsa           Alsa sound drivers support (Only for linux) (default disabled)],
Sam Hocevar's avatar
   
Sam Hocevar committed
524
525
  [if test x$enable_alsa = xyes; then AC_CHECK_HEADER(sys/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false") if test x$have_alsa = xtrue; then
     PLUGINS="${PLUGINS} alsa"
Sam Hocevar's avatar
   
Sam Hocevar committed
526
527
     LIB_ALSA="-lasound"
   fi; fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
528

Sam Hocevar's avatar
   
Sam Hocevar committed
529
dnl  end of non-BeOS stuff
530
531
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
532
533
534
dnl 
dnl  Configuration is finished
dnl
535
536
AC_SUBST(SYS)
AC_SUBST(ARCH)
537
AC_SUBST(PLUGINS)
Sam Hocevar's avatar
   
Sam Hocevar committed
538
AC_SUBST(BUILTINS)
539
AC_SUBST(ALIASES)
Sam Hocevar's avatar
   
Sam Hocevar committed
540
AC_SUBST(DEFINE)
Sam Hocevar's avatar
   
Sam Hocevar committed
541
AC_SUBST(INCLUDE)
542
543
AC_SUBST(DEBUG)
AC_SUBST(STATS)
544
AC_SUBST(TRACE)
545
AC_SUBST(OPTIMS)
Sam Hocevar's avatar
   
Sam Hocevar committed
546
AC_SUBST(CSS)
Sam Hocevar's avatar
   
Sam Hocevar committed
547
AC_SUBST(MOC)
Sam Hocevar's avatar
   
Sam Hocevar committed
548
549
550
551

AC_SUBST(LCFLAGS)
AC_SUBST(LIB)

Sam Hocevar's avatar
   
Sam Hocevar committed
552
553
554
555
AC_SUBST(LIB_ALSA)
AC_SUBST(LIB_BEOS)
AC_SUBST(LIB_DARWIN)
AC_SUBST(LIB_ESD)
Christophe Massiot's avatar
Christophe Massiot committed
556
AC_SUBST(LIB_GGI)
Sam Hocevar's avatar
   
Sam Hocevar committed
557
558
559
560
561
562
563
564
565
566
567
568
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GNOME)
AC_SUBST(LIB_GTK)
AC_SUBST(LIB_IDCTALTIVEC)
AC_SUBST(LIB_MACOSX)
AC_SUBST(LIB_NCURSES)
AC_SUBST(LIB_QT)
AC_SUBST(LIB_TS)
AC_SUBST(LIB_SDL)
AC_SUBST(LIB_X11)
AC_SUBST(LIB_XVIDEO)
AC_SUBST(LIB_YUV)
569

Sam Hocevar's avatar
   
Sam Hocevar committed
570
AC_SUBST(CFLAGS_VLC)
Sam Hocevar's avatar
   
Sam Hocevar committed
571
572
573
AC_SUBST(CFLAGS_GTK)
AC_SUBST(CFLAGS_X11)

Sam Hocevar's avatar
   
Sam Hocevar committed
574
AC_OUTPUT([Makefile.opts include/config.h])
575

576
577
578
579
580
581
echo "
vlc configuration
-----------------
vlc version           : ${VLC_VERSION}
system                : ${SYS}
architecture          : ${ARCH}
582
583
debug mode            : ${DEBUG}
statistics            : ${STATS}
584
trace mode            : ${TRACE}
585
optimizations         : ${OPTIMS}
Sam Hocevar's avatar
   
Sam Hocevar committed
586
CSS decryption        : ${CSS}
Sam Hocevar's avatar
   
Sam Hocevar committed
587
need builtin getopt   : ${GETOPT}
Sam Hocevar's avatar
   
Sam Hocevar committed
588
built-in modules      :${BUILTINS}
Sam Hocevar's avatar
   
Sam Hocevar committed
589
plugin modules        :${PLUGINS}
Sam Hocevar's avatar
   
Sam Hocevar committed
590
vlc aliases           :${ALIASES}
Sam Hocevar's avatar
   
Sam Hocevar committed
591
592

You may now tune Makefile.opts at your convenience."
593