configure.in 39.6 KB
Newer Older
Sam Hocevar's avatar
 
Sam Hocevar committed
1
dnl Autoconf settings for vlc and libdvdcss
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 9
HAVE_VLC=0
if test -r src/interface/main.c; then
  HAVE_VLC=1
10
  VLC_VERSION="0.2.92-dev"
Sam Hocevar's avatar
 
Sam Hocevar committed
11 12 13 14 15 16
  VLC_CODENAME=Ourumov
fi

HAVE_LIBDVDCSS=0
if test -r extras/libdvdcss/libdvdcss.c; then
  HAVE_LIBDVDCSS=1
17
  LIBDVDCSS_VERSION="1.0.1-dev"
Sam Hocevar's avatar
 
Sam Hocevar committed
18
  AC_SUBST(LIBDVDCSS_VERSION)
19 20 21
  if test -r extras/libdvdcss/csskeys.h; then
    AC_DEFINE(HAVE_CSSKEYS,1,css decryption with player keys)
  fi
Sam Hocevar's avatar
 
Sam Hocevar committed
22
fi
23

Sam Hocevar's avatar
 
Sam Hocevar committed
24
dnl Save CFLAGS and LDFLAGS
Sam Hocevar's avatar
 
Sam Hocevar committed
25
save_CFLAGS="${CFLAGS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
26
save_LDFLAGS="${LDFLAGS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
27

28 29
dnl Check for tools
AC_PROG_MAKE_SET
Sam Hocevar's avatar
 
Sam Hocevar committed
30 31
AC_PROG_CC
AC_PROG_CPP
32

Gildas Bazin's avatar
 
Gildas Bazin committed
33 34 35
dnl Find the right ranlib, even when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, :)

Sam Hocevar's avatar
 
Sam Hocevar committed
36
dnl Gettext stuff
Sam Hocevar's avatar
 
Sam Hocevar committed
37
ALL_LINGUAS="de fr ru"
Sam Hocevar's avatar
Sam Hocevar committed
38

Sam Hocevar's avatar
 
Sam Hocevar committed
39 40
AC_DEFINE_UNQUOTED(PACKAGE, "vlc")
AC_DEFINE_UNQUOTED(VERSION, "$VLC_VERSION")
Sam Hocevar's avatar
 
Sam Hocevar committed
41 42
AM_GNU_GETTEXT

43 44 45
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL

46
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
47
dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
48
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
49 50 51 52 53
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)])
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
  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_cv_c_bigendian=unknown
      AC_MSG_CHECKING(what the byte order looks to be)[
        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 `grep -l BIGenDianSyS conftest.o`
          then
            AC_MSG_RESULT("big endian")
            ac_cv_c_bigendian=yes
          fi
          if test `grep -l LiTTleEnDian conftest.o`
          then
            AC_MSG_RESULT("little endian")
            ac_cv_c_bigendian=no
          fi
        fi
      fi
      if test $ac_cv_c_bigendian = xunknown
      then
        AC_MSG_ERROR([Could not guess endianness, please use --with-words])
      fi
      dnl  Now we know what to use for endianness, just put it in the header
      if test $ac_cv_c_bigendian = yes
      then
        cat >> confdefs.h <<\EOF
#define WORDS_BIGENDIAN 1
EOF
      fi
      ;;
  esac
106 107

dnl Check for system libs needed
Sam Hocevar's avatar
 
Sam Hocevar committed
108
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty)
Sam Hocevar's avatar
 
Sam Hocevar committed
109 110 111 112 113 114 115 116 117 118 119
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")
  ])
])
120
AC_CHECK_FUNCS(usleep)
Sam Hocevar's avatar
 
Sam Hocevar committed
121 122 123
AC_CHECK_FUNC(inet_aton,,[
  AC_CHECK_LIB(resolv,inet_aton,LIB="${LIB} -lresolv")
])
Sam Hocevar's avatar
 
Sam Hocevar committed
124
AC_CHECK_FUNCS(vasprintf)
Sam Hocevar's avatar
 
Sam Hocevar committed
125
AC_CHECK_FUNCS(swab)
126
AC_CHECK_FUNCS([memalign valloc])
Sam Hocevar's avatar
 
Sam Hocevar committed
127

Sam Hocevar's avatar
 
Sam Hocevar committed
128 129
AC_CHECK_FUNCS(sigrelse)

Sam Hocevar's avatar
 
Sam Hocevar committed
130
dnl Check for getopt
Sam Hocevar's avatar
 
Sam Hocevar committed
131
NEED_GETOPT=0
Sam Hocevar's avatar
 
Sam Hocevar committed
132 133 134
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
135
    [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LIB="${LIB} -lgnugetopt"],
Sam Hocevar's avatar
 
Sam Hocevar committed
136
    [NEED_GETOPT=1])])
Sam Hocevar's avatar
 
Sam Hocevar committed
137

138
AC_TYPE_SIGNAL
Sam Hocevar's avatar
 
Sam Hocevar committed
139
AC_CHECK_LIB(dl,dlopen,LIB="${LIB} -ldl")
Sam Hocevar's avatar
 
Sam Hocevar committed
140 141 142
AC_CHECK_LIB(m,cos,
  LIB_IMDCT="${LIB_IMDCT} -lm"
  LIB_FILTER_DISTORT="${LIB_FILTER_DISTORT} -lm")
Sam Hocevar's avatar
 
Sam Hocevar committed
143 144 145 146 147
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
148

Sam Hocevar's avatar
 
Sam Hocevar committed
149
dnl Check for pthreads - borrowed from XMMS
Sam Hocevar's avatar
 
Sam Hocevar committed
150 151 152 153 154 155 156 157 158 159 160 161 162 163
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
164 165 166

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

Sam Hocevar's avatar
 
Sam Hocevar committed
168 169 170
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
171
            Define if <pthread.h> defines pthread_cond_t.)])
Sam Hocevar's avatar
 
Sam Hocevar committed
172 173
AC_EGREP_HEADER(strncasecmp,strings.h,[
  AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
Sam Hocevar's avatar
 
Sam Hocevar committed
174
            Define if <strings.h> defines strncasecmp.)])
Sam Hocevar's avatar
 
Sam Hocevar committed
175

Sam Hocevar's avatar
 
Sam Hocevar committed
176
dnl Check for headers
Sam Hocevar's avatar
 
Sam Hocevar committed
177
AC_CHECK_HEADERS(getopt.h strings.h)
178
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/time.h sys/times.h)
Sam Hocevar's avatar
 
Sam Hocevar committed
179 180 181 182 183
AC_CHECK_HEADERS(sys/soundcard.h machine/soundcard.h)
AC_CHECK_HEADERS(dlfcn.h image.h)
AC_CHECK_HEADERS(arpa/inet.h net/if.h netinet/in.h sys/socket.h)
AC_CHECK_HEADERS(machine/param.h)

Sam Hocevar's avatar
 
Sam Hocevar committed
184 185
AC_HEADER_TIME

Sam Hocevar's avatar
 
Sam Hocevar committed
186 187 188
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
189
dnl Check for ntohl, etc.
190 191 192 193 194 195 196 197 198
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
199

Sam Hocevar's avatar
 
Sam Hocevar committed
200
dnl Check for inline function size limit
201 202 203 204 205 206 207
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
208

Sam Hocevar's avatar
 
Sam Hocevar committed
209
dnl Check for Darwin plugin linking flags
210 211 212 213 214
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error],
    [ac_cv_ld_darwin],
    [CFLAGS="${save_CFLAGS} -bundle -undefined error"
     AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
if test x"$ac_cv_ld_darwin" != x"no"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
215
    PLDFLAGS="${PLDFLAGS} -bundle -undefined error"
216
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
217 218

dnl Check for standard plugin linking flags
219 220 221 222 223
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
224
    PLDFLAGS="${PLDFLAGS} -shared"
Sam Hocevar's avatar
 
Sam Hocevar committed
225
fi
226 227
        
dnl Check for soname setting
Sam Hocevar's avatar
 
Sam Hocevar committed
228
if test x"${SOFLAGS}" = x; then
229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250
    AC_CACHE_CHECK([for soname setting],
        [ac_cv_ld_soname],
        [
        # Standard
        try_SOFLAGS="-Wl,-soname -Wl,"
        LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
        AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}", [
            # SunOS
            try_SOFLAGS="-Wl,-h -Wl,"
            LDFLAGS="${save_LDFLAGS} ${try_SOFLAGS}foo.so.0"
            AC_TRY_LINK([],,ac_cv_ld_soname="${try_SOFLAGS}",
                ac_cv_ld_soname=none)
        ])])
    if test x"$ac_cv_ld_soname" != x"none"; then
        SOFLAGS=$ac_cv_ld_soname
    else
        echo "
------------
Your system doesn't seem to have support for dynamic linking. You may
have problems using libdvdcss.
------------
"
251
    fi
Sam Hocevar's avatar
 
Sam Hocevar committed
252 253
fi

254 255 256 257
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
258
        CFLAGS="${save_CFLAGS} -Werror"
259 260 261 262 263 264 265 266 267 268
    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
269
dnl End of the bizarre compilation tests
Sam Hocevar's avatar
 
Sam Hocevar committed
270
CFLAGS="${save_CFLAGS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
271
LDFLAGS="${save_LDFLAGS}"
Christophe Massiot's avatar
Christophe Massiot committed
272

273
dnl Check for boolean_t
274 275
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
276
    [AC_TRY_COMPILE([#include <sys/types.h>], [boolean_t foo;],
277 278 279 280 281 282 283
     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
284
    [AC_TRY_COMPILE([#include <pthread.h>], [boolean_t foo;],
285 286 287 288 289 290 291
     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
292
    [AC_TRY_COMPILE([#include <cthreads.h>], [boolean_t foo;],
293 294 295 296
     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
297

Sam Hocevar's avatar
 
Sam Hocevar committed
298 299 300 301 302 303 304 305 306 307 308
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
309 310 311 312

dnl
dnl  default modules
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
313
BUILTINS="${BUILTINS} mpeg_es mpeg_ps mpeg_ts memcpy idct idctclassic motion imdct downmix chroma_i420_rgb chroma_i420_yuy2 chroma_i422_yuy2 chroma_i420_ymga mpeg_adec lpcm_adec ac3_adec mpeg_vdec"
Sam Hocevar's avatar
 
Sam Hocevar committed
314
PLUGINS="${PLUGINS} ac3_spdif spudec filter_deinterlace filter_invert filter_wall filter_transform filter_distort"
Sam Hocevar's avatar
 
Sam Hocevar committed
315 316 317 318

dnl
dnl  Accelerated modules
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
319
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
320 321
MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
Sam Hocevar's avatar
 
Sam Hocevar committed
322
SSE_MODULES="imdctsse downmixsse"
323
ALTIVEC_MODULES="idctaltivec motionaltivec"
324

325 326
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
    [ac_cv_mmx_inline],
Sam Hocevar's avatar
 
Sam Hocevar committed
327
    [AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
328
                    ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
329
if test x"$ac_cv_mmx_inline" != x"no"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
330
  ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
331
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
332

333 334
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
    [ac_cv_mmxext_inline],
Sam Hocevar's avatar
 
Sam Hocevar committed
335
    [AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
336
                    ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
337
if test x"$ac_cv_mmxext_inline" != x"no"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
338
  ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
339
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
340

341 342
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
    [ac_cv_3dnow_inline],
Sam Hocevar's avatar
 
Sam Hocevar committed
343
    [AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
344
                    ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
345
if test x"$ac_cv_3dnow_inline" != x"no"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
346
  AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
Sam Hocevar's avatar
 
Sam Hocevar committed
347
  ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
348
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
349

350 351
AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
    [ac_cv_sse_inline],
Sam Hocevar's avatar
 
Sam Hocevar committed
352
    [AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
353
                    ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
354
if test x"$ac_cv_sse_inline" != x"no"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
355
  AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
Sam Hocevar's avatar
 
Sam Hocevar committed
356
  ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
357
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
358

359 360
AC_CACHE_CHECK([if \$CC groks Altivec inline assembly],
    [ac_cv_altivec_inline],
Sam Hocevar's avatar
 
Sam Hocevar committed
361
    [AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
362 363 364
         ac_cv_altivec_inline=yes,
         [save_CFLAGS=$CFLAGS
          CFLAGS="$CFLAGS -Wa,-m7400"
Sam Hocevar's avatar
 
Sam Hocevar committed
365
          AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
366
            [ac_cv_altivec_inline="-Wa,-m7400"],
367
            ac_cv_altivec_inline=no)
368 369
          CFLAGS=$save_CFLAGS
         ])])
370
if test x"$ac_cv_altivec_inline" != x"no"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
371
  AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks ALTIVEC inline assembly.)
372
  if test x"$ac_cv_altivec_inline" != x"yes"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
373 374
    CFLAGS_IDCTALTIVEC="$CFLAGS_IDCTALTIVEC $ac_cv_altivec_inline"
    CFLAGS_MOTIONALTIVEC="$CFLAGS_MOTIONALTIVEC $ac_cv_altivec_inline"
Sam Hocevar's avatar
 
Sam Hocevar committed
375
    CFLAGS_VLC="$CFLAGS_VLC $ac_cv_altivec_inline"
376
  fi
377
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
378
fi
379

380 381
AC_CACHE_CHECK([if \$CC groks Altivec C extensions],
    [ac_cv_c_altivec],
382 383 384
    [save_CFLAGS=$CFLAGS
     CFLAGS="$CFLAGS -faltivec"
     # Darwin test
Sam Hocevar's avatar
 
Sam Hocevar committed
385
     AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
386 387
        ac_cv_c_altivec=-faltivec, [
        # Linux/PPC test
Sam Hocevar's avatar
 
Sam Hocevar committed
388
        CFLAGS="$save_CFLAGS $CFLAGS_IDCTALTIVEC -fvec"
Sam Hocevar's avatar
 
Sam Hocevar committed
389
        AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
390 391 392 393
            [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
        ])
     CFLAGS=$save_CFLAGS
    ])
394
if test x"$ac_cv_c_altivec" != x"no"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
395
  AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C altivec extensions.)
Sam Hocevar's avatar
 
Sam Hocevar committed
396 397
  CFLAGS_IDCTALTIVEC="$CFLAGS_IDCTALTIVEC $ac_cv_c_altivec"
  CFLAGS_MOTIONALTIVEC="$CFLAGS_MOTIONALTIVEC $ac_cv_c_altivec"
Sam Hocevar's avatar
 
Sam Hocevar committed
398
  CFLAGS_VLC="$CFLAGS_VLC $ac_cv_c_altivec"
399
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
400 401 402 403 404 405 406 407 408 409
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
410 411
  LIB_IDCTALTIVEC="${LIB_IDCTALTIVEC} -framework vecLib"
  LIB_MOTIONALTIVEC="${LIB_MOTIONALTIVEC} -framework vecLib"
Sam Hocevar's avatar
 
Sam Hocevar committed
412
  LIB="${LIB} -framework vecLib"
413 414
fi

415 416 417
dnl
dnl  Check the operating system
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
418 419 420 421 422
case x"${target_os}" in
  x)
    SYS=unknown
    ;;
  xlinux*)
423
    SYS=linux
Sam Hocevar's avatar
 
Sam Hocevar committed
424
    ;;
Sam Hocevar's avatar
 
Sam Hocevar committed
425
  xbsdi*)
426 427
    SYS=bsdi
    ;;
Sam Hocevar's avatar
 
Sam Hocevar committed
428
  xdarwin*)
429 430
    SYS=darwin
    ;;
Sam Hocevar's avatar
 
Sam Hocevar committed
431
  x*mingw32*)
432
    SYS=mingw32
Sam Hocevar's avatar
 
Sam Hocevar committed
433 434 435
    AC_CHECK_TOOL(WINDRES, windres, :)
    LIB_MPEG_TS="-lws2_32"
    LIB_RC="-lws2_32"
436
    ;;
Sam Hocevar's avatar
 
Sam Hocevar committed
437
  x*nto*)
Sam Hocevar's avatar
 
Sam Hocevar committed
438 439 440 441
    SYS=nto
    LIB_X11="${LIB_X11} -lsocket"
    LIB_XVIDEO="${LIB_XVIDEO} -lsocket"
    ;;
Sam Hocevar's avatar
 
Sam Hocevar committed
442
  xbeos)
Sam Hocevar's avatar
 
Sam Hocevar committed
443 444 445 446 447
    SYS=beos
    LIB="${LIB} -lbe"
    LIB_BEOS="${LIB_BEOS} -lbe -lgame -lroot -ltracker"
    PLDFLAGS="${PLDFLAGS} -nostart"
    ;;
Sam Hocevar's avatar
 
Sam Hocevar committed
448
  x*)
449 450 451 452 453
    SYS=${target_os}
    ;;
esac

dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
454
dnl  DVD and VCD devices
455
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
456 457 458 459 460 461 462 463 464 465 466 467 468 469
case $SYS in
  mingw32)
    DVD_DEVICE="E:"
    VCD_DEVICE="E:"
    ;;
  *)
    DVD_DEVICE="/dev/dvd"
    VCD_DEVICE="/dev/cdrom"
    ;;
esac

AC_DEFINE_UNQUOTED(DVD_DEVICE, "$DVD_DEVICE")
AC_DEFINE_UNQUOTED(VCD_DEVICE, "$VCD_DEVICE")

470

Sam Hocevar's avatar
 
Sam Hocevar committed
471
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
472
dnl  libdvdcss: check for DVD ioctls
Sam Hocevar's avatar
 
Sam Hocevar committed
473
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
474

Sam Hocevar's avatar
 
Sam Hocevar committed
475 476 477
dnl  default is no
CAN_BUILD_LIBDVDCSS=0

Sam Hocevar's avatar
 
Sam Hocevar committed
478 479
dnl  for windoze
AC_CHECK_HEADERS(winioctl.h,[
Sam Hocevar's avatar
 
Sam Hocevar committed
480
  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
481 482
])

Sam Hocevar's avatar
 
Sam Hocevar committed
483
dnl  for Un*x and BeOS
Sam Hocevar's avatar
 
Sam Hocevar committed
484
AC_CHECK_HEADERS(sys/ioctl.h,[
Sam Hocevar's avatar
 
Sam Hocevar committed
485
  CAN_BUILD_LIBDVDCSS="${HAVE_LIBDVDCSS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
486
  AC_CHECK_HEADERS(sys/cdio.h sys/dvdio.h linux/cdrom.h dvd.h)
Sam Hocevar's avatar
 
Sam Hocevar committed
487
  BSD_DVD_STRUCT=0
Sam Hocevar's avatar
 
Sam Hocevar committed
488
  LINUX_DVD_STRUCT=0
489
  OPENBSD_DVD_STRUCT=0
Sam Hocevar's avatar
 
Sam Hocevar committed
490 491 492
  dnl
  dnl Old FreeBSD: sys/cdio.h
  dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
493 494 495 496
  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.)
    AC_EGREP_HEADER(struct dvd_struct,sys/cdio.h,[
497
                    BSD_DVD_STRUCT=1],[LINUX_DVD_STRUCT=1; OPENBSD_DVD_STRUCT=1])
Sam Hocevar's avatar
 
Sam Hocevar committed
498 499 500 501
  ])
  dnl
  dnl Newer FreeBSD: sys/dvdio.h
  dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
502 503 504 505 506
  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.)
    AC_EGREP_HEADER(struct dvd_struct,sys/dvdio.h,[
                    BSD_DVD_STRUCT=1],[LINUX_DVD_STRUCT=1])
Sam Hocevar's avatar
 
Sam Hocevar committed
507 508 509 510 511 512 513
  ])
  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
514 515 516 517 518
    LINUX_DVD_STRUCT=1
  ])
  dnl
  dnl BSDI: dvd.h
  dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
519
  NEED_BSDI_LIBDVD=0
Sam Hocevar's avatar
 
Sam Hocevar committed
520 521 522
  AC_EGREP_HEADER(dvd_struct,dvd.h,[
    AC_DEFINE(DVD_STRUCT_IN_DVD_H, 1,
              Define if <dvd.h> defines DVD_STRUCT.)
Sam Hocevar's avatar
 
Sam Hocevar committed
523
    LIB_LIBDVDCSS="${LIB_LIBDVDCSS} -ldvd"
Sam Hocevar's avatar
 
Sam Hocevar committed
524
    LINUX_DVD_STRUCT=1
Sam Hocevar's avatar
 
Sam Hocevar committed
525 526 527 528 529 530
  ],[
    dnl
    dnl BSDI: /sys/dev/scsi/scsi_ioctl.h, using our own libdvd
    dnl
    AC_CHECK_HEADERS(/sys/dev/scsi/scsi_ioctl.h,[
      NEED_BSDI_LIBDVD=1
Sam Hocevar's avatar
 
Sam Hocevar committed
531 532
      AC_DEFINE(DVD_STRUCT_IN_BSDI_DVDIOCTL_DVD_H, 1,
                Define if <extras/BSDI_dvdioctl/dvd.h> defines DVD_STRUCT.)
Sam Hocevar's avatar
 
Sam Hocevar committed
533
      SRC_DVDCSS_EXTRA="${SRC_DVDCSS_EXTRA} bsdi_dvdioctl.c"
Sam Hocevar's avatar
 
Sam Hocevar committed
534 535
      LINUX_DVD_STRUCT=1
    ])
Sam Hocevar's avatar
 
Sam Hocevar committed
536
  ])
Sam Hocevar's avatar
 
Sam Hocevar committed
537
  dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
538
  dnl Solaris: sys/scsi/scsi_types.h, sys/scsi/impl/uscsi.h
Sam Hocevar's avatar
 
Sam Hocevar committed
539
  dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
540
  AC_CHECK_HEADER(sys/scsi/scsi_types.h,[
Sam Hocevar's avatar
 
Sam Hocevar committed
541 542 543 544 545
    AC_CHECK_HEADER(sys/scsi/impl/uscsi.h,[
      AC_DEFINE(SOLARIS_USCSI, 1, Have userspace SCSI headers.)
    ])
  ])
  dnl
546 547 548 549 550 551 552 553
  dnl HP-UX: sys/scsi.h
  dnl
  AC_CHECK_HEADER(sys/scsi.h,[
    AC_EGREP_HEADER(sctl_io,sys/scsi.h,[
      AC_DEFINE(HPUX_SCTL_IO, 1, Define if <sys/scsi.h> defines sctl_io.)
    ])
  ])
  dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
554 555 556 557 558
  dnl Final tests to check what was detected
  dnl
  if test x$LINUX_DVD_STRUCT = x1; then
    AC_DEFINE(HAVE_LINUX_DVD_STRUCT, 1,
              Define if Linux-like dvd_struct is defined.)
559 560 561 562
    if test x$OPENBSD_DVD_STRUCT = x1; then
      AC_DEFINE(HAVE_OPENBSD_DVD_STRUCT, 1,
                Define if OpenBSD-like dvd_struct is defined.)
    fi
Sam Hocevar's avatar
 
Sam Hocevar committed
563 564 565
  else
    if test x$BSD_DVD_STRUCT = x1; then
      AC_DEFINE(HAVE_BSD_DVD_STRUCT, 1,
Sam Hocevar's avatar
 
Sam Hocevar committed
566
                Define if FreeBSD-like dvd_struct is defined.)
Sam Hocevar's avatar
 
Sam Hocevar committed
567 568
    fi
  fi
Sam Hocevar's avatar
 
Sam Hocevar committed
569 570 571
])

dnl
572
dnl  Special arch tuning
Sam Hocevar's avatar
 
Sam Hocevar committed
573
dnl
574 575 576 577 578 579
AC_ARG_WITH(tuning,
[  --with-tuning=[arch]    Enable special tuning for an architecture
                          (default i686 on IA-32 and 750 on PPC)])
if test "x$withval" != "x"; then
    TUNING=$withval
else
580
    if test x${target_cpu} = xi686 -o x${target_cpu} = xi586 -o x${target_cpu} = xi486 -o x${target_cpu} = xi386; then TUNING="pentiumpro"
581
    else
582
        if test x${target_cpu} = xpowerpc; then TUNING="750"; fi
583 584
    fi
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
585

586 587 588 589 590 591 592 593 594
dnl
dnl  Enable release-specific flags
dnl
AC_ARG_ENABLE(release,
[  --enable-release        Activate extra optimizations (default disabled)],
[ if test x$enableval = xyes; then RELEASE=1; fi ],
[ VLC_VERSION="${VLC_VERSION}_`date +%Y-%m-%d`";
  LIBDVDCSS_VERSION="${LIBDVDCSS_VERSION}_`date +%Y-%m-%d`"; ])

Sam Hocevar's avatar
 
Sam Hocevar committed
595
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
596
dnl  x86 accelerations
Sam Hocevar's avatar
 
Sam Hocevar committed
597
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
598 599 600 601 602
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
603 604 605 606

dnl
dnl  AltiVec acceleration
dnl
607
AC_ARG_ENABLE(altivec,
608 609 610
[  --disable-altivec       Disable altivec optimizations (default enabled on PPC)],
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
611
[ if test x${target_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
612
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
613 614 615 616

dnl
dnl  Debugging mode
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
617
DEBUG=0
618
AC_ARG_ENABLE(debug,
619
[  --enable-debug          Enable debug mode (default disabled)],
620
[ if test x$enableval = xyes; then DEBUG=1; fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
621

622 623 624
dnl
dnl  Trace mode
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
625
TRACE=0
626 627 628 629
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
630
dnl
631
dnl  Profiling
Sam Hocevar's avatar
 
Sam Hocevar committed
632
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
633 634 635 636 637 638 639 640 641 642 643 644 645 646
GPROF=0
AC_ARG_ENABLE(gprof,
[  --enable-gprof          Enable gprof profiling (default disabled)],
[ if test x$enableval = xyes; then GPROF=1; fi ])

CPROF=0
AC_ARG_ENABLE(cprof,
[  --enable-cprof          Enable cprof profiling (default disabled)],
[ if test x$enableval = xyes;
  then
    LIB="${LIB} -lcprof"
    CPROF=1
  fi
])
Sam Hocevar's avatar
 
Sam Hocevar committed
647

Sam Hocevar's avatar
 
Sam Hocevar committed
648 649 650
dnl
dnl  Enable/disable optimizations
dnl
651
AC_ARG_ENABLE(optimizations,
652
[  --disable-optimizations Disable compiler optimizations (default enabled)],
653 654
[ if test x$enableval = xno; then OPTIMS=0; fi ],
[ OPTIMS=1 ])
655

Sam Hocevar's avatar
 
Sam Hocevar committed
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672
dnl
dnl  GNU portable threads
dnl
AC_ARG_ENABLE(pth,
  [  --enable-pth            Enable 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])
])

LIB="${LIB} ${THREAD_LIB}"

dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
673
dnl  DVD module: check for installed libdvdcss or local libdvdcss
Sam Hocevar's avatar
 
Sam Hocevar committed
674
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
675
NEED_LIBDVDCSS=0
Sam Hocevar's avatar
 
Sam Hocevar committed
676
STATIC_LIBDVDCSS=0
Sam Hocevar's avatar
 
Sam Hocevar committed
677
DUMMY_LIBDVDCSS=0
Sam Hocevar's avatar
 
Sam Hocevar committed
678
AC_ARG_WITH(dvdcss,
679 680 681 682
  [  --with-dvdcss[=name]    way to use libdvdcss, either 'yes' or 'no',
                          or 'local-static', 'local-shared', or a path to
                          another libdvdcss such as '/usr/local'
                          (default 'local-static')],
Sam Hocevar's avatar
 
Sam Hocevar committed
683 684 685 686 687
  [ case "x${withval}" in
    xlocal-static|xyes)
      # local libdvdcss, statically linked
      if test x${CAN_BUILD_LIBDVDCSS} = x1
      then
Sam Hocevar's avatar
 
Sam Hocevar committed
688
        NEED_LIBDVDCSS=1
Sam Hocevar's avatar
 
Sam Hocevar committed
689 690 691
        STATIC_LIBDVDCSS=1
        BUILTINS="${BUILTINS} dvd"
        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
Sam Hocevar's avatar
 
Sam Hocevar committed
692 693
        LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
694
        LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
695 696 697 698
      fi
    ;;
    xlocal-shared)
      # local libdvdcss, dynamically linked
Sam Hocevar's avatar
 
Sam Hocevar committed
699 700
      if test x${CAN_BUILD_LIBDVDCSS} = x1
      then
Sam Hocevar's avatar
 
Sam Hocevar committed
701
        NEED_LIBDVDCSS=1
Sam Hocevar's avatar
 
Sam Hocevar committed
702 703 704 705
        BUILTINS="${BUILTINS} dvd"
        CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
        LIB_DVD="${LIB_DVD} -Llib -ldvdcss"
        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L../../lib -ldvdcss"
Sam Hocevar's avatar
 
Sam Hocevar committed
706
        LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -L../../lib -ldvdcss"
Sam Hocevar's avatar
 
Sam Hocevar committed
707
      fi
Sam Hocevar's avatar
 
Sam Hocevar committed
708
    ;;
Sam Hocevar's avatar
 
Sam Hocevar committed
709 710 711 712
    xno)
      # don't use libdvdcss at all, build a DVD module that can dlopen() it
      DUMMY_LIBDVDCSS=1
      BUILTINS="${BUILTINS} dvd"
Sam Hocevar's avatar
 
Sam Hocevar committed
713
      SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
Sam Hocevar's avatar
 
Sam Hocevar committed
714
      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
Sam Hocevar's avatar
 
Sam Hocevar committed
715
      CFLAGS_DVD="${CFLAGS_DVD} -DLIBDVDCSS_VERSION=\"${LIBDVDCSS_VERSION}\""
Sam Hocevar's avatar
 
Sam Hocevar committed
716 717
      LIB_DVD="${LIB_DVD} -ldl"
      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
Sam Hocevar's avatar
 
Sam Hocevar committed
718
      LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldl"
Sam Hocevar's avatar
 
Sam Hocevar committed
719
    ;;
Sam Hocevar's avatar
 
Sam Hocevar committed
720
    *)
Sam Hocevar's avatar
 
Sam Hocevar committed
721 722 723 724 725
      # existing libdvdcss
      BUILTINS="${BUILTINS} dvd"
      if test "x$withval" != "xyes"
      then
        LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -L"$withval"/lib"
Sam Hocevar's avatar
 
Sam Hocevar committed
726
        LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -L"$withval"/lib"
Sam Hocevar's avatar
 
Sam Hocevar committed
727 728 729 730
        CFLAGS_DVD="${CFLAGS_DVD} -I"$withval"/include"
      fi
      LIB_DVD="${LIB_DVD} -ldvdcss"
      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldvdcss"
Sam Hocevar's avatar
 
Sam Hocevar committed
731
      LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldvdcss"
Sam Hocevar's avatar
 
Sam Hocevar committed
732
    esac ],
Sam Hocevar's avatar
 
Sam Hocevar committed
733
  # user didn't decide, we choose to use local libdvdcss and link statically
Sam Hocevar's avatar
 
Sam Hocevar committed
734
  # if libdvdcss is in the archive, or to use the dummy replacement otherwise.
Sam Hocevar's avatar
 
Sam Hocevar committed
735 736
  [ if test x${CAN_BUILD_LIBDVDCSS} = x1
    then
Sam Hocevar's avatar
 
Sam Hocevar committed
737
      NEED_LIBDVDCSS=1
Sam Hocevar's avatar
 
Sam Hocevar committed
738 739 740
      STATIC_LIBDVDCSS=1
      BUILTINS="${BUILTINS} dvd"
      CFLAGS_DVD="${CFLAGS_DVD} -I../../extras/libdvdcss"
Sam Hocevar's avatar
 
Sam Hocevar committed
741 742
      LIB_DVD="${LIB_DVD} lib/libdvdcss.a ${LIB_LIBDVDCSS}"
      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
743
      LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} ../../lib/libdvdcss.a ${LIB_LIBDVDCSS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
744 745 746 747
    else
      # XXX: no check for libdl is done, don't try this at home !
      DUMMY_LIBDVDCSS=1
      BUILTINS="${BUILTINS} dvd"
Sam Hocevar's avatar
 
Sam Hocevar committed
748
      SRC_DVD_EXTRA="${SRC_DVD_EXTRA} dummy_dvdcss.c"
Sam Hocevar's avatar
 
Sam Hocevar committed
749 750 751
      CFLAGS_DVD="${CFLAGS_DVD} -DGOD_DAMN_DMCA"
      LIB_DVD="${LIB_DVD} -ldl"
      LIB_DVD_PLUGIN="${LIB_DVD_PLUGIN} -ldl"
Sam Hocevar's avatar
 
Sam Hocevar committed
752
      LIB_DVDREAD_PLUGIN="${LIB_DVDREAD_PLUGIN} -ldl"
Sam Hocevar's avatar
 
Sam Hocevar committed
753
    fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
754

Stéphane Borel's avatar
Stéphane Borel committed
755 756 757 758
dnl
dnl DVDREAD module: check for libdvdread plugin
dnl
AC_ARG_ENABLE(dvdread,
759
[  --enable-dvdread          Enable dvdread support (default disabled)],
Stéphane Borel's avatar
Stéphane Borel committed
760 761 762 763 764 765 766
[ if test x$enableval = xyes
  then
    NEED_LIBDVDCSS=1
    STATIC_LIBDVDCSS=1
    BUILTINS="${BUILTINS} dvdread" 
    CFLAGS_DVDREAD="${CFLAGS_DVDREAD} -I../../extras/libdvdread"
    LIB_DVDREAD="${LIB_DVDREAD} lib/libdvdread.a lib/libdvdcss.a"
767
  fi ])
Stéphane Borel's avatar
Stéphane Borel committed
768

769
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
770
dnl  VCD module
771 772
dnl
AC_ARG_ENABLE(vcd,
Sam Hocevar's avatar
 
Sam Hocevar committed
773
  [  --enable-vcd            VCD support for Linux (default enabled)])
774

Sam Hocevar's avatar
 
Sam Hocevar committed
775 776 777 778 779 780
if test x$enable_vcd != xno
then
  AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
    BUILTINS="${BUILTINS} vcd"
  ])
fi
781

782 783 784 785 786
if test x$enable_vcd != xno -a "${SYS}" = "bsdi"
then
  BUILTINS="${BUILTINS} vcd"
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
787 788 789 790 791
dnl
dnl  dummy plugin
dnl
AC_ARG_ENABLE(dummy,
  [  --disable-dummy         dummy module (default enabled)])
Sam Hocevar's avatar
 
Sam Hocevar committed
792 793 794 795 796

if test x$enable_dummy != xno
then
  BUILTINS="${BUILTINS} dummy"
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
797 798 799 800 801 802

dnl
dnl  null plugin
dnl
AC_ARG_ENABLE(null,
  [  --disable-null          Null module (default enabled)])
Sam Hocevar's avatar
 
Sam Hocevar committed
803 804 805 806 807

if test x$enable_null != xno
then
  BUILTINS="${BUILTINS} null"
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
808 809 810 811 812

dnl
dnl  rc plugin
dnl
AC_ARG_ENABLE(rc,
Sam Hocevar's avatar
 
Sam Hocevar committed
813 814
  [  --disable-rc            Remote Control module (default enabled)])

Sam Hocevar's avatar
 
Sam Hocevar committed
815 816 817 818
if test x$enable_rc != xno
then
  BUILTINS="${BUILTINS} rc"
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
819

820
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
821
dnl  mad plugin
822
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
823 824
AC_ARG_WITH(mad,
  [  --with-mad[=PATH]       libmad module (default disabled)],
825 826
  [ if test "x$with_val" != "xno"; then
      if test -n $with_val; then
Sam Hocevar's avatar
 
Sam Hocevar committed
827
        CFLAGS_MAD="-I$with_val/include"
Sam Hocevar's avatar
 
Sam Hocevar committed
828
        LIB_MAD="-L$with_val/lib -lmad"
829
      else
Sam Hocevar's avatar
 
Sam Hocevar committed
830
        LIB_MAD="-lmad"
831 832 833
      fi
      save_CFLAGS=$CFLAGS
      save_LDFLAGS=$LDFLAGS
Sam Hocevar's avatar
 
Sam Hocevar committed
834 835
      CFLAGS="$CFLAGS $CFLAGS_MAD"
      LDFLAGS="$LDFLAGS $LIB_MAD"
836 837 838 839 840 841 842 843 844 845
      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
Sam Hocevar's avatar
 
Sam Hocevar committed
846
      PLUGINS="${PLUGINS} mad"
847 848
    fi ])

Sam Hocevar's avatar
 
Sam Hocevar committed
849
dnl special case for BeOS
Sam Hocevar's avatar
 
Sam Hocevar committed
850 851
if test x$SYS = xbeos
then
Sam Hocevar's avatar
 
Sam Hocevar committed
852
    BUILTINS="${BUILTINS} beos"
853 854 855 856

dnl default case
else

Sam Hocevar's avatar
 
Sam Hocevar committed
857 858
dnl
dnl  OSS /dev/dsp module
859
dnl  (enabled by default except on win32)
Sam Hocevar's avatar
 
Sam Hocevar committed
860
dnl
861
AC_ARG_ENABLE(dsp,
862
  [  --disable-dsp           Linux /dev/dsp support (default enabled)])
Sam Hocevar's avatar
 
Sam Hocevar committed
863

864 865
if test x$enable_dsp != xno &&
  (test $SYS != mingw32 || test x$enable_dsp = xyes)
Sam Hocevar's avatar
 
Sam Hocevar committed
866 867 868
then
  if test -c /dev/dsp
  then
Sam Hocevar's avatar
 
Sam Hocevar committed
869
    PLUGINS="${PLUGINS} dsp"
870 871
  fi
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
872 873 874 875

dnl
dnl  Esound module
dnl
876
AC_ARG_ENABLE(esd,
877
  [  --enable-esd            Esound library support (default disabled)],
Sam Hocevar's avatar
 
Sam Hocevar committed
878 879
  [if test x$enable_esd = xyes
   then
Sam Hocevar's avatar
 
Sam Hocevar committed
880
     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
Sam Hocevar's avatar
 
Sam Hocevar committed
881 882
     if test x${ESD_CONFIG} != xno
     then
Sam Hocevar's avatar
 
Sam Hocevar committed
883
       PLUGINS="${PLUGINS} esd"
Sam Hocevar's avatar
 
Sam Hocevar committed
884
       CFLAGS_ESD="`${ESD_CONFIG} --cflags`"
Sam Hocevar's avatar
 
Sam Hocevar committed
885 886
       LIB_ESD="`${ESD_CONFIG} --libs`"
     fi
Sam Hocevar's avatar
 
Sam Hocevar committed
887 888
   fi])

Sam Hocevar's avatar
 
Sam Hocevar committed
889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904
dnl
dnl  aRts module
dnl
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
     then
       PLUGINS="${PLUGINS} arts"
       CFLAGS_ARTS="`${ARTS_CONFIG} --cflags`"
       LIB_ARTS="`${ARTS_CONFIG} --libs `"
     fi
   fi])

Sam Hocevar's avatar
 
Sam Hocevar committed
905 906 907
dnl
dnl  MacOS X module
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
908
AC_ARG_ENABLE(macosx,
909
  [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
Sam Hocevar's avatar
 
Sam Hocevar committed
910 911
  [if test x$enable_macosx = xyes
   then
912
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
 
Sam Hocevar committed
913 914
     LIB_MACOSX="-framework CoreAudio -framework Cocoa -framework AGL -framework QuickTime -lobjc"
     CFLAGS_MACOSX="-ObjC"
915
     LIB="${LIB} -ObjC"
Sam Hocevar's avatar
 
Sam Hocevar committed
916
   fi],
917 918
  [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
     BUILTINS="${BUILTINS} macosx"
Sam Hocevar's avatar
 
Sam Hocevar committed
919 920
     LIB_MACOSX="-framework CoreAudio -framework Cocoa -framework AGL -framework QuickTime -lobjc"
     CFLAGS_MACOSX="-ObjC"
921
     LIB="${LIB} -ObjC"
Sam Hocevar's avatar
 
Sam Hocevar committed
922 923
   )])

924 925 926 927
dnl
dnl  QNX RTOS module
dnl
AC_ARG_ENABLE(qnx,
928
  [  --disable-qnx           QNX RTOS support (default enabled on QNX RTOS)])
Sam Hocevar's avatar
 
Sam Hocevar committed
929 930
    if test x$enable_qnx != xno
    then
931 932 933 934 935 936
      AC_CHECK_HEADERS(Ph.h, [
        PLUGINS="${PLUGINS} qnx"
        LIB_QNX="-lasound -lph"
      ])
    fi

Sam Hocevar's avatar
 
Sam Hocevar committed
937 938 939
dnl
dnl  Linux framebuffer module
dnl
940 941
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default disabled)],
Sam Hocevar's avatar
 
Sam Hocevar committed
942 943 944 945
  [ if test x$enable_fb = xyes
    then
      PLUGINS="${PLUGINS} fb"
    fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
946

Sam Hocevar's avatar
 
Sam Hocevar committed
947 948 949 950 951 952 953
dnl
dnl  Linux MGA module
dnl
AC_ARG_ENABLE(mga,
  [  --enable-mga            Linux kernel Matrox support (default disabled)],
  [ if test x$enable_mga = xyes
    then
Sam Hocevar's avatar
 
Sam Hocevar committed
954
      PLUGINS="${PLUGINS} mga xmga"
Sam Hocevar's avatar
 
Sam Hocevar committed
955 956
    fi ])

Sam Hocevar's avatar
 
Sam Hocevar committed
957 958 959
dnl
dnl  GGI module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
960 961
AC_ARG_WITH(ggi,
  [  --with-ggi[=name]       GGI support (default disabled)],
Sam Hocevar's avatar
 
Sam Hocevar committed
962
  [ if test "x$withval" != "xno"
Christophe Massiot's avatar
Christophe Massiot committed
963
    then
Sam Hocevar's avatar
 
Sam Hocevar committed
964 965
      PLUGINS="${PLUGINS} ggi"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
966 967 968 969 970
      then
        LIB_GGI="-l"$withval
      else
        LIB_GGI="-lggi"
      fi
Christophe Massiot's avatar
Christophe Massiot committed
971
    fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
972 973 974 975

dnl
dnl  SDL module
dnl
976 977
AC_ARG_ENABLE(sdl,
  [  --disable-sdl           SDL support (default enabled)])
978
if test "x$enable_sdl" != "xno"
979
then
980 981 982 983 984 985 986 987
  SDL_PATH=$PATH
  AC_ARG_WITH(sdl-config-path,
    [  --with-sdl-config-path=path sdl-config path (default search in \$PATH)],
    [ if test "x$withval" != "xno"
      then
        SDL_PATH=$withval:$PATH
      fi ])
  AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, $SDL_PATH)
988 989
  SDL_CONFIG=${SDL12_CONFIG}
  SDL_HEADER="SDL12/SDL.h"
Sam Hocevar's avatar
 
Sam Hocevar committed
990 991
  if test x${SDL_CONFIG} = xno
  then
992
    AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, $SDL_PATH)
Sam Hocevar's avatar
 
Sam Hocevar committed
993
    SDL_CONFIG=${SDL11_CONFIG}
994 995
    SDL_HEADER="SDL11/SDL.h"
  fi
Sam Hocevar's avatar
 
Sam Hocevar committed
996 997
  if test x${SDL_CONFIG} = xno
  then
998
    AC_PATH_PROG(SDL_CONFIG, sdl-config, no, $SDL_PATH)
999
    SDL_HEADER="SDL/SDL.h"
1000
  fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1001 1002
  if test x${SDL_CONFIG} != xno
  then
1003 1004 1005
    PLUGINS="${PLUGINS} sdl"
    CFLAGS_SDL="`${SDL_CONFIG} --cflags`"
    LIB_SDL="`${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
Sam Hocevar's avatar
 
Sam Hocevar committed
1006 1007
    save_CPPFLAGS=$CPPFLAGS
    CPPFLAGS="$CPPFLAGS $CFLAGS_SDL"
1008 1009
    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),
1010 1011 1012 1013
      [ 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
1014
    CPPFLAGS=$save_CPPFLAGS
Sam Hocevar's avatar
 
Sam Hocevar committed
1015
    if expr 1.1.5 \> `$SDL_CONFIG --version` >/dev/null
Sam Hocevar's avatar
 
Sam Hocevar committed
1016
    then
1017 1018 1019
      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
1020
    fi
1021
  elif test "x$enable_sdl" =  "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
1022
  then
1023 1024 1025
    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.
    ])
1026 1027
  fi
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1028

Sam Hocevar's avatar
 
Sam Hocevar committed
1029 1030 1031
dnl
dnl  Windows DirectX module
dnl
1032
AC_ARG_ENABLE(directx,
1033 1034 1035 1036 1037 1038 1039 1040
  [  --disable-directx       Windows DirectX support (default enabled on WIN32)])
if test "x$enableval" != "xno"
then
  if test $SYS = mingw32
  then
    AC_ARG_WITH(directx-path, 
    [  --with-directx-path=path Windows DirectX headers and libraries])
    if test "x$with_directx_path" = "x"
Sam Hocevar's avatar
 
Sam Hocevar committed
1041
    then
1042 1043
      AC_CHECK_HEADERS(directx.h,
      [ PLUGINS="${PLUGINS} directx"
Gildas Bazin's avatar
 
Gildas Bazin committed
1044
        LIB_DIRECTX="-lgdi32" ])
1045 1046 1047
    else
      AC_MSG_CHECKING(for directX headers in ${withval})
      if test -f ${withval}/include/directx.h
Gildas Bazin's avatar
 
Gildas Bazin committed
1048
      then
1049
        PLUGINS="${PLUGINS} directx"
Gildas Bazin's avatar
 
Gildas Bazin committed
1050
        LIB_DIRECTX="-L${withval}/lib -lgdi32"
1051 1052
        INCLUDE="${INCLUDE} -I${withval}/include"
        AC_MSG_RESULT(yes)
Gildas Bazin's avatar
 
Gildas Bazin committed
1053
      else
1054 1055
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([Cannot find ${withval}/include/directx.h!])
Gildas Bazin's avatar
 
Gildas Bazin committed
1056
      fi
1057 1058 1059
    fi
  fi
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1060

Sam Hocevar's avatar
 
Sam Hocevar committed
1061 1062 1063
dnl
dnl  Glide module
dnl
Christophe Massiot's avatar
Christophe Massiot committed
1064 1065
AC_ARG_WITH(glide,
  [  --with-glide[=name]     Glide (3dfx) support (default disabled)],
Sam Hocevar's avatar
 
Sam Hocevar committed
1066
  [ if test "x$withval" != "xno"
Christophe Massiot's avatar
Christophe Massiot committed
1067
    then
Sam Hocevar's avatar
 
Sam Hocevar committed
1068 1069
      PLUGINS="${PLUGINS} glide"
      if test "x$withval" != "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
1070
      then
Sam Hocevar's avatar
 
Sam Hocevar committed
1071
        LIB_GLIDE="-l"$withval" -lm"
Sam Hocevar's avatar
 
Sam Hocevar committed
1072
      else
Sam Hocevar's avatar
 
Sam Hocevar committed
1073
        LIB_GLIDE="-lglide2x -lm"
Sam Hocevar's avatar
 
Sam Hocevar committed
1074
      fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1075
      CFLAGS_GLIDE="-I/usr/include/glide"
Christophe Massiot's avatar
Christophe Massiot committed
1076
    fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
1077 1078 1079 1080

dnl
dnl  ncurses module
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1081 1082
AC_ARG_ENABLE(ncurses,
  [  --enable-ncurses        ncurses interface support (default disabled)],
Sam Hocevar's avatar
 
Sam Hocevar committed
1083
  [if test x$enable_ncurses = xyes; then
Sam Hocevar's avatar
 
Sam Hocevar committed
1084
     PLUGINS="${PLUGINS} ncurses"
Sam Hocevar's avatar
 
Sam Hocevar committed
1085 1086 1087 1088 1089 1090
     LIB_NCURSES="-lncurses"
   fi])

dnl
dnl  Qt module
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1091 1092
AC_ARG_ENABLE(qt,
  [  --enable-qt             Qt interface support (default disabled)],
Sam Hocevar's avatar
 
Sam Hocevar committed
1093
  [if test x$enable_qt = xyes; then
Sam Hocevar's avatar
 
Sam Hocevar committed
1094 1095
     PLUGINS="${PLUGINS} qt"
     ALIASES="${ALIASES} qvlc"
Sam Hocevar's avatar
 
Sam Hocevar committed
1096
     LIB_QT="-lqt -L${QTDIR}/lib"
Sam Hocevar's avatar
 
Sam Hocevar committed
1097
     CFLAGS_QT="-I/usr/include/qt -I${QTDIR}/include"
Sam Hocevar's avatar
 
Sam Hocevar committed
1098
     if test -x ${QTDIR}/bin/moc
Sam Hocevar's avatar
 
Sam Hocevar committed
1099 1100 1101 1102 1103
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1104 1105 1106 1107 1108
   fi])

dnl 
dnl  KDE module
dnl
1109 1110
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
Sam Hocevar's avatar
 
Sam Hocevar committed
1111
  [if test x$enable_kde = xyes; then
Sam Hocevar's avatar
 
Sam Hocevar committed
1112 1113
     PLUGINS="${PLUGINS} kde"
     ALIASES="${ALIASES} kvlc"
Sam Hocevar's avatar
 
Sam Hocevar committed
1114 1115 1116
     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"
1117 1118 1119 1120 1121 1122
     if test -x ${QTDIR}/bin/moc
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1123
   fi])
Sam Hocevar's avatar
 
Sam Hocevar committed
1124 1125 1126 1127

dnl
dnl  Gnome module
dnl
1128
AC_ARG_ENABLE(gnome,
Sam Hocevar's avatar
 
Sam Hocevar committed
1129
  [  --enable-gnome          Gnome interface support (default disabled)],
Sam Hocevar's avatar
 
Sam Hocevar committed
1130
  [if test x$enable_gnome = xyes; then
1131 1132 1133 1134
    # look for gnome-config
    AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
    if test -x ${GNOME_CONFIG}
    then
Sam Hocevar's avatar
 
Sam Hocevar committed
1135
       CFLAGS_GNOME="`${GNOME_CONFIG} --cflags gtk gnomeui`"
1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150
       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
1151 1152 1153 1154

dnl
dnl  Gtk+ module
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1155 1156
AC_ARG_ENABLE(gtk,
  [  --disable-gtk           Gtk+ support (default enabled)])
Sam Hocevar's avatar
 
Sam Hocevar committed
1157 1158
if test x$enable_gtk != xno
then
1159 1160 1161 1162 1163 1164 1165
  GTK_PATH=$PATH
  AC_ARG_WITH(gtk-config-path,
    [  --with-gtk-config-path=path gtk-config path (default search in \$PATH)],
    [ if test "x$withval" != "xno"
      then
        GTK_PATH=$withval:$PATH
      fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
1166
  # look for gtk-config
1167
  AC_PATH_PROG(GTK_CONFIG, gtk-config, no, $GTK_PATH)
Sam Hocevar's avatar
 
Sam Hocevar committed
1168 1169
  if test -x ${GTK_CONFIG}
  then
Sam Hocevar's avatar
 
Sam Hocevar committed
1170 1171 1172 1173
    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
1174 1175
    CFLAGS_GTK="`${GTK_CONFIG} --cflags gtk`"
    LIB_GTK="`${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
1176
  fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1177 1178 1179
  # now look for the gtk.h header
  saved_CPPFLAGS=$CPPFLAGS
  CPPFLAGS="$CPPFLAGS $CFLAGS_GTK"
Sam Hocevar's avatar
 
Sam Hocevar committed
1180 1181 1182 1183
  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."
1184
  ])
Sam Hocevar's avatar
 
Sam Hocevar committed
1185 1186
  if test "x$ac_cv_gtk_headers" = xyes
  then
Sam Hocevar's avatar
 
Sam Hocevar committed
1187 1188
    PLUGINS="${PLUGINS} gtk"
    ALIASES="${ALIASES} gvlc"
1189
  fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1190
  CPPFLAGS=$saved_CPPFLAGS
1191
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1192 1193 1194

dnl
dnl  X11 module
1195
dnl  (enabled by default except on win32)
Sam Hocevar's avatar
 
Sam Hocevar committed
1196
dnl
1197
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
 
Sam Hocevar committed
1198
  [  --disable-x11           X11 support (default enabled)])
1199 1200
if test x$enable_x11 != xno &&
  (test $SYS != mingw32 || test x$enable_x11 = xyes); then
Sam Hocevar's avatar
 
Sam Hocevar committed
1201 1202 1203 1204 1205 1206 1207 1208
  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
1209
  AC_CHECK_HEADERS(X11/Xlib.h, [
Sam Hocevar's avatar
 
Sam Hocevar committed
1210 1211 1212
    PLUGINS="${PLUGINS} x11"
    LIB_X11="${LIB_X11} -L$x_libraries -lX11 -lXext"
    CFLAGS_X11="${CFLAGS_X11} -I$x_includes"
Sam Hocevar's avatar
 
Sam Hocevar committed
1213 1214
  ]
  CPPFLAGS=$saved_CPPFLAGS)
1215
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1216 1217 1218

dnl
dnl  XVideo module
1219
dnl  (enabled by default except on win32)
Sam Hocevar's avatar
 
Sam Hocevar committed
1220
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1221
AC_ARG_ENABLE(xvideo,
Sam Hocevar's avatar
 
Sam Hocevar committed
1222
  [  --disable-xvideo        XVideo support (default enabled)])
1223 1224
if test x$enable_xvideo != xno &&
  (test $SYS != mingw32 || test x$enable_xvideo = xyes); then
Sam Hocevar's avatar
 
Sam Hocevar committed
1225 1226 1227 1228 1229 1230 1231 1232 1233
  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, [
Sam Hocevar's avatar
 
Sam Hocevar committed
1234
    BUILTINS="${BUILTINS} xvideo"
Sam Hocevar's avatar
 
Sam Hocevar committed
1235 1236
    LIB_XVIDEO="${LIB_XVIDEO} -L$x_libraries -lX11 -lXext -lXv"
    CFLAGS_XVIDEO="${CFLAGS_XVIDEO} -I$x_includes"
Sam Hocevar's avatar
 
Sam Hocevar committed
1237 1238 1239
  ]
  CPPFLAGS=$saved_CPPFLAGS)
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1240 1241 1242 1243

dnl
dnl  ALSA module
dnl
Henri Fallon's avatar
 
Henri Fallon committed
1244
AC_ARG_ENABLE(alsa,
1245 1246
  [  --enable-alsa           Alsa sound drivers support (Only for linux)
                          (default disabled)],
Sam Hocevar's avatar
 
Sam Hocevar committed
1247 1248
  [if test x$enable_alsa = xyes
   then
Sam Hocevar's avatar
 
Sam Hocevar committed
1249
     AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
Sam Hocevar's avatar
 
Sam Hocevar committed
1250 1251 1252
     if test x$have_alsa = xtrue
     then
       PLUGINS="${PLUGINS} alsa"
Sam Hocevar's avatar
 
Sam Hocevar committed
1253
       LIB_ALSA="-lasound -lm -ldl"
Sam Hocevar's avatar
 
Sam Hocevar committed
1254 1255
     fi
   fi])
Sam Hocevar's avatar
 
Sam Hocevar committed
1256

Sam Hocevar's avatar
 
Sam Hocevar committed
1257
dnl  end of non-BeOS stuff
1258 1259
fi

1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270
dnl
dnl  Plug-ins - this must be AT THE END
dnl
AC_ARG_ENABLE(plugins,
  [  --disable-plugins       Make all plug-ins built-in (default plug-ins enabled)],
  [if test x$enable_plugins = xno
   then
     BUILTINS="${BUILTINS} ${PLUGINS}"
     PLUGINS=
   fi])

Sam Hocevar's avatar
 
Sam Hocevar committed
1271 1272 1273 1274 1275 1276 1277 1278 1279 1280
dnl
dnl  DLLs - used for Win32 package build
dnl
DLL_PATH=.
AC_ARG_WITH(dll-path,
  [  --with-dll-path=path    Path to Win32 DLLs (default search in \$PWD)],
  [ if test "x$withval" != "xno"
    then
      DLL_PATH=$withval
    fi ])
1281

Sam Hocevar's avatar
 
Sam Hocevar committed
1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296
dnl
dnl  Stuff used by the program
dnl
AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "vlc $VLC_VERSION $VLC_CODENAME Copyright 1996-2001 VideoLAN\n")
AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version $VLC_VERSION $VLC_CODENAME - (c) 1996-2002 VideoLAN")

VLC_SYMBOL="`echo ${VLC_VERSION} | tr .- __`"
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__MODULE_$VLC_SYMBOL")
AC_DEFINE_UNQUOTED(MODULE_SYMBOL, $VLC_SYMBOL)

DATA_PATH="${ac_tool_prefix}/share/videolan"
AC_SUBST(DATA_PATH)
PLUGIN_PATH="${ac_tool_prefix}/share/videolan"
AC_SUBST(PLUGIN_PATH)

Sam Hocevar's avatar
 
Sam Hocevar committed
1297 1298 1299
dnl 
dnl  Configuration is finished
dnl
1300 1301
AC_SUBST(SYS)
AC_SUBST(ARCH)
1302
AC_SUBST(PLUGINS)
Sam Hocevar's avatar
 
Sam Hocevar committed
1303
AC_SUBST(BUILTINS)
1304
AC_SUBST(ALIASES)
Sam Hocevar's avatar
 
Sam Hocevar committed
1305
AC_SUBST(DEFINE)
Sam Hocevar's avatar
 
Sam Hocevar committed
1306
AC_SUBST(INCLUDE)
1307
AC_SUBST(DEBUG)
Sam Hocevar's avatar
 
Sam Hocevar committed
1308
AC_SUBST(ASM)
1309
AC_SUBST(TRACE)
Sam Hocevar's avatar
 
Sam Hocevar committed
1310 1311
AC_SUBST(CPROF)
AC_SUBST(GPROF)
1312
AC_SUBST(OPTIMS)
1313
AC_SUBST(TUNING)
1314
AC_SUBST(RELEASE)
Sam Hocevar's avatar
 
Sam Hocevar committed
1315
AC_SUBST(MOC)
Sam Hocevar's avatar
 
Sam Hocevar committed
1316
AC_SUBST(WINDRES)
Sam Hocevar's avatar
 
Sam Hocevar committed
1317
AC_SUBST(DLL_PATH)
Sam Hocevar's avatar
 
Sam Hocevar committed
1318 1319
AC_SUBST(PACKAGE)
AC_SUBST(VERSION)
Sam Hocevar's avatar
 
Sam Hocevar committed
1320 1321
AC_SUBST(VCD_DEVICE)
AC_SUBST(DVD_DEVICE)
Sam Hocevar's avatar
 
Sam Hocevar committed
1322

Sam Hocevar's avatar
 
Sam Hocevar committed
1323 1324
AC_SUBST(LDFLAGS)
AC_SUBST(PLDFLAGS)
Sam Hocevar's avatar
 
Sam Hocevar committed
1325
AC_SUBST(SOFLAGS)
Sam Hocevar's avatar
 
Sam Hocevar committed
1326

Sam Hocevar's avatar
 
Sam Hocevar committed
1327
AC_SUBST(LIB)
Sam Hocevar's avatar
 
Sam Hocevar committed
1328
AC_SUBST(LIB_ALSA)
Sam Hocevar's avatar
 
Sam Hocevar committed
1329
AC_SUBST(LIB_ARTS)
Sam Hocevar's avatar
 
Sam Hocevar committed
1330 1331
AC_SUBST(LIB_BEOS)
AC_SUBST(LIB_DARWIN)
Gildas Bazin's avatar
 
Gildas Bazin committed
1332
AC_SUBST(LIB_DIRECTX)
Sam Hocevar's avatar
 
Sam Hocevar committed
1333
AC_SUBST(LIB_DVD)
Sam Hocevar's avatar
 
Sam Hocevar committed
1334
AC_SUBST(LIB_DVD_PLUGIN)
Stéphane Borel's avatar
Stéphane Borel committed
1335 1336
AC_SUBST(LIB_DVDREAD)
AC_SUBST(LIB_DVDREAD_PLUGIN)
Sam Hocevar's avatar
 
Sam Hocevar committed
1337
AC_SUBST(LIB_ESD)
Sam Hocevar's avatar
 
Sam Hocevar committed
1338
AC_SUBST(LIB_FILTER_DISTORT)
Christophe Massiot's avatar
Christophe Massiot committed
1339
AC_SUBST(LIB_GGI)
Sam Hocevar's avatar
 
Sam Hocevar committed
1340 1341 1342
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GNOME)
AC_SUBST(LIB_GTK)
Sam Hocevar's avatar
 
Sam Hocevar committed
1343
AC_SUBST(LIB_IDCTALTIVEC)
Sam Hocevar's avatar
 
Sam Hocevar committed
1344 1345 1346
AC_SUBST(LIB_IMDCT)
AC_SUBST(LIB_IMDCT3DN)
AC_SUBST(LIB_IMDCTSSE)
Sam Hocevar's avatar
 
Sam Hocevar committed
1347
AC_SUBST(LIB_KDE)
Gildas Bazin's avatar
 
Gildas Bazin committed
1348
AC_SUBST(LIB_LIBDVDCSS)
Sam Hocevar's avatar
 
Sam Hocevar committed
1349
AC_SUBST(LIB_MACOSX)
Sam Hocevar's avatar
 
Sam Hocevar committed
1350
AC_SUBST(LIB_MAD)
Sam Hocevar's avatar
 
Sam Hocevar committed
1351
AC_SUBST(LIB_MOTIONALTIVEC)
Sam Hocevar's avatar
 
Sam Hocevar committed
1352
AC_SUBST(LIB_MPEG_TS)
Sam Hocevar's avatar
 
Sam Hocevar committed
1353
AC_SUBST(LIB_NCURSES)
Gildas Bazin's avatar
 
Gildas Bazin committed
1354
AC_SUBST(LIB_QNX)
Sam Hocevar's avatar
 
Sam Hocevar committed
1355
AC_SUBST(LIB_QT)
Gildas Bazin's avatar
 
Gildas Bazin committed
1356
AC_SUBST(LIB_RC)
Sam Hocevar's avatar
 
Sam Hocevar committed
1357 1358 1359
AC_SUBST(LIB_SDL)
AC_SUBST(LIB_X11)
AC_SUBST(LIB_XVIDEO)
1360

Sam Hocevar's avatar
 
Sam Hocevar committed
1361
AC_SUBST(CFLAGS_VLC)
Sam Hocevar's avatar
 
Sam Hocevar committed
1362
AC_SUBST(CFLAGS_ARTS)
Sam Hocevar's avatar
 
Sam Hocevar committed
1363
AC_SUBST(CFLAGS_DVD)
Stéphane Borel's avatar
Stéphane Borel committed
1364
AC_SUBST(CFLAGS_DVDREAD)
Sam Hocevar's avatar
 
Sam Hocevar committed
1365
AC_SUBST(CFLAGS_ESD)
Sam Hocevar's avatar
 
Sam Hocevar committed
1366 1367
AC_SUBST(CFLAGS_GLIDE)
AC_SUBST(CFLAGS_GNOME)
Sam Hocevar's avatar
 
Sam Hocevar committed
1368
AC_SUBST(CFLAGS_GTK)
Sam Hocevar's avatar
 
Sam Hocevar committed
1369 1370 1371 1372
AC_SUBST(CFLAGS_KDE)
AC_SUBST(CFLAGS_IDCTALTIVEC)
AC_SUBST(CFLAGS_LIBDVDCSS)
AC_SUBST(CFLAGS_MACOSX)
Sam Hocevar's avatar
 
Sam Hocevar committed
1373
AC_SUBST(CFLAGS_MAD)
Sam Hocevar's avatar
 
Sam Hocevar committed
1374 1375
AC_SUBST(CFLAGS_MOTIONALTIVEC)
AC_SUBST(CFLAGS_QT)
Sam Hocevar's avatar
 
Sam Hocevar committed
1376
AC_SUBST(CFLAGS_SDL)
Sam Hocevar's avatar
 
Sam Hocevar committed
1377
AC_SUBST(CFLAGS_X11)
Sam Hocevar's avatar
 
Sam Hocevar committed
1378
AC_SUBST(CFLAGS_XVIDEO)
Sam Hocevar's avatar
 
Sam Hocevar committed
1379

Sam Hocevar's avatar
 
Sam Hocevar committed
1380 1381
AC_SUBST(SRC_DVD_EXTRA)
AC_SUBST(SRC_DVDCSS_EXTRA)
Sam Hocevar's avatar
 
Sam Hocevar committed
1382

Sam Hocevar's avatar
 
Sam Hocevar committed
1383
AC_SUBST(NEED_GETOPT)
Sam Hocevar's avatar
 
Sam Hocevar committed
1384
AC_SUBST(NEED_LIBDVDCSS)
Sam Hocevar's avatar
 
Sam Hocevar committed
1385

Sam Hocevar's avatar
 
Sam Hocevar committed
1386
AC_OUTPUT([Makefile.opts po/Makefile.in])
1387

1388
echo "
Sam Hocevar's avatar
 
Sam Hocevar committed
1389 1390 1391 1392
global configuration
--------------------
system                : ${SYS}
architecture          : ${ARCH}
1393
optimizations         : ${OPTIMS}
1394 1395
tuning:               : ${TUNING}
release:              : ${RELEASE}"
Sam Hocevar's avatar
 
Sam Hocevar committed
1396

Sam Hocevar's avatar
 
Sam Hocevar committed
1397 1398 1399
if test x${HAVE_VLC} = x1
then
  echo "
1400 1401 1402
vlc configuration
-----------------
vlc version           : ${VLC_VERSION}
1403
debug mode            : ${DEBUG}
1404
trace mode            : ${TRACE}
Sam Hocevar's avatar
 
Sam Hocevar committed
1405
cprof/gprof support   : ${CPROF}/${GPROF}
Sam Hocevar's avatar
 
Sam Hocevar committed
1406
need builtin getopt   : ${NEED_GETOPT}
Sam Hocevar's avatar
 
Sam Hocevar committed
1407
built-in modules      :${BUILTINS}
1408
plug-in modules       :${PLUGINS}
Sam Hocevar's avatar
 
Sam Hocevar committed
1409 1410
vlc aliases           :${ALIASES}"
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1411

Sam Hocevar's avatar
 
Sam Hocevar committed
1412
echo "
Sam Hocevar's avatar
 
Sam Hocevar committed
1413 1414
libdvdcss configuration
-----------------------
Sam Hocevar's avatar
 
Sam Hocevar committed
1415
can be built          : ${CAN_BUILD_LIBDVDCSS}
Sam Hocevar's avatar
 
Sam Hocevar committed
1416 1417
will be built         : ${NEED_LIBDVDCSS}"
if test x${NEED_LIBDVDCSS} = x1
Sam Hocevar's avatar
 
Sam Hocevar committed
1418
then
Sam Hocevar's avatar
 
Sam Hocevar committed
1419
  echo "need BSDI libdvd      : ${NEED_BSDI_LIBDVD}"
Sam Hocevar's avatar
 
Sam Hocevar committed
1420 1421 1422
  echo "link statically       : ${STATIC_LIBDVDCSS}"
else
  echo "use dummy replacement : ${DUMMY_LIBDVDCSS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
1423 1424 1425
fi

echo "
Sam Hocevar's avatar
 
Sam Hocevar committed
1426 1427 1428 1429 1430
You may now tune Makefile.opts at your convenience, for instance to choose
which modules get compiled as plugins.
"
if test x${HAVE_VLC} = x1
then
Sam Hocevar's avatar
 
Sam Hocevar committed
1431
  echo "To build vlc and its plugins, type \`make vlc plugins'."
Sam Hocevar's avatar
 
Sam Hocevar committed
1432 1433 1434 1435 1436 1437
fi
if test x${HAVE_LIBDVDCSS} = x1
then
  echo "To build libdvdcss only, type \`make libdvdcss'."
fi
echo ""
1438