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

Revision 4914, 28.2 KB (checked in by douglask, 3 years ago)

The MacOSX10.6 SDK is the last SDK that contain QuickTime? header files capable of building video/grabber-macosx.cpp

On Lion build using the 10.6 SDK and header files with '-isysroot /Developer/SDKs/MacOSX10.6.sdk'

  • 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_videoio_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*-*-openbsd*)
470        if test "$gpl" = "yes" ; then
471                V_OBJ_GRABBER="video/grabber-ov511.o $V_OBJ_GRABBER"
472        fi
473        V_DEFINE="$V_DEFINE -DOpenBSD"
474        V_STATIC=""
475        V_TARCMD="tar -h -c -f"
476        OPSYS=openbsd
477        ;;
478*-*-freebsd*)
479        if test "$gpl" = "yes" ; then
480                V_OBJ_GRABBER="video/grabber-ov511.o $V_OBJ_GRABBER"
481        fi
482        V_STATIC=""
483        V_DEFINE="$V_DEFINE -DSIGARGS=int -DFreeBSD"
484        if test $ipv6 = yes; then
485                V_DEFINE="$V_DEFINE -DHAVE_IPV6"
486                V_LIB="$V_LIB -L/usr/local/v6/lib"
487        fi
488        OPSYS=freebsd
489        ;;
490*-*-hpux*)
491        V_CCOPT="-O -DHPUX"
492        OPSYS=hpux
493        ;;
494*-*-aix3*)
495        V_STATIC=""
496        V_DEFINE="$V_DEFINE -DSIGARGS=int -DHPUX"
497        if test "$V_LIB_AIXSHM" != "" ; then
498                V_LIB="$V_LIB $V_LIB_AIXSHM"
499        else
500                V_SHM=""
501        fi
502        CXX="xlC -+"
503        ;;
504*-*-aix4*)
505        V_STATIC=""
506        V_DEFINE="$V_DEFINE -DSIGARGS=int -D_AIX41"
507        if test "$V_LIB_AIXSHM" != "" ; then
508                V_LIB="$V_LIB $V_LIB_AIXSHM"
509        else
510                V_SHM=""
511        fi
512        CXX="xlC -+"
513        ;;
514armv4l-*-linux)
515        V_STATIC=""
516        V_BROKEN_OBJ=
517        CC=arm-linux-gcc
518        CPP=arm-linux-g++
519        AR=arm-linux-ar
520        RANLIB=arm-linux-ranlib
521        if test $ipv6 = yes; then
522                V_DEFINE="$V_DEFINE -DLinux -DHAVE_IPV6 -DLINUX_IPV6"
523        else
524                V_DEFINE="$V_DEFINE -DLinux"
525        fi
526        OPSYS=linux
527        ;;
528*-*-linux*)
529        V_STATIC=""
530        V_BROKEN_OBJ=
531        if test $ipv6 = yes; then
532                V_DEFINE="$V_DEFINE -DLinux -DHAVE_IPV6 -DLINUX_IPV6"
533        else
534                V_DEFINE="$V_DEFINE -DLinux"
535        fi
536        OPSYS=linux
537        ;;
538*darwin*)
539        V_SHM=""
540        V_STATIC=""
541        V_BROKEN_OBJ=
542        V_DEFINE="$V_DEFINE -DHAVE_IPV6 -DHAVE_FAST_INT"
543        V_LIB="$V_LIB -framework Carbon -framework QuickTime"
544        if test "$target_cpu" = powerpc; then
545            V_CCOPT="-O2 $ppc_tune"
546        fi
547dnl Check for 64-bit host gcc - in Snow Leopard+
548        AC_MSG_CHECKING([for 64-bit gcc on OSX])
549        if gcc -v 2>&1 | grep host=x86_64 >& /dev/null ; then
550dnl Check for lack of 64-bit support in QuickTime - an issue in Snow Leopard+
551           if ! file -L  /System/Library/Frameworks/QuickTime.framework/QuickTime 2>&1 | grep x86_64 >&/dev/null; then
552              AC_MSG_RESULT([Yes but forcing 32-bit due to QuickTime])
553dnl If gcc 32bit then we need to set following flags for compilation of ffmpeg and x264
554dnl The MacOSX10.6 SDK is the last SDK that contain QuickTime header files capable of building video/grabber-macosx.cpp
555              x264_conf="$x264_conf --host=i686-apple-darwin"
556              if [[ -d /Developer/SDKs/MacOSX10.4u.sdk ]] ; then
557                 V_LDFLAGS="$V_LDFLAGS -arch i386  -mmacosx-version-min=10.4"
558                 V_CCLDFLAGS32="LDFLAGS='-arch i386 -mmacosx-version-min=10.4' CFLAGS='-arch i386'"
559                 V_CCOPT="$V_CCOPT -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk"
560              elif [[ -d /Developer/SDKs/MacOSX10.5.sdk ]] ; then
561                 V_LDFLAGS="$V_LDFLAGS -arch i386  -mmacosx-version-min=10.5"
562                 V_CCLDFLAGS32="LDFLAGS='-arch i386 -mmacosx-version-min=10.5' CFLAGS='-arch i386'"
563                 V_CCOPT="$V_CCOPT -arch i386 -isysroot /Developer/SDKs/MacOSX10.5.sdk"
564              elif [[ -d /Developer/SDKs/MacOSX10.6.sdk ]] ; then
565                 V_LDFLAGS="$V_LDFLAGS -arch i386  -mmacosx-version-min=10.6"
566                 V_CCLDFLAGS32="LDFLAGS='-arch i386 -mmacosx-version-min=10.6' CFLAGS='-arch i386'"
567                 V_CCOPT="$V_CCOPT -arch i386 -isysroot /Developer/SDKs/MacOSX10.6.sdk"
568              else
569                 AC_MSG_RESULT([No suitable SDK under /Developer/SDKs/ found for building with QuickTime framework])
570              fi
571           fi
572        else
573              AC_MSG_RESULT([No - using 32-bit])
574        fi
575        OPSYS=macosx
576        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-macosx.o video/yuv_convert.o"
577        ;;
578*mingw*|*mingw32*)
579        V_SHM=""
580                AC_CHECK_LIB(ws2_32, _head_libws2_32_a, ws2="yes", ws2="no")
581                if test "$ws2" == "yes"; then
582                    LIBS="$LIBS -lws2_32"
583                else
584                    AC_CHECK_LIB(wsock32, socket, ws1="yes", ws1="no")
585                        if test "$ws1" == "yes"; then
586                            LIBS="$LIBS -lwsock32"
587                        else
588                            AC_MSG_ERROR([Winsock library not found!])
589                        fi
590                fi
591                LIBS="$LIBS -liphlpapi -lvfw32 -lgdi32 -lole32 -loleaut32 -luuid -lcomctl32 -lcomdlg32 -limm32"
592                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"
593                V_EXTRAC_OBJ="$V_EXTRAC_OBJ win32/win32.o getopt.o"
594                V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-win32.o video/yuv_convert.o"
595                V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-win32DS.o video/crossbar.o"
596                V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-decklink.o video/DeckLinkAPI_i.o"
597                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"
598                V_INCLUDE_GRABBER="$V_INCLUDE_GRABBER -Idx9/Include -Idx9/Extras/DirectShow/Include"
599                ffmpeg_conf="$ffmpeg_conf --enable-memalign-hack --enable-w32threads"
600                x264_conf="$x264_conf --disable-avis-input --disable-pthread"
601                AC_ARG_ENABLE(ddraw, --enable-ddraw        Enable or disable DirectDraw, ddraw="yes", ddraw="no")
602                if test "$ddraw" == "yes"; then
603                    V_DDRAW="-DUSE_DDRAW"
604                        echo "Using DirectDraw"
605                fi;
606                V_PROG="vic.exe"
607                V_CCOPT="$V_CCOPT -Wl,-subsystem,windows"
608                ;;
609esac
610
611case "$target" in
612*-*-darwin* | *-*-mingw* | *-*-cygwin* | *-*-pw32*)
613        ;;
614*)
615        V_OBJ_GRABBER="$V_OBJ_GRABBER video/grabber-x11.o"
616        ;;
617esac
618
619AC_ARG_ENABLE(gpl,      --enable-gpl    Enable or disable  use of gpl functionality - H264 MPEG4 Swscale, gpl="yes", gpl="no")
620if test "$gpl" = "yes" ; then
621  V_DEFINE="$V_DEFINE -DHAVE_SWSCALE"
622  V_OBJ="$V_OBJ codec/packetbuffer.o codec/databuffer.o \
623    codec/ffmpeg_codec.o codec/encoder-mpeg4.o codec/decoder-mpeg4.o \
624    codec/x264encoder.o codec/encoder-h264.o codec/decoder-h264.o \
625    codec/rtp_h264_depayloader.o render/color-swscale.o video/deinterlace.o"
626else
627  V_OBJ="$V_OBJ render/color-true.o  render/color-hi.o"
628fi
629
630AC_CHECK_PROG(DOWNLOAD, wget, [wget -q -O -])
631AC_CHECK_PROG(DOWNLOAD, curl, [curl -s])
632
633havex264="no"
634AC_ARG_WITH(ffmpegver,       --with-ffmpegver=ffmpeg-version     specify the version of ffmpeg to download and build, ffmpegver=$withval, ffmpegver=ffmpeg-0.5.8)
635AC_ARG_ENABLE(ffmpeg-co,        --disable-ffmpeg-co     Enable or disable ffmpeg download, ffmpegco="no", ffmpegco="yes")
636if test "$ffmpegco" = "yes" ; then
637  if test "$gpl" = "yes" ; then
638   if test ! -d ${ffmpegver} ; then
639      echo "Downloading ${ffmpegver} of ffmpeg from ffmpeg.org ..."
640      ${DOWNLOAD} http://ffmpeg.org/releases/${ffmpegver}.tar.bz2 | tar xjf - && ln -sf ${ffmpegver} ffmpeg
641   fi
642   patch --dry-run -sf -p0 < ffmpeg.iocom.patch >& /dev/null
643   if test $? = 0; then
644      echo "Patching ffmpeg h264 for IOCOM decode compatibility..."
645      patch -p0 < ffmpeg.iocom.patch
646   else
647      echo "ffmpeg has already been patched for IOCOM decode compatibility"
648   fi
649   echo "Configuring ffmpeg..."
650   echo "${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/ffmpeg $ffmpeg_conf --enable-gpl --enable-swscale --enable-postproc"
651   cd ffmpeg && eval ${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/ffmpeg $ffmpeg_conf --enable-gpl --enable-swscale --enable-postproc; cd ..
652   V_INCLUDE="$V_INCLUDE -Iffmpeg/include -Iffmpeg"
653   V_CODEC_LIB="$V_CODEC_LIB -Lffmpeg/lib -lavcodec -lavutil -lswscale -lpostproc "
654  else
655   echo "ffmpeg not available without --enable-gpl"
656  fi
657fi
658
659AC_ARG_WITH(x264ver,       --with-x264ver=x264ver-version     specify the version of x264 to download and build, x264ver=$withval, x264ver=x264-snapshot-20100805-2245)
660AC_ARG_ENABLE(x264-co,        --disable-x264-co      Enable or disable x264 download, x264co="no", x264co="yes")
661if test "$x264co" = "yes" ; then
662  if test "$gpl" = "yes" ; then
663   if test ! -d "x264" ; then
664     echo "Downloading ${x264ver} of x264 from videolan.org ..."
665     ${DOWNLOAD} http://downloads.videolan.org/pub/videolan/x264/snapshots/${x264ver}.tar.bz2 | tar xjf - && ln -sf ${x264ver} x264
666   fi
667   echo;echo "Configuring x264..."
668   echo "${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/x264 $x264_conf"
669   cd x264 && eval ${V_CCLDFLAGS32} ./configure --prefix=$V_PATH/x264 $x264_conf; cd ..
670   V_INCLUDE="$V_INCLUDE -Ix264/include"
671   V_CODEC_LIB="$V_CODEC_LIB -Lx264/lib -lx264"
672   havex264="yes"
673  else
674   echo "x264 not available without --enable-gpl"
675  fi
676fi
677
678AC_ARG_WITH(ffmpeginc,       --with-ffmpeginc=dir     specify the prefix directory of ffmpeg header, ffmpeginc=$withval, ffmpeginc="")
679AC_ARG_WITH(ffmpeglib,       --with-ffmpeglib=dir     specify the directory of ffmpeg library, ffmpeglib=$withval, ffmpeglib="")
680
681if test "$gpl" = "yes" ; then
682  if test "$ffmpegco" != "yes"; then
683
684        if test "$ffmpeginc" != "" ; then
685           if test ! -r $ffmpeginc/libavcodec/avcodec.h ; then
686                echo "Error! you need to have $ffmpeginc/ffmpeg/avcodec.h around"
687                exit 1
688           elif test ! -r $ffmpeginc/libavutil/avutil.h ; then
689                echo "Error! you need to have $ffmpeginc/ffmpeg/avutil.h around"
690                exit 1
691           elif test ! -r $ffmpeginc/libswscale/swscale.h ; then
692                echo "Error! you need to have $ffmpeginc/ffmpeg/swscale.h around"
693                exit 1
694           fi
695           echo "checking for FFmpeg headers...yes"
696           V_INCLUDE="$V_INCLUDE -I$ffmpeginc"
697
698        else
699
700           AC_CHECK_HEADER(libavcodec/avcodec.h, [], [
701                echo "Error! you need to have avcodec.h around."
702                exit -1
703           ])
704           AC_CHECK_HEADER(libavutil/avutil.h, [], [
705                echo "Error! you need to have avutil.h around."
706                exit -1
707           ])
708           AC_CHECK_HEADER(libswscale/swscale.h, [], [
709                echo "Error! you need to have swscale.h around."
710                exit -1
711           ])
712        fi
713
714        if test "$ffmpeglib" != "" ; then
715           if test ! -r $ffmpeglib/libavcodec.a ; then
716                    echo "Error! you need to have $ffmpeglib/libavcodec.a around"
717           elif test ! -r $ffmpeglib/libavutil.a ; then
718                echo "Error! you need to have $ffmpeglib/libavutil.a around"
719           elif test ! -r $ffmpeglib/libswscale.a ; then
720                echo "Error! you need to have $ffmpeglib/libswscale.a around"
721       elif test ! -r $ffmpeglib/libpostproc.a ; then
722            echo "Error! you need to have $ffmpeglib/libpostproc.a around"
723       fi
724
725           V_CODEC_LIB="$V_CODEC_LIB -L$ffmpeglib -lavcodec -lavutil -lswscale -lpostproc"
726        else
727           AC_CHECK_LIB(avcodec, main, [], [
728                echo "Error! you need to have libavcodec around."
729                exit -1
730           ])
731           AC_CHECK_LIB(avutil, main, [], [
732                echo "Error! you need to have libavutil around."
733                exit -1
734           ])
735           AC_CHECK_LIB(swscale, main, [], [
736                echo "Error! you need to have libswscale around."
737                exit -1
738           ])
739
740           AC_CHECK_LIB(postproc, main, [], [
741                        echo "Error! you need to have libpostproc around."
742                        exit -1
743           ])
744
745           V_CODEC_LIB="$V_CODEC_LIB -lavcodec -lavutil -lswscale -lpostproc"
746        fi
747  fi
748fi
749
750AC_ARG_WITH(x264inc,       --with-x264inc=dir     specify the directory of x264 header, x264inc=$withval, x264inc="")
751AC_ARG_WITH(x264lib,       --with-x264lib=dir     specify the directory of x264 library, x264lib=$withval, x264lib="")
752if test "$gpl" = "yes" ; then
753  if test "$x264co" != "yes" ; then
754        if test "$x264inc" != "" ; then
755           if test ! -r $x264inc/x264.h ; then
756                echo "Error! you need to have $x264inc/x264.h around."
757                exit 1
758           fi
759           V_INCLUDE="$V_INCLUDE -I$x264inc"
760        elif test ! -r /usr/local/include/x264.h -a ! -r /usr/include/x264.h ; then
761                echo "Error! you need to have x264.h around."
762                exit 1
763        else
764           echo "checking for x264.h...yes"
765        fi
766
767        if test "$x264lib" != "" ; then
768           if test ! -r $x264lib/libx264.a ; then
769                echo "Error! you need to have $x264lib/libx264.a around"
770                exit 1
771           fi
772           V_CODEC_LIB="$V_CODEC_LIB -L$x264lib -lx264"
773        else
774           AC_CHECK_LIB(x264, main, [], [
775                echo "Error! you need to have libx264 around."
776                exit -1
777           ])
778           V_CODEC_LIB="$V_CODEC_LIB -lx264"
779        fi
780        havex264="yes"
781 fi
782fi
783
784if test "$havex264" == "yes"; then
785    AC_CHECK_LIB(pthread, pthread_create, pthread="yes", pthread="no")
786        if test "$pthread" == "yes"; then
787            V_CODEC_LIB="$V_CODEC_LIB -lpthread"
788        else
789            AC_CHECK_LIB(pthreadGC2, pthread_create, pthreadGC2="yes", pthreadGC2="no")
790                if test "$pthreadGC2" == "yes"; then
791                    V_CODEC_LIB="$V_CODEC_LIB -lpthreadGC2"
792                        V_DEFINE="$V_DEFINE -DPTW32_STATIC_LIB"
793                fi
794        fi
795fi
796
797V_CPUDETECT=""
798AC_ARG_ENABLE(cpudetect, --disable-cpudetect     Enable or disable runtime cpu detection, cpudetect="no", cpudetect="yes")
799if test "$gpl" = "yes" ; then
800 if test "$cpudetect" = "yes"; then
801    echo "Using CPU runtime detection..."
802    V_CPUDETECT="-DRUNTIME_CPUDETECT"
803    V_CPUDETECT_OBJ="cpu/cpudetect.o cpu/cpuid.o"
804 fi
805 else
806   echo "No runtime cputect without --enable-gpl"
807fi
808
809AC_SUBST(V_LIB_FFMPEG)
810AC_SUBST(V_LIB_X264)
811AC_SUBST(V_INCLUDE_GRABBER)
812AC_SUBST(V_LIB_GRABBER)
813AC_SUBST(V_OBJ_GRABBER)
814AC_SUBST(V_LIB_XIL)
815AC_SUBST(V_OBJ_XIL)
816AC_SUBST(V_OBJ)
817AC_SUBST(V_LIB)
818AC_SUBST(V_CODEC_LIB)
819AC_SUBST(V_CPUDETECT_OBJ)
820AC_SUBST(V_PROG)
821
822V_DEFINE="$V_DEFINE $V_SHM $V_ZVFS $V_DDRAW $V_DV $V_XV $V_CPUDETECT -D$V_ARCH "
823
824builtin(include, configure.in.tail)
Note: See TracBrowser for help on using the browser.