root/vic/branches/mpeg4/configure.in @ 4856

Revision 4856, 27.0 KB (checked in by douglask, 4 years ago)

Added test for dlsym function in libdl (as needed by Fedora 13)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1dnl 'autoconf' input file for the LBL/UCB vic tool
2dnl $Header$ (LBL)
3
4AC_INIT(main.cpp)
5
6AC_PROG_INSTALL
7
8V_PROG="vic"
9V_SHM="-DUSE_SHM"
10V_PATH=`pwd`
11V_OBJ=""
12V_LIB=""
13V_CODEC_LIB=""
14V_DEFINE=""
15
16#ARCH DETECTION
17v_ARCH=""
18arch=`uname -m`
19case "$arch" in
20  i386|i486|i586|i686|i86pc|BePC)
21    V_ARCH="ARCH_X86"
22  ;;
23  x86_64|amd64)
24    V_ARCH="ARCH_X86_64"
25  ;;
26  "Power Macintosh"|ppc|ppc64|powerpc)
27    V_ARCH="ARCH_PPC"
28    case "$target" in (*darwin*) V_DEFINE="$V_DEFINE -DSYS_DARWIN";; esac
29    ffmpeg_conf="--disable-altivec"
30    ppc_tune="-mcpu=G3"
31    if sysctl hw.vectorunit 2>/dev/null | grep "hw.vectorunit: 1" >/dev/null 2>&1; then
32        ffmpeg_conf=""
33        ppc_tune="-mcpu=G4 -mtune=G4"
34    fi
35  ;;
36esac
37
38echo "Architecture             $V_ARCH"
39
40
41builtin(include, configure.in.head)
42
43#XXX
44V_STATIC="-static"
45V_LIB_GRABBER=""
46V_INCLUDE_GRABBER=""
47V_OBJ_GRABBER=""
48V_LIB_XIL=""
49V_OBJ_XIL=""
50V_LIB_FFMPEG=""
51V_LIB_X264=""
52V_DDRAW=""
53
54dnl Optimisation in H261 decoder needs to be turned off for GCC 2.96
55
56AC_MSG_CHECKING([for buggy version of GCC-2.96])
57if test $CC = gcc ; then
58     if $CC --version | grep 2.96 >&/dev/null; then
59           AC_MSG_RESULT([Yes - Turning off optimisation for dct code])
60           V_CCOPT_H261="";
61     else
62           AC_MSG_RESULT(no)
63     fi
64fi
65
66if test -f codec/encoder-bvc.cpp ; then
67        V_OBJ="$V_OBJ codec/encoder-bvc.o codec/decoder-bvc.o"
68fi
69
70AC_ARG_WITH(aix-shm,    --with-aix-shm=path     specify a pathname for the AIX shm X extension library file, lib=$withval, lib="")
71if test "$lib" != "" ; then
72        if test ! -r $lib ; then
73                echo "'$lib' does not exist"
74                exit 1
75        fi
76        V_LIB_AIXSHM=$lib
77else
78        V_LIB_AIXSHM=""
79fi
80
81AC_ARG_WITH(qcam,       --with-qcam=dir     specify directory with qcam.h for Connectix QuickCam device driver, qcamdir=$withval, qcamdir="")
82if test "$qcamdir" != "" -a ! -r $qcamdir/qcam.h ; then
83        echo "'$dir/qcam.h' does not exist"
84        exit 1
85fi
86
87
88V_DV=""
89dnl dv decoding support
90AC_ARG_ENABLE(dvdecode, --enable-dvdecode       Enable or disable dv decoding (default: disabled), dvdecode=yes, dvdecode=no)
91if test "$dvdecode" = "yes"; then
92   AC_CHECK_LIB([dv], [main], [], [
93      echo "Error! libdv not available. Please install libdv."
94      exit 1
95      ])
96   AC_CHECK_HEADERS([libdv/dv.h], [], [
97      echo "Error! libdv/dv.h not found. Please install libdv developer package."
98      exit 1
99      ])
100   V_OBJ="$V_OBJ codec/decoder-dv.o"
101   V_DV="-DUSE_DVDECODER"
102   V_LIB="$V_LIB -ldv"
103fi
104
105dnl xvideo rendering support
106V_XV=""
107AC_ARG_ENABLE(xvideo, --enable-xvideo           Enable or disable Xvideo rendering (default: disabled), xvideo=yes, xvideo=no)
108if test "$xvideo" = "yes"; then
109
110   dnl Look for the PIC library first, Debian requires it.
111   AC_CHECK_LIB(Xv_pic, XvQueryExtension,
112                 HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
113                 -lXext)
114   if test $HAVE_XVIDEO = "yes"; then
115        V_LIB="$V_LIB -lXv_pic"
116        V_XV="-DHAVE_XVIDEO"
117        V_OBJ="$V_OBJ render/xvideo.o"
118   else
119   dnl try again using something else if we didn't find it first
120
121        AC_CHECK_LIB(Xv, XvQueryExtension,
122                HAVE_XVIDEO="yes", HAVE_XVIDEO="no",
123                -lXext)
124
125        if test $HAVE_XVIDEO = "yes"; then
126            V_XV="-DHAVE_XVIDEO"
127            V_LIB="$V_LIB -lXv"
128            V_OBJ="$V_OBJ render/xvideo.o"
129        fi
130   fi
131
132   if test $HAVE_XVIDEO = "yes"; then
133        AC_CHECK_HEADERS([X11/extensions/Xvlib.h], [], [
134        echo "Error! \"X11/extensions/Xvlib.h\" not found. Please install \"libxv-dev\" package."
135                exit 1
136        ])
137   fi
138fi
139
140dnl lots of hairy special cases for detecting which frame capture
141dnl support to compile in
142
143AC_MSG_NOTICE([checking for V4L support])
144AC_CHECK_HEADER([linux/videodev.h],
145        [ have_videodev_h=yes; ],
146        [AC_CHECK_HEADER([/usr/local/include/linux/videodev.h],[ have_videodev_h=yes; ])])
147if test x$have_videodev_h = xyes; then
148        AC_MSG_NOTICE([suitable V4L support found... using linux/videodev.h])
149        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-video4linux.o"
150        have_V4L=yes
151fi
152
153AC_MSG_NOTICE([checking for V4L2 support])
154AC_CHECK_HEADER([linux/videodev2.h], [ have_linux_videodev2_h=yes; ])
155AC_CHECK_HEADER([sys/videodev2.h], [ have_sys_videodev2_h=yes; ])
156AC_CHECK_HEADER([sys/videoio.h], [ have_sys_videoio_h=yes; ])
157
158if test x$have_linux_videodev2_h = xyes ; then
159        AC_MSG_NOTICE([suitable V4L2 support found... using linux/videodev2.h])
160        V_DEFINE="$V_DEFINE -DHAVE_LINUX_VIDEODEV2_H"
161        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
162        have_V4L2=yes
163
164elif test x$have_sys_videodev2_h = xyes; then
165        AC_MSG_NOTICE([suitable V4L2 support found... using sys/videodev2.h])
166        V_DEFINE="$V_DEFINE -DHAVE_SYS_VIDEODEV2_H"
167        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
168        have_V4L2=yes
169
170elif test x$have_sys_videodev2_h = xyes; then
171        AC_MSG_NOTICE([suitable V4L2 support found... using sys/videoio.h])
172        V_DEFINE="$V_DEFINE -DHAVE_SYS_VIDEOIO_H"
173        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-v4l2.o"
174        have_V4L2=yes
175
176fi
177
178if test x$have_V4L = xyes -o x$have_V4L2 = xyes; then
179        V_OBJ_GRABBER="$V_OBJ_GRABBER video/yuv_convert.o"
180fi
181
182AC_CHECK_HEADER([libv4lconvert.h], [ have_libv4lconvert_h=yes; ])
183if test x$have_libv4lconvert_h = xyes; then
184        V_DEFINE="$V_DEFINE -DHAVE_LIBV4L"
185        if test x$have_V4L = xyes; then
186                V_LIB_GRABBER="$V_LIB_GRABBER -lv4l1"
187        fi
188        if test x$have_V4L2 = xyes; then
189                V_LIB_GRABBER="$V_LIB_GRABBER -lv4l2"
190        fi
191else
192        V_OBJ_GRABBER="$V_OBJ_GRABBER  video/tinyjpeg.o video/jidctflt.o"
193fi
194
195AC_ARG_WITH(decklink,--with-decklink=dir     specify directory containing DeckLinkAPIDispatch.cpp, with_decklinkapidispatch=${withval})
196AC_MSG_NOTICE([checking for Blackmagic DeckLink SDK])
197AC_CACHE_VAL(ac_cv_c_decklinkapidispatch,[
198        # First check to see if --with-decklink was specified.
199        if test x"${with_decklinkapidispatch}" != x ; then
200                case ${with_decklinkapidispatch} in
201                */DeckLinkAPIDispatch.cpp )
202                        if test -f ${with_decklinkapidispatch}; then
203                                AC_MSG_WARN([--with-decklink argument should refer to directory containing DeckLinkAPIDispatch.cpp, not to DeckLinkAPIDispatch.cpp itself])
204                                with_decklinkapidispatch=`echo ${with_decklinkapidispatch} | sed 's!/DeckLinkAPIDispatch\.cpp!!'`
205                        fi ;;
206                esac
207                if test -f "${with_decklinkapidispatch}/DeckLinkAPIDispatch.cpp" ; then
208                    ac_cv_c_decklinkapidispatch=`(cd ${with_decklinkapidispatch}; pwd)`
209                else
210                    AC_MSG_ERROR([${with_decklinkapidispatch} directory doesn't contain DeckLinkAPIDispatch.cpp])
211                fi
212        fi
213
214        # then check for a private Blackmagic DeckLink SDK installation
215        if test x"${ac_cv_c_decklinkapidispatch}" = x ; then
216                as_save_IFS=$IFS
217                IFS=`echo`
218                for i in \
219                        `ls -dr "Blackmagic DeckLink SDK "[[0-9]]* 2>/dev/null` \
220                        `ls -dr ../"Blackmagic DeckLink SDK "[[0-9]]* 2>/dev/null` \
221                        `ls -dr $HOME/"Blackmagic DeckLink SDK "[[0-9]]* 2>/dev/null` \
222                        `ls -dr $HOME/Downloads/"Blackmagic DeckLink SDK "[[0-9]]* 2>/dev/null` \
223                        `ls -dr /usr/local/"Blackmagic DeckLink SDK "[[0-9]]* 2>/dev/null` \
224                        `ls -dr /opt/local/"Blackmagic DeckLink SDK "[[0-9]]* 2>/dev/null` ; do
225                        case "$target" in
226                        *linux* )
227                                if test -f "$i/Linux/include/DeckLinkAPIDispatch.cpp" ; then
228                                        ac_cv_c_decklinkapidispatch=`(cd "$i/Linux/include"; pwd)`
229                                        break
230                                fi ;;
231                        *darwin* )
232                                if test -f "$i/Mac/include/DeckLinkAPIDispatch.cpp" ; then
233                                        ac_cv_c_decklinkapidispatch=`(cd "$i/Mac/include"; pwd)`
234                                        break
235                                fi ;;
236                        esac
237                done
238                IFS=$as_save_IFS
239        fi
240])
241if test x"${ac_cv_c_decklinkapidispatch}" = x ; then
242        AC_MSG_WARN([no DeckLinkAPIDispatch.cpp file found])
243else
244        AC_MSG_RESULT([found ${ac_cv_c_decklinkapidispatch}/DeckLinkAPIDispatch.cpp])
245        V_INCLUDE="$V_INCLUDE -I\"${ac_cv_c_decklinkapidispatch}\""
246        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-decklink.o"
247
248        AC_CHECK_LIB(dl, dlsym, [V_LIB="$V_LIB -ldl"])
249fi
250
251if test -r /usr/lib/libvl.so ; then
252        V_LIB_GRABBER="$V_LIB_GRABBER -lvl -ldmedia"
253        V_OBJ_GRABBER="video/grabber-vl.o video/output-vl.o $V_OBJ_GRABBER"
254        if test -r /usr/include/dmedia/cl_cosmo.h  ; then
255                V_LIB_GRABBER="$V_LIB_GRABBER -lcl"
256                V_OBJ_GRABBER="video/grabber-cosmo.o $V_OBJ_GRABBER"
257        fi
258fi
259if test -r /usr/lib/libsvideo.a ; then
260        V_LIB_GRABBER="$V_LIB_GRABBER -lsvideo"
261        V_OBJ_GRABBER="video/grabber-svideo.o $V_OBJ_GRABBER"
262fi
263
264AC_ARG_ENABLE(XvGrabber,--enable-XvGrabber    Enable or disable old XvGrabber (default: disabled), XvGrabber=yes, XvGrabber=no)
265if test -r /usr/lib/libXv.a -a "$XvGrabber" = "yes" ; then
266        V_LIB_GRABBER="$V_LIB_GRABBER -lXv"
267        V_DEFINE="$V_DEFINE -DXV_PSEUDO8"
268        V_OBJ_GRABBER="video/grabber-xv.o $V_OBJ_GRABBER"
269fi
270if test -r /usr/lpp/parallax/lib/libXvid.a ; then
271    V_LIB_GRABBER="$V_LIB_GRABBER -L/usr/lpp/parallax/lib -lXvid -lXv"
272    V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/lpp/parallax/include"
273    V_OBJ_GRABBER="video/grabber-plx.o video/assistor-plx.o $V_OBJ_GRABBER"
274fi
275if test -r /usr/lpp/UMS6000/lib/libUMSobj.a ; then
276        V_LIB_GRABBER="$V_LIB_GRABBER -L/usr/lpp/UMS6000/lib -lUMSobj"
277        V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/lpp/UMS6000/include"
278        V_DEFINE="$V_DEFINE -DSUNRISE"
279        V_OBJ_GRABBER="video/grabber-sunrise.o video/output-sunrise.o $V_OBJ_GRABBER"
280fi
281
282if test -r /usr/include/machine/ioctl_meteor.h -o \
283    -r /usr/include/dev/ic/bt8xx.h ; then
284        V_OBJ_GRABBER="video/grabber-meteor.o $V_OBJ_GRABBER"
285fi
286
287AC_ARG_ENABLE(Linux1394Grabber,--enable-Linux1394Grabber    Enable or disable Linux1394XvGrabber (default: disabled), Linux1394Grabber=yes, Linux1394Grabber=no)
288if test -r /usr/include/libdc1394/dc1394_control.h -a -r /usr/include/libraw1394/raw1394.h -a "$Linux1394Grabber" = "yes"; then
289      V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-linux1394.o"
290      V_LIB_GRABBER="$V_LIB_GRABBER -lraw1394 -ldc1394_control"
291fi
292
293#if test -r /usr/local/lib/libspigot.a -a ${PORTOBJFORMAT} != elf; then
294if test -r /usr/local/lib/libspigot.a ; then
295        V_OBJ_GRABBER="video/grabber-spigot.o $V_OBJ_GRABBER"
296        V_LIB_GRABBER="$V_LIB_GRABBER -lspigot"
297        V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/local/include"
298fi
299
300if test "$qcamdir" != "" ; then
301        V_OBJ_GRABBER="video/grabber-qcam.o $V_OBJ_GRABBER"
302        V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$qcamdir"
303        V_DEFINE="$V_DEFINE -DQCAMDEV -DQCAMDOTH=qcam.h"
304elif test -r /usr/local/lib/libqcam.a ; then
305        V_OBJ_GRABBER="video/grabber-qcam.o $V_OBJ_GRABBER"
306        V_LIB_GRABBER="$V_LIB_GRABBER -lqcam"
307        V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I/usr/local/include"
308        V_DEFINE="$V_DEFINE -DQCAMLIB"
309elif test -r /dev/qcam0 ; then
310        V_OBJ_GRABBER="video/grabber-qcam.o $V_OBJ_GRABBER"
311        V_DEFINE="$V_DEFINE -DQCAMDEV"
312fi
313vpix_dir=/usr/src/local/vfc-1.0
314vpix_lib=$vpix_dir/vfc_lib
315if test -d /import/VideoPix ; then
316        vpix_dir=/import/VideoPix
317        vpic_lib=$vpix_dir/lib
318fi
319if test -d $vpix_dir ; then
320        V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$vpix_dir/sys -I$vpix_lib"
321        V_LIB_GRABBER="$V_LIB_GRABBER $vpix_lib/libvfc.a"
322        V_DEFINE="$V_DEFINE -DVIDEOPIX"
323        V_OBJ_GRABBER="video/grabber-vpix.o $V_OBJ_GRABBER"
324fi
325places="/usr/src/local/vigrapix/lib \
326        /opt/VIGRAvigrapix/lib"
327for dir in $places; do
328        if test -d $dir ; then
329                V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$dir"
330                V_LIB_GRABBER="$V_LIB_GRABBER $dir/libvigrapix.a"
331                V_OBJ_GRABBER="video/grabber-vigra.o $V_OBJ_GRABBER"
332                break
333        fi
334done
335
336d=/opt/MMACslv
337if test -d $d ; then
338        V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$d/include"
339        V_LIB_GRABBER="$V_LIB_GRABBER $d/lib/libslv.a -lintl"
340        V_OBJ_GRABBER="video/grabber-slv.o $V_OBJ_GRABBER"
341fi
342
343d=/usr/include/mme
344if test -d $d ; then
345        V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$d"
346        V_LIB_GRABBER="$V_LIB_GRABBER -lmme"
347        V_OBJ_GRABBER="video/grabber-mme.o $V_OBJ_GRABBER"
348fi
349
350places="/opt/parallax \
351        /usr/src/local/parallax \
352        /usr/local/parallax \
353        /usr/local/parallax/components/Xclients_sun4.ow3_1.18 \
354        /usr/src/local/parallax/components/Xclients_sun4.ow3_1.18"
355for dir in $places; do
356        if test -d $dir/include ; then
357                V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$dir/include"
358                V_LIB_GRABBER="$V_LIB_GRABBER -L$dir/lib -lXext -lXvid"
359                V_OBJ_GRABBER="video/grabber-plx.o video/assistor-plx.o $V_OBJ_GRABBER"
360                break
361        fi
362done
363
364case "$target" in
365*-dec-*)
366        jv_dir=jv2
367        V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$jv_dir"
368        V_LIB_GRABBER="$V_LIB_GRABBER $jv_dir/jvdriverint.o"
369        V_OBJ_GRABBER="video/assistor-jv.o video/grabber-jv.o $V_OBJ_GRABBER"
370        if test "$target_os" = ultrix4.3 ; then
371                #XXX rtip code currently broken
372                #V_DEFINE="$V_DEFINE -DRTIP"
373                #V_LIB="$V_LIB lib.ultrix/librcap.a"
374                #V_INCLUDE="$V_INCLUDE -Ircap-include"
375                #XXX
376                #V_OBJ_GRABBER="$V_OBJ_GRABBER net-rtip.o"
377                echo no rtip support
378        fi
379        ;;
380sparc-sun-solaris*)
381        V_STATIC=""
382        have_xil=no
383        xil_dir=/usr/openwin
384        if test -d $xil_dir ; then
385                if test ! -d $xil_dir/include/xil ; then
386                        echo "You don't have the XIL developer's kit!"
387                        echo "Building without XIL support..."
388                else
389                        echo "Using XIL developer's kit (Found in: $xil_dir/include/xil)"
390                        have_xil=yes
391                fi
392        fi
393        SYSINC="-I"
394        if test $CC = gcc ; then
395                V_DEFINE="$V_DEFINE -mv8 -msupersparc"
396                SYSINC="-isystem "
397        elif  test -z "$enable_debug" ; then
398                V_CCOPT="-xO2";
399        fi
400        if test $ipv6 = yes; then
401                V_DEFINE="$V_DEFINE -D__svr4__ -DSolaris -DHAVE_IPV6 -DSOLARIS7_IPV6"
402        else
403                V_DEFINE="$V_DEFINE -D__svr4__ -DSolaris"
404        fi
405        OPSYS=solaris
406        if test -f video/grabber-rtvc.cpp || test -f video/grabber-rtvc.o ; then
407                V_OBJ_GRABBER="video/grabber-rtvc.o $V_OBJ_GRABBER"
408                if test "$have_xil" = yes ; then
409                        V_PROG="vic vic.xil"
410                        V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER $SYSINC$xil_dir/include -DSUNXIL_WARNING_DISABLE"
411                        V_LIB_XIL="-L$xil_dir/lib -R\"$xil_dir/lib:/opt/SUNWo1kp/lib:/opt/MMACo1k/lib\" -lxil"
412                        V_OBJ_XIL="video/grabber-xil.o codec/framer-h261hw.o codec/framer-cellb.o video/assistor-xil.o"
413                fi
414        elif test "$have_xil" = yes ; then
415                V_OBJ_XIL="video/grabber-xil.o codec/framer-h261hw.o codec/framer-cellb.o video/assistor-xil.o"
416                V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -I$xil_dir/include"
417                V_LIB_GRABBER="$V_LIB_GRABBER -L$xil_dir/lib -R\"$xil_dir/lib:/opt/SUNWo1kp/lib:/opt/MMACo1k/lib\" -lxil "
418        fi
419        ;;
420sparc-sun-sunos*)
421        V_DEFINE="$V_DEFINE -DNEED_SUNOS_PROTOS -DSunOS"
422        ;;
423*-sgi-irix*)
424        V_DEFINE="$V_DEFINE -D_BSD_SIGNALS -DIRIX"
425        OPSYS=irix
426        if test "$target_os" = irix6.2 ; then
427                V_DEFINE="$V_DEFINE -DIRIX6_2 -DSIGARGS=__sigargs"
428        fi
429        V_TARCMD="tar cfL"
430        V_SHELL="SHELL = /bin/sh"
431        if test $CC != gcc ; then
432                V_DEFINE="$V_DEFINE -signed -g3"
433                CC="cc -Dinline="
434                if test "$target_os" = irix5.2 ; then
435                        CC="$CC -xansi -D__STDC__"
436                fi
437                CXX="CC +p -float -woff 3262 -DSGI_COMPAT"
438        else
439                CXX=$CC
440        fi
441        V_STATIC=""
442        ;;
443*-*-bsdi1*)
444        V_SHM=""
445        V_TARCMD="tar cfL"
446        ;;
447*-*-bsdi2.0*)
448        V_SHM=""
449        V_TARCMD="tar cfL"
450        ;;
451*-*-bsdi*)
452        # bsdi2.1 added sys-v shared memory support but their implementation
453        # is broken so we have to turn it off.  If they ever fix libipc,
454        # the following line should be deleted.
455        V_SHM=""
456        V_TARCMD="tar cfL"
457        V_CCOPT="-O2 -m486"
458        V_LIB="$V_LIB -lipc"
459        ;;
460*-*-netbsd*)
461        if test "$gpl" = "yes" ; then
462                V_OBJ_GRABBER="video/grabber-ov511.o $V_OBJ_GRABBER"
463        fi
464        V_DEFINE="$V_DEFINE -DNetBSD"
465        V_STATIC=""
466        V_TARCMD="tar -h -c -f"
467        OPSYS=netbsd
468        ;;
469*-*-freebsd*)
470        if test "$gpl" = "yes" ; then
471                V_OBJ_GRABBER="video/grabber-ov511.o $V_OBJ_GRABBER"
472        fi
473        V_STATIC=""
474        V_DEFINE="$V_DEFINE -DSIGARGS=int -DFreeBSD"
475        if test $ipv6 = yes; then
476                V_DEFINE="$V_DEFINE -DHAVE_IPV6"
477                V_LIB="$V_LIB -L/usr/local/v6/lib"
478        fi
479        OPSYS=freebsd
480        ;;
481*-*-hpux*)
482        V_CCOPT="-O -DHPUX"
483        OPSYS=hpux
484        ;;
485*-*-aix3*)
486        V_STATIC=""
487        V_DEFINE="$V_DEFINE -DSIGARGS=int -DHPUX"
488        if test "$V_LIB_AIXSHM" != "" ; then
489                V_LIB="$V_LIB $V_LIB_AIXSHM"
490        else
491                V_SHM=""
492        fi
493        CXX="xlC -+"
494        ;;
495*-*-aix4*)
496        V_STATIC=""
497        V_DEFINE="$V_DEFINE -DSIGARGS=int -D_AIX41"
498        if test "$V_LIB_AIXSHM" != "" ; then
499                V_LIB="$V_LIB $V_LIB_AIXSHM"
500        else
501                V_SHM=""
502        fi
503        CXX="xlC -+"
504        ;;
505armv4l-*-linux)
506        V_STATIC=""
507        V_BROKEN_OBJ=
508        CC=arm-linux-gcc
509        CPP=arm-linux-g++
510        AR=arm-linux-ar
511        RANLIB=arm-linux-ranlib
512        if test $ipv6 = yes; then
513                V_DEFINE="$V_DEFINE -DLinux -DHAVE_IPV6 -DLINUX_IPV6"
514        else
515                V_DEFINE="$V_DEFINE -DLinux"
516        fi
517        OPSYS=linux
518        ;;
519*-*-linux*)
520        V_STATIC=""
521        V_BROKEN_OBJ=
522        if test $ipv6 = yes; then
523                V_DEFINE="$V_DEFINE -DLinux -DHAVE_IPV6 -DLINUX_IPV6"
524        else
525                V_DEFINE="$V_DEFINE -DLinux"
526        fi
527        OPSYS=linux
528        ;;
529*darwin*)
530        V_SHM=""
531        V_STATIC=""
532        V_BROKEN_OBJ=
533        V_DEFINE="$V_DEFINE -DHAVE_IPV6 -DHAVE_FAST_INT"
534        V_LIB="$V_LIB -framework Carbon -framework QuickTime"
535        if test "$target_cpu" = powerpc; then
536            V_CCOPT="-O2 $ppc_tune"
537        fi
538dnl Check for 64-bit host gcc - in Snow Leopard+
539        AC_MSG_CHECKING([for 64-bit gcc on OSX])
540        if gcc -v 2>&1 | grep host=x86_64 >& /dev/null ; then
541dnl Check for lack of 64-bit support in QT - an issue in Snow Leopard+
542           if ! file -L  /System/Library/Frameworks/QuickTime.framework/QuickTime 2>&1 | grep x86_64 >&/dev/null; then
543              AC_MSG_RESULT([Yes but forcing 32-bit due to QT])
544              V_CCOPT="$V_CCOPT -arch i386"
545              V_LDFLAGS="$V_LDFLAGS -arch i386  -mmacosx-version-min=10.4"
546dnl If gcc 32bit then we need to set these flags for compilation of ffmpeg and x264
547              V_CCLDFLAGS32="LDFLAGS='-arch i386 -mmacosx-version-min=10.4' CFLAGS='-arch i386'"
548           fi
549        else
550              AC_MSG_RESULT([No - using 32-bit])
551        fi
552        OPSYS=macosx
553        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-macosx.o video/yuv_convert.o"
554        ;;
555*mingw*|*mingw32*)
556        V_SHM=""
557                AC_CHECK_LIB(ws2_32, _head_libws2_32_a, ws2="yes", ws2="no")
558                if test "$ws2" == "yes"; then
559                    LIBS="$LIBS -lws2_32"
560                else
561                    AC_CHECK_LIB(wsock32, socket, ws1="yes", ws1="no")
562                        if test "$ws1" == "yes"; then
563                            LIBS="$LIBS -lwsock32"
564                        else
565                            AC_MSG_ERROR([Winsock library not found!])
566                        fi
567                fi
568                LIBS="$LIBS -liphlpapi -lvfw32 -lgdi32 -lole32 -loleaut32 -luuid -lcomctl32 -lcomdlg32 -limm32"
569                V_DEFINE="$V_DEFINE -DSTATIC_BUILD -DWIN32 -D_WINDOWS -DHAVE_SWSCALE -DHAVE_STDLIB_H -DSASR -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_WIN32_WINNT=_WIN32_WINNT_WINXP"
570                V_EXTRAC_OBJ="$V_EXTRAC_OBJ win32/win32.o getopt.o"
571                V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-win32.o video/yuv_convert.o"
572                V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-win32DS.o video/crossbar.o"
573                V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-decklink.o video/DeckLinkAPI_i.o"
574                V_LIB_GRABBER="$V_LIB_GRABBER dx9/Lib/x86/ddraw.lib dx9/Lib/x86/dxguid.lib dx9/Extras/DirectShow/Lib/x86/strmiids.lib dx9/Extras/DirectShow/Lib/x86/quartz.lib"
575                V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -Idx9/Include -Idx9/Extras/DirectShow/Include"
576                ffmpeg_conf="$ffmpeg_conf --enable-memalign-hack --enable-w32threads"
577                x264_conf="$x264_conf --disable-avis-input --disable-pthread"
578                AC_ARG_ENABLE(ddraw, --enable-ddraw        Enable or disable DirectDraw, ddraw="yes", ddraw="no")
579                if test "$ddraw" == "yes"; then
580                    V_DDRAW="-DUSE_DDRAW"
581                        echo "Using DirectDraw"
582                fi;
583                V_PROG="vic.exe"
584                V_CCOPT="$V_CCOPT -Wl,-subsystem,windows"
585                ;;
586esac
587
588case "$target" in
589*-*-darwin* | *-*-mingw* | *-*-cygwin* | *-*-pw32*)
590        ;;
591*)
592        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-x11.o"
593        ;;
594esac
595
596AC_ARG_ENABLE(gpl,      --enable-gpl    Enable or disable  use of gpl functionality - H264 MPEG4 Swscale, gpl="yes", gpl="no")
597if test "$gpl" = "yes" ; then
598  V_DEFINE="$V_DEFINE -DHAVE_SWSCALE"
599  V_OBJ="$V_OBJ codec/packetbuffer.o codec/databuffer.o \
600    codec/ffmpeg_codec.o codec/encoder-mpeg4.o codec/decoder-mpeg4.o \
601    codec/x264encoder.o codec/encoder-h264.o codec/decoder-h264.o \
602    codec/rtp_h264_depayloader.o render/color-swscale.o video/deinterlace.o"
603else
604  V_OBJ="$V_OBJ render/color-true.o  render/color-hi.o"
605fi
606
607AC_CHECK_PROG(DOWNLOAD, wget, [wget -q -O -])
608AC_CHECK_PROG(DOWNLOAD, curl, [curl -s])
609
610havex264="no"
611AC_ARG_WITH(ffmpegver,       --with-ffmpegver=ffmpeg-version     specify the version of ffmpeg to download and build, ffmpegver=$withval, ffmpegver=ffmpeg)
612AC_ARG_ENABLE(ffmpeg-co,        --disable-ffmpeg-co     Enable or disable ffmpeg download, ffmpegco="no", ffmpegco="yes")
613if test "$ffmpegco" = "yes" ; then
614  if test "$gpl" = "yes" ; then
615   if test ! -d ${ffmpegver} ; then
616      echo "Checking out r20462 (and 29824 of libswscale) of ffmpeg from svn://svn.ffmpeg.org/ffmpeg/trunk..."
617      svn checkout -q -r 20462 svn://svn.ffmpeg.org/ffmpeg/trunk ffmpeg
618      svn checkout -q -r 29824 svn://svn.ffmpeg.org/mplayer/trunk/libswscale  ffmpeg/libswscale
619   fi
620   patch --dry-run -sf -p0 < ffmpeg.iocom.patch >& /dev/null
621   if test $? = 0; then
622      echo "Patching ffmpeg h264 for IOCOM decode compatibility..."
623      patch -p0 < ffmpeg.iocom.patch
624   else
625      echo "ffmpeg has already been patched for IOCOM decode compatibility"
626   fi
627   echo "Configuring ffmpeg..."
628   echo "${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/ffmpeg $ffmpeg_conf --enable-gpl --enable-postproc"
629   cd ffmpeg && eval ${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/ffmpeg $ffmpeg_conf --enable-gpl --enable-postproc; cd ..
630   V_INCLUDE="$V_INCLUDE -Iffmpeg/include -Iffmpeg"
631   V_CODEC_LIB="$V_CODEC_LIB -Lffmpeg/lib -lavcodec -lavutil -lswscale -lpostproc "
632  else
633   echo "ffmpeg not available without --enable-gpl"
634  fi
635fi
636
637AC_ARG_WITH(x264ver,       --with-x264ver=x264ver-version     specify the version of x264 to download and build, x264ver=$withval, x264ver=x264-snapshot-20090708-2245)
638AC_ARG_ENABLE(x264-co,        --disable-x264-co      Enable or disable x264 download, x264co="no", x264co="yes")
639if test "$x264co" = "yes" ; then
640  if test "$gpl" = "yes" ; then
641   if test ! -d "x264" ; then
642     echo "Downloading ${x264ver} of x264 from videolan.org ..."
643     ${DOWNLOAD} http://downloads.videolan.org/pub/videolan/x264/snapshots/${x264ver}.tar.bz2 | tar xjf - && ln -sf ${x264ver} x264
644   fi
645   echo;echo "Configuring x264..."
646   echo "${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/x264"
647   cd x264 && eval ${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/x264 $x264_conf; cd ..
648   V_INCLUDE="$V_INCLUDE -Ix264/include"
649   V_CODEC_LIB="$V_CODEC_LIB -Lx264/lib -lx264"
650   havex264="yes"
651  else
652   echo "x264 not available without --enable-gpl"
653  fi
654fi
655
656AC_ARG_WITH(ffmpeginc,       --with-ffmpeginc=dir     specify the prefix directory of ffmpeg header, ffmpeginc=$withval, ffmpeginc="")
657AC_ARG_WITH(ffmpeglib,       --with-ffmpeglib=dir     specify the directory of ffmpeg library, ffmpeglib=$withval, ffmpeglib="")
658
659if test "$gpl" = "yes" ; then
660  if test "$ffmpegco" != "yes"; then
661
662        if test "$ffmpeginc" != "" ; then
663           if test ! -r $ffmpeginc/libavcodec/avcodec.h ; then
664                echo "Error! you need to have $ffmpeginc/ffmpeg/avcodec.h around"
665                exit 1
666           elif test ! -r $ffmpeginc/libavutil/avutil.h ; then
667                echo "Error! you need to have $ffmpeginc/ffmpeg/avutil.h around"
668                exit 1
669           elif test ! -r $ffmpeginc/libswscale/swscale.h ; then
670                echo "Error! you need to have $ffmpeginc/ffmpeg/swscale.h around"
671                exit 1
672           fi
673           echo "checking for FFmpeg headers...yes"
674           V_INCLUDE="$V_INCLUDE -I$ffmpeginc"
675
676        else
677
678           AC_CHECK_HEADER(libavcodec/avcodec.h, [], [
679                echo "Error! you need to have avcodec.h around."
680                exit -1
681           ])
682           AC_CHECK_HEADER(libavutil/avutil.h, [], [
683                echo "Error! you need to have avutil.h around."
684                exit -1
685           ])
686           AC_CHECK_HEADER(libswscale/swscale.h, [], [
687                echo "Error! you need to have swscale.h around."
688                exit -1
689           ])
690        fi
691
692        if test "$ffmpeglib" != "" ; then
693           if test ! -r $ffmpeglib/libavcodec.a ; then
694                    echo "Error! you need to have $ffmpeglib/libavcodec.a around"
695           elif test ! -r $ffmpeglib/libavutil.a ; then
696                echo "Error! you need to have $ffmpeglib/libavutil.a around"
697           elif test ! -r $ffmpeglib/libswscale.a ; then
698                echo "Error! you need to have $ffmpeglib/libswscale.a around"
699       elif test ! -r $ffmpeglib/libpostproc.a ; then
700            echo "Error! you need to have $ffmpeglib/libpostproc.a around"
701       fi
702
703           V_CODEC_LIB="$V_CODEC_LIB -L$ffmpeglib -lavcodec -lavutil -lswscale -lpostproc"
704        else
705           AC_CHECK_LIB(avcodec, main, [], [
706                echo "Error! you need to have libavcodec around."
707                exit -1
708           ])
709           AC_CHECK_LIB(avutil, main, [], [
710                echo "Error! you need to have libavutil around."
711                exit -1
712           ])
713           AC_CHECK_LIB(swscale, main, [], [
714                echo "Error! you need to have libswscale around."
715                exit -1
716           ])
717
718           AC_CHECK_LIB(postproc, main, [], [
719                        echo "Error! you need to have libpostproc around."
720                        exit -1
721           ])
722
723           V_CODEC_LIB="$V_CODEC_LIB -lavcodec -lavutil -lswscale -lpostproc"
724        fi
725  fi
726fi
727
728AC_ARG_WITH(x264inc,       --with-x264inc=dir     specify the directory of x264 header, x264inc=$withval, x264inc="")
729AC_ARG_WITH(x264lib,       --with-x264lib=dir     specify the directory of x264 library, x264lib=$withval, x264lib="")
730if test "$gpl" = "yes" ; then
731  if test "$x264co" != "yes" ; then
732        if test "$x264inc" != "" ; then
733           if test ! -r $x264inc/x264.h ; then
734                echo "Error! you need to have $x264inc/x264.h around."
735                exit 1
736           fi
737           V_INCLUDE="$V_INCLUDE -I$x264inc"
738        elif test ! -r /usr/local/include/x264.h -a ! -r /usr/include/x264.h ; then
739                echo "Error! you need to have x264.h around."
740                exit 1
741        else
742           echo "checking for x264.h...yes"
743        fi
744
745        if test "$x264lib" != "" ; then
746           if test ! -r $x264lib/libx264.a ; then
747                echo "Error! you need to have $x264lib/libx264.a around"
748                exit 1
749           fi
750           V_CODEC_LIB="$V_CODEC_LIB -L$x264lib -lx264"
751        else
752           AC_CHECK_LIB(x264, main, [], [
753                echo "Error! you need to have libx264 around."
754                exit -1
755           ])
756           V_CODEC_LIB="$V_CODEC_LIB -lx264"
757        fi
758        havex264="yes"
759 fi
760fi
761
762if test "$havex264" == "yes"; then
763    AC_CHECK_LIB(pthread, pthread_create, pthread="yes", pthread="no")
764        if test "$pthread" == "yes"; then
765            V_CODEC_LIB="$V_CODEC_LIB -lpthread"
766        else
767            AC_CHECK_LIB(pthreadGC2, pthread_create, pthreadGC2="yes", pthreadGC2="no")
768                if test "$pthreadGC2" == "yes"; then
769                    V_CODEC_LIB="$V_CODEC_LIB -lpthreadGC2"
770                        V_DEFINE="$V_DEFINE -DPTW32_STATIC_LIB"
771                fi
772        fi
773fi
774
775V_CPUDETECT=""
776AC_ARG_ENABLE(cpudetect, --disable-cpudetect     Enable or disable runtime cpu detection, cpudetect="no", cpudetect="yes")
777if test "$gpl" = "yes" ; then
778 if test "$cpudetect" = "yes"; then
779    echo "Using CPU runtime detection..."
780    V_CPUDETECT="-DRUNTIME_CPUDETECT"
781    V_CPUDETECT_OBJ="cpu/cpudetect.o cpu/cpuid.o"
782 fi
783 else
784   echo "No runtime cputect without --enable-gpl"
785fi
786
787AC_SUBST(V_LIB_FFMPEG)
788AC_SUBST(V_LIB_X264)
789AC_SUBST(V_INCLUDE_GRABBER)
790AC_SUBST(V_LIB_GRABBER)
791AC_SUBST(V_OBJ_GRABBER)
792AC_SUBST(V_LIB_XIL)
793AC_SUBST(V_OBJ_XIL)
794AC_SUBST(V_OBJ)
795AC_SUBST(V_LIB)
796AC_SUBST(V_CODEC_LIB)
797AC_SUBST(V_CPUDETECT_OBJ)
798AC_SUBST(V_PROG)
799
800V_DEFINE="$V_DEFINE $V_SHM $V_ZVFS $V_DDRAW $V_DV $V_XV $V_CPUDETECT -D$V_ARCH "
801
802builtin(include, configure.in.tail)
Note: See TracBrowser for help on using the browser.