1 # Process this file with autoconf to produce a configure script.
3 # Set various version strings
4 m4_define([opencv_major_version], [1])
5 m4_define([opencv_minor_version], [1])
6 m4_define([opencv_subminor_version], [0])
7 m4_define([opencv_version], [opencv_major_version.opencv_minor_version.opencv_subminor_version])
9 # Before making a release, the LT_VERSION string should be modified.
10 # See: http://www.gnu.org/software/libtool/manual.html#Versioning
12 # The string is of the form Current:Revision:Age.
14 # The following lines are taken from the GNU Libtool Manual:
15 # Here are a set of rules to help you update your library version information:
17 # Start with version information of 0:0:0 for each libtool library.
18 # Update the version information only immediately before a public release of your software.
19 # More frequent updates are unnecessary, and only guarantee that the current interface number
22 # 1) If the library source code has changed at all since the last update,
23 # then increment revision (c:r:a becomes c:r+1:a).
24 # 2) If any interfaces have been added, removed, or changed since the last update,
25 # increment current, and set revision to 0.
26 # 3) If any interfaces have been added since the last public release, then increment age.
27 # 4) If any interfaces have been removed since the last public release, then set age to 0.
29 # Never try to set the interface numbers so that they correspond to the release number of your package.
30 # This is an abuse that only fosters misunderstanding of the purpose of library versions. Instead,
31 # use the -release flag (see Release numbers), but be warned that every release of your package will
32 # not be binary compatible with any other release.
33 m4_define([opencv_lt_version], [2:0:0])
37 AC_INIT([opencv],[opencv_version],[opencvlibrary-devel@lists.sourceforge.net])
38 AC_CONFIG_SRCDIR([opencv.pc.in])
39 AC_CONFIG_AUX_DIR([autotools])
40 AC_CONFIG_MACRO_DIR([autotools/aclocal])
42 # put CVS revision of this configure.in into the resulting configure script
43 AC_REVISION($Revision: 1.58 $)
45 # Detect the canonical host and target build environment
49 # setup automake - we need >= 1.6 because of python and aclocal support
50 # we updated to 1.9 because of cross-platform issues
51 AC_CONFIG_HEADERS([cvconfig.h])
52 AM_INIT_AUTOMAKE([1.9])
55 # use 'gly maintainer-mode flag to help CVS users that do not want to
56 # help developing OpenCV but just need to compile the latest version
59 # substitute versionnumbers
60 AC_SUBST(MMAJOR, [opencv_major_version])
61 AC_SUBST(MMINOR, [opencv_minor_version])
62 AC_SUBST(MSUBMINOR, [opencv_subminor_version])
63 AC_SUBST(VERSION, [opencv_version])
64 AC_SUBST(LT_VERSION, [opencv_lt_version])
66 # disable building static libraries,
67 # allow Cygwin to build DLLs
71 # checks for programs.
79 ######################################################################
80 # the following interpret 'with' and 'enable' switches.
81 # some of these switches trigger checks that can be found further
82 # below in this configure script
84 # does the user want aggressive optimization?
85 AC_ARG_ENABLE([debug],
86 [AS_HELP_STRING([--enable-debug],[build debug version without optimization [no]])],
90 # does the user want to build demo applications?
92 [AS_HELP_STRING([--enable-apps],[build demo applications [yes]])],
93 [enable_apps=$enableval],
95 AM_CONDITIONAL([BUILD_APPS], [test x"$enable_apps" = x"yes"])
98 # the following checks reflect the dependencies of OpenCV on other
99 # libraries that do the actual work for video I/O or windowing
100 # subsystem. On some platforms there are ambiguities that a user
101 # can influence. There is also additional logic to be found in code
102 # later code lines that tries to do sensible decisions on what to use
104 # does the user want to compile python modules as well?
106 [AS_HELP_STRING([--with-swig],[use swig wrapper generator [no]])],
107 [with_swig=$withval],
110 # does the user want to compile python modules as well?
111 AC_ARG_WITH([python],
112 [AS_HELP_STRING([--with-python],[use python for wrapping [yes]])],
113 [with_python=$withval],
116 # does the user want to compile octave modules as well?
117 AC_ARG_WITH([octave],
118 [AS_HELP_STRING([--with-octave],[use octave for wrapping [no]])],
119 [with_octave=$withval],
122 # does the user want OpenCV to use xine video libraries?
124 [AS_HELP_STRING([--with-xine],[use xine libraries (see LICENSE) [no]])],
125 [with_xine=$withval],
128 # does the user want OpenCV to use the gstreamer multimedia framework?
129 AC_ARG_WITH([gstreamer],
130 [AS_HELP_STRING([--with-gstreamer],[use gstreamer multimedia framework (see LICENSE) [no]])],
131 [with_gstreamer=$withval],
134 # does the user want OpenCV to use ffmpeg video libraries?
135 AC_ARG_WITH([ffmpeg],
136 [AS_HELP_STRING([--with-ffmpeg],[use ffmpeg libraries (see LICENSE) [automatic]])],
137 [with_ffmpeg=$withval],
140 # does the user want OpenCV to use libraw1394/libdc1394 for video input?
141 AC_ARG_WITH([1394libs],
142 [AS_HELP_STRING([--with-1394libs],[use libraw1394/libdc1394 [automatic]])],
143 [with_1394libs=$withval],
144 [with_1394libs=auto])
146 # does the user want OpenCV to use the video4linux kernel module?
148 [AS_HELP_STRING([--with-v4l],[use video4linux [automatic]])],
152 # does the user want OpenCV to use the unicap library?
153 AC_ARG_WITH([unicap],
154 [AS_HELP_STRING([--with-unicap],[use unicap (see LICENSE) [no]])],
155 [with_unicap=$withval],
158 # does the user want OpenCV to use image libraries from OS X 10.4?
159 AC_ARG_WITH([imageio],
160 [AS_HELP_STRING([--with-imageio],[use ImageIO libraries [automatic]])],
161 [with_imageio=$withval],
164 # does the user want OpenCV to use QuickTime video libraries?
165 AC_ARG_WITH([quicktime],
166 [AS_HELP_STRING([--with-quicktime],[use QuickTime libraries [automatic]])],
167 [with_quicktime=$withval],
168 [with_quicktime=yes])
170 # does the user want OpenCV to use the Carbon GUI of Mac OS X?
171 AC_ARG_WITH([carbon],
172 [AS_HELP_STRING([--with-carbon],[use Carbon windows [automatic]])],
173 [with_carbon=$withval],
176 # does the user want OpenCV to use GTK+ 2.0 for the GUI?
178 [AS_HELP_STRING([--with-gtk],[use gtk+ 2.0 windows [automatic]])],
182 # does the user want OpenCV to use gthread for GTK+ threaded HighGUI?
183 AC_ARG_WITH([gthread],
184 [AS_HELP_STRING([--with-gthread],[use gthread in addition to gtk+ [automatic]])],
185 [with_gthread=$withval],
189 ######################################################################
190 # getting the code to compile
192 # cure annoying default arguments for CFLAGS and CXXFLAGS
193 # that autoconf automatically sets in GNU environments if
194 # no CFLAGS or CXXFLAGS were manually given
195 if test x"$CFLAGS" = "x-g -O2" ; then
198 if test x"$CXXFLAGS" = "x-g -O2" ; then
202 # set the default c++ flags for all the compilations
203 # we don't append CXXFLAGS, because it's done at compile time
204 # see http://www.gnu.org/software/libtool/manual/automake/Flag-Variables-Ordering.html
205 # for more information
208 # see if the user wants aggressive optimizations of the code,
209 # check whether to include debugging code
210 AC_MSG_CHECKING([whether to build debug version (no optimization)])
211 if test x"$debug" = "xyes"; then
213 if test x"$ac_cv_c_compiler_gnu" = "xyes"; then
214 CPPFLAGS="-DDEBUG -D_DEBUG $CPPFLAGS"
215 DEFAULT_CXXFLAGS="-ggdb -O0 $DEFAULT_CXXFLAGS"
219 AC_MSG_NOTICE( TARGET=$target )
222 if test x"$ac_cv_c_compiler_gnu" = "xyes"; then
223 # apples g++ fails with '-march=i686' and there are no apple machines older than prescott/core anyway
224 DEFAULT_CXXFLAGS="-g -march=prescott -ffast-math -fomit-frame-pointer $DEFAULT_CXXFLAGS"
228 if test x"$ac_cv_c_compiler_gnu" = "xyes"; then
229 # default to i686/pentiumpro -- people can override this
230 DEFAULT_CXXFLAGS="-g -march=i686 -ffast-math -fomit-frame-pointer $DEFAULT_CXXFLAGS"
234 if test x"$ac_cv_c_compiler_gnu" = "xyes"; then
235 # default to G3 processors -- people can override this
236 DEFAULT_CXXFLAGS="-g -mcpu=G3 -mtune=G5 -fomit-frame-pointer $DEFAULT_CXXFLAGS"
240 if test x"$ac_cv_c_compiler_gnu" = "xyes"; then
241 DEFAULT_CXXFLAGS="-fomit-frame-pointer $DEFAULT_CXXFLAGS"
246 CPPFLAGS="-DNDEBUG $CPPFLAGS"
247 DEFAULT_CXXFLAGS="-O3 $DEFAULT_CXXFLAGS"
250 if test x"$ac_cv_c_compiler_gnu" = "xyes"; then
251 PY_CXXFLAGS="-Wall -pipe $DEFAULT_CXXFLAGS"
252 OCT_CXXFLAGS="-fno-strict-aliasing -Wall -Wno-uninitialized -pipe $DEFAULT_CXXFLAGS"
253 DEF_CXXFLAGS="-Wall -fno-rtti -pipe $DEFAULT_CXXFLAGS"
255 PY_CXXFLAGS="$DEFAULT_CXXFLAGS"
256 OCT_CXXFLAGS="$DEFAULT_CXXFLAGS"
257 DEF_CXXFLAGS="$DEFAULT_CXXFLAGS"
259 AC_SUBST(PY_CXXFLAGS)
260 AC_SUBST(OCT_CXXFLAGS)
261 AC_SUBST(DEF_CXXFLAGS)
263 # add libm because it is used by several libraries and OpenCV itself
265 AC_CHECK_LIB(dl,dlopen)
266 AC_CHECK_LIB(pthread,pthread_create)
271 # check for specific functions that might be missing from
272 # certain standard library implementations
274 AC_CHECK_HEADERS([malloc.h])
275 AC_CHECK_HEADERS([assert.h])
276 AC_CHECK_FUNCS(lrint)
279 ######################################################################
280 # HighGUI dependencies for windowing system
282 # honor user selection,
283 # if no selection given check for Carbon first
286 if test x"$with_carbon" = "xyes"; then
288 # header presence and usability seem to be enough
289 AC_CHECK_HEADER([Carbon/Carbon.h],
291 AC_DEFINE(HAVE_CARBON,,[Carbon windowing environment])
292 CARBON_LIBS="-Xlinker -framework -Xlinker Carbon"
301 if test x"$have_carbon" = "xyes"; then
303 # if we asked for gtk, this is not ok
304 if test x"$with_gtk" = "xyes"; then
305 AC_MSG_ERROR([You cannot specify --with-carbon and --with-gtk at the same time])
308 # don't check alternatives if carbon was found
309 if test x"$with_gtk" = "xauto"; then
315 if test ! x"$with_carbon" = "xno"; then
316 AC_MSG_WARN([unexpected arguments for option --with-carbon, continuing assuming 'no'])
319 AC_SUBST(CARBON_CFLAGS)
320 AC_SUBST(CARBON_LIBS)
321 AM_CONDITIONAL([BUILD_CARBON], [test x"$have_carbon" = "xyes"])
323 # use GTK+ 2.x (or later) for windowing
324 # if carbon not present or not wanted (--without-carbon)
329 if test x"$with_gtk" = "xno"; then
333 # check if ./configure arguments are valid
334 if test x"$with_gtk" = "xauto"; then
337 if test x"$with_gtk" = "xyes"; then
339 # pkg-config is needed for GTK+
340 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
341 if test x"$PKG_CONFIG" == "xno"; then
342 AC_MSG_ERROR([You have to install pkg-config to compile OpenCV with GTK+])
345 PKG_CHECK_MODULES(GTK, "gtk+-2.0 gdk-pixbuf-2.0",
348 AC_DEFINE(HAVE_GTK,,[GTK+ 2.x toolkit])
353 # if we get here then --with-gtk was not called with 'yes','no' or 'auto'
354 AC_MSG_WARN([unexpected arguments for option --with-gtk, continuing assuming 'no'])
358 if test x"$with_gthread" = "xno"; then
361 if test x"$have_gtk" = "xyes"; then
362 if test x"$with_gthread" = "xauto"; then
366 if test x"$with_gthread" = "xyes"; then
367 PKG_CHECK_MODULES(GTHREAD, "gthread-2.0",
370 AC_DEFINE(HAVE_GTHREAD,,[GTK+ 2.0 Thread support])
374 # if we get here then --with-gthread was not called with 'yes','no' or 'auto'
375 AC_MSG_WARN([unexpected arguments for option --with-gthread, continuing assuming 'no'])
379 # if no gtk+ was detected, looking for gthread does not make any sense
385 AC_SUBST(GTHREAD_CFLAGS)
386 AC_SUBST(GTHREAD_LIBS)
387 AM_CONDITIONAL([BUILD_GTK], [test x"$have_gtk" = "xyes"])
390 ######################################################################
391 # HighGUI dependencies for video I/O
393 # if QuickTime is present, it will override everything else,
394 # (unless '--without-quicktime' was given)
395 if test x"$with_quicktime" = "xyes"; then
397 # check other ./configure flags
398 if test x"$with_ffmpeg" = "xyes"; then
399 AC_MSG_ERROR([You cannot specify --with-quicktime and --with-ffmpeg at the same time])
401 if test x"$with_xine" = "xyes"; then
402 AC_MSG_ERROR([You cannot specify --with-quicktime and --with-xine at the same time])
404 if test x"$with_1394libs" = "xyes"; then
405 AC_MSG_ERROR([You cannot specify --with-quicktime and --with-1394libs at the same time])
407 if test x"$with_v4l" = "xyes"; then
408 AC_MSG_ERROR([You cannot specify --with-quicktime and --with-v4l at the same time])
411 # header presence and usability seem to be enough
412 AC_CHECK_HEADER([QuickTime/QuickTime.h],
414 AC_DEFINE(HAVE_QUICKTIME,,[QuickTime video libraries])
417 [ have_quicktime=no ])
419 # specify quicktime libraries
420 if test x"$have_quicktime" = "xyes"; then
421 QUICKTIME_LIBS="-Xlinker -framework -Xlinker QuickTime -Xlinker -framework -Xlinker QuartzCore"
423 # don't check alternatives if quicktime was found
424 if test x"$with_ffmpeg" = "xauto"; then
427 if test x"$with_xine" = "xauto"; then
430 if test x"$with_1394libs" = "xauto"; then
433 if test x"$with_v4l" = "xauto"; then
438 # check if ./configure arguments are valid
440 if test ! x"$with_quicktime" = "xno"; then
441 AC_MSG_WARN([unexpected arguments for option --with-quicktime, continuing assuming 'no'])
444 AC_SUBST(QUICKTIME_CFLAGS)
445 AC_SUBST(QUICKTIME_LIBS)
446 AM_CONDITIONAL([BUILD_QUICKTIME], [test x"$have_quicktime" = "xyes"])
448 # GStreamer seems to be a nice solution for both reading and writing
449 # and even supports some cameras
452 if test x"$with_gstreamer" = "xno"; then
456 if test x"$with_ffmpeg" = "xyes"; then
457 AC_MSG_ERROR([You cannot specify --with-gstreamer and --with-ffmpeg at the same time])
460 # check if ./configure arguments are valid
461 if test x"$with_gstreamer" = "xauto"; then
464 if test x"$with_gstreamer" = "xyes"; then
466 # pkg-config is needed for GTK+
467 AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
468 if test x"$PKG_CONFIG" == "xno"; then
469 AC_MSG_ERROR([You have to install pkg-config to compile OpenCV with GStreamer])
472 PKG_CHECK_MODULES(GSTREAMER, "gstreamer-0.10",
475 AC_DEFINE(HAVE_GSTREAMER,,[GStreamer multimedia framework])
477 [ have_gstreamer=no ])
479 if test x"$have_gstreamer" = "xyes"; then
480 GSTREAMER_LIBS="$GSTREAMER_LIBS -lgstbase-0.10"
484 # if we get here then --with-gstreamer was not called with 'yes','no' or 'auto'
485 AC_MSG_WARN([unexpected arguments for option --with-gstreamer, continuing assuming 'no'])
489 AC_SUBST(GSTREAMER_CFLAGS)
490 AC_SUBST(GSTREAMER_LIBS)
491 AM_CONDITIONAL([BUILD_GSTREAMER], [test x"$have_gstreamer" = "xyes"])
493 # Check for the unicap library
494 UNICAP_PACKAGE_LIBS=""
495 UNICAP_PACKAGE_CFLAGS=""
497 UCIL_PACKAGE_CFLAGS=""
498 if test x"$with_unicap" = "xno"; then
501 PKG_CHECK_MODULES(UNICAP_PACKAGE,libunicap)
502 PKG_CHECK_MODULES(UCIL_PACKAGE,libucil)
504 AC_DEFINE(HAVE_UNICAP,,[Unicap video capture library])
506 AM_CONDITIONAL([BUILD_UNICAP], [test x"$have_unicap" = "xyes"])
507 AC_SUBST(UNICAP_PACKAGE_LIBS)
508 AC_SUBST(UNICAP_PACKAGE_CFLAGS)
509 AC_SUBST(UCIL_PACKAGE_LIBS)
510 AC_SUBST(UCIL_PACKAGE_CFLAGS)
512 # prefer XINE over FFMPEG for video reading because it is quick, has a cleaner API
513 # and allows for easy seeking with some formats
514 if test x"$with_xine" = "xno"; then
519 # check if ./configure arguments are valid
520 if test x"$with_xine" = "xauto"; then
523 if test x"$with_xine" = "xyes"; then
524 AC_CHECK_HEADER(xine.h,
525 AC_CHECK_LIB(xine, xine_init,
528 AC_DEFINE(HAVE_XINE,,[Xine video library])
534 # if we get here then --with-xine was not called with 'yes','no' or 'auto'
535 AC_MSG_WARN([unexpected arguments for option --with-xine, continuing assuming 'no'])
540 AM_CONDITIONAL([BUILD_XINE], [test x"$have_xine" = "xyes"])
542 # unfortunately, xine does not feature video writing,
543 # so we have to resort to FFMPEG here
544 if test x"$with_ffmpeg" = "xno"; then
549 # check if ./configure arguments are valid
550 if test x"$with_ffmpeg" = "xauto"; then
553 if test x"$with_ffmpeg" = "xyes"; then
554 AC_CHECK_HEADER(ffmpeg/avcodec.h,
555 AC_SEARCH_LIBS([avcodec_decode_video],[avcodec_pic avcodec], [
556 AC_SEARCH_LIBS([av_open_input_file], [avformat_pic avformat],
559 AC_DEFINE(HAVE_FFMPEG,,[FFMpeg video library])
560 FFMPEGLIBS="-lavcodec -lavformat"
568 # if we get here then --with-ffmpeg was not called with 'yes','no' or 'auto'
569 AC_MSG_WARN([unexpected arguments for option --with-ffmpeg, continuing assuming 'no'])
574 AM_CONDITIONAL([BUILD_FFMPEG], [test x"$have_ffmpeg" = "xyes"])
576 # IEEE1394 / FireWire video video i/o with libdc1394, libraw1394
577 # (can be managed by QuickTime as well)
578 if test x"$with_1394libs" = "xno"; then
584 # check if ./configure arguments are valid
585 if test x"$with_1394libs" = "xauto"; then
588 if test x"$with_1394libs" = "xyes"; then
594 AC_CHECK_HEADER(libraw1394/raw1394.h,
595 AC_CHECK_LIB(raw1394, raw1394_new_handle,
598 LIBS="-lm -lraw1394 $LIBS"
601 if test x"$have_raw1394" = "xyes"; then
602 AC_CHECK_HEADER(libdc1394/dc1394_control.h,
603 AC_CHECK_LIB(dc1394_control, dc1394_camera_on,
606 AC_DEFINE(HAVE_DC1394,,[IEEE1394 capturing support])
607 AC_EGREP_HEADER(do_extra_buffering, libdc1394/dc1394_control.h,
608 [AC_DEFINE(HAVE_DC1394_095,,[libdc1394 0.9.4 or 0.9.5])])
609 IEEE1394LIBS="-lm -lraw1394 -ldc1394_control"
615 # if we get here then --with-1394libs was not called with 'yes','no' or 'auto'
616 AC_MSG_WARN([unexpected arguments for option --with-1394libs, continuing assuming 'no'])
620 AC_SUBST(IEEE1394LIBS)
621 AM_CONDITIONAL([BUILD_DC1394], [test x"$have_dc1394" = "xyes"])
623 # Video for Linux (V4L)
624 # we support version 1 and 2 currently
625 if test x"$with_v4l" = "xno"; then
630 # check if ./configure arguments are valid
631 if test x"$with_v4l" = "xauto"; then
634 if test x"$with_v4l" = "xyes"; then
635 AC_CHECK_HEADER([linux/videodev.h],
637 AC_DEFINE(HAVE_CAMV4L,,[V4L capturing support])
645 AC_CHECK_HEADER([linux/videodev2.h],
647 AC_DEFINE(HAVE_CAMV4L2,,[V4L2 capturing support])
653 #include <asm/types.h>
654 #include <sys/time.h>
657 # if we get here then --with-v4l was not called with 'yes','no' or 'auto'
658 AC_MSG_WARN([unexpected arguments for option --with-v4l, continuing assuming 'no'])
665 AM_CONDITIONAL([BUILD_V4L], [test x"$have_v4l1or2" = "xyes"])
668 ######################################################################
669 # HighGUI dependencies for image I/O
677 if test x"$with_imageio" = "xauto"; then
680 if test x"$with_imageio" = "xyes"; then
681 AC_CHECK_HEADER([ApplicationServices/ApplicationServices.h],
684 AC_DEFINE(HAVE_IMAGEIO,,[Apple ImageIO Framework])
685 IMAGELIBS="$IMAGELIBS -framework ApplicationServices"
686 LIBS="$LIBS -framework ApplicationServices"
690 AM_CONDITIONAL([BUILD_IMAGEIO], [test x"$have_imageio" = "xyes"])
698 # there are problems with dependencies of ImageIO to libtiff, etc.
699 # that we avoid by not linking them ourselves
700 if test x"$have_imageio" = "xno" ; then
702 AC_CHECK_HEADER(jpeglib.h,
703 AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
706 AC_DEFINE(HAVE_JPEG,,[IJG JPEG codec])
707 IMAGELIBS="$IMAGELIBS -ljpeg"
710 AC_CHECK_HEADER(zlib.h,
711 AC_CHECK_LIB(z, gzopen,
714 AC_DEFINE(HAVE_ZLIB,,[LZ77 compression/decompression library (used for PNG)])
715 IMAGELIBS="$IMAGELIBS -lz -lm"
719 AC_CHECK_HEADER(png.h,
721 AC_DEFINE(HAVE_PNG_H,,[png.h needs to be included])
724 AC_CHECK_HEADER([libpng/png.h],
726 AC_DEFINE(HAVE_LIBPNG_PNG_H,,[libpng/png.h needs to be included])
730 if test x"$have_png" = "xyes"; then
731 AC_CHECK_LIB(png12, png_read_image,
734 AC_DEFINE(HAVE_PNG,,[PNG codec])
735 IMAGELIBS="-lpng12 $IMAGELIBS"
737 AC_CHECK_FUNCS(png_get_valid png_set_tRNS_to_alpha)
742 AC_CHECK_HEADER(tiff.h,
743 AC_CHECK_LIB(tiff, TIFFReadRGBAStrip,
746 AC_DEFINE(HAVE_TIFF,,[TIFF codec])
747 IMAGELIBS="$IMAGELIBS -ltiff"
753 AC_CHECK_HEADER(jasper/jasper.h,
754 AC_CHECK_LIB(jasper, jas_image_readcmpt,
757 AC_DEFINE(HAVE_JASPER,,[JPEG-2000 codec])
758 IMAGELIBS="$IMAGELIBS -ljasper"
759 LIBS="$LIBS -ljasper"
763 AC_CHECK_HEADER(ImfCRgbaFile.h,
764 AC_CHECK_LIB(IlmImf, ImfInputReadPixels,
767 AC_DEFINE(HAVE_ILMIMF,,[OpenEXR codec])
768 IMAGELIBS="$IMAGELIBS -lIlmImf -lIex -lHalf"
769 LIBS="$LIBS -lIlmImf -lIex -lHalf"
773 # Restore original LIBS settings...
778 ######################################################################
781 # each language should have --with-LANGUAGE switch
784 if test x"$with_python" = "xyes"; then
785 AC_MSG_NOTICE([Checking for necessary tools to build python wrappers])
790 # get some info on how to compile and link python modules
794 # if not explicitly forbidden, check for swig also
795 if test x"$with_swig" = "xauto"; then
799 ### almost ok... just need to check if we have the Python headers ###
801 # first, save the CPPFLAGS
802 OLD_CPPFLAGS=$CPPFLAGS
804 # then add the PYTHON path founded previously
805 CPPFLAGS="$CPPFLAGS $PYTHON_CSPEC"
808 AC_CHECK_HEADER(Python.h,
811 AC_MSG_WARN([Python headers not found, disabling python wrappers])
815 # restore the old CPPFLAGS
816 CPPFLAGS=$OLD_CPPFLAGS
819 # check if ./configure arguments are valid
820 if test x"$with_python" = "xno"; then
823 # if we get here then --with-python was not called with 'yes','no' or 'auto'
824 AC_MSG_WARN([unexpected arguments for option --with-python, continuing assuming 'no'])
828 AM_CONDITIONAL([BUILD_PYTHON_WRAPPERS], [test x"$have_python" = "xyes"])
831 if test x"$with_octave" = "xyes"; then
832 AC_MSG_NOTICE([Checking for necessary tools to build octave wrappers])
834 # find octave and mkoctfile
835 AC_PATH_PROG(OCTAVE,octave)
836 AC_PATH_PROG(MKOCTFILE,mkoctfile)
838 if test -z "$OCTAVE"; then
839 AC_MSG_WARN([octave not found, disabling octave wrappers])
842 if test -z "$MKOCTFILE"; then
843 AC_MSG_WARN([mkoctfile not found, disabling octave wrappers])
846 OCTAVE_INCFLAGS=`$MKOCTFILE -p INCFLAGS`
847 AC_SUBST(OCTAVE_INCFLAGS,[$OCTAVE_INCFLAGS])
849 if test x"$with_octave" = "xyes"; then
850 # check that octave version is at least 2.9.12
851 cat > conftest.m <<'EOF'
852 [[a,b,c]]=sscanf([[version()," "]],"%i.%i.%i","C");
853 exit(sum([[a,b,c]].*[[1e5,1e3,1]])<209012)
855 $OCTAVE --no-init-file conftest.m >& /dev/null || with_octave="no";
858 if test x"$with_octave" = "xno"; then
859 AC_MSG_WARN([Octave version < 2.9.12, disabling octave wrappers])
862 if test x"$with_octave" = "xyes"; then
863 # if not explicitly forbidden, check for swig also
864 if test x"$with_swig" = "xauto"; then
868 # check that we have octave headers
869 OLD_CPPFLAGS=$CPPFLAGS
870 CPPFLAGS="$CPPFLAGS -x c++ $OCTAVE_INCFLAGS"
871 AC_CHECK_HEADER(octave/oct.h,
874 AC_MSG_WARN([Octave headers not found, disabling octave wrappers])
878 # restore the old CPPFLAGS
879 CPPFLAGS=$OLD_CPPFLAGS
882 AC_MSG_CHECKING([for Octave arch])
883 OCTAVE_ARCH=`$OCTAVE -q --eval 'strcat(octave_config_info("canonical_host_type"), "-", octave_config_info("api_version"))'|sed -e 's/ans = //'`
884 AC_MSG_RESULT([$OCTAVE_ARCH])
885 AC_SUBST(OCTAVE_ARCH,[$OCTAVE_ARCH])
888 # check if ./configure arguments are valid
889 if test x"$with_octave" = "xno"; then
892 # if we get here then --with-octave was not called with 'yes','no' or 'auto'
893 AC_MSG_WARN([unexpected arguments for option --with-octave, continuing assuming 'no'])
897 AM_CONDITIONAL([BUILD_OCTAVE_WRAPPERS], [test x"$have_octave" = "xyes"])
899 # check for swig itself
901 if test x"$with_swig" = "xyes"; then
902 AC_MSG_NOTICE([Checking for SWIG])
904 # Python 2.5 requires SWIG >= 1.3.30
905 AM_PYTHON_CHECK_VERSION( [2.5], have_python25=yes, have_python25=no )
906 if test x"$have_python25" = "xyes" ; then
907 AC_PATH_SWIG([1.3.30])
909 AC_PATH_SWIG([1.2.24])
913 if test -n "$SWIG"; then
915 SWIG_MULTI_MODULE_SUPPORT()
917 # if octave wrappers are enabled, check that swig supports octave
918 if test x"$with_octave" = "xyes"; then
919 AC_MSG_CHECKING([if SWIG supports Octave])
920 cat > conftest.i <<EOF
923 $SWIG -c++ -octave conftest.i || AC_MSG_ERROR(SWIG doesn't support Octave modules)
927 # specify the flags for swig
928 AC_SUBST([SWIG_OCTAVE_OPT], "-octave")
932 # check for swig python library
936 if test x"$have_python25" = "xyes"; then
937 AC_MSG_WARN([Python Version >= 2.5 requires SWIG >= 1.3.30])
942 if test x"$with_swig" = "xno"; then
945 if test x"$with_swig" = "xauto"; then
946 # no (python) wrapper will be generated
947 # we don't need to check for SWIG
950 # if we get here then --with-swig was not called with 'yes','no' or 'auto'
951 AC_MSG_WARN([unexpected arguments for option --with-swig, continuing assuming 'no'])
956 AM_CONDITIONAL([UPDATE_SWIG_WRAPPERS], [test x"$have_swig" = "xyes"])
959 ######################################################################
964 #AC_ARG_WITH(openmp, dnl
965 # [--with-openmp=COMPILER use OpenMP supporting compiler [default=no] ],
966 # [CXXOPENMP="$withval"],[CXXOPENMP="no"])
967 #if test "$CXXOPENMP" = "no"; then
975 AC_CONFIG_FILES([Makefile
981 cxcore/include/Makefile
987 cvaux/include/Makefile
993 otherlibs/highgui/Makefile
995 apps/haartraining/Makefile
996 apps/haartraining/include/Makefile
997 apps/haartraining/src/Makefile
999 interfaces/swig/Makefile
1000 interfaces/swig/filtered/Makefile
1001 interfaces/swig/general/Makefile
1002 interfaces/swig/python/Makefile
1003 interfaces/swig/octave/Makefile
1005 tests/python/Makefile
1006 tests/octave/Makefile
1008 tests/cv/src/Makefile
1010 tests/cxcore/Makefile
1011 tests/cxcore/src/Makefile
1015 samples/python/Makefile
1016 samples/octave/Makefile
1022 General configuration ================================================
1024 CXXFLAGS: ${CXXFLAGS}
1025 DEF_CXXFLAGS: ${DEF_CXXFLAGS}
1026 PY_CXXFLAGS: ${PY_CXXFLAGS}
1027 OCT_CXXFLAGS: ${OCT_CXXFLAGS}
1029 Install path: ${prefix}
1031 HighGUI configuration ================================================
1033 Windowing system --------------
1034 Use Carbon / Mac OS X: ${have_carbon}
1035 Use gtk+ 2.x: ${have_gtk}
1036 Use gthread: ${have_gthread}
1038 Image I/O ---------------------
1039 Use ImageIO / Mac OS X: ${have_imageio}
1040 Use libjpeg: ${have_jpeg}
1041 Use zlib: ${have_zlib}
1042 Use libpng: ${have_png}
1043 Use libtiff: ${have_tiff}
1044 Use libjasper: ${have_jasper}
1045 Use libIlmImf: ${have_ilmimf}
1047 Video I/O ---------------------
1048 Use QuickTime / Mac OS X: ${have_quicktime}
1049 Use xine: ${have_xine}
1050 Use gstreamer: ${have_gstreamer}
1051 Use ffmpeg: ${have_ffmpeg}
1052 Use dc1394 & raw1394: ${have_dc1394}
1053 Use v4l: ${have_v4l}
1054 Use v4l2: ${have_v4l2}
1055 Use unicap: ${have_unicap}
1057 Wrappers for other languages =========================================
1059 Python ${have_python}
1060 Octave ${have_octave}
1062 Additional build settings ============================================
1063 Build demo apps ${enable_apps}
1068 if test x"$have_xine" = "xyes"; then
1070 ATTENTION: highgui will be built with xine support,
1071 thus it will be a subject to GNU Public License])