configure.in 41.4 KB
Newer Older
Sam Hocevar's avatar
   
Sam Hocevar committed
1
dnl Autoconf settings for vlc
Sam Hocevar's avatar
   
Sam Hocevar committed
2
AC_INIT(include/main.h)
3
AC_CONFIG_HEADER(include/defs.h)
4

5
AC_CANONICAL_SYSTEM
6

Sam Hocevar's avatar
   
Sam Hocevar committed
7
8
VERSION="0.2.92-dev"
CODENAME=Ourumov
9

Sam Hocevar's avatar
   
Sam Hocevar committed
10
dnl Save CFLAGS and LDFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
11
save_CFLAGS="${CFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
12
save_LDFLAGS="${LDFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
13

14
15
dnl Check for tools
AC_PROG_MAKE_SET
Sam Hocevar's avatar
   
Sam Hocevar committed
16
17
AC_PROG_CC
AC_PROG_CPP
18

gbazin's avatar
   
gbazin committed
19
20
21
dnl Find the right ranlib, even when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, :)

Christophe Massiot's avatar
Christophe Massiot committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
dnl Check for GNU make
AC_PATH_PROG(GMAKE, gmake, no)
if test "x$GMAKE" = "xno"; then
  AC_CACHE_CHECK([whether GNU make is installed],
      [ac_cv_gmake],
      [if make --version | grep -q -i gnu; then
         ac_cv_gmake="yes"
       else
         echo "This software needs you to install GNU make to compile properly."
         echo "You can get it from http://www.gnu.org/."
         exit
       fi])
  VLC_MAKE="make"
else
  VLC_MAKE="gmake"
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
39
dnl Gettext stuff
Sam Hocevar's avatar
   
Sam Hocevar committed
40
ALL_LINGUAS="de fr ja no ru nl"
Sam Hocevar's avatar
Sam Hocevar committed
41

Sam Hocevar's avatar
   
Sam Hocevar committed
42
43
AC_DEFINE_UNQUOTED(PACKAGE, "vlc", [Package name])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Package version])
Sam Hocevar's avatar
   
Sam Hocevar committed
44
45
AM_GNU_GETTEXT

46
47
48
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL

gbazin's avatar
   
gbazin committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
dnl
dnl  Check the operating system
dnl
case x"${target_os}" in
  x)
    SYS=unknown
    ;;
  xlinux*)
    SYS=linux
    ;;
  xbsdi*)
    SYS=bsdi
    ;;
  xdarwin*)
    SYS=darwin
    ;;
  x*mingw32*)
    SYS=mingw32
    AC_CHECK_TOOL(WINDRES, windres, :)
Sam Hocevar's avatar
   
Sam Hocevar committed
68
    LIB_IPV4="${LIB_IPV4} -lws2_32"
gbazin's avatar
   
gbazin committed
69
70
71
72
73
74
75
76
77
    LIB_RC="${LIB_RC} -lws2_32"
    ;;
  x*nto*)
    SYS=nto
    LIB_X11="${LIB_X11} -lsocket"
    LIB_XVIDEO="${LIB_XVIDEO} -lsocket"
    ;;
  xbeos)
    SYS=beos
Sam Hocevar's avatar
   
Sam Hocevar committed
78
    LIB_VLC="${LIB_VLC} -lbe"
gbazin's avatar
   
gbazin committed
79
    LIB_BEOS="${LIB_BEOS} -lbe -lgame -lroot -ltracker"
Sam Hocevar's avatar
   
Sam Hocevar committed
80
    LIB_IPV4="${LIB_IPV4} -lbind"
gbazin's avatar
   
gbazin committed
81
82
83
84
85
86
87
    PLDFLAGS="${PLDFLAGS} -nostart"
    ;;
  x*)
    SYS=${target_os}
    ;;
esac

88
dnl Check for system libs needed
Sam Hocevar's avatar
   
Sam Hocevar committed
89
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty)
Sam Hocevar's avatar
   
Sam Hocevar committed
90
AC_CHECK_FUNC(connect,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
91
92
93
94
  AC_CHECK_LIB(socket,connect,
    LIB_IPV4="${LIB_IPV4} -lsocket"
    LIB_VLC="${LIB_VLC} -lsocket"
)])
Sam Hocevar's avatar
   
Sam Hocevar committed
95
AC_CHECK_FUNC(gethostbyname,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
96
97
98
99
  AC_CHECK_LIB(nsl,gethostbyname,LIB_IPV4="${LIB_IPV4} -lnsl")
])
AC_CHECK_FUNC(gethostbyname,,[
  AC_CHECK_LIB(bind,gethostbyname,LIB_IPV4="${LIB_IPV4} -lbind")
Sam Hocevar's avatar
   
Sam Hocevar committed
100
101
])
AC_CHECK_FUNC(nanosleep,,[
Sam Hocevar's avatar
   
Sam Hocevar committed
102
103
  AC_CHECK_LIB(rt,nanosleep,LIB_VLC="${LIB_VLC} -lrt",[
    AC_CHECK_LIB(posix4,nanosleep,LIB_VLC="${LIB_VLC} -lposix4")
Sam Hocevar's avatar
   
Sam Hocevar committed
104
105
  ])
])
106
AC_CHECK_FUNCS(usleep)
Sam Hocevar's avatar
   
Sam Hocevar committed
107
AC_CHECK_FUNC(inet_aton,,[
108
109
110
111
  AC_CHECK_LIB(resolv,inet_aton,LIB_VLC="${LIB_IPV4} -lresolv")
])
AC_CHECK_FUNC(textdomain,,[
  AC_CHECK_LIB(intl,textdomain,LIB_VLC="${LIB_VLC} -lintl")
Sam Hocevar's avatar
   
Sam Hocevar committed
112
])
Sam Hocevar's avatar
   
Sam Hocevar committed
113
AC_CHECK_FUNCS(vasprintf)
Sam Hocevar's avatar
   
Sam Hocevar committed
114
AC_CHECK_FUNCS(swab)
115
AC_CHECK_FUNCS([memalign valloc])
Sam Hocevar's avatar
   
Sam Hocevar committed
116

Sam Hocevar's avatar
   
Sam Hocevar committed
117
AC_CHECK_FUNCS(sigrelse)
gbazin's avatar
   
gbazin committed
118
AC_CHECK_FUNCS(getpwuid)
Sam Hocevar's avatar
   
Sam Hocevar committed
119

Sam Hocevar's avatar
   
Sam Hocevar committed
120
dnl Check for getopt
Sam Hocevar's avatar
   
Sam Hocevar committed
121
NEED_GETOPT=0
Sam Hocevar's avatar
   
Sam Hocevar committed
122
123
124
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
125
    [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB_VLC="${LIB_VLC} -lgnugetopt"],
Sam Hocevar's avatar
   
Sam Hocevar committed
126
    [NEED_GETOPT=1])])
Sam Hocevar's avatar
   
Sam Hocevar committed
127

128
AC_TYPE_SIGNAL
Sam Hocevar's avatar
   
Sam Hocevar committed
129
AC_CHECK_LIB(dl,dlopen,LIB_VLC="${LIB_VLC} -ldl")
Sam Hocevar's avatar
   
Sam Hocevar committed
130
131
132
AC_CHECK_LIB(m,cos,
  LIB_IMDCT="${LIB_IMDCT} -lm"
  LIB_FILTER_DISTORT="${LIB_FILTER_DISTORT} -lm")
Sam Hocevar's avatar
   
Sam Hocevar committed
133
134
135
136
AC_CHECK_LIB(m,pow,
  LIB_IMDCT="${LIB_IMDCT} -lm"
  LIB_IMDCT3DN="${LIB_IMDCT3DN} -lm"
  LIB_IMDCTSSE="${LIB_IMDCTSSE} -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
137
  LIB_CHROMA_I420_RGB="${LIB_CHROMA_I420_RGB} -lm"
Sam Hocevar's avatar
   
Sam Hocevar committed
138
)
Sam Hocevar's avatar
   
Sam Hocevar committed
139

Sam Hocevar's avatar
   
Sam Hocevar committed
140
dnl Check for pthreads - borrowed from XMMS
Sam Hocevar's avatar
   
Sam Hocevar committed
141
142
143
144
145
146
147
148
149
150
151
152
153
154
THREAD_LIB=error
if test "x${THREAD_LIB}" = xerror; then
  AC_CHECK_LIB(pthread,pthread_attr_init,THREAD_LIB="-lpthread")
fi
if test "x${THREAD_LIB}" = xerror; then
  AC_CHECK_LIB(pthreads,pthread_attr_init,THREAD_LIB="-lpthreads")
fi
if test "x${THREAD_LIB}" = xerror; then
  AC_CHECK_LIB(c_r,pthread_attr_init,THREAD_LIB="-lc_r")
fi
if test "x${THREAD_LIB}" = xerror; then
  AC_CHECK_FUNC(pthread_attr_init)
  THREAD_LIB=""
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
155
156
157

dnl Check for cthreads under GNU/Hurd for instance
AC_CHECK_LIB(threads,cthread_fork,THREAD_LIB="-lthreads")
158

Sam Hocevar's avatar
   
Sam Hocevar committed
159
160
161
dnl Check for misc headers
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
  AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
Sam Hocevar's avatar
   
Sam Hocevar committed
162
            Define if <pthread.h> defines pthread_cond_t.)])
Sam Hocevar's avatar
   
Sam Hocevar committed
163
164
AC_EGREP_HEADER(strncasecmp,strings.h,[
  AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Sam Hocevar's avatar
   
Sam Hocevar committed
165
            Define if <strings.h> defines strncasecmp.)])
Sam Hocevar's avatar
   
Sam Hocevar committed
166

Sam Hocevar's avatar
   
Sam Hocevar committed
167
dnl Check for headers
Sam Hocevar's avatar
   
Sam Hocevar committed
168
AC_CHECK_HEADERS(getopt.h strings.h)
169
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
170
171
AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
172
AC_CHECK_HEADERS(machine/param.h sys/shm.h)
Sam Hocevar's avatar
   
Sam Hocevar committed
173

Sam Hocevar's avatar
   
Sam Hocevar committed
174
175
AC_HEADER_TIME

Sam Hocevar's avatar
   
Sam Hocevar committed
176
177
178
dnl Check for threads library
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)

Sam Hocevar's avatar
   
Sam Hocevar committed
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
dnl Check for DPMS
if test x$SYS != xmingw32
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/dpms.h, [
    AC_EGREP_HEADER(DPMSInfo,X11/extensions/dpms.h,[
      AC_DEFINE(DPMSINFO_IN_DPMS_H, 1,
                Define if <X11/extensions/dpms.h> defines DPMSInfo.)
    ])
  ])
  CPPFLAGS=$saved_CPPFLAGS
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
199
dnl Check for ntohl, etc.
200
201
202
203
204
205
206
207
208
AC_CACHE_CHECK([for ntohl in sys/param.h],
    [ac_cv_c_ntohl_sys_param_h],
    [CFLAGS="${save_CFLAGS} -Wall -Werror"
     AC_TRY_COMPILE([#include <sys/param.h>],
        [void foo() { int meuh; ntohl(meuh); }],
        ac_cv_c_ntohl_sys_param_h=yes, ac_cv_c_ntohl_sys_param_h=no)])
if test x"$ac_cv_c_ntohl_sys_param_h" != x"no"; then
    AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
209

Sam Hocevar's avatar
   
Sam Hocevar committed
210
dnl Check for inline function size limit
211
212
213
214
215
216
217
AC_CACHE_CHECK([if \$CC accepts -finline-limit],
    [ac_cv_c_inline_limit],
    [CFLAGS="${save_CFLAGS} -finline-limit-30000"
     AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
if test x"$ac_cv_c_inline_limit" != x"no"; then
    save_CFLAGS="${save_CFLAGS} -finline-limit-30000"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
218

Sam Hocevar's avatar
   
Sam Hocevar committed
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
dnl Check for -W or -w flags
AC_CACHE_CHECK([if \$CC accepts -Wall -Winline],
    [ac_cv_c_Wall_Winline],
    [CFLAGS="${save_CFLAGS} -Wall -Winline"
     AC_TRY_COMPILE([],,ac_cv_c_Wall_Winline=yes, ac_cv_c_Wall_Winline=no)])
if test x"$ac_cv_c_Wall_Winline" != x"no"; then
    save_CFLAGS="${save_CFLAGS} -Wall -Winline"
else
    AC_CACHE_CHECK([if \$CC accepts -wall -winline],
        [ac_cv_c_wall_winline],
        [CFLAGS="${save_CFLAGS} -wall -winline"
         AC_TRY_COMPILE([],,ac_cv_c_wall_winline=yes, ac_cv_c_wall_winline=no)])
    if test x"$ac_cv_c_wall_winline" != x"no"; then
        save_CFLAGS="${save_CFLAGS} -wall -winline"
    fi
fi

dnl Check for -pipe
AC_CACHE_CHECK([if \$CC accepts -pipe],
    [ac_cv_c_pipe],
    [CFLAGS="${save_CFLAGS} -pipe"
     AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
if test x"$ac_cv_c_pipe" != x"no"; then
    save_CFLAGS="${save_CFLAGS} -pipe"
fi

dnl Check for various optimization flags
AC_CACHE_CHECK([if \$CC accepts -O3],
    [ac_cv_c_o3],
    [CFLAGS="${save_CFLAGS} -O3"
     AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
if test x"$ac_cv_c_o3" != x"no"; then
    CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
else
    AC_CACHE_CHECK([if \$CC accepts -O2],
        [ac_cv_c_o2],
        [CFLAGS="${save_CFLAGS} -O2"
         AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
    if test x"$ac_cv_c_o2" != x"no"; then
        CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
    else
        AC_CACHE_CHECK([if \$CC accepts -O],
            [ac_cv_c_o],
            [CFLAGS="${save_CFLAGS} -O"
             AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
        if test x"$ac_cv_c_o" != x"no"; then
            CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
        fi
    fi
fi

dnl Check for -ffast-math
AC_CACHE_CHECK([if \$CC accepts -ffast-math],
    [ac_cv_c_fast_math],
    [CFLAGS="${save_CFLAGS} -ffast-math"
     AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
if test x"$ac_cv_c_fast_math" != x"no"; then
    CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
fi

dnl Check for -funroll-loops
AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
    [ac_cv_c_unroll_loops],
    [CFLAGS="${save_CFLAGS} -funroll-loops"
     AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
if test x"$ac_cv_c_unroll_loops" != x"no"; then
    CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
fi

dnl Check for -fomit-frame-pointer
AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
    [ac_cv_c_omit_frame_pointer],
    [CFLAGS="${save_CFLAGS} -fomit-frame-pointer"
     AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
if test x"$ac_cv_c_omit_frame_pointer" != x"no"; then
    CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
297
dnl Check for Darwin plugin linking flags
Christophe Massiot's avatar
Christophe Massiot committed
298
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
299
    [ac_cv_ld_darwin],
Christophe Massiot's avatar
Christophe Massiot committed
300
    [CFLAGS="${save_CFLAGS} -bundle -undefined error -lcc_dynamic"
301
302
     AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
if test x"$ac_cv_ld_darwin" != x"no"; then
Christophe Massiot's avatar
Christophe Massiot committed
303
    PLDFLAGS="${PLDFLAGS} -bundle -undefined error -lcc_dynamic"
304
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
305
306

dnl Check for standard plugin linking flags
307
308
309
310
311
AC_CACHE_CHECK([if \$CC accepts -shared],
    [ac_cv_ld_plugins],
    [CFLAGS="${save_CFLAGS} -shared"
     AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
if test x"$ac_cv_ld_plugins" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
312
    PLDFLAGS="${PLDFLAGS} -shared"
Sam Hocevar's avatar
   
Sam Hocevar committed
313
fi
314
        
315
316
317
318
dnl Checks for __attribute__(aligned()) directive
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
    [ac_cv_c_attribute_aligned],
    [ac_cv_c_attribute_aligned=0
Sam Hocevar's avatar
   
Sam Hocevar committed
319
        CFLAGS="${save_CFLAGS} -Werror"
320
321
322
323
324
325
326
327
328
329
    for ac_cv_c_attr_align_try in 2 4 8 16 32 64; do
        AC_TRY_COMPILE([],
        [static char c __attribute__ ((aligned($ac_cv_c_attr_align_try))) = 0; return c;],
        [ac_cv_c_attribute_aligned=$ac_cv_c_attr_align_try])
    done])
if test x"$ac_cv_c_attribute_aligned" != x"0"; then
    AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
        [$ac_cv_c_attribute_aligned],[Maximum supported data alignment])
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
330
dnl End of the bizarre compilation tests
Sam Hocevar's avatar
   
Sam Hocevar committed
331
CFLAGS="${save_CFLAGS}"
Sam Hocevar's avatar
   
Sam Hocevar committed
332
LDFLAGS="${save_LDFLAGS}"
Christophe Massiot's avatar
Christophe Massiot committed
333

334
dnl Check for boolean_t
335
336
AC_CACHE_CHECK([for boolean_t in sys/types.h],
    [ac_cv_c_boolean_t_sys_types_h],
Sam Hocevar's avatar
   
Sam Hocevar committed
337
    [AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
338
339
340
341
342
343
344
     ac_cv_c_boolean_t_sys_types_h=yes, ac_cv_c_boolean_t_sys_types_h=no)])
if test x"$ac_cv_c_boolean_t_sys_types_h" != x"no"; then
    AC_DEFINE(BOOLEAN_T_IN_SYS_TYPES_H, 1, Define if <sys/types.h> defines boolean_t.)
fi

AC_CACHE_CHECK([for boolean_t in pthread.h],
    [ac_cv_c_boolean_t_pthread_h],
Sam Hocevar's avatar
   
Sam Hocevar committed
345
    [AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
346
347
348
349
350
351
352
     ac_cv_c_boolean_t_pthread_h=yes, ac_cv_c_boolean_t_pthread_h=no)])
if test x"$ac_cv_c_boolean_t_pthread_h" != x"no"; then
    AC_DEFINE(BOOLEAN_T_IN_PTHREAD_H, 1, Define if <pthread.h> defines boolean_t.)
fi

AC_CACHE_CHECK([for boolean_t in cthreads.h],
    [ac_cv_c_boolean_t_cthreads_h],
Sam Hocevar's avatar
   
Sam Hocevar committed
353
    [AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
354
355
356
357
     ac_cv_c_boolean_t_cthreads_h=yes, ac_cv_c_boolean_t_cthreads_h=no)])
if test x"$ac_cv_c_boolean_t_cthreads_h" != x"no"; then
    AC_DEFINE(BOOLEAN_T_IN_CTHREADS_H, 1, Define if <cthreads.h> defines boolean_t.)
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
358

Sam Hocevar's avatar
   
Sam Hocevar committed
359
360
361
362
363
364
365
366
367
368
369
dnl
dnl  Check the CPU
dnl
case x"${target_cpu}" in
  x)
    ARCH=unknown
    ;;
  *)
    ARCH=${target_cpu}
    ;;
esac
Sam Hocevar's avatar
   
Sam Hocevar committed
370
371
372
373

dnl
dnl  default modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
374
BUILTINS="${BUILTINS} idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec ac3_adec mpeg_vdec"
Sam Hocevar's avatar
   
Sam Hocevar committed
375
PLUGINS="${PLUGINS} dummy null rc logger mpeg_es mpeg_ps mpeg_ts file udp http ipv4 memcpy lpcm_adec ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort fx_scope"
Sam Hocevar's avatar
   
Sam Hocevar committed
376
377
378
379

dnl
dnl  Accelerated modules
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
380
MMX_MODULES="memcpymmx idctmmx motionmmx chroma_i420_rgb_mmx chroma_i420_yuy2_mmx chroma_i422_yuy2_mmx chroma_i420_ymga_mmx"
Sam Hocevar's avatar
   
Sam Hocevar committed
381
382
MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
gbazin's avatar
   
gbazin committed
383
if test x$SYS != xmingw32; then
Sam Hocevar's avatar
   
Sam Hocevar committed
384
SSE_MODULES="imdctsse downmixsse"
gbazin's avatar
   
gbazin committed
385
fi
Christophe Massiot's avatar
Christophe Massiot committed
386
ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
387

388
389
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
    [ac_cv_mmx_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
390
    [AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
391
                    ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
392
if test x"$ac_cv_mmx_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
393
  ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
394
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
395

396
397
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
    [ac_cv_mmxext_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
398
    [AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
399
                    ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
400
if test x"$ac_cv_mmxext_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
401
  ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
402
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
403

404
405
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
    [ac_cv_3dnow_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
406
    [AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
407
                    ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
408
if test x"$ac_cv_3dnow_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
409
  AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
Sam Hocevar's avatar
   
Sam Hocevar committed
410
  ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
411
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
412

413
414
AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
    [ac_cv_sse_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
415
    [AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
416
                    ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
417
if test x"$ac_cv_sse_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
418
  AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
Sam Hocevar's avatar
   
Sam Hocevar committed
419
  ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
420
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
421

gbazin's avatar
   
gbazin committed
422
423
424
# don't try to grok altivec with native mingw32 it doesn't work right now
# we should be able to remove this test with future versions of mingw32
if test x$SYS != xmingw32; then
425
426
AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
    [ac_cv_altivec_inline],
Sam Hocevar's avatar
   
Sam Hocevar committed
427
    [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
428
429
430
         ac_cv_altivec_inline=yes,
         [save_CFLAGS=$CFLAGS
          CFLAGS="$CFLAGS -Wa,-m7400"
Sam Hocevar's avatar
   
Sam Hocevar committed
431
          AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
432
            [ac_cv_altivec_inline="-Wa,-m7400"],
433
            ac_cv_altivec_inline=no)
434
435
          CFLAGS=$save_CFLAGS
         ])])
436
if test x"$ac_cv_altivec_inline" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
437
  AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
438
  if test x"$ac_cv_altivec_inline" != x"yes"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
439
440
    CFLAGS_IDCTALTIVEC="$CFLAGS_IDCTALTIVEC $ac_cv_altivec_inline"
    CFLAGS_MOTIONALTIVEC="$CFLAGS_MOTIONALTIVEC $ac_cv_altivec_inline"
Sam Hocevar's avatar
   
Sam Hocevar committed
441
    CFLAGS_VLC="$CFLAGS_VLC $ac_cv_altivec_inline"
442
  fi
443
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
444
fi
445

446
447
AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
    [ac_cv_c_altivec],
448
449
450
    [save_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -faltivec"
     # Darwin test
Sam Hocevar's avatar
   
Sam Hocevar committed
451
     AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
452
453
        ac_cv_c_altivec=-faltivec, [
        # Linux/PPC test
Sam Hocevar's avatar
   
Sam Hocevar committed
454
        CFLAGS="$save_CFLAGS $CFLAGS_IDCTALTIVEC -fvec"
Sam Hocevar's avatar
   
Sam Hocevar committed
455
        AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
456
457
458
459
            [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
        ])
     CFLAGS=$save_CFLAGS
    ])
460
if test x"$ac_cv_c_altivec" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
461
  AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
Sam Hocevar's avatar
   
Sam Hocevar committed
462
463
  CFLAGS_IDCTALTIVEC="$CFLAGS_IDCTALTIVEC $ac_cv_c_altivec"
  CFLAGS_MOTIONALTIVEC="$CFLAGS_MOTIONALTIVEC $ac_cv_c_altivec"
Sam Hocevar's avatar
   
Sam Hocevar committed
464
  CFLAGS_VLC="$CFLAGS_VLC $ac_cv_c_altivec"
465
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
466
467
468
469
470
471
472
473
474
475
fi

AC_CACHE_CHECK([if linker needs -framework vecLib],
    [ac_cv_ld_altivec],
    [save_LDFLAGS=$LDFLAGS
     LDFLAGS="$LDFLAGS -framework vecLib"
     AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
     LDFLAGS=$save_LDFLAGS
    ])
if test x"$ac_cv_ld_altivec" != x"no"; then
Sam Hocevar's avatar
   
Sam Hocevar committed
476
477
  LIB_IDCTALTIVEC="${LIB_IDCTALTIVEC} -framework vecLib"
  LIB_MOTIONALTIVEC="${LIB_MOTIONALTIVEC} -framework vecLib"
Sam Hocevar's avatar
   
Sam Hocevar committed
478
  LIB_VLC="${LIB_VLC} -framework vecLib"
479
fi
gbazin's avatar
   
gbazin committed
480
fi # end if mingw32
481
482


Sam Hocevar's avatar
   
Sam Hocevar committed
483
484
485
AC_ARG_WITH(,[])
AC_ARG_WITH(,[Optimization options:])

Sam Hocevar's avatar
   
Sam Hocevar committed
486
dnl
487
dnl  Special arch tuning
Sam Hocevar's avatar
   
Sam Hocevar committed
488
dnl
489
AC_ARG_WITH(tuning,
Sam Hocevar's avatar
   
Sam Hocevar committed
490
[  --with-tuning=ARCH      enable special tuning for an architecture
491
492
493
494
                          (default i686 on IA-32 and 750 on PPC)])
if test "x$withval" != "x"; then
    TUNING=$withval
else
495
    if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
496
    else
497
        if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
498
499
    fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
500
501

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
502
dnl  x86 accelerations
Sam Hocevar's avatar
   
Sam Hocevar committed
503
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
504
505
506
507
508
if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xx86 -o x${target_cpu} = xi386
then
    ARCH="${ARCH} mmx"
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
509

Sam Hocevar's avatar
   
Sam Hocevar committed
510
511
512
513
514
515
516
517
dnl
dnl  Enable/disable optimizations
dnl
AC_ARG_ENABLE(optimizations,
[  --disable-optimizations disable compiler optimizations (default enabled)],
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])

Sam Hocevar's avatar
   
Sam Hocevar committed
518
519
520
dnl
dnl  AltiVec acceleration
dnl
521
AC_ARG_ENABLE(altivec,
Sam Hocevar's avatar
   
Sam Hocevar committed
522
[  --disable-altivec       disable altivec optimizations (default enabled on PPC)],
523
524
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
525
[ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
526
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
527
528
529
530

dnl
dnl  Debugging mode
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
531
DEBUG=0
532
AC_ARG_ENABLE(debug,
Sam Hocevar's avatar
   
Sam Hocevar committed
533
[  --enable-debug          debug mode (default disabled)],
534
[ if test x$enableval = xyes; then DEBUG=1; fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
535

Sam Hocevar's avatar
   
Sam Hocevar committed
536
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
537
dnl  Enable release-specific flags
Sam Hocevar's avatar
   
Sam Hocevar committed
538
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
539
540
541
AC_ARG_ENABLE(release,
[  --enable-release        activate extra optimizations (default disabled)],
[ if test x$enableval = xyes; then RELEASE=1; fi ],
Sam Hocevar's avatar
   
Sam Hocevar committed
542
[ VERSION="${VERSION}_`date +%Y-%m-%d`" ])
Sam Hocevar's avatar
   
Sam Hocevar committed
543

Sam Hocevar's avatar
   
Sam Hocevar committed
544
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
545
dnl  Input plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
546
547
dnl

Sam Hocevar's avatar
   
Sam Hocevar committed
548
AC_ARG_WITH(,[Input plugins:])
Sam Hocevar's avatar
   
Sam Hocevar committed
549
550

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
dnl  DVD module: optionally check for installed libdvdcss
dnl
AC_ARG_ENABLE(dvd,
[  --enable-dvd            DVD input module (default enabled)])
if test "x$enableval" != "xno"
then
  AC_ARG_WITH(dvdcss, 
  [    --with-dvdcss=PATH    libdvdcss headers and libraries])
  case "x$with_dvdcss" in
  x)
    AC_CHECK_HEADERS(dvdcss/dvdcss.h,
      [ PLUGINS="${PLUGINS} dvd"
        LIB_DVD="${LIB_DVD} -ldvdcss" ])
  ;;
  xno)
    PLUGINS="${PLUGINS} dvd"
    CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
    LIB_DVD="${LIB_DVD} -ldl"
  ;;
  *)
    AC_MSG_CHECKING(for dvdcss headers in ${withval})
    if test -f ${withval}/include/dvdcss/dvdcss.h
Sam Hocevar's avatar
   
Sam Hocevar committed
573
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
574
      AC_MSG_RESULT(yes)
Sam Hocevar's avatar
   
Sam Hocevar committed
575
      PLUGINS="${PLUGINS} dvd"
Sam Hocevar's avatar
   
Sam Hocevar committed
576
577
578
579
580
581
582
583
584
      LIB_DVD="${LIB_DVD} -L${withval}/lib -ldvd"
      CFLAGS_DVD="${CFLAGS_DVD} -I${withval}/include"
    else
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([Cannot find ${withval}/dvdcss/dvdcss.h])
    fi
  ;;
  esac
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
585

Stéphane Borel's avatar
Stéphane Borel committed
586
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
587
dnl dvdread module: check for libdvdread plugin
Stéphane Borel's avatar
Stéphane Borel committed
588
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
AC_ARG_ENABLE(dvdread,
[  --enable-dvdread        dvdread input module (default disabled)])
if test "x$enableval" != "xno"
then
  AC_ARG_WITH(dvdread, 
  [    --with-dvdread=PATH   libdvdread headers and libraries])
  case "x$with_dvdread" in
  x)
    AC_CHECK_HEADERS(dvdread/dvd_reader.h,
      [ PLUGINS="${PLUGINS} dvdread"
        LIB_DVDREAD="${LIB_DVDREAD} -ldvdread" ])
  ;;
  *)
    AC_MSG_CHECKING(for dvdread headers in ${withval})
    if test -f ${withval}/include/dvdread/dvd_reader.h
604
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
605
606
607
608
      AC_MSG_RESULT(yes)
      PLUGINS="${PLUGINS} dvdread"
      LIB_DVDREAD="${LIB_DVDREAD} -L${withval}/lib -ldvdread"
      CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I${withval}/include"
609
    else
Sam Hocevar's avatar
   
Sam Hocevar committed
610
611
612
613
614
615
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([Cannot find ${withval}/dvdread/dvd_reader.h])
    fi
  ;;
  esac
fi
Stéphane Borel's avatar
Stéphane Borel committed
616

617
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
618
dnl  VCD module
619
620
dnl
AC_ARG_ENABLE(vcd,
Sam Hocevar's avatar
   
Sam Hocevar committed
621
  [  --enable-vcd            VCD support for Linux and MacOS X (default enabled)])
622

Sam Hocevar's avatar
   
Sam Hocevar committed
623
624
625
if test x$enable_vcd != xno
then
  AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
Sam Hocevar's avatar
   
Sam Hocevar committed
626
    PLUGINS="${PLUGINS} vcd"
Sam Hocevar's avatar
   
Sam Hocevar committed
627
  ])
628

Sam Hocevar's avatar
   
Sam Hocevar committed
629
630
631
632
  if test "x${SYS}" = "xbsdi"
  then
    PLUGINS="${PLUGINS} vcd"
  fi
633

Sam Hocevar's avatar
   
Sam Hocevar committed
634
635
636
  if test "x${SYS}" = "xdarwin"
  then
    PLUGINS="${PLUGINS} vcd"
Christophe Massiot's avatar
Christophe Massiot committed
637
    LIB_VCD="${LIB_VCD} -framework IOKit -framework CoreFoundation" 
Sam Hocevar's avatar
   
Sam Hocevar committed
638
  fi
Jon Lech Johansen's avatar
Jon Lech Johansen committed
639
640
fi

Johan Bilien's avatar
Johan Bilien committed
641
642
643
644
dnl
dnl  Satellite input module
dnl
AC_ARG_ENABLE(satellite,
Sam Hocevar's avatar
   
Sam Hocevar committed
645
  [  --enable-satellite      satellite card support (default disabled)],
Johan Bilien's avatar
Johan Bilien committed
646
647
648
649
650
651
  [ if test x$enable_satellite = xyes
    then
      BUILTINS="${BUILTINS} satellite"
      AC_DEFINE(HAVE_SATELLITE, 1, define if compiling with satellite card support)
    fi])

652
653
654
dnl
dnl  ipv6 plugin
dnl
Christophe Massiot's avatar
Christophe Massiot committed
655
AC_CHECK_FUNC(inet_pton,[PLUGINS="${PLUGINS} ipv6"])
656

Sam Hocevar's avatar
   
Sam Hocevar committed
657
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
658
dnl  Codec plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
659
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
660

Sam Hocevar's avatar
   
Sam Hocevar committed
661
AC_ARG_WITH(,[Codec plugins:])
Sam Hocevar's avatar
   
Sam Hocevar committed
662

663
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
664
dnl  mad plugin
665
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
666
667
AC_ARG_ENABLE(mad,
  [  --enable-mad            libmad module (default disabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
668
if test x$enable_mad = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
669
670
671
672
673
674
675
then
  PLUGINS="${PLUGINS} mad"
  LIB_MAD="${LIB_MAD} -lmad"
  AC_ARG_WITH(mad,
    [    --with-mad=PATH       path to libmad],
    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
676
        CFLAGS_MAD="${CFLAGS_MAD} -I$with_val/include"
Sam Hocevar's avatar
   
Sam Hocevar committed
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
        LIB_MAD="${LIB_MAD} -L$with_val/lib"
      fi ])
  save_CFLAGS=$CFLAGS
  save_LDFLAGS=$LDFLAGS
  CFLAGS="$CFLAGS $CFLAGS_MAD"
  LDFLAGS="$LDFLAGS $LIB_MAD"
  AC_CHECK_HEADERS(mad.h, ,
  [ echo "Cannot find development headers for libmad..."
    exit 1
  ])
  AC_CHECK_LIB(mad, mad_bit_init, ,
  [ echo "Cannot find libmad library..."
    exit 1
  ])
  CFLAGS=$save_CFLAGS
  LDFLAGS=$save_LDFLAGS
fi
694

Sam Hocevar's avatar
   
Sam Hocevar committed
695
dnl special case for BeOS
Sam Hocevar's avatar
   
Sam Hocevar committed
696
697
if test x$SYS = xbeos
then
Sam Hocevar's avatar
   
Sam Hocevar committed
698
    PLUGINS="${PLUGINS} beos"
699
700
701
702

dnl default case
else

gbazin's avatar
   
gbazin committed
703
dnl
gbazin's avatar
   
gbazin committed
704
dnl  a52 AC3 decoder plugin
gbazin's avatar
   
gbazin committed
705
dnl
gbazin's avatar
   
gbazin committed
706
AC_ARG_ENABLE(a52,
Sam Hocevar's avatar
   
Sam Hocevar committed
707
  [  --enable-a52            AC3 support with liba52 (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
708
if test "x$enableval" != "xno" -a x$SYS != xmingw32
gbazin's avatar
   
gbazin committed
709
710
  then
    AC_CHECK_HEADERS(a52dec/a52.h, [
gbazin's avatar
   
gbazin committed
711
      BUILTINS="${BUILTINS} a52"
Sam Hocevar's avatar
   
Sam Hocevar committed
712
      LIB_A52="${LIB_A52} -la52 -lm"
gbazin's avatar
   
gbazin committed
713
714
715
     ],[])
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
716
717
718
719
720
721
722
723
724
725
726
727
728
dnl
dnl  ogg vorbis plugin
dnl
AC_ARG_ENABLE(vorbis,
  [  --enable-vorbis             Ogg/Vorbis decoder support (default enabled)])
if test "x$enableval" != "xno"
then
  AC_CHECK_HEADERS(ogg/ogg.h, [
    PLUGINS="${PLUGINS} vorbis"
    LIB_VORBIS="${LIB_VORBIS} -lvorbis"
   ],[])
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
729
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
730
dnl  Video plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
731
732
dnl

Sam Hocevar's avatar
   
Sam Hocevar committed
733
AC_ARG_WITH(,[Video plugins:])
Sam Hocevar's avatar
   
Sam Hocevar committed
734

Sam Hocevar's avatar
   
Sam Hocevar committed
735
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
736
737
dnl  X11 module
dnl  (enabled by default except on win32)
Sam Hocevar's avatar
   
Sam Hocevar committed
738
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
739
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
   
Sam Hocevar committed
740
  [  --enable-x11            X11 support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
if test x$enable_x11 != xno &&
  (test x$SYS != xmingw32 || test x$enable_x11 = xyes); 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/Xlib.h, [
    PLUGINS="${PLUGINS} x11"
    LIB_X11="${LIB_X11} -L$x_libraries -lX11 -lXext"
    CFLAGS_X11="${CFLAGS_X11} -I$x_includes"
  ])
  CPPFLAGS=$saved_CPPFLAGS
fi

dnl
dnl  XVideo module
dnl  (enabled by default except on win32)
dnl
AC_ARG_ENABLE(xvideo,
Sam Hocevar's avatar
   
Sam Hocevar committed
764
  [  --enable-xvideo         XVideo support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
if test x$enable_xvideo != xno &&
  (test x$SYS != xmingw32 || test x$enable_xvideo = xyes); 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, [
    saved_CFLAGS=$CFLAGS
    CFLAGS="$CFLAGS -L$x_libraries -lX11 -lXext"
    AC_CHECK_LIB(Xv_pic,XvSetPortAttribute,
      # We have Xv_pic, that's good, we can build an xvideo.so plugin !
      PLUGINS="${PLUGINS} xvideo"
      LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv_pic"
      CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes",
      # We don't have Xv_pic, let's make xvideo.a as builtin
      BUILTINS="${BUILTINS} xvideo"
      LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv"
      CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes")
    CFLAGS=$saved_CFLAGS
  ]
  CPPFLAGS=$saved_CPPFLAGS)
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
791
792
793
794

dnl
dnl  SDL module
dnl
795
AC_ARG_ENABLE(sdl,
Sam Hocevar's avatar
   
Sam Hocevar committed
796
  [  --enable-sdl            SDL support (default enabled)])
797
if test "x$enable_sdl" != "xno"
798
then
799
800
  SDL_PATH=$PATH
  AC_ARG_WITH(sdl-config-path,
Sam Hocevar's avatar
   
Sam Hocevar committed
801
    [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
802
803
804
805
806
    [ if test "x$withval" != "xno"
      then
        SDL_PATH=$withval:$PATH
      fi ])
  AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
807
808
  SDL_CONFIG=${SDL12_CONFIG}
  SDL_HEADER="SDL12/SDL.h"
Sam Hocevar's avatar
   
Sam Hocevar committed
809
810
  if test x${SDL_CONFIG} = xno
  then
811
    AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
Sam Hocevar's avatar
   
Sam Hocevar committed
812
    SDL_CONFIG=${SDL11_CONFIG}
813
814
    SDL_HEADER="SDL11/SDL.h"
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
815
816
  if test x${SDL_CONFIG} = xno
  then
817
    AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
818
    SDL_HEADER="SDL/SDL.h"
819
  fi
Sam Hocevar's avatar
   
Sam Hocevar committed
820
821
  if test x${SDL_CONFIG} != xno
  then
822
    PLUGINS="${PLUGINS} sdl"
Sam Hocevar's avatar
   
Sam Hocevar committed
823
824
    CFLAGS_SDL="${CFLAGS_SDL} `${SDL_CONFIG} --cflags`"
    LIB_SDL="${LIB_SDL} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
Sam Hocevar's avatar
   
Sam Hocevar committed
825
826
    save_CPPFLAGS=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS $CFLAGS_SDL"
827
828
    AC_CHECK_HEADERS(${SDL_HEADER}, AC_DEFINE_UNQUOTED(SDL_INCLUDE_FILE,
      <${SDL_HEADER}>, Indicate whether we should use SDL/SDL.h or SDL11/SDL.h),
829
830
831
832
      [ AC_MSG_ERROR([The development package for SDL is not installed. 
Please install it and try again. Alternatively you can also configure with 
--disable-sdl.])
      ])
Sam Hocevar's avatar
   
Sam Hocevar committed
833
    CPPFLAGS=$save_CPPFLAGS
Sam Hocevar's avatar
   
Sam Hocevar committed
834
    if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
Sam Hocevar's avatar
   
Sam Hocevar committed
835
    then
836
837
838
      AC_MSG_ERROR([The development package for SDL is not installed.
Please install it and try again. Alternatively you can also configure with
--disable-sdl.])
Sam Hocevar's avatar
   
Sam Hocevar committed
839
    fi
840
  elif test "x$enable_sdl" =  "xyes"
Sam Hocevar's avatar
   
Sam Hocevar committed
841
  then
842
843
844
    AC_MSG_ERROR([I couldn't find the SDL package. You can download libSDL
from http://www.libsdl.org/, or configure with --disable-sdl. Have a nice day.
    ])
845
846
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
847

Sam Hocevar's avatar
   
Sam Hocevar committed
848
849
850
dnl
dnl  Windows DirectX module
dnl
851
AC_ARG_ENABLE(directx,
Sam Hocevar's avatar
   
Sam Hocevar committed
852
  [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
853
854
if test "x$enableval" != "xno"
then
Sam Hocevar's avatar
   
Sam Hocevar committed
855
  if test x$SYS = xmingw32
856
  then
Xavier Marchesini's avatar
   
Xavier Marchesini committed
857
    AC_ARG_WITH(directx, 
Sam Hocevar's avatar
   
Sam Hocevar committed
858
859
    [    --with-directx=PATH   Win32 DirectX headers and libraries])
    if test "x$with_directx" = "x"
Sam Hocevar's avatar
   
Sam Hocevar committed
860
    then
gbazin's avatar
   
gbazin committed
861
      AC_CHECK_HEADERS(ddraw.h,
862
      [ PLUGINS="${PLUGINS} directx"
Sam Hocevar's avatar
   
Sam Hocevar committed
863
        LIB_DIRECTX="${LIB_DIRECTX} -lgdi32" ])
864
865
    else
      AC_MSG_CHECKING(for directX headers in ${withval})
gbazin's avatar
   
gbazin committed
866
      if test -f ${withval}/ddraw.h
gbazin's avatar
   
gbazin committed
867
      then
868
        PLUGINS="${PLUGINS} directx"
Sam Hocevar's avatar
   
Sam Hocevar committed
869
        LIB_DIRECTX="${LIB_DIRECTX} -L${withval}/lib -lgdi32"
gbazin's avatar
   
gbazin committed
870
        INCLUDE="${INCLUDE} -I${withval}"
871
        AC_MSG_RESULT(yes)
gbazin's avatar
   
gbazin committed
872
      else
873
        AC_MSG_RESULT(no)
gbazin's avatar
   
gbazin committed
874
        AC_MSG_ERROR([Cannot find ${withval}/ddraw.h!])
gbazin's avatar
   
gbazin committed
875
      fi
876
877
878
    fi
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
879

gbazin's avatar
   
gbazin committed
880
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
881
dnl  Linux framebuffer module
gbazin's avatar
   
gbazin committed
882
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
883
884
885
886
887
888
889
890
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
    if test x$enable_fb != xno
    then
      AC_CHECK_HEADERS(linux/fb.h, [
        PLUGINS="${PLUGINS} fb"
      ])
    fi
gbazin's avatar
   
gbazin committed
891

Sam Hocevar's avatar
   
Sam Hocevar committed
892
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
893
dnl  Linux MGA module
Sam Hocevar's avatar
   
Sam Hocevar committed
894
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
895
896
897
AC_ARG_ENABLE(mga,
  [  --enable-mga            Linux kernel Matrox support (default disabled)],
  [ if test x$enable_mga = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
898
    then
Sam Hocevar's avatar
   
Sam Hocevar committed
899
      PLUGINS="${PLUGINS} mga xmga"
Sam Hocevar's avatar
   
Sam Hocevar committed
900
    fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
901

Sam Hocevar's avatar
   
Sam Hocevar committed
902
903
904
905
906
dnl
dnl  GGI module
dnl
AC_ARG_ENABLE(ggi,
  [  --enable-ggi            GGI support (default disabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
907
if test x$enable_ggi = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
908
909
910
911
912
913
914
915
916
917
918
919
then
  PLUGINS="${PLUGINS} ggi"
  LIB_GGI="${LIB_GGI} -lggi"
  AC_ARG_WITH(ggi,
    [    --with-ggi=PATH       path to libggi],
    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
      then
        CFLAGS_GGI="${CFLAGS_GGI} -I$with_val/include"
        LIB_GGI="${LIB_GGI} -L$with_val/lib"
      fi ])
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
920
921
922
dnl
dnl  Glide module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
923
924
AC_ARG_ENABLE(glide,
  [  --enable-glide          Glide (3dfx) support (default disabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
925
if test x$enable_glide = xyes
Sam Hocevar's avatar
   
Sam Hocevar committed
926
927
928
929
930
931
932
then
  PLUGINS="${PLUGINS} glide"
  LIB_GLIDE="${LIB_GLIDE} -lglide2x -lm"
  CFLAGS_GLIDE="${CFLAGS_GLIDE} -I/usr/include/glide"
  AC_ARG_WITH(glide,
    [    --with-glide=PATH     path to libglide],
    [ if test "x$with_val" != "xno" -a "x$with_val" != "x"
Sam Hocevar's avatar
   
Sam Hocevar committed
933
      then
Sam Hocevar's avatar
   
Sam Hocevar committed
934
935
936
937
        CFLAGS_GLIDE="${CFLAGS_GLIDE} -I$with_val/include"
        LIB_GLIDE="${LIB_GLIDE} -L$with_val/lib"
      fi ])
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
938

Sam Hocevar's avatar
   
Sam Hocevar committed
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
dnl
dnl  AA plugin
dnl
AC_ARG_ENABLE(aa,
  [  --enable-aa             aalib output (default disabled)])
if test x$enable_aa = xyes
then
  AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
  if test x$have_aa = xtrue
  then
    PLUGINS="${PLUGINS} aa"
    LIB_AA="${LIB_AA} -laa"
  fi
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
954
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
955
dnl  Audio plugins
Sam Hocevar's avatar
   
Sam Hocevar committed
956
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988

AC_ARG_WITH(,[Audio plugins:])

dnl
dnl  OSS /dev/dsp module (enabled by default except on win32)
dnl
AC_ARG_ENABLE(dsp,
  [  --enable-dsp            Linux /dev/dsp support (enabled on Linux)])

if test x$enable_dsp != xno &&
  (test x$SYS != xmingw32 || test x$enable_dsp = xyes)
then
  AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
    PLUGINS="${PLUGINS} dsp"
    AC_CHECK_LIB(ossaudio,main,LIB_DSP="${LIB_DSP} -lossaudio")
  ])
fi

dnl
dnl  Esound module
dnl
AC_ARG_ENABLE(esd,
  [  --enable-esd            Esound library support (default disabled)],
  [if test x$enable_esd = xyes
   then
     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
     if test x${ESD_CONFIG} != xno
     then
       PLUGINS="${PLUGINS} esd"
       CFLAGS_ESD="${CFLAGS_ESD} `${ESD_CONFIG} --cflags`"
       LIB_ESD="${LIB_ESD} `${ESD_CONFIG} --libs`"
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
989
990
991
   fi])

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
992
dnl  aRts module
Sam Hocevar's avatar
   
Sam Hocevar committed
993
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
994
995
996
997
998
999
AC_ARG_ENABLE(arts,
  [  --enable-arts           aRts sound server (default disabled)],
  [if test x$enable_arts = xyes
   then
     AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
     if test x${ARTS_CONFIG} != xno
Sam Hocevar's avatar
   
Sam Hocevar committed
1000
     then
Sam Hocevar's avatar
   
Sam Hocevar committed
1001
1002
1003
       PLUGINS="${PLUGINS} arts"
       CFLAGS_ARTS="${CFLAGS_ARTS} `${ARTS_CONFIG} --cflags`"
       LIB_ARTS="${LIB_ARTS} `${ARTS_CONFIG} --libs `"
Sam Hocevar's avatar
   
Sam Hocevar committed
1004
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1005
1006
1007
   fi])

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1008
1009
1010
1011
1012
1013
1014
1015
dnl  ALSA module
dnl
AC_ARG_ENABLE(alsa,
  [  --enable-alsa           ALSA sound support for Linux (default disabled)],
  [if test x$enable_alsa = xyes
   then
     AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
     if test x$have_alsa = xtrue
1016
     then
Sam Hocevar's avatar
   
Sam Hocevar committed
1017
1018
       PLUGINS="${PLUGINS} alsa"
       LIB_ALSA="${LIB_ALSA} -lasound -lm -ldl"
1019
     fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1020
   fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
1021
1022

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1023
dnl  win32 waveOut plugin
Sam Hocevar's avatar
   
Sam Hocevar committed
1024
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
AC_ARG_ENABLE(waveout,
  [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
if test "x$enableval" != "xno" -a x$SYS = xmingw32
  then
    PLUGINS="${PLUGINS} waveout"
    LIB_WAVEOUT="-lwinmm"
fi

dnl
dnl  Interface plugins
dnl

AC_ARG_WITH(,[Interface plugins:])
Sam Hocevar's avatar
   
Sam Hocevar committed
1038
1039
1040
1041

dnl
dnl  Gtk+ module
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1042
AC_ARG_ENABLE(gtk,
Sam Hocevar's avatar
   
Sam Hocevar committed
1043
  [  --enable-gtk            Gtk+ support (default enabled)])
Sam Hocevar's avatar
   
Sam Hocevar committed
1044
1045
if test x$enable_gtk != xno
then
1046
1047
  GTK_PATH=$PATH
  AC_ARG_WITH(gtk-config-path,
Sam Hocevar's avatar
   
Sam Hocevar committed
1048
    [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
1049
1050
1051
1052
    [ if test "x$withval" != "xno"
      then
        GTK_PATH=$withval:$PATH
      fi ])
Sam Hocevar's avatar
   
Sam Hocevar committed
1053
  # look for gtk-config
Sam Hocevar's avatar
   
Sam Hocevar committed
1054
1055
1056
1057
1058
1059
1060
  AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, $GTK_PATH)
  GTK_CONFIG=${GTK12_CONFIG}
  if test x${GTK_CONFIG} = xno
  then
    AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH)
  fi
  if test x${GTK_CONFIG} != xno
Sam Hocevar's avatar
   
Sam Hocevar committed
1061
  then
Sam Hocevar's avatar
   
Sam Hocevar committed
1062
1063
1064
1065
    if expr 1.2.0 \> `$GTK_CONFIG --version` >/dev/null
    then
      AC_MSG_ERROR([Your development package for Gtk+ is too old, you need at least version 1.2.0. Please upgrade and try again. Alternatively you can also configure with --disable-gtk.])
    fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1066
1067
    CFLAGS_GTK="${CFLAGS_GTK} `${GTK_CONFIG} --cflags gtk`"
    LIB_GTK="${LIB_GTK} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
Sam Hocevar's avatar
   
Sam Hocevar committed
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
    # now look for the gtk.h header
    saved_CPPFLAGS=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS $CFLAGS_GTK"
    ac_cv_gtk_headers=yes
    AC_CHECK_HEADERS(gtk/gtk.h glib.h gdk/gdk.h, , [
      ac_cv_gtk_headers=no
      echo "Cannot find gtk development headers."
    ])
    if test "x$ac_cv_gtk_headers" = xyes
    then
      PLUGINS="${PLUGINS} gtk"
      ALIASES="${ALIASES} gvlc"
    fi
    CPPFLAGS=$saved_CPPFLAGS
1082
1083
  fi
fi
Sam Hocevar's avatar
   
Sam Hocevar committed
1084
1085

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1086
dnl  Gnome module
Sam Hocevar's avatar
   
Sam Hocevar committed
1087
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
AC_ARG_ENABLE(gnome,
  [  --enable-gnome          Gnome interface support (default disabled)],
  [if test x$enable_gnome = xyes; then
    # look for gnome-config
    AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
    if test -x ${GNOME_CONFIG}
    then
       CFLAGS_GNOME="${CFLAGS_GNOME} `${GNOME_CONFIG} --cflags gtk gnomeui`"
       LIB_GNOME="${LIB_GNOME} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
    fi
    # now look for the gnome.h header
    saved_CPPFLAGS=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS $CFLAGS_GNOME"
    AC_CHECK_HEADERS(gnome.h, [
      PLUGINS="${PLUGINS} gnome"
      ALIASES="${ALIASES} gnome-vlc"
     ],[
      AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
developement librairie or remove the --enable-gnome option])
     ])
  
    CPPFLAGS=$saved_CPPFLAGS
  fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
1111
1112

dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1113
dnl  Qt module
Sam Hocevar's avatar
   
Sam Hocevar committed
1114
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
AC_ARG_ENABLE(qt,
  [  --enable-qt             Qt interface support (default disabled)],
  [if test x$enable_qt = xyes; then
     PLUGINS="${PLUGINS} qt"
     ALIASES="${ALIASES} qvlc"
     LIB_QT="${LIB_QT} -lqt -L${QTDIR}/lib"
     CFLAGS_QT="${CFLAGS_QT} -I/usr/include/qt -I${QTDIR}/include"
     if test -x ${QTDIR}/bin/moc
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
   fi])

dnl 
dnl  KDE module
dnl
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
  [if test x$enable_kde = xyes; then
     PLUGINS="${PLUGINS} kde"
     ALIASES="${ALIASES} kvlc"
     LIB_KDE="${LIB_KDE} -L${KDEDIR}/lib -lkfile"
     CFLAGS_KDE="${CFLAGS_KDE} -I/usr/include/kde -I/usr/include/qt"
     CFLAGS_KDE="${CFLAGS_KDE} -I${KDEDIR}/include -I${QTDIR}/include"
     if test -x ${QTDIR}/bin/moc
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
   fi])

dnl
dnl  MacOS X module
dnl
AC_ARG_ENABLE(macosx,
  [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
  [if test x$enable_macosx = xyes
   then
     BUILTINS="${BUILTINS} macosx"
1157
     LIB_MACOSX="${LIB_MACOSX} -framework CoreAudio -framework AudioToolbox -framework Cocoa -framework AGL -framework QuickTime -lobjc"
Sam Hocevar's avatar
   
Sam Hocevar committed
1158
     CFLAGS_MACOSX="${CFLAGS_MACOSX} -ObjC"
Sam Hocevar's avatar
   
Sam Hocevar committed
1159
     LIB_COMMON="${LIB_COMMON} -ObjC"
Sam Hocevar's avatar
   
Sam Hocevar committed
1160
1161
1162
   fi],
  [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
     BUILTINS="${BUILTINS} macosx"
1163
     LIB_MACOSX="${LIB_MACOSX} -framework CoreAudio -framework AudioToolbox -framework Cocoa -framework AGL -framework QuickTime -lobjc"
Sam Hocevar's avatar
   
Sam Hocevar committed
1164
     CFLAGS_MACOSX="${CFLAGS_MACOSX} -ObjC"
Sam Hocevar's avatar
   
Sam Hocevar committed
1165
     LIB_COMMON="${LIB_COMMON} -ObjC"
Sam Hocevar's avatar
   
Sam Hocevar committed
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
   )])

dnl
dnl  QNX RTOS module
dnl
AC_ARG_ENABLE(qnx,
  [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
    if test x$enable_qnx != xno
    then
      AC_CHECK_HEADERS(Ph.h, [
        PLUGINS="${PLUGINS} qnx"
        LIB_QNX="${LIB_QNX} -lasound -lph"
      ])
    fi

dnl
dnl  Windows MFC interface module
dnl
AC_ARG_ENABLE(win32,
  [  --enable-win32          Win32 interface support (default disabled)],
  [ if test "x$enableval" != "xno"
    then
      PLUGINS="${PLUGINS} win32"
    fi ])

dnl
dnl  ncurses module
dnl
AC_ARG_ENABLE(ncurses,
  [  --enable-ncurses        ncurses interface support (default disabled)],
  [if test x$enable_ncurses = xyes; then
     PLUGINS="${PLUGINS} ncurses"
     LIB_NCURSES="${LIB_NCURSES} -lncurses"
   fi])
Sam Hocevar's avatar
   
Sam Hocevar committed
1200

1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
dnl
dnl  Lirc plugin
dnl
AC_ARG_ENABLE(lirc,
  [  --enable-lirc           lirc support (default disabled)])
if test x$enable_lirc = xyes
then
  AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
  if test x$have_lirc = xtrue
  then
    PLUGINS="${PLUGINS} lirc"
    LIB_LIRC="${LIB_LIRC} -llirc_client"
  fi
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
1216
dnl  end of non-BeOS stuff
1217
1218
fi

Sam Hocevar's avatar
   
Sam Hocevar committed
1219
1220
AC_ARG_WITH(,[Misc options:])

1221
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1222
dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
1223
dnl
Sam Hocevar's avatar
   
Sam Hocevar committed
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
dnl  We give the user the opportunity to specify
dnl  --with-words=big or --with-words=little ; otherwise, try to guess
dnl
AC_ARG_WITH(words,
  [  --with-words=endianness set endianness (big or little)])
  case "x$withval" in
    xbig)
      ac_cv_c_bigendian=yes
      ;;
    xlittle)
      ac_cv_c_bigendian=no
      ;;
    *)
      dnl  Try to guess endianness by matching patterns on a compiled
      dnl  binary, by looking for an ASCII or EBCDIC string
      AC_CACHE_CHECK([whether the byte order is big-endian],
        [ac_cv_c_bigendian],
        [ac_cv_c_bigendian=unknown
        [cat >conftest.c <<EOF
        short am[] = { 0x4249, 0x4765, 0x6e44, 0x6961, 0x6e53, 0x7953, 0 };
        short ai[] = { 0x694c, 0x5454, 0x656c, 0x6e45, 0x6944, 0x6e61, 0 };
        void _a(void) { char*s = (char*)am; s = (char *)ai; }
        short ei[] = { 0x89D3, 0xe3e3, 0x8593, 0x95c5, 0x89c4, 0x9581, 0 };
        short em[] = { 0xc2c9, 0xc785, 0x95c4, 0x8981, 0x95e2, 0xa8e2, 0 };
        void _e(void) { char*s = (char*)em; s = (char*)ei; }
        int main(void) { _a(); _e(); return 0; }
EOF
        ]
        if test -f conftest.c
        then 
          if ${CC-cc} conftest.c -o conftest.o >config.log 2>&1 \
              && test -f conftest.o
          then
            if test "`strings conftest.o | grep BIGenDianSyS`"
            then
              ac_cv_c_bigendian=yes
            fi
            if test "`strings conftest.o | grep LiTTleEnDian`"
            then
              ac_cv_c_bigendian=no
            fi
          fi
        fi
      ])
      if test x$ac_cv_c_bigendian = xunknown
      then
        AC_MSG_ERROR([Could not guess endianness, please use --with-words])
      fi
      ;;
  esac
dnl  Now we know what to use for endianness, just put it in the header
if test $ac_cv_c_bigendian = yes
then
  AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
fi
1279

Sam Hocevar's avatar
   
Sam Hocevar committed
1280
1281
1282
1283
1284
dnl
dnl  DLLs - used for Win32 package build
dnl
DLL_PATH=.
AC_ARG_WITH(dll-path,
Sam Hocevar's avatar
   
Sam Hocevar committed
1285
  [  --with-dll-path=PATH    path to Win32 DLLs (default search in \$PWD)],
Sam Hocevar's avatar
   
Sam Hocevar committed
1286
1287
1288
1289
  [ if test "x$withval" != "xno"
    then
      DLL_PATH=$withval
    fi ])
1290

Sam Hocevar's avatar
   
Sam Hocevar committed
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
dnl
dnl  Profiling
dnl
GPROF=0
AC_ARG_ENABLE(gprof,
[  --enable-gprof          gprof profiling (default disabled)],
[ if test x$enableval = xyes; then GPROF=1; fi ])

CPROF=0
AC_ARG_ENABLE(cprof,
[  --enable-cprof          cprof profiling (default disabled)],
[ if test x$enableval = xyes;
  then
Sam Hocevar's avatar
   
Sam Hocevar committed
1304
    LIB_COMMON="${LIB_COMMON} -lcprof"
Sam Hocevar's avatar
   
Sam Hocevar committed
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
    CPROF=1
  fi
])

dnl
dnl  GNU portable threads
dnl
AC_ARG_ENABLE(pth,
  [  --enable-pth            GNU Pth support (default disabled)],
  [ if test x$enableval = xyes; then
    AC_CHECK_LIB(pth,pth_init)
    AC_EGREP_HEADER(pth_init,pth.h,[
      AC_DEFINE(PTH_INIT_IN_PTH_H, 1,
                Define if <pth.h> defines pth_init)
    THREAD_LIB="-lpth"
    fi])
])

dnl
dnl  State Threads
dnl
AC_ARG_ENABLE(st,
  [  --enable-st             State Threads (default disabled)],
  [ if test x$enableval = xyes; then
    AC_CHECK_LIB(st,st_init)
    AC_EGREP_HEADER(st_init,st.h,[
      AC_DEFINE(ST_INIT_IN_ST_H, 1,
                Define if <st.h> defines st_init)
    THREAD_LIB="-lst"
    fi])
])

Sam Hocevar's avatar
   
Sam Hocevar committed
1337
LIB_COMMON="${LIB_COMMON} ${THREAD_LIB}"
Sam Hocevar's avatar
   
Sam Hocevar committed
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349