configure.ac.in 85.6 KB
Newer Older
Sam Hocevar's avatar
 
Sam Hocevar committed
1
dnl Autoconf settings for vlc
2

3
AC_INIT(vlc,0.5.0-cvs)
4

Sam Hocevar's avatar
Sam Hocevar committed
5 6
CONFIGURE_LINE="$0 $*"
CODENAME="Natalya"
7

8 9 10 11
AC_PREREQ(2.50)
AC_CONFIG_SRCDIR(src/libvlc.c)
AC_CANONICAL_SYSTEM

12 13
dnl XXX: we don't put any flags here, because automake 1.5 doesn't support
dnl them. And we need the comma otherwize automake will choke on it.
14
AM_INIT_AUTOMAKE(vlc,0.5.0-cvs)
15 16
AM_CONFIG_HEADER(config.h)

Sam Hocevar's avatar
Sam Hocevar committed
17 18 19
dnl
dnl  Save *FLAGS
dnl
20 21 22 23 24
CPPFLAGS_save="${CPPFLAGS}"
CFLAGS_save="${CFLAGS}"
CXXFLAGS_save="${CXXFLAGS}"
OBJCFLAGS_save="${OBJCFLAGS}"
LDFLAGS_save="${LDFLAGS}"
Sam Hocevar's avatar
 
Sam Hocevar committed
25

Sam Hocevar's avatar
Sam Hocevar committed
26
dnl
27
dnl Check for tools
Sam Hocevar's avatar
Sam Hocevar committed
28
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
29
AC_PROG_CC
30
AM_PROG_CC_C_O
Sam Hocevar's avatar
 
Sam Hocevar committed
31
AC_PROG_CPP
32
AC_PROG_CXX
33 34
AC_PROG_MAKE_SET
AC_PROG_INSTALL
35

36 37 38 39 40 41 42 43 44 45 46 47
dnl AC_PROG_OBJC doesn't seem to exist, this is the KDE workaround
AC_MSG_CHECKING(for an Objective-C compiler)
OBJC="${CXX}"
AC_SUBST(OBJC)
OBJCFLAGS="${CXXFLAGS} -fgnu-runtime -fconstant-string-class=NSConstantString"
AC_SUBST(OBJCFLAGS)
dnl _AM_DEPENDENCIES(OBJC) doesn't work, so hard code OBJCDEPMODE here
#OBJCDEPMODE="depmode=gcc3"
#AC_SUBST(OBJCDEPMODE)
_AM_DEPENDENCIES(OBJC)
AC_MSG_RESULT(not implemented yet)

Gildas Bazin's avatar
 
Gildas Bazin committed
48 49
dnl Find the right ranlib, even when cross-compiling
AC_CHECK_TOOL(RANLIB, ranlib, :)
Sam Hocevar's avatar
 
Sam Hocevar committed
50
AC_CHECK_TOOL(STRIP, strip, :)
Gildas Bazin's avatar
 
Gildas Bazin committed
51

52
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
53
dnl Gettext stuff
54
dnl
55
ALL_LINGUAS="de en_GB fr ja no ru nl pl se"
56
AM_GNU_GETTEXT_VERSION(0.10.40)
Sam Hocevar's avatar
 
Sam Hocevar committed
57
AM_GNU_GETTEXT
58 59 60 61 62
if test "${nls_cv_force_use_gnu_gettext}" = "yes"; then
  AC_DEFINE(HAVE_INCLUDED_GETTEXT, 1, Define if we use the local libintl)
  INCLUDES="${INCLUDES} -I\\\$(top_srcdir)/intl"
fi
AM_CONDITIONAL(BUILD_INTL, test "${nls_cv_force_use_gnu_gettext}" = "yes")
Sam Hocevar's avatar
 
Sam Hocevar committed
63

64 65 66
dnl AM_PROG_LIBTOOL
AC_PROG_INSTALL

67 68 69 70
dnl Check for compiler properties
AC_C_CONST
AC_C_INLINE

Sam Hocevar's avatar
Sam Hocevar committed
71
dnl
72
dnl  Set default values
Sam Hocevar's avatar
Sam Hocevar committed
73
dnl
74 75
LDFLAGS_vlc="${LDFLAGS}"
LIBEXT=".so"
Sam Hocevar's avatar
Sam Hocevar committed
76

Gildas Bazin's avatar
 
Gildas Bazin committed
77 78 79
dnl
dnl  Check the operating system
dnl
80
case "x${target_os}" in
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104
  x)
    SYS=unknown
    ;;
  xlinux*)
    SYS=linux
    ;;
  xbsdi*)
    SYS=bsdi
    CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
    LDFLAGS_dvd="${LDFLAGS_dvd} -ldvd"
    LDFLAGS_vcd="${LDFLAGS_vcd} -ldvd"
    ;;
  x*bsd*)
    SYS="${target_os}"
    CFLAGS_save="${CFLAGS_save} -pthread"; CFLAGS="${CFLAGS_save}"
    ;;
  xdarwin*)
    SYS=darwin
    CFLAGS_save="${CFLAGS_save} -no-cpp-precomp"; CFLAGS="${CFLAGS_save}"
    CXXFLAGS_save="${CXXFLAGS_save} -no-cpp-precomp"; CXXFLAGS="${CXXFLAGS_save}"
    OBJCFLAGS_save="${OBJCFLAGS_save} -no-cpp-precomp"; OBJCFLAGS="${OBJCFLAGS_save}"
    LDFLAGS_vlc="${LDFLAGS_vlc} -all_load"
    LIBEXT=".dylib"
    ;;
Gildas Bazin's avatar
 
Gildas Bazin committed
105
  x*mingw32* | x*cygwin*)
106 107
    AC_CHECK_TOOL(WINDRES, windres, :)
    LIBEXT=".dll"
Gildas Bazin's avatar
 
Gildas Bazin committed
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124

    case "x${target_os}" in
      x*mingw32*)
        SYS=mingw32
        ;;
      x*cygwin*)
        dnl Check if we are using the mno-cygwin mode in which case we are
        dnl actually dealing with a mingw32 compiler.
        AC_EGREP_CPP(yes,
            [#ifdef WIN32
             yes
             #endif],
            SYS=mingw32, SYS=cygwin)
        ;;
    esac

    if test "x$SYS" = "xmingw32"; then
125
        # add ws2_32 for closesocket, select, recv
Gildas Bazin's avatar
 
Gildas Bazin committed
126 127 128 129 130
        CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"
        CPPFLAGS="${CPPFLAGS_save}"
        LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows"
        LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
        LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
Gildas Bazin's avatar
 
Gildas Bazin committed
131 132 133 134
        LDFLAGS_access_http="${LDFLAGS_access_http} -lws2_32"
        LDFLAGS_access_mms="${LDFLAGS_access_mms} -lws2_32"
        LDFLAGS_access_rtp="${LDFLAGS_access_rtp} -lws2_32"
        LDFLAGS_access_udp="${LDFLAGS_access_udp} -lws2_32"
Gildas Bazin's avatar
 
Gildas Bazin committed
135 136
        LDFLAGS_rc="${LDFLAGS_rc} -lws2_32"
    fi
137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155
    ;;
  x*nto*)
    SYS=nto
    LDFLAGS_x11="${LDFLAGS_x11} -lsocket"
    LDFLAGS_xvideo="${LDFLAGS_xvideo} -lsocket"
    ;;
  xsolaris*)
    SYS=solaris
    ;;
  xhpux*)
    SYS=hpux
    LIBEXT=".sl"
    ;;
  xbeos)
    SYS=beos
    CFLAGS_save="${CFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CFLAGS="${CFLAGS_save}"
    CXXFLAGS_save="${CXXFLAGS_save} -Wno-multichar -Wno-ctor-dtor-privacy -Woverloaded-virtual"; CXXFLAGS="${CXXFLAGS_save}"
    LDFLAGS_vlc="${LDFLAGS_vlc} -lbe"
    LDFLAGS_plugins="${LDFLAGS_plugins} -nostart"
156
    LDFLAGS_beos="${LDFLAGS_beos} -lbe -lmedia -lroot -ltracker -lstdc++.r4 -ltranslation"
157 158 159 160 161
    dnl BONE or not BONE ?
    AC_CHECK_LIB( bind, inet_ntoa,
        [ LDFLAGS_access_mms="${LDFLAGS_access_mms} -lbind"
          LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind"],
        [])
162 163 164 165
    ;;
  x*)
    SYS="${target_os}"
    ;;
Gildas Bazin's avatar
 
Gildas Bazin committed
166
esac
167 168 169 170 171 172
AM_CONDITIONAL(HAVE_BEOS, test "x${SYS}" = "xbeos")
AM_CONDITIONAL(HAVE_DARWIN, test "x${SYS}" = "xdarwin")
AM_CONDITIONAL(HAVE_WIN32, test "x${SYS}" = "xmingw32")

AC_MSG_CHECKING(for suffix of libraries)
AC_MSG_RESULT(${LIBEXT})
Gildas Bazin's avatar
 
Gildas Bazin committed
173

Gildas Bazin's avatar
 
Gildas Bazin committed
174 175 176 177 178
dnl Check for the need to include the mingwex lib for mingw32
if test x$SYS = xmingw32
then
    AC_CHECK_LIB(mingwex,opendir,
        AC_CHECK_LIB(mingw32,opendir,LDFLAGS_vlc="${LDFLAGS_vlc}",
Gildas Bazin's avatar
 
Gildas Bazin committed
179 180
            [LDFLAGS_vlc="${LDFLAGS_vlc} -lmingwex"
             LDFLAGS_gtk="${LDFLAGS_gtk} -lmingwex"])
Gildas Bazin's avatar
 
Gildas Bazin committed
181 182 183
    )
fi

Gildas Bazin's avatar
 
Gildas Bazin committed
184 185 186 187 188 189 190 191 192 193 194 195 196
dnl Check for fnative-struct or mms-bitfields support for mingw32
if test x$SYS = xmingw32
then
    AC_CACHE_CHECK([if \$CC accepts -mms-bitfields],
        [ac_cv_c_mms_bitfields],
        [CFLAGS="${CFLAGS_save} -mms-bitfields"
         AC_TRY_COMPILE([],,ac_cv_c_mms_bitfields=yes, ac_cv_c_mms_bitfields=no)])
    if test x"$ac_cv_c_mms_bitfields" != x"no"; then
        CFLAGS_mingw32_special="-mms-bitfields"
    else
        CFLAGS_mingw32_special="-fnative-struct"
    fi

Gildas Bazin's avatar
 
Gildas Bazin committed
197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217
    CFLAGS_save="${CFLAGS_save} ${CFLAGS_mingw32_special}";
    CXXFLAGS_save="${CXXFLAGS_save} ${CFLAGS_mingw32_special}";
    CFLAGS="${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
fi

dnl Check for fvtable-thunks support for mingw32
if test x$SYS = xmingw32
then
AC_LANG_PUSH(C++)
    AC_CACHE_CHECK([if \$CXX accepts -fvtable-thunks],
        [ac_cv_cxx_fvtable_thunks],
        [CXXFLAGS="${CXXFLAGS_save} -Wall -Werror -fvtable-thunks"
         AC_TRY_COMPILE([],,ac_cv_cxx_fvtable_thunks=yes,
                        ac_cv_cxx_fvtable_thunks=no)])
    if test x"$ac_cv_cxx_fvtable_thunks" = x"yes"; then
        CXXFLAGS_mingw32_special="-fvtable-thunks"
    fi

    CXXFLAGS_save="${CXXFLAGS_save} ${CXXFLAGS_mingw32_special}"
    CXXFLAGS="${CXXFLAGS_save}"
AC_LANG_POP(C++)
Gildas Bazin's avatar
 
Gildas Bazin committed
218 219
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
220
dnl Flags for plugin compilation
221 222
case "x${SYS}" in
  xmingw32|xcygwin)
Gildas Bazin's avatar
 
Gildas Bazin committed
223
    CFLAGS_pics="${CFLAGS_pics} ${CFLAGS_mingw32_special}"
Gildas Bazin's avatar
 
Gildas Bazin committed
224
    CXXFLAGS_pics="${CXXFLAGS_pics} ${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}"
Gildas Bazin's avatar
 
Gildas Bazin committed
225 226
    OBJCFLAGS_pics="${OBJCFLAGS_pics} ${CFLAGS_mingw32_special}"
    CFLAGS_plugins="${CFLAGS_plugins} ${CFLAGS_mingw32_special}"
Gildas Bazin's avatar
 
Gildas Bazin committed
227
    CXXFLAGS_plugins="${CXXFLAGS_plugins} ${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}"
Gildas Bazin's avatar
 
Gildas Bazin committed
228
    OBJCFLAGS_plugins="${OBJCFLAGS_plugins} ${CFLAGS_mingw32_special}"
229 230 231 232 233 234 235 236 237 238 239
    ;;
  x*)
    CFLAGS_pics="${CFLAGS_pics} -fPIC"
    CXXFLAGS_pics="${CXXFLAGS_pics} -fPIC"
    OBJCFLAGS_pics="${OBJCFLAGS_pics} -fPIC"
    CFLAGS_plugins="${CFLAGS_plugins} -fPIC"
    CXXFLAGS_plugins="${CXXFLAGS_plugins} -fPIC"
    OBJCFLAGS_plugins="${OBJCFLAGS_plugins} -fPIC"
    LDFLAGS_plugins="${LDFLAGS_plugins} -fPIC"
    ;;
esac
Sam Hocevar's avatar
 
Sam Hocevar committed
240 241

dnl The -DSYS_FOO flag
242
CPPFLAGS_save="${CPPFLAGS_save} -DSYS_`echo ${SYS} | sed -e 's/-.*//' | tr 'abcdefghijklmnopqrstuvwxyz.' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_'`"; CPPFLAGS="${CPPFLAGS_save}"
Sam Hocevar's avatar
 
Sam Hocevar committed
243

244
dnl Check for system libs needed
245
need_libc=false
246

247 248 249 250 251 252 253 254 255 256 257
AC_CHECK_FUNCS(gettimeofday select strerror strtod strtol isatty vasprintf swab sigrelse getpwuid memalign posix_memalign gethostbyname2 atoll getenv putenv setenv)

dnl Check for usual libc functions
AC_CHECK_FUNCS(strdup,,[need_libc=:])
AC_CHECK_FUNCS(strndup,,[need_libc=:])
AC_CHECK_FUNCS(atof,,[need_libc=:])
AC_CHECK_FUNCS(lseek,,[need_libc=:])
AC_CHECK_FUNCS(strcasecmp,,[AC_CHECK_FUNCS(stricmp,,[need_libc=:])])
AC_CHECK_FUNCS(strncasecmp,,[AC_CHECK_FUNCS(strnicmp,,[need_libc=:])])

AM_CONDITIONAL(BUILD_LIBC, ${need_libc})
Sam Hocevar's avatar
 
Sam Hocevar committed
258

Sam Hocevar's avatar
 
Sam Hocevar committed
259
AC_CHECK_FUNC(connect,,[
260 261 262
  AC_CHECK_LIB(socket,connect,
    LDFLAGS_ipv4="${LDFLAGS_ipv4} -lsocket"
    LDFLAGS_vlc="${LDFLAGS_vlc} -lsocket"
Sam Hocevar's avatar
 
Sam Hocevar committed
263
)])
264

Sam Hocevar's avatar
Sam Hocevar committed
265
AC_CHECK_FUNC(send,,[
266
  AC_CHECK_LIB(socket,send,
Gildas Bazin's avatar
 
Gildas Bazin committed
267 268 269 270
    LDFLAGS_access_http="${LDFLAGS_access_http} -lsocket"
    LDFLAGS_access_mms="${LDFLAGS_access_mms} -lsocket"
    LDFLAGS_access_rtp="${LDFLAGS_access_rtp} -lsocket"
    LDFLAGS_access_udp="${LDFLAGS_access_udp} -lsocket"
Sam Hocevar's avatar
Sam Hocevar committed
271
)])
272

Sam Hocevar's avatar
 
Sam Hocevar committed
273
AC_CHECK_FUNC(gethostbyname,,[
274 275
  AC_CHECK_LIB(nsl,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lnsl",[
    AC_CHECK_LIB(bind,gethostbyname,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lbind")])
Sam Hocevar's avatar
 
Sam Hocevar committed
276
])
277 278 279

have_nanosleep=false
AC_CHECK_FUNC(nanosleep,have_nanosleep=:,[
280
  AC_CHECK_LIB(rt,nanosleep,
281
    [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"; have_nanosleep=:],
282
    [AC_CHECK_LIB(posix4,nanosleep,
283
        [LDFLAGS_vlc="${LDFLAGS_vlc} -lposix4"; have_nanosleep=:])]
284
  )
Sam Hocevar's avatar
 
Sam Hocevar committed
285
])
286 287 288
if ${have_nanosleep}; then
  AC_DEFINE(HAVE_NANOSLEEP, 1,
            Define if nanosleep is available.)
289
fi
290 291 292 293 294 295 296 297 298 299 300 301 302 303 304

dnl Check for socklen_t
AC_CACHE_CHECK([for socklen_t], ac_cv_type_socklen_t,
  [AC_TRY_COMPILE(
     [#include <sys/types.h>
      #include <sys/socket.h>],
     [socklen_t len = 42; return len;],
     ac_cv_type_socklen_t=yes,
     ac_cv_type_socklen_t=no)])
if test x$ac_cv_type_socklen_t != xno; then
  AC_DEFINE(HAVE_SOCKLEN_T, 1,
            Define if <sys/socket.h> defines socklen_t.)
fi

dnl HP/UX port
305
AC_CHECK_LIB(rt,sem_init, [LDFLAGS_vlc="${LDFLAGS_vlc} -lrt"])
306

Sam Hocevar's avatar
 
Sam Hocevar committed
307
AC_CHECK_FUNC(inet_aton,,[
308
  AC_CHECK_LIB(resolv,inet_aton,LDFLAGS_ipv4="${LDFLAGS_ipv4} -lresolv")
309 310
])
AC_CHECK_FUNC(textdomain,,[
311 312 313 314
  AC_CHECK_LIB(intl,textdomain,
    LDFLAGS_vlc="${LDFLAGS_vlc} -lintl"
    LDFLAGS_plugins="${LDFLAGS_plugins} -lintl"
  )
Sam Hocevar's avatar
 
Sam Hocevar committed
315
])
Sam Hocevar's avatar
 
Sam Hocevar committed
316

Sam Hocevar's avatar
 
Sam Hocevar committed
317
dnl Check for getopt
318
need_getopt=false
Sam Hocevar's avatar
 
Sam Hocevar committed
319 320
AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
[ # FreeBSD has a gnugetopt library for this:
321 322 323 324
  AC_CHECK_LIB([gnugetopt],[getopt_long],
    [AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) LDFLAGS_vlc="${LDFLAGS_vlc} -lgnugetopt"],
    [need_getopt=:])])
AM_CONDITIONAL(BUILD_GETOPT, ${need_getopt})
Sam Hocevar's avatar
 
Sam Hocevar committed
325

326
AC_TYPE_SIGNAL
327
AC_CHECK_LIB(dl,dlopen,LDFLAGS_vlc="${LDFLAGS_vlc} -ldl")
Sam Hocevar's avatar
 
Sam Hocevar committed
328
AC_CHECK_LIB(m,cos,
329
  LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
330 331
  LDFLAGS_filter_distort="${LDFLAGS_filter_distort} -lm"
  LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -lm")
Sam Hocevar's avatar
 
Sam Hocevar committed
332
AC_CHECK_LIB(m,pow,
333 334 335 336 337 338
  LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lm"
  LDFLAGS_imdct="${LDFLAGS_imdct} -lm"
  LDFLAGS_imdct3dn="${LDFLAGS_imdct3dn} -lm"
  LDFLAGS_imdctsse="${LDFLAGS_imdctsse} -lm"
  LDFLAGS_i420_rgb="${LDFLAGS_i420_rgb} -lm"
  LDFLAGS_faad="${LDFLAGS_faad} -lm"
Sam Hocevar's avatar
 
Sam Hocevar committed
339
)
Sam Hocevar's avatar
 
Sam Hocevar committed
340

Sam Hocevar's avatar
 
Sam Hocevar committed
341
dnl Check for pthreads - borrowed from XMMS
Sam Hocevar's avatar
 
Sam Hocevar committed
342
THREAD_LIB=error
343
if test "x${THREAD_LIB}" = "xerror"; then
344
  AC_CHECK_LIB(pthread,main,THREAD_LIB="-lpthread")
Sam Hocevar's avatar
 
Sam Hocevar committed
345
fi
346
if test "x${THREAD_LIB}" = "xerror"; then
347
  AC_CHECK_LIB(pthreads,main,THREAD_LIB="-lpthreads")
Sam Hocevar's avatar
 
Sam Hocevar committed
348
fi
349
if test "x${THREAD_LIB}" = "xerror"; then
350
  AC_CHECK_LIB(c_r,main,THREAD_LIB="-lc_r")
Sam Hocevar's avatar
 
Sam Hocevar committed
351
fi
352
if test "x${THREAD_LIB}" = "xerror"; then
353 354
  AC_CHECK_FUNC(pthread_mutex_lock)
  THREAD_LIB=""
Sam Hocevar's avatar
 
Sam Hocevar committed
355
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
356 357 358

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

Sam Hocevar's avatar
 
Sam Hocevar committed
360 361
dnl Check for misc headers
AC_EGREP_HEADER(pthread_cond_t,pthread.h,[
362 363
  AC_DEFINE(PTHREAD_COND_T_IN_PTHREAD_H, 1,
            Define if <pthread.h> defines pthread_cond_t.)])
Sam Hocevar's avatar
Sam Hocevar committed
364
AC_EGREP_HEADER(pthread_once,pthread.h,[
365 366
  AC_DEFINE(PTHREAD_ONCE_IN_PTHREAD_H, 1,
            Define if <pthread.h> defines pthread_once.)])
Sam Hocevar's avatar
 
Sam Hocevar committed
367
AC_EGREP_HEADER(strncasecmp,strings.h,[
368 369
  AC_DEFINE(STRNCASECMP_IN_STRINGS_H, 1,
            Define if <strings.h> defines strncasecmp.)])
Sam Hocevar's avatar
 
Sam Hocevar committed
370

Sam Hocevar's avatar
 
Sam Hocevar committed
371
dnl Check for headers
372 373
AC_CHECK_HEADERS(signal.h time.h errno.h stdint.h getopt.h strings.h inttypes.h sys/int_types.h)
AC_CHECK_HEADERS(sys/sockio.h fcntl.h sys/types.h sys/time.h sys/times.h sys/ioctl.h sys/stat.h)
Sam Hocevar's avatar
 
Sam Hocevar committed
374 375
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
376
AC_CHECK_HEADERS(machine/param.h sys/shm.h)
377
AC_CHECK_HEADERS(linux/version.h)
Sam Hocevar's avatar
 
Sam Hocevar committed
378

Sam Hocevar's avatar
 
Sam Hocevar committed
379 380
AC_HEADER_TIME

381 382
dnl Check for dirent
need_dirent=false
383
AC_CHECK_HEADERS(dirent.h,,[need_dirent=:])
384 385
AM_CONDITIONAL(BUILD_DIRENT, ${need_dirent})

386
dnl Mac OS X and other OSes don't have declaration for nanosleep
387
AC_EGREP_HEADER(nanosleep,time.h,[
388 389
  AC_DEFINE(HAVE_DECL_NANOSLEEP, 1,
            Define if <time.h> defines nanosleep.)
390
])
391 392

dnl Make sure we have timespecs
393
AC_EGREP_HEADER(timespec,sys/time.h,[
394 395
  AC_DEFINE(HAVE_STRUCT_TIMESPEC, 1,
            Define if <sys/time.h> defines struct timespec.)
396
])
397

Sam Hocevar's avatar
 
Sam Hocevar committed
398 399 400
dnl Check for threads library
AC_CHECK_HEADERS(cthreads.h pthread.h kernel/scheduler.h kernel/OS.h)

401 402
dnl Default X headers and libraries
if test "x${x_includes}" = "xNONE"; then
403
  x_includes="/usr/X11R6/include"
404 405
fi
if test "x${x_libraries}" = "xNONE"; then
406
  x_libraries="/usr/X11R6/lib"
407 408
fi

409
dnl Build the gtk_main plugins?
410
NEED_GTK_MAIN=no
411
NEED_GNOME_MAIN=no
412

Sam Hocevar's avatar
 
Sam Hocevar committed
413
dnl Check for DPMS
414
if test "x${SYS}" != "xmingw32"
Sam Hocevar's avatar
 
Sam Hocevar committed
415
then
416 417 418 419 420 421 422 423
  CPPFLAGS="${CPPFLAGS_save} -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="${CPPFLAGS_save}"
Sam Hocevar's avatar
 
Sam Hocevar committed
424 425
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
426
dnl Check for ntohl, etc.
427
AC_CACHE_CHECK([for ntohl in sys/param.h],
428 429 430 431 432
    [ac_cv_c_ntohl_sys_param_h],
    [CFLAGS="${CFLAGS_save} -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)])
433
if test "x${ac_cv_c_ntohl_sys_param_h}" != "xno"; then
434
    AC_DEFINE(NTOHL_IN_SYS_PARAM_H, 1, Define if <sys/param.h> defines ntohl.)
435
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
436

Sam Hocevar's avatar
 
Sam Hocevar committed
437
dnl Check for inline function size limit
438
AC_CACHE_CHECK([if \$CC accepts -finline-limit],
439 440 441
    [ac_cv_c_inline_limit],
    [CFLAGS="${CFLAGS_save} -finline-limit-30000"
     AC_TRY_COMPILE([],,ac_cv_c_inline_limit=yes, ac_cv_c_inline_limit=no)])
442
if test "x${ac_cv_c_inline_limit}" != "xno"; then
443 444 445
    CFLAGS_save="${CFLAGS_save} -finline-limit-30000"; CFLAGS="${CFLAGS_save}"
    CXXFLAGS_save="${CXXFLAGS_save} -finline-limit-30000"; CXXFLAGS="${CXXFLAGS_save}"
    OBJCFLAGS_save="${OBJCFLAGS_save} -finline-limit-30000"; OBJCFLAGS="${OBJCFLAGS_save}"
446
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
447

448 449 450 451 452 453 454 455 456 457 458 459 460 461 462
# XXX: do this with an M4 macro?
#dnl Check for various -W flags
#for flag in "" all unreachable-code conversion sign-compare disabled-optimization
#do
#    AC_CACHE_CHECK([if \$CC accepts -W${flag}],
#        [ac_cv_c_W${flag}],
#        [CFLAGS="-W${flag} ${CFLAGS_save}"
#         AC_TRY_COMPILE([],,ac_cv_c_W${flag}=yes, ac_cv_c_W${flag}=no)])
#    if test "x${ac_cv_c_W${flag}}" != "xno"; then
#        CFLAGS_save="-W${flag} ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
#        CXXFLAGS_save="-W${flag} ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
#        OBJCFLAGS_save="-W${flag} ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
#    fi
#done

463 464 465 466 467
AC_CACHE_CHECK([if \$CC accepts -Wall],
    [ac_cv_c_Wall],
    [CFLAGS="-Wall ${CFLAGS_save}"
     AC_TRY_COMPILE([],,ac_cv_c_Wall=yes, ac_cv_c_Wall=no)])

468 469 470 471 472
AC_CACHE_CHECK([if \$CC accepts -Wtraditional],
    [ac_cv_c_Wtraditional],
    [CFLAGS="-Wtraditional ${CFLAGS_save}"
     AC_TRY_COMPILE([],,ac_cv_c_Wtraditional=yes, ac_cv_c_Wtraditional=no)])

473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497
AC_CACHE_CHECK([if \$CC accepts -Wconversion],
    [ac_cv_c_Wconversion],
    [CFLAGS="-Wconversion ${CFLAGS_save}"
     AC_TRY_COMPILE([],,ac_cv_c_Wconversion=yes, ac_cv_c_Wconversion=no)])

AC_CACHE_CHECK([if \$CC accepts -Wunreachable-code],
    [ac_cv_c_Wunreachable_code],
    [CFLAGS="-Wunreachable-code ${CFLAGS_save}"
     AC_TRY_COMPILE([],,ac_cv_c_Wunreachable_code=yes, ac_cv_c_Wunreachable_code=no)])

AC_CACHE_CHECK([if \$CC accepts -Wsign-compare],
    [ac_cv_c_Wsign_compare],
    [CFLAGS="-Wsign-compare ${CFLAGS_save}"
     AC_TRY_COMPILE([],,ac_cv_c_Wsign_compare=yes, ac_cv_c_Wsign_compare=no)])

AC_CACHE_CHECK([if \$CC accepts -Wdisabled-optimization],
    [ac_cv_c_Wdisabled_optimization],
    [CFLAGS="-Wdisabled-optimization ${CFLAGS_save}"
     AC_TRY_COMPILE([],,ac_cv_c_Wdisabled_optimization=yes, ac_cv_c_Wdisabled_optimization=no)])

AC_CACHE_CHECK([if \$CC accepts -Winline],
    [ac_cv_c_Winline],
    [CFLAGS="-Winline ${CFLAGS_save}"
     AC_TRY_COMPILE([],,ac_cv_c_Winline=yes, ac_cv_c_Winline=no)])

498 499 500 501 502
if test "x${ac_cv_c_Wall}" != "xno"; then
    CFLAGS_save="-Wall ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
    CXXFLAGS_save="-Wall ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
    OBJCFLAGS_save="-Wall ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
fi
503 504 505 506 507 508 509

if test "x${ac_cv_c_Wtraditional}" != "xno"; then
    CFLAGS_save="-Wtraditional ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
    CXXFLAGS_save="-Wtraditional ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
    OBJCFLAGS_save="-Wtraditional ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
fi

510 511 512 513 514
if test "x${ac_cv_c_Wunreachable_code}" != "xno"; then
    CFLAGS_save="-Wunreachable-code ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
    CXXFLAGS_save="-Wunreachable-code ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
    OBJCFLAGS_save="-Wunreachable-code ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"

515 516 517 518 519 520 521 522 523 524 525
    dnl -Wunreachable-code means gcc-3.x, we can use -Wconversion and we can
    dnl activate -Winline for C++, it won't choke on system headers.
    if test "x${ac_cv_c_Wconversion}" != "xno"; then
        CFLAGS_save="-Wconversion ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
        CXXFLAGS_save="-Wconversion ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
        OBJCFLAGS_save="-Wconversion ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
    fi
    if test "x${ac_cv_c_Winline}" != "xno"; then
        CXXFLAGS_save="-Winline ${CXXFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
    fi

526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542
fi

if test "x${ac_cv_c_Wsign_compare}" != "xno"; then
    CFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
    CXXFLAGS_save="-Wsign-compare ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
    OBJCFLAGS_save="-Wsign-compare ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
fi

if test "x${ac_cv_c_Wdisabled_optimization}" != "xno"; then
    CFLAGS_save="-Wdisabled-optimization ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
    CXXFLAGS_save="-Wdisabled-optimization ${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
    OBJCFLAGS_save="-Wdisabled-optimization ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
fi

if test "x${ac_cv_c_Winline}" != "xno"; then
    CFLAGS_save="-Winline ${CFLAGS_save}"; CFLAGS="${CFLAGS_save}"
    OBJCFLAGS_save="-Winline ${OBJCFLAGS_save}"; OBJCFLAGS="${OBJCFLAGS_save}"
Sam Hocevar's avatar
 
Sam Hocevar committed
543 544 545 546
fi

dnl Check for -pipe
AC_CACHE_CHECK([if \$CC accepts -pipe],
547 548 549
    [ac_cv_c_pipe],
    [CFLAGS="${CFLAGS_save} -pipe"
     AC_TRY_COMPILE([],,ac_cv_c_pipe=yes, ac_cv_c_pipe=no)])
550
if test "x${ac_cv_c_pipe}" != "xno"; then
551 552 553
    CFLAGS_save="${CFLAGS_save} -pipe"; CFLAGS="${CFLAGS_save}"
    CXXFLAGS_save="${CXXFLAGS_save} -pipe"; CXXFLAGS="${CXXFLAGS_save}"
    OBJCFLAGS_save="${OBJCFLAGS_save} -pipe"; OBJCFLAGS="${OBJCFLAGS_save}"
Sam Hocevar's avatar
 
Sam Hocevar committed
554 555 556 557
fi

dnl Check for various optimization flags
AC_CACHE_CHECK([if \$CC accepts -O3],
558 559 560
    [ac_cv_c_o3],
    [CFLAGS="${CFLAGS_save} -O3"
     AC_TRY_COMPILE([],,ac_cv_c_o3=yes, ac_cv_c_o3=no)])
561
if test "x${ac_cv_c_o3}" != "xno"; then
562
    CFLAGS_OPTIM="${CFLAGS_OPTIM} -O3"
563
else
564 565 566 567 568 569 570 571 572 573 574 575 576 577
    AC_CACHE_CHECK([if \$CC accepts -O2],
        [ac_cv_c_o2],
        [CFLAGS="${CFLAGS_save} -O2"
         AC_TRY_COMPILE([],,ac_cv_c_o2=yes, ac_cv_c_o2=no)])
    if test "x${ac_cv_c_o2}" != "xno"; then
        CFLAGS_OPTIM="${CFLAGS_OPTIM} -O2"
    else
        AC_CACHE_CHECK([if \$CC accepts -O],
            [ac_cv_c_o],
            [CFLAGS="${CFLAGS_save} -O"
             AC_TRY_COMPILE([],,ac_cv_c_o=yes, ac_cv_c_o=no)])
        if test "x${ac_cv_c_o}" != "xno"; then
            CFLAGS_OPTIM="${CFLAGS_OPTIM} -O"
        fi
Sam Hocevar's avatar
 
Sam Hocevar committed
578 579 580 581 582
    fi
fi

dnl Check for -ffast-math
AC_CACHE_CHECK([if \$CC accepts -ffast-math],
583 584 585
    [ac_cv_c_fast_math],
    [CFLAGS="${CFLAGS_save} -ffast-math"
     AC_TRY_COMPILE([],,ac_cv_c_fast_math=yes, ac_cv_c_fast_math=no)])
586
if test "x${ac_cv_c_fast_math}" != "xno"; then
587
    CFLAGS_OPTIM="${CFLAGS_OPTIM} -ffast-math"
Sam Hocevar's avatar
 
Sam Hocevar committed
588 589 590 591
fi

dnl Check for -funroll-loops
AC_CACHE_CHECK([if \$CC accepts -funroll-loops],
592 593 594
    [ac_cv_c_unroll_loops],
    [CFLAGS="${CFLAGS_save} -funroll-loops"
     AC_TRY_COMPILE([],,ac_cv_c_unroll_loops=yes, ac_cv_c_unroll_loops=no)])
595
if test "x${ac_cv_c_unroll_loops}" != "xno"; then
596
    CFLAGS_OPTIM="${CFLAGS_OPTIM} -funroll-loops"
Sam Hocevar's avatar
 
Sam Hocevar committed
597 598 599 600
fi

dnl Check for -fomit-frame-pointer
AC_CACHE_CHECK([if \$CC accepts -fomit-frame-pointer],
601 602 603
    [ac_cv_c_omit_frame_pointer],
    [CFLAGS="${CFLAGS_save} -fomit-frame-pointer"
     AC_TRY_COMPILE([],,ac_cv_c_omit_frame_pointer=yes, ac_cv_c_omit_frame_pointer=no)])
604
if test "x${ac_cv_c_omit_frame_pointer}" != "xno"; then
605 606 607
    CFLAGS_OPTIM_NODEBUG="${CFLAGS_OPTIM_NODEBUG} -fomit-frame-pointer"
    # this plugin does not compile without -fomit-frame-pointer, damn gcc!
    CFLAGS_i420_yuy2_mmx="${CFLAGS_i420_yuy2_mmx} -fomit-frame-pointer"
Sam Hocevar's avatar
 
Sam Hocevar committed
608 609
fi

610 611 612 613 614 615
dnl Check for -mdynamic-no-pic
AC_CACHE_CHECK([if \$CC accepts -mdynamic-no-pic],
    [ac_cv_c_dynamic_no_pic],
    [CFLAGS="${CFLAGS_save} -mdynamic-no-pic"
     AC_TRY_COMPILE([],,ac_cv_c_dynamic_no_pic=yes, ac_cv_c_dynamic_no_pic=no)])
if test "x${ac_cv_c_dynamic_no_pic}" != "xno"; then
Christophe Massiot's avatar
Christophe Massiot committed
616 617
    CFLAGS_builtins="${CFLAGS_builtins} -mdynamic-no-pic"
    CFLAGS_libvlc="${CFLAGS_libvlc} -mdynamic-no-pic"
618 619
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
620
dnl Check for Darwin plugin linking flags
Christophe Massiot's avatar
Christophe Massiot committed
621
AC_CACHE_CHECK([if \$CC accepts -bundle -undefined error -lcc_dynamic],
622 623 624
    [ac_cv_ld_darwin],
    [CFLAGS="${CFLAGS_save} -bundle -undefined error -lcc_dynamic"
     AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
625
if test "x${ac_cv_ld_darwin}" != "xno"; then
626
    LDFLAGS_plugins="${LDFLAGS_plugins} -bundle -undefined error -lcc_dynamic"
627
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
628 629

dnl Check for standard plugin linking flags
630
AC_CACHE_CHECK([if \$CC accepts -shared],
631 632 633
    [ac_cv_ld_plugins],
    [CFLAGS="${CFLAGS_save} -shared"
     AC_TRY_COMPILE([],, ac_cv_ld_plugins=yes, ac_cv_ld_plugins=no)])
634
if test "x${ac_cv_ld_plugins}" != "xno"; then
635
    LDFLAGS_plugins="${LDFLAGS_plugins} -shared"
Sam Hocevar's avatar
 
Sam Hocevar committed
636
fi
637

638 639
dnl Check for variadic macros
AC_CACHE_CHECK([for variadic cpp macros],
640 641 642 643 644 645 646 647
    [ac_cv_cpp_variadic_macros],
    [CFLAGS="${CFLAGS_save}"
     AC_TRY_COMPILE(
         [#include <stdio.h>
          #define a(b,c...) printf(b,##c)],
         [a("foo");a("%s","bar");a("%s%s","baz","quux");],
         ac_cv_cpp_variadic_macros=yes,
         ac_cv_cpp_variadic_macros=no)])
648
if test "x${ac_cv_cpp_variadic_macros}" != "xno"; then
649
    AC_DEFINE(HAVE_VARIADIC_MACROS, 1, Support for variadic macros)
650 651
fi

652 653
dnl Checks for __attribute__(aligned()) directive
AC_CACHE_CHECK([__attribute__ ((aligned ())) support],
654 655 656 657 658 659 660 661 662
    [ac_cv_c_attribute_aligned],
    [ac_cv_c_attribute_aligned=0
        CFLAGS="${CFLAGS_save} -Werror"
    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
        CFLAGS="${CFLAGS_save}"])
663
if test "x${ac_cv_c_attribute_aligned}" != "x0"; then
664 665
    AC_DEFINE_UNQUOTED([ATTRIBUTE_ALIGNED_MAX],
        [${ac_cv_c_attribute_aligned}],[Maximum supported data alignment])
666 667
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
668 669 670
dnl
dnl  Check the CPU
dnl
671
case "x${target_cpu}" in
672 673 674 675 676 677 678 679 680 681 682 683
  x)
    ARCH=unknown
    ;;
  *)
    ARCH="${target_cpu}"
    ;;
esac

case "${ARCH}" in
  hppa64)
    CFLAGS_mpeg_video="${CFLAGS_mpeg_video} -ffunction-sections"
    ;;
Sam Hocevar's avatar
 
Sam Hocevar committed
684
esac
Sam Hocevar's avatar
 
Sam Hocevar committed
685 686 687 688

dnl
dnl  default modules
dnl
689
PLUGINS="${PLUGINS} dummy rc logger access_file memcpy"
690 691 692
PLUGINS="${PLUGINS} es audio mpeg_system ps ts"
PLUGINS="${PLUGINS} idct idctclassic motion mpeg_video spudec mpeg_audio"
#PLUGINS="${PLUGINS} a52old imdct downmix"
693
PLUGINS="${PLUGINS} lpcm a52"
694
PLUGINS="${PLUGINS} deinterlace invert adjust wall transform distort clone crop motionblur"
695
PLUGINS="${PLUGINS} float32tos16 float32tos8 float32tou16 float32tou8 a52tospdif fixed32tofloat32 fixed32tos16 s16tofloat32 s16tofloat32swab s8tofloat32 u8tofixed32 u8tofloat32"
696
PLUGINS="${PLUGINS} trivial_resampler ugly_resampler linear_resampler"
697
PLUGINS="${PLUGINS} trivial_channel_mixer"
Christophe Massiot's avatar
Christophe Massiot committed
698
PLUGINS="${PLUGINS} trivial_mixer spdif_mixer float32_mixer"
699 700 701
PLUGINS="${PLUGINS} aout_file"
#PLUGINS="${PLUGINS} scope"
PLUGINS="${PLUGINS} i420_rgb i420_yuy2 i422_yuy2 i420_ymga"
702
PLUGINS="${PLUGINS} id3 m3u"
703
PLUGINS="${PLUGINS} wav araw demuxdump demuxsub adpcm"
704
PLUGINS="${PLUGINS} access_udp access_http access_rtp ipv4 access_mms sap"
705

Sam Hocevar's avatar
 
Sam Hocevar committed
706 707 708
dnl
dnl  Accelerated modules
dnl
709 710 711 712 713
MMX_MODULES="memcpymmx idctmmx motionmmx i420_rgb_mmx i420_yuy2_mmx i422_yuy2_mmx i420_ymga_mmx"
MMXEXT_MODULES="memcpymmxext idctmmxext motionmmxext"
THREEDNOW_MODULES="memcpy3dn imdct3dn downmix3dn"
SSE_MODULES="imdctsse downmixsse"
ALTIVEC_MODULES="idctaltivec motionaltivec memcpyaltivec"
714

715 716
AC_CACHE_CHECK([if \$CC groks MMX inline assembly],
    [ac_cv_mmx_inline],
717
    [CFLAGS="${CFLAGS_save}"
Sam Hocevar's avatar
Sam Hocevar committed
718
     AC_TRY_COMPILE(,[void *p;asm volatile("packuswb %%mm1,%%mm2"::"r"(p));],
719
                    ac_cv_mmx_inline=yes, ac_cv_mmx_inline=no)])
720
if test "x${ac_cv_mmx_inline}" != "xno"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
721
  ACCEL_MODULES="${ACCEL_MODULES} ${MMX_MODULES}"
722
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
723

724 725
AC_CACHE_CHECK([if \$CC groks MMX EXT inline assembly],
    [ac_cv_mmxext_inline],
726
    [CFLAGS="${CFLAGS_save}"
Sam Hocevar's avatar
Sam Hocevar committed
727
     AC_TRY_COMPILE(,[void *p;asm volatile("maskmovq %%mm1,%%mm2"::"r"(p));],
728
                    ac_cv_mmxext_inline=yes, ac_cv_mmxext_inline=no)])
729
if test "x${ac_cv_mmxext_inline}" != "xno"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
730
  ACCEL_MODULES="${ACCEL_MODULES} ${MMXEXT_MODULES}"
731
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
732

733 734
AC_CACHE_CHECK([if \$CC groks 3D Now! inline assembly],
    [ac_cv_3dnow_inline],
735
    [CFLAGS="${CFLAGS_save}"
Sam Hocevar's avatar
Sam Hocevar committed
736
     AC_TRY_COMPILE(,[void *p;asm volatile("pfadd %%mm1,%%mm2"::"r"(p));],
737
                    ac_cv_3dnow_inline=yes, ac_cv_3dnow_inline=no)])
738
if test "x${ac_cv_3dnow_inline}" != "xno"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
739
  AC_DEFINE(CAN_COMPILE_3DNOW, 1, Define if \$CC groks 3D Now! inline assembly.)
Sam Hocevar's avatar
 
Sam Hocevar committed
740
  ACCEL_MODULES="${ACCEL_MODULES} ${THREEDNOW_MODULES}"
741
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
742

743 744
AC_CACHE_CHECK([if \$CC groks SSE inline assembly],
    [ac_cv_sse_inline],
745
    [CFLAGS="${CFLAGS_save}"
Sam Hocevar's avatar
Sam Hocevar committed
746
     AC_TRY_COMPILE(,[void *p;asm volatile("xorps %%xmm1,%%xmm2"::"r"(p));],
747
                    ac_cv_sse_inline=yes, ac_cv_sse_inline=no)])
748
if test "x${ac_cv_sse_inline}" != "xno" -a "x${SYS}" != "xmingw32"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
749
  AC_DEFINE(CAN_COMPILE_SSE, 1, Define if \$CC groks SSE inline assembly.)
Sam Hocevar's avatar
 
Sam Hocevar committed
750
  ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
751
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
752

Sam Hocevar's avatar
Sam Hocevar committed
753
# don't try to grok AltiVec with native mingw32 it doesn't work right now
Gildas Bazin's avatar
 
Gildas Bazin committed
754
# we should be able to remove this test with future versions of mingw32
755
if test "x${SYS}" != "xmingw32"; then
Sam Hocevar's avatar
Sam Hocevar committed
756
AC_CACHE_CHECK([if \$CC groks AltiVec inline assembly],
757
    [ac_cv_altivec_inline],
758
    [CFLAGS="${CFLAGS_save}"
Sam Hocevar's avatar
Sam Hocevar committed
759
     AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
760
         ac_cv_altivec_inline=yes,
761
         [CFLAGS="${CFLAGS_save} -Wa,-m7400"
Sam Hocevar's avatar
 
Sam Hocevar committed
762
          AC_TRY_COMPILE(,[asm volatile("vperm 0,1,2,3");],
763
            [ac_cv_altivec_inline="-Wa,-m7400"],
764
            ac_cv_altivec_inline=no)
765
         ])])
766
if test "x${ac_cv_altivec_inline}" != "xno"; then
Sam Hocevar's avatar
Sam Hocevar committed
767
  AC_DEFINE(CAN_COMPILE_ALTIVEC, 1, Define if \$CC groks AltiVec inline assembly.)
768
  if test "x${ac_cv_altivec_inline}" != "xyes"; then
769 770 771 772
    CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_altivec_inline}"
    CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_altivec_inline}"
    CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_altivec_inline}"
    CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_altivec_inline}"
773
  fi
774
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
775
fi
776

Sam Hocevar's avatar
Sam Hocevar committed
777
AC_CACHE_CHECK([if \$CC groks AltiVec C extensions],
778
    [ac_cv_c_altivec],
779
    [CFLAGS="${CFLAGS_save} -faltivec"
780
     # Darwin test
Sam Hocevar's avatar
 
Sam Hocevar committed
781
     AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
782 783
        ac_cv_c_altivec=-faltivec, [
        # Linux/PPC test
784
        CFLAGS="${CFLAGS_save} ${CFLAGS_idctaltivec} -fvec"
Sam Hocevar's avatar
 
Sam Hocevar committed
785
        AC_TRY_COMPILE(,[vec_mtvscr((vector unsigned int)(0));],
786 787
            [ac_cv_c_altivec="-fvec"], ac_cv_c_altivec=no)
        ])
788
     CFLAGS="${CFLAGS_save}"])
789
if test "x${ac_cv_c_altivec}" != "xno"; then
Sam Hocevar's avatar
Sam Hocevar committed
790
  AC_DEFINE(CAN_COMPILE_C_ALTIVEC, 1, Define if your compiler groks C AltiVec extensions.)
791 792 793 794
  CFLAGS_idctaltivec="${CFLAGS_idctaltivec} ${ac_cv_c_altivec}"
  CFLAGS_motionaltivec="${CFLAGS_motionaltivec} ${ac_cv_c_altivec}"
  CFLAGS_memcpyaltivec="${CFLAGS_memcpyaltivec} ${ac_cv_c_altivec}"
  CFLAGS_vlc="${CFLAGS_vlc} ${ac_cv_c_altivec}"
795
  ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
796 797 798 799
fi

AC_CACHE_CHECK([if linker needs -framework vecLib],
    [ac_cv_ld_altivec],
800
    [LDFLAGS="${LDFLAGS_vlc} -framework vecLib"
801
     AC_TRY_LINK([],,ac_cv_ld_altivec=yes,ac_cv_ld_altivec=no)
802
     LDFLAGS="${LDFLAGS_save}"
803
    ])
804
if test "x${ac_cv_ld_altivec}" != "xno"; then
805 806 807 808
  LDFLAGS_idctaltivec="${LDFLAGS_idctaltivec} -framework vecLib"
  LDFLAGS_motionaltivec="${LDFLAGS_motionaltivec} -framework vecLib"
  LDFLAGS_memcpyaltivec="${LDFLAGS_memcpyaltivec} -framework vecLib"
  LDFLAGS_vlc="${LDFLAGS_vlc} -framework vecLib"
809
fi
Gildas Bazin's avatar
 
Gildas Bazin committed
810
fi # end if mingw32
811

Sam Hocevar's avatar
 
Sam Hocevar committed
812 813 814
AC_ARG_WITH(,[])
AC_ARG_WITH(,[Optimization options:])

Sam Hocevar's avatar
 
Sam Hocevar committed
815
dnl
816
dnl  Special arch tuning
Sam Hocevar's avatar
 
Sam Hocevar committed
817
dnl
818
AC_ARG_WITH(tuning,
Sam Hocevar's avatar
 
Sam Hocevar committed
819
[  --with-tuning=ARCH      enable special tuning for an architecture
820
                          (default i686 on IA-32 and 750 on PPC)])
821
if test "x${with_tuning}" != "x"; then
822 823 824 825 826
    if test "x${target_cpu}" = "xpowerpc"; then
        CFLAGS_TUNING="-mtune=${with_tuning}"
    else
        CFLAGS_TUNING="-mcpu=${with_tuning}"
    fi
827
else
828
    if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xi486" -o "x${target_cpu}" = "xi386"; then CFLAGS_TUNING="-mcpu=pentiumpro"
829
    else
830
        if test "x${target_cpu}" = "xpowerpc"; then CFLAGS_TUNING="-mtune=750"; fi
831 832
    fi
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
833 834

dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
835
dnl  x86 accelerations
Sam Hocevar's avatar
 
Sam Hocevar committed
836
dnl
837
if test "x${target_cpu}" = "xi686" -o "x${target_cpu}" = "xi586" -o "x${target_cpu}" = "xx86" -o "x${target_cpu}" = "xi386"
Sam Hocevar's avatar
 
Sam Hocevar committed
838 839
then
    ARCH="${ARCH} mmx"
Sam Hocevar's avatar
Sam Hocevar committed
840
    PLUGINS="${PLUGINS} ${ACCEL_MODULES}"
Sam Hocevar's avatar
 
Sam Hocevar committed
841
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
842

Sam Hocevar's avatar
 
Sam Hocevar committed
843 844 845 846
dnl
dnl  Enable/disable optimizations
dnl
AC_ARG_ENABLE(optimizations,
847 848
[  --disable-optimizations disable compiler optimizations (default enabled)])
AM_CONDITIONAL(OPTIM, test "x${enable_optimizations}" != "xno")
Sam Hocevar's avatar
 
Sam Hocevar committed
849

Sam Hocevar's avatar
 
Sam Hocevar committed
850 851 852
dnl
dnl  AltiVec acceleration
dnl
853
AC_ARG_ENABLE(altivec,
Sam Hocevar's avatar
Sam Hocevar committed
854
[  --disable-altivec       disable AltiVec optimizations (default enabled on PPC)],
855
[ if test "x${enable_altivec}" = "xyes"; then ARCH="${ARCH} altivec";
856
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
857
[ if test "x${target_cpu}" = "xpowerpc"; then ARCH="${ARCH} altivec";
858
    BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
859 860 861 862

dnl
dnl  Debugging mode
dnl
863
AC_ARG_ENABLE(debug,
864 865
[  --enable-debug          debug mode (default disabled)])
AM_CONDITIONAL(DEBUG, test "x${enable_debug}" = "xyes")
Sam Hocevar's avatar
 
Sam Hocevar committed
866

Sam Hocevar's avatar
 
Sam Hocevar committed
867
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
868
dnl  Enable release-specific flags
Sam Hocevar's avatar
 
Sam Hocevar committed
869
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
870
AC_ARG_ENABLE(release,
871 872
[  --enable-release        activate extra optimizations (default disabled)])
AM_CONDITIONAL(RELEASE, test "x${enable_release}" = "xyes")
Sam Hocevar's avatar
 
Sam Hocevar committed
873

Sam Hocevar's avatar
 
Sam Hocevar committed
874
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
875
dnl  Input plugins
Sam Hocevar's avatar
 
Sam Hocevar committed
876 877
dnl

Sam Hocevar's avatar
 
Sam Hocevar committed
878
AC_ARG_WITH(,[Input plugins:])
Sam Hocevar's avatar
 
Sam Hocevar committed
879 880

dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
881 882 883 884
dnl  DVD module: optionally check for installed libdvdcss
dnl
AC_ARG_ENABLE(dvd,
[  --enable-dvd            DVD input module (default enabled)])
885
if test "x${enable_dvd}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
886
then
887
  AC_ARG_WITH(dvdcss,
Sam Hocevar's avatar
 
Sam Hocevar committed
888
  [    --with-dvdcss=PATH    libdvdcss headers and libraries])
889
  AC_ARG_WITH(dvdcss-tree,
Sam Hocevar's avatar
 
Sam Hocevar committed
890
  [    --with-dvdcss-tree=PATH libdvdcss tree for static linking])
891
  case "x${with_dvdcss}" in
Sam Hocevar's avatar
 
Sam Hocevar committed
892
  x|xyes)
893
    if test "x${with_dvdcss_tree}" = x
Sam Hocevar's avatar
 
Sam Hocevar committed
894 895
    then
      AC_CHECK_HEADERS(dvdcss/dvdcss.h,
896
        [ PLUGINS="${PLUGINS} dvd"
897 898
          LDFLAGS_dvd="${LDFLAGS_dvd} -ldvdcss"
          LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -ldvdcss" ],
Sam Hocevar's avatar
 
Sam Hocevar committed
899 900 901 902 903
        [ AC_MSG_WARN([libdvdcss is no longer provided with vlc; please get libdvdcss from http://www.videolan.org/libdvdcss/ and build it. Then either use --with-dvdcss=<path/where/libdvdcss/was/installed> for dynamic linking (recommended under Unix) or --with-dvdcss-tree=<path/where/libdvdcss/was/built> for static linking (recommended under BeOS, Windows, MacOS X). Alternatively you can use --disable-dvd to disable the DVD plugin.])
          AC_MSG_ERROR([cannot find libdvdcss headers]) ])
    else
      AC_MSG_CHECKING(for libdvdcss.a in ${with_dvdcss_tree})
      real_dvdcss_tree="`cd ${with_dvdcss_tree} 2>/dev/null && pwd`"
904
      if test "x${real_dvdcss_tree}" = "x"
Sam Hocevar's avatar
 
Sam Hocevar committed
905 906 907 908 909 910 911 912 913
      then
        dnl  The given directory can't be found
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot cd to ${with_dvdcss_tree}])
      fi
      if test -f "${real_dvdcss_tree}/src/.libs/libdvdcss.a"
      then
        dnl  Use a custom libdvdcss
        AC_MSG_RESULT(${real_dvdcss_tree}/src/.libs/libdvdcss.a)
914 915
        BUILTINS="${BUILTINS} dvd"
        LDFLAGS_dvd="${LDFLAGS_dvd} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
916
        LDFLAGS_dvdcss="${LDFLAGS_dvdcss} ${real_dvdcss_tree}/src/.libs/libdvdcss.a"
917
        CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${real_dvdcss_tree}/src"
Sam Hocevar's avatar
 
Sam Hocevar committed
918 919 920 921 922 923
      else
        dnl  The given libdvdcss wasn't built
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot find ${real_dvdcss_tree}/src/.libs/libdvdcss.a, make sure you compiled libdvdcss in ${with_dvdcss_tree}])
      fi
    fi
Sam Hocevar's avatar
 
Sam Hocevar committed
924 925
  ;;
  xno)
Sam Hocevar's avatar
 
Sam Hocevar committed
926
    dnl  Compile without dvdcss (dlopen version, works only under Linux)
927 928 929
    PLUGINS="${PLUGINS} dvd"
    CPPFLAGS_dvd="${CPPFLAGS_dvd} -DGOD_DAMN_DMCA"
    LDFLAGS_dvd="${LDFLAGS_dvd} -ldl"
Sam Hocevar's avatar
 
Sam Hocevar committed
930 931
  ;;
  *)
Sam Hocevar's avatar
 
Sam Hocevar committed
932 933
    AC_MSG_CHECKING(for dvdcss headers in ${with_dvdcss})
    if test -f ${with_dvdcss}/include/dvdcss/dvdcss.h
Sam Hocevar's avatar
 
Sam Hocevar committed
934
    then
Sam Hocevar's avatar
 
Sam Hocevar committed
935
      dnl  Use ${with_dvdcss}/include/dvdcss/dvdcss.h
Sam Hocevar's avatar
 
Sam Hocevar committed
936
      AC_MSG_RESULT(yes)
937 938
      PLUGINS="${PLUGINS} dvd"
      LDFLAGS_dvd="${LDFLAGS_dvd} -L${with_dvdcss}/lib -ldvdcss"
939
      LDFLAGS_dvdcss="${LDFLAGS_dvdcss} -L${with_dvdcss}/lib -ldvdcss"
940
      CPPFLAGS_dvd="${CPPFLAGS_dvd} -I${with_dvdcss}/include"
Sam Hocevar's avatar
 
Sam Hocevar committed
941
    else
Sam Hocevar's avatar
 
Sam Hocevar committed
942
      dnl  No libdvdcss could be found, sorry
Sam Hocevar's avatar
 
Sam Hocevar committed
943
      AC_MSG_RESULT(no)
Sam Hocevar's avatar
 
Sam Hocevar committed
944
      AC_MSG_ERROR([cannot find ${with_dvdcss}/include/dvdcss/dvdcss.h])
Sam Hocevar's avatar
 
Sam Hocevar committed
945 946 947 948
    fi
  ;;
  esac
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
949

Stéphane Borel's avatar
Stéphane Borel committed
950
dnl
951
dnl dvdread module: check for libdvdread
Stéphane Borel's avatar
Stéphane Borel committed
952
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
953 954
AC_ARG_ENABLE(dvdread,
[  --enable-dvdread        dvdread input module (default disabled)])
955
if test "x${enable_dvdread}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
956
then
957
  AC_ARG_WITH(dvdread,
958 959 960 961
  [    --with-dvdread=PATH    libdvdread headers and libraries])
  AC_ARG_WITH(dvdread-tree,
  [    --with-dvdread-tree=PATH libdvdread tree for static linking])
  if test "x${with_dvdread}" = x
Sam Hocevar's avatar
 
Sam Hocevar committed
962
  then
963
    if test "x${with_dvdread_tree}" = x
964
    then
Gildas Bazin's avatar
 
Gildas Bazin committed
965
      AC_CHECK_HEADERS(dvdread/dvd_reader.h,
966 967 968 969 970 971 972 973 974 975 976
        [ PLUGINS="${PLUGINS} dvdread"
          LDFLAGS_dvdread="${LDFLAGS_dvdread} -ldvdread" ],
        [ if test "x${enable_dvdread}" != "x"
          then
            AC_MSG_WARN([Please get libdvdread from http://www.dtek.chalmers.se/groups/dvd/downloads.shtml])
            AC_MSG_ERROR([cannot find libdvdread headers])
          fi ])
    else
      AC_MSG_CHECKING(for libdvdread.a in ${with_dvdread_tree})
      real_dvdread_tree="`cd ${with_dvdread_tree} 2>/dev/null && pwd`"
      if test "x${real_dvdread_tree}" = "x"
Sam Hocevar's avatar
 
Sam Hocevar committed
977
      then
978 979 980 981 982 983 984 985 986 987 988
        dnl  The given directory can't be found
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot cd to ${with_dvdread_tree}])
      fi
      if test -f "${real_dvdread_tree}/dvdread/.libs/libdvdread.a"
      then
        dnl  Use a custom libdvdread
        AC_MSG_RESULT(${real_dvdread_tree}/dvdread/.libs/libdvdread.a)
        BUILTINS="${BUILTINS} dvdread"
        LDFLAGS_dvdread="${LDFLAGS_dvdread} ${real_dvdread_tree}/dvdread/.libs/libdvdread.a"
        CPPFLAGS_dvdread="${CPPFLAGS_dvdread} -I${real_dvdread_tree}"
Sam Hocevar's avatar
 
Sam Hocevar committed
989
      else
990 991 992
        dnl  The given libdvdread wasn't built
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot find ${real_dvdread_tree}/dvdread/.libs/libdvdread.a, make sure you compiled libdvdread in ${with_dvdread_tree}])
Sam Hocevar's avatar
 
Sam Hocevar committed
993
      fi
Sam Hocevar's avatar
 
Sam Hocevar committed
994
    fi
995 996
  else
    AC_MSG_CHECKING(for dvdread headers in ${with_dvdread})
Gildas Bazin's avatar
 
Gildas Bazin committed
997
    if test -f ${with_dvdread}/include/dvdread/dvd_reader.h
998
    then
Gildas Bazin's avatar
 
Gildas Bazin committed
999
      dnl  Use ${with_dvdread}/include/dvdread/dvd_reader.h
1000 1001 1002 1003 1004 1005 1006
      AC_MSG_RESULT(yes)
      PLUGINS="${PLUGINS} dvdread"
      LDFLAGS_dvdread="${LDFLAGS_dvdread} -L${with_dvdread}/lib -ldvdread"
      CPPFLAGS_dvdread="${CPPFLAGS_dvdread} -I${with_dvdread}/include"
    else
      dnl  No libdvdread could be found, sorry
      AC_MSG_RESULT(no)
Gildas Bazin's avatar
 
Gildas Bazin committed
1007
      AC_MSG_ERROR([cannot find ${with_dvdread}/include/dvdread/dvd_reader.h])
1008 1009
    fi
  fi
1010 1011 1012 1013 1014 1015 1016
fi

dnl
dnl dvdplay module: check for libdvdplay
dnl
AC_ARG_ENABLE(dvdplay,
[  --enable-dvdplay        dvdplay input module (default disabled)])
1017
if test "x${enable_dvdplay}" != "xno"
1018
then
1019
  AC_ARG_WITH(dvdplay,
1020 1021 1022
  [    --with-dvdplay=PATH    libdvdplay headers and libraries])
  AC_ARG_WITH(dvdplay-tree,
  [    --with-dvdplay-tree=PATH libdvdplay tree for static linking])
1023
  if test "x${with_dvdplay}" = x
1024
  then
1025
    if test "x${with_dvdplay_tree}" = x
1026
    then
1027 1028 1029
      AC_CHECK_HEADERS(dvdplay/dvdplay.h,
        [ PLUGINS="${PLUGINS} dvdplay"
          LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${LDFLAGS_dvd} ${LDFLAGS_dvdread} -ldvdplay"
1030
          CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_dvdread}" ],
1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045
        [ if test "x${enable_dvdplay}" != "x"
          then
            AC_MSG_WARN([Please get libdvdplay from http://www.videolan.org/.])
            AC_MSG_ERROR([cannot find libdvdplay headers])
          fi ])
    else
      AC_MSG_CHECKING(for libdvdplay.a in ${with_dvdplay_tree})
      real_dvdplay_tree="`cd ${with_dvdplay_tree} 2>/dev/null && pwd`"
      if test "x${real_dvdplay_tree}" = "x"
      then
        dnl  The given directory can't be found
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot cd to ${with_dvdplay_tree}])
      fi
      if test -f "${real_dvdplay_tree}/src/.libs/libdvdplay.a"
1046
      then
1047 1048 1049 1050 1051
        dnl  Use a custom libdvdplay
        AC_MSG_RESULT(${real_dvdplay_tree}/src/.libs/libdvdplay.a)
        BUILTINS="${BUILTINS} dvdplay"
        LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${LDFLAGS_dvd} ${LDFLAGS_dvdread} ${real_dvdplay_tree}/src/.libs/libdvdplay.a"
        CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_dvdread} -I${real_dvdplay_tree}/src"
1052
      else
1053 1054 1055
        dnl  The given libdvdplay wasn't built
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot find ${real_dvdplay_tree}/src/.libs/libdvdplay.a, make sure you compiled libdvdplay in ${with_dvdplay_tree}])
1056 1057
      fi
    fi
1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072
  else
    AC_MSG_CHECKING(for dvdplay headers in ${with_dvdplay})
    if test -f ${with_dvdplay}/include/dvdplay/dvdplay.h
    then
      dnl  Use ${with_dvdplay}/include/dvdplay/dvdplay.h
      AC_MSG_RESULT(yes)
      PLUGINS="${PLUGINS} dvdplay"
      LDFLAGS_dvdplay="${LDFLAGS_dvdplay} ${LDFLAGS_dvd} ${LDFLAGS_dvdread} -L${with_dvdplay}/lib -ldvdplay"
      CPPFLAGS_dvdplay="${CPPFLAGS_dvdplay} ${CPPFLAGS_dvdread} -I${with_dvdplay}/include"
    else
      dnl  No libdvdplay could be found, sorry
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${with_dvdplay}/include/dvdplay/dvdplay.h])
    fi
  fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1073
fi
Stéphane Borel's avatar
Stéphane Borel committed
1074

1075 1076 1077 1078
dnl
dnl  libdvbpsi ts demux
dnl
AC_ARG_ENABLE(dvbpsi,
Gildas Bazin's avatar
 
Gildas Bazin committed
1079
[  --enable-dvbpsi         dvbpsi ts demux module (default enabled)])
1080
if test "x${enable_dvbpsi}" != "xno"
1081
then
1082
  AC_ARG_WITH(dvbpsi,
1083
  [    --with-dvbpsi=PATH    libdvbpsi headers and libraries])
1084 1085
  AC_ARG_WITH(dvbpsi,
  [    --with-dvbpsi-tree=PATH libdvbpsi tree for static linking])
1086
  case "x${with_dvbpsi}" in
1087
  x|xyes)
1088
    if test "x${with_dvbpsi_tree}" = "x"
1089
    then
Sam Hocevar's avatar
Sam Hocevar committed
1090
      AC_CHECK_HEADERS(dvbpsi/dr.h,
1091
        [ PLUGINS="${PLUGINS} ts_dvbpsi"
Gildas Bazin's avatar
 
Gildas Bazin committed
1092
          LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} -ldvbpsi" ],
1093
        [  AC_MSG_WARN([cannot find libdvbpsi headers]) ],
Gildas Bazin's avatar
 
Gildas Bazin committed
1094 1095 1096 1097 1098
        [#include <stdint.h>
#include <dvbpsi/dvbpsi.h>
#include <dvbpsi/descriptor.h>
#include <dvbpsi/pat.h>
#include <dvbpsi/pmt.h>])
1099 1100 1101
    else
      AC_MSG_CHECKING(for libdvbpsi.a in ${with_dvbpsi_tree})
      real_dvbpsi_tree="`cd ${with_dvbpsi_tree} 2>/dev/null && pwd`"
1102
      if test "x${real_dvbpsi_tree}" = "x"
1103 1104 1105 1106 1107 1108 1109 1110 1111
      then
        dnl  The given directory can't be found
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot cd to ${with_dvbpsi_tree}])
      fi
      if test -f "${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
      then
        dnl  Use a custom libdvbpsi
        AC_MSG_RESULT(${real_dvbpsi_tree}/src/.libs/libdvbpsi.a)
1112 1113 1114
        BUILTINS="${BUILTINS} ts_dvbpsi"
        LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a"
        CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} -I${real_dvbpsi_tree}/src"
1115 1116 1117 1118 1119
      else
        dnl  The given libdvbpsi wasn't built
        AC_MSG_RESULT(no)
        AC_MSG_ERROR([cannot find ${real_dvbpsi_tree}/src/.libs/libdvbpsi.a, make sure you compiled libdvbpsi in ${with_dvbpsi_tree}])
      fi
1120
    fi
1121 1122
  ;;
  xno)
1123
    dnl  Compile without dvbpsi
1124 1125 1126
  ;;
  *)
    AC_MSG_CHECKING(for dvbpsi headers in ${with_dvbpsi})
1127
    if test "x${with_dvbpsi}" = "x"
1128
    then
1129 1130
      LDFLAGS_test=""
      CPPFLAGS_test=""
1131
    else
1132 1133
      LDFLAGS_test="-L${with_dvbpsi}/lib"
      CPPFLAGS_test="-I${with_dvbpsi}/include"
1134
    fi
1135
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1136
    AC_CHECK_HEADER([dvbpsi/dr.h],[
1137 1138 1139
      PLUGINS="${PLUGINS} ts_dvbpsi"
      LDFLAGS_ts_dvbpsi="${LDFLAGS_ts_dvbpsi} ${LDFLAGS_test} -ldvbpsi"
      CPPFLAGS_ts_dvbpsi="${CPPFLAGS_ts_dvbpsi} ${CPPFLAGS_test}"
1140
      ],[
1141
      if test "x${enable_dvbpsi}" != "x"
1142 1143 1144 1145
      then
        AC_MSG_ERROR([Could not find libdvbpsi on your system: you may get it from www.videolan.org, you'll need at least version 0.1.1])
      fi
    ])
1146
    CPPFLAGS="${CPPFLAGS_save}"
1147 1148
  ;;
  esac
1149
fi
1150

1151 1152 1153 1154 1155 1156 1157 1158
dnl
dnl  Video4Linux plugin
dnl
AC_ARG_ENABLE(v4l,
  [  --enable-v4l            Video4Linux input support (default disabled)])
if test "x${enable_v4l}" = "xyes"
then
  AC_CHECK_HEADERS(libv4l/v4l.h, [
1159
    PLUGINS="${PLUGINS} v4l"
1160 1161 1162
   ],[])
fi

1163
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1164
dnl  VCD module
1165 1166
dnl
AC_ARG_ENABLE(vcd,
Gildas Bazin's avatar
 
Gildas Bazin committed
1167
  [  --enable-vcd            VCD support for Linux, FreeBSD, MacOS X and Win32 (default enabled)])
1168

1169
if test "x${enable_vcd}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
1170 1171
then
  AC_EGREP_HEADER(cdrom_msf0,linux/cdrom.h,[
1172
    PLUGINS="${PLUGINS} vcd"
Sam Hocevar's avatar
 
Sam Hocevar committed
1173
  ])
1174

1175 1176 1177 1178 1179
  AC_EGREP_HEADER(scsireq,sys/scsiio.h,[
    PLUGINS="${PLUGINS} vcd"
    AC_DEFINE(HAVE_SCSIREQ_IN_SYS_SCSIIO_H, 1, For NetBSD VCD support)
  ])

1180
  AC_EGREP_HEADER(ioc_toc_header ,sys/cdio.h,[
1181
    PLUGINS="${PLUGINS} vcd"
1182 1183
    AC_DEFINE(HAVE_IOC_TOC_HEADER_IN_SYS_CDIO_H, 1, For FreeBSD VCD support)
  ])
1184

Gildas Bazin's avatar
 
Gildas Bazin committed
1185
  if test "x${SYS}" = "xbsdi" -o "x${SYS}" = "xmingw32"
Sam Hocevar's avatar
 
Sam Hocevar committed
1186
  then
1187
    PLUGINS="${PLUGINS} vcd"
Sam Hocevar's avatar
 
Sam Hocevar committed
1188
  fi
1189

Sam Hocevar's avatar
 
Sam Hocevar committed
1190 1191
  if test "x${SYS}" = "xdarwin"
  then
1192
    PLUGINS="${PLUGINS} vcd"
1193
    LDFLAGS_vcd="${LDFLAGS_vcd} -framework IOKit -framework CoreFoundation"
Sam Hocevar's avatar
 
Sam Hocevar committed
1194
  fi
1195 1196
fi

Johan Bilien's avatar
Johan Bilien committed
1197 1198 1199 1200
dnl
dnl  Satellite input module
dnl
AC_ARG_ENABLE(satellite,
Sam Hocevar's avatar
 
Sam Hocevar committed
1201
  [  --enable-satellite      satellite card support (default disabled)],
1202
  [ if test "x${enable_satellite}" = "xyes"
Johan Bilien's avatar
Johan Bilien committed
1203
    then
1204
      PLUGINS="${PLUGINS} satellite"
Johan Bilien's avatar
Johan Bilien committed
1205 1206
    fi])

1207
dnl
1208
dnl  ipv6 plugin - not for QNX yet
1209
dnl
1210
if test "x${SYS}" != "xnto" && test "x${SYS}" != "xmingw32"
1211
then
1212 1213
  have_ipv6=false
  AC_CHECK_FUNC(inet_pton,[have_ipv6=:],[
1214
    AC_CHECK_LIB(resolv,inet_pton,
1215 1216
      [have_ipv6=:
       LDFLAGS_ipv6="${LDFLAGS_ipv6} -lresolv"])
1217
  ])
1218 1219
  AC_MSG_CHECKING(for sockaddr_in6 in netinet/in.h)
  AC_EGREP_HEADER(sockaddr_in6,netinet/in.h,
1220 1221 1222
    [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no); have_ipv6=false])
  if ${have_ipv6}; then
    PLUGINS="${PLUGINS} ipv6"
1223
  fi
1224
fi
1225
if test "x${SYS}" = "xmingw32"
Gildas Bazin's avatar
 
Gildas Bazin committed
1226 1227 1228
then
  AC_MSG_CHECKING(for getaddrinfo in ws2tcpip.h)
  AC_EGREP_HEADER(addrinfo,ws2tcpip.h,[AC_MSG_RESULT(yes)
1229
    PLUGINS="${PLUGINS} ipv6"],[AC_MSG_RESULT(no)])
Gildas Bazin's avatar
 
Gildas Bazin committed
1230
fi
1231

1232 1233 1234 1235 1236
dnl
dnl  AVI demux plugin
dnl
AC_ARG_ENABLE(avi,
  [  --enable-avi            AVI demux module (default enabled)])
1237
if test "x${enable_avi}" != "xno"
1238
then
1239
  PLUGINS="${PLUGINS} avi"
1240 1241
fi

1242 1243 1244 1245 1246 1247 1248 1249 1250 1251
dnl
dnl  ASF demux plugin
dnl
AC_ARG_ENABLE(asf,
  [  --enable-asf            ASF demux module (default enabled)])
if test "x${enable_asf}" != "xno"
then
  PLUGINS="${PLUGINS} asf"
fi

1252 1253 1254 1255 1256 1257 1258
dnl
dnl  AAC demux plugin
dnl
AC_ARG_ENABLE(aac,
  [  --enable-aac            AAC demux module (default enabled)])
if test "x${enable_aac}" != "xno"
then
1259
  PLUGINS="${PLUGINS} aac"
1260 1261
fi

Gildas Bazin's avatar
 
Gildas Bazin committed
1262 1263 1264 1265 1266 1267 1268 1269
dnl
dnl  ogg plugin
dnl
AC_ARG_ENABLE(ogg,
  [  --enable-ogg            Ogg demux support (default enabled)])
if test "x${enable_ogg}" != "xno"
then
  AC_CHECK_HEADERS(ogg/ogg.h, [
Gildas Bazin's avatar
 
Gildas Bazin committed
1270 1271 1272 1273 1274
    AC_CHECK_LIB( ogg, oggpack_read, [
      PLUGINS="${PLUGINS} ogg"
      LDFLAGS_ogg="${LDFLAGS_ogg} -logg"
      AC_CHECK_LIB( ogg, oggpackB_read, [
        CPPFLAGS_ogg="${CPPFLAGS_ogg} -DHAVE_OGGPACKB"])])
Gildas Bazin's avatar
 
Gildas Bazin committed
1275 1276 1277
   ],[])
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
1278
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1279
dnl  Codec plugins
Sam Hocevar's avatar
 
Sam Hocevar committed
1280
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1281

Sam Hocevar's avatar
 
Sam Hocevar committed
1282
AC_ARG_WITH(,[Codec plugins:])
Sam Hocevar's avatar
 
Sam Hocevar committed
1283

1284
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1285
dnl  mad plugin
1286
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1287 1288
AC_ARG_ENABLE(mad,
  [  --enable-mad            libmad module (default disabled)])
1289
if test "x${enable_mad}" = "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
1290 1291
then
  AC_ARG_WITH(mad,
Gildas Bazin's avatar
 
Gildas Bazin committed
1292
    [    --with-mad=PATH       path to libmad],[],[])
1293
  if test "x${with_mad}" != "xno" -a "x${with_mad}" != "x"
Gildas Bazin's avatar
 
Gildas Bazin committed
1294
  then
1295 1296
    CPPFLAGS_mad="${CPPFLAGS_mad} -I${with_mad}/include"
    LDFLAGS_mad="${LDFLAGS_mad} -L${with_mad}/lib"
Gildas Bazin's avatar
 
Gildas Bazin committed
1297 1298 1299 1300
  fi

  AC_ARG_WITH(mad-tree,
    [    --with-mad-tree=PATH  mad tree for static linking],[],[])
1301
  if test "x${with_mad_tree}" != "xno" -a "x${with_mad_tree}" != "x"
Gildas Bazin's avatar
 
Gildas Bazin committed
1302 1303
  then
    real_mad_tree="`cd ${with_mad_tree} 2>/dev/null && pwd`"
1304
    if test "x${real_mad_tree}" = "x"
Gildas Bazin's avatar
 
Gildas Bazin committed
1305 1306 1307 1308 1309 1310 1311 1312 1313 1314
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([${with_mad_tree} directory doesn't exist])
    fi
    dnl  Use a custom libmad
    AC_MSG_CHECKING(for mad.h in ${real_mad_tree}/libmad)
    if test -f ${real_mad_tree}/libmad/mad.h
    then
      AC_MSG_RESULT(yes)
1315 1316 1317
      CPPFLAGS_mad="${CPPFLAGS_mad} -I${real_mad_tree}/libmad"
      LDFLAGS_mad="${LDFLAGS_mad} -L${real_mad_tree}/libmad/.libs"
      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
Gildas Bazin's avatar
 
Gildas Bazin committed
1318
      AC_CHECK_LIB(mad, mad_bit_init, [
1319 1320
        BUILTINS="${BUILTINS} mad"
        LDFLAGS_mad="${LDFLAGS_mad} -lmad"
Gildas Bazin's avatar
 
Gildas Bazin committed
1321 1322
        ],[ AC_MSG_ERROR([the specified tree hasn't been compiled ])
      ],[])
1323
      LDFLAGS="${LDFLAGS_save}"
Gildas Bazin's avatar
 
Gildas Bazin committed
1324 1325 1326 1327 1328
    else
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([the specified tree doesn't have mad.h])
    fi
  else
1329 1330
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_mad}"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_mad}"
Gildas Bazin's avatar
 
Gildas Bazin committed
1331 1332
    AC_CHECK_HEADERS(mad.h, ,
      [ AC_MSG_ERROR([Cannot find development headers for libmad...]) ])
1333
    AC_CHECK_LIB(mad, mad_bit_init, [
1334 1335
      PLUGINS="${PLUGINS} mad"
      LDFLAGS_mad="${LDFLAGS_mad} -lmad" ],
Gildas Bazin's avatar
 
Gildas Bazin committed
1336
      [ AC_MSG_ERROR([Cannot find libmad library...]) ])
1337 1338
    CPPFLAGS="${CPPFLAGS_save}"
    LDFLAGS="${LDFLAGS_save}"
Gildas Bazin's avatar
 
Gildas Bazin committed
1339
  fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1340
fi
1341

1342 1343 1344
dnl
dnl   libid3tag support
dnl
1345
AC_CHECK_HEADERS(id3tag.h, [
1346 1347 1348
  LDFLAGS_id3tag="${LDFLAGS_id3tag} -lz -lid3tag"
  PLUGINS="${PLUGINS} id3tag"])

1349 1350 1351 1352 1353
dnl
dnl  ffmpeg decoder plugin
dnl
AC_ARG_ENABLE(ffmpeg,
[  --enable-ffmpeg         ffmpeg codec (default disabled)])
1354
if test "x${enable_ffmpeg}" = "xyes"
1355
then
1356 1357
  AC_ARG_WITH(ffmpeg,
    [    --with-ffmpeg=PATH    path to ffmpeg installation],[],[])
1358
  if test "x${with_ffmpeg}" != "xno" -a "x${with_ffmpeg}" != "x"
1359
  then
1360 1361
    CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${with_ffmpeg}/include/libffmpeg"
    LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -L${with_ffmpeg}/lib"
1362 1363
  fi

1364
  dnl Add postprocessing modules
1365
  PLUGINS="${PLUGINS} postprocessing_c"
1366
  if test "x${ac_cv_mmx_inline}" != "xno"; then
1367
    PLUGINS="${PLUGINS} postprocessing_mmx"
1368 1369 1370
  fi

  if test "x${ac_cv_mmxext_inline}" != "xno"; then
1371
    PLUGINS="${PLUGINS} postprocessing_mmxext"
1372 1373
  fi

1374
  AC_ARG_WITH(ffmpeg-tree,
1375
  [    --with-ffmpeg-tree=PATH ffmpeg tree for static linking])
1376
  if test "x${with_ffmpeg_tree}" != "x"
1377 1378 1379
  then
    AC_MSG_CHECKING(for libavcodec.a in ${with_ffmpeg_tree})
    real_ffmpeg_tree="`cd ${with_ffmpeg_tree} 2>/dev/null && pwd`"
1380
    if test "x${real_ffmpeg_tree}" = x
1381 1382 1383 1384 1385 1386 1387 1388 1389
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_ffmpeg_tree}])
    fi
    if test -f "${real_ffmpeg_tree}/libavcodec/libavcodec.a"
    then
      dnl  Use a custom libffmpeg
      AC_MSG_RESULT(${real_ffmpeg_tree}/libavcodec/libavcodec.a)
1390 1391 1392
      BUILTINS="${BUILTINS} ffmpeg"
      LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} ${real_ffmpeg_tree}/libavcodec/libavcodec.a"
      CPPFLAGS_ffmpeg="${CPPFLAGS_ffmpeg} -I${real_ffmpeg_tree}/libavcodec"
1393 1394 1395 1396 1397
    else
      dnl  The given libavcodec wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_ffmpeg_tree}/libavcodec/libavcodec.a, make sure you compiled libavcodec in ${with_ffmpeg_tree}])
    fi
1398
  else
1399 1400
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_ffmpeg}"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_ffmpeg}"
1401
    AC_CHECK_LIB(avcodec, avcodec_init, [
1402 1403
      BUILTINS="${BUILTINS} ffmpeg"
      LDFLAGS_ffmpeg="${LDFLAGS_ffmpeg} -lavcodec" ],
1404
      [ AC_MSG_ERROR([Cannot find libavcodec library...]) ])
1405 1406
    LDFLAGS="${LDFLAGS_save}"
    CPPFLAGS="${CPPFLAGS_save}"
1407 1408 1409
  fi
fi

1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420
dnl
dnl  faad decoder plugin
dnl
AC_ARG_ENABLE(faad,
[  --enable-faad           faad codec (default disabled)])
if test "x${enable_faad}" = "xyes"
then
  AC_ARG_WITH(faad,
    [    --with-faad=PATH      path to faad installation],[],[])
  if test "x${with_faad}" != "xno" -a "x${with_faad}" != "x"
  then
1421 1422
    CPPFLAGS_faad="${CPPFLAGS_faad} -I${with_faad}/include"
    LDFLAGS_faad="${LDFLAGS_faad} -L${with_faad}/lib"
1423
  fi
1424
  LDFLAGS_faad="${LDFLAGS_faad}"
1425

1426
  AC_ARG_WITH(faad-tree,
1427 1428 1429 1430 1431 1432 1433 1434 1435 1436 1437 1438 1439 1440 1441
  [    --with-faad-tree=PATH faad tree for static linking])
  if test "x${with_faad_tree}" != "x"
  then
    AC_MSG_CHECKING(for libfaad.a in ${with_faad_tree})
    real_faad_tree="`cd ${with_faad_tree} 2>/dev/null && pwd`"
    if test "x${real_faad_tree}" = x
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_faad_tree}])
    fi
    if test -f "${real_faad_tree}/libfaad/.libs/libfaad.a"
    then
      dnl  Use a custom faad
      AC_MSG_RESULT(${real_faad_tree}/libfaad/.libs/libfaad.a)
1442 1443 1444
      BUILTINS="${BUILTINS} faad"
      LDFLAGS_faad="${LDFLAGS_faad} ${real_faad_tree}/libfaad/.libs/libfaad.a"
      CPPFLAGS_faad="${CPPFLAGS_faad} -I${real_faad_tree}/include"
1445 1446 1447
    else
      dnl  The given libfaad wasn't built
      AC_MSG_RESULT(no)
1448
      AC_MSG_ERROR([cannot find ${real_faad_tree}/libfaad/.libs/libfaad.a, make sure you compiled libfaad in ${with_faad_tree}])
1449 1450
    fi
  else
1451 1452
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_faad}"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_faad}"
1453 1454 1455
    AC_CHECK_HEADERS(faad.h, ,
      [ AC_MSG_ERROR([Cannot find development headers for libfaad...]) ])
    AC_CHECK_LIB(faad, faacDecOpen, [
1456 1457
      PLUGINS="${PLUGINS} faad"
      LDFLAGS_faad="${LDFLAGS_faad} -lfaad" ],
1458
      [ AC_MSG_ERROR([Cannot find libfaad library...]) ])
1459 1460
    LDFLAGS="${LDFLAGS_save}"
    CPPFLAGS="${CPPFLAGS_save}"
1461 1462 1463 1464
  fi
fi


1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519
dnl
dnl  xvid decoder plugin
dnl
AC_ARG_ENABLE(xvid,
[  --enable-xvid           xvid codec (default disabled)])
if test "x${enable_xvid}" = "xyes"
then
  AC_ARG_WITH(xvid,
    [    --with-xvid=PATH      path to xvid installation],[],[])
  if test "x${with_xvid}" != "xno" -a "x${with_xvid}" != "x"
  then
    CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${with_xvid}/include"
    LDFLAGS_xvid="${LDFLAGS_xvid} -L${with_xvid}/lib"
  fi
  LDFLAGS_xvid="${LDFLAGS_xvid}"

  AC_ARG_WITH(xvid-tree,
  [    --with-xvid-tree=PATH xvid tree for static linking])
  if test "x${with_xvid_tree}" != "x"
  then
    AC_MSG_CHECKING(for libxvidcore.a in ${with_xvid_tree})
    real_xvid_tree="`cd ${with_xvid_tree} 2>/dev/null && pwd`"
    if test "x${real_xvid_tree}" = x
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot cd to ${with_xvid_tree}])
    fi
    if test -f "${real_xvid_tree}/build/generic/libxvidcore.a"
    then
      dnl  Use a custom xvid
      AC_MSG_RESULT(${real_xvid_tree}/build/generic/libxvidcore.a)
      BUILTINS="${BUILTINS} xvid"
      LDFLAGS_xvid="${LDFLAGS_xvid} ${real_xvid_tree}/build/generic/libxvidcore.a"
      CPPFLAGS_xvid="${CPPFLAGS_xvid} -I${real_xvid_tree}/src"
    else
      dnl  The given libxvidcore wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_xvid_tree}/build/generic/libxvidcore.a, make sure you compiled libxvidcore in ${with_xvid_tree}])
    fi
  else
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_xvid}"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_xvid}"
    AC_CHECK_HEADERS(xvid.h, ,
      [ AC_MSG_ERROR([Cannot find development headers for libxvidcore...]) ])
    AC_CHECK_LIB(xvid, xvid_init, [
      PLUGINS="${PLUGINS} xvid"
      LDFLAGS_xvid="${LDFLAGS_xvid} -lxvid" ],
      [ AC_MSG_ERROR([Cannot find libxvidcore library...]) ])
    LDFLAGS="${LDFLAGS_save}"
    CPPFLAGS="${CPPFLAGS_save}"
  fi
fi


1520

1521 1522 1523
dnl
dnl MP4 module
dnl
1524
AC_ARG_ENABLE(mp4,
1525 1526
  [  --enable-mp4            MP4 demux module (default enabled)])
if test "x${enable_mp4}" != "xno"
1527
then
1528

1529
    PLUGINS="${PLUGINS} mp4"
1530
    AC_CHECK_HEADERS(zlib.h,
1531
              [ LDFLAGS_mp4="${LDFLAGS_mp4} -lz" ] )
1532
fi
1533

Gildas Bazin's avatar
 
Gildas Bazin committed
1534
dnl
Gildas Bazin's avatar
 
Gildas Bazin committed
1535
dnl  a52 AC3 decoder plugin
Gildas Bazin's avatar
 
Gildas Bazin committed
1536
dnl
Gildas Bazin's avatar
 
Gildas Bazin committed
1537
AC_ARG_ENABLE(a52,
1538
  [  --enable-a52            A/52 support with liba52 (default enabled)])
1539
if test "x${enable_a52}" != "xno"
Gildas Bazin's avatar
 
Gildas Bazin committed
1540
then
1541
  AC_ARG_WITH(a52,
1542
    [    --with-a52=PATH       a52 headers and libraries])
Gildas Bazin's avatar
 
Gildas Bazin committed
1543 1544
  AC_ARG_WITH(a52-tree,
    [    --with-a52-tree=PATH  a52dec tree for static linking ],[],[])
1545
  if test "x${with_a52_tree}" != "xno" -a "x${with_a52_tree}" != "x"
Gildas Bazin's avatar
 
Gildas Bazin committed
1546
  then
Gildas Bazin's avatar
 
Gildas Bazin committed
1547
    real_a52_tree="`cd ${with_a52_tree} 2>/dev/null && pwd`"
1548
    if test "x${real_a52_tree}" = "x"
Gildas Bazin's avatar
 
Gildas Bazin committed
1549 1550 1551 1552 1553 1554 1555 1556 1557 1558
    then
      dnl  The given directory can't be found
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([${with_a52_tree} directory doesn't exist])
    fi
    dnl  Use a custom a52dec
    AC_MSG_CHECKING(for a52.h in ${real_a52_tree}/include)
    if test -f ${real_a52_tree}/include/a52.h
    then
      AC_MSG_RESULT(yes)
1559 1560 1561
      CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -I${real_a52_tree}"
      LDFLAGS_a52tofloat32="${LDFLAGS_a52tofloat32} -L${real_a52_tree}/liba52/.libs"
      LDFLAGS="${LDFLAGS_save} ${LDFLAGS_a52tofloat32}"
Gildas Bazin's avatar
 
Gildas Bazin committed
1562
      AC_CHECK_LIB(a52, a52_free, [
1563
        BUILTINS="${BUILTINS} a52tofloat32"
1564
        LDFLAGS_a52tofloat32="-la52 ${LDFLAGS_a52tofloat32}"
1565
        CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} -DUSE_A52DEC_TREE"
Gildas Bazin's avatar
 
Gildas Bazin committed
1566 1567 1568
        ],[
        if test -f ${real_a52_tree}/liba52/.libs/liba52.a
        then
1569
          AC_MSG_ERROR([make sure you have at least a52dec-0.7.3])
Gildas Bazin's avatar
 
Gildas Bazin committed
1570 1571 1572
        else
          AC_MSG_ERROR([the specified tree hasn't been compiled])
        fi
1573
      ])
1574
      LDFLAGS="${LDFLAGS_save}"
Gildas Bazin's avatar
 
Gildas Bazin committed
1575 1576 1577 1578
    else
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([the specified tree doesn't have a52.h])
    fi
1579 1580 1581
  else
    if test "x${with_a52}" = "x"
    then
1582 1583
      LDFLAGS_test=""
      CPPFLAGS_test=""
1584
    else
1585 1586
      LDFLAGS_test="-L${with_a52}/lib"
      CPPFLAGS_test="-I${with_a52}/include"
1587
    fi
1588 1589
    CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
    LDFLAGS="${LDFLAGS_save} ${LDFLAGS_test}"
1590
    AC_CHECK_HEADERS(a52dec/a52.h, [
Gildas Bazin's avatar
 
Gildas Bazin committed
1591
      AC_CHECK_LIB(a52, a52_free, [
1592
        PLUGINS="${PLUGINS} a52tofloat32"
1593
        LDFLAGS_a52tofloat32="${LDFLAGS_test} -la52 ${LDFLAGS_a52tofloat32}"
1594
        CPPFLAGS_a52tofloat32="${CPPFLAGS_a52tofloat32} ${CPPFLAGS_test}"
1595 1596 1597 1598 1599
      ],[
        if test "x${enable_dvbpsi}" != "x"
        then
          AC_MSG_ERROR([Could not find a52 on your system: you may get it from http://liba52.sf.net])
        fi
1600
      ])
Gildas Bazin's avatar
 
Gildas Bazin committed
1601
    ])
1602 1603
    CPPFLAGS="${CPPFLAGS_save}"
    LDFLAGS="${LDFLAGS_save}"
Gildas Bazin's avatar
 
Gildas Bazin committed
1604
  fi
Gildas Bazin's avatar
 
Gildas Bazin committed
1605 1606
fi

1607 1608 1609 1610 1611 1612 1613
dnl
dnl  cinepak plugin
dnl
AC_ARG_ENABLE(cinepak,
  [  --enable-cinepak        Cinepak decoder (default enabled)])
if test "x${enable_cinepak}" != "xno"
then
1614
  PLUGINS="${PLUGINS} cinepak"
1615 1616
fi

1617 1618
dnl
dnl  DV plugin
1619
dnl
1620 1621 1622 1623 1624
AC_ARG_ENABLE(dv,
  [  --enable-dv             DV decoder support (default disabled)])
if test "x${enable_dv}" = "xyes"
then
  AC_CHECK_HEADERS(libdv/dv.h, [
1625 1626
    PLUGINS="${PLUGINS} dv"
    LDFLAGS_dv="${LDFLAGS_dv} -ldv"
1627
   ],[])
1628
fi
1629

Gildas Bazin's avatar
 
Gildas Bazin committed
1630 1631 1632 1633
dnl
dnl  Vorbis plugin
dnl
AC_ARG_ENABLE(vorbis,
Gildas Bazin's avatar
 
Gildas Bazin committed
1634
  [  --enable-vorbis         Vorbis decoder support (default enabled)])
Gildas Bazin's avatar
 
Gildas Bazin committed
1635 1636 1637 1638
if test "x${enable_vorbis}" != "xno"
then
  AC_CHECK_HEADERS(vorbis/codec.h, [
    PLUGINS="${PLUGINS} vorbis"
Gildas Bazin's avatar
 
Gildas Bazin committed
1639
    LDFLAGS_vorbis="${LDFLAGS_vorbis} -lvorbis -logg"
Gildas Bazin's avatar
 
Gildas Bazin committed
1640 1641 1642
   ],[])
fi

Gildas Bazin's avatar
 
Gildas Bazin committed
1643 1644 1645 1646 1647 1648 1649 1650 1651 1652 1653 1654 1655
dnl
dnl  Tremor plugin
dnl
AC_ARG_ENABLE(tremor,
  [  --enable-tremor         Tremor decoder support (default disabled)])
if test "x${enable_tremor}" = "xyes"
then
  AC_CHECK_HEADERS(tremor/ivorbiscodec.h, [
    PLUGINS="${PLUGINS} tremor"
    LDFLAGS_tremor="${LDFLAGS_tremor} -lvorbisidec -logg"
   ],[])
fi

Gildas Bazin's avatar
 
Gildas Bazin committed
1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673
dnl
dnl  tarkin decoder plugin
dnl
AC_ARG_ENABLE(tarkin,
[  --enable-tarkin         experimental tarkin codec (default disabled)])
if test "x${enable_tarkin}" = "xyes"
then
  AC_ARG_WITH(tarkin-tree,
  [    --with-tarkin-tree=PATH tarkin tree for static linking])
  if test "x${with_tarkin_tree}" != "x"
  then
    AC_MSG_CHECKING(for tarkin.o in ${with_tarkin_tree})
    real_tarkin_tree="`cd ${with_tarkin_tree} 2>/dev/null && pwd`"
    if test -f "${real_tarkin_tree}/tarkin.o"
    then
      BUILTINS="${BUILTINS} tarkin"
      CPPFLAGS_tarkin="${CPPFLAGS_tarkin} -I${real_tarkin_tree}"
      LDFLAGS_tarkin="${LDFLAGS_tarkin} ${real_tarkin_tree}/mem.o ${real_tarkin_tree}/pnm.o ${real_tarkin_tree}/wavelet.o ${real_tarkin_tree}/wavelet_xform.o ${real_tarkin_tree}/wavelet_coeff.o ${real_tarkin_tree}/yuv.o ${real_tarkin_tree}/tarkin.o ${real_tarkin_tree}/info.o -logg"
Gildas Bazin's avatar
 
Gildas Bazin committed
1674
      AC_MSG_RESULT(yes)
Gildas Bazin's avatar
 
Gildas Bazin committed
1675 1676 1677 1678 1679 1680 1681 1682 1683
    else
      dnl  The given tarkin tree wasn't built
      AC_MSG_RESULT(no)
      AC_MSG_ERROR([cannot find ${real_tarkin_tree}/tarkin.o,
                    make sure you compiled tarkin in ${with_tarkin_tree}])
    fi
  fi
fi

Gildas Bazin's avatar
 
Gildas Bazin committed
1684 1685 1686 1687 1688 1689 1690 1691 1692 1693
dnl
dnl  theora decoder plugin
dnl
AC_ARG_ENABLE(theora,
[  --enable-theora         experimental theora codec (default disabled)])
if test "x${enable_theora}" = "xyes"
then
  AC_CHECK_HEADERS(theora/theora.h, [
    AC_CHECK_LIB(theora, theora_granule_time, [
      BUILTINS="${BUILTINS} theora"
Gildas Bazin's avatar
 
Gildas Bazin committed
1694
      LDFLAGS_theora="${LDFLAGS_theora} -ltheora -logg" ],[
Gildas Bazin's avatar
 
Gildas Bazin committed
1695 1696 1697 1698 1699 1700
      AC_MSG_ERROR([libtheora doesn't appear to be installed on you system.
You also need to check that you have a libogg posterior to the 1.0 release.])],
      [-logg])
  ])
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
1701
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1702
dnl  Video plugins
Sam Hocevar's avatar
 
Sam Hocevar committed
1703 1704
dnl

Sam Hocevar's avatar
 
Sam Hocevar committed
1705
AC_ARG_WITH(,[Video plugins:])
Sam Hocevar's avatar
 
Sam Hocevar committed
1706

Sam Hocevar's avatar
 
Sam Hocevar committed
1707
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1708 1709
dnl  X11 module
dnl  (enabled by default except on win32)
Sam Hocevar's avatar
 
Sam Hocevar committed
1710
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1711
AC_ARG_ENABLE(x11,
Sam Hocevar's avatar
 
Sam Hocevar committed
1712
  [  --enable-x11            X11 support (default enabled)])
1713 1714
if test "x${enable_x11}" != "xno" &&
  (test "x${SYS}" != "xmingw32" || test "x${enable_x11}" = "xyes"); then
1715
  CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
Sam Hocevar's avatar
 
Sam Hocevar committed
1716
  AC_CHECK_HEADERS(X11/Xlib.h, [
1717 1718 1719
    PLUGINS="${PLUGINS} x11"
    LDFLAGS_x11="${LDFLAGS_x11} -L${x_libraries} -lX11 -lXext"
    CPPFLAGS_x11="${CPPFLAGS_x11} -I${x_includes}"
Sam Hocevar's avatar
 
Sam Hocevar committed
1720
  ])
1721
  CPPFLAGS="${CPPFLAGS_save}"
Sam Hocevar's avatar
 
Sam Hocevar committed
1722 1723 1724 1725 1726 1727 1728
fi

dnl
dnl  XVideo module
dnl  (enabled by default except on win32)
dnl
AC_ARG_ENABLE(xvideo,
Sam Hocevar's avatar
 
Sam Hocevar committed
1729
  [  --enable-xvideo         XVideo support (default enabled)])
1730 1731
if test "x${enable_xvideo}" != "xno" &&
  (test "x${SYS}" != "xmingw32" || test "x${enable_xvideo}" = "xyes"); then
1732
  CPPFLAGS="${CPPFLAGS_save} -I${x_includes}"
Sam Hocevar's avatar
 
Sam Hocevar committed
1733
  AC_CHECK_HEADERS(X11/extensions/Xv.h, [
1734
    CFLAGS="${CFLAGS_save} -L${x_libraries} -lX11 -lXext"
1735
    AC_CHECK_LIB(Xv_pic,XvPutImage,
Sam Hocevar's avatar
 
Sam Hocevar committed
1736
      # We have Xv_pic, that's good, we can build an xvideo.so plugin !
1737 1738 1739
      PLUGINS="${PLUGINS} xvideo"
      LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv_pic"
      CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1740 1741
      AC_CHECK_LIB(Xv,XvPutImage,
        # We don't have Xv_pic, but we have Xv, let's make xvideo.a as builtin
1742 1743 1744
        PLUGINS="${PLUGINS} xvideo"
        LDFLAGS_xvideo="${LDFLAGS_xvideo} -L${x_libraries} -lX11 -lXext -lXv"
        CPPFLAGS_xvideo="${CPPFLAGS_xvideo} -I${x_includes}",
1745
        # Otherwise... well, do nothing.
1746
        :
1747 1748
      )
    )
1749
    CFLAGS="${CFLAGS_save}"
Sam Hocevar's avatar
 
Sam Hocevar committed
1750
  ]
1751
  CPPFLAGS="${CPPFLAGS_save}")
Sam Hocevar's avatar
 
Sam Hocevar committed
1752
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1753 1754 1755 1756

dnl
dnl  SDL module
dnl
1757
AC_ARG_ENABLE(sdl,
Sam Hocevar's avatar
 
Sam Hocevar committed
1758
  [  --enable-sdl            SDL support (default enabled)])
1759
if test "x${enable_sdl}" != "xno"
1760
then
1761
  SDL_PATH="${PATH}"
1762
  AC_ARG_WITH(sdl-config-path,
Sam Hocevar's avatar
 
Sam Hocevar committed
1763
    [    --with-sdl-config-path=PATH sdl-config path (default search in \$PATH)],
1764
    [ if test "x${with_sdl_config_path}" != "xno"
1765
      then
1766
        SDL_PATH="${with_sdl_config_path}:${PATH}"
1767
      fi ])
1768 1769
  AC_PATH_PROG(SDL12_CONFIG, sdl12-config, no, ${SDL_PATH})
  SDL_CONFIG="${SDL12_CONFIG}"
1770
  SDL_HEADER="SDL12/SDL.h"
1771
  if test "x${SDL_CONFIG}" = "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
1772
  then
1773
    AC_PATH_PROG(SDL11_CONFIG, sdl11-config, no, ${SDL_PATH})
Sam Hocevar's avatar
 
Sam Hocevar committed
1774
    SDL_CONFIG=${SDL11_CONFIG}
1775 1776
    SDL_HEADER="SDL11/SDL.h"
  fi
1777
  if test "x${SDL_CONFIG}" = "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
1778
  then
1779
    AC_PATH_PROG(SDL_CONFIG, sdl-config, no, ${SDL_PATH})
1780
    SDL_HEADER="SDL/SDL.h"
1781
  fi
1782
  if test "x${SDL_CONFIG}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
1783
  then
1784 1785 1786 1787 1788 1789
    PLUGINS="${PLUGINS} vout_sdl aout_sdl"
    CFLAGS_vout_sdl="${CFLAGS_vout_sdl} `${SDL_CONFIG} --cflags`"
    LDFLAGS_vout_sdl="${LDFLAGS_vout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
    CFLAGS_aout_sdl="${CFLAGS_aout_sdl} `${SDL_CONFIG} --cflags`"
    LDFLAGS_aout_sdl="${LDFLAGS_aout_sdl} `${SDL_CONFIG} --libs | sed 's,-rdynamic,,'`"
    CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_vout_sdl}"
1790 1791
    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),
1792 1793
      [ AC_MSG_ERROR([The development package for SDL is not installed.
Please install it and try again. Alternatively you can also configure with
1794 1795
--disable-sdl.])
      ])
1796
    CPPFLAGS="${CPPFLAGS_save}"
1797
    if expr 1.1.5 \> `${SDL_CONFIG} --version` >/dev/null
Sam Hocevar's avatar
 
Sam Hocevar committed
1798
    then
1799 1800 1801
      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
1802
    fi
1803
  elif test "x${enable_sdl}" =  "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
1804
  then
1805 1806 1807
    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.
    ])
1808 1809
  fi
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1810

1811
dnl
1812
dnl  Qt Embedded module
1813 1814 1815 1816
dnl  (disabled by default)
dnl
AC_ARG_ENABLE(qte,
  [  --enable-qte            QT Embedded support (default disabled)])
1817
if test "x${enable_qte}" != "xno"
1818 1819 1820 1821 1822
then
  AC_ARG_WITH(qte,
  [    --with-qte=PATH    Qt Embedded headers and libraries])
  if test "x${with_qte}" = "x"
  then
1823 1824
    LDFLAGS_test="-L${QTDIR}/lib"
    CPPFLAGS_test="-I${QTDIR}/include"
1825
  else
1826 1827
    LDFLAGS_test="-L${with_qte}/lib"
    CPPFLAGS_test="-I${with_qte}/include"
1828 1829
  fi

1830
  CPPFLAGS="${CPPFLAGS_save} ${CPPFLAGS_test}"
1831
  AC_CHECK_HEADERS(qt.h, [
1832 1833 1834
    CPPFLAGS_qte="${CPPFLAGS_qte} ${CPPFLAGS_test} -DQT_QWS_IPAQ -DQWS"
    CXXFLAGS_qte="${CXXFLAGS_qte} -fno-exceptions -fno-rtti"
    LDFLAGS_qte="${LDFLAGS_qte} ${LDFLAGS_test} -lqte"
1835 1836
    if test "x${with_qte}" = "x"
    then
1837
      PLUGINS="${PLUGINS} qte"
1838
    else
1839
      BUILTINS="${BUILTINS} qte"
1840
    fi
1841
  ])
1842
  CPPFLAGS="${CPPFLAGS_save}"
1843 1844
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
1845 1846 1847
dnl
dnl  Windows DirectX module
dnl
1848
AC_ARG_ENABLE(directx,
Sam Hocevar's avatar
 
Sam Hocevar committed
1849
  [  --enable-directx        Win32 DirectX support (default enabled on Win32)])
1850
if test "x${enable_directx}" != "xno"
1851
then
Gildas Bazin's avatar
 
Gildas Bazin committed
1852
  if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"
1853
  then
1854
    AC_ARG_WITH(directx,
Gildas Bazin's avatar
 
Gildas Bazin committed
1855
    [    --with-directx=PATH   Win32 DirectX headers])
1856
    if test "x${with_directx}" = "x"
Sam Hocevar's avatar
 
Sam Hocevar committed
1857
    then
Gildas Bazin's avatar
 
Gildas Bazin committed
1858
      AC_CHECK_HEADERS(ddraw.h,
Gildas Bazin's avatar
 
Gildas Bazin committed
1859 1860
      [ PLUGINS="${PLUGINS} vout_directx aout_directx"
        LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32" ])
1861
    else
1862 1863
      AC_MSG_CHECKING(for directX headers in ${with_directx})
      if test -f ${with_directx}/ddraw.h
Gildas Bazin's avatar
 
Gildas Bazin committed
1864
      then
Gildas Bazin's avatar
 
Gildas Bazin committed
1865 1866 1867 1868
        PLUGINS="${PLUGINS} vout_directx aout_directx"
        LDFLAGS_vout_directx="${LDFLAGS_directx} -lgdi32"
        CPPFLAGS_vout_directx="${CPPFLAGS_vout_directx} -I${with_directx}"
        CPPFLAGS_aout_directx="${CPPFLAGS_aout_directx} -I${with_directx}"
1869
        AC_MSG_RESULT(yes)
Gildas Bazin's avatar
 
Gildas Bazin committed
1870
      else
1871
        AC_MSG_RESULT(no)
1872
        AC_MSG_ERROR([Cannot find ${with_directx}/ddraw.h!])
Gildas Bazin's avatar
 
Gildas Bazin committed
1873
      fi
1874 1875 1876
    fi
  fi
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1877

Gildas Bazin's avatar
 
Gildas Bazin committed
1878
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1879
dnl  Linux framebuffer module
Gildas Bazin's avatar
 
Gildas Bazin committed
1880
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1881 1882
AC_ARG_ENABLE(fb,
  [  --enable-fb             Linux framebuffer support (default enabled on Linux)])
1883
    if test "x${enable_fb}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
1884 1885
    then
      AC_CHECK_HEADERS(linux/fb.h, [
1886
        PLUGINS="${PLUGINS} fb"
Sam Hocevar's avatar
 
Sam Hocevar committed
1887 1888
      ])
    fi
Gildas Bazin's avatar
 
Gildas Bazin committed
1889

Sam Hocevar's avatar
 
Sam Hocevar committed
1890
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1891
dnl  Linux MGA module
Sam Hocevar's avatar
 
Sam Hocevar committed
1892
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1893 1894
AC_ARG_ENABLE(mga,
  [  --enable-mga            Linux kernel Matrox support (default disabled)],
1895
  [ if test "x${enable_mga}" = "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
1896
    then
1897
      PLUGINS="${PLUGINS} mga xmga"
Sam Hocevar's avatar
 
Sam Hocevar committed
1898
    fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
1899

1900 1901 1902 1903 1904 1905 1906
dnl
dnl  SVGAlib module
dnl
AC_ARG_ENABLE(svgalib,
  [  --enable-svgalib        SVGAlib support (default disabled)])
if test "x${enable_svgalib}" = "xyes"
then
1907 1908
  PLUGINS="${PLUGINS} svgalib"
  LDFLAGS_svgalib="${LDFLAGS_svgalib} -lvgagl -lvga"
1909 1910
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
1911 1912 1913 1914 1915
dnl
dnl  GGI module
dnl
AC_ARG_ENABLE(ggi,
  [  --enable-ggi            GGI support (default disabled)])
1916
if test "x${enable_ggi}" = "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
1917
then
1918 1919
  PLUGINS="${PLUGINS} ggi"
  LDFLAGS_ggi="${LDFLAGS_ggi} -lggi"
Sam Hocevar's avatar
 
Sam Hocevar committed
1920 1921
  AC_ARG_WITH(ggi,
    [    --with-ggi=PATH       path to libggi],
1922
    [ if test "x${with_ggi}" != "xno" -a "x${with_ggi}" != "x"
Sam Hocevar's avatar
 
Sam Hocevar committed
1923
      then
1924 1925
        CPPFLAGS_ggi="${CPPFLAGS_ggi} -I${with_ggi}/include"
        LDFLAGS_ggi="${LDFLAGS_ggi} -L${with_ggi}/lib"
Sam Hocevar's avatar
 
Sam Hocevar committed
1926 1927 1928
      fi ])
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
1929 1930 1931
dnl
dnl  Glide module
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1932 1933
AC_ARG_ENABLE(glide,
  [  --enable-glide          Glide (3dfx) support (default disabled)])
1934
if test "x${enable_glide}" = "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
1935
then
1936 1937 1938
  PLUGINS="${PLUGINS} glide"
  LDFLAGS_glide="${LDFLAGS_glide} -lglide2x -lm"
  CPPFLAGS_glide="${CPPFLAGS_glide} -I/usr/include/glide"
Sam Hocevar's avatar
 
Sam Hocevar committed
1939 1940
  AC_ARG_WITH(glide,
    [    --with-glide=PATH     path to libglide],
1941
    [ if test "x${with_glide}" != "xno" -a "x${with_glide}" != "x"
Sam Hocevar's avatar
 
Sam Hocevar committed
1942
      then
1943 1944
        CPPFLAGS_glide="${CPPFLAGS_glide} -I${with_glide}/include"
        LDFLAGS_glide="${LDFLAGS_glide} -L${with_glide}/lib"
Sam Hocevar's avatar
 
Sam Hocevar committed
1945 1946
      fi ])
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
1947

Sam Hocevar's avatar
 
Sam Hocevar committed
1948 1949 1950 1951 1952
dnl
dnl  AA plugin
dnl
AC_ARG_ENABLE(aa,
  [  --enable-aa             aalib output (default disabled)])
1953
if test "x${enable_aa}" = "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
1954 1955
then
  AC_CHECK_HEADER(aalib.h,have_aa="true",have_aa="false")
1956
  if test "x${have_aa}" = "xtrue"
Sam Hocevar's avatar
 
Sam Hocevar committed
1957
  then
1958 1959
    PLUGINS="${PLUGINS} aa"
    LDFLAGS_aa="${LDFLAGS_aa} -laa"
Sam Hocevar's avatar
 
Sam Hocevar committed
1960 1961 1962
  fi
fi

1963 1964 1965 1966 1967 1968 1969 1970 1971 1972 1973 1974
dnl
dnl  win32 GDI plugin
dnl
AC_ARG_ENABLE(wingdi,
  [  --enable-wingdi         Win32 GDI module (default enabled on Win32)])
if test "x${enable_wingdi}" != "xno"; then
  if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
    PLUGINS="${PLUGINS} wingdi"
    LDFLAGS_wingdi="${LDFLAGS_wingdi} -lgdi32"
  fi
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
1975
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1976
dnl  Audio plugins
Sam Hocevar's avatar
 
Sam Hocevar committed
1977
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
1978 1979 1980 1981 1982 1983

AC_ARG_WITH(,[Audio plugins:])

dnl
dnl  OSS /dev/dsp module (enabled by default except on win32)
dnl
1984 1985
AC_ARG_ENABLE(oss,
  [  --enable-oss            Linux OSS /dev/dsp support (enabled on Linux)])
Sam Hocevar's avatar
 
Sam Hocevar committed
1986

1987 1988
if test "x${enable_oss}" != "xno" &&
  (test "x${SYS}" != "xmingw32" || test "x${enable_oss}" = "xyes")
Sam Hocevar's avatar
 
Sam Hocevar committed
1989 1990
then
  AC_CHECK_HEADERS(soundcard.h sys/soundcard.h machine/soundcard.h, [
Gildas Bazin's avatar
 
Gildas Bazin committed
1991
    PLUGINS="${PLUGINS} oss"
1992
    AC_CHECK_LIB(ossaudio,main,LDFLAGS_oss="${LDFLAGS_oss} -lossaudio")
Sam Hocevar's avatar
 
Sam Hocevar committed
1993 1994 1995 1996 1997 1998 1999 2000
  ])
fi

dnl
dnl  Esound module
dnl
AC_ARG_ENABLE(esd,
  [  --enable-esd            Esound library support (default disabled)],
2001
  [if test "x${enable_esd}" = "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
2002 2003
   then
     AC_PATH_PROG(ESD_CONFIG, esd-config, no)
2004
     if test "x${ESD_CONFIG}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
2005
     then
Gildas Bazin's avatar
 
Gildas Bazin committed
2006
       PLUGINS="${PLUGINS} esd"
2007 2008
       CFLAGS_esd="${CFLAGS_esd} `${ESD_CONFIG} --cflags`"
       LDFLAGS_esd="${LDFLAGS_esd} `${ESD_CONFIG} --libs`"
Sam Hocevar's avatar
 
Sam Hocevar committed
2009
     fi
Sam Hocevar's avatar
 
Sam Hocevar committed
2010 2011 2012
   fi])

dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2013
dnl  aRts module
Sam Hocevar's avatar
 
Sam Hocevar committed
2014
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2015 2016
AC_ARG_ENABLE(arts,
  [  --enable-arts           aRts sound server (default disabled)],
2017
  [if test "x${enable_arts}" = "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
2018 2019
   then
     AC_PATH_PROG(ARTS_CONFIG, artsc-config, no)
2020
     if test "x${ARTS_CONFIG}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
2021
     then
Gildas Bazin's avatar
 
Gildas Bazin committed
2022
       PLUGINS="${PLUGINS} arts"
2023 2024
       CFLAGS_arts="${CFLAGS_arts} `${ARTS_CONFIG} --cflags`"
       LDFLAGS_arts="${LDFLAGS_arts} `${ARTS_CONFIG} --libs `"
Sam Hocevar's avatar
 
Sam Hocevar committed
2025
     fi
Sam Hocevar's avatar
 
Sam Hocevar committed
2026 2027 2028
   fi])

dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2029 2030 2031 2032
dnl  ALSA module
dnl
AC_ARG_ENABLE(alsa,
  [  --enable-alsa           ALSA sound support for Linux (default disabled)],
2033
  [if test "x${enable_alsa}" = "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
2034 2035
   then
     AC_CHECK_HEADER(alsa/asoundlib.h, AC_CHECK_LIB(asound, main, have_alsa="true", have_alsa="false"),have_alsa="false")
2036
     if test "x${have_alsa}" = "xtrue"
2037
     then
2038
       #PLUGINS="${PLUGINS} alsa"
2039
       LDFLAGS_alsa="${LDFLAGS_alsa} -lasound -lm -ldl"
2040
     fi
Sam Hocevar's avatar
 
Sam Hocevar committed
2041
   fi])
Sam Hocevar's avatar
 
Sam Hocevar committed
2042 2043

dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2044
dnl  win32 waveOut plugin
Sam Hocevar's avatar
 
Sam Hocevar committed
2045
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2046 2047
AC_ARG_ENABLE(waveout,
  [  --enable-waveout        Win32 waveOut module (default enabled on Win32)])
Gildas Bazin's avatar
 
Gildas Bazin committed
2048 2049
if test "x${enable_waveout}" != "xno"; then
  if test "x${SYS}" = "xmingw32" -o "x${SYS}" = "xcygwin"; then
Gildas Bazin's avatar
 
Gildas Bazin committed
2050
    PLUGINS="${PLUGINS} waveout"
2051
    LDFLAGS_waveout="-lwinmm"
Gildas Bazin's avatar
 
Gildas Bazin committed
2052
  fi
Sam Hocevar's avatar
 
Sam Hocevar committed
2053 2054 2055 2056 2057 2058 2059
fi

dnl
dnl  Interface plugins
dnl

AC_ARG_WITH(,[Interface plugins:])
Sam Hocevar's avatar
 
Sam Hocevar committed
2060

2061 2062 2063
dnl special case for BeOS
if test "x${SYS}" = "xbeos"
then
2064
    PLUGINS="${PLUGINS} beos"
2065 2066
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
2067 2068 2069
dnl
dnl  Gtk+ module
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2070
AC_ARG_ENABLE(gtk,
Sam Hocevar's avatar
 
Sam Hocevar committed
2071
  [  --enable-gtk            Gtk+ support (default enabled)])
2072
if test "x${enable_gtk}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
2073
then
2074
  GTK_PATH="${PATH}"
2075
  AC_ARG_WITH(gtk-config-path,
Sam Hocevar's avatar
 
Sam Hocevar committed
2076
    [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
2077
    [ if test "x${with_gtk_config_path}" != "xno"
2078
      then
2079
        GTK_PATH="${with_gtk_config_path}:${PATH}"
2080
      fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
2081
  # look for gtk-config
2082
  AC_PATH_PROG(GTK12_CONFIG, gtk12-config, no, ${GTK_PATH})
Sam Hocevar's avatar
 
Sam Hocevar committed
2083
  GTK_CONFIG=${GTK12_CONFIG}
2084
  if test "x${GTK_CONFIG}" = "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
2085
  then
2086
    AC_PATH_PROG(GTK_CONFIG, gtk-config, no, ${GTK_PATH})
Sam Hocevar's avatar
 
Sam Hocevar committed
2087
  fi
2088
  if test "x${GTK_CONFIG}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
2089
  then
2090
    if expr 1.2.0 \> `${GTK_CONFIG} --version` >/dev/null
Sam Hocevar's avatar
 
Sam Hocevar committed
2091 2092 2093
    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
Gildas Bazin's avatar
 
Gildas Bazin committed
2094 2095 2096 2097 2098 2099 2100
    if test "x${SYS}" != "xmingw32"; then
      CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk gthread`"
      LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
    else
      CFLAGS_gtk="${CFLAGS_gtk} `${GTK_CONFIG} --cflags gtk`"
      LDFLAGS_gtk="${LDFLAGS_gtk} `${GTK_CONFIG} --libs gtk | sed 's,-rdynamic,,'`"
    fi
Sam Hocevar's avatar
 
Sam Hocevar committed
2101
    # now look for the gtk.h header
2102
    CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gtk}"
Sam Hocevar's avatar
 
Sam Hocevar committed
2103 2104 2105 2106 2107
    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."
    ])
2108
    if test "x${ac_cv_gtk_headers}" = "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
2109
    then
2110
      PLUGINS="${PLUGINS} gtk"
Gildas Bazin's avatar
 
Gildas Bazin committed
2111 2112 2113
      if test "x${SYS}" != "xmingw32"; then
        NEED_GTK_MAIN=yes
      fi
Sam Hocevar's avatar
 
Sam Hocevar committed
2114 2115
      ALIASES="${ALIASES} gvlc"
    fi
2116
    CPPFLAGS="${CPPFLAGS_save}"
2117 2118
  fi
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
2119

2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 2137 2138 2139 2140 2141 2142 2143 2144 2145 2146
dnl
dnl  Familiar module uses Gtk+ library
dnl
AC_ARG_ENABLE(familiar,
  [  --enable-familiar       Familiar Gtk+ support (default disabled)])
if test "x${enable_familiar}" = "xyes"
then
  GTK_PATH="${PATH}"
  AC_ARG_WITH(gtk-config-path,
    [    --with-gtk-config-path=PATH gtk-config path (default search in \$PATH)],
    [ if test "x${with_gtk_config_path}" != "xno"
      then
        GTK_PATH="${with_gtk_config_path}:${PATH}"
      fi ])
  # look for gtk-config
  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"
  then
    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-familiar.])
    fi
2147 2148
    CFLAGS_familiar="${CFLAGS_familiar} `${GTK_CONFIG} --cflags gtk gthread`"
    LDFLAGS_familiar="${LDFLAGS_familiar} `${GTK_CONFIG} --libs gtk gthread | sed 's,-rdynamic,,'`"
2149
    # now look for the gtk.h header
2150
    CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_familiar}"
2151 2152 2153 2154 2155 2156 2157
    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
2158
      PLUGINS="${PLUGINS} familiar"
2159
      NEED_GTK_MAIN=yes
2160
    fi
2161
    CPPFLAGS="${CPPFLAGS_save}"
2162 2163 2164
  fi
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
2165
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2166
dnl  Gnome module
Sam Hocevar's avatar
 
Sam Hocevar committed
2167
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2168 2169
AC_ARG_ENABLE(gnome,
  [  --enable-gnome          Gnome interface support (default disabled)],
2170
  [if test "x${enable_gnome}" = "xyes"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
2171 2172 2173 2174
    # look for gnome-config
    AC_PATH_PROG(GNOME_CONFIG, gnome-config, no)
    if test -x ${GNOME_CONFIG}
    then
2175 2176
       CFLAGS_gnome="${CFLAGS_gnome} `${GNOME_CONFIG} --cflags gtk gnomeui`"
       LDFLAGS_gnome="${LDFLAGS_gnome} `${GNOME_CONFIG} --libs gnomeui | sed 's,-rdynamic,,'`"
Sam Hocevar's avatar
 
Sam Hocevar committed
2177 2178
    fi
    # now look for the gnome.h header
2179
    CPPFLAGS="${CPPFLAGS_save} ${CFLAGS_gnome}"
Sam Hocevar's avatar
 
Sam Hocevar committed
2180
    AC_CHECK_HEADERS(gnome.h, [
2181
      PLUGINS="${PLUGINS} gnome"
2182
      NEED_GTK_MAIN=yes
2183
      NEED_GNOME_MAIN=yes
Sam Hocevar's avatar
 
Sam Hocevar committed
2184 2185 2186
      ALIASES="${ALIASES} gnome-vlc"
     ],[
      AC_MSG_ERROR([Can't find gnome headers. Please install the gnome
Sam Hocevar's avatar
 
Sam Hocevar committed
2187
developement tools or remove the --enable-gnome option])
Sam Hocevar's avatar
 
Sam Hocevar committed
2188
     ])
2189
    CPPFLAGS="${CPPFLAGS_save}"
Sam Hocevar's avatar
 
Sam Hocevar committed
2190
  fi])
Sam Hocevar's avatar
 
Sam Hocevar committed
2191

Gildas Bazin's avatar
 
Gildas Bazin committed
2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215
dnl
dnl  wxWindows module
dnl
AC_ARG_ENABLE(wxwindows,
  [  --enable-wxwindows      wxWindows support (default enabled)])
if test "x${enable_wxwindows}" != "xno"
then
  WXWINDOWS_PATH="${PATH}"
  AC_ARG_WITH(wx-config-path,
    [    --with-wx-config-path=PATH wx-config path (default search in \$PATH)],
    [ if test "x${with_wx_config_path}" != "xno"
      then
        WXWINDOWS_PATH="${with_wx_config_path}:${PATH}"
      fi ])
  # look for wx-config
  AC_PATH_PROG(WX_CONFIG, wx-config, no, ${WXWINDOWS_PATH})
  if test "x${WX_CONFIG}" != "xno"
  then
    if expr 2.3.0 \> `${WX_CONFIG} --version` >/dev/null
    then
      AC_MSG_ERROR([Your development package for wxWindows is too old, you need at least version 2.3.0. Please upgrade and try again. Alternatively you can also configure with --disable-wxwindows.])
    fi
    CXXFLAGS_wxwindows="${CXXFLAGS_wxwindows} `${WX_CONFIG} --cflags`"
    LDFLAGS_wxwindows="${LDFLAGS_wxwindows} `${WX_CONFIG} --libs`"
Gildas Bazin's avatar
 
Gildas Bazin committed
2216
    # now look for the wxprec.h header
Gildas Bazin's avatar
 
Gildas Bazin committed
2217 2218
    CPPFLAGS="${save_CPPFLAGS} ${CXXFLAGS_wxwindows}"
    ac_cv_wx_headers=yes
Gildas Bazin's avatar
 
Gildas Bazin committed
2219
    AC_CHECK_HEADERS(wx/wxprec.h, , [
Gildas Bazin's avatar
 
Gildas Bazin committed
2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231
      ac_cv_wx_headers=no
      echo "Cannot find wxWindows development headers."
    ])
    if test "x${ac_cv_wx_headers}" = "xyes"
    then
      PLUGINS="${PLUGINS} wxwindows"
      ALIASES="${ALIASES} wxvlc"
    fi
    CPPFLAGS="${save_CPPFLAGS}"
  fi
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
2232
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2233
dnl  Qt module
Sam Hocevar's avatar
 
Sam Hocevar committed
2234
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2235 2236
AC_ARG_ENABLE(qt,
  [  --enable-qt             Qt interface support (default disabled)],
2237
  [if test "x${enable_qt}" = "xyes"; then
2238
     PLUGINS="${PLUGINS} qt"
Sam Hocevar's avatar
 
Sam Hocevar committed
2239
     ALIASES="${ALIASES} qvlc"
2240 2241
     LDFLAGS_qt="${LDFLAGS_qt} -lqt -L${QTDIR}/lib"
     CPPFLAGS_qt="${CPPFLAGS_qt} -I/usr/include/qt -I${QTDIR}/include"
Sam Hocevar's avatar
 
Sam Hocevar committed
2242 2243 2244 2245 2246 2247 2248 2249
     if test -x ${QTDIR}/bin/moc
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
   fi])

2250
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2251 2252 2253 2254
dnl  KDE module
dnl
AC_ARG_ENABLE(kde,
  [  --enable-kde            KDE interface support (default disabled)],
2255
  [if test "x${enable_kde}" = "xyes"; then
2256
     PLUGINS="${PLUGINS} kde"
Sam Hocevar's avatar
 
Sam Hocevar committed
2257
     ALIASES="${ALIASES} kvlc"
2258 2259 2260
     LDFLAGS_kde="${LDFLAGS_kde} -L${KDEDIR}/lib -lkfile"
     CPPFLAGS_kde="${CPPFLAGS_kde} -I/usr/include/kde -I/usr/include/qt"
     CPPFLAGS_kde="${CPPFLAGS_kde} -I${KDEDIR}/include -I${QTDIR}/include"
Sam Hocevar's avatar
 
Sam Hocevar committed
2261 2262 2263 2264 2265 2266 2267 2268
     if test -x ${QTDIR}/bin/moc
     then
       MOC=${QTDIR}/bin/moc
     else
       MOC=moc
     fi
   fi])

2269
dnl
2270
dnl  Opie QT embedded module
2271
dnl
2272 2273 2274 2275 2276 2277 2278
AC_ARG_ENABLE(opie,
  [  --enable-opie           Qt embedded interface support (default disabled)],
  [if test "x${enable_opie}" = "xyes"; then
     AC_ARG_WITH(qte,
     [    --with-qte=PATH    Qt Embedded headers and libraries])
     if test "x${with_qte}" = "x"
     then
2279 2280
       LDFLAGS_test="-L${QTDIR}/lib"
       CPPFLAGS_test="-I${QTDIR}/include"
2281
     else
2282 2283
       LDFLAGS_test="-L${with_qte}/lib"
       CPPFLAGS_test="-I${with_qte}/include"
2284 2285
     fi

2286 2287 2288 2289
     PLUGINS="${PLUGINS} opie"
     LDFLAGS_opie="${LDFLAGS_opie} ${LDFLAGS_test} -lqte"
     CPPFLAGS_opie="${CPPFLAGS_opie} ${CPPFLAGS_test}"
     if test -x ${QTEDIR}/bin/moc
2290
     then
2291
       MOC=${QTEDIR}/bin/moc
2292 2293 2294 2295 2296
     else
       MOC=moc
     fi
   fi])

Sam Hocevar's avatar
 
Sam Hocevar committed
2297 2298 2299 2300 2301
dnl
dnl  MacOS X module
dnl
AC_ARG_ENABLE(macosx,
  [  --enable-macosx         MacOS X support (default enabled on MacOS X)],
2302
  [if test "x${enable_macosx}" = "xyes"
Sam Hocevar's avatar
 
Sam Hocevar committed
2303
   then
2304
     BUILTINS="${BUILTINS} macosx"
2305
     LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
Sam Hocevar's avatar
 
Sam Hocevar committed
2306 2307
   fi],
  [AC_CHECK_HEADERS(Cocoa/Cocoa.h,
2308
     BUILTINS="${BUILTINS} macosx"
2309
     LDFLAGS_macosx="${LDFLAGS_macosx} -framework CoreAudio -framework AudioToolbox -framework IOKit -framework Cocoa -framework Carbon -framework QuickTime -lobjc -ObjC"
Sam Hocevar's avatar
 
Sam Hocevar committed
2310 2311 2312 2313 2314 2315 2316
   )])

dnl
dnl  QNX RTOS module
dnl
AC_ARG_ENABLE(qnx,
  [  --enable-qnx            QNX RTOS support (default enabled on QNX RTOS)])
2317
    if test "x${enable_qnx}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
2318 2319
    then
      AC_CHECK_HEADERS(Ph.h, [
2320 2321
        PLUGINS="${PLUGINS} qnx"
        LDFLAGS_qnx="${LDFLAGS_qnx} -lasound -lph"
Sam Hocevar's avatar
 
Sam Hocevar committed
2322 2323 2324 2325
      ])
    fi

dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2326
dnl  Windows native interface module, built with Borland C++ Builder
Sam Hocevar's avatar
 
Sam Hocevar committed
2327
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2328 2329
AC_ARG_ENABLE(intfwin,
[  --enable-intfwin        Win32 interface support (default disabled)],
2330
[ if test "x${enable_intfwin}" != "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
2331
  then
2332
    AC_ARG_WITH(bcbuilder,
Sam Hocevar's avatar
 
Sam Hocevar committed
2333
    [    --with-bcbuilder=PATH Borland C++ Builder installation path])
2334
    if test "x${with_bcbuilder}" != "x"
Sam Hocevar's avatar
 
Sam Hocevar committed
2335
    then
2336
      BCBUILDER="${with_bcbuilder}"
Sam Hocevar's avatar
 
Sam Hocevar committed
2337
    fi
2338
    PLUGINS="${PLUGINS} win32"
Sam Hocevar's avatar
 
Sam Hocevar committed
2339
  fi ])
Sam Hocevar's avatar
 
Sam Hocevar committed
2340 2341 2342 2343 2344 2345

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

2351 2352 2353 2354
dnl
dnl  XOSD plugin
dnl
AC_ARG_ENABLE(xosd,
2355
  [  --enable-xosd           xosd interface support (default disabled)])
2356
if test "x${enable_xosd}" = "xyes"
2357
then
2358
  AC_CHECK_HEADER(xosd.h, have_xosd="true", have_xosd="false")
2359 2360 2361
  AC_TRY_COMPILE([#include <xosd.h>],
     [void foo() { xosd_init("foo","bar",12,XOSD_top,2,12,42); }],,
      AC_DEFINE(HAVE_OLD_XOSD_H, 1, Define if <xosd.h> is pre-1.0.0))
2362
  if test "x${have_xosd}" = "xtrue"
2363
  then
2364 2365
    PLUGINS="${PLUGINS} xosd"
    LDFLAGS_xosd="${LDFLAGS_xosd} -lxosd"
2366 2367 2368
  fi
fi

2369 2370 2371 2372 2373
dnl
dnl  Lirc plugin
dnl
AC_ARG_ENABLE(lirc,
  [  --enable-lirc           lirc support (default disabled)])
2374
if test "x${enable_lirc}" = "xyes"
2375 2376
then
  AC_CHECK_HEADER(lirc/lirc_client.h, AC_CHECK_LIB(lirc_client, lirc_init, have_lirc="true", have_lirc="false"),have_lirc="false")
2377
  if test "x${have_lirc}" = "xtrue"
2378
  then
2379 2380
    PLUGINS="${PLUGINS} lirc"
    LDFLAGS_lirc="${LDFLAGS_lirc} -llirc_client"
2381 2382 2383
  fi
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
2384 2385
AC_ARG_WITH(,[Misc options:])

2386
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2387
dnl  Endianness check, AC_C_BIGENDIAN doesn't work if we are cross-compiling
2388
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2389 2390 2391 2392 2393
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)])
2394
  case "x${with_words}" in
Sam Hocevar's avatar
 
Sam Hocevar committed
2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405
    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],
2406
        [ac_cv_c_bigendian="unknown"
Sam Hocevar's avatar
 
Sam Hocevar committed
2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417
        [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
2418 2419
        then
          if ${CC-cc} -c conftest.c -o conftest.o >>config.log 2>&1 \
Sam Hocevar's avatar
 
Sam Hocevar committed
2420 2421 2422 2423
              && test -f conftest.o
          then
            if test "`strings conftest.o | grep BIGenDianSyS`"
            then
2424
              ac_cv_c_bigendian="yes"
Sam Hocevar's avatar
 
Sam Hocevar committed
2425 2426 2427
            fi
            if test "`strings conftest.o | grep LiTTleEnDian`"
            then
2428
              ac_cv_c_bigendian="no"
Sam Hocevar's avatar
 
Sam Hocevar committed
2429 2430 2431 2432
            fi
          fi
        fi
      ])
2433
      if test "x${ac_cv_c_bigendian}" = "xunknown"
Sam Hocevar's avatar
 
Sam Hocevar committed
2434 2435 2436 2437 2438 2439
      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
2440
if test "${ac_cv_c_bigendian}" = "yes"
Sam Hocevar's avatar
 
Sam Hocevar committed
2441 2442 2443
then
  AC_DEFINE(WORDS_BIGENDIAN, 1, big endian system)
fi
2444

Sam Hocevar's avatar
 
Sam Hocevar committed
2445 2446 2447 2448
dnl
dnl  Profiling
dnl
AC_ARG_ENABLE(gprof,
2449
[  --enable-gprof          gprof profiling (default disabled)])
Sam Hocevar's avatar
 
Sam Hocevar committed
2450
AC_ARG_ENABLE(cprof,
2451 2452 2453
[  --enable-cprof          cprof profiling (default disabled)])
AM_CONDITIONAL(GPROF, test "x${enable_gprof}" = "xyes")
AM_CONDITIONAL(CPROF, test "x${enable_gprof}" = "xyes")
Sam Hocevar's avatar
 
Sam Hocevar committed
2454 2455 2456 2457 2458 2459

dnl
dnl  GNU portable threads
dnl
AC_ARG_ENABLE(pth,
  [  --enable-pth            GNU Pth support (default disabled)],
2460
  [ if test "x${enable_pth}" = "xyes"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473
    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)],
2474
  [ if test "x${enable_st}" = "xyes"; then
Sam Hocevar's avatar
 
Sam Hocevar committed
2475 2476 2477 2478 2479 2480 2481 2482
    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])
])

Gildas Bazin's avatar
 
Gildas Bazin committed
2483 2484 2485 2486
if test "x${SYS}" != "xmingw32"; then
  LDFLAGS_vlc="${LDFLAGS_vlc} ${THREAD_LIB}"
  LDFLAGS_plugins="${LDFLAGS_plugins} ${THREAD_LIB}"
fi
Sam Hocevar's avatar
 
Sam Hocevar committed
2487

2488 2489 2490
dnl
dnl  Mozilla plugin
dnl
2491
mozilla=false
2492 2493
AC_ARG_ENABLE(mozilla,
  [  --enable-mozilla        build a vlc-based Mozilla plugin (default disabled)])
2494
if test "x${enable_mozilla}" = "xyes"
2495 2496
then
  AC_PATH_PROG(MOZILLA_CONFIG, mozilla-config, no)
2497
  if test "x${MOZILLA_CONFIG}" != "xno"
2498
  then
2499
    if test "x${SYS}" != "xmingw32"; then
2500
      LDFLAGS="${LDFLAGS_save} -L${x_libraries}"
2501
      AC_CHECK_LIB(Xt,XtStrings,[
2502
        LDFLAGS_mozilla="${LDFLAGS_mozilla} -L${x_libraries} -lXt"
2503
      ])
2504
      LDFLAGS="${LDFLAGS_save}"
2505
    fi
2506
    mozilla=:
2507
    dnl Workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=150490
2508 2509 2510 2511 2512 2513 2514 2515
    [CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
    #[CPPFLAGS_mozilla="${CPPFLAGS_mozilla} `${MOZILLA_CONFIG} --cflags plugin xpcom java --defines | sed 's,-I\([^ ]*\)/mozilla/\([^ ]*\),-I\1/\2 -I\1/mozilla/\2,g' | xargs`"]
    LDFLAGS_mozilla="${LDFLAGS_mozilla} `${MOZILLA_CONFIG} --libs plugin xpcom`"
    dnl Not necessarily in ${PATH}
    if test "x${XPIDL}" = "x" -o ! -x "${XPIDL}"
    then
      XPIDL="/usr/lib/mozilla/xpidl"
    fi
2516 2517
  fi
fi
2518
AM_CONDITIONAL(BUILD_MOZILLA,${mozilla})
2519

2520 2521 2522 2523 2524 2525 2526
dnl
dnl  test plugins
dnl
AC_ARG_ENABLE(testsuite,
  [  --enable-testsuite      build test modules (default disabled)])
if test "x${enable_testsuite}" = "xyes"
then
2527 2528
  TESTS="test1 test2 test3 test4"

2529 2530 2531 2532 2533
  dnl  we define those so that bootstrap sets the right linker
  CXXFLAGS_test2="${CXXFLAGS_test2}"
  OBJCFLAGS_test3="${OBJCFLAGS_test3}"
  dnl  this one is needed until automake knows what to do
  LDFLAGS_test3="${LDFLAGS_test3} -lobjc"
2534

2535
  PLUGINS="${PLUGINS} ${TESTS}"
Sam Hocevar's avatar
Sam Hocevar committed
2536
  #BUILTINS="${BUILTINS} ${TESTS}"
2537 2538
fi

2539 2540 2541 2542 2543
dnl
dnl  gtk_main plugin
dnl
if test "x${NEED_GTK_MAIN}" != "xno"
then
2544
    PLUGINS="${PLUGINS} gtk_main"
2545
    CFLAGS_gtk="${CFLAGS_gtk} -DNEED_GTK_MAIN"
2546 2547 2548 2549 2550 2551 2552 2553 2554
    CFLAGS_gtk_main="${CFLAGS_gtk_main} ${CFLAGS_gtk} ${CFLAGS_familiar}"
    LDFLAGS_gtk_main="${LDFLAGS_gtk_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar}"
fi

if test "x${NEED_GNOME_MAIN}" != "xno"
then
    PLUGINS="${PLUGINS} gnome_main"
    CFLAGS_gnome_main="${CFLAGS_gnome_main} ${CFLAGS_gtk} ${CFLAGS_familiar} ${CFLAGS_gnome}"
    LDFLAGS_gnome_main="${LDFLAGS_gnome_main} ${LDFLAGS_gtk} ${LDFLAGS_familiar} ${LDFLAGS_gnome}"
2555 2556
fi

Sam Hocevar's avatar
 
Sam Hocevar committed
2557
dnl
2558
dnl  Plugin and builtin checks
Sam Hocevar's avatar
 
Sam Hocevar committed
2559
dnl
2560 2561 2562 2563
builtin_support=false
plugin_support=:

dnl Support for plugins - this must be AT THE END
Sam Hocevar's avatar
 
Sam Hocevar committed
2564
AC_ARG_ENABLE(plugins,
2565
  [  --disable-plugins       make all plugins built-in (default plugins enabled)],
2566
  [if test "x${enable_plugins}" = "xno"
Sam Hocevar's avatar
 
Sam Hocevar committed
2567
   then
2568
     plugin_support=false
Sam Hocevar's avatar
 
Sam Hocevar committed
2569 2570
   fi])

2571 2572 2573
dnl Automagically disable plugins if there is no system support for
dnl dynamically loadable files (.so, .dll, .dylib).
dnl don't forget vlc-win32 still can load .dll as plugins
2574
if test "x${ac_cv_header_dlfcn_h}" = "xno" -a "x${ac_cv_header_image_h}" = "xno" -a "x${SYS}" != "xmingw32"
2575
then
2576 2577 2578 2579 2580 2581 2582 2583 2584 2585
  echo "*** Your system doesn't have plugin support. All plugins will be built"
  echo "statically."
  plugin_support=false
fi

dnl Export automake variables
if ${plugin_support}
then
  for plugin in `echo ${PLUGINS}`
  do
2586
    eval "${plugin}_plugin=yes"
2587 2588
  done
else
2589 2590 2591
  BUILTINS="${BUILTINS} ${PLUGINS}"
  PLUGINS=
fi
2592 2593 2594 2595 2596 2597 2598
AM_CONDITIONAL(HAVE_PLUGINS, ${plugin_support})

[if echo "${BUILTINS}" | grep '[^ ]' >/dev/null 2>&1
then
  builtin_support=:
  for builtin in `echo ${BUILTINS}`
  do
2599
    eval "${builtin}_builtin=yes"
2600 2601 2602 2603 2604 2605
  done
fi]
AM_CONDITIONAL(HAVE_BUILTINS, ${builtin_support})

dnl do not touch this line (bootstrap needs it)

2606

Sam Hocevar's avatar
 
Sam Hocevar committed
2607 2608 2609
dnl
dnl  Stuff used by the program
dnl
Sam Hocevar's avatar
Sam Hocevar committed
2610
AC_DEFINE_UNQUOTED(VERSION_MESSAGE, "${VERSION} ${CODENAME}", [Simple version string])
2611 2612
AC_DEFINE_UNQUOTED(COPYRIGHT_MESSAGE, "VideoLAN Client - version ${VERSION} ${CODENAME} - (c) 1996-2002 VideoLAN", [Copyright string])
AC_DEFINE_UNQUOTED(CONFIGURE_LINE, "${CONFIGURE_LINE}", [The ./configure command line])
Sam Hocevar's avatar
 
Sam Hocevar committed
2613

Sam Hocevar's avatar
 
Sam Hocevar committed
2614
VLC_SYMBOL="`echo ${VERSION} | tr .- __`"
2615
AC_DEFINE_UNQUOTED(MODULE_SUFFIX, "__${VLC_SYMBOL}", [String suffix for module functions])
2616
AC_DEFINE_UNQUOTED(MODULE_SYMBOL, ${VLC_SYMBOL}, [Symbol suffix for module functions])
2617
AC_DEFINE_UNQUOTED(LIBEXT, "${LIBEXT}", [Dynamic object extension])
Sam Hocevar's avatar
 
Sam Hocevar committed
2618 2619 2620 2621 2622 2623

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
2624 2625 2626
dnl
dnl  Restore *FLAGS
dnl
2627 2628 2629 2630 2631 2632 2633 2634 2635 2636 2637
CPPFLAGS="${CPPFLAGS_save}"
CFLAGS="${CFLAGS_save}"
CXXFLAGS="${CXXFLAGS_save}"
OBJCFLAGS="${OBJCFLAGS_save}"
LDFLAGS="${LDFLAGS_save}"

dnl
dnl  Fool automake (see Makefile.am)
dnl
AUTOMAKE_SUCKS="\$(L_builtin) \$(LDFLAGS_builtin)"
AC_SUBST(AUTOMAKE_SUCKS)
Sam Hocevar's avatar
Sam Hocevar committed
2638

2639 2640 2641
dnl
dnl  Create the vlc-config script
dnl
2642 2643
LDFLAGS_libvlc="${LDFLAGS_vlc} ${LDFLAGS_builtins}"
for i in `echo "${BUILTINS}" | sed -e 's@[^ ]*/@@g'` ; do LDFLAGS_libvlc="${LDFLAGS_libvlc} ${libdir}/vlc/${i}.a `eval echo '$'{LDFLAGS_${i}}`" ; done
2644

2645
dnl
Sam Hocevar's avatar
 
Sam Hocevar committed
2646 2647
dnl  Configuration is finished
dnl
2648 2649
AC_SUBST(SYS)
AC_SUBST(ARCH)
2650
AC_SUBST(PLUGINS)
Sam Hocevar's avatar
 
Sam Hocevar committed
2651
AC_SUBST(BUILTINS)
2652
AC_SUBST(ALIASES)
Sam Hocevar's avatar
 
Sam Hocevar committed
2653
AC_SUBST(ASM)
Sam Hocevar's avatar
 
Sam Hocevar committed
2654
AC_SUBST(MOC)
Sam Hocevar's avatar
 
Sam Hocevar committed
2655
AC_SUBST(WINDRES)
Sam Hocevar's avatar
 
Sam Hocevar committed
2656
AC_SUBST(BCBUILDER)
2657 2658
AC_SUBST(XPIDL)
AC_SUBST(LIBEXT)
2659
AC_SUBST(INCLUDES)
Sam Hocevar's avatar
 
Sam Hocevar committed
2660

2661
AC_SUBST(CFLAGS_TUNING)
Sam Hocevar's avatar
 
Sam Hocevar committed
2662 2663
AC_SUBST(CFLAGS_OPTIM)
AC_SUBST(CFLAGS_OPTIM_NODEBUG)
Sam Hocevar's avatar
 
Sam Hocevar committed
2664
AC_SUBST(LDFLAGS)
Sam Hocevar's avatar
 
Sam Hocevar committed
2665

2666 2667
AC_SUBST(CFLAGS_vlc)
AC_SUBST(CFLAGS_pics)
Gildas Bazin's avatar
 
Gildas Bazin committed
2668
AC_SUBST(CXXFLAGS_pics)
2669
AC_SUBST(CFLAGS_plugins)
Gildas Bazin's avatar
 
Gildas Bazin committed
2670
AC_SUBST(CXXFLAGS_plugins)
2671 2672 2673 2674 2675 2676 2677 2678 2679
AC_SUBST(CFLAGS_builtins)
AC_SUBST(CPPFLAGS_mozilla)

AC_SUBST(LDFLAGS_vlc)
AC_SUBST(LDFLAGS_libvlc)
AC_SUBST(LDFLAGS_plugins)
AC_SUBST(LDFLAGS_builtins)
AC_SUBST(LDFLAGS_mozilla)

2680 2681
AC_OUTPUT([
  Makefile
2682 2683
  debian/Makefile
  doc/Makefile
2684
  intl/Makefile
2685 2686 2687 2688
  ipkg/Makefile
  lib/Makefile
  m4/Makefile
  modules/Makefile
2689
  po/Makefile.in
2690 2691
  share/Makefile
  src/Makefile
2692 2693 2694 2695
  vlc-config
],[
  chmod a+x vlc-config
])
2696

2697
printf "
Sam Hocevar's avatar
 
Sam Hocevar committed
2698
vlc configuration
Sam Hocevar's avatar
 
Sam Hocevar committed
2699
--------------------
Sam Hocevar's avatar
 
Sam Hocevar committed
2700
vlc version           : ${VERSION}
Sam Hocevar's avatar
 
Sam Hocevar committed
2701 2702
system                : ${SYS}
architecture          : ${ARCH}
2703 2704 2705 2706 2707 2708 2709
build flavour         : "
test "x${DEBUG_TRUE}" = "x" && printf "debug "
test "x${CPROF_TRUE}" = "x" && printf "cprof "
test "x${GPROF_TRUE}" = "x" && printf "gprof "
test "x${OPTIM_TRUE}" = "x" && printf "optim "
test "x${RELEASE_TRUE}" = "x" && printf "release " || printf "devel "
echo "
Sam Hocevar's avatar
 
Sam Hocevar committed
2710
vlc aliases           :${ALIASES}
Sam Hocevar's avatar
 
Sam Hocevar committed
2711

2712
To build vlc and its plugins, type \`make'.
Sam Hocevar's avatar
 
Sam Hocevar committed
2713
"
2714