zbar-0.10/0000777000000000000000000000000011270371535007347 500000000000000zbar-0.10/Makefile.am0000644000000000000000000000561411270371414011321 00000000000000AM_CPPFLAGS = -I$(srcdir)/include AM_CFLAGS = -Wall -Wno-parentheses AM_CXXFLAGS = $(AM_CFLAGS) ACLOCAL_AMFLAGS = -I config bin_PROGRAMS = check_PROGRAMS = EXTRA_PROGRAMS = lib_LTLIBRARIES = pyexec_LTLIBRARIES = CLEANFILES = DISTCLEANFILES = BUILT_SOURCES = EXTRA_DIST = pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = zbar.pc dist_doc_DATA = COPYING HACKING INSTALL LICENSE NEWS README TODO include $(srcdir)/include/Makefile.am.inc include $(srcdir)/zbar/Makefile.am.inc if HAVE_MAGICK include $(srcdir)/zbarimg/Makefile.am.inc endif if HAVE_VIDEO include $(srcdir)/zbarcam/Makefile.am.inc endif if HAVE_PYTHON include $(srcdir)/python/Makefile.am.inc endif if HAVE_GTK include $(srcdir)/gtk/Makefile.am.inc pkgconfig_DATA += zbar-gtk.pc if HAVE_PYTHON include $(srcdir)/pygtk/Makefile.am.inc endif endif if HAVE_QT include $(srcdir)/qt/Makefile.am.inc pkgconfig_DATA += zbar-qt.pc endif if HAVE_NPAPI include $(srcdir)/plugin/Makefile.am.inc endif include $(srcdir)/test/Makefile.am.inc include $(srcdir)/doc/Makefile.am.inc EXTRA_DIST += zbar.ico zbar.nsi EXTRA_DIST += examples/upcrpc.pl examples/upcrpc.py examples/paginate.pl \ examples/barcode.png examples/processor.pl examples/processor.py \ examples/read_one.py examples/read_one.pl \ examples/scan_image.c examples/scan_image.cpp examples/scan_image.pl \ examples/scan_image.py examples/scan_image.vcproj EXTRA_DIST += perl/MANIFEST perl/README perl/Changes perl/COPYING.LIB \ perl/Makefile.PL perl/typemap perl/ZBar.xs perl/ppport.h \ perl/ZBar.pm perl/inc/Devel/CheckLib.pm perl/ZBar/Image.pod \ perl/ZBar/ImageScanner.pod perl/ZBar/Processor.pod perl/ZBar/Symbol.pod \ perl/examples/paginate.pl perl/examples/processor.pl \ perl/examples/read_one.pl perl/examples/scan_image.pl \ perl/t/barcode.png perl/t/ZBar.t perl/t/Decoder.t perl/t/Image.t \ perl/t/Processor.t perl/t/Scanner.t perl/t/pod.t perl/t/pod-coverage.t if WIN32 dist_doc_DATA += README.windows pkgdata_DATA = $(srcdir)/examples/barcode.png \ $(srcdir)/examples/scan_image.cpp $(srcdir)/examples/scan_image.vcproj %-rc.o: %.rc $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $< %-rc.lo: %.rc $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $< # install to tmp dest and run NSIS to generate installer dist-nsis: html-local test ! -e _nsis || test -d _nsis && rm -rf _nsis mkdir _nsis tmpinst=`cd _nsis && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=$$tmpinst prefix=/ install cp zbar/.libs/libzbar-0.dll.def _nsis/lib/libzbar-0.def cp -r doc/html _nsis/share/doc/zbar/ $(WINEXEC) lib.exe /machine:x86 /def:_nsis/lib/libzbar-0.def /out:_nsis/lib/libzbar-0.lib cd _nsis && \ makensis -NOCD -V2 -DVERSION=$(VERSION) $(abs_srcdir)/zbar.nsi @ls -l _nsis/zbar-$(VERSION)-setup.exe endif zbar-0.10/configure.ac0000644000000000000000000003725211270371414011556 00000000000000dnl Process this file with autoconf to produce a configure script. AC_PREREQ([2.61]) AC_INIT([zbar], [0.10], [spadix@users.sourceforge.net]) AC_CONFIG_AUX_DIR(config) AC_CONFIG_MACRO_DIR(config) AM_INIT_AUTOMAKE([1.10 -Wall -Werror foreign subdir-objects std-options dist-bzip2]) AC_CONFIG_HEADERS([include/config.h]) AC_CONFIG_SRCDIR(zbar/scanner.c) LT_PREREQ([2.2]) LT_INIT([dlopen win32-dll]) LT_LANG([Windows Resource]) dnl update these just before each release (along w/pacakge version above) dnl LIB_VERSION update instructions copied from libtool docs: dnl library version follows the form current:revision:age dnl - If the library source code has changed at all since the last update, dnl then increment revision (c:r:a becomes c:r+1:a). dnl - If any interfaces have been added, removed, or changed, dnl increment current, and set revision to 0. dnl - If any interfaces have been added since the last public release, dnl then increment age. dnl - If any interfaces have been removed since the last public release, dnl then set age to 0. AC_SUBST([LIB_VERSION], [2:0:2]) AC_SUBST([RELDATE], [2009-10-23]) dnl widget libraries use their own versioning. dnl NB pygtk wrapper is *unversioned* AC_SUBST([ZGTK_LIB_VERSION], [0:2:0]) AC_SUBST([ZQT_LIB_VERSION], [0:2:0]) AC_DEFINE_UNQUOTED([ZBAR_VERSION_MAJOR], [[`echo "$PACKAGE_VERSION" | sed -e 's/\..*$//'`]], [Program major version (before the '.') as a number]) AC_DEFINE_UNQUOTED([ZBAR_VERSION_MINOR], [[`echo "$PACKAGE_VERSION" | sed -e 's/^[^.]*\.\([^.]*\)$/\1/'`]], [Program minor version (after '.') as a number]) cur=`echo "$LIB_VERSION" | sed -e 's/:.*$//'` age=`echo "$LIB_VERSION" | sed -e 's/^.*://'` AC_DEFINE_UNQUOTED([LIB_VERSION_MAJOR], [[$(( $cur - $age ))]], [Library major version]) AC_DEFINE_UNQUOTED([LIB_VERSION_MINOR], [[$age]], [Library minor version]) AC_DEFINE_UNQUOTED([LIB_VERSION_REVISION], [[`echo "$LIB_VERSION" | sed -e 's/^[^:]*:\([^:]*\):.*$/\1/'`]], [Library revision]) dnl windows build AC_CANONICAL_HOST case $host_os in *cygwin* | *mingw* | *uwin* | *djgpp* | *ems* ) win32="yes" AC_DEFINE([_WIN32_WINNT], [0x0500], [Minimum Windows API version]) ;; * ) win32="no" ;; esac AM_CONDITIONAL([WIN32], [test "x$win32" = "xyes"]) dnl programs AC_PROG_CC AM_PROG_CC_C_O AC_PROG_CXX PKG_PROG_PKG_CONFIG AC_ARG_VAR([XMLTO], [location of xmlto, used for optional \ documentation generation]) AC_ARG_VAR([XMLTOFLAGS], [additional arguments for xmlto]) AC_CHECK_PROGS([XMLTO], [xmlto], [:]) dnl symbologies AC_ARG_ENABLE([codes], [AS_HELP_STRING([--enable-codes=SYMS], [select symbologies to compile [default=ean,i25,code39,code128,qrcode]])], [], [enable_codes="ean,code39,code128,i25,qrcode"]) dnl pdf417 AC_DEFUN([ZBAR_CHK_CODE], [ AC_MSG_CHECKING([whether to build $2]) enable_$1="no" AH_TEMPLATE([ENABLE_]translit($1, a-z, A-Z), [whether to build support for $2]) AS_CASE([$enable_codes], [*$1* | *all*], [enable_$1="yes" AC_DEFINE([ENABLE_]translit($1, a-z, A-Z), [1]) ]) AM_CONDITIONAL([ENABLE_]translit($1, a-z, A-Z), [test "x$enable_$1" = "xyes"]) AC_MSG_RESULT([$enable_$1]) ])dnl ZBAR_CHK_CODE([ean], [EAN symbologies]) ZBAR_CHK_CODE([code128], [Code 128 symbology]) ZBAR_CHK_CODE([code39], [Code 39 symbology]) ZBAR_CHK_CODE([pdf417], [PDF417 symbology]) ZBAR_CHK_CODE([i25], [Interleaved 2 of 5 symbology]) ZBAR_CHK_CODE([qrcode], [QR Code]) dnl libraries AC_SEARCH_LIBS([clock_gettime], [rt]) AM_ICONV() dnl poll support AC_CHECK_HEADERS([poll.h], [have_poll="yes"], [have_poll="no"]) AM_CONDITIONAL([HAVE_POLL], [test "x$have_poll" = "xyes"]) dnl pthreads dnl FIXME this doesn't port well, integrate something like this: dnl http://autoconf-archive.cryp.to/acx_pthread.html AC_ARG_ENABLE([pthread], [AS_HELP_STRING([--disable-pthread], [omit support for threaded applications])], [], [AS_IF([test "x$win32" = "xno"], [enable_pthread="yes"], [enable_pthread="no" ])]) AS_IF([test "x$enable_pthread" != "xno"], [AC_CHECK_HEADERS([pthread.h], [], [AC_MSG_FAILURE([test for pthread support failed! configure --disable-pthread to skip threaded support.])]) AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_FAILURE([unable to link against -lpthread, although you appear to have pthread.h? set LDFLAGS and/or LIBS to help the linker, or configure --disable-pthread to skip threaded support.])]) AC_DEFINE([__USE_UNIX98], [1], [used only for pthread debug attributes]) ]) dnl video AC_ARG_ENABLE([video], [AS_HELP_STRING([--disable-video], [exclude video scanner features])], [], [enable_video="yes"]) with_video="no" AS_IF([test "x$enable_video" != "xno"], [AS_IF([test "x$win32" = "xno"], [AC_CHECK_HEADERS([linux/videodev.h], [with_video="v4l1"], [AC_MSG_FAILURE([test for video support failed! rebuild your kernel to include video4linux support or configure --disable-video to skip building video support.])]) AC_CHECK_HEADERS([linux/videodev2.h], [with_video="v4l2"], [AC_MSG_WARN([v4l2 API not detected, upgrade your kernel!])])], [AC_CHECK_HEADERS([vfw.h], [with_video="vfw"], [AC_MSG_FAILURE([test for VfW video support failed! configure --disable-video to skip building vidoe support.])])]) ]) AM_CONDITIONAL([HAVE_VIDEO], [test "x$enable_video" != "xno"]) AM_CONDITIONAL([HAVE_V4L1], [test "x$with_video" = "xv4l1" || test "x$with_video" = "xv4l2"]) AM_CONDITIONAL([HAVE_V4L2], [test "x$with_video" = "xv4l2"]) dnl X AC_ARG_VAR([XSHM_LIBS], [linker flags for X shared memory extension]) AS_IF([test "x$win32" != "xno"], [have_x="no"], [AC_PATH_XTRA AH_BOTTOM([#ifndef X_DISPLAY_MISSING # define HAVE_X #endif ])]) AM_CONDITIONAL([HAVE_X], [test "x$have_x" = "xyes"]) AS_IF([test "x$XSHM_LIBS" = "x"], [XSHM_LIBS="-lXext"]) AC_ARG_WITH([xshm], [AS_HELP_STRING([--without-xshm], [disable support for X shared memory extension])], [], [with_xshm="check"]) AS_IF([test "x$with_xshm" != "xno"], [AC_CHECK_HEADERS([X11/extensions/XShm.h], [with_xshm="yes"], [AS_IF([test "x$with_xshm" = "xcheck"], [with_xshm="no"], [AC_MSG_FAILURE([test for X shared memory extension failed! install the X shared memory extension, specify --x-includes or configure --without-xshm to disable the extension])])], [[#include #include #include ]]) AS_IF([test "x$with_xshm" != "xno"], [AC_CHECK_LIB([Xext], [XShmQueryVersion], [with_xshm="yes"], [AC_MSG_FAILURE([unable to find XShmQueryVersion in $XSHM_LIBS! specify XSHM_LIBS or configure --without-xshm to disable the extension])], ["$X_LIBS" "$X_PRE_LIBS" -lX11 "$X_EXTRA_LIBS" "$XSHM_LIBS"]) ]) ]) AM_CONDITIONAL([HAVE_XSHM], [test "x$with_xshm" = "xyes"]) AC_ARG_VAR([XV_LIBS], [linker flags for XVideo extension]) AS_IF([test "x$XV_LIBS" = "x"], [XV_LIBS="-lXv"]) AC_ARG_WITH([xv], [AS_HELP_STRING([--without-xv], [disable support for XVideo extension])], [], [with_xv="check"]) AS_IF([test "x$with_xv" != "xno"], [AC_CHECK_HEADERS([X11/extensions/Xvlib.h], [with_xv="yes"], [AS_IF([test "x$with_xv" = "xcheck"], [with_xv="no"], [AC_MSG_FAILURE([test for XVideo extension failed! install the XVideo extension, specify --x-includes or configure --without-xv to disable the extension])])], [[#include ]]) AS_IF([test "x$with_xv" != "xno"], [AC_CHECK_LIB([Xv], [XvQueryExtension], [with_xv="yes"], [AC_MSG_FAILURE([unable to find XvQueryExtension in $XV_LIBS! specify XV_LIBS or configure --without-xv to disable the extension])], ["$X_LIBS" "$X_PRE_LIBS" -lX11 "$X_EXTRA_LIBS" "$XV_LIBS"]) ]) ]) AM_CONDITIONAL([HAVE_XV], [test "x$with_xv" = "xyes"]) dnl libjpeg AC_ARG_WITH([jpeg], [AS_HELP_STRING([--without-jpeg], [disable support for JPEG image conversions])], [], [with_jpeg="check"]) have_jpeg="maybe" AS_IF([test "x$with_jpeg" != "xno"], [AC_CHECK_HEADERS([jpeglib.h], [], [have_jpeg="no"]) AC_CHECK_HEADER([jerror.h], [], [have_jpeg="no"]) AC_CHECK_LIB([jpeg], [jpeg_read_header], [], [have_jpeg="no"]) AS_IF([test "x$have_jpeg" != "xno"], [with_jpeg="yes"], [test "x$with_jpeg" = "xyes"], [AC_MSG_FAILURE([unable to find libjpeg! ensure CFLAGS/LDFLAGS are set appropriately or configure --without-jpeg])], [with_jpeg="no"]) ]) AM_CONDITIONAL([HAVE_JPEG], [test "x$with_jpeg" = "xyes"]) dnl ImageMagick AC_ARG_WITH([imagemagick], [AS_HELP_STRING([--without-imagemagick], [disable support for scanning images using ImageMagick])], [], [with_imagemagick="yes"]) AS_IF([test "x$with_imagemagick" != "xno"], [PKG_CHECK_MODULES([MAGICK], [MagickWand >= 6.2.6], [], [dnl Wand is deprecated in favor of MagickWand, dnl but the latter doesn't exist in older verisons (bug #2848437) saved_error=$MAGICK_PKG_ERRORS PKG_CHECK_MODULES([MAGICK], [Wand >= 6.2.6], [], [AC_MSG_FAILURE([dnl Unable to find ImageMagick >= 6.2.6: $saved_error * Ensure that you installed any "development" packages for ImageMagick. * Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. * You may set the environment variables MAGICK_CFLAGS and MAGICK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. * To avoid using ImageMagick altogether you may add the --without-imagemagick flag to the configure command; the zbarimg program will not be built. ])])]) MAGICK_VERSION=`$PKG_CONFIG MagickWand --modversion` AC_MSG_NOTICE([using ImageMagick version $MAGICK_VERSION]) dnl double check ImageMagick install (bug #2582232) CPPFLAGS_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $MAGICK_CFLAGS" AC_CHECK_HEADER([wand/MagickWand.h], [], [AC_MSG_FAILURE([ImageMagick package found but wand/MagickWand.h not installed?! this is a problem with your ImageMagick install, please resolve the inconsistency and try again...])]) CPPFLAGS="$CPPFLAGS_save"]) AM_CONDITIONAL([HAVE_MAGICK], [test "x$with_imagemagick" = "xyes"]) dnl Mozilla NPAPI AC_ARG_WITH([npapi], [AS_HELP_STRING([--with-npapi], [enable support for Firefox/Mozilla/OpenOffice NPAPI plugin])], [], [with_npapi="no"]) AS_IF([test "x$with_npapi" != "xno"], [PKG_CHECK_MODULES([NPAPI], [firefox-plugin]) NPAPI_VERSION=`$PKG_CONFIG firefox-plugin --modversion` AC_MSG_NOTICE([using firefox-plugin version $NPAPI_VERSION])]) AM_CONDITIONAL([HAVE_NPAPI], [test "x$with_npapi" = "xyes"]) dnl GTK AC_ARG_WITH([gtk], [AS_HELP_STRING([--without-gtk], [disable support for GTK+ widget])], [], [with_gtk="yes"]) AC_ARG_VAR([GLIB_GENMARSHAL], [full path to glib-genmarshal]) AS_IF([test "x$with_gtk" != "xno"], [PKG_CHECK_MODULES([GTK], [gtk+-2.0 gthread-2.0]) GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal` GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion` AC_MSG_NOTICE([using GTK+ version $GTK_VERSION]) GTHREAD_VERSION=`$PKG_CONFIG gthread-2.0 --modversion` AC_MSG_NOTICE([using gthread-2.0 version $GTHREAD_VERSION])]) AM_CONDITIONAL([HAVE_GTK], [test "x$with_gtk" = "xyes"]) dnl PyGTK AC_ARG_WITH([python], [AS_HELP_STRING([--without-python], [disable support for Python bindings])], [], [with_python="yes"]) AC_ARG_VAR([PYTHON_CONFIG], [full path to python-config program]) AC_ARG_VAR([PYTHON_CFLAGS], [compiler flags for building python extensions]) AC_ARG_VAR([PYTHON_LIBS], [linker flags for building python extensions]) AC_ARG_VAR([PYGTK_H2DEF], [full path to PyGTK h2def.py module]) AC_ARG_VAR([PYGTK_CODEGEN], [full path to pygtk-codegen program]) AC_ARG_VAR([PYGTK_DEFS], [directory where PyGTK definitions may be found]) AS_IF([test "x$with_python" != "xno"], [AM_PATH_PYTHON(2.3.5) AS_IF([test "x$PYTHON_CFLAGS" != "x"], [], [test "x$PYTHON_CONFIG" != "x" && test -x "$PYTHON_CONFIG"], [PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags`], [test -x "$PYTHON-config"], [PYTHON_CFLAGS=`$PYTHON-config --cflags`], [PYTHON_CFLAGS=`$PYTHON -c 'import distutils.sysconfig as s; print " ".join(s.get_config_vars("CFLAGS")) + " -I"+s.get_python_inc() + " -I"+s.get_python_inc(plat_specific=True)'`]) dnl FIXME now should check that #include compiles AS_IF([test "x$with_gtk" = "xyes"], [PKG_CHECK_MODULES([PYGTK], [pygtk-2.0]) AC_CHECK_PROGS([PYGTK_CODEGEN], [pygtk-codegen-2.0 pygtk-codegen], [:]) AS_IF([test "x$PYGTK_H2DEF" = "x"], [PYGTK_H2DEF=`$PKG_CONFIG pygtk-2.0 --variable=codegendir`/h2def.py AS_IF([test -f "$PYGTK_H2DEF"], [], [PYGTK_H2DEF=":"])]) AS_IF([test "x$PYGTK_DEFS" = "x"], [PYGTK_DEFS=`$PKG_CONFIG pygtk-2.0 --variable=defsdir`]) ]) ]) AM_CONDITIONAL([HAVE_PYTHON], [test "x$with_python" = "xyes"]) dnl Qt AC_ARG_WITH([qt], [AS_HELP_STRING([--without-qt], [disable support for Qt4 widget])], [], [with_qt="yes"]) AC_ARG_VAR([MOC], [full path to Qt moc program]) AS_IF([test "x$with_qt" != "xno"], [PKG_CHECK_MODULES([QT], [QtCore >= 4 QtGui >= 4]) MOC=`$PKG_CONFIG QtGui --variable=moc_location` AC_MSG_NOTICE([using moc from $MOC]) QT_VERSION=`$PKG_CONFIG QtGui --modversion` AC_MSG_NOTICE([using Qt version $QT_VERSION])]) AM_CONDITIONAL([HAVE_QT], [test "x$with_qt" = "xyes"]) dnl header files dnl FIXME switches for shm, mmap AC_HEADER_ASSERT AC_CHECK_HEADERS([fcntl.h features.h inttypes.h stdlib.h string.h unistd.h \ sys/ioctl.h sys/time.h sys/times.h sys/ipc.h sys/shm.h sys/mman.h]) dnl types AC_TYPE_INT32_T AC_TYPE_UINT32_T AC_TYPE_UINT8_T AC_TYPE_UINTPTR_T dnl compile characteristics AC_C_CONST AC_C_INLINE dnl functions AC_FUNC_MMAP AC_CHECK_FUNCS([memset atexit setenv]) dnl output generation dnl avoid doc rebuilds unless revision info changes AC_CONFIG_COMMANDS([doc/version.xml], [AS_IF([test -f doc/version.xml && \ ! echo $VERSION | diff doc/version.xml - >/dev/null 2>&1 || \ ! echo $VERSION | diff $srcdir/doc/version.xml - >/dev/null 2>&1 ], [echo "writing new doc/version.xml" ; echo $VERSION > doc/version.xml ])], [VERSION="$VERSION"] ) AC_CONFIG_COMMANDS([doc/reldate.xml], [AS_IF([test -f doc/reldate.xml && \ ! echo $RELDATE | diff doc/reldate.xml - >/dev/null 2>&1 || \ ! echo $RELDATE | diff $srcdir/doc/reldate.xml - >/dev/null 2>&1 ], [echo "writing new doc/reldate.xml" ; echo $RELDATE > doc/reldate.xml ])], [RELDATE="$RELDATE"] ) AC_CONFIG_FILES([ Makefile zbar.pc zbar-gtk.pc zbar-qt.pc doc/doxygen.conf ]) AC_OUTPUT dnl summary log echo "" echo "please verify that the detected configuration matches your expectations:" echo "------------------------------------------------------------------------" echo "X --with-x=$have_x" echo "pthreads --enable-pthread=$enable_pthread" echo "v4l --enable-video=$enable_video" AS_IF([test "x$enable_video" != "xyes"], [echo " => zbarcam video scanner will *NOT* be built"]) echo "jpeg --with-jpeg=$with_jpeg" AS_IF([test "x$with_jpeg" != "xyes"], [echo " => JPEG image conversions will *NOT* be supported"]) echo "Magick++ --with-imagemagick=$with_imagemagick" AS_IF([test "x$with_imagemagick" != "xyes"], [echo " => the zbarimg file scanner will *NOT* be built"]) echo "Python --with-python=$with_python" echo "GTK+ --with-gtk=$with_gtk" AS_IF([test "x$with_gtk" != "xyes"], [echo " => the GTK+ widget will *NOT* be built"], [AS_IF([test "x$with_python" != "xyes"], [echo " => the PyGTK widget wrapper will *NOT* be built"])]) echo "Qt4 --with-qt=$with_qt" AS_IF([test "x$with_qt" != "xyes"], [echo " => the Qt4 widget will *NOT* be built"]) #echo "NPAPI Plugin --with-npapi=$with_npapi" #AS_IF([test "x$with_mozilla" != "xyes"], # [echo " => the Mozilla/Firefox/OpenOffice plugin will *NOT* be built"]) echo "" zbar-0.10/include/0000777000000000000000000000000011270371535010772 500000000000000zbar-0.10/include/config.h.in0000644000000000000000000001422011270371464012731 00000000000000/* include/config.h.in. Generated from configure.ac by autoheader. */ /* whether to build support for Code 128 symbology */ #undef ENABLE_CODE128 /* whether to build support for Code 39 symbology */ #undef ENABLE_CODE39 /* whether to build support for EAN symbologies */ #undef ENABLE_EAN /* whether to build support for Interleaved 2 of 5 symbology */ #undef ENABLE_I25 /* whether to build support for PDF417 symbology */ #undef ENABLE_PDF417 /* whether to build support for QR Code */ #undef ENABLE_QRCODE /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FEATURES_H /* Define to 1 if you have the `getpagesize' function. */ #undef HAVE_GETPAGESIZE /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_JPEGLIB_H /* Define to 1 if you have the `jpeg' library (-ljpeg). */ #undef HAVE_LIBJPEG /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_VIDEODEV2_H /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_VIDEODEV_H /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have a working `mmap' system call. */ #undef HAVE_MMAP /* Define to 1 if you have the header file. */ #undef HAVE_POLL_H /* Define to 1 if you have the header file. */ #undef HAVE_PTHREAD_H /* Define to 1 if you have the `setenv' function. */ #undef HAVE_SETENV /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IOCTL_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_IPC_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_MMAN_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_SHM_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIMES_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TIME_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if the system has the type `uintptr_t'. */ #undef HAVE_UINTPTR_T /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_VFW_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_XSHM_H /* Define to 1 if you have the header file. */ #undef HAVE_X11_EXTENSIONS_XVLIB_H /* Define as const if the declaration of iconv() needs const. */ #undef ICONV_CONST /* Library major version */ #undef LIB_VERSION_MAJOR /* Library minor version */ #undef LIB_VERSION_MINOR /* Library revision */ #undef LIB_VERSION_REVISION /* Define to the sub-directory in which libtool stores uninstalled libraries. */ #undef LT_OBJDIR /* Define to 1 if assertions should be disabled. */ #undef NDEBUG /* Define to 1 if your C compiler doesn't accept -c and -o together. */ #undef NO_MINUS_C_MINUS_O /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define to 1 if the X Window System is missing or not being used. */ #undef X_DISPLAY_MISSING /* Program major version (before the '.') as a number */ #undef ZBAR_VERSION_MAJOR /* Program minor version (after '.') as a number */ #undef ZBAR_VERSION_MINOR /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* Minimum Windows API version */ #undef _WIN32_WINNT /* used only for pthread debug attributes */ #undef __USE_UNIX98 /* Define to empty if `const' does not conform to ANSI C. */ #undef const /* Define to `__inline__' or `__inline' if that's what the C compiler calls it, or to nothing if 'inline' is not supported under any name. */ #ifndef __cplusplus #undef inline #endif /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t /* Define to the type of an unsigned integer type wide enough to hold a pointer, if such a type exists, and if the system does not define it. */ #undef uintptr_t #ifndef X_DISPLAY_MISSING # define HAVE_X #endif zbar-0.10/include/zbar/0000777000000000000000000000000011270371535011730 500000000000000zbar-0.10/include/zbar/Decoder.h0000644000000000000000000001251611270371414013363 00000000000000//------------------------------------------------------------------------ // Copyright 2007-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _ZBAR_DECODER_H_ #define _ZBAR_DECODER_H_ /// @file /// Decoder C++ wrapper #ifndef _ZBAR_H_ # error "include zbar.h in your application, **not** zbar/Decoder.h" #endif #include namespace zbar { /// low-level bar width stream decoder interface. /// identifies symbols and extracts encoded data class Decoder { public: /// Decoder result handler. /// applications should subtype this and pass an instance to /// set_handler() to implement result processing class Handler { public: virtual ~Handler() { } /// invoked by the Decoder as decode results become available. virtual void decode_callback(Decoder &decoder) = 0; }; /// constructor. Decoder () : _handler(NULL) { _decoder = zbar_decoder_create(); } ~Decoder () { zbar_decoder_destroy(_decoder); } /// clear all decoder state. /// see zbar_decoder_reset() void reset () { zbar_decoder_reset(_decoder); } /// mark start of a new scan pass. /// see zbar_decoder_new_scan() void new_scan () { zbar_decoder_new_scan(_decoder); } /// process next bar/space width from input stream. /// see zbar_decode_width() zbar_symbol_type_t decode_width (unsigned width) { return(zbar_decode_width(_decoder, width)); } /// process next bar/space width from input stream. /// see zbar_decode_width() Decoder& operator<< (unsigned width) { zbar_decode_width(_decoder, width); return(*this); } /// retrieve color of @em next element passed to Decoder. /// see zbar_decoder_get_color() zbar_color_t get_color () const { return(zbar_decoder_get_color(_decoder)); } /// retrieve last decoded symbol type. /// see zbar_decoder_get_type() zbar_symbol_type_t get_type () const { return(zbar_decoder_get_type(_decoder)); } /// retrieve string name of last decoded symbol type. /// see zbar_get_symbol_name() const char *get_symbol_name () const { return(zbar_get_symbol_name(zbar_decoder_get_type(_decoder))); } /// retrieve string name for last decode addon. /// see zbar_get_addon_name() const char *get_addon_name () const { return(zbar_get_addon_name(zbar_decoder_get_type(_decoder))); } /// retrieve last decoded data in ASCII format as a char array. /// see zbar_decoder_get_data() const char *get_data_chars() const { return(zbar_decoder_get_data(_decoder)); } /// retrieve last decoded data as a std::string. /// see zbar_decoder_get_data() const std::string get_data_string() const { return(std::string(zbar_decoder_get_data(_decoder), zbar_decoder_get_data_length(_decoder))); } /// retrieve last decoded data as a std::string. /// see zbar_decoder_get_data() const std::string get_data() const { return(get_data_string()); } /// retrieve length of decoded binary data. /// see zbar_decoder_get_data_length() int get_data_length() const { return(zbar_decoder_get_data_length(_decoder)); } /// setup callback to handle result data. void set_handler (Handler &handler) { _handler = &handler; zbar_decoder_set_handler(_decoder, _cb); zbar_decoder_set_userdata(_decoder, this); } /// set config for indicated symbology (0 for all) to specified value. /// @see zbar_decoder_set_config() /// @since 0.4 int set_config (zbar_symbol_type_t symbology, zbar_config_t config, int value) { return(zbar_decoder_set_config(_decoder, symbology, config, value)); } /// set config parsed from configuration string. /// @see zbar_decoder_parse_config() /// @since 0.4 int set_config (std::string cfgstr) { return(zbar_decoder_parse_config(_decoder, cfgstr.c_str())); } private: friend class Scanner; zbar_decoder_t *_decoder; Handler *_handler; static void _cb (zbar_decoder_t *cdcode) { Decoder *dcode = (Decoder*)zbar_decoder_get_userdata(cdcode); if(dcode && dcode->_handler) dcode->_handler->decode_callback(*dcode); } }; } #endif zbar-0.10/include/zbar/Window.h0000644000000000000000000000723511270371414013267 00000000000000//------------------------------------------------------------------------ // Copyright 2007-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _ZBAR_WINDOW_H_ #define _ZBAR_WINDOW_H_ /// @file /// Output Window C++ wrapper #ifndef _ZBAR_H_ # error "include zbar.h in your application, **not** zbar/Window.h" #endif #include "Image.h" namespace zbar { /// mid-level output window abstraction. /// displays images to user-specified platform specific output window class Window { public: /// constructor. Window (zbar_window_t *window = NULL) { if(window) _window = window; else _window = zbar_window_create(); } /// constructor. Window (void *x11_display_w32_hwnd, unsigned long x11_drawable) { _window = zbar_window_create(); attach(x11_display_w32_hwnd, x11_drawable); } ~Window () { zbar_window_destroy(_window); } /// cast to C window object. operator zbar_window_t* () const { return(_window); } /// associate reader with an existing platform window. /// see zbar_window_attach() void attach (void *x11_display_w32_hwnd, unsigned long x11_drawable = 0) { if(zbar_window_attach(_window, x11_display_w32_hwnd, x11_drawable) < 0) throw_exception(_window); } /// control content level of the reader overlay. /// see zbar_window_set_overlay() void set_overlay (int level) { zbar_window_set_overlay(_window, level); } /// retrieve current content level of reader overlay. /// see zbar_window_get_overlay() /// draw a new image into the output window. /// see zbar_window_draw() void draw (Image& image) { if(zbar_window_draw(_window, image) < 0) throw_exception(_window); } /// clear the image from the output window. /// see zbar_window_draw() void clear () { if(zbar_window_draw(_window, NULL) < 0) throw_exception(_window); } /// redraw the last image. /// zbar_window_redraw() void redraw () { if(zbar_window_redraw(_window) < 0) throw_exception(_window); } /// resize the image window. /// zbar_window_resize() void resize (unsigned width, unsigned height) { if(zbar_window_resize(_window, width, height) < 0) throw_exception(_window); } private: zbar_window_t *_window; }; /// select a compatible format between video input and output window. /// see zbar_negotiate_format() static inline void negotiate_format (Video& video, Window& window) { if(zbar_negotiate_format(video, window) < 0) throw_exception(video); } } #endif zbar-0.10/include/zbar/Symbol.h0000644000000000000000000002516711270371414013271 00000000000000//------------------------------------------------------------------------ // Copyright 2007-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _ZBAR_SYMBOL_H_ #define _ZBAR_SYMBOL_H_ /// @file /// Symbol C++ wrapper #ifndef _ZBAR_H_ # error "include zbar.h in your application, **not** zbar/Symbol.h" #endif #include #include #include #include namespace zbar { class SymbolIterator; /// container for decoded result symbols associated with an image /// or a composite symbol. class SymbolSet { public: /// constructor. SymbolSet (const zbar_symbol_set_t *syms = NULL) : _syms(syms) { ref(); } /// copy constructor. SymbolSet (const SymbolSet& syms) : _syms(syms._syms) { ref(); } /// destructor. ~SymbolSet () { ref(-1); } /// manipulate reference count. void ref (int delta = 1) const { if(_syms) zbar_symbol_set_ref((zbar_symbol_set_t*)_syms, delta); } /// cast to C symbol set. operator const zbar_symbol_set_t* () const { return(_syms); } int get_size () { return((_syms) ? zbar_symbol_set_get_size(_syms) : 0); } /// create a new SymbolIterator over decoded results. SymbolIterator symbol_begin() const; /// return a SymbolIterator suitable for ending iteration. const SymbolIterator symbol_end() const; private: const zbar_symbol_set_t *_syms; }; /// decoded barcode symbol result object. stores type, data, and /// image location of decoded symbol class Symbol { public: /// image pixel location (x, y) coordinate tuple. class Point { public: int x; ///< x-coordinate. int y; ///< y-coordinate. Point () { } Point(int x, int y) : x(x), y(y) { } /// copy constructor. Point (const Point& pt) { x = pt.x; y = pt.y; } }; /// iteration over Point objects in a symbol location polygon. class PointIterator : public std::iterator { public: /// constructor. PointIterator (const Symbol *sym = NULL, int index = 0) : _sym(sym), _index(index) { sym->ref(1); if(!sym || (unsigned)_index >= zbar_symbol_get_loc_size(*_sym)) _index = -1; } /// constructor. PointIterator (const PointIterator& iter) : _sym(iter._sym), _index(iter._index) { _sym->ref(); } /// destructor. ~PointIterator () { _sym->ref(-1); } /// advance iterator to next Point. PointIterator& operator++ () { unsigned int i = ++_index; if(i >= zbar_symbol_get_loc_size(*_sym)) _index = -1; return(*this); } /// retrieve currently referenced Point. const Point operator* () const { assert(_index >= 0); return(Point(zbar_symbol_get_loc_x(*_sym, _index), zbar_symbol_get_loc_y(*_sym, _index))); } /// test if two iterators refer to the same Point in the same /// Symbol. bool operator== (const PointIterator& iter) const { return(_index == iter._index && ((_index < 0) || _sym == iter._sym)); } /// test if two iterators refer to the same Point in the same /// Symbol. bool operator!= (const PointIterator& iter) const { return(!(*this == iter)); } private: const Symbol *_sym; int _index; }; /// constructor. Symbol (const zbar_symbol_t *sym = NULL) : _xmlbuf(NULL), _xmllen(0) { init(sym); ref(); } /// copy constructor. Symbol (const Symbol& sym) : _sym(sym._sym), _type(sym._type), _data(sym._data), _xmlbuf(NULL), _xmllen(0) { ref(); } /// destructor. ~Symbol () { if(_xmlbuf) free(_xmlbuf); ref(-1); } void ref (int delta = 1) const { if(_sym) zbar_symbol_ref((zbar_symbol_t*)_sym, delta); } /// cast to C symbol. operator const zbar_symbol_t* () const { return(_sym); } /// test if two Symbol objects refer to the same C symbol. bool operator== (const Symbol& sym) const { return(_sym == sym._sym); } /// test if two Symbol objects refer to the same C symbol. bool operator!= (const Symbol& sym) const { return(!(*this == sym)); } /// retrieve type of decoded symbol. zbar_symbol_type_t get_type () const { return(_type); } /// retrieve the string name of the symbol type. const std::string get_type_name () const { return(zbar_get_symbol_name(_type)); } /// retrieve the string name for any addon. const std::string get_addon_name () const { return(zbar_get_addon_name(_type)); } /// retrieve data decoded from symbol. const std::string get_data () const { return(_data); } /// retrieve length of binary data unsigned get_data_length () const { return((_sym) ? zbar_symbol_get_data_length(_sym) : 0); } /// retrieve inter-frame coherency count. /// see zbar_symbol_get_count() /// @since 1.5 int get_count () const { return((_sym) ? zbar_symbol_get_count(_sym) : -1); } SymbolSet get_components () const { return(SymbolSet((_sym) ? zbar_symbol_get_components(_sym) : NULL)); } /// create a new PointIterator at the start of the location /// polygon. PointIterator point_begin() const { return(PointIterator(this)); } /// return a PointIterator suitable for ending iteration. const PointIterator point_end() const { return(PointIterator()); } /// see zbar_symbol_get_loc_size(). int get_location_size () const { return((_sym) ? zbar_symbol_get_loc_size(_sym) : 0); } /// see zbar_symbol_get_loc_x(). int get_location_x (unsigned index) const { return((_sym) ? zbar_symbol_get_loc_x(_sym, index) : -1); } /// see zbar_symbol_get_loc_y(). int get_location_y (unsigned index) const { return((_sym) ? zbar_symbol_get_loc_y(_sym, index) : -1); } /// see zbar_symbol_xml(). const std::string xml () const { if(!_sym) return(""); return(zbar_symbol_xml(_sym, (char**)&_xmlbuf, (unsigned*)&_xmllen)); } protected: friend class SymbolIterator; /// (re)initialize Symbol from C symbol object. void init (const zbar_symbol_t *sym = NULL) { _sym = sym; if(sym) { _type = zbar_symbol_get_type(sym); _data = std::string(zbar_symbol_get_data(sym), zbar_symbol_get_data_length(sym)); } else { _type = ZBAR_NONE; _data = ""; } } private: const zbar_symbol_t *_sym; zbar_symbol_type_t _type; std::string _data; char *_xmlbuf; unsigned _xmllen; }; /// iteration over Symbol result objects in a scanned Image or SymbolSet. class SymbolIterator : public std::iterator { public: /// default constructor. SymbolIterator () { } /// constructor. SymbolIterator (const SymbolSet &syms) : _syms(syms) { const zbar_symbol_set_t *zsyms = _syms; if(zsyms) _sym.init(zbar_symbol_set_first_symbol(zsyms)); } /// copy constructor. SymbolIterator (const SymbolIterator& iter) : _syms(iter._syms) { const zbar_symbol_set_t *zsyms = _syms; if(zsyms) _sym.init(zbar_symbol_set_first_symbol(zsyms)); } ~SymbolIterator () { _sym.init(); } /// advance iterator to next Symbol. SymbolIterator& operator++ () { const zbar_symbol_t *zsym = _sym; if(zsym) _sym.init(zbar_symbol_next(zsym)); else { const zbar_symbol_set_t *zsyms = _syms; if(zsyms) _sym.init(zbar_symbol_set_first_symbol(zsyms)); } return(*this); } /// retrieve currently referenced Symbol. const Symbol operator* () const { return(_sym); } /// access currently referenced Symbol. const Symbol* operator-> () const { return(&_sym); } /// test if two iterators refer to the same Symbol bool operator== (const SymbolIterator& iter) const { // it is enough to test the symbols, as they belong // to only one set (also simplifies invalid case) return(_sym == iter._sym); } /// test if two iterators refer to the same Symbol bool operator!= (const SymbolIterator& iter) const { return(!(*this == iter)); } const SymbolIterator end () const { return(SymbolIterator()); } private: SymbolSet _syms; Symbol _sym; }; inline SymbolIterator SymbolSet::symbol_begin () const { return(SymbolIterator(*this)); } inline const SymbolIterator SymbolSet::symbol_end () const { return(SymbolIterator()); } /// @relates Symbol /// stream the string representation of a Symbol. static inline std::ostream& operator<< (std::ostream& out, const Symbol& sym) { out << sym.get_type_name() << sym.get_addon_name() << ":" << sym.get_data(); return(out); } } #endif zbar-0.10/include/zbar/QZBar.h0000644000000000000000000001163011270371414012771 00000000000000//------------------------------------------------------------------------ // Copyright 2008-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _QZBAR_H_ #define _QZBAR_H_ /// @file /// Barcode Reader Qt4 Widget #include namespace zbar { class QZBarThread; /// barcode reader Qt4 widget. /// embeds a barcode reader directly into a Qt4 based GUI. the widget /// can process barcodes from a video source (using the QZBar::videoDevice /// and QZBar::videoEnabled properties) or from individual QImages /// supplied to the QZBar::scanImage() slot /// @since 1.5 class QZBar : public QWidget { Q_OBJECT /// the currently opened video device. /// /// setting a new device opens it and automatically sets /// QZBar::videoEnabled /// /// @see videoDevice(), setVideoDevice() Q_PROPERTY(QString videoDevice READ videoDevice WRITE setVideoDevice DESIGNABLE false) /// video device streaming state. /// /// use to pause/resume video scanning. /// /// @see isVideoEnabled(), setVideoEnabled() Q_PROPERTY(bool videoEnabled READ isVideoEnabled WRITE setVideoEnabled DESIGNABLE false) /// video device opened state. /// /// (re)setting QZBar::videoDevice should eventually cause it /// to be opened or closed. any errors while streaming/scanning /// will also cause the device to be closed /// /// @see isVideoOpened() Q_PROPERTY(bool videoOpened READ isVideoOpened DESIGNABLE false) public: /// constructs a barcode reader widget with the given @a parent QZBar(QWidget *parent = NULL); ~QZBar(); /// retrieve the currently opened video device. /// @returns the current video device or the empty string if no /// device is opened QString videoDevice() const; /// retrieve the current video enabled state. /// @returns true if video scanning is currently enabled, false /// otherwise bool isVideoEnabled() const; /// retrieve the current video opened state. /// @returns true if video device is currently opened, false otherwise bool isVideoOpened() const; /// @{ /// @internal QSize sizeHint() const; int heightForWidth(int) const; QPaintEngine *paintEngine() const; /// @} public Q_SLOTS: /// open a new video device. /// /// use an empty string to close a currently opened device. /// /// @note since opening a device may take some time, this call will /// return immediately and the device will be opened asynchronously void setVideoDevice(const QString &videoDevice); /// enable/disable video scanning. /// has no effect unless a video device is opened void setVideoEnabled(bool videoEnabled = true); /// scan for barcodes in a QImage. void scanImage(const QImage &image); Q_SIGNALS: /// emitted when when a video device is opened or closed. /// /// (re)setting QZBar::videoDevice should eventually cause it /// to be opened or closed. any errors while streaming/scanning /// will also cause the device to be closed void videoOpened(bool videoOpened); /// emitted when a barcode is decoded from an image. /// the symbol type and contained data are provided as separate /// parameters. void decoded(int type, const QString &data); /// emitted when a barcode is decoded from an image. /// the symbol type name is prefixed to the data, separated by a /// colon void decodedText(const QString &text); /// @{ /// @internal protected: void attach(); void showEvent(QShowEvent*); void paintEvent(QPaintEvent*); void resizeEvent(QResizeEvent*); void changeEvent(QEvent*); void dragEnterEvent(QDragEnterEvent*); void dropEvent(QDropEvent*); protected Q_SLOTS: void sizeChange(); /// @} private: QZBarThread *thread; QString _videoDevice; bool _videoEnabled; bool _attached; }; }; #endif zbar-0.10/include/zbar/Scanner.h0000644000000000000000000001014511270371414013403 00000000000000//------------------------------------------------------------------------ // Copyright 2007-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _ZBAR_SCANNER_H_ #define _ZBAR_SCANNER_H_ /// @file /// Scanner C++ wrapper #ifndef _ZBAR_H_ # error "include zbar.h in your application, **not** zbar/Scanner.h" #endif #include namespace zbar { /// low-level linear intensity sample stream scanner interface. /// identifies "bar" edges and measures width between them. /// optionally passes to bar width Decoder class Scanner { public: /// constructor. /// @param decoder reference to a Decoder instance which will /// be passed scan results automatically Scanner (Decoder& decoder) { _scanner = zbar_scanner_create(decoder._decoder); } /// constructor. /// @param decoder pointer to a Decoder instance which will /// be passed scan results automatically Scanner (Decoder* decoder = NULL) { zbar_decoder_t *zdcode = NULL; if(decoder) zdcode = decoder->_decoder; _scanner = zbar_scanner_create(zdcode); } ~Scanner () { zbar_scanner_destroy(_scanner); } /// clear all scanner state. /// see zbar_scanner_reset() void reset () { zbar_scanner_reset(_scanner); } /// mark start of a new scan pass. /// see zbar_scanner_new_scan() zbar_symbol_type_t new_scan () { _type = zbar_scanner_new_scan(_scanner); return(_type); } /// flush scanner pipeline. /// see zbar_scanner_flush() zbar_symbol_type_t flush () { _type = zbar_scanner_flush(_scanner); return(_type); } /// process next sample intensity value. /// see zbar_scan_y() zbar_symbol_type_t scan_y (int y) { _type = zbar_scan_y(_scanner, y); return(_type); } /// process next sample intensity value. /// see zbar_scan_y() Scanner& operator<< (int y) { _type = zbar_scan_y(_scanner, y); return(*this); } /// process next sample from RGB (or BGR) triple. /// see zbar_scan_rgb24() zbar_symbol_type_t scan_rgb24 (unsigned char *rgb) { _type = zbar_scan_rgb24(_scanner, rgb); return(_type); } /// process next sample from RGB (or BGR) triple. /// see zbar_scan_rgb24() Scanner& operator<< (unsigned char *rgb) { _type = zbar_scan_rgb24(_scanner, rgb); return(*this); } /// retrieve last scanned width. /// see zbar_scanner_get_width() unsigned get_width () const { return(zbar_scanner_get_width(_scanner)); } /// retrieve last scanned color. /// see zbar_scanner_get_color() zbar_color_t get_color () const { return(zbar_scanner_get_color(_scanner)); } /// retrieve last scan result. zbar_symbol_type_t get_type () const { return(_type); } /// cast to C scanner operator zbar_scanner_t* () const { return(_scanner); } /// retrieve C scanner const zbar_scanner_t *get_c_scanner () const { return(_scanner); } private: zbar_scanner_t *_scanner; zbar_symbol_type_t _type; }; } #endif zbar-0.10/include/zbar/ImageScanner.h0000644000000000000000000000725311270371414014354 00000000000000//------------------------------------------------------------------------ // Copyright 2007-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _ZBAR_IMAGE_SCANNER_H_ #define _ZBAR_IMAGE_SCANNER_H_ /// @file /// Image Scanner C++ wrapper #ifndef _ZBAR_H_ # error "include zbar.h in your application, **not** zbar/ImageScanner.h" #endif #include "Image.h" namespace zbar { /// mid-level image scanner interface. /// reads barcodes from a 2-D Image class ImageScanner { public: /// constructor. ImageScanner (zbar_image_scanner_t *scanner = NULL) { if(scanner) _scanner = scanner; else _scanner = zbar_image_scanner_create(); } ~ImageScanner () { zbar_image_scanner_destroy(_scanner); } /// cast to C image_scanner object operator zbar_image_scanner_t* () const { return(_scanner); } /// setup result handler callback. void set_handler (Image::Handler &handler) { zbar_image_scanner_set_data_handler(_scanner, handler, &handler); } /// set config for indicated symbology (0 for all) to specified value. /// @see zbar_image_scanner_set_config() /// @since 0.4 int set_config (zbar_symbol_type_t symbology, zbar_config_t config, int value) { return(zbar_image_scanner_set_config(_scanner, symbology, config, value)); } /// set config parsed from configuration string. /// @see zbar_image_scanner_parse_config() /// @since 0.4 int set_config (std::string cfgstr) { return(zbar_image_scanner_parse_config(_scanner, cfgstr.c_str())); } /// enable or disable the inter-image result cache. /// see zbar_image_scanner_enable_cache() void enable_cache (bool enable = true) { zbar_image_scanner_enable_cache(_scanner, enable); } /// remove previous results from scanner and image. /// @see zbar_image_scanner_recycle_image() /// @since 0.10 void recycle_image (Image &image) { zbar_image_scanner_recycle_image(_scanner, image); } /// retrieve decode results for last scanned image. /// @see zbar_image_scanner_get_results() /// @since 0.10 const SymbolSet get_results () const { return(SymbolSet(zbar_image_scanner_get_results(_scanner))); } /// scan for symbols in provided image. /// see zbar_scan_image() int scan (Image& image) { return(zbar_scan_image(_scanner, image)); } /// scan for symbols in provided image. /// see zbar_scan_image() ImageScanner& operator<< (Image& image) { scan(image); return(*this); } private: zbar_image_scanner_t *_scanner; }; } #endif zbar-0.10/include/zbar/Video.h0000644000000000000000000001053211270371414013060 00000000000000//------------------------------------------------------------------------ // Copyright 2007-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _ZBAR_VIDEO_H_ #define _ZBAR_VIDEO_H_ /// @file /// Video Input C++ wrapper #ifndef _ZBAR_H_ # error "include zbar.h in your application, **not** zbar/Video.h" #endif #include "Image.h" namespace zbar { /// mid-level video source abstraction. /// captures images from a video device class Video { public: /// constructor. Video (zbar_video_t *video = NULL) { if(video) _video = video; else _video = zbar_video_create(); } /// constructor. Video (std::string& device) { _video = zbar_video_create(); open(device); } ~Video () { zbar_video_destroy(_video); } /// cast to C video object. operator zbar_video_t* () const { return(_video); } /// open and probe a video device. void open (std::string& device) { if(zbar_video_open(_video, device.c_str())) throw_exception(_video); } /// close video device if open. void close () { if(zbar_video_open(_video, NULL)) throw_exception(_video); } /// initialize video using a specific format for debug. /// see zbar_video_init() void init (unsigned long fourcc) { if(zbar_video_init(_video, fourcc)) throw_exception(_video); } /// initialize video using a specific format for debug. /// see zbar_video_init() void init (std::string& format) { unsigned int fourcc = *(unsigned int*)format.c_str(); if(zbar_video_init(_video, fourcc)) throw_exception(_video); } /// retrieve file descriptor associated with open *nix video device. /// see zbar_video_get_fd() int get_fd () { return(zbar_video_get_fd(_video)); } /// retrieve current output image width. /// see zbar_video_get_width() int get_width () { return(zbar_video_get_width(_video)); } /// retrieve current output image height. /// see zbar_video_get_height() int get_height () { return(zbar_video_get_height(_video)); } /// start/stop video capture. /// see zbar_video_enable() void enable (bool enable = true) { if(zbar_video_enable(_video, enable)) throw_exception(_video); } /// retrieve next captured image. /// see zbar_video_next_image() Image next_image () { zbar_image_t *img = zbar_video_next_image(_video); if(!img) throw_exception(_video); return(Image(img)); } /// request a preferred size for the video image from the device. /// see zbar_video_request_size() /// @since 0.6 void request_size (int width, int height) { zbar_video_request_size(_video, width, height); } /// request a preferred driver interface version for debug/testing. /// see zbar_video_request_interface() /// @since 0.6 void request_interface (int version) { zbar_video_request_interface(_video, version); } /// request a preferred I/O mode for debug/testing. /// see zbar_video_request_iomode() /// @since 0.7 void request_iomode (int iomode) { if(zbar_video_request_iomode(_video, iomode)) throw_exception(_video); } private: zbar_video_t *_video; }; } #endif zbar-0.10/include/zbar/Image.h0000644000000000000000000001720011270371414013033 00000000000000//------------------------------------------------------------------------ // Copyright 2007-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _ZBAR_IMAGE_H_ #define _ZBAR_IMAGE_H_ /// @file /// Image C++ wrapper #ifndef _ZBAR_H_ # error "include zbar.h in your application, **not** zbar/Image.h" #endif #include #include #include "Symbol.h" #include "Exception.h" namespace zbar { class Video; /// stores image data samples along with associated format and size /// metadata class Image { public: /// general Image result handler. /// applications should subtype this and pass an instance to /// eg. ImageScanner::set_handler() to implement result processing class Handler { public: virtual ~Handler() { } /// invoked by library when Image should be processed virtual void image_callback(Image &image) = 0; /// cast this handler to the C handler operator zbar_image_data_handler_t* () const { return(_cb); } private: static void _cb (zbar_image_t *zimg, const void *userdata) { if(userdata) { Image *image = (Image*)zbar_image_get_userdata(zimg); ((Handler*)userdata)->image_callback(*image); } } }; class SymbolIterator : public zbar::SymbolIterator { public: /// default constructor. SymbolIterator () : zbar::SymbolIterator() { } /// constructor. SymbolIterator (const SymbolSet &syms) : zbar::SymbolIterator(syms) { } /// copy constructor. SymbolIterator (const SymbolIterator& iter) : zbar::SymbolIterator(iter) { } }; /// constructor. /// create a new Image with the specified parameters Image (unsigned width = 0, unsigned height = 0, const std::string& format = "", const void *data = NULL, unsigned long length = 0) : _img(zbar_image_create()) { zbar_image_set_userdata(_img, this); if(width && height) set_size(width, height); if(format.length()) set_format(format); if(data && length) set_data(data, length); } ~Image () { zbar_image_ref(_img, -1); } /// cast to C image object operator const zbar_image_t* () const { return(_img); } /// cast to C image object operator zbar_image_t* () { return(_img); } /// retrieve the image format. /// see zbar_image_get_format() unsigned long get_format () const { return(zbar_image_get_format(_img)); } /// specify the fourcc image format code for image sample data. /// see zbar_image_set_format() void set_format (unsigned long format) { zbar_image_set_format(_img, format); } /// specify the fourcc image format code for image sample data. /// see zbar_image_set_format() void set_format (const std::string& format) { if(format.length() != 4) throw FormatError(); unsigned long fourcc = ((format[0] & 0xff) | ((format[1] & 0xff) << 8) | ((format[2] & 0xff) << 16) | ((format[3] & 0xff) << 24)); zbar_image_set_format(_img, fourcc); } /// retrieve a "sequence" (page/frame) number associated with this /// image. /// see zbar_image_get_sequence() /// @since 0.6 unsigned get_sequence () const { return(zbar_image_get_sequence(_img)); } /// associate a "sequence" (page/frame) number with this image. /// see zbar_image_set_sequence() /// @since 0.6 void set_sequence (unsigned sequence_num) { zbar_image_set_sequence(_img, sequence_num); } /// retrieve the width of the image. /// see zbar_image_get_width() unsigned get_width () const { return(zbar_image_get_width(_img)); } /// retrieve the height of the image. /// see zbar_image_get_height() unsigned get_height () const { return(zbar_image_get_height(_img)); } /// specify the pixel size of the image. /// see zbar_image_set_size() void set_size (unsigned width, unsigned height) { zbar_image_set_size(_img, width, height); } /// return the image sample data. /// see zbar_image_get_data() const void *get_data () const { return(zbar_image_get_data(_img)); } /// return the size of the image sample data. /// see zbar_image_get_data_length() /// @since 0.6 unsigned long get_data_length () const { return(zbar_image_get_data_length(_img)); } /// specify image sample data. /// see zbar_image_set_data() void set_data (const void *data, unsigned long length) { zbar_image_set_data(_img, data, length, _cleanup); } /// image format conversion. /// see zbar_image_convert() Image convert (unsigned long format) const { zbar_image_t *img = zbar_image_convert(_img, format); if(img) return(Image(img)); throw FormatError(); } /// image format conversion with crop/pad. /// see zbar_image_convert_resize() /// @since 0.4 Image convert (unsigned long format, unsigned width, unsigned height) const { zbar_image_t *img = zbar_image_convert_resize(_img, format, width, height); if(img) return(Image(img)); throw FormatError(); } const SymbolSet get_symbols () const { return(SymbolSet(zbar_image_get_symbols(_img))); } void set_symbols (const SymbolSet &syms) { zbar_image_set_symbols(_img, syms); } /// create a new SymbolIterator over decoded results. SymbolIterator symbol_begin () const { return(SymbolIterator(get_symbols())); } /// return a SymbolIterator suitable for ending iteration. SymbolIterator symbol_end () const { return(SymbolIterator()); } protected: friend class Video; /// constructor. /// @internal /// create a new Image from a zbar_image_t C object Image (zbar_image_t *src, int refs = 0) : _img(src) { if(refs) zbar_image_ref(_img, refs); zbar_image_set_userdata(_img, this); } /// default data cleanup (noop) /// @internal static void _cleanup (zbar_image_t *img) { // by default nothing is cleaned assert(img); assert(zbar_image_get_userdata(img)); } private: zbar_image_t *_img; }; } #endif zbar-0.10/include/zbar/zbargtk.h0000644000000000000000000001401011270371414013451 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef __ZBAR_GTK_H__ #define __ZBAR_GTK_H__ /** SECTION:ZBarGtk * @short_description: barcode reader GTK+ 2.x widget * @include: zbar/zbargtk.h * * embeds a barcode reader directly into a GTK+ based GUI. the widget * can process barcodes from a video source (using the * #ZBarGtk:video-device and #ZBarGtk:video-enabled properties) or * from individual GdkPixbufs supplied to zbar_gtk_scan_image() * * Since: 1.5 */ #include #include #include #include G_BEGIN_DECLS #define ZBAR_TYPE_GTK (zbar_gtk_get_type()) #define ZBAR_GTK(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), ZBAR_TYPE_GTK, ZBarGtk)) #define ZBAR_GTK_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), ZBAR_TYPE_GTK, ZBarGtkClass)) #define ZBAR_IS_GTK(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), ZBAR_TYPE_GTK)) #define ZBAR_IS_GTK_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), ZBAR_TYPE_GTK)) #define ZBAR_GTK_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS((obj), ZBAR_TYPE_GTK, ZBarGtkClass)) typedef struct _ZBarGtk ZBarGtk; typedef struct _ZBarGtkClass ZBarGtkClass; struct _ZBarGtk { GtkWidget widget; gpointer *_private; /* properties */ /** * ZBarGtk:video-device: * * the currently set video device. * * setting a new device opens it and automatically sets * #ZBarGtk:video-enabled. set the empty string ("") or NULL to * close. */ /** * ZBarGtk:video-enabled: * * video device streaming state. * * use to pause/resume video scanning. */ /** * ZBarGtk:video-opened: * * video device opened state. * * (re)setting #ZBarGtk:video-device should eventually cause it * to be opened or closed. any errors while streaming/scanning * will also cause the device to be closed */ }; struct _ZBarGtkClass { GtkWidgetClass parent_class; /* signals */ /** * ZBarGtk::decoded: * @widget: the object that received the signal * @symbol_type: the type of symbol decoded (a zbar_symbol_type_t) * @data: the data decoded from the symbol * * emitted when a barcode is decoded from an image. * the symbol type and contained data are provided as separate * parameters */ void (*decoded) (ZBarGtk *zbar, zbar_symbol_type_t symbol_type, const char *data); /** * ZBarGtk::decoded-text: * @widget: the object that received the signal * @text: the decoded data prefixed by the string name of the * symbol type (separated by a colon) * * emitted when a barcode is decoded from an image. * the symbol type name is prefixed to the data, separated by a * colon */ void (*decoded_text) (ZBarGtk *zbar, const char *text); /** * ZBarGtk::scan-image: * @widget: the object that received the signal * @image: the image to scan for barcodes */ void (*scan_image) (ZBarGtk *zbar, GdkPixbuf *image); }; GType zbar_gtk_get_type(void) G_GNUC_CONST; /** * zbar_gtk_new: * create a new barcode reader widget instance. * initially has no associated video device or image. * * Returns: a new #ZBarGtk widget instance */ GtkWidget *zbar_gtk_new(void); /** * zbar_gtk_scan_image: * */ void zbar_gtk_scan_image(ZBarGtk *zbar, GdkPixbuf *image); /** retrieve the currently opened video device. * * Returns: the current video device or NULL if no device is opened */ const char *zbar_gtk_get_video_device(ZBarGtk *zbar); /** open a new video device. * * @video_device: the platform specific name of the device to open. * use NULL to close a currently opened device. * * @note since opening a device may take some time, this call will * return immediately and the device will be opened asynchronously */ void zbar_gtk_set_video_device(ZBarGtk *zbar, const char *video_device); /** retrieve the current video enabled state. * * Returns: true if video scanning is currently enabled, false otherwise */ gboolean zbar_gtk_get_video_enabled(ZBarGtk *zbar); /** enable/disable video scanning. * @video_enabled: true to enable video scanning, false to disable * * has no effect unless a video device is opened */ void zbar_gtk_set_video_enabled(ZBarGtk *zbar, gboolean video_enabled); /** retrieve the current video opened state. * * Returns: true if video device is currently opened, false otherwise */ gboolean zbar_gtk_get_video_opened(ZBarGtk *zbar); /** * utility function to populate a zbar_image_t from a GdkPixbuf. * @image: the zbar library image destination to populate * @pixbuf: the GdkPixbuf source * * Returns: TRUE if successful or FALSE if the conversion could not be * performed for some reason */ gboolean zbar_gtk_image_from_pixbuf(zbar_image_t *image, GdkPixbuf *pixbuf); G_END_DECLS #endif zbar-0.10/include/zbar/Exception.h0000644000000000000000000001102011270371414013741 00000000000000//------------------------------------------------------------------------ // Copyright 2007-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _ZBAR_EXCEPTION_H_ #define _ZBAR_EXCEPTION_H_ /// @file /// C++ Exception definitions #ifndef _ZBAR_H_ # error "include zbar.h in your application, **not** zbar/Exception.h" #endif #include #include namespace zbar { /// base class for exceptions defined by this API. class Exception : public std::exception { public: /// create exception from C library error Exception (const void *obj = NULL) : std::exception(), _obj(obj) { } ~Exception () throw() { } /// retrieve error message virtual const char* what () const throw() { if(!_obj) return("zbar library unspecified generic error"); return(_zbar_error_string(_obj, 0)); } private: const void *_obj; }; /// internal library error. class InternalError : public Exception { public: /// create exception from C library error InternalError (const void *obj) : Exception(obj) { } }; /// unsupported request. class UnsupportedError : public Exception { public: /// create exception from C library error UnsupportedError (const void *obj) : Exception(obj) { } }; /// invalid request. class InvalidError : public Exception { public: /// create exception from C library error InvalidError (const void *obj) : Exception(obj) { } }; /// failed system call. class SystemError : public Exception { public: /// create exception from C library error SystemError (const void *obj) : Exception(obj) { } }; /// locking error. class LockingError : public Exception { public: /// create exception from C library error LockingError (const void *obj) : Exception(obj) { } }; /// all resources busy. class BusyError : public Exception { public: /// create exception from C library error BusyError (const void *obj) : Exception(obj) { } }; /// X11 display error. class XDisplayError : public Exception { public: /// create exception from C library error XDisplayError (const void *obj) : Exception(obj) { } }; /// X11 protocol error. class XProtoError : public Exception { public: /// create exception from C library error XProtoError (const void *obj) : Exception(obj) { } }; /// output window is closed. class ClosedError : public Exception { public: /// create exception from C library error ClosedError (const void *obj) : Exception(obj) { } }; /// image format error class FormatError : public Exception { // FIXME needs c equivalent virtual const char* what () const throw() { // FIXME what format? return("unsupported format"); } }; /// @internal /// extract error information and create exception. static inline std::exception throw_exception (const void *obj) { switch(_zbar_get_error_code(obj)) { case ZBAR_ERR_NOMEM: throw std::bad_alloc(); case ZBAR_ERR_INTERNAL: throw InternalError(obj); case ZBAR_ERR_UNSUPPORTED: throw UnsupportedError(obj); case ZBAR_ERR_INVALID: throw InvalidError(obj); case ZBAR_ERR_SYSTEM: throw SystemError(obj); case ZBAR_ERR_LOCKING: throw LockingError(obj); case ZBAR_ERR_BUSY: throw BusyError(obj); case ZBAR_ERR_XDISPLAY: throw XDisplayError(obj); case ZBAR_ERR_XPROTO: throw XProtoError(obj); case ZBAR_ERR_CLOSED: throw ClosedError(obj); default: throw Exception(obj); } } } #endif zbar-0.10/include/zbar/Processor.h0000644000000000000000000001546711270371414014005 00000000000000//------------------------------------------------------------------------ // Copyright 2007-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _ZBAR_PROCESSOR_H_ #define _ZBAR_PROCESSOR_H_ /// @file /// Processor C++ wrapper #ifndef _ZBAR_H_ # error "include zbar.h in your application, **not** zbar/Processor.h" #endif #include "Exception.h" #include "Image.h" namespace zbar { /// high-level self-contained image processor. /// processes video and images for barcodes, optionally displaying /// images to a library owned output window class Processor { public: /// value to pass for no timeout. static const int FOREVER = -1; /// constructor. Processor (bool threaded = true, const char *video_device = "", bool enable_display = true) { _processor = zbar_processor_create(threaded); if(!_processor) throw std::bad_alloc(); init(video_device, enable_display); } ~Processor () { zbar_processor_destroy(_processor); } /// cast to C processor object. operator zbar_processor_t* () { return(_processor); } /// opens a video input device and/or prepares to display output. /// see zbar_processor_init() void init (const char *video_device = "", bool enable_display = true) { if(zbar_processor_init(_processor, video_device, enable_display)) throw_exception(_processor); } /// setup result handler callback. /// see zbar_processor_set_data_handler() void set_handler (Image::Handler& handler) { zbar_processor_set_data_handler(_processor, handler, &handler); } /// set config for indicated symbology (0 for all) to specified value. /// @see zbar_processor_set_config() /// @since 0.4 int set_config (zbar_symbol_type_t symbology, zbar_config_t config, int value) { return(zbar_processor_set_config(_processor, symbology, config, value)); } /// set config parsed from configuration string. /// @see zbar_processor_parse_config() /// @since 0.4 int set_config (std::string cfgstr) { return(zbar_processor_parse_config(_processor, cfgstr.c_str())); } /// retrieve the current state of the ouput window. /// see zbar_processor_is_visible() bool is_visible () { int rc = zbar_processor_is_visible(_processor); if(rc < 0) throw_exception(_processor); return(rc != 0); } /// show or hide the display window owned by the library. /// see zbar_processor_set_visible() void set_visible (bool visible = true) { if(zbar_processor_set_visible(_processor, visible) < 0) throw_exception(_processor); } /// control the processor in free running video mode. /// see zbar_processor_set_active() void set_active (bool active = true) { if(zbar_processor_set_active(_processor, active) < 0) throw_exception(_processor); } /// retrieve decode results for last scanned image. /// @see zbar_processor_get_results() /// @since 0.10 const SymbolSet get_results () const { return(SymbolSet(zbar_processor_get_results(_processor))); } /// wait for input to the display window from the user. /// see zbar_processor_user_wait() int user_wait (int timeout = FOREVER) { int rc = zbar_processor_user_wait(_processor, timeout); if(rc < 0) throw_exception(_processor); return(rc); } /// process from the video stream until a result is available. /// see zbar_process_one() void process_one (int timeout = FOREVER) { if(zbar_process_one(_processor, timeout) < 0) throw_exception(_processor); } /// process the provided image for barcodes. /// see zbar_process_image() void process_image (Image& image) { if(zbar_process_image(_processor, image) < 0) throw_exception(_processor); } /// process the provided image for barcodes. /// see zbar_process_image() Processor& operator<< (Image& image) { process_image(image); return(*this); } /// force specific input and output formats for debug/testing. /// see zbar_processor_force_format() void force_format (unsigned long input_format, unsigned long output_format) { if(zbar_processor_force_format(_processor, input_format, output_format)) throw_exception(_processor); } /// force specific input and output formats for debug/testing. /// see zbar_processor_force_format() void force_format (std::string& input_format, std::string& output_format) { unsigned long ifourcc = *(unsigned long*)input_format.c_str(); unsigned long ofourcc = *(unsigned long*)output_format.c_str(); if(zbar_processor_force_format(_processor, ifourcc, ofourcc)) throw_exception(_processor); } /// request a preferred size for the video image from the device. /// see zbar_processor_request_size() /// @since 0.6 void request_size (int width, int height) { zbar_processor_request_size(_processor, width, height); } /// request a preferred driver interface version for debug/testing. /// see zbar_processor_request_interface() /// @since 0.6 void request_interface (int version) { zbar_processor_request_interface(_processor, version); } /// request a preferred I/O mode for debug/testing. /// see zbar_processor_request_iomode() /// @since 0.7 void request_iomode (int iomode) { if(zbar_processor_request_iomode(_processor, iomode)) throw_exception(_processor); } private: zbar_processor_t *_processor; }; } #endif zbar-0.10/include/zbar/QZBarImage.h0000644000000000000000000000417711270371414013744 00000000000000//------------------------------------------------------------------------ // Copyright 2008-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _QZBARIMAGE_H_ #define _QZBARIMAGE_H_ /// @file /// QImage to Image type conversion wrapper #include #include namespace zbar { /// wrap a QImage and convert into a format suitable for scanning. class QZBarImage : public Image { public: /// construct a zbar library image based on an existing QImage. QZBarImage (const QImage &qimg) : qimg(qimg) { QImage::Format fmt = qimg.format(); if(fmt != QImage::Format_RGB32 && fmt != QImage::Format_ARGB32 && fmt != QImage::Format_ARGB32_Premultiplied) throw FormatError(); unsigned bpl = qimg.bytesPerLine(); unsigned width = bpl / 4; unsigned height = qimg.height(); set_size(width, height); set_format('B' | ('G' << 8) | ('R' << 16) | ('4' << 24)); unsigned long datalen = qimg.numBytes(); set_data(qimg.bits(), datalen); if((width * 4 != bpl) || (width * height * 4 > datalen)) throw FormatError(); } private: QImage qimg; }; }; #endif zbar-0.10/include/zbar.h0000644000000000000000000013435311270371414012022 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _ZBAR_H_ #define _ZBAR_H_ /** @file * ZBar Barcode Reader C API definition */ /** @mainpage * * interface to the barcode reader is available at several levels. * most applications will want to use the high-level interfaces: * * @section high-level High-Level Interfaces * * these interfaces wrap all library functionality into an easy-to-use * package for a specific toolkit: * - the "GTK+ 2.x widget" may be used with GTK GUI applications. a * Python wrapper is included for PyGtk * - the @ref zbar::QZBar "Qt4 widget" may be used with Qt GUI * applications * - the Processor interface (in @ref c-processor "C" or @ref * zbar::Processor "C++") adds a scanning window to an application * with no GUI. * * @section mid-level Intermediate Interfaces * * building blocks used to construct high-level interfaces: * - the ImageScanner (in @ref c-imagescanner "C" or @ref * zbar::ImageScanner "C++") looks for barcodes in a library defined * image object * - the Window abstraction (in @ref c-window "C" or @ref * zbar::Window "C++") sinks library images, displaying them on the * platform display * - the Video abstraction (in @ref c-video "C" or @ref zbar::Video * "C++") sources library images from a video device * * @section low-level Low-Level Interfaces * * direct interaction with barcode scanning and decoding: * - the Scanner (in @ref c-scanner "C" or @ref zbar::Scanner "C++") * looks for barcodes in a linear intensity sample stream * - the Decoder (in @ref c-decoder "C" or @ref zbar::Decoder "C++") * extracts barcodes from a stream of bar and space widths */ #ifdef __cplusplus /** C++ namespace for library interfaces */ namespace zbar { extern "C" { #endif /** @name Global library interfaces */ /*@{*/ /** "color" of element: bar or space. */ typedef enum zbar_color_e { ZBAR_SPACE = 0, /**< light area or space between bars */ ZBAR_BAR = 1, /**< dark area or colored bar segment */ } zbar_color_t; /** decoded symbol type. */ typedef enum zbar_symbol_type_e { ZBAR_NONE = 0, /**< no symbol decoded */ ZBAR_PARTIAL = 1, /**< intermediate status */ ZBAR_EAN8 = 8, /**< EAN-8 */ ZBAR_UPCE = 9, /**< UPC-E */ ZBAR_ISBN10 = 10, /**< ISBN-10 (from EAN-13). @since 0.4 */ ZBAR_UPCA = 12, /**< UPC-A */ ZBAR_EAN13 = 13, /**< EAN-13 */ ZBAR_ISBN13 = 14, /**< ISBN-13 (from EAN-13). @since 0.4 */ ZBAR_I25 = 25, /**< Interleaved 2 of 5. @since 0.4 */ ZBAR_CODE39 = 39, /**< Code 39. @since 0.4 */ ZBAR_PDF417 = 57, /**< PDF417. @since 0.6 */ ZBAR_QRCODE = 64, /**< QR Code. @since 0.10 */ ZBAR_CODE128 = 128, /**< Code 128 */ ZBAR_SYMBOL = 0x00ff, /**< mask for base symbol type */ ZBAR_ADDON2 = 0x0200, /**< 2-digit add-on flag */ ZBAR_ADDON5 = 0x0500, /**< 5-digit add-on flag */ ZBAR_ADDON = 0x0700, /**< add-on flag mask */ } zbar_symbol_type_t; /** error codes. */ typedef enum zbar_error_e { ZBAR_OK = 0, /**< no error */ ZBAR_ERR_NOMEM, /**< out of memory */ ZBAR_ERR_INTERNAL, /**< internal library error */ ZBAR_ERR_UNSUPPORTED, /**< unsupported request */ ZBAR_ERR_INVALID, /**< invalid request */ ZBAR_ERR_SYSTEM, /**< system error */ ZBAR_ERR_LOCKING, /**< locking error */ ZBAR_ERR_BUSY, /**< all resources busy */ ZBAR_ERR_XDISPLAY, /**< X11 display error */ ZBAR_ERR_XPROTO, /**< X11 protocol error */ ZBAR_ERR_CLOSED, /**< output window is closed */ ZBAR_ERR_WINAPI, /**< windows system error */ ZBAR_ERR_NUM /**< number of error codes */ } zbar_error_t; /** decoder configuration options. * @since 0.4 */ typedef enum zbar_config_e { ZBAR_CFG_ENABLE = 0, /**< enable symbology/feature */ ZBAR_CFG_ADD_CHECK, /**< enable check digit when optional */ ZBAR_CFG_EMIT_CHECK, /**< return check digit when present */ ZBAR_CFG_ASCII, /**< enable full ASCII character set */ ZBAR_CFG_NUM, /**< number of boolean decoder configs */ ZBAR_CFG_MIN_LEN = 0x20, /**< minimum data length for valid decode */ ZBAR_CFG_MAX_LEN, /**< maximum data length for valid decode */ ZBAR_CFG_POSITION = 0x80, /**< enable scanner to collect position data */ ZBAR_CFG_X_DENSITY = 0x100, /**< image scanner vertical scan density */ ZBAR_CFG_Y_DENSITY, /**< image scanner horizontal scan density */ } zbar_config_t; /** retrieve runtime library version information. * @param major set to the running major version (unless NULL) * @param minor set to the running minor version (unless NULL) * @returns 0 */ extern int zbar_version(unsigned *major, unsigned *minor); /** set global library debug level. * @param verbosity desired debug level. higher values create more spew */ extern void zbar_set_verbosity(int verbosity); /** increase global library debug level. * eg, for -vvvv */ extern void zbar_increase_verbosity(void); /** retrieve string name for symbol encoding. * @param sym symbol type encoding * @returns the static string name for the specified symbol type, * or "UNKNOWN" if the encoding is not recognized */ extern const char *zbar_get_symbol_name(zbar_symbol_type_t sym); /** retrieve string name for addon encoding. * @param sym symbol type encoding * @returns static string name for any addon, or the empty string * if no addons were decoded */ extern const char *zbar_get_addon_name(zbar_symbol_type_t sym); /** parse a configuration string of the form "[symbology.]config[=value]". * the config must match one of the recognized names. * the symbology, if present, must match one of the recognized names. * if symbology is unspecified, it will be set to 0. * if value is unspecified it will be set to 1. * @returns 0 if the config is parsed successfully, 1 otherwise * @since 0.4 */ extern int zbar_parse_config(const char *config_string, zbar_symbol_type_t *symbology, zbar_config_t *config, int *value); /** @internal type unsafe error API (don't use) */ extern int _zbar_error_spew(const void *object, int verbosity); extern const char *_zbar_error_string(const void *object, int verbosity); extern zbar_error_t _zbar_get_error_code(const void *object); /*@}*/ struct zbar_symbol_s; typedef struct zbar_symbol_s zbar_symbol_t; struct zbar_symbol_set_s; typedef struct zbar_symbol_set_s zbar_symbol_set_t; /*------------------------------------------------------------*/ /** @name Symbol interface * decoded barcode symbol result object. stores type, data, and image * location of decoded symbol. all memory is owned by the library */ /*@{*/ /** @typedef zbar_symbol_t * opaque decoded symbol object. */ /** symbol reference count manipulation. * increment the reference count when you store a new reference to the * symbol. decrement when the reference is no longer used. do not * refer to the symbol once the count is decremented and the * containing image has been recycled or destroyed. * @note the containing image holds a reference to the symbol, so you * only need to use this if you keep a symbol after the image has been * destroyed or reused. * @since 0.9 */ extern void zbar_symbol_ref(const zbar_symbol_t *symbol, int refs); /** retrieve type of decoded symbol. * @returns the symbol type */ extern zbar_symbol_type_t zbar_symbol_get_type(const zbar_symbol_t *symbol); /** retrieve data decoded from symbol. * @returns the data string */ extern const char *zbar_symbol_get_data(const zbar_symbol_t *symbol); /** retrieve length of binary data. * @returns the length of the decoded data */ extern unsigned int zbar_symbol_get_data_length(const zbar_symbol_t *symbol); /** retrieve a symbol confidence metric. * @returns an unscaled, relative quantity: larger values are better * than smaller values, where "large" and "small" are application * dependent. * @note expect the exact definition of this quantity to change as the * metric is refined. currently, only the ordered relationship * between two values is defined and will remain stable in the future * @since 0.9 */ extern int zbar_symbol_get_quality(const zbar_symbol_t *symbol); /** retrieve current cache count. when the cache is enabled for the * image_scanner this provides inter-frame reliability and redundancy * information for video streams. * @returns < 0 if symbol is still uncertain. * @returns 0 if symbol is newly verified. * @returns > 0 for duplicate symbols */ extern int zbar_symbol_get_count(const zbar_symbol_t *symbol); /** retrieve the number of points in the location polygon. the * location polygon defines the image area that the symbol was * extracted from. * @returns the number of points in the location polygon * @note this is currently not a polygon, but the scan locations * where the symbol was decoded */ extern unsigned zbar_symbol_get_loc_size(const zbar_symbol_t *symbol); /** retrieve location polygon x-coordinates. * points are specified by 0-based index. * @returns the x-coordinate for a point in the location polygon. * @returns -1 if index is out of range */ extern int zbar_symbol_get_loc_x(const zbar_symbol_t *symbol, unsigned index); /** retrieve location polygon y-coordinates. * points are specified by 0-based index. * @returns the y-coordinate for a point in the location polygon. * @returns -1 if index is out of range */ extern int zbar_symbol_get_loc_y(const zbar_symbol_t *symbol, unsigned index); /** iterate the set to which this symbol belongs (there can be only one). * @returns the next symbol in the set, or * @returns NULL when no more results are available */ extern const zbar_symbol_t *zbar_symbol_next(const zbar_symbol_t *symbol); /** retrieve components of a composite result. * @returns the symbol set containing the components * @returns NULL if the symbol is already a physical symbol * @since 0.10 */ extern const zbar_symbol_set_t* zbar_symbol_get_components(const zbar_symbol_t *symbol); /** iterate components of a composite result. * @returns the first physical component symbol of a composite result * @returns NULL if the symbol is already a physical symbol * @since 0.10 */ extern const zbar_symbol_t* zbar_symbol_first_component(const zbar_symbol_t *symbol); /** print XML symbol element representation to user result buffer. * @see http://zbar.sourceforge.net/2008/barcode.xsd for the schema. * @param symbol is the symbol to print * @param buffer is the inout result pointer, it will be reallocated * with a larger size if necessary. * @param buflen is inout length of the result buffer. * @returns the buffer pointer * @since 0.6 */ extern char *zbar_symbol_xml(const zbar_symbol_t *symbol, char **buffer, unsigned *buflen); /*@}*/ /*------------------------------------------------------------*/ /** @name Symbol Set interface * container for decoded result symbols associated with an image * or a composite symbol. * @since 0.10 */ /*@{*/ /** @typedef zbar_symbol_set_t * opaque symbol iterator object. * @since 0.10 */ /** reference count manipulation. * increment the reference count when you store a new reference. * decrement when the reference is no longer used. do not refer to * the object any longer once references have been released. * @since 0.10 */ extern void zbar_symbol_set_ref(const zbar_symbol_set_t *symbols, int refs); /** retrieve set size. * @returns the number of symbols in the set. * @since 0.10 */ extern int zbar_symbol_set_get_size(const zbar_symbol_set_t *symbols); /** set iterator. * @returns the first decoded symbol result in a set * @returns NULL if the set is empty * @since 0.10 */ extern const zbar_symbol_t* zbar_symbol_set_first_symbol(const zbar_symbol_set_t *symbols); /*@}*/ /*------------------------------------------------------------*/ /** @name Image interface * stores image data samples along with associated format and size * metadata */ /*@{*/ struct zbar_image_s; /** opaque image object. */ typedef struct zbar_image_s zbar_image_t; /** cleanup handler callback function. * called to free sample data when an image is destroyed. */ typedef void (zbar_image_cleanup_handler_t)(zbar_image_t *image); /** data handler callback function. * called when decoded symbol results are available for an image */ typedef void (zbar_image_data_handler_t)(zbar_image_t *image, const void *userdata); /** new image constructor. * @returns a new image object with uninitialized data and format. * this image should be destroyed (using zbar_image_destroy()) as * soon as the application is finished with it */ extern zbar_image_t *zbar_image_create(void); /** image destructor. all images created by or returned to the * application should be destroyed using this function. when an image * is destroyed, the associated data cleanup handler will be invoked * if available * @note make no assumptions about the image or the data buffer. * they may not be destroyed/cleaned immediately if the library * is still using them. if necessary, use the cleanup handler hook * to keep track of image data buffers */ extern void zbar_image_destroy(zbar_image_t *image); /** image reference count manipulation. * increment the reference count when you store a new reference to the * image. decrement when the reference is no longer used. do not * refer to the image any longer once the count is decremented. * zbar_image_ref(image, -1) is the same as zbar_image_destroy(image) * @since 0.5 */ extern void zbar_image_ref(zbar_image_t *image, int refs); /** image format conversion. refer to the documentation for supported * image formats * @returns a @em new image with the sample data from the original image * converted to the requested format. the original image is * unaffected. * @note the converted image size may be rounded (up) due to format * constraints */ extern zbar_image_t *zbar_image_convert(const zbar_image_t *image, unsigned long format); /** image format conversion with crop/pad. * if the requested size is larger than the image, the last row/column * are duplicated to cover the difference. if the requested size is * smaller than the image, the extra rows/columns are dropped from the * right/bottom. * @returns a @em new image with the sample data from the original * image converted to the requested format and size. * @note the image is @em not scaled * @see zbar_image_convert() * @since 0.4 */ extern zbar_image_t *zbar_image_convert_resize(const zbar_image_t *image, unsigned long format, unsigned width, unsigned height); /** retrieve the image format. * @returns the fourcc describing the format of the image sample data */ extern unsigned long zbar_image_get_format(const zbar_image_t *image); /** retrieve a "sequence" (page/frame) number associated with this image. * @since 0.6 */ extern unsigned zbar_image_get_sequence(const zbar_image_t *image); /** retrieve the width of the image. * @returns the width in sample columns */ extern unsigned zbar_image_get_width(const zbar_image_t *image); /** retrieve the height of the image. * @returns the height in sample rows */ extern unsigned zbar_image_get_height(const zbar_image_t *image); /** return the image sample data. the returned data buffer is only * valid until zbar_image_destroy() is called */ extern const void *zbar_image_get_data(const zbar_image_t *image); /** return the size of image data. * @since 0.6 */ extern unsigned long zbar_image_get_data_length(const zbar_image_t *img); /** retrieve the decoded results. * @returns the (possibly empty) set of decoded symbols * @returns NULL if the image has not been scanned * @since 0.10 */ extern const zbar_symbol_set_t* zbar_image_get_symbols(const zbar_image_t *image); /** associate the specified symbol set with the image, replacing any * existing results. use NULL to release the current results from the * image. * @see zbar_image_scanner_recycle_image() * @since 0.10 */ extern void zbar_image_set_symbols(zbar_image_t *image, const zbar_symbol_set_t *symbols); /** image_scanner decode result iterator. * @returns the first decoded symbol result for an image * or NULL if no results are available */ extern const zbar_symbol_t* zbar_image_first_symbol(const zbar_image_t *image); /** specify the fourcc image format code for image sample data. * refer to the documentation for supported formats. * @note this does not convert the data! * (see zbar_image_convert() for that) */ extern void zbar_image_set_format(zbar_image_t *image, unsigned long format); /** associate a "sequence" (page/frame) number with this image. * @since 0.6 */ extern void zbar_image_set_sequence(zbar_image_t *image, unsigned sequence_num); /** specify the pixel size of the image. * @note this does not affect the data! */ extern void zbar_image_set_size(zbar_image_t *image, unsigned width, unsigned height); /** specify image sample data. when image data is no longer needed by * the library the specific data cleanup handler will be called * (unless NULL) * @note application image data will not be modified by the library */ extern void zbar_image_set_data(zbar_image_t *image, const void *data, unsigned long data_byte_length, zbar_image_cleanup_handler_t *cleanup_hndlr); /** built-in cleanup handler. * passes the image data buffer to free() */ extern void zbar_image_free_data(zbar_image_t *image); /** associate user specified data value with an image. * @since 0.5 */ extern void zbar_image_set_userdata(zbar_image_t *image, void *userdata); /** return user specified data value associated with the image. * @since 0.5 */ extern void *zbar_image_get_userdata(const zbar_image_t *image); /** dump raw image data to a file for debug. * the data will be prefixed with a 16 byte header consisting of: * - 4 bytes uint = 0x676d697a ("zimg") * - 4 bytes format fourcc * - 2 bytes width * - 2 bytes height * - 4 bytes size of following image data in bytes * this header can be dumped w/eg: * @verbatim od -Ax -tx1z -N16 -w4 [file] @endverbatim * for some formats the image can be displayed/converted using * ImageMagick, eg: * @verbatim display -size 640x480+16 [-depth ?] [-sampling-factor ?x?] \ {GRAY,RGB,UYVY,YUV}:[file] @endverbatim * * @param image the image object to dump * @param filebase base filename, appended with ".XXXX.zimg" where * XXXX is the format fourcc * @returns 0 on success or a system error code on failure */ extern int zbar_image_write(const zbar_image_t *image, const char *filebase); /** read back an image in the format written by zbar_image_write() * @note TBD */ extern zbar_image_t *zbar_image_read(char *filename); /*@}*/ /*------------------------------------------------------------*/ /** @name Processor interface * @anchor c-processor * high-level self-contained image processor. * processes video and images for barcodes, optionally displaying * images to a library owned output window */ /*@{*/ struct zbar_processor_s; /** opaque standalone processor object. */ typedef struct zbar_processor_s zbar_processor_t; /** constructor. * if threaded is set and threading is available the processor * will spawn threads where appropriate to avoid blocking and * improve responsiveness */ extern zbar_processor_t *zbar_processor_create(int threaded); /** destructor. cleans up all resources associated with the processor */ extern void zbar_processor_destroy(zbar_processor_t *processor); /** (re)initialization. * opens a video input device and/or prepares to display output */ extern int zbar_processor_init(zbar_processor_t *processor, const char *video_device, int enable_display); /** request a preferred size for the video image from the device. * the request may be adjusted or completely ignored by the driver. * @note must be called before zbar_processor_init() * @since 0.6 */ extern int zbar_processor_request_size(zbar_processor_t *processor, unsigned width, unsigned height); /** request a preferred video driver interface version for * debug/testing. * @note must be called before zbar_processor_init() * @since 0.6 */ extern int zbar_processor_request_interface(zbar_processor_t *processor, int version); /** request a preferred video I/O mode for debug/testing. You will * get errors if the driver does not support the specified mode. * @verbatim 0 = auto-detect 1 = force I/O using read() 2 = force memory mapped I/O using mmap() 3 = force USERPTR I/O (v4l2 only) @endverbatim * @note must be called before zbar_processor_init() * @since 0.7 */ extern int zbar_processor_request_iomode(zbar_processor_t *video, int iomode); /** force specific input and output formats for debug/testing. * @note must be called before zbar_processor_init() */ extern int zbar_processor_force_format(zbar_processor_t *processor, unsigned long input_format, unsigned long output_format); /** setup result handler callback. * the specified function will be called by the processor whenever * new results are available from the video stream or a static image. * pass a NULL value to disable callbacks. * @param processor the object on which to set the handler. * @param handler the function to call when new results are available. * @param userdata is set as with zbar_processor_set_userdata(). * @returns the previously registered handler */ extern zbar_image_data_handler_t* zbar_processor_set_data_handler(zbar_processor_t *processor, zbar_image_data_handler_t *handler, const void *userdata); /** associate user specified data value with the processor. * @since 0.6 */ extern void zbar_processor_set_userdata(zbar_processor_t *processor, void *userdata); /** return user specified data value associated with the processor. * @since 0.6 */ extern void *zbar_processor_get_userdata(const zbar_processor_t *processor); /** set config for indicated symbology (0 for all) to specified value. * @returns 0 for success, non-0 for failure (config does not apply to * specified symbology, or value out of range) * @see zbar_decoder_set_config() * @since 0.4 */ extern int zbar_processor_set_config(zbar_processor_t *processor, zbar_symbol_type_t symbology, zbar_config_t config, int value); /** parse configuration string using zbar_parse_config() * and apply to processor using zbar_processor_set_config(). * @returns 0 for success, non-0 for failure * @see zbar_parse_config() * @see zbar_processor_set_config() * @since 0.4 */ static inline int zbar_processor_parse_config (zbar_processor_t *processor, const char *config_string) { zbar_symbol_type_t sym; zbar_config_t cfg; int val; return(zbar_parse_config(config_string, &sym, &cfg, &val) || zbar_processor_set_config(processor, sym, cfg, val)); } /** retrieve the current state of the ouput window. * @returns 1 if the output window is currently displayed, 0 if not. * @returns -1 if an error occurs */ extern int zbar_processor_is_visible(zbar_processor_t *processor); /** show or hide the display window owned by the library. * the size will be adjusted to the input size */ extern int zbar_processor_set_visible(zbar_processor_t *processor, int visible); /** control the processor in free running video mode. * only works if video input is initialized. if threading is in use, * scanning will occur in the background, otherwise this is only * useful wrapping calls to zbar_processor_user_wait(). if the * library output window is visible, video display will be enabled. */ extern int zbar_processor_set_active(zbar_processor_t *processor, int active); /** retrieve decode results for last scanned image/frame. * @returns the symbol set result container or NULL if no results are * available * @note the returned symbol set has its reference count incremented; * ensure that the count is decremented after use * @since 0.10 */ extern const zbar_symbol_set_t* zbar_processor_get_results(const zbar_processor_t *processor); /** wait for input to the display window from the user * (via mouse or keyboard). * @returns >0 when input is received, 0 if timeout ms expired * with no input or -1 in case of an error */ extern int zbar_processor_user_wait(zbar_processor_t *processor, int timeout); /** process from the video stream until a result is available, * or the timeout (in milliseconds) expires. * specify a timeout of -1 to scan indefinitely * (zbar_processor_set_active() may still be used to abort the scan * from another thread). * if the library window is visible, video display will be enabled. * @note that multiple results may still be returned (despite the * name). * @returns >0 if symbols were successfully decoded, * 0 if no symbols were found (ie, the timeout expired) * or -1 if an error occurs */ extern int zbar_process_one(zbar_processor_t *processor, int timeout); /** process the provided image for barcodes. * if the library window is visible, the image will be displayed. * @returns >0 if symbols were successfully decoded, * 0 if no symbols were found or -1 if an error occurs */ extern int zbar_process_image(zbar_processor_t *processor, zbar_image_t *image); /** display detail for last processor error to stderr. * @returns a non-zero value suitable for passing to exit() */ static inline int zbar_processor_error_spew (const zbar_processor_t *processor, int verbosity) { return(_zbar_error_spew(processor, verbosity)); } /** retrieve the detail string for the last processor error. */ static inline const char* zbar_processor_error_string (const zbar_processor_t *processor, int verbosity) { return(_zbar_error_string(processor, verbosity)); } /** retrieve the type code for the last processor error. */ static inline zbar_error_t zbar_processor_get_error_code (const zbar_processor_t *processor) { return(_zbar_get_error_code(processor)); } /*@}*/ /*------------------------------------------------------------*/ /** @name Video interface * @anchor c-video * mid-level video source abstraction. * captures images from a video device */ /*@{*/ struct zbar_video_s; /** opaque video object. */ typedef struct zbar_video_s zbar_video_t; /** constructor. */ extern zbar_video_t *zbar_video_create(void); /** destructor. */ extern void zbar_video_destroy(zbar_video_t *video); /** open and probe a video device. * the device specified by platform specific unique name * (v4l device node path in *nix eg "/dev/video", * DirectShow DevicePath property in windows). * @returns 0 if successful or -1 if an error occurs */ extern int zbar_video_open(zbar_video_t *video, const char *device); /** retrieve file descriptor associated with open *nix video device * useful for using select()/poll() to tell when new images are * available (NB v4l2 only!!). * @returns the file descriptor or -1 if the video device is not open * or the driver only supports v4l1 */ extern int zbar_video_get_fd(const zbar_video_t *video); /** request a preferred size for the video image from the device. * the request may be adjusted or completely ignored by the driver. * @returns 0 if successful or -1 if the video device is already * initialized * @since 0.6 */ extern int zbar_video_request_size(zbar_video_t *video, unsigned width, unsigned height); /** request a preferred driver interface version for debug/testing. * @note must be called before zbar_video_open() * @since 0.6 */ extern int zbar_video_request_interface(zbar_video_t *video, int version); /** request a preferred I/O mode for debug/testing. You will get * errors if the driver does not support the specified mode. * @verbatim 0 = auto-detect 1 = force I/O using read() 2 = force memory mapped I/O using mmap() 3 = force USERPTR I/O (v4l2 only) @endverbatim * @note must be called before zbar_video_open() * @since 0.7 */ extern int zbar_video_request_iomode(zbar_video_t *video, int iomode); /** retrieve current output image width. * @returns the width or 0 if the video device is not open */ extern int zbar_video_get_width(const zbar_video_t *video); /** retrieve current output image height. * @returns the height or 0 if the video device is not open */ extern int zbar_video_get_height(const zbar_video_t *video); /** initialize video using a specific format for debug. * use zbar_negotiate_format() to automatically select and initialize * the best available format */ extern int zbar_video_init(zbar_video_t *video, unsigned long format); /** start/stop video capture. * all buffered images are retired when capture is disabled. * @returns 0 if successful or -1 if an error occurs */ extern int zbar_video_enable(zbar_video_t *video, int enable); /** retrieve next captured image. blocks until an image is available. * @returns NULL if video is not enabled or an error occurs */ extern zbar_image_t *zbar_video_next_image(zbar_video_t *video); /** display detail for last video error to stderr. * @returns a non-zero value suitable for passing to exit() */ static inline int zbar_video_error_spew (const zbar_video_t *video, int verbosity) { return(_zbar_error_spew(video, verbosity)); } /** retrieve the detail string for the last video error. */ static inline const char *zbar_video_error_string (const zbar_video_t *video, int verbosity) { return(_zbar_error_string(video, verbosity)); } /** retrieve the type code for the last video error. */ static inline zbar_error_t zbar_video_get_error_code (const zbar_video_t *video) { return(_zbar_get_error_code(video)); } /*@}*/ /*------------------------------------------------------------*/ /** @name Window interface * @anchor c-window * mid-level output window abstraction. * displays images to user-specified platform specific output window */ /*@{*/ struct zbar_window_s; /** opaque window object. */ typedef struct zbar_window_s zbar_window_t; /** constructor. */ extern zbar_window_t *zbar_window_create(void); /** destructor. */ extern void zbar_window_destroy(zbar_window_t *window); /** associate reader with an existing platform window. * This can be any "Drawable" for X Windows or a "HWND" for windows. * input images will be scaled into the output window. * pass NULL to detach from the resource, further input will be * ignored */ extern int zbar_window_attach(zbar_window_t *window, void *x11_display_w32_hwnd, unsigned long x11_drawable); /** control content level of the reader overlay. * the overlay displays graphical data for informational or debug * purposes. higher values increase the level of annotation (possibly * decreasing performance). @verbatim 0 = disable overlay 1 = outline decoded symbols (default) 2 = also track and display input frame rate @endverbatim */ extern void zbar_window_set_overlay(zbar_window_t *window, int level); /** retrieve current content level of reader overlay. * @see zbar_window_set_overlay() * @since 0.10 */ extern int zbar_window_get_overlay(const zbar_window_t *window); /** draw a new image into the output window. */ extern int zbar_window_draw(zbar_window_t *window, zbar_image_t *image); /** redraw the last image (exposure handler). */ extern int zbar_window_redraw(zbar_window_t *window); /** resize the image window (reconfigure handler). * this does @em not update the contents of the window * @since 0.3, changed in 0.4 to not redraw window */ extern int zbar_window_resize(zbar_window_t *window, unsigned width, unsigned height); /** display detail for last window error to stderr. * @returns a non-zero value suitable for passing to exit() */ static inline int zbar_window_error_spew (const zbar_window_t *window, int verbosity) { return(_zbar_error_spew(window, verbosity)); } /** retrieve the detail string for the last window error. */ static inline const char* zbar_window_error_string (const zbar_window_t *window, int verbosity) { return(_zbar_error_string(window, verbosity)); } /** retrieve the type code for the last window error. */ static inline zbar_error_t zbar_window_get_error_code (const zbar_window_t *window) { return(_zbar_get_error_code(window)); } /** select a compatible format between video input and output window. * the selection algorithm attempts to use a format shared by * video input and window output which is also most useful for * barcode scanning. if a format conversion is necessary, it will * heuristically attempt to minimize the cost of the conversion */ extern int zbar_negotiate_format(zbar_video_t *video, zbar_window_t *window); /*@}*/ /*------------------------------------------------------------*/ /** @name Image Scanner interface * @anchor c-imagescanner * mid-level image scanner interface. * reads barcodes from 2-D images */ /*@{*/ struct zbar_image_scanner_s; /** opaque image scanner object. */ typedef struct zbar_image_scanner_s zbar_image_scanner_t; /** constructor. */ extern zbar_image_scanner_t *zbar_image_scanner_create(void); /** destructor. */ extern void zbar_image_scanner_destroy(zbar_image_scanner_t *scanner); /** setup result handler callback. * the specified function will be called by the scanner whenever * new results are available from a decoded image. * pass a NULL value to disable callbacks. * @returns the previously registered handler */ extern zbar_image_data_handler_t* zbar_image_scanner_set_data_handler(zbar_image_scanner_t *scanner, zbar_image_data_handler_t *handler, const void *userdata); /** set config for indicated symbology (0 for all) to specified value. * @returns 0 for success, non-0 for failure (config does not apply to * specified symbology, or value out of range) * @see zbar_decoder_set_config() * @since 0.4 */ extern int zbar_image_scanner_set_config(zbar_image_scanner_t *scanner, zbar_symbol_type_t symbology, zbar_config_t config, int value); /** parse configuration string using zbar_parse_config() * and apply to image scanner using zbar_image_scanner_set_config(). * @returns 0 for success, non-0 for failure * @see zbar_parse_config() * @see zbar_image_scanner_set_config() * @since 0.4 */ static inline int zbar_image_scanner_parse_config (zbar_image_scanner_t *scanner, const char *config_string) { zbar_symbol_type_t sym; zbar_config_t cfg; int val; return(zbar_parse_config(config_string, &sym, &cfg, &val) || zbar_image_scanner_set_config(scanner, sym, cfg, val)); } /** enable or disable the inter-image result cache (default disabled). * mostly useful for scanning video frames, the cache filters * duplicate results from consecutive images, while adding some * consistency checking and hysteresis to the results. * this interface also clears the cache */ extern void zbar_image_scanner_enable_cache(zbar_image_scanner_t *scanner, int enable); /** remove any previously decoded results from the image scanner and the * specified image. somewhat more efficient version of * zbar_image_set_symbols(image, NULL) which may retain memory for * subsequent decodes * @since 0.10 */ extern void zbar_image_scanner_recycle_image(zbar_image_scanner_t *scanner, zbar_image_t *image); /** retrieve decode results for last scanned image. * @returns the symbol set result container or NULL if no results are * available * @note the symbol set does not have its reference count adjusted; * ensure that the count is incremented if the results may be kept * after the next image is scanned * @since 0.10 */ extern const zbar_symbol_set_t* zbar_image_scanner_get_results(const zbar_image_scanner_t *scanner); /** scan for symbols in provided image. The image format must be * "Y800" or "GRAY". * @returns >0 if symbols were successfully decoded from the image, * 0 if no symbols were found or -1 if an error occurs * @see zbar_image_convert() * @since 0.9 - changed to only accept grayscale images */ extern int zbar_scan_image(zbar_image_scanner_t *scanner, zbar_image_t *image); /*@}*/ /*------------------------------------------------------------*/ /** @name Decoder interface * @anchor c-decoder * low-level bar width stream decoder interface. * identifies symbols and extracts encoded data */ /*@{*/ struct zbar_decoder_s; /** opaque decoder object. */ typedef struct zbar_decoder_s zbar_decoder_t; /** decoder data handler callback function. * called by decoder when new data has just been decoded */ typedef void (zbar_decoder_handler_t)(zbar_decoder_t *decoder); /** constructor. */ extern zbar_decoder_t *zbar_decoder_create(void); /** destructor. */ extern void zbar_decoder_destroy(zbar_decoder_t *decoder); /** set config for indicated symbology (0 for all) to specified value. * @returns 0 for success, non-0 for failure (config does not apply to * specified symbology, or value out of range) * @since 0.4 */ extern int zbar_decoder_set_config(zbar_decoder_t *decoder, zbar_symbol_type_t symbology, zbar_config_t config, int value); /** parse configuration string using zbar_parse_config() * and apply to decoder using zbar_decoder_set_config(). * @returns 0 for success, non-0 for failure * @see zbar_parse_config() * @see zbar_decoder_set_config() * @since 0.4 */ static inline int zbar_decoder_parse_config (zbar_decoder_t *decoder, const char *config_string) { zbar_symbol_type_t sym; zbar_config_t cfg; int val; return(zbar_parse_config(config_string, &sym, &cfg, &val) || zbar_decoder_set_config(decoder, sym, cfg, val)); } /** clear all decoder state. * any partial symbols are flushed */ extern void zbar_decoder_reset(zbar_decoder_t *decoder); /** mark start of a new scan pass. * clears any intra-symbol state and resets color to ::ZBAR_SPACE. * any partially decoded symbol state is retained */ extern void zbar_decoder_new_scan(zbar_decoder_t *decoder); /** process next bar/space width from input stream. * the width is in arbitrary relative units. first value of a scan * is ::ZBAR_SPACE width, alternating from there. * @returns appropriate symbol type if width completes * decode of a symbol (data is available for retrieval) * @returns ::ZBAR_PARTIAL as a hint if part of a symbol was decoded * @returns ::ZBAR_NONE (0) if no new symbol data is available */ extern zbar_symbol_type_t zbar_decode_width(zbar_decoder_t *decoder, unsigned width); /** retrieve color of @em next element passed to * zbar_decode_width(). */ extern zbar_color_t zbar_decoder_get_color(const zbar_decoder_t *decoder); /** retrieve last decoded data. * @returns the data string or NULL if no new data available. * the returned data buffer is owned by library, contents are only * valid between non-0 return from zbar_decode_width and next library * call */ extern const char *zbar_decoder_get_data(const zbar_decoder_t *decoder); /** retrieve length of binary data. * @returns the length of the decoded data or 0 if no new data * available. */ extern unsigned int zbar_decoder_get_data_length(const zbar_decoder_t *decoder); /** retrieve last decoded symbol type. * @returns the type or ::ZBAR_NONE if no new data available */ extern zbar_symbol_type_t zbar_decoder_get_type(const zbar_decoder_t *decoder); /** setup data handler callback. * the registered function will be called by the decoder * just before zbar_decode_width() returns a non-zero value. * pass a NULL value to disable callbacks. * @returns the previously registered handler */ extern zbar_decoder_handler_t* zbar_decoder_set_handler(zbar_decoder_t *decoder, zbar_decoder_handler_t *handler); /** associate user specified data value with the decoder. */ extern void zbar_decoder_set_userdata(zbar_decoder_t *decoder, void *userdata); /** return user specified data value associated with the decoder. */ extern void *zbar_decoder_get_userdata(const zbar_decoder_t *decoder); /*@}*/ /*------------------------------------------------------------*/ /** @name Scanner interface * @anchor c-scanner * low-level linear intensity sample stream scanner interface. * identifies "bar" edges and measures width between them. * optionally passes to bar width decoder */ /*@{*/ struct zbar_scanner_s; /** opaque scanner object. */ typedef struct zbar_scanner_s zbar_scanner_t; /** constructor. * if decoder is non-NULL it will be attached to scanner * and called automatically at each new edge * current color is initialized to ::ZBAR_SPACE * (so an initial BAR->SPACE transition may be discarded) */ extern zbar_scanner_t *zbar_scanner_create(zbar_decoder_t *decoder); /** destructor. */ extern void zbar_scanner_destroy(zbar_scanner_t *scanner); /** clear all scanner state. * also resets an associated decoder */ extern zbar_symbol_type_t zbar_scanner_reset(zbar_scanner_t *scanner); /** mark start of a new scan pass. resets color to ::ZBAR_SPACE. * also updates an associated decoder. * @returns any decode results flushed from the pipeline * @note when not using callback handlers, the return value should * be checked the same as zbar_scan_y() * @note call zbar_scanner_flush() at least twice before calling this * method to ensure no decode results are lost */ extern zbar_symbol_type_t zbar_scanner_new_scan(zbar_scanner_t *scanner); /** flush scanner processing pipeline. * forces current scanner position to be a scan boundary. * call multiple times (max 3) to completely flush decoder. * @returns any decode/scan results flushed from the pipeline * @note when not using callback handlers, the return value should * be checked the same as zbar_scan_y() * @since 0.9 */ extern zbar_symbol_type_t zbar_scanner_flush(zbar_scanner_t *scanner); /** process next sample intensity value. * intensity (y) is in arbitrary relative units. * @returns result of zbar_decode_width() if a decoder is attached, * otherwise @returns (::ZBAR_PARTIAL) when new edge is detected * or 0 (::ZBAR_NONE) if no new edge is detected */ extern zbar_symbol_type_t zbar_scan_y(zbar_scanner_t *scanner, int y); /** process next sample from RGB (or BGR) triple. */ static inline zbar_symbol_type_t zbar_scan_rgb24 (zbar_scanner_t *scanner, unsigned char *rgb) { return(zbar_scan_y(scanner, rgb[0] + rgb[1] + rgb[2])); } /** retrieve last scanned width. */ extern unsigned zbar_scanner_get_width(const zbar_scanner_t *scanner); /** retrieve sample position of last edge. * @since 0.10 */ extern unsigned zbar_scanner_get_edge(const zbar_scanner_t *scn, unsigned offset, int prec); /** retrieve last scanned color. */ extern zbar_color_t zbar_scanner_get_color(const zbar_scanner_t *scanner); /*@}*/ #ifdef __cplusplus } } # include "zbar/Exception.h" # include "zbar/Decoder.h" # include "zbar/Scanner.h" # include "zbar/Symbol.h" # include "zbar/Image.h" # include "zbar/ImageScanner.h" # include "zbar/Video.h" # include "zbar/Window.h" # include "zbar/Processor.h" #endif #endif zbar-0.10/include/Makefile.am.inc0000644000000000000000000000071311270371414013507 00000000000000zincludedir = $(includedir)/zbar include_HEADERS = include/zbar.h zinclude_HEADERS = include/zbar/Scanner.h include/zbar/Decoder.h \ include/zbar/Exception.h include/zbar/Symbol.h include/zbar/Image.h \ include/zbar/ImageScanner.h include/zbar/Video.h include/zbar/Window.h \ include/zbar/Processor.h if HAVE_GTK zinclude_HEADERS += include/zbar/zbargtk.h endif if HAVE_QT zinclude_HEADERS += include/zbar/QZBar.h include/zbar/QZBarImage.h endif zbar-0.10/Makefile.in0000644000000000000000000053540111270371465011342 00000000000000# Makefile.in generated by automake 1.10.2 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = $(am__EXEEXT_2) $(am__EXEEXT_3) check_PROGRAMS = test/test_decode$(EXEEXT) test/test_convert$(EXEEXT) \ $(am__EXEEXT_4) test/test_proc$(EXEEXT) test/test_cpp$(EXEEXT) \ $(am__EXEEXT_5) $(am__EXEEXT_6) $(am__EXEEXT_7) EXTRA_PROGRAMS = $(am__EXEEXT_1) DIST_COMMON = README $(am__configure_deps) $(am__dist_doc_DATA_DIST) \ $(am__zinclude_HEADERS_DIST) $(dist_man_MANS) \ $(include_HEADERS) $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/doc/Makefile.am.inc $(srcdir)/gtk/Makefile.am.inc \ $(srcdir)/include/Makefile.am.inc \ $(srcdir)/plugin/Makefile.am.inc \ $(srcdir)/pygtk/Makefile.am.inc \ $(srcdir)/python/Makefile.am.inc $(srcdir)/qt/Makefile.am.inc \ $(srcdir)/test/Makefile.am.inc $(srcdir)/zbar-gtk.pc.in \ $(srcdir)/zbar-qt.pc.in $(srcdir)/zbar.pc.in \ $(srcdir)/zbar/Makefile.am.inc \ $(srcdir)/zbarcam/Makefile.am.inc \ $(srcdir)/zbarimg/Makefile.am.inc $(top_srcdir)/configure \ $(top_srcdir)/doc/doxygen.conf.in \ $(top_srcdir)/include/config.h.in COPYING ChangeLog INSTALL \ NEWS TODO config/compile config/config.guess \ config/config.rpath config/config.sub config/depcomp \ config/install-sh config/ltmain.sh config/missing @HAVE_GTK_TRUE@am__append_1 = include/zbar/zbargtk.h @HAVE_QT_TRUE@am__append_2 = include/zbar/QZBar.h include/zbar/QZBarImage.h @ENABLE_EAN_TRUE@am__append_3 = zbar/decoder/ean.h zbar/decoder/ean.c @ENABLE_CODE128_TRUE@am__append_4 = zbar/decoder/code128.h zbar/decoder/code128.c @ENABLE_CODE39_TRUE@am__append_5 = zbar/decoder/code39.h zbar/decoder/code39.c @ENABLE_I25_TRUE@am__append_6 = zbar/decoder/i25.h zbar/decoder/i25.c @ENABLE_PDF417_TRUE@am__append_7 = zbar/decoder/pdf417.h zbar/decoder/pdf417.c \ @ENABLE_PDF417_TRUE@ zbar/decoder/pdf417_hash.h @ENABLE_QRCODE_TRUE@am__append_8 = zbar/qrcode.h \ @ENABLE_QRCODE_TRUE@ zbar/decoder/qr_finder.h zbar/decoder/qr_finder.c \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/qrdec.h zbar/qrcode/qrdec.c zbar/qrcode/qrdectxt.c \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/rs.h zbar/qrcode/rs.c \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/isaac.h zbar/qrcode/isaac.c \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/bch15_5.h zbar/qrcode/bch15_5.c \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/binarize.h zbar/qrcode/binarize.c \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/util.h zbar/qrcode/util.c @WIN32_TRUE@am__append_9 = zbar/processor/win.c zbar/libzbar.rc @WIN32_TRUE@am__append_10 = -mthreads @WIN32_TRUE@am__append_11 = -mthreads # FIXME broken @WIN32_TRUE@am__append_12 = zbar/libzbar-rc.lo @WIN32_FALSE@am__append_13 = zbar/processor/posix.h zbar/processor/posix.c @HAVE_V4L1_TRUE@am__append_14 = zbar/video/v4l1.c @HAVE_V4L1_TRUE@@HAVE_V4L2_TRUE@am__append_15 = zbar/video/v4l2.c @HAVE_VIDEO_TRUE@@WIN32_TRUE@am__append_16 = zbar/video/vfw.c @HAVE_VIDEO_TRUE@@WIN32_TRUE@am__append_17 = -lvfw32 @HAVE_VIDEO_FALSE@am__append_18 = zbar/video/null.c @HAVE_JPEG_TRUE@am__append_19 = zbar/jpeg.c @HAVE_X_TRUE@am__append_20 = zbar/processor/x.c \ @HAVE_X_TRUE@ zbar/window/x.h zbar/window/x.c zbar/window/ximage.c @HAVE_X_TRUE@am__append_21 = $(X_CFLAGS) @HAVE_X_TRUE@am__append_22 = $(X_LIBS) @HAVE_X_TRUE@am__append_23 = $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) @HAVE_XV_TRUE@@HAVE_X_TRUE@am__append_24 = zbar/window/xv.c @HAVE_XV_TRUE@@HAVE_X_TRUE@am__append_25 = $(XV_LIBS) @HAVE_X_FALSE@@WIN32_TRUE@am__append_26 = zbar/window/win.h zbar/window/win.c \ @HAVE_X_FALSE@@WIN32_TRUE@ zbar/window/dib.c # zbar/window/vfw.c -lvfw32 @HAVE_X_FALSE@@WIN32_TRUE@am__append_27 = -lgdi32 -lwinmm @HAVE_X_FALSE@@WIN32_FALSE@am__append_28 = zbar/processor/null.c zbar/window/null.c @HAVE_MAGICK_TRUE@am__append_29 = zbarimg/zbarimg # automake bug in "monolithic mode"? @HAVE_MAGICK_TRUE@am__append_30 = zbarimg/.libs/zbarimg @HAVE_MAGICK_TRUE@@WIN32_TRUE@am__append_31 = zbarimg/zbarimg.rc @HAVE_MAGICK_TRUE@@WIN32_TRUE@am__append_32 = zbarimg/zbarimg-rc.o @HAVE_MAGICK_TRUE@am__append_33 = test/barcodetest.py @HAVE_VIDEO_TRUE@am__append_34 = zbarcam/zbarcam # automake bug in "monolithic mode"? @HAVE_VIDEO_TRUE@am__append_35 = zbarcam/.libs/zbarcam @HAVE_VIDEO_TRUE@@WIN32_TRUE@am__append_36 = zbarcam/zbarcam.rc @HAVE_VIDEO_TRUE@@WIN32_TRUE@am__append_37 = zbarcam/zbarcam-rc.o @HAVE_PYTHON_TRUE@am__append_38 = python/zbar.la @HAVE_PYTHON_TRUE@am__append_39 = python/test/barcode.png python/test/test_zbar.py @HAVE_GTK_TRUE@am__append_40 = gtk/libzbargtk.la @HAVE_GTK_TRUE@am__append_41 = gtk/zbarmarshal.c gtk/zbarmarshal.h @HAVE_GTK_TRUE@am__append_42 = gtk/zbarmarshal.c gtk/zbarmarshal.h @HAVE_GTK_TRUE@am__append_43 = gtk/zbarmarshal.list @HAVE_GTK_TRUE@am__append_44 = zbar-gtk.pc @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@am__append_45 = pygtk/zbarpygtk.la @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@am__append_46 = pygtk/zbarpygtk.c pygtk/zbarpygtk.defs @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@am__append_47 = pygtk/zbarpygtk.c pygtk/zbarpygtk.defs @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@am__append_48 = pygtk/zbarpygtk.override @HAVE_QT_TRUE@am__append_49 = qt/libzbarqt.la @HAVE_QT_TRUE@am__append_50 = $(nodist_qt_libzbarqt_la_SOURCES) \ @HAVE_QT_TRUE@ $(nodist_test_test_qt_SOURCES) @HAVE_QT_TRUE@am__append_51 = $(nodist_qt_libzbarqt_la_SOURCES) \ @HAVE_QT_TRUE@ $(nodist_test_test_qt_SOURCES) @HAVE_QT_TRUE@am__append_52 = zbar-qt.pc @HAVE_NPAPI_TRUE@am__append_53 = plugin/libzbarplugin.la #check_PROGRAMS += test/test_window #test_test_window_SOURCES = test/test_window.c $(TEST_IMAGE_SOURCES) #test_test_window_CPPFLAGS = -I$(srcdir)/zbar $(AM_CPPFLAGS) #test_test_window_LDADD = zbar/libzbar.la $(AM_LDADD) @HAVE_VIDEO_TRUE@am__append_54 = test/test_video @HAVE_JPEG_TRUE@am__append_55 = test/test_jpeg @HAVE_MAGICK_TRUE@am__append_56 = test/dbg_scan @HAVE_GTK_TRUE@am__append_57 = test/test_gtk @HAVE_QT_TRUE@am__append_58 = test/test_qt @HAVE_MAGICK_TRUE@am__append_59 = doc/man/zbarimg.1 @HAVE_VIDEO_TRUE@am__append_60 = doc/man/zbarcam.1 @WIN32_TRUE@am__append_61 = README.windows subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \ $(top_srcdir)/config/ltoptions.m4 \ $(top_srcdir)/config/ltsugar.m4 \ $(top_srcdir)/config/ltversion.m4 \ $(top_srcdir)/config/lt~obsolete.m4 $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/include/config.h CONFIG_CLEAN_FILES = zbar.pc zbar-gtk.pc zbar-qt.pc doc/doxygen.conf am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pyexecdir)" \ "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \ "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" \ "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)" \ "$(DESTDIR)$(zincludedir)" libLTLIBRARIES_INSTALL = $(INSTALL) pyexecLTLIBRARIES_INSTALL = $(INSTALL) LTLIBRARIES = $(lib_LTLIBRARIES) $(pyexec_LTLIBRARIES) am__DEPENDENCIES_1 = @HAVE_GTK_TRUE@gtk_libzbargtk_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @HAVE_GTK_TRUE@ zbar/libzbar.la am__dist_gtk_libzbargtk_la_SOURCES_DIST = gtk/zbargtk.c \ gtk/zbargtkprivate.h am__dirstamp = $(am__leading_dot)dirstamp @HAVE_GTK_TRUE@dist_gtk_libzbargtk_la_OBJECTS = \ @HAVE_GTK_TRUE@ gtk/gtk_libzbargtk_la-zbargtk.lo @HAVE_GTK_TRUE@nodist_gtk_libzbargtk_la_OBJECTS = \ @HAVE_GTK_TRUE@ gtk/gtk_libzbargtk_la-zbarmarshal.lo gtk_libzbargtk_la_OBJECTS = $(dist_gtk_libzbargtk_la_OBJECTS) \ $(nodist_gtk_libzbargtk_la_OBJECTS) gtk_libzbargtk_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(gtk_libzbargtk_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_GTK_TRUE@am_gtk_libzbargtk_la_rpath = -rpath $(libdir) plugin_libzbarplugin_la_LIBADD = am__plugin_libzbarplugin_la_SOURCES_DIST = plugin/plugin.c @HAVE_NPAPI_TRUE@am_plugin_libzbarplugin_la_OBJECTS = \ @HAVE_NPAPI_TRUE@ plugin/plugin_libzbarplugin_la-plugin.lo plugin_libzbarplugin_la_OBJECTS = \ $(am_plugin_libzbarplugin_la_OBJECTS) plugin_libzbarplugin_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(plugin_libzbarplugin_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_NPAPI_TRUE@am_plugin_libzbarplugin_la_rpath = -rpath $(libdir) @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@pygtk_zbarpygtk_la_DEPENDENCIES = \ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ $(am__DEPENDENCIES_1) \ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ $(am__DEPENDENCIES_1) \ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ gtk/libzbargtk.la am__dist_pygtk_zbarpygtk_la_SOURCES_DIST = pygtk/zbarpygtkmodule.c @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@dist_pygtk_zbarpygtk_la_OBJECTS = pygtk/pygtk_zbarpygtk_la-zbarpygtkmodule.lo @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@nodist_pygtk_zbarpygtk_la_OBJECTS = pygtk/pygtk_zbarpygtk_la-zbarpygtk.lo pygtk_zbarpygtk_la_OBJECTS = $(dist_pygtk_zbarpygtk_la_OBJECTS) \ $(nodist_pygtk_zbarpygtk_la_OBJECTS) pygtk_zbarpygtk_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(pygtk_zbarpygtk_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@am_pygtk_zbarpygtk_la_rpath = -rpath \ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ $(pyexecdir) @HAVE_PYTHON_TRUE@python_zbar_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @HAVE_PYTHON_TRUE@ zbar/libzbar.la am__python_zbar_la_SOURCES_DIST = python/zbarmodule.c \ python/zbarmodule.h python/enum.c python/exception.c \ python/symbol.c python/symbolset.c python/symboliter.c \ python/image.c python/processor.c python/imagescanner.c \ python/decoder.c python/scanner.c @HAVE_PYTHON_TRUE@am_python_zbar_la_OBJECTS = \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-zbarmodule.lo \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-enum.lo \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-exception.lo \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-symbol.lo \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-symbolset.lo \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-symboliter.lo \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-image.lo \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-processor.lo \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-imagescanner.lo \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-decoder.lo \ @HAVE_PYTHON_TRUE@ python/python_zbar_la-scanner.lo python_zbar_la_OBJECTS = $(am_python_zbar_la_OBJECTS) python_zbar_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(python_zbar_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_PYTHON_TRUE@am_python_zbar_la_rpath = -rpath $(pyexecdir) @HAVE_QT_TRUE@qt_libzbarqt_la_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @HAVE_QT_TRUE@ zbar/libzbar.la am__qt_libzbarqt_la_SOURCES_DIST = qt/QZBar.cpp qt/QZBarThread.h \ qt/QZBarThread.cpp @HAVE_QT_TRUE@am_qt_libzbarqt_la_OBJECTS = \ @HAVE_QT_TRUE@ qt/qt_libzbarqt_la-QZBar.lo \ @HAVE_QT_TRUE@ qt/qt_libzbarqt_la-QZBarThread.lo @HAVE_QT_TRUE@nodist_qt_libzbarqt_la_OBJECTS = \ @HAVE_QT_TRUE@ qt/qt_libzbarqt_la-moc_QZBar.lo \ @HAVE_QT_TRUE@ qt/qt_libzbarqt_la-moc_QZBarThread.lo qt_libzbarqt_la_OBJECTS = $(am_qt_libzbarqt_la_OBJECTS) \ $(nodist_qt_libzbarqt_la_OBJECTS) qt_libzbarqt_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \ $(CXXFLAGS) $(qt_libzbarqt_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_QT_TRUE@am_qt_libzbarqt_la_rpath = -rpath $(libdir) @HAVE_X_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1) \ @HAVE_X_TRUE@ $(am__DEPENDENCIES_1) @HAVE_XV_TRUE@@HAVE_X_TRUE@am__DEPENDENCIES_3 = $(am__DEPENDENCIES_1) zbar_libzbar_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__append_12) \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_2) \ $(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) am__zbar_libzbar_la_SOURCES_DIST = zbar/debug.h zbar/config.c \ zbar/error.h zbar/error.c zbar/symbol.h zbar/symbol.c \ zbar/image.h zbar/image.c zbar/convert.c zbar/processor.c \ zbar/processor.h zbar/processor/lock.c zbar/refcnt.h \ zbar/refcnt.c zbar/timer.h zbar/mutex.h zbar/event.h \ zbar/thread.h zbar/window.h zbar/window.c zbar/video.h \ zbar/video.c zbar/img_scanner.h zbar/img_scanner.c \ zbar/scanner.c zbar/decoder.h zbar/decoder.c \ zbar/decoder/ean.h zbar/decoder/ean.c zbar/decoder/code128.h \ zbar/decoder/code128.c zbar/decoder/code39.h \ zbar/decoder/code39.c zbar/decoder/i25.h zbar/decoder/i25.c \ zbar/decoder/pdf417.h zbar/decoder/pdf417.c \ zbar/decoder/pdf417_hash.h zbar/qrcode.h \ zbar/decoder/qr_finder.h zbar/decoder/qr_finder.c \ zbar/qrcode/qrdec.h zbar/qrcode/qrdec.c zbar/qrcode/qrdectxt.c \ zbar/qrcode/rs.h zbar/qrcode/rs.c zbar/qrcode/isaac.h \ zbar/qrcode/isaac.c zbar/qrcode/bch15_5.h \ zbar/qrcode/bch15_5.c zbar/qrcode/binarize.h \ zbar/qrcode/binarize.c zbar/qrcode/util.h zbar/qrcode/util.c \ zbar/processor/win.c zbar/libzbar.rc zbar/processor/posix.h \ zbar/processor/posix.c zbar/video/v4l1.c zbar/video/v4l2.c \ zbar/video/vfw.c zbar/video/null.c zbar/jpeg.c \ zbar/processor/x.c zbar/window/x.h zbar/window/x.c \ zbar/window/ximage.c zbar/window/xv.c zbar/window/win.h \ zbar/window/win.c zbar/window/dib.c zbar/processor/null.c \ zbar/window/null.c @ENABLE_EAN_TRUE@am__objects_1 = zbar/decoder/zbar_libzbar_la-ean.lo @ENABLE_CODE128_TRUE@am__objects_2 = \ @ENABLE_CODE128_TRUE@ zbar/decoder/zbar_libzbar_la-code128.lo @ENABLE_CODE39_TRUE@am__objects_3 = \ @ENABLE_CODE39_TRUE@ zbar/decoder/zbar_libzbar_la-code39.lo @ENABLE_I25_TRUE@am__objects_4 = zbar/decoder/zbar_libzbar_la-i25.lo @ENABLE_PDF417_TRUE@am__objects_5 = \ @ENABLE_PDF417_TRUE@ zbar/decoder/zbar_libzbar_la-pdf417.lo @ENABLE_QRCODE_TRUE@am__objects_6 = \ @ENABLE_QRCODE_TRUE@ zbar/decoder/zbar_libzbar_la-qr_finder.lo \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/zbar_libzbar_la-qrdec.lo \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/zbar_libzbar_la-qrdectxt.lo \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/zbar_libzbar_la-rs.lo \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/zbar_libzbar_la-isaac.lo \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/zbar_libzbar_la-bch15_5.lo \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/zbar_libzbar_la-binarize.lo \ @ENABLE_QRCODE_TRUE@ zbar/qrcode/zbar_libzbar_la-util.lo @WIN32_TRUE@am__objects_7 = zbar/processor/zbar_libzbar_la-win.lo @WIN32_FALSE@am__objects_8 = zbar/processor/zbar_libzbar_la-posix.lo @HAVE_V4L1_TRUE@am__objects_9 = zbar/video/zbar_libzbar_la-v4l1.lo @HAVE_V4L1_TRUE@@HAVE_V4L2_TRUE@am__objects_10 = zbar/video/zbar_libzbar_la-v4l2.lo @HAVE_VIDEO_TRUE@@WIN32_TRUE@am__objects_11 = zbar/video/zbar_libzbar_la-vfw.lo @HAVE_VIDEO_FALSE@am__objects_12 = zbar/video/zbar_libzbar_la-null.lo @HAVE_JPEG_TRUE@am__objects_13 = zbar/zbar_libzbar_la-jpeg.lo @HAVE_X_TRUE@am__objects_14 = zbar/processor/zbar_libzbar_la-x.lo \ @HAVE_X_TRUE@ zbar/window/zbar_libzbar_la-x.lo \ @HAVE_X_TRUE@ zbar/window/zbar_libzbar_la-ximage.lo @HAVE_XV_TRUE@@HAVE_X_TRUE@am__objects_15 = \ @HAVE_XV_TRUE@@HAVE_X_TRUE@ zbar/window/zbar_libzbar_la-xv.lo @HAVE_X_FALSE@@WIN32_TRUE@am__objects_16 = \ @HAVE_X_FALSE@@WIN32_TRUE@ zbar/window/zbar_libzbar_la-win.lo \ @HAVE_X_FALSE@@WIN32_TRUE@ zbar/window/zbar_libzbar_la-dib.lo @HAVE_X_FALSE@@WIN32_FALSE@am__objects_17 = zbar/processor/zbar_libzbar_la-null.lo \ @HAVE_X_FALSE@@WIN32_FALSE@ zbar/window/zbar_libzbar_la-null.lo am_zbar_libzbar_la_OBJECTS = zbar/zbar_libzbar_la-config.lo \ zbar/zbar_libzbar_la-error.lo zbar/zbar_libzbar_la-symbol.lo \ zbar/zbar_libzbar_la-image.lo zbar/zbar_libzbar_la-convert.lo \ zbar/zbar_libzbar_la-processor.lo \ zbar/processor/zbar_libzbar_la-lock.lo \ zbar/zbar_libzbar_la-refcnt.lo zbar/zbar_libzbar_la-window.lo \ zbar/zbar_libzbar_la-video.lo \ zbar/zbar_libzbar_la-img_scanner.lo \ zbar/zbar_libzbar_la-scanner.lo \ zbar/zbar_libzbar_la-decoder.lo $(am__objects_1) \ $(am__objects_2) $(am__objects_3) $(am__objects_4) \ $(am__objects_5) $(am__objects_6) $(am__objects_7) \ $(am__objects_8) $(am__objects_9) $(am__objects_10) \ $(am__objects_11) $(am__objects_12) $(am__objects_13) \ $(am__objects_14) $(am__objects_15) $(am__objects_16) \ $(am__objects_17) zbar_libzbar_la_OBJECTS = $(am_zbar_libzbar_la_OBJECTS) zbar_libzbar_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(zbar_libzbar_la_LDFLAGS) $(LDFLAGS) -o $@ @HAVE_MAGICK_TRUE@am__EXEEXT_1 = test/dbg_scan$(EXEEXT) @HAVE_MAGICK_TRUE@am__EXEEXT_2 = zbarimg/zbarimg$(EXEEXT) @HAVE_VIDEO_TRUE@am__EXEEXT_3 = zbarcam/zbarcam$(EXEEXT) binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) @HAVE_VIDEO_TRUE@am__EXEEXT_4 = test/test_video$(EXEEXT) @HAVE_JPEG_TRUE@am__EXEEXT_5 = test/test_jpeg$(EXEEXT) @HAVE_GTK_TRUE@am__EXEEXT_6 = test/test_gtk$(EXEEXT) @HAVE_QT_TRUE@am__EXEEXT_7 = test/test_qt$(EXEEXT) PROGRAMS = $(bin_PROGRAMS) am__test_dbg_scan_SOURCES_DIST = test/dbg_scan.cpp @HAVE_MAGICK_TRUE@am_test_dbg_scan_OBJECTS = \ @HAVE_MAGICK_TRUE@ test/test_dbg_scan-dbg_scan.$(OBJEXT) test_dbg_scan_OBJECTS = $(am_test_dbg_scan_OBJECTS) @HAVE_MAGICK_TRUE@test_dbg_scan_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @HAVE_MAGICK_TRUE@ zbar/libzbar.la am__objects_18 = test/test_images.$(OBJEXT) am_test_test_convert_OBJECTS = test/test_convert.$(OBJEXT) \ $(am__objects_18) test_test_convert_OBJECTS = $(am_test_test_convert_OBJECTS) test_test_convert_DEPENDENCIES = zbar/libzbar.la am_test_test_cpp_OBJECTS = test/test_cpp.$(OBJEXT) test_test_cpp_OBJECTS = $(am_test_test_cpp_OBJECTS) test_test_cpp_DEPENDENCIES = zbar/libzbar.la am_test_test_decode_OBJECTS = \ test/test_test_decode-test_decode.$(OBJEXT) test_test_decode_OBJECTS = $(am_test_test_decode_OBJECTS) test_test_decode_DEPENDENCIES = zbar/libzbar.la test_test_decode_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(test_test_decode_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__test_test_gtk_SOURCES_DIST = test/test_gtk.c test/scan_video.c @HAVE_GTK_TRUE@am_test_test_gtk_OBJECTS = \ @HAVE_GTK_TRUE@ test/test_test_gtk-test_gtk.$(OBJEXT) \ @HAVE_GTK_TRUE@ test/test_test_gtk-scan_video.$(OBJEXT) test_test_gtk_OBJECTS = $(am_test_test_gtk_OBJECTS) @HAVE_GTK_TRUE@test_test_gtk_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @HAVE_GTK_TRUE@ gtk/libzbargtk.la am__test_test_jpeg_SOURCES_DIST = test/test_jpeg.c @HAVE_JPEG_TRUE@am_test_test_jpeg_OBJECTS = test/test_jpeg.$(OBJEXT) test_test_jpeg_OBJECTS = $(am_test_test_jpeg_OBJECTS) @HAVE_JPEG_TRUE@test_test_jpeg_DEPENDENCIES = zbar/libzbar.la am_test_test_proc_OBJECTS = test/test_proc.$(OBJEXT) $(am__objects_18) test_test_proc_OBJECTS = $(am_test_test_proc_OBJECTS) test_test_proc_DEPENDENCIES = zbar/libzbar.la am__test_test_qt_SOURCES_DIST = test/test_qt.cpp test/scan_video.c @HAVE_QT_TRUE@am_test_test_qt_OBJECTS = \ @HAVE_QT_TRUE@ test/test_test_qt-test_qt.$(OBJEXT) \ @HAVE_QT_TRUE@ test/test_test_qt-scan_video.$(OBJEXT) nodist_test_test_qt_OBJECTS = test_test_qt_OBJECTS = $(am_test_test_qt_OBJECTS) \ $(nodist_test_test_qt_OBJECTS) @HAVE_QT_TRUE@test_test_qt_DEPENDENCIES = $(am__DEPENDENCIES_1) \ @HAVE_QT_TRUE@ qt/libzbarqt.la am__test_test_video_SOURCES_DIST = test/test_video.c \ test/test_images.c test/test_images.h @HAVE_VIDEO_TRUE@am_test_test_video_OBJECTS = \ @HAVE_VIDEO_TRUE@ test/test_video.$(OBJEXT) $(am__objects_18) test_test_video_OBJECTS = $(am_test_test_video_OBJECTS) @HAVE_VIDEO_TRUE@test_test_video_DEPENDENCIES = zbar/libzbar.la am__zbarcam_zbarcam_SOURCES_DIST = zbarcam/zbarcam.c \ zbarcam/zbarcam.rc am__objects_19 = @HAVE_VIDEO_TRUE@am_zbarcam_zbarcam_OBJECTS = \ @HAVE_VIDEO_TRUE@ zbarcam/zbarcam.$(OBJEXT) $(am__objects_19) zbarcam_zbarcam_OBJECTS = $(am_zbarcam_zbarcam_OBJECTS) @HAVE_VIDEO_TRUE@zbarcam_zbarcam_DEPENDENCIES = zbar/libzbar.la \ @HAVE_VIDEO_TRUE@ $(am__append_37) am__zbarimg_zbarimg_SOURCES_DIST = zbarimg/zbarimg.c \ zbarimg/zbarimg.rc @HAVE_MAGICK_TRUE@am_zbarimg_zbarimg_OBJECTS = \ @HAVE_MAGICK_TRUE@ zbarimg/zbarimg_zbarimg-zbarimg.$(OBJEXT) \ @HAVE_MAGICK_TRUE@ $(am__objects_19) zbarimg_zbarimg_OBJECTS = $(am_zbarimg_zbarimg_OBJECTS) @HAVE_MAGICK_TRUE@zbarimg_zbarimg_DEPENDENCIES = \ @HAVE_MAGICK_TRUE@ $(am__DEPENDENCIES_1) zbar/libzbar.la \ @HAVE_MAGICK_TRUE@ $(am__append_32) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/include depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \ $(LDFLAGS) -o $@ SOURCES = $(dist_gtk_libzbargtk_la_SOURCES) \ $(nodist_gtk_libzbargtk_la_SOURCES) \ $(plugin_libzbarplugin_la_SOURCES) \ $(dist_pygtk_zbarpygtk_la_SOURCES) \ $(nodist_pygtk_zbarpygtk_la_SOURCES) $(python_zbar_la_SOURCES) \ $(qt_libzbarqt_la_SOURCES) $(nodist_qt_libzbarqt_la_SOURCES) \ $(zbar_libzbar_la_SOURCES) $(EXTRA_zbar_libzbar_la_SOURCES) \ $(test_dbg_scan_SOURCES) $(test_test_convert_SOURCES) \ $(test_test_cpp_SOURCES) $(test_test_decode_SOURCES) \ $(test_test_gtk_SOURCES) $(test_test_jpeg_SOURCES) \ $(test_test_proc_SOURCES) $(test_test_qt_SOURCES) \ $(nodist_test_test_qt_SOURCES) $(test_test_video_SOURCES) \ $(zbarcam_zbarcam_SOURCES) $(zbarimg_zbarimg_SOURCES) DIST_SOURCES = $(am__dist_gtk_libzbargtk_la_SOURCES_DIST) \ $(am__plugin_libzbarplugin_la_SOURCES_DIST) \ $(am__dist_pygtk_zbarpygtk_la_SOURCES_DIST) \ $(am__python_zbar_la_SOURCES_DIST) \ $(am__qt_libzbarqt_la_SOURCES_DIST) \ $(am__zbar_libzbar_la_SOURCES_DIST) \ $(EXTRA_zbar_libzbar_la_SOURCES) \ $(am__test_dbg_scan_SOURCES_DIST) $(test_test_convert_SOURCES) \ $(test_test_cpp_SOURCES) $(test_test_decode_SOURCES) \ $(am__test_test_gtk_SOURCES_DIST) \ $(am__test_test_jpeg_SOURCES_DIST) $(test_test_proc_SOURCES) \ $(am__test_test_qt_SOURCES_DIST) \ $(am__test_test_video_SOURCES_DIST) \ $(am__zbarcam_zbarcam_SOURCES_DIST) \ $(am__zbarimg_zbarimg_SOURCES_DIST) man1dir = $(mandir)/man1 NROFF = nroff MANS = $(dist_man_MANS) am__dist_doc_DATA_DIST = COPYING HACKING INSTALL LICENSE NEWS README \ TODO README.windows dist_docDATA_INSTALL = $(INSTALL_DATA) pkgconfigDATA_INSTALL = $(INSTALL_DATA) pkgdataDATA_INSTALL = $(INSTALL_DATA) DATA = $(dist_doc_DATA) $(pkgconfig_DATA) $(pkgdata_DATA) includeHEADERS_INSTALL = $(INSTALL_HEADER) am__zinclude_HEADERS_DIST = include/zbar/Scanner.h \ include/zbar/Decoder.h include/zbar/Exception.h \ include/zbar/Symbol.h include/zbar/Image.h \ include/zbar/ImageScanner.h include/zbar/Video.h \ include/zbar/Window.h include/zbar/Processor.h \ include/zbar/zbargtk.h include/zbar/QZBar.h \ include/zbar/QZBarImage.h zincludeHEADERS_INSTALL = $(INSTALL_HEADER) HEADERS = $(include_HEADERS) $(zinclude_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ { test ! -d $(distdir) \ || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -fr $(distdir); }; } DIST_ARCHIVES = $(distdir).tar.gz $(distdir).tar.bz2 GZIP_ENV = --best distuninstallcheck_listfiles = find . -type f -print distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AR = @AR@ AS = @AS@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ GREP = @GREP@ GTK_CFLAGS = @GTK_CFLAGS@ GTK_LIBS = @GTK_LIBS@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LD = @LD@ LDFLAGS = @LDFLAGS@ LIBICONV = @LIBICONV@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIB_VERSION = @LIB_VERSION@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBICONV = @LTLIBICONV@ LTLIBOBJS = @LTLIBOBJS@ MAGICK_CFLAGS = @MAGICK_CFLAGS@ MAGICK_LIBS = @MAGICK_LIBS@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ MOC = @MOC@ NM = @NM@ NMEDIT = @NMEDIT@ NPAPI_CFLAGS = @NPAPI_CFLAGS@ NPAPI_LIBS = @NPAPI_LIBS@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PKG_CONFIG = @PKG_CONFIG@ PYGTK_CFLAGS = @PYGTK_CFLAGS@ PYGTK_CODEGEN = @PYGTK_CODEGEN@ PYGTK_DEFS = @PYGTK_DEFS@ PYGTK_H2DEF = @PYGTK_H2DEF@ PYGTK_LIBS = @PYGTK_LIBS@ PYTHON = @PYTHON@ PYTHON_CFLAGS = @PYTHON_CFLAGS@ PYTHON_CONFIG = @PYTHON_CONFIG@ PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@ PYTHON_LIBS = @PYTHON_LIBS@ PYTHON_PLATFORM = @PYTHON_PLATFORM@ PYTHON_PREFIX = @PYTHON_PREFIX@ PYTHON_VERSION = @PYTHON_VERSION@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ RC = @RC@ RELDATE = @RELDATE@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ STRIP = @STRIP@ VERSION = @VERSION@ XMKMF = @XMKMF@ XMLTO = @XMLTO@ XMLTOFLAGS = @XMLTOFLAGS@ XSHM_LIBS = @XSHM_LIBS@ XV_LIBS = @XV_LIBS@ X_CFLAGS = @X_CFLAGS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_LIBS = @X_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ ZGTK_LIB_VERSION = @ZGTK_LIB_VERSION@ ZQT_LIB_VERSION = @ZQT_LIB_VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ lt_ECHO = @lt_ECHO@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ pkgpyexecdir = @pkgpyexecdir@ pkgpythondir = @pkgpythondir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ pyexecdir = @pyexecdir@ pythondir = @pythondir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -I$(srcdir)/include AM_CFLAGS = -Wall -Wno-parentheses AM_CXXFLAGS = $(AM_CFLAGS) ACLOCAL_AMFLAGS = -I config lib_LTLIBRARIES = zbar/libzbar.la $(am__append_40) $(am__append_49) \ $(am__append_53) pyexec_LTLIBRARIES = $(am__append_38) $(am__append_45) # automake bug in "monolithic mode"? CLEANFILES = $(am__append_30) $(am__append_35) $(am__append_42) \ $(am__append_47) test/.libs/test_decode test/.libs/test_proc \ test/.libs/test_convert test/.libs/test_window \ test/.libs/test_video test/.libs/dbg_scan test/.libs/test_gtk DISTCLEANFILES = $(am__append_51) BUILT_SOURCES = $(am__append_41) $(am__append_46) $(am__append_50) # TBD add manual content #dist_doc_DATA = doc/zbar.pdf doc/zbar.html # distribute all documentation related files to avoid end-user rebuilds EXTRA_DIST = $(am__append_33) $(am__append_39) $(am__append_43) \ $(am__append_48) test/test_pygtk.py test/test_perl.pl \ $(DOCSOURCES) $(man_stamp) doc/api/footer.html doc/style.xsl \ zbar.ico zbar.nsi examples/upcrpc.pl examples/upcrpc.py \ examples/paginate.pl examples/barcode.png \ examples/processor.pl examples/processor.py \ examples/read_one.py examples/read_one.pl \ examples/scan_image.c examples/scan_image.cpp \ examples/scan_image.pl examples/scan_image.py \ examples/scan_image.vcproj perl/MANIFEST perl/README \ perl/Changes perl/COPYING.LIB perl/Makefile.PL perl/typemap \ perl/ZBar.xs perl/ppport.h perl/ZBar.pm \ perl/inc/Devel/CheckLib.pm perl/ZBar/Image.pod \ perl/ZBar/ImageScanner.pod perl/ZBar/Processor.pod \ perl/ZBar/Symbol.pod perl/examples/paginate.pl \ perl/examples/processor.pl perl/examples/read_one.pl \ perl/examples/scan_image.pl perl/t/barcode.png perl/t/ZBar.t \ perl/t/Decoder.t perl/t/Image.t perl/t/Processor.t \ perl/t/Scanner.t perl/t/pod.t perl/t/pod-coverage.t pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = zbar.pc $(am__append_44) $(am__append_52) dist_doc_DATA = COPYING HACKING INSTALL LICENSE NEWS README TODO \ $(am__append_61) zincludedir = $(includedir)/zbar include_HEADERS = include/zbar.h zinclude_HEADERS = include/zbar/Scanner.h include/zbar/Decoder.h \ include/zbar/Exception.h include/zbar/Symbol.h \ include/zbar/Image.h include/zbar/ImageScanner.h \ include/zbar/Video.h include/zbar/Window.h \ include/zbar/Processor.h $(am__append_1) $(am__append_2) zbar_libzbar_la_CPPFLAGS = -I$(srcdir)/zbar $(AM_CPPFLAGS) \ $(am__append_10) $(am__append_21) zbar_libzbar_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION) \ -export-symbols-regex "^(zbar|_zbar.*_error)_.*" $(AM_LDFLAGS) \ $(am__append_11) $(am__append_22) $(AM_LDFLAGS) zbar_libzbar_la_LIBADD = $(LTLIBICONV) $(am__append_12) \ $(am__append_17) $(am__append_23) $(am__append_25) \ $(am__append_27) $(AM_LIBADD) zbar_libzbar_la_SOURCES = zbar/debug.h zbar/config.c zbar/error.h \ zbar/error.c zbar/symbol.h zbar/symbol.c zbar/image.h \ zbar/image.c zbar/convert.c zbar/processor.c zbar/processor.h \ zbar/processor/lock.c zbar/refcnt.h zbar/refcnt.c zbar/timer.h \ zbar/mutex.h zbar/event.h zbar/thread.h zbar/window.h \ zbar/window.c zbar/video.h zbar/video.c zbar/img_scanner.h \ zbar/img_scanner.c zbar/scanner.c zbar/decoder.h \ zbar/decoder.c $(am__append_3) $(am__append_4) $(am__append_5) \ $(am__append_6) $(am__append_7) $(am__append_8) \ $(am__append_9) $(am__append_13) $(am__append_14) \ $(am__append_15) $(am__append_16) $(am__append_18) \ $(am__append_19) $(am__append_20) $(am__append_24) \ $(am__append_26) $(am__append_28) EXTRA_zbar_libzbar_la_SOURCES = zbar/svg.h zbar/svg.c @HAVE_MAGICK_TRUE@zbarimg_zbarimg_SOURCES = zbarimg/zbarimg.c \ @HAVE_MAGICK_TRUE@ $(am__append_31) @HAVE_MAGICK_TRUE@zbarimg_zbarimg_CPPFLAGS = $(MAGICK_CFLAGS) $(AM_CPPFLAGS) @HAVE_MAGICK_TRUE@zbarimg_zbarimg_LDADD = $(MAGICK_LIBS) \ @HAVE_MAGICK_TRUE@ zbar/libzbar.la $(am__append_32) @HAVE_VIDEO_TRUE@zbarcam_zbarcam_SOURCES = zbarcam/zbarcam.c \ @HAVE_VIDEO_TRUE@ $(am__append_36) @HAVE_VIDEO_TRUE@zbarcam_zbarcam_LDADD = zbar/libzbar.la \ @HAVE_VIDEO_TRUE@ $(am__append_37) @HAVE_PYTHON_TRUE@python_zbar_la_CPPFLAGS = $(PYTHON_CFLAGS) $(AM_CPPFLAGS) @HAVE_PYTHON_TRUE@python_zbar_la_LDFLAGS = -shared -module -avoid-version -export-dynamic \ @HAVE_PYTHON_TRUE@ -export-symbols-regex initzbar @HAVE_PYTHON_TRUE@python_zbar_la_LIBADD = $(PYTHON_LIBS) zbar/libzbar.la $(AM_LIBADD) @HAVE_PYTHON_TRUE@python_zbar_la_SOURCES = python/zbarmodule.c python/zbarmodule.h \ @HAVE_PYTHON_TRUE@ python/enum.c python/exception.c python/symbol.c python/symbolset.c \ @HAVE_PYTHON_TRUE@ python/symboliter.c python/image.c \ @HAVE_PYTHON_TRUE@ python/processor.c python/imagescanner.c python/decoder.c python/scanner.c @HAVE_GTK_TRUE@gtk_libzbargtk_la_CPPFLAGS = -Igtk $(GTK_CFLAGS) $(AM_CPPFLAGS) @HAVE_GTK_TRUE@gtk_libzbargtk_la_LDFLAGS = -version-info $(ZGTK_LIB_VERSION) \ @HAVE_GTK_TRUE@ -export-symbols-regex "^zbar_gtk_.*" $(AM_LDFLAGS) @HAVE_GTK_TRUE@gtk_libzbargtk_la_LIBADD = $(GTK_LIBS) zbar/libzbar.la $(AM_LIBADD) @HAVE_GTK_TRUE@dist_gtk_libzbargtk_la_SOURCES = gtk/zbargtk.c gtk/zbargtkprivate.h @HAVE_GTK_TRUE@nodist_gtk_libzbargtk_la_SOURCES = gtk/zbarmarshal.c gtk/zbarmarshal.h @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@pygtk_zbarpygtk_la_CPPFLAGS = \ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ $(GTK_CFLAGS) $(PYTHON_CFLAGS) $(PYGTK_CFLAGS) $(AM_CPPFLAGS) @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@pygtk_zbarpygtk_la_LDFLAGS = -shared -module -avoid-version -export-dynamic \ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ -export-symbols-regex initzbarpygtk @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@pygtk_zbarpygtk_la_LIBADD = \ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ $(PYTHON_LIBS) $(PYGTK_LIBS) gtk/libzbargtk.la $(AM_LIBADD) @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@dist_pygtk_zbarpygtk_la_SOURCES = pygtk/zbarpygtkmodule.c @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@nodist_pygtk_zbarpygtk_la_SOURCES = pygtk/zbarpygtk.c @HAVE_QT_TRUE@qt_libzbarqt_la_CPPFLAGS = -Iqt $(QT_CFLAGS) $(AM_CPPFLAGS) @HAVE_QT_TRUE@qt_libzbarqt_la_LDFLAGS = -version-info $(ZQT_LIB_VERSION) $(AM_LDFLAGS) @HAVE_QT_TRUE@qt_libzbarqt_la_LIBADD = $(QT_LIBS) zbar/libzbar.la $(AM_LIBADD) @HAVE_QT_TRUE@qt_libzbarqt_la_SOURCES = qt/QZBar.cpp qt/QZBarThread.h qt/QZBarThread.cpp @HAVE_QT_TRUE@nodist_qt_libzbarqt_la_SOURCES = qt/moc_QZBar.cpp qt/moc_QZBarThread.cpp @HAVE_NPAPI_TRUE@plugin_libzbarplugin_la_SOURCES = \ @HAVE_NPAPI_TRUE@ plugin/plugin.c @HAVE_NPAPI_TRUE@plugin_libzbarplugin_la_CPPFLAGS = $(MOZILLA_CFLAGS) $(AM_CPPFLAGS) @HAVE_NPAPI_TRUE@plugin_libzbarplugin_la_LDFLAGS = $(MOZILLA_LIBS) $(AM_LDFLAGS) test_test_decode_SOURCES = test/test_decode.c test/pdf417_encode.h test_test_decode_CFLAGS = -Wno-unused $(AM_CFLAGS) test_test_decode_LDADD = zbar/libzbar.la $(AM_LDADD) TEST_IMAGE_SOURCES = test/test_images.c test/test_images.h test_test_convert_SOURCES = test/test_convert.c $(TEST_IMAGE_SOURCES) test_test_convert_LDADD = zbar/libzbar.la $(AM_LDADD) @HAVE_VIDEO_TRUE@test_test_video_SOURCES = test/test_video.c $(TEST_IMAGE_SOURCES) @HAVE_VIDEO_TRUE@test_test_video_LDADD = zbar/libzbar.la $(AM_LDADD) test_test_proc_SOURCES = test/test_proc.c $(TEST_IMAGE_SOURCES) test_test_proc_LDADD = zbar/libzbar.la $(AM_LDADD) test_test_cpp_SOURCES = test/test_cpp.cpp test_test_cpp_LDADD = zbar/libzbar.la $(AM_LDADD) @HAVE_JPEG_TRUE@test_test_jpeg_SOURCES = test/test_jpeg.c @HAVE_JPEG_TRUE@test_test_jpeg_LDADD = zbar/libzbar.la $(AM_LDADD) @HAVE_MAGICK_TRUE@test_dbg_scan_SOURCES = test/dbg_scan.cpp @HAVE_MAGICK_TRUE@test_dbg_scan_CPPFLAGS = $(MAGICK_CFLAGS) $(AM_CPPFLAGS) @HAVE_MAGICK_TRUE@test_dbg_scan_LDADD = $(MAGICK_LIBS) -lMagick++ zbar/libzbar.la $(AM_LDADD) @HAVE_GTK_TRUE@test_test_gtk_SOURCES = test/test_gtk.c test/scan_video.c @HAVE_GTK_TRUE@test_test_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS) @HAVE_GTK_TRUE@test_test_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la $(AM_LDADD) @HAVE_QT_TRUE@test_test_qt_SOURCES = test/test_qt.cpp test/scan_video.c @HAVE_QT_TRUE@nodist_test_test_qt_SOURCES = test/moc_test_qt.h @HAVE_QT_TRUE@test_test_qt_CPPFLAGS = -Itest $(QT_CFLAGS) $(AM_CPPFLAGS) @HAVE_QT_TRUE@test_test_qt_LDADD = $(QT_LIBS) qt/libzbarqt.la $(AM_LDADD) # documentation sources DOCSOURCES = doc/manual.xml doc/version.xml doc/reldate.xml \ doc/ref/zbarimg.xml doc/ref/zbarcam.xml doc/ref/commonoptions.xml # man page targets to distribute and install dist_man_MANS = $(am__append_59) $(am__append_60) # witness to man page build (many-to-many workaround) man_stamp = doc/man/man.stamp # xmlto --searchpath broken again... doc_path = --searchpath $(abs_builddir)/doc -m \ $(abs_srcdir)/doc/style.xsl --skip-validation @WIN32_TRUE@pkgdata_DATA = $(srcdir)/examples/barcode.png \ @WIN32_TRUE@ $(srcdir)/examples/scan_image.cpp $(srcdir)/examples/scan_image.vcproj all: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) all-am .SUFFIXES: .SUFFIXES: .c .cpp .lo .o .obj am--refresh: @: $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(srcdir)/include/Makefile.am.inc $(srcdir)/zbar/Makefile.am.inc $(srcdir)/zbarimg/Makefile.am.inc $(srcdir)/zbarcam/Makefile.am.inc $(srcdir)/python/Makefile.am.inc $(srcdir)/gtk/Makefile.am.inc $(srcdir)/pygtk/Makefile.am.inc $(srcdir)/qt/Makefile.am.inc $(srcdir)/plugin/Makefile.am.inc $(srcdir)/test/Makefile.am.inc $(srcdir)/doc/Makefile.am.inc $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \ cd $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ cd $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: $(am__configure_deps) cd $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): $(am__aclocal_m4_deps) cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) include/config.h: include/stamp-h1 @if test ! -f $@; then \ rm -f include/stamp-h1; \ $(MAKE) $(AM_MAKEFLAGS) include/stamp-h1; \ else :; fi include/stamp-h1: $(top_srcdir)/include/config.h.in $(top_builddir)/config.status @rm -f include/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status include/config.h $(top_srcdir)/include/config.h.in: $(am__configure_deps) cd $(top_srcdir) && $(AUTOHEADER) rm -f include/stamp-h1 touch $@ distclean-hdr: -rm -f include/config.h include/stamp-h1 zbar.pc: $(top_builddir)/config.status $(srcdir)/zbar.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ zbar-gtk.pc: $(top_builddir)/config.status $(srcdir)/zbar-gtk.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ zbar-qt.pc: $(top_builddir)/config.status $(srcdir)/zbar-qt.pc.in cd $(top_builddir) && $(SHELL) ./config.status $@ doc/doxygen.conf: $(top_builddir)/config.status $(top_srcdir)/doc/doxygen.conf.in cd $(top_builddir) && $(SHELL) ./config.status $@ install-libLTLIBRARIES: $(lib_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(libdir)" || $(MKDIR_P) "$(DESTDIR)$(libdir)" @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(libdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(libLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(libdir)/$$f"; \ else :; fi; \ done uninstall-libLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$p"; \ done clean-libLTLIBRARIES: -test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES) @list='$(lib_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done install-pyexecLTLIBRARIES: $(pyexec_LTLIBRARIES) @$(NORMAL_INSTALL) test -z "$(pyexecdir)" || $(MKDIR_P) "$(DESTDIR)$(pyexecdir)" @list='$(pyexec_LTLIBRARIES)'; for p in $$list; do \ if test -f $$p; then \ f=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pyexecLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pyexecdir)/$$f'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(pyexecLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pyexecdir)/$$f"; \ else :; fi; \ done uninstall-pyexecLTLIBRARIES: @$(NORMAL_UNINSTALL) @list='$(pyexec_LTLIBRARIES)'; for p in $$list; do \ p=$(am__strip_dir) \ echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(pyexecdir)/$$p'"; \ $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(pyexecdir)/$$p"; \ done clean-pyexecLTLIBRARIES: -test -z "$(pyexec_LTLIBRARIES)" || rm -f $(pyexec_LTLIBRARIES) @list='$(pyexec_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done gtk/$(am__dirstamp): @$(MKDIR_P) gtk @: > gtk/$(am__dirstamp) gtk/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) gtk/$(DEPDIR) @: > gtk/$(DEPDIR)/$(am__dirstamp) gtk/gtk_libzbargtk_la-zbargtk.lo: gtk/$(am__dirstamp) \ gtk/$(DEPDIR)/$(am__dirstamp) gtk/gtk_libzbargtk_la-zbarmarshal.lo: gtk/$(am__dirstamp) \ gtk/$(DEPDIR)/$(am__dirstamp) gtk/libzbargtk.la: $(gtk_libzbargtk_la_OBJECTS) $(gtk_libzbargtk_la_DEPENDENCIES) gtk/$(am__dirstamp) $(gtk_libzbargtk_la_LINK) $(am_gtk_libzbargtk_la_rpath) $(gtk_libzbargtk_la_OBJECTS) $(gtk_libzbargtk_la_LIBADD) $(LIBS) plugin/$(am__dirstamp): @$(MKDIR_P) plugin @: > plugin/$(am__dirstamp) plugin/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) plugin/$(DEPDIR) @: > plugin/$(DEPDIR)/$(am__dirstamp) plugin/plugin_libzbarplugin_la-plugin.lo: plugin/$(am__dirstamp) \ plugin/$(DEPDIR)/$(am__dirstamp) plugin/libzbarplugin.la: $(plugin_libzbarplugin_la_OBJECTS) $(plugin_libzbarplugin_la_DEPENDENCIES) plugin/$(am__dirstamp) $(plugin_libzbarplugin_la_LINK) $(am_plugin_libzbarplugin_la_rpath) $(plugin_libzbarplugin_la_OBJECTS) $(plugin_libzbarplugin_la_LIBADD) $(LIBS) pygtk/$(am__dirstamp): @$(MKDIR_P) pygtk @: > pygtk/$(am__dirstamp) pygtk/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) pygtk/$(DEPDIR) @: > pygtk/$(DEPDIR)/$(am__dirstamp) pygtk/pygtk_zbarpygtk_la-zbarpygtkmodule.lo: pygtk/$(am__dirstamp) \ pygtk/$(DEPDIR)/$(am__dirstamp) pygtk/pygtk_zbarpygtk_la-zbarpygtk.lo: pygtk/$(am__dirstamp) \ pygtk/$(DEPDIR)/$(am__dirstamp) pygtk/zbarpygtk.la: $(pygtk_zbarpygtk_la_OBJECTS) $(pygtk_zbarpygtk_la_DEPENDENCIES) pygtk/$(am__dirstamp) $(pygtk_zbarpygtk_la_LINK) $(am_pygtk_zbarpygtk_la_rpath) $(pygtk_zbarpygtk_la_OBJECTS) $(pygtk_zbarpygtk_la_LIBADD) $(LIBS) python/$(am__dirstamp): @$(MKDIR_P) python @: > python/$(am__dirstamp) python/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) python/$(DEPDIR) @: > python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-zbarmodule.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-enum.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-exception.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-symbol.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-symbolset.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-symboliter.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-image.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-processor.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-imagescanner.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-decoder.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/python_zbar_la-scanner.lo: python/$(am__dirstamp) \ python/$(DEPDIR)/$(am__dirstamp) python/zbar.la: $(python_zbar_la_OBJECTS) $(python_zbar_la_DEPENDENCIES) python/$(am__dirstamp) $(python_zbar_la_LINK) $(am_python_zbar_la_rpath) $(python_zbar_la_OBJECTS) $(python_zbar_la_LIBADD) $(LIBS) qt/$(am__dirstamp): @$(MKDIR_P) qt @: > qt/$(am__dirstamp) qt/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) qt/$(DEPDIR) @: > qt/$(DEPDIR)/$(am__dirstamp) qt/qt_libzbarqt_la-QZBar.lo: qt/$(am__dirstamp) \ qt/$(DEPDIR)/$(am__dirstamp) qt/qt_libzbarqt_la-QZBarThread.lo: qt/$(am__dirstamp) \ qt/$(DEPDIR)/$(am__dirstamp) qt/qt_libzbarqt_la-moc_QZBar.lo: qt/$(am__dirstamp) \ qt/$(DEPDIR)/$(am__dirstamp) qt/qt_libzbarqt_la-moc_QZBarThread.lo: qt/$(am__dirstamp) \ qt/$(DEPDIR)/$(am__dirstamp) qt/libzbarqt.la: $(qt_libzbarqt_la_OBJECTS) $(qt_libzbarqt_la_DEPENDENCIES) qt/$(am__dirstamp) $(qt_libzbarqt_la_LINK) $(am_qt_libzbarqt_la_rpath) $(qt_libzbarqt_la_OBJECTS) $(qt_libzbarqt_la_LIBADD) $(LIBS) zbar/$(am__dirstamp): @$(MKDIR_P) zbar @: > zbar/$(am__dirstamp) zbar/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) zbar/$(DEPDIR) @: > zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-config.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-error.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-symbol.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-image.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-convert.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-processor.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/processor/$(am__dirstamp): @$(MKDIR_P) zbar/processor @: > zbar/processor/$(am__dirstamp) zbar/processor/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) zbar/processor/$(DEPDIR) @: > zbar/processor/$(DEPDIR)/$(am__dirstamp) zbar/processor/zbar_libzbar_la-lock.lo: \ zbar/processor/$(am__dirstamp) \ zbar/processor/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-refcnt.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-window.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-video.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-img_scanner.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-scanner.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-decoder.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/decoder/$(am__dirstamp): @$(MKDIR_P) zbar/decoder @: > zbar/decoder/$(am__dirstamp) zbar/decoder/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) zbar/decoder/$(DEPDIR) @: > zbar/decoder/$(DEPDIR)/$(am__dirstamp) zbar/decoder/zbar_libzbar_la-ean.lo: zbar/decoder/$(am__dirstamp) \ zbar/decoder/$(DEPDIR)/$(am__dirstamp) zbar/decoder/zbar_libzbar_la-code128.lo: zbar/decoder/$(am__dirstamp) \ zbar/decoder/$(DEPDIR)/$(am__dirstamp) zbar/decoder/zbar_libzbar_la-code39.lo: zbar/decoder/$(am__dirstamp) \ zbar/decoder/$(DEPDIR)/$(am__dirstamp) zbar/decoder/zbar_libzbar_la-i25.lo: zbar/decoder/$(am__dirstamp) \ zbar/decoder/$(DEPDIR)/$(am__dirstamp) zbar/decoder/zbar_libzbar_la-pdf417.lo: zbar/decoder/$(am__dirstamp) \ zbar/decoder/$(DEPDIR)/$(am__dirstamp) zbar/decoder/zbar_libzbar_la-qr_finder.lo: \ zbar/decoder/$(am__dirstamp) \ zbar/decoder/$(DEPDIR)/$(am__dirstamp) zbar/qrcode/$(am__dirstamp): @$(MKDIR_P) zbar/qrcode @: > zbar/qrcode/$(am__dirstamp) zbar/qrcode/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) zbar/qrcode/$(DEPDIR) @: > zbar/qrcode/$(DEPDIR)/$(am__dirstamp) zbar/qrcode/zbar_libzbar_la-qrdec.lo: zbar/qrcode/$(am__dirstamp) \ zbar/qrcode/$(DEPDIR)/$(am__dirstamp) zbar/qrcode/zbar_libzbar_la-qrdectxt.lo: zbar/qrcode/$(am__dirstamp) \ zbar/qrcode/$(DEPDIR)/$(am__dirstamp) zbar/qrcode/zbar_libzbar_la-rs.lo: zbar/qrcode/$(am__dirstamp) \ zbar/qrcode/$(DEPDIR)/$(am__dirstamp) zbar/qrcode/zbar_libzbar_la-isaac.lo: zbar/qrcode/$(am__dirstamp) \ zbar/qrcode/$(DEPDIR)/$(am__dirstamp) zbar/qrcode/zbar_libzbar_la-bch15_5.lo: zbar/qrcode/$(am__dirstamp) \ zbar/qrcode/$(DEPDIR)/$(am__dirstamp) zbar/qrcode/zbar_libzbar_la-binarize.lo: zbar/qrcode/$(am__dirstamp) \ zbar/qrcode/$(DEPDIR)/$(am__dirstamp) zbar/qrcode/zbar_libzbar_la-util.lo: zbar/qrcode/$(am__dirstamp) \ zbar/qrcode/$(DEPDIR)/$(am__dirstamp) zbar/processor/zbar_libzbar_la-win.lo: zbar/processor/$(am__dirstamp) \ zbar/processor/$(DEPDIR)/$(am__dirstamp) zbar/processor/zbar_libzbar_la-posix.lo: \ zbar/processor/$(am__dirstamp) \ zbar/processor/$(DEPDIR)/$(am__dirstamp) zbar/video/$(am__dirstamp): @$(MKDIR_P) zbar/video @: > zbar/video/$(am__dirstamp) zbar/video/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) zbar/video/$(DEPDIR) @: > zbar/video/$(DEPDIR)/$(am__dirstamp) zbar/video/zbar_libzbar_la-v4l1.lo: zbar/video/$(am__dirstamp) \ zbar/video/$(DEPDIR)/$(am__dirstamp) zbar/video/zbar_libzbar_la-v4l2.lo: zbar/video/$(am__dirstamp) \ zbar/video/$(DEPDIR)/$(am__dirstamp) zbar/video/zbar_libzbar_la-vfw.lo: zbar/video/$(am__dirstamp) \ zbar/video/$(DEPDIR)/$(am__dirstamp) zbar/video/zbar_libzbar_la-null.lo: zbar/video/$(am__dirstamp) \ zbar/video/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-jpeg.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/processor/zbar_libzbar_la-x.lo: zbar/processor/$(am__dirstamp) \ zbar/processor/$(DEPDIR)/$(am__dirstamp) zbar/window/$(am__dirstamp): @$(MKDIR_P) zbar/window @: > zbar/window/$(am__dirstamp) zbar/window/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) zbar/window/$(DEPDIR) @: > zbar/window/$(DEPDIR)/$(am__dirstamp) zbar/window/zbar_libzbar_la-x.lo: zbar/window/$(am__dirstamp) \ zbar/window/$(DEPDIR)/$(am__dirstamp) zbar/window/zbar_libzbar_la-ximage.lo: zbar/window/$(am__dirstamp) \ zbar/window/$(DEPDIR)/$(am__dirstamp) zbar/window/zbar_libzbar_la-xv.lo: zbar/window/$(am__dirstamp) \ zbar/window/$(DEPDIR)/$(am__dirstamp) zbar/window/zbar_libzbar_la-win.lo: zbar/window/$(am__dirstamp) \ zbar/window/$(DEPDIR)/$(am__dirstamp) zbar/window/zbar_libzbar_la-dib.lo: zbar/window/$(am__dirstamp) \ zbar/window/$(DEPDIR)/$(am__dirstamp) zbar/processor/zbar_libzbar_la-null.lo: \ zbar/processor/$(am__dirstamp) \ zbar/processor/$(DEPDIR)/$(am__dirstamp) zbar/window/zbar_libzbar_la-null.lo: zbar/window/$(am__dirstamp) \ zbar/window/$(DEPDIR)/$(am__dirstamp) zbar/zbar_libzbar_la-svg.lo: zbar/$(am__dirstamp) \ zbar/$(DEPDIR)/$(am__dirstamp) zbar/libzbar.la: $(zbar_libzbar_la_OBJECTS) $(zbar_libzbar_la_DEPENDENCIES) zbar/$(am__dirstamp) $(zbar_libzbar_la_LINK) -rpath $(libdir) $(zbar_libzbar_la_OBJECTS) $(zbar_libzbar_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)" @list='$(bin_PROGRAMS)'; for p in $$list; do \ p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ if test -f $$p \ || test -f $$p1 \ ; then \ f=`echo "$$p1" | sed 's,^.*/,,;$(transform);s/$$/$(EXEEXT)/'`; \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) '$$p' '$(DESTDIR)$(bindir)/$$f'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(binPROGRAMS_INSTALL) "$$p" "$(DESTDIR)$(bindir)/$$f" || exit 1; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo "$$p" | sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ echo " rm -f '$(DESTDIR)$(bindir)/$$f'"; \ rm -f "$(DESTDIR)$(bindir)/$$f"; \ done clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done installcheck-binPROGRAMS: $(bin_PROGRAMS) bad=0; pid=$$$$; list="$(bin_PROGRAMS)"; for p in $$list; do \ case ' $(AM_INSTALLCHECK_STD_OPTIONS_EXEMPT) ' in \ *" $$p "* | *" $(srcdir)/$$p "*) continue;; \ esac; \ f=`echo "$$p" | \ sed 's,^.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ for opt in --help --version; do \ if "$(DESTDIR)$(bindir)/$$f" $$opt >c$${pid}_.out \ 2>c$${pid}_.err &2; bad=1; fi; \ done; \ done; rm -f c$${pid}_.???; exit $$bad clean-checkPROGRAMS: @list='$(check_PROGRAMS)'; for p in $$list; do \ f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ echo " rm -f $$p $$f"; \ rm -f $$p $$f ; \ done test/$(am__dirstamp): @$(MKDIR_P) test @: > test/$(am__dirstamp) test/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) test/$(DEPDIR) @: > test/$(DEPDIR)/$(am__dirstamp) test/test_dbg_scan-dbg_scan.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/dbg_scan$(EXEEXT): $(test_dbg_scan_OBJECTS) $(test_dbg_scan_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/dbg_scan$(EXEEXT) $(CXXLINK) $(test_dbg_scan_OBJECTS) $(test_dbg_scan_LDADD) $(LIBS) test/test_convert.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_images.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_convert$(EXEEXT): $(test_test_convert_OBJECTS) $(test_test_convert_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/test_convert$(EXEEXT) $(LINK) $(test_test_convert_OBJECTS) $(test_test_convert_LDADD) $(LIBS) test/test_cpp.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_cpp$(EXEEXT): $(test_test_cpp_OBJECTS) $(test_test_cpp_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/test_cpp$(EXEEXT) $(CXXLINK) $(test_test_cpp_OBJECTS) $(test_test_cpp_LDADD) $(LIBS) test/test_test_decode-test_decode.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_decode$(EXEEXT): $(test_test_decode_OBJECTS) $(test_test_decode_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/test_decode$(EXEEXT) $(test_test_decode_LINK) $(test_test_decode_OBJECTS) $(test_test_decode_LDADD) $(LIBS) test/test_test_gtk-test_gtk.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_test_gtk-scan_video.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_gtk$(EXEEXT): $(test_test_gtk_OBJECTS) $(test_test_gtk_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/test_gtk$(EXEEXT) $(LINK) $(test_test_gtk_OBJECTS) $(test_test_gtk_LDADD) $(LIBS) test/test_jpeg.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_jpeg$(EXEEXT): $(test_test_jpeg_OBJECTS) $(test_test_jpeg_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/test_jpeg$(EXEEXT) $(LINK) $(test_test_jpeg_OBJECTS) $(test_test_jpeg_LDADD) $(LIBS) test/test_proc.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_proc$(EXEEXT): $(test_test_proc_OBJECTS) $(test_test_proc_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/test_proc$(EXEEXT) $(LINK) $(test_test_proc_OBJECTS) $(test_test_proc_LDADD) $(LIBS) test/test_test_qt-test_qt.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_test_qt-scan_video.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_qt$(EXEEXT): $(test_test_qt_OBJECTS) $(test_test_qt_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/test_qt$(EXEEXT) $(CXXLINK) $(test_test_qt_OBJECTS) $(test_test_qt_LDADD) $(LIBS) test/test_video.$(OBJEXT): test/$(am__dirstamp) \ test/$(DEPDIR)/$(am__dirstamp) test/test_video$(EXEEXT): $(test_test_video_OBJECTS) $(test_test_video_DEPENDENCIES) test/$(am__dirstamp) @rm -f test/test_video$(EXEEXT) $(LINK) $(test_test_video_OBJECTS) $(test_test_video_LDADD) $(LIBS) zbarcam/$(am__dirstamp): @$(MKDIR_P) zbarcam @: > zbarcam/$(am__dirstamp) zbarcam/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) zbarcam/$(DEPDIR) @: > zbarcam/$(DEPDIR)/$(am__dirstamp) zbarcam/zbarcam.$(OBJEXT): zbarcam/$(am__dirstamp) \ zbarcam/$(DEPDIR)/$(am__dirstamp) zbarcam/zbarcam$(EXEEXT): $(zbarcam_zbarcam_OBJECTS) $(zbarcam_zbarcam_DEPENDENCIES) zbarcam/$(am__dirstamp) @rm -f zbarcam/zbarcam$(EXEEXT) $(LINK) $(zbarcam_zbarcam_OBJECTS) $(zbarcam_zbarcam_LDADD) $(LIBS) zbarimg/$(am__dirstamp): @$(MKDIR_P) zbarimg @: > zbarimg/$(am__dirstamp) zbarimg/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) zbarimg/$(DEPDIR) @: > zbarimg/$(DEPDIR)/$(am__dirstamp) zbarimg/zbarimg_zbarimg-zbarimg.$(OBJEXT): zbarimg/$(am__dirstamp) \ zbarimg/$(DEPDIR)/$(am__dirstamp) zbarimg/zbarimg$(EXEEXT): $(zbarimg_zbarimg_OBJECTS) $(zbarimg_zbarimg_DEPENDENCIES) zbarimg/$(am__dirstamp) @rm -f zbarimg/zbarimg$(EXEEXT) $(LINK) $(zbarimg_zbarimg_OBJECTS) $(zbarimg_zbarimg_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f gtk/gtk_libzbargtk_la-zbargtk.$(OBJEXT) -rm -f gtk/gtk_libzbargtk_la-zbargtk.lo -rm -f gtk/gtk_libzbargtk_la-zbarmarshal.$(OBJEXT) -rm -f gtk/gtk_libzbargtk_la-zbarmarshal.lo -rm -f plugin/plugin_libzbarplugin_la-plugin.$(OBJEXT) -rm -f plugin/plugin_libzbarplugin_la-plugin.lo -rm -f pygtk/pygtk_zbarpygtk_la-zbarpygtk.$(OBJEXT) -rm -f pygtk/pygtk_zbarpygtk_la-zbarpygtk.lo -rm -f pygtk/pygtk_zbarpygtk_la-zbarpygtkmodule.$(OBJEXT) -rm -f pygtk/pygtk_zbarpygtk_la-zbarpygtkmodule.lo -rm -f python/python_zbar_la-decoder.$(OBJEXT) -rm -f python/python_zbar_la-decoder.lo -rm -f python/python_zbar_la-enum.$(OBJEXT) -rm -f python/python_zbar_la-enum.lo -rm -f python/python_zbar_la-exception.$(OBJEXT) -rm -f python/python_zbar_la-exception.lo -rm -f python/python_zbar_la-image.$(OBJEXT) -rm -f python/python_zbar_la-image.lo -rm -f python/python_zbar_la-imagescanner.$(OBJEXT) -rm -f python/python_zbar_la-imagescanner.lo -rm -f python/python_zbar_la-processor.$(OBJEXT) -rm -f python/python_zbar_la-processor.lo -rm -f python/python_zbar_la-scanner.$(OBJEXT) -rm -f python/python_zbar_la-scanner.lo -rm -f python/python_zbar_la-symbol.$(OBJEXT) -rm -f python/python_zbar_la-symbol.lo -rm -f python/python_zbar_la-symboliter.$(OBJEXT) -rm -f python/python_zbar_la-symboliter.lo -rm -f python/python_zbar_la-symbolset.$(OBJEXT) -rm -f python/python_zbar_la-symbolset.lo -rm -f python/python_zbar_la-zbarmodule.$(OBJEXT) -rm -f python/python_zbar_la-zbarmodule.lo -rm -f qt/qt_libzbarqt_la-QZBar.$(OBJEXT) -rm -f qt/qt_libzbarqt_la-QZBar.lo -rm -f qt/qt_libzbarqt_la-QZBarThread.$(OBJEXT) -rm -f qt/qt_libzbarqt_la-QZBarThread.lo -rm -f qt/qt_libzbarqt_la-moc_QZBar.$(OBJEXT) -rm -f qt/qt_libzbarqt_la-moc_QZBar.lo -rm -f qt/qt_libzbarqt_la-moc_QZBarThread.$(OBJEXT) -rm -f qt/qt_libzbarqt_la-moc_QZBarThread.lo -rm -f test/test_convert.$(OBJEXT) -rm -f test/test_cpp.$(OBJEXT) -rm -f test/test_dbg_scan-dbg_scan.$(OBJEXT) -rm -f test/test_images.$(OBJEXT) -rm -f test/test_jpeg.$(OBJEXT) -rm -f test/test_proc.$(OBJEXT) -rm -f test/test_test_decode-test_decode.$(OBJEXT) -rm -f test/test_test_gtk-scan_video.$(OBJEXT) -rm -f test/test_test_gtk-test_gtk.$(OBJEXT) -rm -f test/test_test_qt-scan_video.$(OBJEXT) -rm -f test/test_test_qt-test_qt.$(OBJEXT) -rm -f test/test_video.$(OBJEXT) -rm -f zbar/decoder/zbar_libzbar_la-code128.$(OBJEXT) -rm -f zbar/decoder/zbar_libzbar_la-code128.lo -rm -f zbar/decoder/zbar_libzbar_la-code39.$(OBJEXT) -rm -f zbar/decoder/zbar_libzbar_la-code39.lo -rm -f zbar/decoder/zbar_libzbar_la-ean.$(OBJEXT) -rm -f zbar/decoder/zbar_libzbar_la-ean.lo -rm -f zbar/decoder/zbar_libzbar_la-i25.$(OBJEXT) -rm -f zbar/decoder/zbar_libzbar_la-i25.lo -rm -f zbar/decoder/zbar_libzbar_la-pdf417.$(OBJEXT) -rm -f zbar/decoder/zbar_libzbar_la-pdf417.lo -rm -f zbar/decoder/zbar_libzbar_la-qr_finder.$(OBJEXT) -rm -f zbar/decoder/zbar_libzbar_la-qr_finder.lo -rm -f zbar/processor/zbar_libzbar_la-lock.$(OBJEXT) -rm -f zbar/processor/zbar_libzbar_la-lock.lo -rm -f zbar/processor/zbar_libzbar_la-null.$(OBJEXT) -rm -f zbar/processor/zbar_libzbar_la-null.lo -rm -f zbar/processor/zbar_libzbar_la-posix.$(OBJEXT) -rm -f zbar/processor/zbar_libzbar_la-posix.lo -rm -f zbar/processor/zbar_libzbar_la-win.$(OBJEXT) -rm -f zbar/processor/zbar_libzbar_la-win.lo -rm -f zbar/processor/zbar_libzbar_la-x.$(OBJEXT) -rm -f zbar/processor/zbar_libzbar_la-x.lo -rm -f zbar/qrcode/zbar_libzbar_la-bch15_5.$(OBJEXT) -rm -f zbar/qrcode/zbar_libzbar_la-bch15_5.lo -rm -f zbar/qrcode/zbar_libzbar_la-binarize.$(OBJEXT) -rm -f zbar/qrcode/zbar_libzbar_la-binarize.lo -rm -f zbar/qrcode/zbar_libzbar_la-isaac.$(OBJEXT) -rm -f zbar/qrcode/zbar_libzbar_la-isaac.lo -rm -f zbar/qrcode/zbar_libzbar_la-qrdec.$(OBJEXT) -rm -f zbar/qrcode/zbar_libzbar_la-qrdec.lo -rm -f zbar/qrcode/zbar_libzbar_la-qrdectxt.$(OBJEXT) -rm -f zbar/qrcode/zbar_libzbar_la-qrdectxt.lo -rm -f zbar/qrcode/zbar_libzbar_la-rs.$(OBJEXT) -rm -f zbar/qrcode/zbar_libzbar_la-rs.lo -rm -f zbar/qrcode/zbar_libzbar_la-util.$(OBJEXT) -rm -f zbar/qrcode/zbar_libzbar_la-util.lo -rm -f zbar/video/zbar_libzbar_la-null.$(OBJEXT) -rm -f zbar/video/zbar_libzbar_la-null.lo -rm -f zbar/video/zbar_libzbar_la-v4l1.$(OBJEXT) -rm -f zbar/video/zbar_libzbar_la-v4l1.lo -rm -f zbar/video/zbar_libzbar_la-v4l2.$(OBJEXT) -rm -f zbar/video/zbar_libzbar_la-v4l2.lo -rm -f zbar/video/zbar_libzbar_la-vfw.$(OBJEXT) -rm -f zbar/video/zbar_libzbar_la-vfw.lo -rm -f zbar/window/zbar_libzbar_la-dib.$(OBJEXT) -rm -f zbar/window/zbar_libzbar_la-dib.lo -rm -f zbar/window/zbar_libzbar_la-null.$(OBJEXT) -rm -f zbar/window/zbar_libzbar_la-null.lo -rm -f zbar/window/zbar_libzbar_la-win.$(OBJEXT) -rm -f zbar/window/zbar_libzbar_la-win.lo -rm -f zbar/window/zbar_libzbar_la-x.$(OBJEXT) -rm -f zbar/window/zbar_libzbar_la-x.lo -rm -f zbar/window/zbar_libzbar_la-ximage.$(OBJEXT) -rm -f zbar/window/zbar_libzbar_la-ximage.lo -rm -f zbar/window/zbar_libzbar_la-xv.$(OBJEXT) -rm -f zbar/window/zbar_libzbar_la-xv.lo -rm -f zbar/zbar_libzbar_la-config.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-config.lo -rm -f zbar/zbar_libzbar_la-convert.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-convert.lo -rm -f zbar/zbar_libzbar_la-decoder.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-decoder.lo -rm -f zbar/zbar_libzbar_la-error.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-error.lo -rm -f zbar/zbar_libzbar_la-image.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-image.lo -rm -f zbar/zbar_libzbar_la-img_scanner.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-img_scanner.lo -rm -f zbar/zbar_libzbar_la-jpeg.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-jpeg.lo -rm -f zbar/zbar_libzbar_la-processor.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-processor.lo -rm -f zbar/zbar_libzbar_la-refcnt.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-refcnt.lo -rm -f zbar/zbar_libzbar_la-scanner.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-scanner.lo -rm -f zbar/zbar_libzbar_la-svg.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-svg.lo -rm -f zbar/zbar_libzbar_la-symbol.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-symbol.lo -rm -f zbar/zbar_libzbar_la-video.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-video.lo -rm -f zbar/zbar_libzbar_la-window.$(OBJEXT) -rm -f zbar/zbar_libzbar_la-window.lo -rm -f zbarcam/zbarcam.$(OBJEXT) -rm -f zbarimg/zbarimg_zbarimg-zbarimg.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@gtk/$(DEPDIR)/gtk_libzbargtk_la-zbargtk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@gtk/$(DEPDIR)/gtk_libzbargtk_la-zbarmarshal.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@plugin/$(DEPDIR)/plugin_libzbarplugin_la-plugin.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@pygtk/$(DEPDIR)/pygtk_zbarpygtk_la-zbarpygtk.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@pygtk/$(DEPDIR)/pygtk_zbarpygtk_la-zbarpygtkmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-decoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-enum.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-exception.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-imagescanner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-processor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-scanner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-symbol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-symboliter.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-symbolset.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@python/$(DEPDIR)/python_zbar_la-zbarmodule.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@qt/$(DEPDIR)/qt_libzbarqt_la-QZBar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@qt/$(DEPDIR)/qt_libzbarqt_la-QZBarThread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@qt/$(DEPDIR)/qt_libzbarqt_la-moc_QZBar.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@qt/$(DEPDIR)/qt_libzbarqt_la-moc_QZBarThread.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_convert.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_cpp.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_dbg_scan-dbg_scan.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_images.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_jpeg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_proc.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_test_decode-test_decode.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_test_gtk-scan_video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_test_gtk-test_gtk.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_test_qt-scan_video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_test_qt-test_qt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@test/$(DEPDIR)/test_video.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-config.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-convert.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-decoder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-error.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-image.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-img_scanner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-jpeg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-processor.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-refcnt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-scanner.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-svg.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-symbol.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-video.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/$(DEPDIR)/zbar_libzbar_la-window.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/decoder/$(DEPDIR)/zbar_libzbar_la-code128.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/decoder/$(DEPDIR)/zbar_libzbar_la-code39.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/decoder/$(DEPDIR)/zbar_libzbar_la-ean.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/decoder/$(DEPDIR)/zbar_libzbar_la-i25.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/decoder/$(DEPDIR)/zbar_libzbar_la-pdf417.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/decoder/$(DEPDIR)/zbar_libzbar_la-qr_finder.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/processor/$(DEPDIR)/zbar_libzbar_la-lock.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/processor/$(DEPDIR)/zbar_libzbar_la-null.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/processor/$(DEPDIR)/zbar_libzbar_la-posix.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/processor/$(DEPDIR)/zbar_libzbar_la-win.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/processor/$(DEPDIR)/zbar_libzbar_la-x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-bch15_5.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-binarize.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-isaac.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-qrdec.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-qrdectxt.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-rs.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-util.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/video/$(DEPDIR)/zbar_libzbar_la-null.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/video/$(DEPDIR)/zbar_libzbar_la-v4l1.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/video/$(DEPDIR)/zbar_libzbar_la-v4l2.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/video/$(DEPDIR)/zbar_libzbar_la-vfw.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/window/$(DEPDIR)/zbar_libzbar_la-dib.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/window/$(DEPDIR)/zbar_libzbar_la-null.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/window/$(DEPDIR)/zbar_libzbar_la-win.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/window/$(DEPDIR)/zbar_libzbar_la-x.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/window/$(DEPDIR)/zbar_libzbar_la-ximage.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbar/window/$(DEPDIR)/zbar_libzbar_la-xv.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbarcam/$(DEPDIR)/zbarcam.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@zbarimg/$(DEPDIR)/zbarimg_zbarimg-zbarimg.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ mv -f $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ mv -f $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ mv -f $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $< gtk/gtk_libzbargtk_la-zbargtk.lo: gtk/zbargtk.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gtk_libzbargtk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtk/gtk_libzbargtk_la-zbargtk.lo -MD -MP -MF gtk/$(DEPDIR)/gtk_libzbargtk_la-zbargtk.Tpo -c -o gtk/gtk_libzbargtk_la-zbargtk.lo `test -f 'gtk/zbargtk.c' || echo '$(srcdir)/'`gtk/zbargtk.c @am__fastdepCC_TRUE@ mv -f gtk/$(DEPDIR)/gtk_libzbargtk_la-zbargtk.Tpo gtk/$(DEPDIR)/gtk_libzbargtk_la-zbargtk.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtk/zbargtk.c' object='gtk/gtk_libzbargtk_la-zbargtk.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gtk_libzbargtk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gtk/gtk_libzbargtk_la-zbargtk.lo `test -f 'gtk/zbargtk.c' || echo '$(srcdir)/'`gtk/zbargtk.c gtk/gtk_libzbargtk_la-zbarmarshal.lo: gtk/zbarmarshal.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gtk_libzbargtk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT gtk/gtk_libzbargtk_la-zbarmarshal.lo -MD -MP -MF gtk/$(DEPDIR)/gtk_libzbargtk_la-zbarmarshal.Tpo -c -o gtk/gtk_libzbargtk_la-zbarmarshal.lo `test -f 'gtk/zbarmarshal.c' || echo '$(srcdir)/'`gtk/zbarmarshal.c @am__fastdepCC_TRUE@ mv -f gtk/$(DEPDIR)/gtk_libzbargtk_la-zbarmarshal.Tpo gtk/$(DEPDIR)/gtk_libzbargtk_la-zbarmarshal.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='gtk/zbarmarshal.c' object='gtk/gtk_libzbargtk_la-zbarmarshal.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(gtk_libzbargtk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o gtk/gtk_libzbargtk_la-zbarmarshal.lo `test -f 'gtk/zbarmarshal.c' || echo '$(srcdir)/'`gtk/zbarmarshal.c plugin/plugin_libzbarplugin_la-plugin.lo: plugin/plugin.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(plugin_libzbarplugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT plugin/plugin_libzbarplugin_la-plugin.lo -MD -MP -MF plugin/$(DEPDIR)/plugin_libzbarplugin_la-plugin.Tpo -c -o plugin/plugin_libzbarplugin_la-plugin.lo `test -f 'plugin/plugin.c' || echo '$(srcdir)/'`plugin/plugin.c @am__fastdepCC_TRUE@ mv -f plugin/$(DEPDIR)/plugin_libzbarplugin_la-plugin.Tpo plugin/$(DEPDIR)/plugin_libzbarplugin_la-plugin.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='plugin/plugin.c' object='plugin/plugin_libzbarplugin_la-plugin.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(plugin_libzbarplugin_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o plugin/plugin_libzbarplugin_la-plugin.lo `test -f 'plugin/plugin.c' || echo '$(srcdir)/'`plugin/plugin.c pygtk/pygtk_zbarpygtk_la-zbarpygtkmodule.lo: pygtk/zbarpygtkmodule.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pygtk_zbarpygtk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pygtk/pygtk_zbarpygtk_la-zbarpygtkmodule.lo -MD -MP -MF pygtk/$(DEPDIR)/pygtk_zbarpygtk_la-zbarpygtkmodule.Tpo -c -o pygtk/pygtk_zbarpygtk_la-zbarpygtkmodule.lo `test -f 'pygtk/zbarpygtkmodule.c' || echo '$(srcdir)/'`pygtk/zbarpygtkmodule.c @am__fastdepCC_TRUE@ mv -f pygtk/$(DEPDIR)/pygtk_zbarpygtk_la-zbarpygtkmodule.Tpo pygtk/$(DEPDIR)/pygtk_zbarpygtk_la-zbarpygtkmodule.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygtk/zbarpygtkmodule.c' object='pygtk/pygtk_zbarpygtk_la-zbarpygtkmodule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pygtk_zbarpygtk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pygtk/pygtk_zbarpygtk_la-zbarpygtkmodule.lo `test -f 'pygtk/zbarpygtkmodule.c' || echo '$(srcdir)/'`pygtk/zbarpygtkmodule.c pygtk/pygtk_zbarpygtk_la-zbarpygtk.lo: pygtk/zbarpygtk.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pygtk_zbarpygtk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT pygtk/pygtk_zbarpygtk_la-zbarpygtk.lo -MD -MP -MF pygtk/$(DEPDIR)/pygtk_zbarpygtk_la-zbarpygtk.Tpo -c -o pygtk/pygtk_zbarpygtk_la-zbarpygtk.lo `test -f 'pygtk/zbarpygtk.c' || echo '$(srcdir)/'`pygtk/zbarpygtk.c @am__fastdepCC_TRUE@ mv -f pygtk/$(DEPDIR)/pygtk_zbarpygtk_la-zbarpygtk.Tpo pygtk/$(DEPDIR)/pygtk_zbarpygtk_la-zbarpygtk.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='pygtk/zbarpygtk.c' object='pygtk/pygtk_zbarpygtk_la-zbarpygtk.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(pygtk_zbarpygtk_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o pygtk/pygtk_zbarpygtk_la-zbarpygtk.lo `test -f 'pygtk/zbarpygtk.c' || echo '$(srcdir)/'`pygtk/zbarpygtk.c python/python_zbar_la-zbarmodule.lo: python/zbarmodule.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-zbarmodule.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-zbarmodule.Tpo -c -o python/python_zbar_la-zbarmodule.lo `test -f 'python/zbarmodule.c' || echo '$(srcdir)/'`python/zbarmodule.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-zbarmodule.Tpo python/$(DEPDIR)/python_zbar_la-zbarmodule.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/zbarmodule.c' object='python/python_zbar_la-zbarmodule.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-zbarmodule.lo `test -f 'python/zbarmodule.c' || echo '$(srcdir)/'`python/zbarmodule.c python/python_zbar_la-enum.lo: python/enum.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-enum.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-enum.Tpo -c -o python/python_zbar_la-enum.lo `test -f 'python/enum.c' || echo '$(srcdir)/'`python/enum.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-enum.Tpo python/$(DEPDIR)/python_zbar_la-enum.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/enum.c' object='python/python_zbar_la-enum.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-enum.lo `test -f 'python/enum.c' || echo '$(srcdir)/'`python/enum.c python/python_zbar_la-exception.lo: python/exception.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-exception.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-exception.Tpo -c -o python/python_zbar_la-exception.lo `test -f 'python/exception.c' || echo '$(srcdir)/'`python/exception.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-exception.Tpo python/$(DEPDIR)/python_zbar_la-exception.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/exception.c' object='python/python_zbar_la-exception.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-exception.lo `test -f 'python/exception.c' || echo '$(srcdir)/'`python/exception.c python/python_zbar_la-symbol.lo: python/symbol.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-symbol.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-symbol.Tpo -c -o python/python_zbar_la-symbol.lo `test -f 'python/symbol.c' || echo '$(srcdir)/'`python/symbol.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-symbol.Tpo python/$(DEPDIR)/python_zbar_la-symbol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/symbol.c' object='python/python_zbar_la-symbol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-symbol.lo `test -f 'python/symbol.c' || echo '$(srcdir)/'`python/symbol.c python/python_zbar_la-symbolset.lo: python/symbolset.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-symbolset.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-symbolset.Tpo -c -o python/python_zbar_la-symbolset.lo `test -f 'python/symbolset.c' || echo '$(srcdir)/'`python/symbolset.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-symbolset.Tpo python/$(DEPDIR)/python_zbar_la-symbolset.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/symbolset.c' object='python/python_zbar_la-symbolset.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-symbolset.lo `test -f 'python/symbolset.c' || echo '$(srcdir)/'`python/symbolset.c python/python_zbar_la-symboliter.lo: python/symboliter.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-symboliter.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-symboliter.Tpo -c -o python/python_zbar_la-symboliter.lo `test -f 'python/symboliter.c' || echo '$(srcdir)/'`python/symboliter.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-symboliter.Tpo python/$(DEPDIR)/python_zbar_la-symboliter.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/symboliter.c' object='python/python_zbar_la-symboliter.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-symboliter.lo `test -f 'python/symboliter.c' || echo '$(srcdir)/'`python/symboliter.c python/python_zbar_la-image.lo: python/image.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-image.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-image.Tpo -c -o python/python_zbar_la-image.lo `test -f 'python/image.c' || echo '$(srcdir)/'`python/image.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-image.Tpo python/$(DEPDIR)/python_zbar_la-image.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/image.c' object='python/python_zbar_la-image.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-image.lo `test -f 'python/image.c' || echo '$(srcdir)/'`python/image.c python/python_zbar_la-processor.lo: python/processor.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-processor.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-processor.Tpo -c -o python/python_zbar_la-processor.lo `test -f 'python/processor.c' || echo '$(srcdir)/'`python/processor.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-processor.Tpo python/$(DEPDIR)/python_zbar_la-processor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/processor.c' object='python/python_zbar_la-processor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-processor.lo `test -f 'python/processor.c' || echo '$(srcdir)/'`python/processor.c python/python_zbar_la-imagescanner.lo: python/imagescanner.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-imagescanner.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-imagescanner.Tpo -c -o python/python_zbar_la-imagescanner.lo `test -f 'python/imagescanner.c' || echo '$(srcdir)/'`python/imagescanner.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-imagescanner.Tpo python/$(DEPDIR)/python_zbar_la-imagescanner.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/imagescanner.c' object='python/python_zbar_la-imagescanner.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-imagescanner.lo `test -f 'python/imagescanner.c' || echo '$(srcdir)/'`python/imagescanner.c python/python_zbar_la-decoder.lo: python/decoder.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-decoder.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-decoder.Tpo -c -o python/python_zbar_la-decoder.lo `test -f 'python/decoder.c' || echo '$(srcdir)/'`python/decoder.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-decoder.Tpo python/$(DEPDIR)/python_zbar_la-decoder.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/decoder.c' object='python/python_zbar_la-decoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-decoder.lo `test -f 'python/decoder.c' || echo '$(srcdir)/'`python/decoder.c python/python_zbar_la-scanner.lo: python/scanner.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT python/python_zbar_la-scanner.lo -MD -MP -MF python/$(DEPDIR)/python_zbar_la-scanner.Tpo -c -o python/python_zbar_la-scanner.lo `test -f 'python/scanner.c' || echo '$(srcdir)/'`python/scanner.c @am__fastdepCC_TRUE@ mv -f python/$(DEPDIR)/python_zbar_la-scanner.Tpo python/$(DEPDIR)/python_zbar_la-scanner.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='python/scanner.c' object='python/python_zbar_la-scanner.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(python_zbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o python/python_zbar_la-scanner.lo `test -f 'python/scanner.c' || echo '$(srcdir)/'`python/scanner.c zbar/zbar_libzbar_la-config.lo: zbar/config.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-config.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-config.Tpo -c -o zbar/zbar_libzbar_la-config.lo `test -f 'zbar/config.c' || echo '$(srcdir)/'`zbar/config.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-config.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-config.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/config.c' object='zbar/zbar_libzbar_la-config.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-config.lo `test -f 'zbar/config.c' || echo '$(srcdir)/'`zbar/config.c zbar/zbar_libzbar_la-error.lo: zbar/error.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-error.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-error.Tpo -c -o zbar/zbar_libzbar_la-error.lo `test -f 'zbar/error.c' || echo '$(srcdir)/'`zbar/error.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-error.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-error.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/error.c' object='zbar/zbar_libzbar_la-error.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-error.lo `test -f 'zbar/error.c' || echo '$(srcdir)/'`zbar/error.c zbar/zbar_libzbar_la-symbol.lo: zbar/symbol.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-symbol.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-symbol.Tpo -c -o zbar/zbar_libzbar_la-symbol.lo `test -f 'zbar/symbol.c' || echo '$(srcdir)/'`zbar/symbol.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-symbol.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-symbol.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/symbol.c' object='zbar/zbar_libzbar_la-symbol.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-symbol.lo `test -f 'zbar/symbol.c' || echo '$(srcdir)/'`zbar/symbol.c zbar/zbar_libzbar_la-image.lo: zbar/image.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-image.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-image.Tpo -c -o zbar/zbar_libzbar_la-image.lo `test -f 'zbar/image.c' || echo '$(srcdir)/'`zbar/image.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-image.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-image.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/image.c' object='zbar/zbar_libzbar_la-image.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-image.lo `test -f 'zbar/image.c' || echo '$(srcdir)/'`zbar/image.c zbar/zbar_libzbar_la-convert.lo: zbar/convert.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-convert.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-convert.Tpo -c -o zbar/zbar_libzbar_la-convert.lo `test -f 'zbar/convert.c' || echo '$(srcdir)/'`zbar/convert.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-convert.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-convert.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/convert.c' object='zbar/zbar_libzbar_la-convert.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-convert.lo `test -f 'zbar/convert.c' || echo '$(srcdir)/'`zbar/convert.c zbar/zbar_libzbar_la-processor.lo: zbar/processor.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-processor.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-processor.Tpo -c -o zbar/zbar_libzbar_la-processor.lo `test -f 'zbar/processor.c' || echo '$(srcdir)/'`zbar/processor.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-processor.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-processor.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/processor.c' object='zbar/zbar_libzbar_la-processor.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-processor.lo `test -f 'zbar/processor.c' || echo '$(srcdir)/'`zbar/processor.c zbar/processor/zbar_libzbar_la-lock.lo: zbar/processor/lock.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/processor/zbar_libzbar_la-lock.lo -MD -MP -MF zbar/processor/$(DEPDIR)/zbar_libzbar_la-lock.Tpo -c -o zbar/processor/zbar_libzbar_la-lock.lo `test -f 'zbar/processor/lock.c' || echo '$(srcdir)/'`zbar/processor/lock.c @am__fastdepCC_TRUE@ mv -f zbar/processor/$(DEPDIR)/zbar_libzbar_la-lock.Tpo zbar/processor/$(DEPDIR)/zbar_libzbar_la-lock.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/processor/lock.c' object='zbar/processor/zbar_libzbar_la-lock.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/processor/zbar_libzbar_la-lock.lo `test -f 'zbar/processor/lock.c' || echo '$(srcdir)/'`zbar/processor/lock.c zbar/zbar_libzbar_la-refcnt.lo: zbar/refcnt.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-refcnt.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-refcnt.Tpo -c -o zbar/zbar_libzbar_la-refcnt.lo `test -f 'zbar/refcnt.c' || echo '$(srcdir)/'`zbar/refcnt.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-refcnt.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-refcnt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/refcnt.c' object='zbar/zbar_libzbar_la-refcnt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-refcnt.lo `test -f 'zbar/refcnt.c' || echo '$(srcdir)/'`zbar/refcnt.c zbar/zbar_libzbar_la-window.lo: zbar/window.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-window.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-window.Tpo -c -o zbar/zbar_libzbar_la-window.lo `test -f 'zbar/window.c' || echo '$(srcdir)/'`zbar/window.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-window.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-window.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/window.c' object='zbar/zbar_libzbar_la-window.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-window.lo `test -f 'zbar/window.c' || echo '$(srcdir)/'`zbar/window.c zbar/zbar_libzbar_la-video.lo: zbar/video.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-video.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-video.Tpo -c -o zbar/zbar_libzbar_la-video.lo `test -f 'zbar/video.c' || echo '$(srcdir)/'`zbar/video.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-video.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-video.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/video.c' object='zbar/zbar_libzbar_la-video.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-video.lo `test -f 'zbar/video.c' || echo '$(srcdir)/'`zbar/video.c zbar/zbar_libzbar_la-img_scanner.lo: zbar/img_scanner.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-img_scanner.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-img_scanner.Tpo -c -o zbar/zbar_libzbar_la-img_scanner.lo `test -f 'zbar/img_scanner.c' || echo '$(srcdir)/'`zbar/img_scanner.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-img_scanner.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-img_scanner.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/img_scanner.c' object='zbar/zbar_libzbar_la-img_scanner.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-img_scanner.lo `test -f 'zbar/img_scanner.c' || echo '$(srcdir)/'`zbar/img_scanner.c zbar/zbar_libzbar_la-scanner.lo: zbar/scanner.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-scanner.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-scanner.Tpo -c -o zbar/zbar_libzbar_la-scanner.lo `test -f 'zbar/scanner.c' || echo '$(srcdir)/'`zbar/scanner.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-scanner.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-scanner.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/scanner.c' object='zbar/zbar_libzbar_la-scanner.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-scanner.lo `test -f 'zbar/scanner.c' || echo '$(srcdir)/'`zbar/scanner.c zbar/zbar_libzbar_la-decoder.lo: zbar/decoder.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-decoder.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-decoder.Tpo -c -o zbar/zbar_libzbar_la-decoder.lo `test -f 'zbar/decoder.c' || echo '$(srcdir)/'`zbar/decoder.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-decoder.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-decoder.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/decoder.c' object='zbar/zbar_libzbar_la-decoder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-decoder.lo `test -f 'zbar/decoder.c' || echo '$(srcdir)/'`zbar/decoder.c zbar/decoder/zbar_libzbar_la-ean.lo: zbar/decoder/ean.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/decoder/zbar_libzbar_la-ean.lo -MD -MP -MF zbar/decoder/$(DEPDIR)/zbar_libzbar_la-ean.Tpo -c -o zbar/decoder/zbar_libzbar_la-ean.lo `test -f 'zbar/decoder/ean.c' || echo '$(srcdir)/'`zbar/decoder/ean.c @am__fastdepCC_TRUE@ mv -f zbar/decoder/$(DEPDIR)/zbar_libzbar_la-ean.Tpo zbar/decoder/$(DEPDIR)/zbar_libzbar_la-ean.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/decoder/ean.c' object='zbar/decoder/zbar_libzbar_la-ean.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/decoder/zbar_libzbar_la-ean.lo `test -f 'zbar/decoder/ean.c' || echo '$(srcdir)/'`zbar/decoder/ean.c zbar/decoder/zbar_libzbar_la-code128.lo: zbar/decoder/code128.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/decoder/zbar_libzbar_la-code128.lo -MD -MP -MF zbar/decoder/$(DEPDIR)/zbar_libzbar_la-code128.Tpo -c -o zbar/decoder/zbar_libzbar_la-code128.lo `test -f 'zbar/decoder/code128.c' || echo '$(srcdir)/'`zbar/decoder/code128.c @am__fastdepCC_TRUE@ mv -f zbar/decoder/$(DEPDIR)/zbar_libzbar_la-code128.Tpo zbar/decoder/$(DEPDIR)/zbar_libzbar_la-code128.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/decoder/code128.c' object='zbar/decoder/zbar_libzbar_la-code128.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/decoder/zbar_libzbar_la-code128.lo `test -f 'zbar/decoder/code128.c' || echo '$(srcdir)/'`zbar/decoder/code128.c zbar/decoder/zbar_libzbar_la-code39.lo: zbar/decoder/code39.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/decoder/zbar_libzbar_la-code39.lo -MD -MP -MF zbar/decoder/$(DEPDIR)/zbar_libzbar_la-code39.Tpo -c -o zbar/decoder/zbar_libzbar_la-code39.lo `test -f 'zbar/decoder/code39.c' || echo '$(srcdir)/'`zbar/decoder/code39.c @am__fastdepCC_TRUE@ mv -f zbar/decoder/$(DEPDIR)/zbar_libzbar_la-code39.Tpo zbar/decoder/$(DEPDIR)/zbar_libzbar_la-code39.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/decoder/code39.c' object='zbar/decoder/zbar_libzbar_la-code39.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/decoder/zbar_libzbar_la-code39.lo `test -f 'zbar/decoder/code39.c' || echo '$(srcdir)/'`zbar/decoder/code39.c zbar/decoder/zbar_libzbar_la-i25.lo: zbar/decoder/i25.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/decoder/zbar_libzbar_la-i25.lo -MD -MP -MF zbar/decoder/$(DEPDIR)/zbar_libzbar_la-i25.Tpo -c -o zbar/decoder/zbar_libzbar_la-i25.lo `test -f 'zbar/decoder/i25.c' || echo '$(srcdir)/'`zbar/decoder/i25.c @am__fastdepCC_TRUE@ mv -f zbar/decoder/$(DEPDIR)/zbar_libzbar_la-i25.Tpo zbar/decoder/$(DEPDIR)/zbar_libzbar_la-i25.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/decoder/i25.c' object='zbar/decoder/zbar_libzbar_la-i25.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/decoder/zbar_libzbar_la-i25.lo `test -f 'zbar/decoder/i25.c' || echo '$(srcdir)/'`zbar/decoder/i25.c zbar/decoder/zbar_libzbar_la-pdf417.lo: zbar/decoder/pdf417.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/decoder/zbar_libzbar_la-pdf417.lo -MD -MP -MF zbar/decoder/$(DEPDIR)/zbar_libzbar_la-pdf417.Tpo -c -o zbar/decoder/zbar_libzbar_la-pdf417.lo `test -f 'zbar/decoder/pdf417.c' || echo '$(srcdir)/'`zbar/decoder/pdf417.c @am__fastdepCC_TRUE@ mv -f zbar/decoder/$(DEPDIR)/zbar_libzbar_la-pdf417.Tpo zbar/decoder/$(DEPDIR)/zbar_libzbar_la-pdf417.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/decoder/pdf417.c' object='zbar/decoder/zbar_libzbar_la-pdf417.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/decoder/zbar_libzbar_la-pdf417.lo `test -f 'zbar/decoder/pdf417.c' || echo '$(srcdir)/'`zbar/decoder/pdf417.c zbar/decoder/zbar_libzbar_la-qr_finder.lo: zbar/decoder/qr_finder.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/decoder/zbar_libzbar_la-qr_finder.lo -MD -MP -MF zbar/decoder/$(DEPDIR)/zbar_libzbar_la-qr_finder.Tpo -c -o zbar/decoder/zbar_libzbar_la-qr_finder.lo `test -f 'zbar/decoder/qr_finder.c' || echo '$(srcdir)/'`zbar/decoder/qr_finder.c @am__fastdepCC_TRUE@ mv -f zbar/decoder/$(DEPDIR)/zbar_libzbar_la-qr_finder.Tpo zbar/decoder/$(DEPDIR)/zbar_libzbar_la-qr_finder.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/decoder/qr_finder.c' object='zbar/decoder/zbar_libzbar_la-qr_finder.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/decoder/zbar_libzbar_la-qr_finder.lo `test -f 'zbar/decoder/qr_finder.c' || echo '$(srcdir)/'`zbar/decoder/qr_finder.c zbar/qrcode/zbar_libzbar_la-qrdec.lo: zbar/qrcode/qrdec.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/qrcode/zbar_libzbar_la-qrdec.lo -MD -MP -MF zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-qrdec.Tpo -c -o zbar/qrcode/zbar_libzbar_la-qrdec.lo `test -f 'zbar/qrcode/qrdec.c' || echo '$(srcdir)/'`zbar/qrcode/qrdec.c @am__fastdepCC_TRUE@ mv -f zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-qrdec.Tpo zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-qrdec.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/qrcode/qrdec.c' object='zbar/qrcode/zbar_libzbar_la-qrdec.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/qrcode/zbar_libzbar_la-qrdec.lo `test -f 'zbar/qrcode/qrdec.c' || echo '$(srcdir)/'`zbar/qrcode/qrdec.c zbar/qrcode/zbar_libzbar_la-qrdectxt.lo: zbar/qrcode/qrdectxt.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/qrcode/zbar_libzbar_la-qrdectxt.lo -MD -MP -MF zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-qrdectxt.Tpo -c -o zbar/qrcode/zbar_libzbar_la-qrdectxt.lo `test -f 'zbar/qrcode/qrdectxt.c' || echo '$(srcdir)/'`zbar/qrcode/qrdectxt.c @am__fastdepCC_TRUE@ mv -f zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-qrdectxt.Tpo zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-qrdectxt.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/qrcode/qrdectxt.c' object='zbar/qrcode/zbar_libzbar_la-qrdectxt.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/qrcode/zbar_libzbar_la-qrdectxt.lo `test -f 'zbar/qrcode/qrdectxt.c' || echo '$(srcdir)/'`zbar/qrcode/qrdectxt.c zbar/qrcode/zbar_libzbar_la-rs.lo: zbar/qrcode/rs.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/qrcode/zbar_libzbar_la-rs.lo -MD -MP -MF zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-rs.Tpo -c -o zbar/qrcode/zbar_libzbar_la-rs.lo `test -f 'zbar/qrcode/rs.c' || echo '$(srcdir)/'`zbar/qrcode/rs.c @am__fastdepCC_TRUE@ mv -f zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-rs.Tpo zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-rs.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/qrcode/rs.c' object='zbar/qrcode/zbar_libzbar_la-rs.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/qrcode/zbar_libzbar_la-rs.lo `test -f 'zbar/qrcode/rs.c' || echo '$(srcdir)/'`zbar/qrcode/rs.c zbar/qrcode/zbar_libzbar_la-isaac.lo: zbar/qrcode/isaac.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/qrcode/zbar_libzbar_la-isaac.lo -MD -MP -MF zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-isaac.Tpo -c -o zbar/qrcode/zbar_libzbar_la-isaac.lo `test -f 'zbar/qrcode/isaac.c' || echo '$(srcdir)/'`zbar/qrcode/isaac.c @am__fastdepCC_TRUE@ mv -f zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-isaac.Tpo zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-isaac.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/qrcode/isaac.c' object='zbar/qrcode/zbar_libzbar_la-isaac.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/qrcode/zbar_libzbar_la-isaac.lo `test -f 'zbar/qrcode/isaac.c' || echo '$(srcdir)/'`zbar/qrcode/isaac.c zbar/qrcode/zbar_libzbar_la-bch15_5.lo: zbar/qrcode/bch15_5.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/qrcode/zbar_libzbar_la-bch15_5.lo -MD -MP -MF zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-bch15_5.Tpo -c -o zbar/qrcode/zbar_libzbar_la-bch15_5.lo `test -f 'zbar/qrcode/bch15_5.c' || echo '$(srcdir)/'`zbar/qrcode/bch15_5.c @am__fastdepCC_TRUE@ mv -f zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-bch15_5.Tpo zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-bch15_5.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/qrcode/bch15_5.c' object='zbar/qrcode/zbar_libzbar_la-bch15_5.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/qrcode/zbar_libzbar_la-bch15_5.lo `test -f 'zbar/qrcode/bch15_5.c' || echo '$(srcdir)/'`zbar/qrcode/bch15_5.c zbar/qrcode/zbar_libzbar_la-binarize.lo: zbar/qrcode/binarize.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/qrcode/zbar_libzbar_la-binarize.lo -MD -MP -MF zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-binarize.Tpo -c -o zbar/qrcode/zbar_libzbar_la-binarize.lo `test -f 'zbar/qrcode/binarize.c' || echo '$(srcdir)/'`zbar/qrcode/binarize.c @am__fastdepCC_TRUE@ mv -f zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-binarize.Tpo zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-binarize.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/qrcode/binarize.c' object='zbar/qrcode/zbar_libzbar_la-binarize.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/qrcode/zbar_libzbar_la-binarize.lo `test -f 'zbar/qrcode/binarize.c' || echo '$(srcdir)/'`zbar/qrcode/binarize.c zbar/qrcode/zbar_libzbar_la-util.lo: zbar/qrcode/util.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/qrcode/zbar_libzbar_la-util.lo -MD -MP -MF zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-util.Tpo -c -o zbar/qrcode/zbar_libzbar_la-util.lo `test -f 'zbar/qrcode/util.c' || echo '$(srcdir)/'`zbar/qrcode/util.c @am__fastdepCC_TRUE@ mv -f zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-util.Tpo zbar/qrcode/$(DEPDIR)/zbar_libzbar_la-util.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/qrcode/util.c' object='zbar/qrcode/zbar_libzbar_la-util.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/qrcode/zbar_libzbar_la-util.lo `test -f 'zbar/qrcode/util.c' || echo '$(srcdir)/'`zbar/qrcode/util.c zbar/processor/zbar_libzbar_la-win.lo: zbar/processor/win.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/processor/zbar_libzbar_la-win.lo -MD -MP -MF zbar/processor/$(DEPDIR)/zbar_libzbar_la-win.Tpo -c -o zbar/processor/zbar_libzbar_la-win.lo `test -f 'zbar/processor/win.c' || echo '$(srcdir)/'`zbar/processor/win.c @am__fastdepCC_TRUE@ mv -f zbar/processor/$(DEPDIR)/zbar_libzbar_la-win.Tpo zbar/processor/$(DEPDIR)/zbar_libzbar_la-win.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/processor/win.c' object='zbar/processor/zbar_libzbar_la-win.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/processor/zbar_libzbar_la-win.lo `test -f 'zbar/processor/win.c' || echo '$(srcdir)/'`zbar/processor/win.c zbar/processor/zbar_libzbar_la-posix.lo: zbar/processor/posix.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/processor/zbar_libzbar_la-posix.lo -MD -MP -MF zbar/processor/$(DEPDIR)/zbar_libzbar_la-posix.Tpo -c -o zbar/processor/zbar_libzbar_la-posix.lo `test -f 'zbar/processor/posix.c' || echo '$(srcdir)/'`zbar/processor/posix.c @am__fastdepCC_TRUE@ mv -f zbar/processor/$(DEPDIR)/zbar_libzbar_la-posix.Tpo zbar/processor/$(DEPDIR)/zbar_libzbar_la-posix.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/processor/posix.c' object='zbar/processor/zbar_libzbar_la-posix.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/processor/zbar_libzbar_la-posix.lo `test -f 'zbar/processor/posix.c' || echo '$(srcdir)/'`zbar/processor/posix.c zbar/video/zbar_libzbar_la-v4l1.lo: zbar/video/v4l1.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/video/zbar_libzbar_la-v4l1.lo -MD -MP -MF zbar/video/$(DEPDIR)/zbar_libzbar_la-v4l1.Tpo -c -o zbar/video/zbar_libzbar_la-v4l1.lo `test -f 'zbar/video/v4l1.c' || echo '$(srcdir)/'`zbar/video/v4l1.c @am__fastdepCC_TRUE@ mv -f zbar/video/$(DEPDIR)/zbar_libzbar_la-v4l1.Tpo zbar/video/$(DEPDIR)/zbar_libzbar_la-v4l1.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/video/v4l1.c' object='zbar/video/zbar_libzbar_la-v4l1.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/video/zbar_libzbar_la-v4l1.lo `test -f 'zbar/video/v4l1.c' || echo '$(srcdir)/'`zbar/video/v4l1.c zbar/video/zbar_libzbar_la-v4l2.lo: zbar/video/v4l2.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/video/zbar_libzbar_la-v4l2.lo -MD -MP -MF zbar/video/$(DEPDIR)/zbar_libzbar_la-v4l2.Tpo -c -o zbar/video/zbar_libzbar_la-v4l2.lo `test -f 'zbar/video/v4l2.c' || echo '$(srcdir)/'`zbar/video/v4l2.c @am__fastdepCC_TRUE@ mv -f zbar/video/$(DEPDIR)/zbar_libzbar_la-v4l2.Tpo zbar/video/$(DEPDIR)/zbar_libzbar_la-v4l2.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/video/v4l2.c' object='zbar/video/zbar_libzbar_la-v4l2.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/video/zbar_libzbar_la-v4l2.lo `test -f 'zbar/video/v4l2.c' || echo '$(srcdir)/'`zbar/video/v4l2.c zbar/video/zbar_libzbar_la-vfw.lo: zbar/video/vfw.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/video/zbar_libzbar_la-vfw.lo -MD -MP -MF zbar/video/$(DEPDIR)/zbar_libzbar_la-vfw.Tpo -c -o zbar/video/zbar_libzbar_la-vfw.lo `test -f 'zbar/video/vfw.c' || echo '$(srcdir)/'`zbar/video/vfw.c @am__fastdepCC_TRUE@ mv -f zbar/video/$(DEPDIR)/zbar_libzbar_la-vfw.Tpo zbar/video/$(DEPDIR)/zbar_libzbar_la-vfw.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/video/vfw.c' object='zbar/video/zbar_libzbar_la-vfw.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/video/zbar_libzbar_la-vfw.lo `test -f 'zbar/video/vfw.c' || echo '$(srcdir)/'`zbar/video/vfw.c zbar/video/zbar_libzbar_la-null.lo: zbar/video/null.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/video/zbar_libzbar_la-null.lo -MD -MP -MF zbar/video/$(DEPDIR)/zbar_libzbar_la-null.Tpo -c -o zbar/video/zbar_libzbar_la-null.lo `test -f 'zbar/video/null.c' || echo '$(srcdir)/'`zbar/video/null.c @am__fastdepCC_TRUE@ mv -f zbar/video/$(DEPDIR)/zbar_libzbar_la-null.Tpo zbar/video/$(DEPDIR)/zbar_libzbar_la-null.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/video/null.c' object='zbar/video/zbar_libzbar_la-null.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/video/zbar_libzbar_la-null.lo `test -f 'zbar/video/null.c' || echo '$(srcdir)/'`zbar/video/null.c zbar/zbar_libzbar_la-jpeg.lo: zbar/jpeg.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-jpeg.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-jpeg.Tpo -c -o zbar/zbar_libzbar_la-jpeg.lo `test -f 'zbar/jpeg.c' || echo '$(srcdir)/'`zbar/jpeg.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-jpeg.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-jpeg.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/jpeg.c' object='zbar/zbar_libzbar_la-jpeg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-jpeg.lo `test -f 'zbar/jpeg.c' || echo '$(srcdir)/'`zbar/jpeg.c zbar/processor/zbar_libzbar_la-x.lo: zbar/processor/x.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/processor/zbar_libzbar_la-x.lo -MD -MP -MF zbar/processor/$(DEPDIR)/zbar_libzbar_la-x.Tpo -c -o zbar/processor/zbar_libzbar_la-x.lo `test -f 'zbar/processor/x.c' || echo '$(srcdir)/'`zbar/processor/x.c @am__fastdepCC_TRUE@ mv -f zbar/processor/$(DEPDIR)/zbar_libzbar_la-x.Tpo zbar/processor/$(DEPDIR)/zbar_libzbar_la-x.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/processor/x.c' object='zbar/processor/zbar_libzbar_la-x.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/processor/zbar_libzbar_la-x.lo `test -f 'zbar/processor/x.c' || echo '$(srcdir)/'`zbar/processor/x.c zbar/window/zbar_libzbar_la-x.lo: zbar/window/x.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/window/zbar_libzbar_la-x.lo -MD -MP -MF zbar/window/$(DEPDIR)/zbar_libzbar_la-x.Tpo -c -o zbar/window/zbar_libzbar_la-x.lo `test -f 'zbar/window/x.c' || echo '$(srcdir)/'`zbar/window/x.c @am__fastdepCC_TRUE@ mv -f zbar/window/$(DEPDIR)/zbar_libzbar_la-x.Tpo zbar/window/$(DEPDIR)/zbar_libzbar_la-x.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/window/x.c' object='zbar/window/zbar_libzbar_la-x.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/window/zbar_libzbar_la-x.lo `test -f 'zbar/window/x.c' || echo '$(srcdir)/'`zbar/window/x.c zbar/window/zbar_libzbar_la-ximage.lo: zbar/window/ximage.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/window/zbar_libzbar_la-ximage.lo -MD -MP -MF zbar/window/$(DEPDIR)/zbar_libzbar_la-ximage.Tpo -c -o zbar/window/zbar_libzbar_la-ximage.lo `test -f 'zbar/window/ximage.c' || echo '$(srcdir)/'`zbar/window/ximage.c @am__fastdepCC_TRUE@ mv -f zbar/window/$(DEPDIR)/zbar_libzbar_la-ximage.Tpo zbar/window/$(DEPDIR)/zbar_libzbar_la-ximage.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/window/ximage.c' object='zbar/window/zbar_libzbar_la-ximage.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/window/zbar_libzbar_la-ximage.lo `test -f 'zbar/window/ximage.c' || echo '$(srcdir)/'`zbar/window/ximage.c zbar/window/zbar_libzbar_la-xv.lo: zbar/window/xv.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/window/zbar_libzbar_la-xv.lo -MD -MP -MF zbar/window/$(DEPDIR)/zbar_libzbar_la-xv.Tpo -c -o zbar/window/zbar_libzbar_la-xv.lo `test -f 'zbar/window/xv.c' || echo '$(srcdir)/'`zbar/window/xv.c @am__fastdepCC_TRUE@ mv -f zbar/window/$(DEPDIR)/zbar_libzbar_la-xv.Tpo zbar/window/$(DEPDIR)/zbar_libzbar_la-xv.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/window/xv.c' object='zbar/window/zbar_libzbar_la-xv.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/window/zbar_libzbar_la-xv.lo `test -f 'zbar/window/xv.c' || echo '$(srcdir)/'`zbar/window/xv.c zbar/window/zbar_libzbar_la-win.lo: zbar/window/win.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/window/zbar_libzbar_la-win.lo -MD -MP -MF zbar/window/$(DEPDIR)/zbar_libzbar_la-win.Tpo -c -o zbar/window/zbar_libzbar_la-win.lo `test -f 'zbar/window/win.c' || echo '$(srcdir)/'`zbar/window/win.c @am__fastdepCC_TRUE@ mv -f zbar/window/$(DEPDIR)/zbar_libzbar_la-win.Tpo zbar/window/$(DEPDIR)/zbar_libzbar_la-win.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/window/win.c' object='zbar/window/zbar_libzbar_la-win.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/window/zbar_libzbar_la-win.lo `test -f 'zbar/window/win.c' || echo '$(srcdir)/'`zbar/window/win.c zbar/window/zbar_libzbar_la-dib.lo: zbar/window/dib.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/window/zbar_libzbar_la-dib.lo -MD -MP -MF zbar/window/$(DEPDIR)/zbar_libzbar_la-dib.Tpo -c -o zbar/window/zbar_libzbar_la-dib.lo `test -f 'zbar/window/dib.c' || echo '$(srcdir)/'`zbar/window/dib.c @am__fastdepCC_TRUE@ mv -f zbar/window/$(DEPDIR)/zbar_libzbar_la-dib.Tpo zbar/window/$(DEPDIR)/zbar_libzbar_la-dib.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/window/dib.c' object='zbar/window/zbar_libzbar_la-dib.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/window/zbar_libzbar_la-dib.lo `test -f 'zbar/window/dib.c' || echo '$(srcdir)/'`zbar/window/dib.c zbar/processor/zbar_libzbar_la-null.lo: zbar/processor/null.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/processor/zbar_libzbar_la-null.lo -MD -MP -MF zbar/processor/$(DEPDIR)/zbar_libzbar_la-null.Tpo -c -o zbar/processor/zbar_libzbar_la-null.lo `test -f 'zbar/processor/null.c' || echo '$(srcdir)/'`zbar/processor/null.c @am__fastdepCC_TRUE@ mv -f zbar/processor/$(DEPDIR)/zbar_libzbar_la-null.Tpo zbar/processor/$(DEPDIR)/zbar_libzbar_la-null.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/processor/null.c' object='zbar/processor/zbar_libzbar_la-null.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/processor/zbar_libzbar_la-null.lo `test -f 'zbar/processor/null.c' || echo '$(srcdir)/'`zbar/processor/null.c zbar/window/zbar_libzbar_la-null.lo: zbar/window/null.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/window/zbar_libzbar_la-null.lo -MD -MP -MF zbar/window/$(DEPDIR)/zbar_libzbar_la-null.Tpo -c -o zbar/window/zbar_libzbar_la-null.lo `test -f 'zbar/window/null.c' || echo '$(srcdir)/'`zbar/window/null.c @am__fastdepCC_TRUE@ mv -f zbar/window/$(DEPDIR)/zbar_libzbar_la-null.Tpo zbar/window/$(DEPDIR)/zbar_libzbar_la-null.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/window/null.c' object='zbar/window/zbar_libzbar_la-null.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/window/zbar_libzbar_la-null.lo `test -f 'zbar/window/null.c' || echo '$(srcdir)/'`zbar/window/null.c zbar/zbar_libzbar_la-svg.lo: zbar/svg.c @am__fastdepCC_TRUE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbar/zbar_libzbar_la-svg.lo -MD -MP -MF zbar/$(DEPDIR)/zbar_libzbar_la-svg.Tpo -c -o zbar/zbar_libzbar_la-svg.lo `test -f 'zbar/svg.c' || echo '$(srcdir)/'`zbar/svg.c @am__fastdepCC_TRUE@ mv -f zbar/$(DEPDIR)/zbar_libzbar_la-svg.Tpo zbar/$(DEPDIR)/zbar_libzbar_la-svg.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbar/svg.c' object='zbar/zbar_libzbar_la-svg.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbar_libzbar_la_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbar/zbar_libzbar_la-svg.lo `test -f 'zbar/svg.c' || echo '$(srcdir)/'`zbar/svg.c test/test_test_decode-test_decode.o: test/test_decode.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_test_decode_CFLAGS) $(CFLAGS) -MT test/test_test_decode-test_decode.o -MD -MP -MF test/$(DEPDIR)/test_test_decode-test_decode.Tpo -c -o test/test_test_decode-test_decode.o `test -f 'test/test_decode.c' || echo '$(srcdir)/'`test/test_decode.c @am__fastdepCC_TRUE@ mv -f test/$(DEPDIR)/test_test_decode-test_decode.Tpo test/$(DEPDIR)/test_test_decode-test_decode.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/test_decode.c' object='test/test_test_decode-test_decode.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_test_decode_CFLAGS) $(CFLAGS) -c -o test/test_test_decode-test_decode.o `test -f 'test/test_decode.c' || echo '$(srcdir)/'`test/test_decode.c test/test_test_decode-test_decode.obj: test/test_decode.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_test_decode_CFLAGS) $(CFLAGS) -MT test/test_test_decode-test_decode.obj -MD -MP -MF test/$(DEPDIR)/test_test_decode-test_decode.Tpo -c -o test/test_test_decode-test_decode.obj `if test -f 'test/test_decode.c'; then $(CYGPATH_W) 'test/test_decode.c'; else $(CYGPATH_W) '$(srcdir)/test/test_decode.c'; fi` @am__fastdepCC_TRUE@ mv -f test/$(DEPDIR)/test_test_decode-test_decode.Tpo test/$(DEPDIR)/test_test_decode-test_decode.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/test_decode.c' object='test/test_test_decode-test_decode.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(test_test_decode_CFLAGS) $(CFLAGS) -c -o test/test_test_decode-test_decode.obj `if test -f 'test/test_decode.c'; then $(CYGPATH_W) 'test/test_decode.c'; else $(CYGPATH_W) '$(srcdir)/test/test_decode.c'; fi` test/test_test_gtk-test_gtk.o: test/test_gtk.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_gtk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_test_gtk-test_gtk.o -MD -MP -MF test/$(DEPDIR)/test_test_gtk-test_gtk.Tpo -c -o test/test_test_gtk-test_gtk.o `test -f 'test/test_gtk.c' || echo '$(srcdir)/'`test/test_gtk.c @am__fastdepCC_TRUE@ mv -f test/$(DEPDIR)/test_test_gtk-test_gtk.Tpo test/$(DEPDIR)/test_test_gtk-test_gtk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/test_gtk.c' object='test/test_test_gtk-test_gtk.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_gtk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_test_gtk-test_gtk.o `test -f 'test/test_gtk.c' || echo '$(srcdir)/'`test/test_gtk.c test/test_test_gtk-test_gtk.obj: test/test_gtk.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_gtk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_test_gtk-test_gtk.obj -MD -MP -MF test/$(DEPDIR)/test_test_gtk-test_gtk.Tpo -c -o test/test_test_gtk-test_gtk.obj `if test -f 'test/test_gtk.c'; then $(CYGPATH_W) 'test/test_gtk.c'; else $(CYGPATH_W) '$(srcdir)/test/test_gtk.c'; fi` @am__fastdepCC_TRUE@ mv -f test/$(DEPDIR)/test_test_gtk-test_gtk.Tpo test/$(DEPDIR)/test_test_gtk-test_gtk.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/test_gtk.c' object='test/test_test_gtk-test_gtk.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_gtk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_test_gtk-test_gtk.obj `if test -f 'test/test_gtk.c'; then $(CYGPATH_W) 'test/test_gtk.c'; else $(CYGPATH_W) '$(srcdir)/test/test_gtk.c'; fi` test/test_test_gtk-scan_video.o: test/scan_video.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_gtk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_test_gtk-scan_video.o -MD -MP -MF test/$(DEPDIR)/test_test_gtk-scan_video.Tpo -c -o test/test_test_gtk-scan_video.o `test -f 'test/scan_video.c' || echo '$(srcdir)/'`test/scan_video.c @am__fastdepCC_TRUE@ mv -f test/$(DEPDIR)/test_test_gtk-scan_video.Tpo test/$(DEPDIR)/test_test_gtk-scan_video.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/scan_video.c' object='test/test_test_gtk-scan_video.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_gtk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_test_gtk-scan_video.o `test -f 'test/scan_video.c' || echo '$(srcdir)/'`test/scan_video.c test/test_test_gtk-scan_video.obj: test/scan_video.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_gtk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_test_gtk-scan_video.obj -MD -MP -MF test/$(DEPDIR)/test_test_gtk-scan_video.Tpo -c -o test/test_test_gtk-scan_video.obj `if test -f 'test/scan_video.c'; then $(CYGPATH_W) 'test/scan_video.c'; else $(CYGPATH_W) '$(srcdir)/test/scan_video.c'; fi` @am__fastdepCC_TRUE@ mv -f test/$(DEPDIR)/test_test_gtk-scan_video.Tpo test/$(DEPDIR)/test_test_gtk-scan_video.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/scan_video.c' object='test/test_test_gtk-scan_video.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_gtk_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_test_gtk-scan_video.obj `if test -f 'test/scan_video.c'; then $(CYGPATH_W) 'test/scan_video.c'; else $(CYGPATH_W) '$(srcdir)/test/scan_video.c'; fi` test/test_test_qt-scan_video.o: test/scan_video.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_test_qt-scan_video.o -MD -MP -MF test/$(DEPDIR)/test_test_qt-scan_video.Tpo -c -o test/test_test_qt-scan_video.o `test -f 'test/scan_video.c' || echo '$(srcdir)/'`test/scan_video.c @am__fastdepCC_TRUE@ mv -f test/$(DEPDIR)/test_test_qt-scan_video.Tpo test/$(DEPDIR)/test_test_qt-scan_video.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/scan_video.c' object='test/test_test_qt-scan_video.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_test_qt-scan_video.o `test -f 'test/scan_video.c' || echo '$(srcdir)/'`test/scan_video.c test/test_test_qt-scan_video.obj: test/scan_video.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test/test_test_qt-scan_video.obj -MD -MP -MF test/$(DEPDIR)/test_test_qt-scan_video.Tpo -c -o test/test_test_qt-scan_video.obj `if test -f 'test/scan_video.c'; then $(CYGPATH_W) 'test/scan_video.c'; else $(CYGPATH_W) '$(srcdir)/test/scan_video.c'; fi` @am__fastdepCC_TRUE@ mv -f test/$(DEPDIR)/test_test_qt-scan_video.Tpo test/$(DEPDIR)/test_test_qt-scan_video.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='test/scan_video.c' object='test/test_test_qt-scan_video.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test/test_test_qt-scan_video.obj `if test -f 'test/scan_video.c'; then $(CYGPATH_W) 'test/scan_video.c'; else $(CYGPATH_W) '$(srcdir)/test/scan_video.c'; fi` zbarimg/zbarimg_zbarimg-zbarimg.o: zbarimg/zbarimg.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbarimg_zbarimg_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbarimg/zbarimg_zbarimg-zbarimg.o -MD -MP -MF zbarimg/$(DEPDIR)/zbarimg_zbarimg-zbarimg.Tpo -c -o zbarimg/zbarimg_zbarimg-zbarimg.o `test -f 'zbarimg/zbarimg.c' || echo '$(srcdir)/'`zbarimg/zbarimg.c @am__fastdepCC_TRUE@ mv -f zbarimg/$(DEPDIR)/zbarimg_zbarimg-zbarimg.Tpo zbarimg/$(DEPDIR)/zbarimg_zbarimg-zbarimg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbarimg/zbarimg.c' object='zbarimg/zbarimg_zbarimg-zbarimg.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbarimg_zbarimg_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbarimg/zbarimg_zbarimg-zbarimg.o `test -f 'zbarimg/zbarimg.c' || echo '$(srcdir)/'`zbarimg/zbarimg.c zbarimg/zbarimg_zbarimg-zbarimg.obj: zbarimg/zbarimg.c @am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbarimg_zbarimg_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT zbarimg/zbarimg_zbarimg-zbarimg.obj -MD -MP -MF zbarimg/$(DEPDIR)/zbarimg_zbarimg-zbarimg.Tpo -c -o zbarimg/zbarimg_zbarimg-zbarimg.obj `if test -f 'zbarimg/zbarimg.c'; then $(CYGPATH_W) 'zbarimg/zbarimg.c'; else $(CYGPATH_W) '$(srcdir)/zbarimg/zbarimg.c'; fi` @am__fastdepCC_TRUE@ mv -f zbarimg/$(DEPDIR)/zbarimg_zbarimg-zbarimg.Tpo zbarimg/$(DEPDIR)/zbarimg_zbarimg-zbarimg.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ source='zbarimg/zbarimg.c' object='zbarimg/zbarimg_zbarimg-zbarimg.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(zbarimg_zbarimg_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o zbarimg/zbarimg_zbarimg-zbarimg.obj `if test -f 'zbarimg/zbarimg.c'; then $(CYGPATH_W) 'zbarimg/zbarimg.c'; else $(CYGPATH_W) '$(srcdir)/zbarimg/zbarimg.c'; fi` .cpp.o: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ mv -f $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $< .cpp.obj: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCXX_TRUE@ $(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCXX_TRUE@ mv -f $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'` .cpp.lo: @am__fastdepCXX_TRUE@ depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\ @am__fastdepCXX_TRUE@ $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCXX_TRUE@ mv -f $$depbase.Tpo $$depbase.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $< qt/qt_libzbarqt_la-QZBar.lo: qt/QZBar.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(qt_libzbarqt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT qt/qt_libzbarqt_la-QZBar.lo -MD -MP -MF qt/$(DEPDIR)/qt_libzbarqt_la-QZBar.Tpo -c -o qt/qt_libzbarqt_la-QZBar.lo `test -f 'qt/QZBar.cpp' || echo '$(srcdir)/'`qt/QZBar.cpp @am__fastdepCXX_TRUE@ mv -f qt/$(DEPDIR)/qt_libzbarqt_la-QZBar.Tpo qt/$(DEPDIR)/qt_libzbarqt_la-QZBar.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='qt/QZBar.cpp' object='qt/qt_libzbarqt_la-QZBar.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(qt_libzbarqt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o qt/qt_libzbarqt_la-QZBar.lo `test -f 'qt/QZBar.cpp' || echo '$(srcdir)/'`qt/QZBar.cpp qt/qt_libzbarqt_la-QZBarThread.lo: qt/QZBarThread.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(qt_libzbarqt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT qt/qt_libzbarqt_la-QZBarThread.lo -MD -MP -MF qt/$(DEPDIR)/qt_libzbarqt_la-QZBarThread.Tpo -c -o qt/qt_libzbarqt_la-QZBarThread.lo `test -f 'qt/QZBarThread.cpp' || echo '$(srcdir)/'`qt/QZBarThread.cpp @am__fastdepCXX_TRUE@ mv -f qt/$(DEPDIR)/qt_libzbarqt_la-QZBarThread.Tpo qt/$(DEPDIR)/qt_libzbarqt_la-QZBarThread.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='qt/QZBarThread.cpp' object='qt/qt_libzbarqt_la-QZBarThread.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(qt_libzbarqt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o qt/qt_libzbarqt_la-QZBarThread.lo `test -f 'qt/QZBarThread.cpp' || echo '$(srcdir)/'`qt/QZBarThread.cpp qt/qt_libzbarqt_la-moc_QZBar.lo: qt/moc_QZBar.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(qt_libzbarqt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT qt/qt_libzbarqt_la-moc_QZBar.lo -MD -MP -MF qt/$(DEPDIR)/qt_libzbarqt_la-moc_QZBar.Tpo -c -o qt/qt_libzbarqt_la-moc_QZBar.lo `test -f 'qt/moc_QZBar.cpp' || echo '$(srcdir)/'`qt/moc_QZBar.cpp @am__fastdepCXX_TRUE@ mv -f qt/$(DEPDIR)/qt_libzbarqt_la-moc_QZBar.Tpo qt/$(DEPDIR)/qt_libzbarqt_la-moc_QZBar.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='qt/moc_QZBar.cpp' object='qt/qt_libzbarqt_la-moc_QZBar.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(qt_libzbarqt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o qt/qt_libzbarqt_la-moc_QZBar.lo `test -f 'qt/moc_QZBar.cpp' || echo '$(srcdir)/'`qt/moc_QZBar.cpp qt/qt_libzbarqt_la-moc_QZBarThread.lo: qt/moc_QZBarThread.cpp @am__fastdepCXX_TRUE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(qt_libzbarqt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT qt/qt_libzbarqt_la-moc_QZBarThread.lo -MD -MP -MF qt/$(DEPDIR)/qt_libzbarqt_la-moc_QZBarThread.Tpo -c -o qt/qt_libzbarqt_la-moc_QZBarThread.lo `test -f 'qt/moc_QZBarThread.cpp' || echo '$(srcdir)/'`qt/moc_QZBarThread.cpp @am__fastdepCXX_TRUE@ mv -f qt/$(DEPDIR)/qt_libzbarqt_la-moc_QZBarThread.Tpo qt/$(DEPDIR)/qt_libzbarqt_la-moc_QZBarThread.Plo @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='qt/moc_QZBarThread.cpp' object='qt/qt_libzbarqt_la-moc_QZBarThread.lo' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(qt_libzbarqt_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o qt/qt_libzbarqt_la-moc_QZBarThread.lo `test -f 'qt/moc_QZBarThread.cpp' || echo '$(srcdir)/'`qt/moc_QZBarThread.cpp test/test_dbg_scan-dbg_scan.o: test/dbg_scan.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbg_scan_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test/test_dbg_scan-dbg_scan.o -MD -MP -MF test/$(DEPDIR)/test_dbg_scan-dbg_scan.Tpo -c -o test/test_dbg_scan-dbg_scan.o `test -f 'test/dbg_scan.cpp' || echo '$(srcdir)/'`test/dbg_scan.cpp @am__fastdepCXX_TRUE@ mv -f test/$(DEPDIR)/test_dbg_scan-dbg_scan.Tpo test/$(DEPDIR)/test_dbg_scan-dbg_scan.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='test/dbg_scan.cpp' object='test/test_dbg_scan-dbg_scan.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbg_scan_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test/test_dbg_scan-dbg_scan.o `test -f 'test/dbg_scan.cpp' || echo '$(srcdir)/'`test/dbg_scan.cpp test/test_dbg_scan-dbg_scan.obj: test/dbg_scan.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbg_scan_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test/test_dbg_scan-dbg_scan.obj -MD -MP -MF test/$(DEPDIR)/test_dbg_scan-dbg_scan.Tpo -c -o test/test_dbg_scan-dbg_scan.obj `if test -f 'test/dbg_scan.cpp'; then $(CYGPATH_W) 'test/dbg_scan.cpp'; else $(CYGPATH_W) '$(srcdir)/test/dbg_scan.cpp'; fi` @am__fastdepCXX_TRUE@ mv -f test/$(DEPDIR)/test_dbg_scan-dbg_scan.Tpo test/$(DEPDIR)/test_dbg_scan-dbg_scan.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='test/dbg_scan.cpp' object='test/test_dbg_scan-dbg_scan.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_dbg_scan_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test/test_dbg_scan-dbg_scan.obj `if test -f 'test/dbg_scan.cpp'; then $(CYGPATH_W) 'test/dbg_scan.cpp'; else $(CYGPATH_W) '$(srcdir)/test/dbg_scan.cpp'; fi` test/test_test_qt-test_qt.o: test/test_qt.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test/test_test_qt-test_qt.o -MD -MP -MF test/$(DEPDIR)/test_test_qt-test_qt.Tpo -c -o test/test_test_qt-test_qt.o `test -f 'test/test_qt.cpp' || echo '$(srcdir)/'`test/test_qt.cpp @am__fastdepCXX_TRUE@ mv -f test/$(DEPDIR)/test_test_qt-test_qt.Tpo test/$(DEPDIR)/test_test_qt-test_qt.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='test/test_qt.cpp' object='test/test_test_qt-test_qt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test/test_test_qt-test_qt.o `test -f 'test/test_qt.cpp' || echo '$(srcdir)/'`test/test_qt.cpp test/test_test_qt-test_qt.obj: test/test_qt.cpp @am__fastdepCXX_TRUE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test/test_test_qt-test_qt.obj -MD -MP -MF test/$(DEPDIR)/test_test_qt-test_qt.Tpo -c -o test/test_test_qt-test_qt.obj `if test -f 'test/test_qt.cpp'; then $(CYGPATH_W) 'test/test_qt.cpp'; else $(CYGPATH_W) '$(srcdir)/test/test_qt.cpp'; fi` @am__fastdepCXX_TRUE@ mv -f test/$(DEPDIR)/test_test_qt-test_qt.Tpo test/$(DEPDIR)/test_test_qt-test_qt.Po @AMDEP_TRUE@@am__fastdepCXX_FALSE@ source='test/test_qt.cpp' object='test/test_test_qt-test_qt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_test_qt_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test/test_test_qt-test_qt.obj `if test -f 'test/test_qt.cpp'; then $(CYGPATH_W) 'test/test_qt.cpp'; else $(CYGPATH_W) '$(srcdir)/test/test_qt.cpp'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs -rm -rf gtk/.libs gtk/_libs -rm -rf plugin/.libs plugin/_libs -rm -rf pygtk/.libs pygtk/_libs -rm -rf python/.libs python/_libs -rm -rf qt/.libs qt/_libs -rm -rf test/.libs test/_libs -rm -rf zbar/.libs zbar/_libs -rm -rf zbar/decoder/.libs zbar/decoder/_libs -rm -rf zbar/processor/.libs zbar/processor/_libs -rm -rf zbar/qrcode/.libs zbar/qrcode/_libs -rm -rf zbar/video/.libs zbar/video/_libs -rm -rf zbar/window/.libs zbar/window/_libs -rm -rf zbarcam/.libs zbarcam/_libs -rm -rf zbarimg/.libs zbarimg/_libs distclean-libtool: -rm -f libtool config.lt install-man1: $(man1_MANS) $(man_MANS) @$(NORMAL_INSTALL) test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)" @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ if test -f $$i; then file=$$i; \ else file=$(srcdir)/$$i; fi; \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \ $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst"; \ done uninstall-man1: @$(NORMAL_UNINSTALL) @list='$(man1_MANS) $(dist_man1_MANS) $(nodist_man1_MANS)'; \ l2='$(man_MANS) $(dist_man_MANS) $(nodist_man_MANS)'; \ for i in $$l2; do \ case "$$i" in \ *.1*) list="$$list $$i" ;; \ esac; \ done; \ for i in $$list; do \ ext=`echo $$i | sed -e 's/^.*\\.//'`; \ case "$$ext" in \ 1*) ;; \ *) ext='1' ;; \ esac; \ inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ inst=`echo $$inst | sed -e 's/^.*\///'`; \ inst=`echo $$inst | sed '$(transform)'`.$$ext; \ echo " rm -f '$(DESTDIR)$(man1dir)/$$inst'"; \ rm -f "$(DESTDIR)$(man1dir)/$$inst"; \ done install-dist_docDATA: $(dist_doc_DATA) @$(NORMAL_INSTALL) test -z "$(docdir)" || $(MKDIR_P) "$(DESTDIR)$(docdir)" @list='$(dist_doc_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(dist_docDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(docdir)/$$f'"; \ $(dist_docDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(docdir)/$$f"; \ done uninstall-dist_docDATA: @$(NORMAL_UNINSTALL) @list='$(dist_doc_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(docdir)/$$f'"; \ rm -f "$(DESTDIR)$(docdir)/$$f"; \ done install-pkgconfigDATA: $(pkgconfig_DATA) @$(NORMAL_INSTALL) test -z "$(pkgconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(pkgconfigdir)" @list='$(pkgconfig_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ $(pkgconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done uninstall-pkgconfigDATA: @$(NORMAL_UNINSTALL) @list='$(pkgconfig_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgconfigdir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgconfigdir)/$$f"; \ done install-pkgdataDATA: $(pkgdata_DATA) @$(NORMAL_INSTALL) test -z "$(pkgdatadir)" || $(MKDIR_P) "$(DESTDIR)$(pkgdatadir)" @list='$(pkgdata_DATA)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(pkgdataDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(pkgdatadir)/$$f'"; \ $(pkgdataDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(pkgdatadir)/$$f"; \ done uninstall-pkgdataDATA: @$(NORMAL_UNINSTALL) @list='$(pkgdata_DATA)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(pkgdatadir)/$$f'"; \ rm -f "$(DESTDIR)$(pkgdatadir)/$$f"; \ done install-includeHEADERS: $(include_HEADERS) @$(NORMAL_INSTALL) test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" @list='$(include_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(includeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(includedir)/$$f'"; \ $(includeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(includedir)/$$f"; \ done uninstall-includeHEADERS: @$(NORMAL_UNINSTALL) @list='$(include_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(includedir)/$$f'"; \ rm -f "$(DESTDIR)$(includedir)/$$f"; \ done install-zincludeHEADERS: $(zinclude_HEADERS) @$(NORMAL_INSTALL) test -z "$(zincludedir)" || $(MKDIR_P) "$(DESTDIR)$(zincludedir)" @list='$(zinclude_HEADERS)'; for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ f=$(am__strip_dir) \ echo " $(zincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(zincludedir)/$$f'"; \ $(zincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(zincludedir)/$$f"; \ done uninstall-zincludeHEADERS: @$(NORMAL_UNINSTALL) @list='$(zinclude_HEADERS)'; for p in $$list; do \ f=$(am__strip_dir) \ echo " rm -f '$(DESTDIR)$(zincludedir)/$$f'"; \ rm -f "$(DESTDIR)$(zincludedir)/$$f"; \ done ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$tags $$unique; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) tags=; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$tags$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$tags $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && cd $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) $$here distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) $(am__remove_distdir) test -d $(distdir) || mkdir $(distdir) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ fi; \ cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ else \ test -f $(distdir)/$$file \ || cp -p $$d/$$file $(distdir)/$$file \ || exit 1; \ fi; \ done -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r $(distdir) dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) dist-lzma: distdir tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma $(am__remove_distdir) dist-tarZ: distdir tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__remove_distdir) dist-shar: distdir shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__remove_distdir) dist dist-all: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2 $(am__remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lzma*) \ unlzma -c $(distdir).tar.lzma | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir); chmod a+w $(distdir) mkdir $(distdir)/_build mkdir $(distdir)/_inst chmod a-w $(distdir) dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && cd $(distdir)/_build \ && ../configure --srcdir=.. --prefix="$$dc_install_base" \ $(DISTCHECK_CONFIGURE_FLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck $(am__remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @cd $(distuninstallcheck_dir) \ && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 @HAVE_MAGICK_FALSE@check-local: check-am: all-am $(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS) $(MAKE) $(AM_MAKEFLAGS) check-local check: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(MANS) $(DATA) $(HEADERS) install-binPROGRAMS: install-libLTLIBRARIES installdirs: for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(pyexecdir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(docdir)" "$(DESTDIR)$(pkgconfigdir)" "$(DESTDIR)$(pkgdatadir)" "$(DESTDIR)$(includedir)" "$(DESTDIR)$(zincludedir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: $(BUILT_SOURCES) $(MAKE) $(AM_MAKEFLAGS) install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ `test -z '$(STRIP)' || \ echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install mostlyclean-generic: clean-generic: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -rm -f gtk/$(DEPDIR)/$(am__dirstamp) -rm -f gtk/$(am__dirstamp) -rm -f plugin/$(DEPDIR)/$(am__dirstamp) -rm -f plugin/$(am__dirstamp) -rm -f pygtk/$(DEPDIR)/$(am__dirstamp) -rm -f pygtk/$(am__dirstamp) -rm -f python/$(DEPDIR)/$(am__dirstamp) -rm -f python/$(am__dirstamp) -rm -f qt/$(DEPDIR)/$(am__dirstamp) -rm -f qt/$(am__dirstamp) -rm -f test/$(DEPDIR)/$(am__dirstamp) -rm -f test/$(am__dirstamp) -rm -f zbar/$(DEPDIR)/$(am__dirstamp) -rm -f zbar/$(am__dirstamp) -rm -f zbar/decoder/$(DEPDIR)/$(am__dirstamp) -rm -f zbar/decoder/$(am__dirstamp) -rm -f zbar/processor/$(DEPDIR)/$(am__dirstamp) -rm -f zbar/processor/$(am__dirstamp) -rm -f zbar/qrcode/$(DEPDIR)/$(am__dirstamp) -rm -f zbar/qrcode/$(am__dirstamp) -rm -f zbar/video/$(DEPDIR)/$(am__dirstamp) -rm -f zbar/video/$(am__dirstamp) -rm -f zbar/window/$(DEPDIR)/$(am__dirstamp) -rm -f zbar/window/$(am__dirstamp) -rm -f zbarcam/$(DEPDIR)/$(am__dirstamp) -rm -f zbarcam/$(am__dirstamp) -rm -f zbarimg/$(DEPDIR)/$(am__dirstamp) -rm -f zbarimg/$(am__dirstamp) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) clean: clean-am clean-am: clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ clean-libLTLIBRARIES clean-libtool clean-pyexecLTLIBRARIES \ mostlyclean-am distclean: distclean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf gtk/$(DEPDIR) plugin/$(DEPDIR) pygtk/$(DEPDIR) python/$(DEPDIR) qt/$(DEPDIR) test/$(DEPDIR) zbar/$(DEPDIR) zbar/decoder/$(DEPDIR) zbar/processor/$(DEPDIR) zbar/qrcode/$(DEPDIR) zbar/video/$(DEPDIR) zbar/window/$(DEPDIR) zbarcam/$(DEPDIR) zbarimg/$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-hdr distclean-libtool distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: html-local info: info-am info-am: install-data-am: install-dist_docDATA install-includeHEADERS \ install-man install-pkgconfigDATA install-pkgdataDATA \ install-zincludeHEADERS install-dvi: install-dvi-am install-exec-am: install-binPROGRAMS install-libLTLIBRARIES \ install-pyexecLTLIBRARIES install-html: install-html-am install-info: install-info-am install-man: install-man1 install-pdf: install-pdf-am install-ps: install-ps-am installcheck-am: installcheck-binPROGRAMS maintainer-clean: maintainer-clean-am -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -rf gtk/$(DEPDIR) plugin/$(DEPDIR) pygtk/$(DEPDIR) python/$(DEPDIR) qt/$(DEPDIR) test/$(DEPDIR) zbar/$(DEPDIR) zbar/decoder/$(DEPDIR) zbar/processor/$(DEPDIR) zbar/qrcode/$(DEPDIR) zbar/video/$(DEPDIR) zbar/window/$(DEPDIR) zbarcam/$(DEPDIR) zbarimg/$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-dist_docDATA \ uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-man uninstall-pkgconfigDATA uninstall-pkgdataDATA \ uninstall-pyexecLTLIBRARIES uninstall-zincludeHEADERS uninstall-man: uninstall-man1 .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am am--refresh check check-am check-local \ clean clean-binPROGRAMS clean-checkPROGRAMS clean-generic \ clean-libLTLIBRARIES clean-libtool clean-pyexecLTLIBRARIES \ ctags dist dist-all dist-bzip2 dist-gzip dist-lzma dist-shar \ dist-tarZ dist-zip distcheck distclean distclean-compile \ distclean-generic distclean-hdr distclean-libtool \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am html-local info info-am install install-am \ install-binPROGRAMS install-data install-data-am \ install-dist_docDATA install-dvi install-dvi-am install-exec \ install-exec-am install-html install-html-am \ install-includeHEADERS install-info install-info-am \ install-libLTLIBRARIES install-man install-man1 install-pdf \ install-pdf-am install-pkgconfigDATA install-pkgdataDATA \ install-ps install-ps-am install-pyexecLTLIBRARIES \ install-strip install-zincludeHEADERS installcheck \ installcheck-am installcheck-binPROGRAMS installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-dist_docDATA \ uninstall-includeHEADERS uninstall-libLTLIBRARIES \ uninstall-man uninstall-man1 uninstall-pkgconfigDATA \ uninstall-pkgdataDATA uninstall-pyexecLTLIBRARIES \ uninstall-zincludeHEADERS @HAVE_MAGICK_TRUE@check-local: @HAVE_MAGICK_TRUE@ $(PYTHON) $(srcdir)/test/barcodetest.py @HAVE_MAGICK_TRUE@regress: @HAVE_MAGICK_TRUE@ suite='$(ZBAR_TESTS)'; \ @HAVE_MAGICK_TRUE@ if test "x$$suite" = "x"; then suite='http://zbar.sf.net/test'; fi ; \ @HAVE_MAGICK_TRUE@ $(PYTHON) $(srcdir)/test/barcodetest.py $$suite @HAVE_GTK_TRUE@%.h: %.list @HAVE_GTK_TRUE@ $(GLIB_GENMARSHAL) --g-fatal-warnings --prefix=zbar_marshal \ @HAVE_GTK_TRUE@ --header $^ > $@ @HAVE_GTK_TRUE@%.c: %.list @HAVE_GTK_TRUE@ $(GLIB_GENMARSHAL) --g-fatal-warnings --prefix=zbar_marshal \ @HAVE_GTK_TRUE@ --body $^ > $@ # FIXME ugly hack to fixup new name... now non-standard? @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@pygtk/zbarpygtk.defs: include/zbar/zbargtk.h @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ $(PYTHON) $(PYGTK_H2DEF) $< | \ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ $(SED) -e 's/Z_TYPE_BAR_/ZBAR_TYPE_/' > $@ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@pygtk/%.c: pygtk/%.defs $(srcdir)/pygtk/zbarpygtk.override @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ $(PYGTK_CODEGEN) --prefix zbarpygtk \ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ --register $(PYGTK_DEFS)/gdk-types.defs \ @HAVE_GTK_TRUE@@HAVE_PYTHON_TRUE@ --override $(srcdir)/pygtk/zbarpygtk.override $< > $@ @HAVE_QT_TRUE@qt/moc_%.cpp: qt/%.h @HAVE_QT_TRUE@ $(MOC) $(qt_libzbarqt_la_CPPFLAGS) $< -o $@ @HAVE_QT_TRUE@qt/moc_%.cpp: include/zbar/%.h @HAVE_QT_TRUE@ $(MOC) $(qt_libzbarqt_la_CPPFLAGS) $< -o $@ @HAVE_QT_TRUE@test/moc_%.h: test/%.cpp @HAVE_QT_TRUE@ $(MOC) -i $(test_test_qt_CPPFLAGS) $< -o $@ docs: $(dist_man_MANS) #dist_doc_DATA .PHONY: docs #pdf: doc/zbar-manual.pdf #doc/zbar-manual.pdf: $(DOCSOURCES) # $(XMLTO) $(XMLTOFLAGS) -o doc pdf $< html-local: doc/html/index.html doc/html/index.html: $(DOCSOURCES) $(XMLTO) $(doc_path) $(XMLTOFLAGS) -o doc/html xhtml $< $(dist_man_MANS): $(man_stamp) @if test ! -f $@ ; then \ rm -f $(man_stamp) ; \ $(MAKE) $(AM_MAKEFLAGS) $(man_stamp) ; \ fi $(man_stamp): $(DOCSOURCES) @$(mkdir_p) doc/man 2>/dev/null @rm -f $(man_stamp).tmp @touch $(man_stamp).tmp $(XMLTO) $(doc_path) $(XMLTOFLAGS) -o doc/man man $< @mv $(man_stamp).tmp $(man_stamp) @WIN32_TRUE@%-rc.o: %.rc @WIN32_TRUE@ $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ @WIN32_TRUE@ $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $< @WIN32_TRUE@%-rc.lo: %.rc @WIN32_TRUE@ $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \ @WIN32_TRUE@ --mode=compile $(RC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ @WIN32_TRUE@ $(AM_CPPFLAGS) $(CPPFLAGS) -o $@ $< # install to tmp dest and run NSIS to generate installer @WIN32_TRUE@dist-nsis: html-local @WIN32_TRUE@ test ! -e _nsis || test -d _nsis && rm -rf _nsis @WIN32_TRUE@ mkdir _nsis @WIN32_TRUE@ tmpinst=`cd _nsis && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ @WIN32_TRUE@ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR=$$tmpinst prefix=/ install @WIN32_TRUE@ cp zbar/.libs/libzbar-0.dll.def _nsis/lib/libzbar-0.def @WIN32_TRUE@ cp -r doc/html _nsis/share/doc/zbar/ @WIN32_TRUE@ $(WINEXEC) lib.exe /machine:x86 /def:_nsis/lib/libzbar-0.def /out:_nsis/lib/libzbar-0.lib @WIN32_TRUE@ cd _nsis && \ @WIN32_TRUE@ makensis -NOCD -V2 -DVERSION=$(VERSION) $(abs_srcdir)/zbar.nsi @WIN32_TRUE@ @ls -l _nsis/zbar-$(VERSION)-setup.exe # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: zbar-0.10/ChangeLog0000644000000000000000000006076711270371414011051 00000000000000version 0.10: * attempt fix for Qt4 < 4.4 * release updates - fix perl Processor init without video * fix window closed notification during events - add read_one example, fix xs compiler warnings, update perl docs * add result query interfaces to image scanner and processor - move result filtering into image scanner (from user) - abort output blockers when window closed * Windows updates - update installer and README for distribution of dependency libraries - fix applications to use binary output for xml and raw modes * add regression tests to makefile * cleanup warnings from newer gcc versions * fix excessive i25 QZ checks * add regression script - add zbarimg xml output for every source (even empty) - add edge detection to svg debug overlay * image scanner cleanup and minor performance enhancements * bug hunt and stability improvements - fix broken processor locks - fix X connection polling, revert previous separate thread workaround - refuse to resize windows larger than screen size - fix window output scaling - preserve image aspect ratio, adjust overlay - fix window redraw - fix crash on Xv image creation failure (still need XImage fallback) - clean up zbarimg exit cases (last image window close, missing decodes) * always use separate video thread when threads enabled (even v4l2) * add configure check for features.h * overlay enhancements - add fps to overlay - add overlay control to processor - add windows overlay drawing * tweak linear code position info * trim deep qrcode hierarchy * fix zero length symbol data * fix QR structured append result handling * cleanup SVG debug dump (partial) - some QR integration API cleanup * extract explicit result container, separate from image - remove (broken/tmp) converted image result sharing - add explicit symbol recycle API, update processor/widgets to use - cleanup and update C++ API - update Python/Perl APIs - fix broken and add new Python/Perl tests * cleanup QR result integration - add hierarchy to symbol results - extract symbols during text decode, preserving position and structure - outline QR symbols in window overlay - tmp fix converted image result propagation * factor image scanner cache and apply to QR - fix image scanner handler called once per-image (vs every decode) * QZ and clustering fixes to QR integration - remove qr_finder QZ checks - decrease center clustering threshold from 1/3 to 1/5 of length - add img_scanner svg debug output - manually add config.rpath to workaround broken autofoo * finish initial integration of QR Code reader from maemo-barcode project * zbar-side updates for QR Code integration - add linear scanner position interface - add QR finder position feedback - integrate QR Code reader with img_scanner - refactor some symbol/image interaction - change default scanner density to 1 - add iconv to build infrastructure * initial hooks for QR Code, first pass at finder * fix broken builds with --disable-pthread version 0.9: * hotfix configure check for Wand as well as MagickWand (bug #2848437) * hotfix trim extraneous MagickWand calls (bug #2848445) * release updates * fix uninitialized member in Qt widget (bug #2844846) * move image conversion out of image scanner up to higher levels (preparation for library split) * add symbol quality metric and image scanner position config - update python, perl and docs * compatibility fixes - work around ImageMagick API breakages - fix some OS X compile issues * Qt widget cleanup - handle video device set before window attached - prevent exceptions from escaping event handlers * more Qt window creation hook fixes - NB may still cause problems if video is opened before window is visible * finish fix for Qt init ordering (bug #2844846) * potential fix for display init ordering (bug #2844846) - new workaround for filtering bad EAN results in the image scanner * more testing, fixes and cleanup - fix v4l1 - fix/add null processor interface * change default image scanner density to 1x1 - random cleanup, vfw hang, quit key - fix scan_image example MSVC project - windows installer tweaks * add zbarcam to windows installer * major restructuring to improve platform abstraction - add lock, thread and timer abstractions - migrate specific notification locks to platform independent layer - fixes to vfw capture interface - fix window format conversion issues - fix some broken configure checks - zbarcam working in windows! * fix symbol leaks (bug #2820658) - add symbol reference counting * add support for binary symbol data * initial VFW video support - mostly working with uvc driver, broken for others - factor out common video buffer handling - fix processor to destroy window *before* video (ref TODO) - use /dev/video* VFW pseudo-devices - windows configure skip non-windows checks - prep for platform refactoring * fix zbarimg b&w format handling * fix scan (image) boundary QZ handling (bug #2807538) - add linear scanner manual flush API - linear scanner always starts/ends w/a space of width 0 - remove artificial image scanner border - decoders special case 0 width space for QZ checks - add missing Code 128 leading QZ check * fix Code39 max ICS checks (bug #2807447) - add decoder lock owner tracking (debug) - update dbg_scan to match img_scanner * first pass installer - add version and icon resources for libzbar, zbarimg * zbarimg working in windows - switch to StretchDIBits over DrawDib - refactor some window drawing code to remove redundancies - make refcounts thread safe - clean up alloc/free bugs * convert zbarimg to C (cross compiled C++ cannot run w/native libraries) - fix DrawDib image width granularity - fix window resize dimensions to include decorations - images still inverted, otherwise zbarimg now "working" in windows * refactor processor implementation to support cross-platform - first pass windows processor (before debugging) - make processor locks reentrant (call APIs from callback) * initial Windows support for window interface - currently supports VFW DrawDib interface for image display (DirectDraw and others TBD) - also basic processor window creation/manipulation - Windows configure tests version 0.8: * release updates * add "raw" output option (without symbology prefix) to apps (req #2671863) * fix Code 39 min length and document min/max configs (bug #2787925) * fix zbar_image_free_data windows recursion loop (bug #2796277) * fix uninitialized decoder configs (bug #2800163) * switchover from subversion to mercurial version 0.7: * fix perl MANIFEST * release updates (version, NEWS, packaging) * adjust [py]gtk distributed files * draw new logo (rough, no Xrender yet) * fix Makefile.am syntax error * fixup some perl distribution details * project name change: everything "zebra" becomes "zbar" * remove old logo * add first pass python bindings! * fix perl mortality bug * add new cfg constants to perl * fix perl doc handler ref * fix processor set_active error propagation * add wiki examples (scan_image.*, processor.*) * add missing trailing quiet zone checks for ean and code39 * add min/max code length cfg/check for i25,code128,code39,pdf417 * add image scan density API/option * tweak option parser to be more strict/correct about abbreviations * add API to force specific video io modes (req #2293955) * apply patches for more broken driver workarounds (req #2293955) * fix(?) C++ string to fourcc conversion * add missing C++ wrappers * add additional examples to man pages (symbology enable/disable) * add missing options to man page synopsis * add missing --xml option to man pages version 0.6: * hotfix broken perl install (name change) * add missing files to distribution * release updates (version, NEWS, pacakging) * rename perl module to Barcode::Zebra (fit with existing cpan namespace) * add perl documentation and example * add v4l version debug/test override * add docs for new zebracam prescale option * add video pre-scaling API/option to video/processor/zebracam (req #2277340) * add few missing APIs to perl xs wrapper * fix missing libjpeg #ifdef in convert * initial support for decoding jpeg images using libjpeg! * workaround broken v4l2 drivers in USERPTR mode * have configure double check Magick++ install (bug #2582232) * update README dependency list * fix C++ warnings in Processor * fixes for building DLLs with libtool under MinGW * automatically remove "processor" layer if poll.h is unavailable * test_decode portability workarounds * add config/compile time symbology enables * add low-level PDF417 decode stage - converts widths to codewords * add XML output option to zebracam and zebraimg * add sequence number image attribute, set to frame number by video * change v4l2 interlaced only drivers to warning instead of hard fail * workaround broken drivers that return error for V4L2_FIELD_NONE request * add some initial PDF417 hooks * first pass perl bindings for Processor, Scanner and Decoder * fix error propagation double free bug * add missing APIs: processor userdata and image data length * fix configure check for v4l2 - thanks to Simon Matter for the patch! * finish support for UPC-E * fix zebraimg to scan all pages/frames of a multi-frame input * fix debian packaging dependencies (bug #2070164) * *remove* debian directory from distribution (bug #2070164) * fix inappropriately installed headers and man pages (bug #2055133) * fix pygtk multiple definition link errors on darwin (bug #2052681) * fixes to configure for detecting python settings (bug #2052663) * remove zebrapygtk module link against libpython (bug #2052663) * add drag and drop support for *images* to Qt widget...unfortunately not very useful; every application i tried drops uri-refs rather than images * minor reference documentation updates version 0.5: * release updates (version, NEWS, packaging) * add pkg-config files * update to latest libtool and new autoconf macros * cleanup library symbol exports * remove test programs using internal hooks * improve portability of some format specifiers * fix missing stub for --without-x - thanks to Simon Schmeisser for a patch! * fix --disable-pthread compile errors and warnings * fix XImage size mismatch background artifacts * fix new generated file distribution errors * switch Qt headers to old-style names (investigate possible Qt3 support?) * add independent ABI versioning for GTK and Qt widget libraries * reimplement widget internals to support image scanning and improve locking efficiency * add image scanning to widgets. including builtin conversions from toolkit image types: GtkPixbuf and QImage * add video opened hooks to widgets (improved use model) * add logo, used when there is nothing better to draw * add userdata to image object * fix image reuse cleanup bug * fix format specifiers in some error messages * enhance widget tests to support enable/disable and scan from image * fix broken deallocation assumptions in test_qt * widget API documentation (still need to hookup gtkdoc, and PyGtk docs) * API documentation toplevel overview * update configure summary for new features * replace all decoder assertions w/non-fatal debug spew (bug #1986478) * fix glib-genmarshal check * add first pass of Qt widget! - test/example in test/test_qt.cpp - factor video device scan to share among tests * more C++ integration fixes - additional Image ref tweaks - add Video.close() and Window.clear() APIs * fix missing image scanner handler call * add dereference operator to C++ Symbol * add count attribute to C++ Symbol * fix broken C++ header definitions * fix broken C++ Image references * expose internal reference counting interface * fix window locking bug * cleanup some minor memory leaks * convert Code 128 assertions to non-fatal warning spew * fix single buffer video hang (bug #1984543) * replace inferred video size assertion with warning message (bug #1984543) * add first pass of GTK widget! * add PyGTK widget wrapper * API change: modify window draw/redraw interface to improve interoperability with toolkits - add window locking for thread safety - zebra_window_draw() no longer actually "draws" anything => use window.draw to update the image from video thread then schedule window.redraw from toolkit GUI thread * fix missing C++ std lib dependencies * fix uninitialized handler/userdata bug in decoder * fix broken Code 128 checksum assertion * fix video destructor segfault * fix window destructor Xvideo errors (XID is unsigned...) * switch configure to use pkg-config to find most dependencies * API documentation updates version 0.4: * release updates (version, NEWS, packaging, examples) * couple of portability tweaks * finish format conversion resize cases * add missing conversions * fix some broken conversions * fix some broken redraw and Xv checks * add decoder configuration API - only boolean configs currently implemented - integrate config option parsing w/zebracam and zebraimg - add config to enable/disable each symbology type - add optional conversions from EAN-13 to UPC-A, ISBN-10 and ISBN-13 (disabled by default) - add config to emit/suppress check digit NB behavior change! check digit is now emitted by default * related documentation updates - split common options to a separate entity * fallback to gettimeofday when POSIX timers are not available * image format conversion fixes - fix format size roundoff (NB now rounds *down*) - add convert and resize API to pad/crop image to specific size (eg, to handle Xv min/max image size) NB this is still not implemented for many conversions * fix window deletion visibility inconsistency * add couple processor commands - 'q' to delete window - 'd' to dump displayed image for debug * remove problematic includes used for v4l2 configure test * address compiler portability concerns w/debug print vararg macro * workaround v4l1_set_format() failed consistency check for broken drivers - change from error to warning w/more useful message - calc expected image size using expected value instead of driver value * add missing example scripts to distribution * add missing files for Interleaved 2 of 5 * add support for Interleaved 2 of 5 symbology! - again no check digit option yet * increase decode window from 8 to 16 bars - remove Code 39 "extra bar" hack - add Code 39 quiet zone check - facilitate Interleaved 2 of 5 * optimize character width calculations for all symbologies * fix image scanner bug w/lost symbols at end of scan passes * fix EAN-8 buffer overrun case * add API doc footer * add API documentation generated by Doxygen - markup, cleanup and finish writing header comments - setup Doxygen config file * add/fix window GC * add base support for Code 39 (no check digit or full ASCII options yet) * cleanup decoder locking * add support for EAN-8! version 0.3: * add interface stub files * fix wait timeouts * fix XImage format filtering * fix several error handling corner cases * fix c++ error handling * add missing Window.h * add better hierarchy to library sources * build configuration fixes * portability fixes * packaging updates * fix zebracam beeps * fix some RGB component ordering and XImage format problems * fix window resize and redraw state problems * fix EAN testcase in test_decode - thanks to Steffen Kube for the patch! * add APIs and (hidden) zebracam options to force specific formats for debug * add example scripts * documentation updates * remove implementation of deprecated img_walker * add XImage formats - basic support for 16-bit depths * add some missing rgb format conversions * add basic overlay - currently only markers at detected scan locations (needs improved) * fix memory leak for converted images w/new cleanup semantics * migrate inter-frame consistency check from old zebracam into image_scanner - add API to enable/disable/flush result cache - add API to retrieve cache status from returned symbol * cleanup user_wait blocking semantics for various state combinations * fix bug w/v4l1 not unlinking dequeued image * major restructuring for improved modularity NB not all changes are are backward compatible! - modular support for v4l2 falling back to v4l1 - flexible support for more varied image formats (incomplete) - added reusable abstractions for: an "image" object and associated metadata, a "video" input object and a "window" output object - added new "processor" API to wrap everything together, simplifying trivial application usage (including zebracam and zebraimg) - removed deprecated "img_walker" interface, completely replaced by more integrated "image_scanner" (moving toward more image processing) - updated/added c++ APIs, including improved iterator interfaces * removed SDL dependency due to various usage incompatibilities (most notably the inability to embed video window into a widget) * cleaned up zebracam and zebraimg command line processing (bug #1838535) * many useful enhancements thanks to proposal by mhirsch45 (req #1759923) including: - v4l2 support - support for UYVY image format - zebracam cursor hiding - zebracam audio mute - command line video device specification, * significant error handling and debug improvements * some associated documentation updates * various new test programs (slowly working toward more formal test suite) * add missing xlink namespace to dbg_scan generated output (bug #1764188) * qualify char types as [un]signed to avoid non-portable C ambiguity - thanks to mhirsch45@users.sf.net and Colin Leroy for the patches! (bug #1759914) * add integrated 2D image scanning API - automatically ties to internal scanner and decoder - results reported via new symbol API - deprecated previous, cumbersome img_walker interface - uses new simpler/faster and denser grid pattern (FIXME add 45 and 135) - first step toward more sophisticated image processing * updated zebraimg to use new ImageScanner API - add initial decode location tracking * updated zebracam to use new img_scanner API - extended cache to track multiple symbols per-image - add initial decode location tracking - removed scan grid overlay * add configure check for ImageMagick version >= 6.3.0 * configure dumps ImageMagick, SDL and firefox versions for debug * add NPAPI plugin stub and build infrastructure * flush zebracam output after each scanned symbol * integrate RPM packaging spec file - thanks to V�t Hrachov� for the draft! (patch #1723536) * finally add HACKING to distribution/install (bug #1698202) * add extra documentation files to install (README NEWS INSTALL, etc) * Debian package patch for 0.2 - thanks to V�t Hrachov�: - add libsdl1.2-dev as a build dependency - update automake (>= 1:1.10) as a build dependency - new package version 0.2: * update distribution to include debian packaging * add consistency checking to zebracam * add redundant output suppression to zebraimg * fix couple of Code 128 decode table bugs * fix reversed Code 128 decode * add outstanding scanner edge flush to new_scan() - API change: scanner reset/new_scan() now return scan/decode status - update zebracam and zebraimg to call this between each walker pass (interface still needs improvement...) => improves in scan results for many cases * fix dbg_scan filename generation so results go in local directory * continue Code 128 refinement - finish character set C decode/expansion - add per-character validation - resolve scan direction in separate postprocessing pass before handling ASCII conversion - add several img_walker passes parallel to major axis (for long symbols) - add simple character set C example to test_decode * promote zebraimg images to TrueColor so colored scan pattern always shows * more dbg_scan tweaks * significant scanner improvements - changed "classic" [-1 0 1] first differential kernel to [-1 1] to improve minimum edge resolution to single pixel elements => still need to do some more research and validate assumptions - adaptive thresholding fixes - adjusted filtering for better edge detection - separate constants out to defines (FIXME add config API?) * fix EAN-13 secondary determinant decoding * dbg_scan tweaks to make annotations smaller/more usable * add get_color() interface to decoder * annotated zebraimg scan pattern for marginally useful high-level debug * random include cleanup * cleanup 64-bit compile warnings in zebraimg (bug #1712504) * add first-pass partial support for Code 128 - separate out more EAN state from shared state - internal interface changes - finish dynamic buffer management - add shared resource locking - add Code 128 to test_decode program => still needs additional functionality and plenty of debug => reading both Code 128 *and* EAN still destabilized * add diagnostic program test_video to dump more verbose video debug * incorporate documentation into Debian package - thanks to V�t Hrachov� for the patch! * fix VPATH doc builds (requires automake-1.10 and autoconf-2.61) * build and dist fixes - suppress documentation rebuilds in distributed sources * add Debian packaging sources - thanks to V�t Hrachov� for the patch! * add DocBook template and build infrastructure * add manpages for zebracam and zebraimg * add GNU standard options to zebracam and zebraimg * internal decoder restructuring to support additional symbologies - separated out 1-D decoder infrastructure into generic internal API - moved EAN/UPC specific decoding into it's own module * fix confusing configure behavior which quietly avoided building targets with missing dependencies(?!) configure will now fail with a descriptive error message if you do not have Magick++ and fail to specify --without-imagemagick or do not have SDL and fail to specify --without-sdl * add configure summary describing what will be built (req #1698196) * fix parity encoding in test_decode and add decoded symbol output * introduce Code 128 symbol type * increase width of zebra_symbol_type_t to 16 bits * add HACKING (bug #1698202) version 0.1: * add NEWS and ChangeLog * fix some config/build issues found on other boxes * add missing ImageWalker install * fix scanner runaway threshold calculation bug * fix zebracam/zebraimg bugs overwriting currently scanning image w/scan pattern * add c++ interface to img_walker * apply ImageWalker to zebraimg * add decoder soft reset on partial mismatch * finish basic decoder symbol assembly/reporting * add decoder symbol checksum verification * add callback API option to decoder for "async" symbol processing * add "image walker" library API to trace scan pattern over 2D images * apply image walker to zebracam (C++/zebraimg scan pattern still TBD) * add audio feedback to zebracam (still has long latency) * add zebracam key cmd to dump frame to file (for debugging) * fixes for decoder/scanner reset/new_scan * fixes to scanner initialization and algorithm tweaks * made decoder less sensitive to violated quiet-zone * apply zebraimg workaround for imagemagick image display bug * add string names for symbol types to library and API to access them * add dbg_scan test program for visually debugging image scanner (and decoder) * add test_walk for basic image walker sanity/debug * removed recursive makes in favor of monolithic build * renamed some makefiles accordingly * finished some final symbol data construction * added result callbacks to decoder APIs for data reporting * zebraimg hooks into callback * zebracam still seems to "hang" in undecodeable state? * populate svn with current sources. * most of the basic functionality is included and working. * still need to combine final decode data, finish addons, etc (see TODO). * c++ wrappers are included and tested, but API may need tweaked. * zebraimg and zebracam basically working but need cleanup/polish. * need to create some basic documentation... * initial repository layout zbar-0.10/zbar-gtk.pc.in0000644000000000000000000000044711270371414011736 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: zbar-gtk Description: bar code scanning and decoding GTK widget URL: http://zbar.sourceforge.net Version: @VERSION@ Requires: zbar, gtk+-2.0, gthread-2.0 Libs: -L${libdir} -lzbargtk Cflags: -I${includedir} zbar-0.10/test/0000777000000000000000000000000011270371535010326 500000000000000zbar-0.10/test/test_pygtk.py0000755000000000000000000001523711270371414013020 00000000000000#!/usr/bin/env python #------------------------------------------------------------------------ # Copyright 2008-2009 (c) Jeff Brown # # This file is part of the ZBar Bar Code Reader. # # The ZBar Bar Code Reader is free software; you can redistribute it # and/or modify it under the terms of the GNU Lesser Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # The ZBar Bar Code Reader is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser Public License for more details. # # You should have received a copy of the GNU Lesser Public License # along with the ZBar Bar Code Reader; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA # # http://sourceforge.net/projects/zbar #------------------------------------------------------------------------ import sys, os, stat import pygtk, gtk import zbarpygtk def decoded(zbar, data): """callback invoked when a barcode is decoded by the zbar widget. displays the decoded data in the text box """ buf = results.props.buffer end = buf.get_end_iter() buf.insert(end, data + "\n") results.scroll_to_iter(end, 0) def video_enabled(zbar, param): """callback invoked when the zbar widget enables or disables video streaming. updates the status button state to reflect the current video state """ enabled = zbar.get_video_enabled() if status_button.get_active() != enabled: status_button.set_active(enabled) def video_opened(zbar, param): """callback invoked when the zbar widget opens or closes a video device. also called when a device is closed due to error. updates the status button state to reflect the current video state """ opened = zbar.get_video_opened() status_button.set_sensitive(opened) set_status_label(opened, zbar.get_video_enabled()) def video_changed(widget): """callback invoked when a new video device is selected from the drop-down list. sets the new device for the zbar widget, which will eventually cause it to be opened and enabled """ dev = video_list.get_active_text() if dev[0] == '<': dev = '' zbar.set_video_device(dev) def status_button_toggled(button): """callback invoked when the status button changes state (interactively or programmatically). ensures the zbar widget video streaming state is consistent and updates the display of the button to represent the current state """ opened = zbar.get_video_opened() active = status_button.get_active() if opened and (active != zbar.get_video_enabled()): zbar.set_video_enabled(active) set_status_label(opened, active) if active: status_image.set_from_stock(gtk.STOCK_YES, gtk.ICON_SIZE_BUTTON) else: status_image.set_from_stock(gtk.STOCK_NO, gtk.ICON_SIZE_BUTTON) def open_button_clicked(button): """callback invoked when the 'Open' button is clicked. pops up an 'Open File' dialog which the user may use to select an image file. if the image is successfully opened, it is passed to the zbar widget which displays it and scans it for barcodes. results are returned using the same hook used to report video results """ dialog = gtk.FileChooserDialog("Open Image File", window, gtk.FILE_CHOOSER_ACTION_OPEN, (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL, gtk.STOCK_OPEN, gtk.RESPONSE_ACCEPT)) global open_file if open_file: dialog.set_filename(open_file) try: if dialog.run() == gtk.RESPONSE_ACCEPT: open_file = dialog.get_filename() pixbuf = gtk.gdk.pixbuf_new_from_file(open_file) if pixbuf: zbar.scan_image(pixbuf) finally: dialog.destroy() def set_status_label(opened, enabled): """update status button label to reflect indicated state.""" if not opened: label = "closed" elif enabled: label = "enabled" else: label = "disabled" status_button.set_label(label) open_file = None video_device = None if len(sys.argv) > 1: video_device = sys.argv[1] # threads *must* be properly initialized to use zbarpygtk gtk.gdk.threads_init() gtk.gdk.threads_enter() window = gtk.Window() window.set_title("test_pygtk") window.set_border_width(8) window.connect("destroy", gtk.main_quit) zbar = zbarpygtk.Gtk() zbar.connect("decoded-text", decoded) # video device list combo box video_list = gtk.combo_box_new_text() video_list.connect("changed", video_changed) # enable/disable status button status_button = gtk.ToggleButton("closed") status_image = gtk.image_new_from_stock(gtk.STOCK_NO, gtk.ICON_SIZE_BUTTON) status_button.set_image(status_image) status_button.set_sensitive(False) # bind status button state and video state status_button.connect("toggled", status_button_toggled) zbar.connect("notify::video-enabled", video_enabled) zbar.connect("notify::video-opened", video_opened) # open image file button open_button = gtk.Button(stock=gtk.STOCK_OPEN) open_button.connect("clicked", open_button_clicked) # populate video devices in combo box video_list.append_text("") video_list.set_active(0) for (root, dirs, files) in os.walk("/dev"): for dev in files: path = os.path.join(root, dev) if not os.access(path, os.F_OK): continue info = os.stat(path) if stat.S_ISCHR(info.st_mode) and os.major(info.st_rdev) == 81: video_list.append_text(path) if path == video_device: video_list.set_active(len(video_list.get_model()) - 1) video_device = None if video_device is not None: video_list.append_text(video_device) video_list.set_active(len(video_list.get_model()) - 1) video_device = None # combine combo box and buttons horizontally hbox = gtk.HBox(spacing=8) hbox.pack_start(video_list) hbox.pack_start(status_button, expand=False) hbox.pack_start(open_button, expand=False) # text box for holding results results = gtk.TextView() results.set_size_request(320, 64) results.props.editable = results.props.cursor_visible = False results.set_left_margin(4) # combine inputs, scanner, and results vertically vbox = gtk.VBox(spacing=8) vbox.pack_start(hbox, expand=False) vbox.pack_start(zbar) vbox.pack_start(results, expand=False) window.add(vbox) window.set_geometry_hints(zbar, min_width=320, min_height=240) window.show_all() gtk.main() gtk.gdk.threads_leave() zbar-0.10/test/scan_video.c0000644000000000000000000000570511270371414012523 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include typedef void (cb_t) (void *userdata, const char *device); static cb_t *add_dev; static void *userdata; static int idx; static const char *default_dev; static int default_idx; static int video_filter (const char *fpath, const struct stat *sb, int typeflag) { if(S_ISCHR(sb->st_mode) && (sb->st_rdev >> 8) == 81 && fpath) { int active = default_dev && !strcmp(default_dev, fpath); if(strncmp(fpath, "/dev/", 5)) { char abs[strlen(fpath) + 6]; strcpy(abs, "/dev/"); if(fpath[0] == '/') abs[4] = '\0'; strcat(abs, fpath); add_dev(userdata, abs); active |= default_dev && !strcmp(default_dev, abs); } else add_dev(userdata, fpath); if(active) { default_idx = idx + 1; default_dev = NULL; } idx++; } return(0); } /* scan /dev for v4l video devices and call add_device for each. * also looks for a specified "default" device (if not NULL) * if not found, the default will be appended to the list. * returns the index+1 of the default_device, or 0 if the default * was not specified. NB *not* reentrant */ int scan_video (cb_t add_device, void *_userdata, const char *default_device) { add_dev = add_device; userdata = _userdata; default_dev = default_device; idx = default_idx = 0; if(ftw("/dev", video_filter, 4)) { perror("search for video devices failed"); default_dev = NULL; default_idx = -1; } if(default_dev) { /* default not found in list, add explicitly */ add_dev(userdata, default_dev); default_idx = ++idx; default_dev = NULL; } add_dev = userdata = NULL; return(default_idx); } zbar-0.10/test/test_perl.pl0000755000000000000000000000263611270371414012606 00000000000000#!/usr/bin/env perl #------------------------------------------------------------------------ # Copyright 2008-2009 (c) Jeff Brown # # This file is part of the ZBar Bar Code Reader. # # The ZBar Bar Code Reader is free software; you can redistribute it # and/or modify it under the terms of the GNU Lesser Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # The ZBar Bar Code Reader is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser Public License for more details. # # You should have received a copy of the GNU Lesser Public License # along with the ZBar Bar Code Reader; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA # # http://sourceforge.net/projects/zbar #------------------------------------------------------------------------ use 5.006; use warnings; use strict; use Barcode::ZBar; Barcode::ZBar::set_verbosity(15); my $proc = Barcode::ZBar::Processor->new(1); $proc->init($ARGV[0] || '/dev/video0'); $proc->set_visible(); $proc->user_wait(2); $proc->set_active(); $proc->user_wait(5); $proc->set_active(0); $proc->user_wait(2); $proc->process_one(); $proc->user_wait(1); zbar-0.10/test/test_jpeg.c0000644000000000000000000001262611270371414012375 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #ifdef HAVE_INTTYPES_H # include #endif #include #include #include #include #include "test_images.h" unsigned char jpeg[405] = { 255, 216, 255, 224, 0, 16, 74, 70, 73, 70, 0, 1, 1, 1, 0, 72, 0, 72, 0, 0, 255, 219, 0, 67, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 255, 219, 0, 67, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 255, 192, 0, 17, 8, 0, 8, 0, 8, 3, 1, 17, 0, 2, 17, 1, 3, 17, 1, 255, 196, 0, 20, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 255, 196, 0, 32, 16, 0, 1, 2, 5, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 21, 20, 22, 0, 8, 18, 19, 24, 6, 23, 36, 37, 39, 255, 196, 0, 20, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 9, 255, 196, 0, 35, 17, 0, 2, 1, 1, 7, 5, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 20, 21, 19, 22, 0, 1, 7, 18, 23, 36, 38, 3, 4, 35, 37, 52, 255, 218, 0, 12, 3, 1, 0, 2, 17, 3, 17, 0, 63, 0, 118, 93, 56, 89, 200, 157, 68, 199, 111, 134, 71, 23, 12, 215, 215, 130, 197, 136, 103, 143, 117, 170, 97, 48, 42, 244, 202, 12, 216, 179, 211, 183, 29, 252, 24, 42, 160, 197, 45, 65, 146, 62, 181, 91, 48, 134, 52, 246, 76, 170, 151, 4, 42, 137, 198, 104, 56, 214, 96, 193, 7, 120, 197, 15, 154, 194, 128, 216, 207, 170, 114, 197, 220, 215, 36, 130, 123, 155, 219, 184, 172, 222, 150, 146, 23, 191, 47, 17, 204, 2, 197, 155, 246, 180, 206, 226, 223, 255, 217, }; unsigned char rgb[8*8*3] = { 255, 255, 255, 176, 238, 176, 94, 220, 94, 60, 213, 60, 60, 213, 60, 94, 220, 94, 176, 238, 176, 255, 255, 255, 176, 238, 176, 46, 210, 46, 10, 102, 10, 17, 204, 17, 17, 204, 17, 10, 102, 10, 46, 210, 46, 176, 238, 176, 94, 220, 94, 19, 204, 19, 9, 102, 9, 17, 204, 17, 17, 204, 17, 9, 102, 9, 19, 204, 19, 94, 220, 94, 60, 213, 60, 17, 204, 17, 9, 102, 9, 17, 204, 17, 17, 204, 17, 9, 102, 9, 17, 204, 17, 60, 213, 60, 60, 213, 60, 17, 204, 17, 17, 204, 17, 17, 204, 17, 17, 204, 17, 17, 204, 17, 17, 204, 17, 60, 213, 60, 94, 220, 94, 10, 102, 10, 17, 204, 17, 17, 204, 17, 17, 204, 17, 17, 204, 17, 10, 102, 10, 94, 220, 94, 176, 238, 176, 46, 210, 46, 10, 102, 10, 9, 102, 9, 9, 102, 9, 10, 102, 10, 46, 210, 46, 176, 238, 176, 255, 255, 255, 176, 238, 176, 94, 220, 94, 60, 213, 60, 60, 213, 60, 94, 220, 94, 176, 238, 176, 255, 255, 255, }; int main (int argc, char **argv) { zbar_set_verbosity(32); zbar_processor_t *proc = zbar_processor_create(0); assert(proc); if(zbar_processor_init(proc, NULL, 1)) return(2); zbar_image_t *img = zbar_image_create(); zbar_image_set_size(img, 8, 8); zbar_image_set_format(img, fourcc('J','P','E','G')); zbar_image_set_data(img, jpeg, sizeof(jpeg), NULL); zbar_image_t *test = zbar_image_convert(img, fourcc('Y','8','0','0')); if(!test) return(2); printf("converted: %d x %d (%lx) %08lx\n", zbar_image_get_width(test), zbar_image_get_height(test), zbar_image_get_data_length(test), zbar_image_get_format(test)); if(zbar_process_image(proc, test) < 0) return(3); if(zbar_processor_set_visible(proc, 1)) return(4); zbar_processor_user_wait(proc, -1); return(0); } zbar-0.10/test/barcodetest.py0000755000000000000000000002626711270371414013127 00000000000000#!/usr/bin/env python import sys, re, unittest as UT, xml.etree.ElementTree as ET from os import path, getcwd from errno import EISDIR, EINVAL, EACCES from StringIO import StringIO from subprocess import Popen, PIPE from urllib2 import urlopen, HTTPError from urlparse import urljoin, urlunparse from traceback import format_exception debug = False # program to run - None means we still need to search for it zbarimg = None # arguments to said program zbarimg_args = [ '-q', '--xml' ] # namespace support try: register_namespace = ET.register_namespace except AttributeError: def register_namespace(prefix, uri): ET._namespace_map[uri] = prefix # barcode results BC = 'http://zbar.sourceforge.net/2008/barcode' register_namespace('bc', BC) # testcase extensions TS = 'http://zbar.sourceforge.net/2009/test-spec' register_namespace('test', TS) # printing support def fixtag(node): return str(node.tag).split('}', 1)[-1] def toxml(node): s = StringIO() ET.ElementTree(node).write(s) return s.getvalue() def hexdump(data): print data for i, c in enumerate(data): if i & 0x7 == 0: print '[%04x]' % i, print ' %04x' % ord(c), if i & 0x7 == 0x7: print if len(c) & 0x7 != 0x7: print '\n' # search for a file in the distribution def distdir_search(subdir, base, suffixes=('',)): # start with current dir, # then try script invocation path rundir = path.dirname(sys.argv[0]) search = [ '', rundir ] # finally, attempt to follow VPATH if present try: import re makefile = open('Makefile') for line in makefile: if re.match('^VPATH\s*=', line): vpath = line.split('=', 1)[1].strip() if vpath and vpath != rundir: search.append(vpath) break except: pass # poke around for subdir subdirs = tuple((subdir, path.join('..', subdir), '..', '')) for prefix in search: for subdir in subdirs: for suffix in suffixes: file = path.realpath(path.join(prefix, subdir, base + suffix)) if path.isfile(file): return(file) return None def find_zbarimg(): """search for zbarimg program to run. """ global zbarimg # look in dist dir first zbarimg = distdir_search('zbarimg', 'zbarimg', ('', '.exe')) if not zbarimg: # fall back to PATH zbarimg = 'zbarimg' if debug: print 'using zbarimg from PATH' elif debug: print 'using:', zbarimg def run_zbarimg(images): """invoke zbarimg for the specified files. return results as an ET.Element """ args = [ zbarimg ] args.extend(zbarimg_args) args.extend(images) if debug: print 'running:', ' '.join(args) # FIXME should be able to pipe (feed) parser straight from output child = Popen(args, stdout = PIPE, stderr = PIPE) (xml, err) = child.communicate() rc = child.returncode if debug: print 'zbarimg returned', rc # FIXME trim usage from error msg assert rc in (0, 4), \ 'zbarimg returned error status (%d)\n' % rc + err result = ET.XML(xml) assert result.tag == ET.QName(BC, 'barcodes') return result class TestCase(UT.TestCase): """single barcode source test. must have source attribute set to an ET.Element representation of a bc:source tag before test is run. """ def shortDescription(self): return self.source.get('href') def setUp(self): if not zbarimg: find_zbarimg() def runTest(self): expect = self.source assert expect is not None assert expect.tag == ET.QName(BC, 'source') actual = run_zbarimg((expect.get('href'),)) self.assertEqual(len(actual), 1) try: compare_sources(expect, actual[0]) except AssertionError: if expect.get(str(ET.QName(TS, 'exception'))) != 'TODO': raise # ignore class BuiltinTestCase(TestCase): def __init__(self, methodName='runTest'): TestCase.__init__(self, methodName) href = distdir_search('examples', 'barcode.png') if not href: href = 'http://zbar.sf.net/test/barcode.png' self.source = src = ET.Element(ET.QName(BC, 'source'), href=href) sym = ET.SubElement(src, ET.QName(BC, 'symbol'), type='EAN-13') data = ET.SubElement(sym, ET.QName(BC, 'data')) data.text = '9876543210128' def compare_maps(expect, actual, compare_func): errors = [] notes = [] for key, iact in actual.iteritems(): iexp = expect.pop(key, None) if iexp is None: errors.append('bonus unexpected result:\n' + toxml(iact)) continue try: compare_func(iexp, iact) except: errors.append(''.join(format_exception(*sys.exc_info()))) if iexp.get(str(ET.QName(TS, 'exception'))) == 'TODO': notes.append('TODO unexpected result:\n' + toxml(iact)) for key, iexp in expect.iteritems(): if iexp.get(str(ET.QName(TS, 'exception'))) == 'TODO': notes.append('TODO missing expected result:\n' + toxml(iexp)) else: errors.append('missing expected result:\n' + toxml(iexp)) if len(notes) == 1: print >>sys.stderr, '(TODO)', elif notes: print >>sys.stderr, '(%d TODO)' % len(notes), assert not errors, '\n'.join(errors) def compare_sources(expect, actual): assert actual.tag == ET.QName(BC, 'source') assert actual.get('href').endswith(expect.get('href')), \ 'source href mismatch: %s != %s' % (acthref, exphref) # FIXME process/trim test:* contents def map_source(src): if not len(src) or src[0].tag != ET.QName(BC, 'index'): # insert artificial hierarchy syms = src[:] del src[:] idx = ET.SubElement(src, ET.QName(BC, 'index'), num='0') idx[:] = syms exc = src.get(str(ET.QName(TS, 'exception'))) if exc is not None: idx.set(str(ET.QName(TS, 'exception')), exc) return { '0': idx } elif len(src): assert src[0].tag != ET.QName(BC, 'symbol'), \ 'invalid source element: ' + \ 'expecting "index" or "symbol", got "%s"' % fixtag(src[0]) srcmap = { } for idx in src: srcmap[idx.get('num')] = idx return srcmap compare_maps(map_source(expect), map_source(actual), compare_indices) def compare_indices(expect, actual): assert actual.tag == ET.QName(BC, 'index') assert actual.get('num') == expect.get('num') # FIXME process/trim test:* contents def map_index(idx): idxmap = { } for sym in idx: assert sym.tag == ET.QName(BC, 'symbol') typ = sym.get('type') assert typ is not None data = sym.find(str(ET.QName(BC, 'data'))).text idxmap[typ, data] = sym return idxmap try: compare_maps(map_index(expect), map_index(actual), compare_symbols) except AssertionError: if expect.get(str(ET.QName(TS, 'exception'))) != 'TODO': raise def compare_symbols(expect, actual): pass # override unittest.TestLoader to populate tests from xml description class TestLoader: suiteClass = UT.TestSuite def __init__(self): self.cwd = urlunparse(('file', '', getcwd() + '/', '', '', '')) if debug: print 'cwd =', self.cwd def loadTestsFromModule(self, module): return self.suiteClass([BuiltinTestCase()]) def loadTestsFromNames(self, names, module=None): suites = [ self.loadTestsFromName(name, module) for name in names ] return self.suiteClass(suites) def loadTestsFromURL(self, url=None, file=None): if debug: print 'loading url:', url target = None if not file: if not url: return self.suiteClass([BuiltinTestCase()]) content = None url = urljoin(self.cwd, url) # FIXME grok fragment try: if debug: print 'trying:', url file = urlopen(url) content = file.info().get('Content-Type') except HTTPError, e: # possible remote directory pass except IOError, e: if e.errno not in (EISDIR, EINVAL, EACCES): raise # could be local directory if (not file or content == 'text/html' or (isinstance(file, HTTPError) and file.code != 200)): # could be directory, try opening index try: tmp = urljoin(url + '/', 'index.xml') if debug: print 'trying index:', tmp file = urlopen(tmp) content = file.info().get('Content-Type') url = tmp except IOError: raise IOError('no test index found at: %s' % url) if debug: print '\tContent-Type:', content if content not in ('application/xml', 'text/xml'): # assume url is image to test, try containing index # FIXME should be able to keep searching up try: target = url.rsplit('/', 1)[1] index = urljoin(url, 'index.xml') if debug: print 'trying index:', index file = urlopen(index) content = file.info().get('Content-Type') if debug: print '\tContent-Type:', content assert content in ('application/xml', 'text/xml') url = index except IOError: raise IOError('no index found for: %s' % url) index = ET.ElementTree(file=file).getroot() assert index.tag == ET.QName(BC, 'barcodes') suite = self.suiteClass() for src in index: # FIXME trim any meta info href = src.get('href') if target and target != href: continue if src.tag == ET.QName(BC, 'source'): test = TestCase() src.set('href', urljoin(url, href)) test.source = src suite.addTest(test) elif src.tag == ET.QName(TS, 'index'): suite.addTest(self.loadTestsFromURL(urljoin(url, href))) else: raise AssertionError('malformed test index') # FIXME detail assert suite.countTestCases(), 'empty test index: %s' % url return suite def loadTestsFromName(self, name=None, module=None): return self.loadTestsFromURL(name) def unsupported(self, *args, **kwargs): raise TypeError("unsupported TestLoader API") loadTestsFromTestCase = unsupported getTestCaseNames = unsupported if __name__ == '__main__': if '-d' in sys.argv: debug = True sys.argv.remove('-d') UT.main(module=None, testLoader=TestLoader()) zbar-0.10/test/test_convert.c0000644000000000000000000000336511270371414013130 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #include #include #include #include #include "test_images.h" #if 0 static uint32_t formats[] = { }; #endif int main (int argc, char *argv[]) { zbar_set_verbosity(10); uint32_t srcfmt = fourcc('I','4','2','0'); if(argc > 1) srcfmt = *(uint32_t*)argv[1]; zbar_image_t *img = zbar_image_create(); zbar_image_set_size(img, 640, 480); zbar_image_set_format(img, srcfmt); if(test_image_bars(img)) return(2); if(zbar_image_write(img, "base")) return(1); return(0); } zbar-0.10/test/pdf417_encode.h0000644000000000000000000014221611270371414012737 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _PDF417_ENCODE_H_ #define _PDF417_ENCODE_H_ unsigned long pdf417_encode[929][3] = { { 0x31111136, 0x51111125, 0x21111155, }, /* 0 */ { 0x41111144, 0x61111133, 0x31111163, }, /* 1 */ { 0x51111152, 0x41111216, 0x11111246, }, /* 2 */ { 0x31111235, 0x51111224, 0x21111254, }, /* 3 */ { 0x41111243, 0x61111232, 0x31111262, }, /* 4 */ { 0x51111251, 0x41111315, 0x11111345, }, /* 5 */ { 0x21111326, 0x51111323, 0x21111353, }, /* 6 */ { 0x31111334, 0x61111331, 0x31111361, }, /* 7 */ { 0x21111425, 0x41111414, 0x11111444, }, /* 8 */ { 0x11111516, 0x51111422, 0x21111452, }, /* 9 */ { 0x21111524, 0x41111513, 0x11111543, }, /* 10 */ { 0x11111615, 0x51111521, 0x61112114, }, /* 11 */ { 0x21112136, 0x41111612, 0x11112155, }, /* 12 */ { 0x31112144, 0x41112125, 0x21112163, }, /* 13 */ { 0x41112152, 0x51112133, 0x61112213, }, /* 14 */ { 0x21112235, 0x61112141, 0x11112254, }, /* 15 */ { 0x31112243, 0x31112216, 0x21112262, }, /* 16 */ { 0x41112251, 0x41112224, 0x61112312, }, /* 17 */ { 0x11112326, 0x51112232, 0x11112353, }, /* 18 */ { 0x21112334, 0x31112315, 0x21112361, }, /* 19 */ { 0x11112425, 0x41112323, 0x61112411, }, /* 20 */ { 0x11113136, 0x51112331, 0x11112452, }, /* 21 */ { 0x21113144, 0x31112414, 0x51113114, }, /* 22 */ { 0x31113152, 0x41112422, 0x61113122, }, /* 23 */ { 0x11113235, 0x31112513, 0x11113163, }, /* 24 */ { 0x21113243, 0x41112521, 0x51113213, }, /* 25 */ { 0x31113251, 0x31112612, 0x61113221, }, /* 26 */ { 0x11113334, 0x31113125, 0x11113262, }, /* 27 */ { 0x21113342, 0x41113133, 0x51113312, }, /* 28 */ { 0x11114144, 0x51113141, 0x11113361, }, /* 29 */ { 0x21114152, 0x21113216, 0x51113411, }, /* 30 */ { 0x11114243, 0x31113224, 0x41114114, }, /* 31 */ { 0x21114251, 0x41113232, 0x51114122, }, /* 32 */ { 0x11115152, 0x21113315, 0x41114213, }, /* 33 */ { 0x51116111, 0x31113323, 0x51114221, }, /* 34 */ { 0x31121135, 0x41113331, 0x41114312, }, /* 35 */ { 0x41121143, 0x21113414, 0x41114411, }, /* 36 */ { 0x51121151, 0x31113422, 0x31115114, }, /* 37 */ { 0x21121226, 0x21113513, 0x41115122, }, /* 38 */ { 0x31121234, 0x31113521, 0x31115213, }, /* 39 */ { 0x41121242, 0x21113612, 0x41115221, }, /* 40 */ { 0x21121325, 0x21114125, 0x31115312, }, /* 41 */ { 0x31121333, 0x31114133, 0x31115411, }, /* 42 */ { 0x11121416, 0x41114141, 0x21116114, }, /* 43 */ { 0x21121424, 0x11114216, 0x31116122, }, /* 44 */ { 0x31121432, 0x21114224, 0x21116213, }, /* 45 */ { 0x11121515, 0x31114232, 0x31116221, }, /* 46 */ { 0x21121523, 0x11114315, 0x21116312, }, /* 47 */ { 0x11121614, 0x21114323, 0x11121146, }, /* 48 */ { 0x21122135, 0x31114331, 0x21121154, }, /* 49 */ { 0x31122143, 0x11114414, 0x31121162, }, /* 50 */ { 0x41122151, 0x21114422, 0x11121245, }, /* 51 */ { 0x11122226, 0x11114513, 0x21121253, }, /* 52 */ { 0x21122234, 0x21114521, 0x31121261, }, /* 53 */ { 0x31122242, 0x11115125, 0x11121344, }, /* 54 */ { 0x11122325, 0x21115133, 0x21121352, }, /* 55 */ { 0x21122333, 0x31115141, 0x11121443, }, /* 56 */ { 0x31122341, 0x11115224, 0x21121451, }, /* 57 */ { 0x11122424, 0x21115232, 0x11121542, }, /* 58 */ { 0x21122432, 0x11115323, 0x61122113, }, /* 59 */ { 0x11123135, 0x21115331, 0x11122154, }, /* 60 */ { 0x21123143, 0x11115422, 0x21122162, }, /* 61 */ { 0x31123151, 0x11116133, 0x61122212, }, /* 62 */ { 0x11123234, 0x21116141, 0x11122253, }, /* 63 */ { 0x21123242, 0x11116232, 0x21122261, }, /* 64 */ { 0x11123333, 0x11116331, 0x61122311, }, /* 65 */ { 0x21123341, 0x41121116, 0x11122352, }, /* 66 */ { 0x11124143, 0x51121124, 0x11122451, }, /* 67 */ { 0x21124151, 0x61121132, 0x51123113, }, /* 68 */ { 0x11124242, 0x41121215, 0x61123121, }, /* 69 */ { 0x11124341, 0x51121223, 0x11123162, }, /* 70 */ { 0x21131126, 0x61121231, 0x51123212, }, /* 71 */ { 0x31131134, 0x41121314, 0x11123261, }, /* 72 */ { 0x41131142, 0x51121322, 0x51123311, }, /* 73 */ { 0x21131225, 0x41121413, 0x41124113, }, /* 74 */ { 0x31131233, 0x51121421, 0x51124121, }, /* 75 */ { 0x41131241, 0x41121512, 0x41124212, }, /* 76 */ { 0x11131316, 0x41121611, 0x41124311, }, /* 77 */ { 0x21131324, 0x31122116, 0x31125113, }, /* 78 */ { 0x31131332, 0x41122124, 0x41125121, }, /* 79 */ { 0x11131415, 0x51122132, 0x31125212, }, /* 80 */ { 0x21131423, 0x31122215, 0x31125311, }, /* 81 */ { 0x11131514, 0x41122223, 0x21126113, }, /* 82 */ { 0x11131613, 0x51122231, 0x31126121, }, /* 83 */ { 0x11132126, 0x31122314, 0x21126212, }, /* 84 */ { 0x21132134, 0x41122322, 0x21126311, }, /* 85 */ { 0x31132142, 0x31122413, 0x11131145, }, /* 86 */ { 0x11132225, 0x41122421, 0x21131153, }, /* 87 */ { 0x21132233, 0x31122512, 0x31131161, }, /* 88 */ { 0x31132241, 0x31122611, 0x11131244, }, /* 89 */ { 0x11132324, 0x21123116, 0x21131252, }, /* 90 */ { 0x21132332, 0x31123124, 0x11131343, }, /* 91 */ { 0x11132423, 0x41123132, 0x21131351, }, /* 92 */ { 0x11132522, 0x21123215, 0x11131442, }, /* 93 */ { 0x11133134, 0x31123223, 0x11131541, }, /* 94 */ { 0x21133142, 0x41123231, 0x61132112, }, /* 95 */ { 0x11133233, 0x21123314, 0x11132153, }, /* 96 */ { 0x21133241, 0x31123322, 0x21132161, }, /* 97 */ { 0x11133332, 0x21123413, 0x61132211, }, /* 98 */ { 0x11134142, 0x31123421, 0x11132252, }, /* 99 */ { 0x21141125, 0x21123512, 0x11132351, }, /* 100 */ { 0x31141133, 0x21123611, 0x51133112, }, /* 101 */ { 0x41141141, 0x11124116, 0x11133161, }, /* 102 */ { 0x11141216, 0x21124124, 0x51133211, }, /* 103 */ { 0x21141224, 0x31124132, 0x41134112, }, /* 104 */ { 0x31141232, 0x11124215, 0x41134211, }, /* 105 */ { 0x11141315, 0x21124223, 0x31135112, }, /* 106 */ { 0x21141323, 0x31124231, 0x31135211, }, /* 107 */ { 0x31141331, 0x11124314, 0x21136112, }, /* 108 */ { 0x11141414, 0x21124322, 0x21136211, }, /* 109 */ { 0x21141422, 0x11124413, 0x11141144, }, /* 110 */ { 0x11141513, 0x21124421, 0x21141152, }, /* 111 */ { 0x21141521, 0x11124512, 0x11141243, }, /* 112 */ { 0x11142125, 0x11125124, 0x21141251, }, /* 113 */ { 0x21142133, 0x21125132, 0x11141342, }, /* 114 */ { 0x31142141, 0x11125223, 0x11141441, }, /* 115 */ { 0x11142224, 0x21125231, 0x61142111, }, /* 116 */ { 0x21142232, 0x11125322, 0x11142152, }, /* 117 */ { 0x11142323, 0x11125421, 0x11142251, }, /* 118 */ { 0x21142331, 0x11126132, 0x51143111, }, /* 119 */ { 0x11142422, 0x11126231, 0x41144111, }, /* 120 */ { 0x11142521, 0x41131115, 0x31145111, }, /* 121 */ { 0x21143141, 0x51131123, 0x11151143, }, /* 122 */ { 0x11143331, 0x61131131, 0x21151151, }, /* 123 */ { 0x11151116, 0x41131214, 0x11151242, }, /* 124 */ { 0x21151124, 0x51131222, 0x11151341, }, /* 125 */ { 0x31151132, 0x41131313, 0x11152151, }, /* 126 */ { 0x11151215, 0x51131321, 0x11161142, }, /* 127 */ { 0x21151223, 0x41131412, 0x11161241, }, /* 128 */ { 0x31151231, 0x41131511, 0x12111146, }, /* 129 */ { 0x11151314, 0x31132115, 0x22111154, }, /* 130 */ { 0x21151322, 0x41132123, 0x32111162, }, /* 131 */ { 0x11151413, 0x51132131, 0x12111245, }, /* 132 */ { 0x21151421, 0x31132214, 0x22111253, }, /* 133 */ { 0x11151512, 0x41132222, 0x32111261, }, /* 134 */ { 0x11152124, 0x31132313, 0x12111344, }, /* 135 */ { 0x11152223, 0x41132321, 0x22111352, }, /* 136 */ { 0x11152322, 0x31132412, 0x12111443, }, /* 137 */ { 0x11161115, 0x31132511, 0x22111451, }, /* 138 */ { 0x31161131, 0x21133115, 0x12111542, }, /* 139 */ { 0x21161222, 0x31133123, 0x62112113, }, /* 140 */ { 0x21161321, 0x41133131, 0x12112154, }, /* 141 */ { 0x11161511, 0x21133214, 0x22112162, }, /* 142 */ { 0x32111135, 0x31133222, 0x62112212, }, /* 143 */ { 0x42111143, 0x21133313, 0x12112253, }, /* 144 */ { 0x52111151, 0x31133321, 0x22112261, }, /* 145 */ { 0x22111226, 0x21133412, 0x62112311, }, /* 146 */ { 0x32111234, 0x21133511, 0x12112352, }, /* 147 */ { 0x42111242, 0x11134115, 0x12112451, }, /* 148 */ { 0x22111325, 0x21134123, 0x52113113, }, /* 149 */ { 0x32111333, 0x31134131, 0x62113121, }, /* 150 */ { 0x42111341, 0x11134214, 0x12113162, }, /* 151 */ { 0x12111416, 0x21134222, 0x52113212, }, /* 152 */ { 0x22111424, 0x11134313, 0x12113261, }, /* 153 */ { 0x12111515, 0x21134321, 0x52113311, }, /* 154 */ { 0x22112135, 0x11134412, 0x42114113, }, /* 155 */ { 0x32112143, 0x11134511, 0x52114121, }, /* 156 */ { 0x42112151, 0x11135123, 0x42114212, }, /* 157 */ { 0x12112226, 0x21135131, 0x42114311, }, /* 158 */ { 0x22112234, 0x11135222, 0x32115113, }, /* 159 */ { 0x32112242, 0x11135321, 0x42115121, }, /* 160 */ { 0x12112325, 0x11136131, 0x32115212, }, /* 161 */ { 0x22112333, 0x41141114, 0x32115311, }, /* 162 */ { 0x12112424, 0x51141122, 0x22116113, }, /* 163 */ { 0x12112523, 0x41141213, 0x32116121, }, /* 164 */ { 0x12113135, 0x51141221, 0x22116212, }, /* 165 */ { 0x22113143, 0x41141312, 0x22116311, }, /* 166 */ { 0x32113151, 0x41141411, 0x21211145, }, /* 167 */ { 0x12113234, 0x31142114, 0x31211153, }, /* 168 */ { 0x22113242, 0x41142122, 0x41211161, }, /* 169 */ { 0x12113333, 0x31142213, 0x11211236, }, /* 170 */ { 0x12113432, 0x41142221, 0x21211244, }, /* 171 */ { 0x12114143, 0x31142312, 0x31211252, }, /* 172 */ { 0x22114151, 0x31142411, 0x11211335, }, /* 173 */ { 0x12114242, 0x21143114, 0x21211343, }, /* 174 */ { 0x12115151, 0x31143122, 0x31211351, }, /* 175 */ { 0x31211126, 0x21143213, 0x11211434, }, /* 176 */ { 0x41211134, 0x31143221, 0x21211442, }, /* 177 */ { 0x51211142, 0x21143312, 0x11211533, }, /* 178 */ { 0x31211225, 0x21143411, 0x21211541, }, /* 179 */ { 0x41211233, 0x11144114, 0x11211632, }, /* 180 */ { 0x51211241, 0x21144122, 0x12121145, }, /* 181 */ { 0x21211316, 0x11144213, 0x22121153, }, /* 182 */ { 0x31211324, 0x21144221, 0x32121161, }, /* 183 */ { 0x41211332, 0x11144312, 0x11212145, }, /* 184 */ { 0x21211415, 0x11144411, 0x12121244, }, /* 185 */ { 0x31211423, 0x11145122, 0x22121252, }, /* 186 */ { 0x41211431, 0x11145221, 0x11212244, }, /* 187 */ { 0x21211514, 0x41151113, 0x21212252, }, /* 188 */ { 0x31211522, 0x51151121, 0x22121351, }, /* 189 */ { 0x22121126, 0x41151212, 0x11212343, }, /* 190 */ { 0x32121134, 0x41151311, 0x12121442, }, /* 191 */ { 0x42121142, 0x31152113, 0x11212442, }, /* 192 */ { 0x21212126, 0x41152121, 0x12121541, }, /* 193 */ { 0x22121225, 0x31152212, 0x11212541, }, /* 194 */ { 0x32121233, 0x31152311, 0x62122112, }, /* 195 */ { 0x42121241, 0x21153113, 0x12122153, }, /* 196 */ { 0x21212225, 0x31153121, 0x22122161, }, /* 197 */ { 0x31212233, 0x21153212, 0x61213112, }, /* 198 */ { 0x41212241, 0x21153311, 0x62122211, }, /* 199 */ { 0x11212316, 0x11154113, 0x11213153, }, /* 200 */ { 0x12121415, 0x21154121, 0x12122252, }, /* 201 */ { 0x22121423, 0x11154212, 0x61213211, }, /* 202 */ { 0x32121431, 0x11154311, 0x11213252, }, /* 203 */ { 0x11212415, 0x41161112, 0x12122351, }, /* 204 */ { 0x21212423, 0x41161211, 0x11213351, }, /* 205 */ { 0x11212514, 0x31162112, 0x52123112, }, /* 206 */ { 0x12122126, 0x31162211, 0x12123161, }, /* 207 */ { 0x22122134, 0x21163112, 0x51214112, }, /* 208 */ { 0x32122142, 0x21163211, 0x52123211, }, /* 209 */ { 0x11213126, 0x42111116, 0x11214161, }, /* 210 */ { 0x12122225, 0x52111124, 0x51214211, }, /* 211 */ { 0x22122233, 0x62111132, 0x42124112, }, /* 212 */ { 0x32122241, 0x42111215, 0x41215112, }, /* 213 */ { 0x11213225, 0x52111223, 0x42124211, }, /* 214 */ { 0x21213233, 0x62111231, 0x41215211, }, /* 215 */ { 0x31213241, 0x42111314, 0x32125112, }, /* 216 */ { 0x11213324, 0x52111322, 0x31216112, }, /* 217 */ { 0x12122423, 0x42111413, 0x32125211, }, /* 218 */ { 0x11213423, 0x52111421, 0x31216211, }, /* 219 */ { 0x12123134, 0x42111512, 0x22126112, }, /* 220 */ { 0x22123142, 0x42111611, 0x22126211, }, /* 221 */ { 0x11214134, 0x32112116, 0x11221136, }, /* 222 */ { 0x12123233, 0x42112124, 0x21221144, }, /* 223 */ { 0x22123241, 0x52112132, 0x31221152, }, /* 224 */ { 0x11214233, 0x32112215, 0x11221235, }, /* 225 */ { 0x21214241, 0x42112223, 0x21221243, }, /* 226 */ { 0x11214332, 0x52112231, 0x31221251, }, /* 227 */ { 0x12124142, 0x32112314, 0x11221334, }, /* 228 */ { 0x11215142, 0x42112322, 0x21221342, }, /* 229 */ { 0x12124241, 0x32112413, 0x11221433, }, /* 230 */ { 0x11215241, 0x42112421, 0x21221441, }, /* 231 */ { 0x31221125, 0x32112512, 0x11221532, }, /* 232 */ { 0x41221133, 0x32112611, 0x11221631, }, /* 233 */ { 0x51221141, 0x22113116, 0x12131144, }, /* 234 */ { 0x21221216, 0x32113124, 0x22131152, }, /* 235 */ { 0x31221224, 0x42113132, 0x11222144, }, /* 236 */ { 0x41221232, 0x22113215, 0x12131243, }, /* 237 */ { 0x21221315, 0x32113223, 0x22131251, }, /* 238 */ { 0x31221323, 0x42113231, 0x11222243, }, /* 239 */ { 0x41221331, 0x22113314, 0x21222251, }, /* 240 */ { 0x21221414, 0x32113322, 0x11222342, }, /* 241 */ { 0x31221422, 0x22113413, 0x12131441, }, /* 242 */ { 0x21221513, 0x32113421, 0x11222441, }, /* 243 */ { 0x21221612, 0x22113512, 0x62132111, }, /* 244 */ { 0x22131125, 0x22113611, 0x12132152, }, /* 245 */ { 0x32131133, 0x12114116, 0x61223111, }, /* 246 */ { 0x42131141, 0x22114124, 0x11223152, }, /* 247 */ { 0x21222125, 0x32114132, 0x12132251, }, /* 248 */ { 0x22131224, 0x12114215, 0x11223251, }, /* 249 */ { 0x32131232, 0x22114223, 0x52133111, }, /* 250 */ { 0x11222216, 0x32114231, 0x51224111, }, /* 251 */ { 0x12131315, 0x12114314, 0x42134111, }, /* 252 */ { 0x31222232, 0x22114322, 0x41225111, }, /* 253 */ { 0x32131331, 0x12114413, 0x32135111, }, /* 254 */ { 0x11222315, 0x22114421, 0x31226111, }, /* 255 */ { 0x12131414, 0x12114512, 0x22136111, }, /* 256 */ { 0x22131422, 0x12115124, 0x11231135, }, /* 257 */ { 0x11222414, 0x22115132, 0x21231143, }, /* 258 */ { 0x21222422, 0x12115223, 0x31231151, }, /* 259 */ { 0x22131521, 0x22115231, 0x11231234, }, /* 260 */ { 0x12131612, 0x12115322, 0x21231242, }, /* 261 */ { 0x12132125, 0x12115421, 0x11231333, }, /* 262 */ { 0x22132133, 0x12116132, 0x21231341, }, /* 263 */ { 0x32132141, 0x12116231, 0x11231432, }, /* 264 */ { 0x11223125, 0x51211115, 0x11231531, }, /* 265 */ { 0x12132224, 0x61211123, 0x12141143, }, /* 266 */ { 0x22132232, 0x11211164, 0x22141151, }, /* 267 */ { 0x11223224, 0x51211214, 0x11232143, }, /* 268 */ { 0x21223232, 0x61211222, 0x12141242, }, /* 269 */ { 0x22132331, 0x11211263, 0x11232242, }, /* 270 */ { 0x11223323, 0x51211313, 0x12141341, }, /* 271 */ { 0x12132422, 0x61211321, 0x11232341, }, /* 272 */ { 0x12132521, 0x11211362, 0x12142151, }, /* 273 */ { 0x12133133, 0x51211412, 0x11233151, }, /* 274 */ { 0x22133141, 0x51211511, 0x11241134, }, /* 275 */ { 0x11224133, 0x42121115, 0x21241142, }, /* 276 */ { 0x12133232, 0x52121123, 0x11241233, }, /* 277 */ { 0x11224232, 0x62121131, 0x21241241, }, /* 278 */ { 0x12133331, 0x41212115, 0x11241332, }, /* 279 */ { 0x11224331, 0x42121214, 0x11241431, }, /* 280 */ { 0x11225141, 0x61212131, 0x12151142, }, /* 281 */ { 0x21231116, 0x41212214, 0x11242142, }, /* 282 */ { 0x31231124, 0x51212222, 0x12151241, }, /* 283 */ { 0x41231132, 0x52121321, 0x11242241, }, /* 284 */ { 0x21231215, 0x41212313, 0x11251133, }, /* 285 */ { 0x31231223, 0x42121412, 0x21251141, }, /* 286 */ { 0x41231231, 0x41212412, 0x11251232, }, /* 287 */ { 0x21231314, 0x42121511, 0x11251331, }, /* 288 */ { 0x31231322, 0x41212511, 0x12161141, }, /* 289 */ { 0x21231413, 0x32122115, 0x11252141, }, /* 290 */ { 0x31231421, 0x42122123, 0x11261132, }, /* 291 */ { 0x21231512, 0x52122131, 0x11261231, }, /* 292 */ { 0x21231611, 0x31213115, 0x13111145, }, /* 293 */ { 0x12141116, 0x32122214, 0x23111153, }, /* 294 */ { 0x22141124, 0x42122222, 0x33111161, }, /* 295 */ { 0x32141132, 0x31213214, 0x13111244, }, /* 296 */ { 0x11232116, 0x41213222, 0x23111252, }, /* 297 */ { 0x12141215, 0x42122321, 0x13111343, }, /* 298 */ { 0x22141223, 0x31213313, 0x23111351, }, /* 299 */ { 0x32141231, 0x32122412, 0x13111442, }, /* 300 */ { 0x11232215, 0x31213412, 0x13111541, }, /* 301 */ { 0x21232223, 0x32122511, 0x63112112, }, /* 302 */ { 0x31232231, 0x31213511, 0x13112153, }, /* 303 */ { 0x11232314, 0x22123115, 0x23112161, }, /* 304 */ { 0x12141413, 0x32123123, 0x63112211, }, /* 305 */ { 0x22141421, 0x42123131, 0x13112252, }, /* 306 */ { 0x11232413, 0x21214115, 0x13112351, }, /* 307 */ { 0x21232421, 0x22123214, 0x53113112, }, /* 308 */ { 0x11232512, 0x32123222, 0x13113161, }, /* 309 */ { 0x12142124, 0x21214214, 0x53113211, }, /* 310 */ { 0x22142132, 0x31214222, 0x43114112, }, /* 311 */ { 0x11233124, 0x32123321, 0x43114211, }, /* 312 */ { 0x12142223, 0x21214313, 0x33115112, }, /* 313 */ { 0x22142231, 0x22123412, 0x33115211, }, /* 314 */ { 0x11233223, 0x21214412, 0x23116112, }, /* 315 */ { 0x21233231, 0x22123511, 0x23116211, }, /* 316 */ { 0x11233322, 0x21214511, 0x12211136, }, /* 317 */ { 0x12142421, 0x12124115, 0x22211144, }, /* 318 */ { 0x11233421, 0x22124123, 0x32211152, }, /* 319 */ { 0x11234132, 0x32124131, 0x12211235, }, /* 320 */ { 0x11234231, 0x11215115, 0x22211243, }, /* 321 */ { 0x21241115, 0x12124214, 0x32211251, }, /* 322 */ { 0x31241123, 0x22124222, 0x12211334, }, /* 323 */ { 0x41241131, 0x11215214, 0x22211342, }, /* 324 */ { 0x21241214, 0x21215222, 0x12211433, }, /* 325 */ { 0x31241222, 0x22124321, 0x22211441, }, /* 326 */ { 0x21241313, 0x11215313, 0x12211532, }, /* 327 */ { 0x31241321, 0x12124412, 0x12211631, }, /* 328 */ { 0x21241412, 0x11215412, 0x13121144, }, /* 329 */ { 0x21241511, 0x12124511, 0x23121152, }, /* 330 */ { 0x12151115, 0x12125123, 0x12212144, }, /* 331 */ { 0x22151123, 0x22125131, 0x13121243, }, /* 332 */ { 0x32151131, 0x11216123, 0x23121251, }, /* 333 */ { 0x11242115, 0x12125222, 0x12212243, }, /* 334 */ { 0x12151214, 0x11216222, 0x22212251, }, /* 335 */ { 0x22151222, 0x12125321, 0x12212342, }, /* 336 */ { 0x11242214, 0x11216321, 0x13121441, }, /* 337 */ { 0x21242222, 0x12126131, 0x12212441, }, /* 338 */ { 0x22151321, 0x51221114, 0x63122111, }, /* 339 */ { 0x11242313, 0x61221122, 0x13122152, }, /* 340 */ { 0x12151412, 0x11221163, 0x62213111, }, /* 341 */ { 0x11242412, 0x51221213, 0x12213152, }, /* 342 */ { 0x12151511, 0x61221221, 0x13122251, }, /* 343 */ { 0x12152123, 0x11221262, 0x12213251, }, /* 344 */ { 0x11243123, 0x51221312, 0x53123111, }, /* 345 */ { 0x11243222, 0x11221361, 0x52214111, }, /* 346 */ { 0x11243321, 0x51221411, 0x43124111, }, /* 347 */ { 0x31251122, 0x42131114, 0x42215111, }, /* 348 */ { 0x31251221, 0x52131122, 0x33125111, }, /* 349 */ { 0x21251411, 0x41222114, 0x32216111, }, /* 350 */ { 0x22161122, 0x42131213, 0x23126111, }, /* 351 */ { 0x12161213, 0x52131221, 0x21311135, }, /* 352 */ { 0x11252213, 0x41222213, 0x31311143, }, /* 353 */ { 0x11252312, 0x51222221, 0x41311151, }, /* 354 */ { 0x11252411, 0x41222312, 0x11311226, }, /* 355 */ { 0x23111126, 0x42131411, 0x21311234, }, /* 356 */ { 0x33111134, 0x41222411, 0x31311242, }, /* 357 */ { 0x43111142, 0x32132114, 0x11311325, }, /* 358 */ { 0x23111225, 0x42132122, 0x21311333, }, /* 359 */ { 0x33111233, 0x31223114, 0x31311341, }, /* 360 */ { 0x13111316, 0x32132213, 0x11311424, }, /* 361 */ { 0x23111324, 0x42132221, 0x21311432, }, /* 362 */ { 0x33111332, 0x31223213, 0x11311523, }, /* 363 */ { 0x13111415, 0x41223221, 0x21311531, }, /* 364 */ { 0x23111423, 0x31223312, 0x11311622, }, /* 365 */ { 0x13111514, 0x32132411, 0x12221135, }, /* 366 */ { 0x13111613, 0x31223411, 0x22221143, }, /* 367 */ { 0x13112126, 0x22133114, 0x32221151, }, /* 368 */ { 0x23112134, 0x32133122, 0x11312135, }, /* 369 */ { 0x33112142, 0x21224114, 0x12221234, }, /* 370 */ { 0x13112225, 0x22133213, 0x22221242, }, /* 371 */ { 0x23112233, 0x32133221, 0x11312234, }, /* 372 */ { 0x33112241, 0x21224213, 0x21312242, }, /* 373 */ { 0x13112324, 0x31224221, 0x22221341, }, /* 374 */ { 0x23112332, 0x21224312, 0x11312333, }, /* 375 */ { 0x13112423, 0x22133411, 0x12221432, }, /* 376 */ { 0x13112522, 0x21224411, 0x11312432, }, /* 377 */ { 0x13113134, 0x12134114, 0x12221531, }, /* 378 */ { 0x23113142, 0x22134122, 0x11312531, }, /* 379 */ { 0x13113233, 0x11225114, 0x13131143, }, /* 380 */ { 0x23113241, 0x12134213, 0x23131151, }, /* 381 */ { 0x13113332, 0x22134221, 0x12222143, }, /* 382 */ { 0x13114142, 0x11225213, 0x13131242, }, /* 383 */ { 0x13114241, 0x21225221, 0x11313143, }, /* 384 */ { 0x32211125, 0x11225312, 0x12222242, }, /* 385 */ { 0x42211133, 0x12134411, 0x13131341, }, /* 386 */ { 0x52211141, 0x11225411, 0x11313242, }, /* 387 */ { 0x22211216, 0x12135122, 0x12222341, }, /* 388 */ { 0x32211224, 0x11226122, 0x11313341, }, /* 389 */ { 0x42211232, 0x12135221, 0x13132151, }, /* 390 */ { 0x22211315, 0x11226221, 0x12223151, }, /* 391 */ { 0x32211323, 0x51231113, 0x11314151, }, /* 392 */ { 0x42211331, 0x61231121, 0x11321126, }, /* 393 */ { 0x22211414, 0x11231162, 0x21321134, }, /* 394 */ { 0x32211422, 0x51231212, 0x31321142, }, /* 395 */ { 0x22211513, 0x11231261, 0x11321225, }, /* 396 */ { 0x32211521, 0x51231311, 0x21321233, }, /* 397 */ { 0x23121125, 0x42141113, 0x31321241, }, /* 398 */ { 0x33121133, 0x52141121, 0x11321324, }, /* 399 */ { 0x43121141, 0x41232113, 0x21321332, }, /* 400 */ { 0x22212125, 0x51232121, 0x11321423, }, /* 401 */ { 0x23121224, 0x41232212, 0x21321431, }, /* 402 */ { 0x33121232, 0x42141311, 0x11321522, }, /* 403 */ { 0x12212216, 0x41232311, 0x11321621, }, /* 404 */ { 0x13121315, 0x32142113, 0x12231134, }, /* 405 */ { 0x32212232, 0x42142121, 0x22231142, }, /* 406 */ { 0x33121331, 0x31233113, 0x11322134, }, /* 407 */ { 0x12212315, 0x32142212, 0x12231233, }, /* 408 */ { 0x22212323, 0x31233212, 0x22231241, }, /* 409 */ { 0x23121422, 0x32142311, 0x11322233, }, /* 410 */ { 0x12212414, 0x31233311, 0x21322241, }, /* 411 */ { 0x13121513, 0x22143113, 0x11322332, }, /* 412 */ { 0x12212513, 0x32143121, 0x12231431, }, /* 413 */ { 0x13122125, 0x21234113, 0x11322431, }, /* 414 */ { 0x23122133, 0x31234121, 0x13141142, }, /* 415 */ { 0x33122141, 0x21234212, 0x12232142, }, /* 416 */ { 0x12213125, 0x22143311, 0x13141241, }, /* 417 */ { 0x13122224, 0x21234311, 0x11323142, }, /* 418 */ { 0x32213141, 0x12144113, 0x12232241, }, /* 419 */ { 0x12213224, 0x22144121, 0x11323241, }, /* 420 */ { 0x22213232, 0x11235113, 0x11331125, }, /* 421 */ { 0x23122331, 0x12144212, 0x21331133, }, /* 422 */ { 0x12213323, 0x11235212, 0x31331141, }, /* 423 */ { 0x13122422, 0x12144311, 0x11331224, }, /* 424 */ { 0x12213422, 0x11235311, 0x21331232, }, /* 425 */ { 0x13123133, 0x12145121, 0x11331323, }, /* 426 */ { 0x23123141, 0x11236121, 0x21331331, }, /* 427 */ { 0x12214133, 0x51241112, 0x11331422, }, /* 428 */ { 0x13123232, 0x11241161, 0x11331521, }, /* 429 */ { 0x12214232, 0x51241211, 0x12241133, }, /* 430 */ { 0x13123331, 0x42151112, 0x22241141, }, /* 431 */ { 0x13124141, 0x41242112, 0x11332133, }, /* 432 */ { 0x12215141, 0x42151211, 0x12241232, }, /* 433 */ { 0x31311116, 0x41242211, 0x11332232, }, /* 434 */ { 0x41311124, 0x32152112, 0x12241331, }, /* 435 */ { 0x51311132, 0x31243112, 0x11332331, }, /* 436 */ { 0x31311215, 0x32152211, 0x13151141, }, /* 437 */ { 0x41311223, 0x31243211, 0x12242141, }, /* 438 */ { 0x51311231, 0x22153112, 0x11333141, }, /* 439 */ { 0x31311314, 0x21244112, 0x11341124, }, /* 440 */ { 0x41311322, 0x22153211, 0x21341132, }, /* 441 */ { 0x31311413, 0x21244211, 0x11341223, }, /* 442 */ { 0x41311421, 0x12154112, 0x21341231, }, /* 443 */ { 0x31311512, 0x11245112, 0x11341322, }, /* 444 */ { 0x22221116, 0x12154211, 0x11341421, }, /* 445 */ { 0x32221124, 0x11245211, 0x12251132, }, /* 446 */ { 0x42221132, 0x51251111, 0x11342132, }, /* 447 */ { 0x21312116, 0x42161111, 0x12251231, }, /* 448 */ { 0x22221215, 0x41252111, 0x11342231, }, /* 449 */ { 0x41312132, 0x32162111, 0x11351123, }, /* 450 */ { 0x42221231, 0x31253111, 0x21351131, }, /* 451 */ { 0x21312215, 0x22163111, 0x11351222, }, /* 452 */ { 0x31312223, 0x21254111, 0x11351321, }, /* 453 */ { 0x41312231, 0x43111115, 0x12261131, }, /* 454 */ { 0x21312314, 0x53111123, 0x11352131, }, /* 455 */ { 0x22221413, 0x63111131, 0x11361122, }, /* 456 */ { 0x32221421, 0x43111214, 0x11361221, }, /* 457 */ { 0x21312413, 0x53111222, 0x14111144, }, /* 458 */ { 0x31312421, 0x43111313, 0x24111152, }, /* 459 */ { 0x22221611, 0x53111321, 0x14111243, }, /* 460 */ { 0x13131116, 0x43111412, 0x24111251, }, /* 461 */ { 0x23131124, 0x43111511, 0x14111342, }, /* 462 */ { 0x33131132, 0x33112115, 0x14111441, }, /* 463 */ { 0x12222116, 0x43112123, 0x14112152, }, /* 464 */ { 0x13131215, 0x53112131, 0x14112251, }, /* 465 */ { 0x23131223, 0x33112214, 0x54113111, }, /* 466 */ { 0x33131231, 0x43112222, 0x44114111, }, /* 467 */ { 0x11313116, 0x33112313, 0x34115111, }, /* 468 */ { 0x12222215, 0x43112321, 0x24116111, }, /* 469 */ { 0x22222223, 0x33112412, 0x13211135, }, /* 470 */ { 0x32222231, 0x33112511, 0x23211143, }, /* 471 */ { 0x11313215, 0x23113115, 0x33211151, }, /* 472 */ { 0x21313223, 0x33113123, 0x13211234, }, /* 473 */ { 0x31313231, 0x43113131, 0x23211242, }, /* 474 */ { 0x23131421, 0x23113214, 0x13211333, }, /* 475 */ { 0x11313314, 0x33113222, 0x23211341, }, /* 476 */ { 0x12222413, 0x23113313, 0x13211432, }, /* 477 */ { 0x22222421, 0x33113321, 0x13211531, }, /* 478 */ { 0x11313413, 0x23113412, 0x14121143, }, /* 479 */ { 0x13131611, 0x23113511, 0x24121151, }, /* 480 */ { 0x13132124, 0x13114115, 0x13212143, }, /* 481 */ { 0x23132132, 0x23114123, 0x14121242, }, /* 482 */ { 0x12223124, 0x33114131, 0x13212242, }, /* 483 */ { 0x13132223, 0x13114214, 0x14121341, }, /* 484 */ { 0x23132231, 0x23114222, 0x13212341, }, /* 485 */ { 0x11314124, 0x13114313, 0x14122151, }, /* 486 */ { 0x12223223, 0x23114321, 0x13213151, }, /* 487 */ { 0x22223231, 0x13114412, 0x12311126, }, /* 488 */ { 0x11314223, 0x13114511, 0x22311134, }, /* 489 */ { 0x21314231, 0x13115123, 0x32311142, }, /* 490 */ { 0x13132421, 0x23115131, 0x12311225, }, /* 491 */ { 0x12223421, 0x13115222, 0x22311233, }, /* 492 */ { 0x13133132, 0x13115321, 0x32311241, }, /* 493 */ { 0x12224132, 0x13116131, 0x12311324, }, /* 494 */ { 0x13133231, 0x52211114, 0x22311332, }, /* 495 */ { 0x11315132, 0x62211122, 0x12311423, }, /* 496 */ { 0x12224231, 0x12211163, 0x22311431, }, /* 497 */ { 0x31321115, 0x52211213, 0x12311522, }, /* 498 */ { 0x41321123, 0x62211221, 0x12311621, }, /* 499 */ { 0x51321131, 0x12211262, 0x13221134, }, /* 500 */ { 0x31321214, 0x52211312, 0x23221142, }, /* 501 */ { 0x41321222, 0x12211361, 0x12312134, }, /* 502 */ { 0x31321313, 0x52211411, 0x13221233, }, /* 503 */ { 0x41321321, 0x43121114, 0x23221241, }, /* 504 */ { 0x31321412, 0x53121122, 0x12312233, }, /* 505 */ { 0x31321511, 0x42212114, 0x13221332, }, /* 506 */ { 0x22231115, 0x43121213, 0x12312332, }, /* 507 */ { 0x32231123, 0x53121221, 0x13221431, }, /* 508 */ { 0x42231131, 0x42212213, 0x12312431, }, /* 509 */ { 0x21322115, 0x52212221, 0x14131142, }, /* 510 */ { 0x22231214, 0x42212312, 0x13222142, }, /* 511 */ { 0x41322131, 0x43121411, 0x14131241, }, /* 512 */ { 0x21322214, 0x42212411, 0x12313142, }, /* 513 */ { 0x31322222, 0x33122114, 0x13222241, }, /* 514 */ { 0x32231321, 0x43122122, 0x12313241, }, /* 515 */ { 0x21322313, 0x32213114, 0x21411125, }, /* 516 */ { 0x22231412, 0x33122213, 0x31411133, }, /* 517 */ { 0x21322412, 0x43122221, 0x41411141, }, /* 518 */ { 0x22231511, 0x32213213, 0x11411216, }, /* 519 */ { 0x21322511, 0x42213221, 0x21411224, }, /* 520 */ { 0x13141115, 0x32213312, 0x31411232, }, /* 521 */ { 0x23141123, 0x33122411, 0x11411315, }, /* 522 */ { 0x33141131, 0x32213411, 0x21411323, }, /* 523 */ { 0x12232115, 0x23123114, 0x31411331, }, /* 524 */ { 0x13141214, 0x33123122, 0x11411414, }, /* 525 */ { 0x23141222, 0x22214114, 0x21411422, }, /* 526 */ { 0x11323115, 0x23123213, 0x11411513, }, /* 527 */ { 0x12232214, 0x33123221, 0x21411521, }, /* 528 */ { 0x22232222, 0x22214213, 0x11411612, }, /* 529 */ { 0x23141321, 0x32214221, 0x12321125, }, /* 530 */ { 0x11323214, 0x22214312, 0x22321133, }, /* 531 */ { 0x21323222, 0x23123411, 0x32321141, }, /* 532 */ { 0x13141412, 0x22214411, 0x11412125, }, /* 533 */ { 0x11323313, 0x13124114, 0x12321224, }, /* 534 */ { 0x12232412, 0x23124122, 0x22321232, }, /* 535 */ { 0x13141511, 0x12215114, 0x11412224, }, /* 536 */ { 0x12232511, 0x13124213, 0x21412232, }, /* 537 */ { 0x13142123, 0x23124221, 0x22321331, }, /* 538 */ { 0x23142131, 0x12215213, 0x11412323, }, /* 539 */ { 0x12233123, 0x22215221, 0x12321422, }, /* 540 */ { 0x13142222, 0x12215312, 0x11412422, }, /* 541 */ { 0x11324123, 0x13124411, 0x12321521, }, /* 542 */ { 0x12233222, 0x12215411, 0x11412521, }, /* 543 */ { 0x13142321, 0x13125122, 0x13231133, }, /* 544 */ { 0x11324222, 0x12216122, 0x23231141, }, /* 545 */ { 0x12233321, 0x13125221, 0x12322133, }, /* 546 */ { 0x13143131, 0x12216221, 0x13231232, }, /* 547 */ { 0x11325131, 0x61311113, 0x11413133, }, /* 548 */ { 0x31331114, 0x11311154, 0x12322232, }, /* 549 */ { 0x41331122, 0x21311162, 0x13231331, }, /* 550 */ { 0x31331213, 0x61311212, 0x11413232, }, /* 551 */ { 0x41331221, 0x11311253, 0x12322331, }, /* 552 */ { 0x31331312, 0x21311261, 0x11413331, }, /* 553 */ { 0x31331411, 0x61311311, 0x14141141, }, /* 554 */ { 0x22241114, 0x11311352, 0x13232141, }, /* 555 */ { 0x32241122, 0x11311451, 0x12323141, }, /* 556 */ { 0x21332114, 0x52221113, 0x11414141, }, /* 557 */ { 0x22241213, 0x62221121, 0x11421116, }, /* 558 */ { 0x32241221, 0x12221162, 0x21421124, }, /* 559 */ { 0x21332213, 0x51312113, 0x31421132, }, /* 560 */ { 0x31332221, 0x61312121, 0x11421215, }, /* 561 */ { 0x21332312, 0x11312162, 0x21421223, }, /* 562 */ { 0x22241411, 0x12221261, 0x31421231, }, /* 563 */ { 0x21332411, 0x51312212, 0x11421314, }, /* 564 */ { 0x13151114, 0x52221311, 0x21421322, }, /* 565 */ { 0x23151122, 0x11312261, 0x11421413, }, /* 566 */ { 0x12242114, 0x51312311, 0x21421421, }, /* 567 */ { 0x13151213, 0x43131113, 0x11421512, }, /* 568 */ { 0x23151221, 0x53131121, 0x11421611, }, /* 569 */ { 0x11333114, 0x42222113, 0x12331124, }, /* 570 */ { 0x12242213, 0x43131212, 0x22331132, }, /* 571 */ { 0x22242221, 0x41313113, 0x11422124, }, /* 572 */ { 0x11333213, 0x51313121, 0x12331223, }, /* 573 */ { 0x21333221, 0x43131311, 0x22331231, }, /* 574 */ { 0x13151411, 0x41313212, 0x11422223, }, /* 575 */ { 0x11333312, 0x42222311, 0x21422231, }, /* 576 */ { 0x12242411, 0x41313311, 0x11422322, }, /* 577 */ { 0x11333411, 0x33132113, 0x12331421, }, /* 578 */ { 0x12243122, 0x43132121, 0x11422421, }, /* 579 */ { 0x11334122, 0x32223113, 0x13241132, }, /* 580 */ { 0x11334221, 0x33132212, 0x12332132, }, /* 581 */ { 0x41341121, 0x31314113, 0x13241231, }, /* 582 */ { 0x31341311, 0x32223212, 0x11423132, }, /* 583 */ { 0x32251121, 0x33132311, 0x12332231, }, /* 584 */ { 0x22251212, 0x31314212, 0x11423231, }, /* 585 */ { 0x22251311, 0x32223311, 0x11431115, }, /* 586 */ { 0x13161113, 0x31314311, 0x21431123, }, /* 587 */ { 0x12252113, 0x23133113, 0x31431131, }, /* 588 */ { 0x11343113, 0x33133121, 0x11431214, }, /* 589 */ { 0x13161311, 0x22224113, 0x21431222, }, /* 590 */ { 0x12252311, 0x23133212, 0x11431313, }, /* 591 */ { 0x24111125, 0x21315113, 0x21431321, }, /* 592 */ { 0x14111216, 0x22224212, 0x11431412, }, /* 593 */ { 0x24111224, 0x23133311, 0x11431511, }, /* 594 */ { 0x14111315, 0x21315212, 0x12341123, }, /* 595 */ { 0x24111323, 0x22224311, 0x22341131, }, /* 596 */ { 0x34111331, 0x21315311, 0x11432123, }, /* 597 */ { 0x14111414, 0x13134113, 0x12341222, }, /* 598 */ { 0x24111422, 0x23134121, 0x11432222, }, /* 599 */ { 0x14111513, 0x12225113, 0x12341321, }, /* 600 */ { 0x24111521, 0x13134212, 0x11432321, }, /* 601 */ { 0x14112125, 0x11316113, 0x13251131, }, /* 602 */ { 0x24112133, 0x12225212, 0x12342131, }, /* 603 */ { 0x34112141, 0x13134311, 0x11433131, }, /* 604 */ { 0x14112224, 0x11316212, 0x11441114, }, /* 605 */ { 0x24112232, 0x12225311, 0x21441122, }, /* 606 */ { 0x14112323, 0x11316311, 0x11441213, }, /* 607 */ { 0x24112331, 0x13135121, 0x21441221, }, /* 608 */ { 0x14112422, 0x12226121, 0x11441312, }, /* 609 */ { 0x14112521, 0x61321112, 0x11441411, }, /* 610 */ { 0x14113133, 0x11321153, 0x12351122, }, /* 611 */ { 0x24113141, 0x21321161, 0x11442122, }, /* 612 */ { 0x14113232, 0x61321211, 0x12351221, }, /* 613 */ { 0x14113331, 0x11321252, 0x11442221, }, /* 614 */ { 0x14114141, 0x11321351, 0x11451113, }, /* 615 */ { 0x23211116, 0x52231112, 0x21451121, }, /* 616 */ { 0x33211124, 0x12231161, 0x11451212, }, /* 617 */ { 0x43211132, 0x51322112, 0x11451311, }, /* 618 */ { 0x23211215, 0x52231211, 0x12361121, }, /* 619 */ { 0x33211223, 0x11322161, 0x11452121, }, /* 620 */ { 0x23211314, 0x51322211, 0x15111143, }, /* 621 */ { 0x33211322, 0x43141112, 0x25111151, }, /* 622 */ { 0x23211413, 0x42232112, 0x15111242, }, /* 623 */ { 0x33211421, 0x43141211, 0x15111341, }, /* 624 */ { 0x23211512, 0x41323112, 0x15112151, }, /* 625 */ { 0x14121116, 0x42232211, 0x14211134, }, /* 626 */ { 0x24121124, 0x41323211, 0x24211142, }, /* 627 */ { 0x34121132, 0x33142112, 0x14211233, }, /* 628 */ { 0x13212116, 0x32233112, 0x24211241, }, /* 629 */ { 0x14121215, 0x33142211, 0x14211332, }, /* 630 */ { 0x33212132, 0x31324112, 0x14211431, }, /* 631 */ { 0x34121231, 0x32233211, 0x15121142, }, /* 632 */ { 0x13212215, 0x31324211, 0x14212142, }, /* 633 */ { 0x23212223, 0x23143112, 0x15121241, }, /* 634 */ { 0x33212231, 0x22234112, 0x14212241, }, /* 635 */ { 0x13212314, 0x23143211, 0x13311125, }, /* 636 */ { 0x14121413, 0x21325112, 0x23311133, }, /* 637 */ { 0x24121421, 0x22234211, 0x33311141, }, /* 638 */ { 0x13212413, 0x21325211, 0x13311224, }, /* 639 */ { 0x23212421, 0x13144112, 0x23311232, }, /* 640 */ { 0x14121611, 0x12235112, 0x13311323, }, /* 641 */ { 0x14122124, 0x13144211, 0x23311331, }, /* 642 */ { 0x24122132, 0x11326112, 0x13311422, }, /* 643 */ { 0x13213124, 0x12235211, 0x13311521, }, /* 644 */ { 0x14122223, 0x11326211, 0x14221133, }, /* 645 */ { 0x24122231, 0x61331111, 0x24221141, }, /* 646 */ { 0x13213223, 0x11331152, 0x13312133, }, /* 647 */ { 0x23213231, 0x11331251, 0x14221232, }, /* 648 */ { 0x13213322, 0x52241111, 0x13312232, }, /* 649 */ { 0x14122421, 0x51332111, 0x14221331, }, /* 650 */ { 0x14123132, 0x43151111, 0x13312331, }, /* 651 */ { 0x13214132, 0x42242111, 0x15131141, }, /* 652 */ { 0x14123231, 0x41333111, 0x14222141, }, /* 653 */ { 0x13214231, 0x33152111, 0x13313141, }, /* 654 */ { 0x32311115, 0x32243111, 0x12411116, }, /* 655 */ { 0x42311123, 0x31334111, 0x22411124, }, /* 656 */ { 0x52311131, 0x23153111, 0x32411132, }, /* 657 */ { 0x32311214, 0x22244111, 0x12411215, }, /* 658 */ { 0x42311222, 0x21335111, 0x22411223, }, /* 659 */ { 0x32311313, 0x13154111, 0x32411231, }, /* 660 */ { 0x42311321, 0x12245111, 0x12411314, }, /* 661 */ { 0x32311412, 0x11336111, 0x22411322, }, /* 662 */ { 0x32311511, 0x11341151, 0x12411413, }, /* 663 */ { 0x23221115, 0x44111114, 0x22411421, }, /* 664 */ { 0x33221123, 0x54111122, 0x12411512, }, /* 665 */ { 0x22312115, 0x44111213, 0x12411611, }, /* 666 */ { 0x23221214, 0x54111221, 0x13321124, }, /* 667 */ { 0x33221222, 0x44111312, 0x23321132, }, /* 668 */ { 0x22312214, 0x44111411, 0x12412124, }, /* 669 */ { 0x32312222, 0x34112114, 0x13321223, }, /* 670 */ { 0x33221321, 0x44112122, 0x23321231, }, /* 671 */ { 0x22312313, 0x34112213, 0x12412223, }, /* 672 */ { 0x23221412, 0x44112221, 0x22412231, }, /* 673 */ { 0x22312412, 0x34112312, 0x12412322, }, /* 674 */ { 0x23221511, 0x34112411, 0x13321421, }, /* 675 */ { 0x22312511, 0x24113114, 0x12412421, }, /* 676 */ { 0x14131115, 0x34113122, 0x14231132, }, /* 677 */ { 0x24131123, 0x24113213, 0x13322132, }, /* 678 */ { 0x13222115, 0x34113221, 0x14231231, }, /* 679 */ { 0x14131214, 0x24113312, 0x12413132, }, /* 680 */ { 0x33222131, 0x24113411, 0x13322231, }, /* 681 */ { 0x12313115, 0x14114114, 0x12413231, }, /* 682 */ { 0x13222214, 0x24114122, 0x21511115, }, /* 683 */ { 0x23222222, 0x14114213, 0x31511123, }, /* 684 */ { 0x24131321, 0x24114221, 0x41511131, }, /* 685 */ { 0x12313214, 0x14114312, 0x21511214, }, /* 686 */ { 0x22313222, 0x14114411, 0x31511222, }, /* 687 */ { 0x14131412, 0x14115122, 0x21511313, }, /* 688 */ { 0x12313313, 0x14115221, 0x31511321, }, /* 689 */ { 0x13222412, 0x53211113, 0x21511412, }, /* 690 */ { 0x14131511, 0x63211121, 0x21511511, }, /* 691 */ { 0x13222511, 0x13211162, 0x12421115, }, /* 692 */ { 0x14132123, 0x53211212, 0x22421123, }, /* 693 */ { 0x24132131, 0x13211261, 0x32421131, }, /* 694 */ { 0x13223123, 0x53211311, 0x11512115, }, /* 695 */ { 0x14132222, 0x44121113, 0x12421214, }, /* 696 */ { 0x12314123, 0x54121121, 0x22421222, }, /* 697 */ { 0x13223222, 0x43212113, 0x11512214, }, /* 698 */ { 0x14132321, 0x44121212, 0x21512222, }, /* 699 */ { 0x12314222, 0x43212212, 0x22421321, }, /* 700 */ { 0x13223321, 0x44121311, 0x11512313, }, /* 701 */ { 0x14133131, 0x43212311, 0x12421412, }, /* 702 */ { 0x13224131, 0x34122113, 0x11512412, }, /* 703 */ { 0x12315131, 0x44122121, 0x12421511, }, /* 704 */ { 0x41411114, 0x33213113, 0x11512511, }, /* 705 */ { 0x51411122, 0x34122212, 0x13331123, }, /* 706 */ { 0x41411213, 0x33213212, 0x23331131, }, /* 707 */ { 0x51411221, 0x34122311, 0x12422123, }, /* 708 */ { 0x41411312, 0x33213311, 0x13331222, }, /* 709 */ { 0x41411411, 0x24123113, 0x11513123, }, /* 710 */ { 0x32321114, 0x34123121, 0x12422222, }, /* 711 */ { 0x42321122, 0x23214113, 0x13331321, }, /* 712 */ { 0x31412114, 0x24123212, 0x11513222, }, /* 713 */ { 0x41412122, 0x23214212, 0x12422321, }, /* 714 */ { 0x42321221, 0x24123311, 0x11513321, }, /* 715 */ { 0x31412213, 0x23214311, 0x14241131, }, /* 716 */ { 0x41412221, 0x14124113, 0x13332131, }, /* 717 */ { 0x31412312, 0x24124121, 0x12423131, }, /* 718 */ { 0x32321411, 0x13215113, 0x11514131, }, /* 719 */ { 0x31412411, 0x14124212, 0x21521114, }, /* 720 */ { 0x23231114, 0x13215212, 0x31521122, }, /* 721 */ { 0x33231122, 0x14124311, 0x21521213, }, /* 722 */ { 0x22322114, 0x13215311, 0x31521221, }, /* 723 */ { 0x23231213, 0x14125121, 0x21521312, }, /* 724 */ { 0x33231221, 0x13216121, 0x21521411, }, /* 725 */ { 0x21413114, 0x62311112, 0x12431114, }, /* 726 */ { 0x22322213, 0x12311153, 0x22431122, }, /* 727 */ { 0x32322221, 0x22311161, 0x11522114, }, /* 728 */ { 0x21413213, 0x62311211, 0x12431213, }, /* 729 */ { 0x31413221, 0x12311252, 0x22431221, }, /* 730 */ { 0x23231411, 0x12311351, 0x11522213, }, /* 731 */ { 0x21413312, 0x53221112, 0x21522221, }, /* 732 */ { 0x22322411, 0x13221161, 0x11522312, }, /* 733 */ { 0x21413411, 0x52312112, 0x12431411, }, /* 734 */ { 0x14141114, 0x53221211, 0x11522411, }, /* 735 */ { 0x24141122, 0x12312161, 0x13341122, }, /* 736 */ { 0x13232114, 0x52312211, 0x12432122, }, /* 737 */ { 0x14141213, 0x44131112, 0x13341221, }, /* 738 */ { 0x24141221, 0x43222112, 0x11523122, }, /* 739 */ { 0x12323114, 0x44131211, 0x12432221, }, /* 740 */ { 0x13232213, 0x42313112, 0x11523221, }, /* 741 */ { 0x23232221, 0x43222211, 0x21531113, }, /* 742 */ { 0x11414114, 0x42313211, 0x31531121, }, /* 743 */ { 0x12323213, 0x34132112, 0x21531212, }, /* 744 */ { 0x22323221, 0x33223112, 0x21531311, }, /* 745 */ { 0x14141411, 0x34132211, 0x12441113, }, /* 746 */ { 0x11414213, 0x32314112, 0x22441121, }, /* 747 */ { 0x21414221, 0x33223211, 0x11532113, }, /* 748 */ { 0x13232411, 0x32314211, 0x12441212, }, /* 749 */ { 0x11414312, 0x24133112, 0x11532212, }, /* 750 */ { 0x14142122, 0x23224112, 0x12441311, }, /* 751 */ { 0x13233122, 0x24133211, 0x11532311, }, /* 752 */ { 0x14142221, 0x22315112, 0x13351121, }, /* 753 */ { 0x12324122, 0x23224211, 0x12442121, }, /* 754 */ { 0x13233221, 0x22315211, 0x11533121, }, /* 755 */ { 0x11415122, 0x14134112, 0x21541112, }, /* 756 */ { 0x12324221, 0x13225112, 0x21541211, }, /* 757 */ { 0x11415221, 0x14134211, 0x12451112, }, /* 758 */ { 0x41421113, 0x12316112, 0x11542112, }, /* 759 */ { 0x51421121, 0x13225211, 0x12451211, }, /* 760 */ { 0x41421212, 0x12316211, 0x11542211, }, /* 761 */ { 0x41421311, 0x11411144, 0x16111142, }, /* 762 */ { 0x32331113, 0x21411152, 0x16111241, }, /* 763 */ { 0x42331121, 0x11411243, 0x15211133, }, /* 764 */ { 0x31422113, 0x21411251, 0x25211141, }, /* 765 */ { 0x41422121, 0x11411342, 0x15211232, }, /* 766 */ { 0x31422212, 0x11411441, 0x15211331, }, /* 767 */ { 0x32331311, 0x62321111, 0x16121141, }, /* 768 */ { 0x31422311, 0x12321152, 0x15212141, }, /* 769 */ { 0x23241113, 0x61412111, 0x14311124, }, /* 770 */ { 0x33241121, 0x11412152, 0x24311132, }, /* 771 */ { 0x22332113, 0x12321251, 0x14311223, }, /* 772 */ { 0x23241212, 0x11412251, 0x24311231, }, /* 773 */ { 0x21423113, 0x53231111, 0x14311322, }, /* 774 */ { 0x22332212, 0x52322111, 0x14311421, }, /* 775 */ { 0x23241311, 0x51413111, 0x15221132, }, /* 776 */ { 0x21423212, 0x44141111, 0x14312132, }, /* 777 */ { 0x22332311, 0x43232111, 0x15221231, }, /* 778 */ { 0x21423311, 0x42323111, 0x14312231, }, /* 779 */ { 0x14151113, 0x41414111, 0x13411115, }, /* 780 */ { 0x24151121, 0x34142111, 0x23411123, }, /* 781 */ { 0x13242113, 0x33233111, 0x33411131, }, /* 782 */ { 0x23242121, 0x32324111, 0x13411214, }, /* 783 */ { 0x12333113, 0x31415111, 0x23411222, }, /* 784 */ { 0x13242212, 0x24143111, 0x13411313, }, /* 785 */ { 0x14151311, 0x23234111, 0x23411321, }, /* 786 */ { 0x11424113, 0x22325111, 0x13411412, }, /* 787 */ { 0x12333212, 0x21416111, 0x13411511, }, /* 788 */ { 0x13242311, 0x14144111, 0x14321123, }, /* 789 */ { 0x11424212, 0x13235111, 0x24321131, }, /* 790 */ { 0x12333311, 0x12326111, 0x13412123, }, /* 791 */ { 0x11424311, 0x11421143, 0x23412131, }, /* 792 */ { 0x13243121, 0x21421151, 0x13412222, }, /* 793 */ { 0x11425121, 0x11421242, 0x14321321, }, /* 794 */ { 0x41431211, 0x11421341, 0x13412321, }, /* 795 */ { 0x31432112, 0x12331151, 0x15231131, }, /* 796 */ { 0x31432211, 0x11422151, 0x14322131, }, /* 797 */ { 0x22342112, 0x11431142, 0x13413131, }, /* 798 */ { 0x21433112, 0x11431241, 0x22511114, }, /* 799 */ { 0x21433211, 0x11441141, 0x32511122, }, /* 800 */ { 0x13252112, 0x45111113, 0x22511213, }, /* 801 */ { 0x12343112, 0x45111212, 0x32511221, }, /* 802 */ { 0x11434112, 0x45111311, 0x22511312, }, /* 803 */ { 0x11434211, 0x35112113, 0x22511411, }, /* 804 */ { 0x15111116, 0x45112121, 0x13421114, }, /* 805 */ { 0x15111215, 0x35112212, 0x23421122, }, /* 806 */ { 0x25111223, 0x35112311, 0x12512114, }, /* 807 */ { 0x15111314, 0x25113113, 0x22512122, }, /* 808 */ { 0x15111413, 0x35113121, 0x23421221, }, /* 809 */ { 0x15111512, 0x25113212, 0x12512213, }, /* 810 */ { 0x15112124, 0x25113311, 0x13421312, }, /* 811 */ { 0x15112223, 0x15114113, 0x12512312, }, /* 812 */ { 0x15112322, 0x25114121, 0x13421411, }, /* 813 */ { 0x15112421, 0x15114212, 0x12512411, }, /* 814 */ { 0x15113132, 0x15114311, 0x14331122, }, /* 815 */ { 0x15113231, 0x15115121, 0x13422122, }, /* 816 */ { 0x24211115, 0x54211112, 0x14331221, }, /* 817 */ { 0x24211214, 0x14211161, 0x12513122, }, /* 818 */ { 0x34211222, 0x54211211, 0x13422221, }, /* 819 */ { 0x24211313, 0x45121112, 0x12513221, }, /* 820 */ { 0x34211321, 0x44212112, 0x31611113, }, /* 821 */ { 0x24211412, 0x45121211, 0x41611121, }, /* 822 */ { 0x24211511, 0x44212211, 0x31611212, }, /* 823 */ { 0x15121115, 0x35122112, 0x31611311, }, /* 824 */ { 0x25121123, 0x34213112, 0x22521113, }, /* 825 */ { 0x14212115, 0x35122211, 0x32521121, }, /* 826 */ { 0x24212123, 0x34213211, 0x21612113, }, /* 827 */ { 0x25121222, 0x25123112, 0x22521212, }, /* 828 */ { 0x14212214, 0x24214112, 0x21612212, }, /* 829 */ { 0x24212222, 0x25123211, 0x22521311, }, /* 830 */ { 0x14212313, 0x24214211, 0x21612311, }, /* 831 */ { 0x24212321, 0x15124112, 0x13431113, }, /* 832 */ { 0x14212412, 0x14215112, 0x23431121, }, /* 833 */ { 0x15121511, 0x15124211, 0x12522113, }, /* 834 */ { 0x14212511, 0x14215211, 0x13431212, }, /* 835 */ { 0x15122123, 0x63311111, 0x11613113, }, /* 836 */ { 0x25122131, 0x13311152, 0x12522212, }, /* 837 */ { 0x14213123, 0x13311251, 0x13431311, }, /* 838 */ { 0x24213131, 0x54221111, 0x11613212, }, /* 839 */ { 0x14213222, 0x53312111, 0x12522311, }, /* 840 */ { 0x15122321, 0x45131111, 0x11613311, }, /* 841 */ { 0x14213321, 0x44222111, 0x14341121, }, /* 842 */ { 0x15123131, 0x43313111, 0x13432121, }, /* 843 */ { 0x14214131, 0x35132111, 0x12523121, }, /* 844 */ { 0x33311114, 0x34223111, 0x11614121, }, /* 845 */ { 0x33311213, 0x33314111, 0x31621112, }, /* 846 */ { 0x33311312, 0x25133111, 0x31621211, }, /* 847 */ { 0x33311411, 0x24224111, 0x22531112, }, /* 848 */ { 0x24221114, 0x23315111, 0x21622112, }, /* 849 */ { 0x23312114, 0x15134111, 0x22531211, }, /* 850 */ { 0x33312122, 0x14225111, 0x21622211, }, /* 851 */ { 0x34221221, 0x13316111, 0x13441112, }, /* 852 */ { 0x23312213, 0x12411143, 0x12532112, }, /* 853 */ { 0x33312221, 0x22411151, 0x13441211, }, /* 854 */ { 0x23312312, 0x12411242, 0x11623112, }, /* 855 */ { 0x24221411, 0x12411341, 0x12532211, }, /* 856 */ { 0x23312411, 0x13321151, 0x11623211, }, /* 857 */ { 0x15131114, 0x12412151, 0x31631111, }, /* 858 */ { 0x14222114, 0x11511134, 0x22541111, }, /* 859 */ { 0x15131213, 0x21511142, 0x21632111, }, /* 860 */ { 0x25131221, 0x11511233, 0x13451111, }, /* 861 */ { 0x13313114, 0x21511241, 0x12542111, }, /* 862 */ { 0x14222213, 0x11511332, 0x11633111, }, /* 863 */ { 0x15131312, 0x11511431, 0x16211132, }, /* 864 */ { 0x13313213, 0x12421142, 0x16211231, }, /* 865 */ { 0x14222312, 0x11512142, 0x15311123, }, /* 866 */ { 0x15131411, 0x12421241, 0x25311131, }, /* 867 */ { 0x13313312, 0x11512241, 0x15311222, }, /* 868 */ { 0x14222411, 0x11521133, 0x15311321, }, /* 869 */ { 0x15132122, 0x21521141, 0x16221131, }, /* 870 */ { 0x14223122, 0x11521232, 0x15312131, }, /* 871 */ { 0x15132221, 0x11521331, 0x14411114, }, /* 872 */ { 0x13314122, 0x12431141, 0x24411122, }, /* 873 */ { 0x14223221, 0x11522141, 0x14411213, }, /* 874 */ { 0x13314221, 0x11531132, 0x24411221, }, /* 875 */ { 0x42411113, 0x11531231, 0x14411312, }, /* 876 */ { 0x42411212, 0x11541131, 0x14411411, }, /* 877 */ { 0x42411311, 0x36112112, 0x15321122, }, /* 878 */ { 0x33321113, 0x36112211, 0x14412122, }, /* 879 */ { 0x32412113, 0x26113112, 0x15321221, }, /* 880 */ { 0x42412121, 0x26113211, 0x14412221, }, /* 881 */ { 0x32412212, 0x16114112, 0x23511113, }, /* 882 */ { 0x33321311, 0x16114211, 0x33511121, }, /* 883 */ { 0x32412311, 0x45212111, 0x23511212, }, /* 884 */ { 0x24231113, 0x36122111, 0x23511311, }, /* 885 */ { 0x34231121, 0x35213111, 0x14421113, }, /* 886 */ { 0x23322113, 0x26123111, 0x24421121, }, /* 887 */ { 0x33322121, 0x25214111, 0x13512113, }, /* 888 */ { 0x22413113, 0x16124111, 0x23512121, }, /* 889 */ { 0x23322212, 0x15215111, 0x13512212, }, /* 890 */ { 0x24231311, 0x14311151, 0x14421311, }, /* 891 */ { 0x22413212, 0x13411142, 0x13512311, }, /* 892 */ { 0x23322311, 0x13411241, 0x15331121, }, /* 893 */ { 0x22413311, 0x12511133, 0x14422121, }, /* 894 */ { 0x15141113, 0x22511141, 0x13513121, }, /* 895 */ { 0x25141121, 0x12511232, 0x32611112, }, /* 896 */ { 0x14232113, 0x12511331, 0x32611211, }, /* 897 */ { 0x24232121, 0x13421141, 0x23521112, }, /* 898 */ { 0x13323113, 0x12512141, 0x22612112, }, /* 899 */ { 0x14232212, 0x11611124, 0x23521211, }, /* 900 */ { 0x15141311, 0x21611132, 0x22612211, }, /* 901 */ { 0x12414113, 0x11611223, 0x14431112, }, /* 902 */ { 0x13323212, 0x21611231, 0x13522112, }, /* 903 */ { 0x14232311, 0x11611322, 0x14431211, }, /* 904 */ { 0x12414212, 0x11611421, 0x12613112, }, /* 905 */ { 0x13323311, 0x12521132, 0x13522211, }, /* 906 */ { 0x15142121, 0x11612132, 0x12613211, }, /* 907 */ { 0x14233121, 0x12521231, 0x32621111, }, /* 908 */ { 0x13324121, 0x11612231, 0x23531111, }, /* 909 */ { 0x12415121, 0x11621123, 0x22622111, }, /* 910 */ { 0x51511112, 0x21621131, 0x14441111, }, /* 911 */ { 0x51511211, 0x11621222, 0x13532111, }, /* 912 */ { 0x42421112, 0x11621321, 0x12623111, }, /* 913 */ { 0x41512112, 0x12531131, 0x16311122, }, /* 914 */ { 0x42421211, 0x11622131, 0x16311221, }, /* 915 */ { 0x41512211, 0x11631122, 0x15411113, }, /* 916 */ { 0x33331112, 0x11631221, 0x25411121, }, /* 917 */ { 0x32422112, 0x14411141, 0x15411212, }, /* 918 */ { 0x33331211, 0x13511132, 0x15411311, }, /* 919 */ { 0x31513112, 0x13511231, 0x16321121, }, /* 920 */ { 0x32422211, 0x12611123, 0x15412121, }, /* 921 */ { 0x31513211, 0x22611131, 0x24511112, }, /* 922 */ { 0x24241112, 0x12611222, 0x24511211, }, /* 923 */ { 0x23332112, 0x12611321, 0x15421112, }, /* 924 */ { 0x24241211, 0x13521131, 0x14512112, }, /* 925 */ { 0x22423112, 0x12612131, 0x15421211, }, /* 926 */ { 0x23332211, 0x12621122, 0x14512211, }, /* 927 */ { 0x21514112, 0x12621221, 0x33611111, }, /* 928 */ }; #endif zbar-0.10/test/test_cpp.cpp0000644000000000000000000000300311270371414012557 00000000000000//------------------------------------------------------------------------ // Copyright 2007-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ // NB do not put anything before this header // it's here to check that we didn't omit any dependencies #include int main (int argc, char **argv) { const char *video_dev = "/dev/video0"; if(argc > 1) video_dev = argv[1]; zbar::Processor proc = zbar::Processor(true, video_dev); proc.set_visible(); proc.set_active(); try { proc.user_wait(); } catch(zbar::ClosedError) { } return(0); } zbar-0.10/test/test_images.h0000644000000000000000000000256611270371414012724 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _TEST_IMAGES_H_ #define _TEST_IMAGES_H_ /* adapted from v4l2 spec */ #define fourcc(a, b, c, d) \ ((uint32_t)(a) | ((uint32_t)(b) << 8) | \ ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24)) int test_image_check_cleanup(void); int test_image_bars(zbar_image_t*); #endif zbar-0.10/test/test_proc.c0000644000000000000000000001146011270371414012406 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #include #include #include #include #include #include "test_images.h" zbar_processor_t *proc = NULL; int use_threads = 1, use_window = 1; int input_wait (int timeout) { if(timeout >= 0) fprintf(stderr, "waiting %d.%03ds for input...", timeout / 1000, timeout % 1000); else fprintf(stderr, "waiting indefinitely for input..."); fflush(stderr); int rc = zbar_processor_user_wait(proc, timeout); if(rc > 0) fprintf(stderr, "got input (%02x)\n", rc); else if(!rc) fprintf(stderr, "timed out\n"); else if(zbar_processor_get_error_code(proc) == ZBAR_ERR_CLOSED) use_window = rc = 0; fflush(stderr); return(rc); } int main (int argc, char **argv) { zbar_set_verbosity(127); char *video_dev = NULL; uint32_t fmt = 0; int i, j = 0; for(i = 1; i < argc; i++) { if(argv[i][0] == '-') { if(!strncmp(argv[i], "-thr", 4)) use_threads = 0; else if(!strncmp(argv[i], "-win", 4)) use_window = 0; else return(1); } else if(!j++) video_dev = argv[i]; else if(j++ == 1) { int n = strlen(argv[i]); if(n > 4) n = 4; memcpy((char*)&fmt, argv[i], n); } } if(!fmt) fmt = fourcc('B','G','R','3'); proc = zbar_processor_create(use_threads); assert(proc); fprintf(stderr, "created processor (%sthreaded)\n", (!use_threads) ? "un" : ""); fflush(stderr); if(zbar_processor_init(proc, NULL, 0)) return(2); fprintf(stderr, "initialized (video=disabled, window=disabled)\n"); fflush(stderr); zbar_image_t *img = zbar_image_create(); zbar_image_set_size(img, 640, 480); zbar_image_set_format(img, fmt); test_image_bars(img); if(zbar_process_image(proc, img) < 0) return(3); fprintf(stderr, "processed test image\n"); fflush(stderr); if(zbar_processor_init(proc, video_dev, use_window)) return(2); fprintf(stderr, "reinitialized (video=%s, window=%s)\n", (video_dev) ? video_dev : "disabled", (use_window) ? "enabled" : "disabled"); fflush(stderr); if(use_window) { if(zbar_processor_set_visible(proc, 1)) return(4); fprintf(stderr, "window visible\n"); fflush(stderr); } if(input_wait((use_window && !video_dev) ? -1 : 2000) < 0) return(5); if(zbar_process_image(proc, img) < 0) return(3); fprintf(stderr, "processed test image\n"); fflush(stderr); zbar_image_destroy(img); if(input_wait((use_window && !video_dev) ? -1 : 3333) < 0) return(5); if(video_dev) { if(zbar_processor_set_active(proc, 1)) return(3); fprintf(stderr, "video activated\n"); fflush(stderr); if(input_wait((use_window) ? -1 : 4000) < 0) return(5); if(zbar_processor_set_active(proc, 0)) return(3); fprintf(stderr, "video deactivated\n"); fflush(stderr); if(input_wait((use_window) ? -1 : 4000) < 0) return(5); /* FIXME test process_one() */ } if(zbar_process_image(proc, NULL)) return(3); fprintf(stderr, "flushed image\n"); fflush(stderr); if(input_wait((use_window && !video_dev) ? -1 : 2500) < 0) return(5); fprintf(stderr, "cleaning up...\n"); fflush(stderr); zbar_processor_destroy(proc); proc = NULL; if(test_image_check_cleanup()) return(32); return(0); } zbar-0.10/test/test_video.c0000644000000000000000000001233211270371414012550 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #include #include #include #include #include #include #include "test_images.h" #ifdef _WIN32 struct timespec { time_t tv_sec; long tv_nsec; }; #endif zbar_video_t *video; int main (int argc, char *argv[]) { zbar_set_verbosity(31); const char *dev = ""; uint32_t vidfmt = 0; if(argc > 1) { dev = argv[1]; if(argc > 2) { int n = strlen(argv[2]); if(n > 4) n = 4; memcpy((char*)&vidfmt, argv[2], n); } } if(!vidfmt) vidfmt = fourcc('B','G','R','3'); video = zbar_video_create(); if(!video) { fprintf(stderr, "unable to allocate memory?!\n"); return(1); } zbar_video_request_size(video, 640, 480); if(zbar_video_open(video, dev)) { zbar_video_error_spew(video, 0); fprintf(stderr, "ERROR: unable to access your video device\n" "this program requires video capture support using" " v4l version 1 or 2 or VfW\n" " - is your video device located at \"%s\"?\n" " - is your video driver installed? (check dmesg)\n" " - make sure you have the latest drivers\n" " - do you have read/write permission to access it?\n" " - is another application is using it?\n" " - does the device support video capture?\n" " - does the device work with other programs?\n", dev); return(1); } fprintf(stderr, "opened video device: %s (fd=%d)\n", dev, zbar_video_get_fd(video)); fflush(stderr); if(zbar_video_init(video, vidfmt)) { fprintf(stderr, "ERROR: failed to set format: %.4s(%08x)\n", (char*)&vidfmt, vidfmt); return(zbar_video_error_spew(video, 0)); } if(zbar_video_enable(video, 1)) { fprintf(stderr, "ERROR: starting video stream\n"); return(zbar_video_error_spew(video, 0)); } fprintf(stderr, "started video stream...\n"); fflush(stderr); zbar_image_t *image = zbar_video_next_image(video); if(!image) { fprintf(stderr, "ERROR: unable to capture image\n"); return(zbar_video_error_spew(video, 0)); } uint32_t format = zbar_image_get_format(image); unsigned width = zbar_image_get_width(image); unsigned height = zbar_image_get_height(image); const uint8_t *data = zbar_image_get_data(image); fprintf(stderr, "captured image: %d x %d %.4s @%p\n", width, height, (char*)&format, data); fflush(stderr); zbar_image_destroy(image); fprintf(stderr, "\nstreaming 100 frames...\n"); fflush(stderr); struct timespec start, end; #if _POSIX_TIMERS > 0 clock_gettime(CLOCK_REALTIME, &start); #else struct timeval ustime; gettimeofday(&ustime, NULL); start.tv_nsec = ustime.tv_usec * 1000; start.tv_sec = ustime.tv_sec; #endif int i; for(i = 0; i < 100; i++) { zbar_image_t *image = zbar_video_next_image(video); if(!image) { fprintf(stderr, "ERROR: unable to capture image\n"); return(zbar_video_error_spew(video, 0)); } zbar_image_destroy(image); } #if _POSIX_TIMERS > 0 clock_gettime(CLOCK_REALTIME, &end); #else gettimeofday(&ustime, NULL); end.tv_nsec = ustime.tv_usec * 1000; end.tv_sec = ustime.tv_sec; #endif double ms = (end.tv_sec - start.tv_sec + (end.tv_nsec - start.tv_nsec) / 1000000000.); double fps = i / ms; fprintf(stderr, "\nprocessed %d images in %gs @%gfps\n", i, ms, fps); fflush(stderr); if(zbar_video_enable(video, 0)) { fprintf(stderr, "ERROR: while stopping video stream\n"); return(zbar_video_error_spew(video, 0)); } fprintf(stderr, "\ncleaning up...\n"); fflush(stderr); zbar_video_destroy(video); if(test_image_check_cleanup()) return(32); fprintf(stderr, "\nvideo support verified\n\n"); return(0); } zbar-0.10/test/test_gtk.c0000644000000000000000000002140211270371414012225 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include static GtkWidget *window = NULL; static GtkWidget *status_image = NULL; static GtkTextView *results = NULL; static gchar *open_file = NULL; int scan_video(void *add_device, void *userdata, const char *default_device); /* decode signal callback * puts the decoded result in the textbox */ static void decoded (GtkWidget *widget, zbar_symbol_type_t symbol, const char *result, gpointer data) { GtkTextBuffer *resultbuf = gtk_text_view_get_buffer(results); GtkTextIter end; gtk_text_buffer_get_end_iter(resultbuf, &end); gtk_text_buffer_insert(resultbuf, &end, zbar_get_symbol_name(symbol), -1); gtk_text_buffer_insert(resultbuf, &end, zbar_get_addon_name(symbol), -1); gtk_text_buffer_insert(resultbuf, &end, ":", -1); gtk_text_buffer_insert(resultbuf, &end, result, -1); gtk_text_buffer_insert(resultbuf, &end, "\n", -1); gtk_text_view_scroll_to_iter(results, &end, 0, FALSE, 0, 0); } /* update botton state when video state changes */ static void video_enabled (GObject *object, GParamSpec *param, gpointer data) { ZBarGtk *zbar = ZBAR_GTK(object); gboolean enabled = zbar_gtk_get_video_enabled(zbar); gboolean opened = zbar_gtk_get_video_opened(zbar); GtkToggleButton *button = GTK_TOGGLE_BUTTON(data); gboolean active = gtk_toggle_button_get_active(button); if(active != (opened && enabled)) gtk_toggle_button_set_active(button, enabled); } static void video_opened (GObject *object, GParamSpec *param, gpointer data) { ZBarGtk *zbar = ZBAR_GTK(object); gboolean opened = zbar_gtk_get_video_opened(zbar); gboolean enabled = zbar_gtk_get_video_enabled(zbar); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data), opened && enabled); gtk_widget_set_sensitive(GTK_WIDGET(data), opened); } /* (re)open the video when a new device is selected */ static void video_changed (GtkWidget *widget, gpointer data) { const char *video_device = gtk_combo_box_get_active_text(GTK_COMBO_BOX(widget)); zbar_gtk_set_video_device(ZBAR_GTK(data), ((video_device && video_device[0] != '<') ? video_device : NULL)); } static void status_button_toggled (GtkToggleButton *button, gpointer data) { ZBarGtk *zbar = ZBAR_GTK(data); gboolean opened = zbar_gtk_get_video_opened(zbar); gboolean enabled = zbar_gtk_get_video_enabled(zbar); gboolean active = gtk_toggle_button_get_active(button); if(opened && (active != enabled)) zbar_gtk_set_video_enabled(ZBAR_GTK(data), active); gtk_image_set_from_stock(GTK_IMAGE(status_image), (opened && active) ? GTK_STOCK_YES : GTK_STOCK_NO, GTK_ICON_SIZE_BUTTON); gtk_button_set_label(GTK_BUTTON(button), (!opened) ? "closed" : (active) ? "enabled" : "disabled"); } static void open_button_clicked (GtkButton *button, gpointer data) { GtkWidget *dialog = gtk_file_chooser_dialog_new("Open Image File", GTK_WINDOW(window), GTK_FILE_CHOOSER_ACTION_OPEN, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT, NULL); GtkFileChooser *chooser = GTK_FILE_CHOOSER(dialog); if(open_file) gtk_file_chooser_set_filename(chooser, open_file); if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { gchar *file = gtk_file_chooser_get_filename(chooser); GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file(file, NULL); if(pixbuf) zbar_gtk_scan_image(ZBAR_GTK(data), pixbuf); else fprintf(stderr, "ERROR: unable to open image file: %s\n", file); if(open_file && file) g_free(open_file); open_file = file; } gtk_widget_destroy(dialog); } /* build a simple gui w/: * - a combo box to select the desired video device * - the zbar widget to display video * - a non-editable text box to display any results */ int main (int argc, char *argv[]) { g_thread_init(NULL); gdk_threads_init(); gdk_threads_enter(); gtk_init(&argc, &argv); const char *video_arg = NULL; if(argc > 1) video_arg = argv[1]; window = gtk_window_new(GTK_WINDOW_TOPLEVEL); gtk_window_set_title(GTK_WINDOW(window), "test_gtk"); gtk_container_set_border_width(GTK_CONTAINER(window), 8); g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(gtk_main_quit), NULL); GtkWidget *zbar = zbar_gtk_new(); g_signal_connect(G_OBJECT(zbar), "decoded", G_CALLBACK(decoded), NULL); /* video device list combo box */ GtkWidget *video_list = gtk_combo_box_new_text(); g_signal_connect(G_OBJECT(video_list), "changed", G_CALLBACK(video_changed), zbar); /* enable/disable status button */ GtkWidget *status_button = gtk_toggle_button_new(); status_image = gtk_image_new_from_stock(GTK_STOCK_NO, GTK_ICON_SIZE_BUTTON); gtk_button_set_image(GTK_BUTTON(status_button), status_image); gtk_button_set_label(GTK_BUTTON(status_button), "closed"); gtk_widget_set_sensitive(status_button, FALSE); /* bind status button state and video state */ g_signal_connect(G_OBJECT(status_button), "toggled", G_CALLBACK(status_button_toggled), zbar); g_signal_connect(G_OBJECT(zbar), "notify::video-enabled", G_CALLBACK(video_enabled), status_button); g_signal_connect(G_OBJECT(zbar), "notify::video-opened", G_CALLBACK(video_opened), status_button); /* open image file button */ GtkWidget *open_button = gtk_button_new_from_stock(GTK_STOCK_OPEN); g_signal_connect(G_OBJECT(open_button), "clicked", G_CALLBACK(open_button_clicked), zbar); gtk_combo_box_append_text(GTK_COMBO_BOX(video_list), ""); int active = scan_video(gtk_combo_box_append_text, video_list, video_arg); if(active >= 0) gtk_combo_box_set_active(GTK_COMBO_BOX(video_list), active); /* hbox for combo box and buttons */ GtkWidget *hbox = gtk_hbox_new(FALSE, 8); gtk_box_pack_start(GTK_BOX(hbox), video_list, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), status_button, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(hbox), open_button, FALSE, FALSE, 0); /* text box for holding results */ results = GTK_TEXT_VIEW(gtk_text_view_new()); gtk_widget_set_size_request(GTK_WIDGET(results), 320, 64); gtk_text_view_set_editable(results, FALSE); gtk_text_view_set_cursor_visible(results, FALSE); gtk_text_view_set_left_margin(results, 4); /* vbox for hbox, zbar test widget and result text box */ GtkWidget *vbox = gtk_vbox_new(FALSE, 8); gtk_container_add(GTK_CONTAINER(window), vbox); gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0); gtk_box_pack_start(GTK_BOX(vbox), zbar, TRUE, TRUE, 0); gtk_box_pack_start(GTK_BOX(vbox), GTK_WIDGET(results), FALSE, FALSE, 0); GdkGeometry hints; hints.min_width = 320; hints.min_height = 240; gtk_window_set_geometry_hints(GTK_WINDOW(window), zbar, &hints, GDK_HINT_MIN_SIZE); gtk_widget_show_all(window); gtk_main(); gdk_threads_leave(); return(0); } zbar-0.10/test/test_images.c0000644000000000000000000002750611270371414012720 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #ifdef HAVE_INTTYPES_H # include #endif #include #include #include #include #include #include "test_images.h" typedef enum format_type_e { GRAY, YUVP, YVUP, YUYV, YVYU, UYVY, RGB888, BGR888, RGB565B = 0x0565, RGB565L = 0x1565, RGB555B = 0x0555, RGB555L = 0x1555, } format_type_t; typedef struct format_def_s { uint32_t format; format_type_t type; uint8_t bpp; uint8_t xdiv, ydiv; } format_def_t; typedef union packed_u { uint32_t u32[3]; uint16_t u16[6]; uint8_t u8[12]; } packed_t; /* bar colors */ static const uint8_t Cr[] = { 0x22, 0x92, 0x80, 0xf0, 0x10, 0x80, 0x6e, 0xde }; static const uint8_t Cb[] = { 0x36, 0x10, 0x80, 0x5a, 0xa6, 0x80, 0xf0, 0xca }; static const format_def_t formats[] = { { fourcc('G','R','E','Y'), GRAY, 8, 0,0 }, { fourcc('Y','8','0','0'), GRAY, 8, 0,0 }, { fourcc('Y','8',' ',' '), GRAY, 8, 0,0 }, { fourcc('Y','8', 0 , 0 ), GRAY, 8, 0,0 }, { fourcc('Y','U','V','9'), YUVP, 9, 4,4 }, { fourcc('Y','V','U','9'), YVUP, 9, 4,4 }, { fourcc('I','4','2','0'), YUVP, 12, 2,2 }, { fourcc('Y','U','1','2'), YUVP, 12, 2,2 }, { fourcc('Y','V','1','2'), YVUP, 12, 2,2 }, { fourcc('4','1','1','P'), YUVP, 12, 4,1 }, { fourcc('N','V','1','2'), YUVP, 12, 2,2 }, { fourcc('N','V','2','1'), YVUP, 12, 2,2 }, { fourcc('4','2','2','P'), YUVP, 16, 2,1 }, { fourcc('Y','U','Y','V'), YUYV, 16, 2,1 }, { fourcc('Y','U','Y','2'), YUYV, 16, 2,1 }, { fourcc('Y','V','Y','U'), YVYU, 16, 2,1 }, { fourcc('U','Y','V','Y'), UYVY, 16, 2,1 }, { fourcc('R','G','B','3'), RGB888, 24, }, { fourcc('B','G','R','3'), BGR888, 24, }, { fourcc( 3 , 0 , 0 , 0 ), RGB888, 32, }, { fourcc('R','G','B','4'), RGB888, 32, }, { fourcc('B','G','R','4'), BGR888, 32, }, { fourcc('R','G','B','P'), RGB565L, 16, }, { fourcc('R','G','B','O'), RGB555L, 16, }, { fourcc('R','G','B','R'), RGB565B, 16, }, { fourcc('R','G','B','Q'), RGB555B, 16, }, { 0 } }; static int allocated_images = 0; int test_image_check_cleanup () { if(allocated_images) fprintf(stderr, "ERROR: %d image data buffers still allocated\n", allocated_images); else fprintf(stderr, "all image data buffers freed\n"); return(allocated_images); } static void test_cleanup_handler (zbar_image_t *img) { void *data = (void*)zbar_image_get_data(img); fprintf(stderr, "cleanup image data @%p\n", data); free(data); allocated_images--; } /* write intensity plane */ static inline uint8_t *fill_bars_y (uint8_t *p, unsigned w, unsigned h) { unsigned x, y, i; unsigned y0 = (h + 31) / 30; for(y = 0; y < y0; y++) for(x = 0; x < w; x++) *(p++) = 0xff; for(; y < h - y0; y++) for(x = 0, i = 0; x < w; i++) { assert(i < 8); unsigned x0 = (((i + 1) * w) + 7) >> 3; assert(x0 <= w); unsigned v = ((((i & 1) ? y : h - y) * 256) + h - 1) / h; for(; x < x0; x++) *(p++) = v; } for(; y < h; y++) for(x = 0; x < w; x++) *(p++) = 0xff; return(p); } /* write Cb (U) or Cr (V) plane */ static inline uint8_t *fill_bars_uv (uint8_t *p, unsigned w, unsigned h, const uint8_t *C) { unsigned x, y, i; unsigned y0 = (h + 31) / 30; for(y = 0; y < y0; y++) for(x = 0; x < w; x++) *(p++) = 0x80; for(; y < h - y0; y++) for(x = 0, i = 0; x < w; i++) { assert(i < 8); unsigned x0 = (((i + 1) * w) + 7) >> 3; assert(x0 <= w); for(; x < x0; x++) *(p++) = C[i]; } for(; y < h; y++) for(x = 0; x < w; x++) *(p++) = 0x80; return(p); } /* write packed CbCr plane */ static inline uint8_t *fill_bars_nv (uint8_t *p, unsigned w, unsigned h, format_type_t order) { unsigned x, y, i; unsigned y0 = (h + 31) / 30; for(y = 0; y < y0; y++) for(x = 0; x < w; x++) { *(p++) = 0x80; *(p++) = 0x80; } for(; y < h - y0; y++) for(x = 0, i = 0; x < w; i++) { assert(i < 8); unsigned x0 = (((i + 1) * w) + 7) >> 3; assert(x0 <= w); uint8_t u = (order == YUVP) ? Cb[i] : Cr[i]; uint8_t v = (order == YUVP) ? Cr[i] : Cb[i]; for(; x < x0; x++) { *(p++) = u; *(p++) = v; } } for(; y < h; y++) for(x = 0; x < w; x++) { *(p++) = 0x80; *(p++) = 0x80; } return(p); } /* write packed YCbCr plane */ static inline uint8_t *fill_bars_yuv (uint8_t *p, unsigned w, unsigned h, format_type_t order) { unsigned x, y, i; unsigned y0 = (h + 31) / 30; packed_t yuv; uint32_t *q = (uint32_t*)p; w /= 2; yuv.u8[0] = yuv.u8[2] = (order == UYVY) ? 0x80 : 0xff; yuv.u8[1] = yuv.u8[3] = (order == UYVY) ? 0xff : 0x80; for(y = 0; y < y0; y++) for(x = 0; x < w; x++) *(q++) = yuv.u32[0]; for(; y < h - y0; y++) for(x = 0, i = 0; x < w; i++) { assert(i < 8); unsigned x0 = (((i + 1) * w) + 7) >> 3; assert(x0 <= w); unsigned v = ((((i & 1) ? y : h - y) * 256) + h - 1) / h; if(order == UYVY) { yuv.u8[0] = Cb[i]; yuv.u8[2] = Cr[i]; yuv.u8[1] = yuv.u8[3] = v; } else { yuv.u8[0] = yuv.u8[2] = v; yuv.u8[1] = (order == YUYV) ? Cb[i] : Cr[i]; yuv.u8[3] = (order == YVYU) ? Cr[i] : Cb[i]; } for(; x < x0; x++) *(q++) = yuv.u32[0]; } yuv.u8[0] = yuv.u8[2] = (order == UYVY) ? 0x80 : 0xff; yuv.u8[1] = yuv.u8[3] = (order == UYVY) ? 0xff : 0x80; for(; y < h; y++) for(x = 0; x < w; x++) *(q++) = yuv.u32[0]; return((uint8_t*)q); } static inline uint8_t *fill_bars_rgb (uint8_t *p, unsigned w, unsigned h, format_type_t order, int bpp) { unsigned x, y, i; unsigned y0 = (h + 31) / 30; packed_t rgb; unsigned headlen = y0 * w * bpp / 8; memset(p, 0xff, headlen); uint32_t *q = (uint32_t*)(p + headlen); for(y = y0; y < h - y0; y++) for(x = 0, i = 0; x < w; i++) { assert(i < 8); /* FIXME clean this up... */ unsigned x0 = (((i + 1) * w) + 7) >> 3; assert(x0 <= w); unsigned yi = (i & 1) ? y : h - y; unsigned v1, v0; if(yi < h / 2 - 1) { v1 = ((yi * 0x180) + h - 1) / h + 0x40; v0 = 0x00; } else { v1 = 0xff; v0 = (((yi - (h / 2)) * 0x180) + h - 1) / h + 0x40; } uint8_t r = (i & 4) ? v1 : v0; uint8_t g = (i & 2) ? v1 : v0; uint8_t b = (i & 1) ? v1 : v0; if(bpp == 32) { if(order == RGB888) { rgb.u8[0] = 0xff; rgb.u8[1] = r; rgb.u8[2] = g; rgb.u8[3] = b; } else { rgb.u8[0] = b; rgb.u8[1] = g; rgb.u8[2] = r; rgb.u8[3] = 0xff; } for(; x < x0; x++) *(q++) = rgb.u32[0]; } else if(bpp == 24) { rgb.u8[0] = rgb.u8[3] = rgb.u8[6] = rgb.u8[9] = (order == RGB888) ? r : b; rgb.u8[1] = rgb.u8[4] = rgb.u8[7] = rgb.u8[10] = g; rgb.u8[2] = rgb.u8[5] = rgb.u8[8] = rgb.u8[11] = (order == RGB888) ? b : r; for(; x < x0; x += 4) { *(q++) = rgb.u32[0]; *(q++) = rgb.u32[1]; *(q++) = rgb.u32[2]; } } else { assert(bpp == 16); r = ((r + 7) / 8) & 0x1f; b = ((b + 7) / 8) & 0x1f; if((order & 0x0fff) == 0x0555) { g = ((g + 7) / 8) & 0x1f; rgb.u16[0] = b | (g << 5) | (r << 10); } else { g = ((g + 3) / 4) & 0x3f; rgb.u16[0] = b | (g << 5) | (r << 11); } if(order & 0x1000) rgb.u16[0] = (rgb.u16[0] >> 8) | (rgb.u16[0] << 8); rgb.u16[1] = rgb.u16[0]; for(; x < x0; x += 2) *(q++) = rgb.u32[0]; } } memset(q, 0xff, headlen); return(((uint8_t*)q) + headlen); } int test_image_bars (zbar_image_t *img) { allocated_images++; unsigned w = zbar_image_get_width(img); unsigned h = zbar_image_get_height(img); const format_def_t *fmt; for(fmt = formats; fmt->format; fmt++) if(fmt->format == zbar_image_get_format(img)) break; if(!fmt->format) return(-1); unsigned long planelen = w * h; unsigned long datalen = planelen * fmt->bpp / 8; uint8_t *data = malloc(datalen); zbar_image_set_data(img, data, datalen, test_cleanup_handler); fprintf(stderr, "create %.4s(%08" PRIx32 ") image data %lx bytes @%p\n", (char*)&fmt->format, fmt->format, datalen, data); uint8_t *p = data; switch(fmt->type) { case GRAY: case YUVP: /* planar YUV */ case YVUP: p = fill_bars_y(p, w, h); if(fmt->type != GRAY) { w = (w + fmt->xdiv - 1) / fmt->xdiv; h = (h + fmt->ydiv - 1) / fmt->ydiv; } else break; if(fmt->format == fourcc('N','V','1','2') || fmt->format == fourcc('N','V','2','1')) p = fill_bars_nv(p, w, h, fmt->type); else if(fmt->type == YUVP || fmt->type == YVUP) { p = fill_bars_uv(p, w, h, (fmt->type == YUVP) ? Cb : Cr); p = fill_bars_uv(p, w, h, (fmt->type == YUVP) ? Cr : Cb); } break; case YUYV: /* packed YUV */ case YVYU: case UYVY: p = fill_bars_yuv(p, w, h, fmt->type); break; default: /* RGB */ p = fill_bars_rgb(p, w, h, fmt->type, fmt->bpp); break; } assert(p == data + datalen); return(0); } zbar-0.10/test/Makefile.am.inc0000644000000000000000000000455111270371414013047 00000000000000check_PROGRAMS += test/test_decode test_test_decode_SOURCES = test/test_decode.c test/pdf417_encode.h test_test_decode_CFLAGS = -Wno-unused $(AM_CFLAGS) test_test_decode_LDADD = zbar/libzbar.la $(AM_LDADD) TEST_IMAGE_SOURCES = test/test_images.c test/test_images.h check_PROGRAMS += test/test_convert test_test_convert_SOURCES = test/test_convert.c $(TEST_IMAGE_SOURCES) test_test_convert_LDADD = zbar/libzbar.la $(AM_LDADD) #check_PROGRAMS += test/test_window #test_test_window_SOURCES = test/test_window.c $(TEST_IMAGE_SOURCES) #test_test_window_CPPFLAGS = -I$(srcdir)/zbar $(AM_CPPFLAGS) #test_test_window_LDADD = zbar/libzbar.la $(AM_LDADD) if HAVE_VIDEO check_PROGRAMS += test/test_video test_test_video_SOURCES = test/test_video.c $(TEST_IMAGE_SOURCES) test_test_video_LDADD = zbar/libzbar.la $(AM_LDADD) endif check_PROGRAMS += test/test_proc test_test_proc_SOURCES = test/test_proc.c $(TEST_IMAGE_SOURCES) test_test_proc_LDADD = zbar/libzbar.la $(AM_LDADD) check_PROGRAMS += test/test_cpp test_test_cpp_SOURCES = test/test_cpp.cpp test_test_cpp_LDADD = zbar/libzbar.la $(AM_LDADD) if HAVE_JPEG check_PROGRAMS += test/test_jpeg test_test_jpeg_SOURCES = test/test_jpeg.c test_test_jpeg_LDADD = zbar/libzbar.la $(AM_LDADD) endif if HAVE_MAGICK EXTRA_PROGRAMS += test/dbg_scan test_dbg_scan_SOURCES = test/dbg_scan.cpp test_dbg_scan_CPPFLAGS = $(MAGICK_CFLAGS) $(AM_CPPFLAGS) test_dbg_scan_LDADD = $(MAGICK_LIBS) -lMagick++ zbar/libzbar.la $(AM_LDADD) endif if HAVE_GTK check_PROGRAMS += test/test_gtk test_test_gtk_SOURCES = test/test_gtk.c test/scan_video.c test_test_gtk_CPPFLAGS = $(GTK_CFLAGS) $(AM_CPPFLAGS) test_test_gtk_LDADD = $(GTK_LIBS) gtk/libzbargtk.la $(AM_LDADD) endif if HAVE_QT check_PROGRAMS += test/test_qt test_test_qt_SOURCES = test/test_qt.cpp test/scan_video.c nodist_test_test_qt_SOURCES = test/moc_test_qt.h test_test_qt_CPPFLAGS = -Itest $(QT_CFLAGS) $(AM_CPPFLAGS) test_test_qt_LDADD = $(QT_LIBS) qt/libzbarqt.la $(AM_LDADD) BUILT_SOURCES += $(nodist_test_test_qt_SOURCES) DISTCLEANFILES += $(nodist_test_test_qt_SOURCES) test/moc_%.h: test/%.cpp $(MOC) -i $(test_test_qt_CPPFLAGS) $< -o $@ endif EXTRA_DIST += test/test_pygtk.py test/test_perl.pl # automake bug in "monolithic mode"? CLEANFILES += test/.libs/test_decode test/.libs/test_proc \ test/.libs/test_convert test/.libs/test_window \ test/.libs/test_video test/.libs/dbg_scan test/.libs/test_gtk zbar-0.10/test/test_decode.c0000644000000000000000000003544311270371414012675 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include #include #include #include zbar_decoder_t *decoder; static void symbol_handler (zbar_decoder_t *decoder) { zbar_symbol_type_t sym = zbar_decoder_get_type(decoder); if(sym <= ZBAR_PARTIAL) return; printf("%s%s:%s\n", zbar_get_symbol_name(sym), zbar_get_addon_name(sym), zbar_decoder_get_data(decoder)); /* FIXME add check! */ } static void encode_junk (int n) { printf("encode random junk...\n"); int i; for(i = 0; i < n; i++) zbar_decode_width(decoder, 10. * (rand() / (RAND_MAX + 1.))); } #define FWD 1 #define REV 0 static void encode (uint64_t units, int fwd) { printf(" raw=%x%x%c\n", (unsigned)(units >> 32), (unsigned)(units & 0xffffffff), (fwd) ? '<' : '>'); if(!fwd) while(units && !(units >> 0x3c)) units <<= 4; while(units) { unsigned char w = (fwd) ? units & 0xf : units >> 0x3c; zbar_decode_width(decoder, w); if(fwd) units >>= 4; else units <<= 4; } } /*------------------------------------------------------------*/ /* Code 128 encoding */ typedef enum code128_char_e { FNC3 = 0x60, FNC2 = 0x61, SHIFT = 0x62, CODE_C = 0x63, CODE_B = 0x64, CODE_A = 0x65, FNC1 = 0x66, START_A = 0x67, START_B = 0x68, START_C = 0x69, STOP = 0x6a, } code128_char_t; static const unsigned int code128[107] = { 0x212222, 0x222122, 0x222221, 0x121223, /* 00 */ 0x121322, 0x131222, 0x122213, 0x122312, 0x132212, 0x221213, 0x221312, 0x231212, /* 08 */ 0x112232, 0x122132, 0x122231, 0x113222, 0x123122, 0x123221, 0x223211, 0x221132, /* 10 */ 0x221231, 0x213212, 0x223112, 0x312131, 0x311222, 0x321122, 0x321221, 0x312212, /* 18 */ 0x322112, 0x322211, 0x212123, 0x212321, 0x232121, 0x111323, 0x131123, 0x131321, /* 20 */ 0x112313, 0x132113, 0x132311, 0x211313, 0x231113, 0x231311, 0x112133, 0x112331, /* 28 */ 0x132131, 0x113123, 0x113321, 0x133121, 0x313121, 0x211331, 0x231131, 0x213113, /* 30 */ 0x213311, 0x213131, 0x311123, 0x311321, 0x331121, 0x312113, 0x312311, 0x332111, /* 38 */ 0x314111, 0x221411, 0x431111, 0x111224, 0x111422, 0x121124, 0x121421, 0x141122, /* 40 */ 0x141221, 0x112214, 0x112412, 0x122114, 0x122411, 0x142112, 0x142211, 0x241211, /* 48 */ 0x221114, 0x413111, 0x241112, 0x134111, 0x111242, 0x121142, 0x121241, 0x114212, /* 50 */ 0x124112, 0x124211, 0x411212, 0x421112, 0x421211, 0x212141, 0x214121, 0x412121, /* 58 */ 0x111143, 0x111341, 0x131141, 0x114113, 0x114311, 0x411113, 0x411311, 0x113141, /* 60 */ 0x114131, 0x311141, 0x411131, 0xa211412, 0xa211214, 0xa211232, /* START_A-START_C (67-69) */ 0x2331112a, /* STOP (6a) */ }; static void encode_code128b (unsigned char *data) { printf("------------------------------------------------------------\n" "encode CODE-128(B): %s\n" " encode START_B: %02x", data, START_B); encode(code128[START_B], 0); int i, chk = START_B; for(i = 0; data[i]; i++) { printf(" encode '%c': %02x", data[i], data[i] - 0x20); encode(code128[data[i] - 0x20], 0); chk += (i + 1) * (data[i] - 0x20); } chk %= 103; printf(" encode checksum: %02x", chk); encode(code128[chk], 0); printf(" encode STOP: %02x", STOP); encode(code128[STOP], 0); printf("------------------------------------------------------------\n"); } static void encode_code128c (unsigned char *data) { printf("------------------------------------------------------------\n" "encode CODE-128(C): %s\n" " encode START_C: %02x", data, START_C); encode(code128[START_C], 0); int i, chk = START_C; for(i = 0; data[i]; i += 2) { assert(data[i] >= '0'); assert(data[i + 1] >= '0'); unsigned char c = (data[i] - '0') * 10 + (data[i + 1] - '0'); printf(" encode '%c%c': %02d", data[i], data[i + 1], c); encode(code128[c], 0); chk += (i / 2 + 1) * c; } chk %= 103; printf(" encode checksum: %02x", chk); encode(code128[chk], 0); printf(" encode STOP: %02x", STOP); encode(code128[STOP], 0); printf("------------------------------------------------------------\n"); } /*------------------------------------------------------------*/ /* Code 39 encoding */ static const unsigned int code39[91-32] = { 0x0c4, 0x000, 0x000, 0x000, 0x0a8, 0x02a, 0x000, 0x000, /* 20 */ 0x000, 0x000, 0x094, 0x08a, 0x000, 0x085, 0x184, 0x0a2, /* 28 */ 0x034, 0x121, 0x061, 0x160, 0x031, 0x130, 0x070, 0x025, /* 30 */ 0x124, 0x064, 0x000, 0x000, 0x000, 0x000, 0x000, 0x000, /* 38 */ 0x000, 0x109, 0x049, 0x148, 0x019, 0x118, 0x058, 0x00d, /* 40 */ 0x10c, 0x04c, 0x01c, 0x103, 0x043, 0x142, 0x013, 0x112, /* 48 */ 0x052, 0x007, 0x106, 0x046, 0x016, 0x181, 0x0c1, 0x1c0, /* 50 */ 0x091, 0x190, 0x0d0, /* 58 */ }; /* FIXME configurable/randomized ratio, ics */ /* FIXME check digit option, ASCII escapes */ static void encode_char39 (unsigned char c, unsigned ics) { if(c >= 'a' && c <= 'z') c -= 'a' - 'A'; else if(c < 0x20 || c > 0x5a) return; /* skip (FIXME) */ unsigned int raw = code39[c - 0x20]; if(!raw) return; /* skip (FIXME) */ uint64_t enc = 0; int j; for(j = 0; j < 9; j++) { enc = (enc << 4) | ((raw & 0x100) ? 2 : 1); raw <<= 1; } enc = (enc << 4) | ics; printf(" encode '%c': %02x%08x: ", c, (unsigned)(enc >> 32), (unsigned)(enc & 0xffffffff)); encode(enc, REV); } static void encode_code39 (unsigned char *data) { printf("------------------------------------------------------------\n" "encode CODE-39: %s\n", data); encode(0xa, 0); /* leading quiet */ encode_char39('*', 1); int i; for(i = 0; data[i]; i++) if(data[i] != '*') /* skip (FIXME) */ encode_char39(data[i], 1); encode_char39('*', 0xa); /* w/trailing quiet */ printf("------------------------------------------------------------\n"); } /*------------------------------------------------------------*/ /* PDF417 encoding */ /* hardcoded test message: "hello world" */ #define PDF417_ROWS 3 #define PDF417_COLS 3 static const unsigned pdf417_msg[PDF417_ROWS][PDF417_COLS] = { { 007, 817, 131 }, { 344, 802, 437 }, { 333, 739, 194 }, }; #define PDF417_START UINT64_C(0x81111113) #define PDF417_STOP UINT64_C(0x711311121) #include "pdf417_encode.h" static int calc_ind417 (int mod, int r, int cols) { mod = (mod + 3) % 3; int cw = 30 * (r / 3); if(!mod) return(cw + cols - 1); else if(mod == 1) return(cw + (PDF417_ROWS - 1) % 3); assert(mod == 2); return(cw + (PDF417_ROWS - 1) / 3); } static void encode_row417 (int r, const unsigned *cws, int cols, int dir) { int k = r % 3; printf(" [%d] encode %s:", r, (dir) ? "stop" : "start"); encode((dir) ? PDF417_STOP : PDF417_START, dir); int cw = calc_ind417(k + !dir, r, cols); printf(" [%d,%c] encode %03d(%d): ", r, (dir) ? 'R' : 'L', cw, k); encode(pdf417_encode[cw][k], dir); int c; for(c = 0; c < cols; c++) { cw = cws[c]; printf(" [%d,%d] encode %03d(%d): ", r, c, cw, k); encode(pdf417_encode[cw][k], dir); } cw = calc_ind417(k + dir, r, cols); printf(" [%d,%c] encode %03d(%d): ", r, (dir) ? 'L' : 'R', cw, k); encode(pdf417_encode[cw][k], dir); printf(" [%d] encode %s:", r, (dir) ? "start" : "stop"); encode((dir) ? PDF417_START : PDF417_STOP, dir); } static void encode_pdf417 (unsigned char *data) { printf("------------------------------------------------------------\n" "encode PDF417: hello world\n"); encode(0xa, 0); int r; for(r = 0; r < PDF417_ROWS; r++) { encode_row417(r, pdf417_msg[r], PDF417_COLS, r & 1); encode(0xa, 0); } printf("------------------------------------------------------------\n"); } /*------------------------------------------------------------*/ /* Interleaved 2 of 5 encoding */ static const unsigned char i25[10] = { 0x06, 0x11, 0x09, 0x18, 0x05, 0x14, 0x0c, 0x03, 0x12, 0x0a, }; static void encode_i25 (unsigned char *data, int dir) { printf("------------------------------------------------------------\n" "encode Interleaved 2 of 5: %s\n" " encode start:", data); encode((dir) ? 0xa1111 : 0xa112, 0); /* FIXME rev case data reversal */ int i; for(i = (strlen((char*)data) & 1) ? -1 : 0; i < 0 || data[i]; i += 2) { /* encode 2 digits */ unsigned char c0 = (i < 0) ? 0 : data[i] - '0'; unsigned char c1 = data[i + 1] - '0'; printf(" encode '%d%d':", c0, c1); assert(c0 < 10); assert(c1 < 10); c0 = i25[c0]; c1 = i25[c1]; /* interleave */ uint64_t enc = 0; int j; for(j = 0; j < 5; j++) { enc <<= 8; enc |= (c0 & 1) ? 0x02 : 0x01; enc |= (c1 & 1) ? 0x20 : 0x10; c0 >>= 1; c1 >>= 1; } encode(enc, dir); } printf(" encode end:"); encode((dir) ? 0x211a : 0x1111a, 0); printf("------------------------------------------------------------\n"); } /*------------------------------------------------------------*/ /* EAN/UPC encoding */ static const unsigned int ean_digits[10] = { 0x1123, 0x1222, 0x2212, 0x1141, 0x2311, 0x1321, 0x4111, 0x2131, 0x3121, 0x2113, }; static const unsigned int ean_guard[] = { 0, 0, 0x11, /* [2] add-on delineator */ 0x1117, /* [3] normal guard bars */ 0x2117, /* [4] add-on guard bars */ 0x11111, /* [5] center guard bars */ 0x111111 /* [6] "special" guard bars */ }; static const unsigned char ean_parity_encode[] = { 0x3f, /* AAAAAA = 0 */ 0x34, /* AABABB = 1 */ 0x32, /* AABBAB = 2 */ 0x31, /* AABBBA = 3 */ 0x2c, /* ABAABB = 4 */ 0x26, /* ABBAAB = 5 */ 0x23, /* ABBBAA = 6 */ 0x2a, /* ABABAB = 7 */ 0x29, /* ABABBA = 8 */ 0x25, /* ABBABA = 9 */ }; static void calc_ean_parity (unsigned char *data, int n) { int i, chk = 0; for(i = 0; i < n; i++) { unsigned char c = data[i] - '0'; chk += ((i ^ n) & 1) ? c * 3 : c; } chk %= 10; if(chk) chk = 10 - chk; data[i++] = '0' + chk; data[i] = 0; } static void encode_ean13 (unsigned char *data) { int i; unsigned char par = ean_parity_encode[data[0] - '0']; printf("------------------------------------------------------------\n" "encode EAN-13: %s (%02x)\n" " encode start guard:", data, par); encode(ean_guard[3], FWD); for(i = 1; i < 7; i++, par <<= 1) { printf(" encode %x%c:", (par >> 5) & 1, data[i]); encode(ean_digits[data[i] - '0'], REV ^ ((par >> 5) & 1)); } printf(" encode center guard:"); encode(ean_guard[5], FWD); for(; i < 13; i++) { printf(" encode %x%c:", 0, data[i]); encode(ean_digits[data[i] - '0'], FWD); } printf(" encode end guard:"); encode(ean_guard[3], REV); printf("------------------------------------------------------------\n"); } static void encode_ean8 (unsigned char *data) { int i; printf("------------------------------------------------------------\n" "encode EAN-8: %s\n" " encode start guard:", data); encode(ean_guard[3], FWD); for(i = 0; i < 4; i++) { printf(" encode %c:", data[i]); encode(ean_digits[data[i] - '0'], FWD); } printf(" encode center guard:"); encode(ean_guard[5], FWD); for(; i < 8; i++) { printf(" encode %c:", data[i]); encode(ean_digits[data[i] - '0'], FWD); } printf(" encode end guard:"); encode(ean_guard[3], REV); printf("------------------------------------------------------------\n"); } /*------------------------------------------------------------*/ /* main test flow */ int main (int argc, char **argv) { int i; int rnd_size = 9; /* should be odd */ srand(0xbabeface); /* FIXME TBD: * - random module width (!= 1.0) * - simulate scan speed variance * - simulate dark "swelling" and light "blooming" * - inject parity errors */ decoder = zbar_decoder_create(); zbar_decoder_set_handler(decoder, symbol_handler); zbar_decoder_set_config(decoder, 0, ZBAR_CFG_MIN_LEN, 0); encode_junk(rnd_size + 1); unsigned char data[32] = { 0 }; for(i = 0; i < 12; i++) data[i] = (rand() % 10) + '0'; calc_ean_parity(data, 12); encode_ean13(data); encode_junk(rnd_size); data[i] = 0; encode_code128c(data); encode_junk(rnd_size); encode_i25(data, FWD); encode_junk(rnd_size); encode_i25(data, REV); encode_junk(rnd_size); calc_ean_parity(data, 7); encode_ean8(data); encode_junk(rnd_size); for(i = 0; i < 10; i++) data[i] = (rand() % 0x5f) + 0x20; data[i] = 0; encode_code128b(data); encode_junk(rnd_size); /*encode_code39("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%");*/ encode_code39(data); encode_junk(rnd_size); encode_pdf417(data); encode_junk(rnd_size); zbar_decoder_destroy(decoder); return(0); } zbar-0.10/test/test_qt.cpp0000644000000000000000000001206611270371414012432 00000000000000//------------------------------------------------------------------------ // Copyright 2008-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #include #include #include #include #include #include #include #include #include #define TEST_IMAGE_FORMATS \ "Image Files (*.png *.jpg *.jpeg *.bmp *.gif *.ppm *.pgm *.pbm *.tiff *.xpm *.xbm)" extern "C" { int scan_video(void *add_device, void *userdata, const char *default_device); } class TestQZBar : public QWidget { Q_OBJECT protected: static void add_device (QComboBox *list, const char *device) { list->addItem(QString(device)); } public: TestQZBar (const char *default_device) { // drop-down list of video devices QComboBox *videoList = new QComboBox; // toggle button to disable/enable video QPushButton *statusButton = new QPushButton; QStyle *style = QApplication::style(); QIcon statusIcon = style->standardIcon(QStyle::SP_DialogNoButton); QIcon yesIcon = style->standardIcon(QStyle::SP_DialogYesButton); statusIcon.addPixmap(yesIcon.pixmap(QSize(128, 128), QIcon::Normal, QIcon::On), QIcon::Normal, QIcon::On); statusButton->setIcon(statusIcon); statusButton->setText("&Enable"); statusButton->setCheckable(true); statusButton->setEnabled(false); // command button to open image files for scanning QPushButton *openButton = new QPushButton("&Open"); QIcon openIcon = style->standardIcon(QStyle::SP_DialogOpenButton); openButton->setIcon(openIcon); // collect video list and buttons horizontally QHBoxLayout *hbox = new QHBoxLayout; hbox->addWidget(videoList, 5); hbox->addWidget(statusButton, 1); hbox->addWidget(openButton, 1); // video barcode scanner zbar = new zbar::QZBar; zbar->setAcceptDrops(true); // text box for results QTextEdit *results = new QTextEdit; results->setReadOnly(true); QVBoxLayout *vbox = new QVBoxLayout; vbox->addLayout(hbox); vbox->addWidget(zbar); vbox->addWidget(results); setLayout(vbox); videoList->addItem(""); int active = scan_video((void*)add_device, videoList, default_device); // directly connect combo box change signal to scanner video open connect(videoList, SIGNAL(currentIndexChanged(const QString&)), zbar, SLOT(setVideoDevice(const QString&))); // directly connect status button state to video enabled state connect(statusButton, SIGNAL(toggled(bool)), zbar, SLOT(setVideoEnabled(bool))); // also update status button state when video is opened/closed connect(zbar, SIGNAL(videoOpened(bool)), statusButton, SLOT(setEnabled(bool))); // enable/disable status button when video is opened/closed connect(zbar, SIGNAL(videoOpened(bool)), statusButton, SLOT(setChecked(bool))); // prompt for image file to scan when openButton is clicked connect(openButton, SIGNAL(clicked()), SLOT(openImage())); // directly connect video scanner decode result to display in text box connect(zbar, SIGNAL(decodedText(const QString&)), results, SLOT(append(const QString&))); if(active >= 0) videoList->setCurrentIndex(active); } public Q_SLOTS: void openImage () { file = QFileDialog::getOpenFileName(this, "Open Image", file, TEST_IMAGE_FORMATS); if(!file.isEmpty()) zbar->scanImage(QImage(file)); } private: QString file; zbar::QZBar *zbar; }; #include "moc_test_qt.h" int main (int argc, char *argv[]) { QApplication app(argc, argv); const char *dev = NULL; if(argc > 1) dev = argv[1]; TestQZBar window(dev); window.show(); return(app.exec()); } zbar-0.10/test/dbg_scan.cpp0000644000000000000000000002114211270371414012502 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include #include #include using namespace std; using namespace zbar; #ifndef ZBAR_FIXED # define ZBAR_FIXED 5 #endif #define ZBAR_FRAC (1 << ZBAR_FIXED) Decoder decoder; Scanner scanner; /* undocumented API for drawing cutesy debug graphics */ extern "C" void zbar_scanner_get_state(const zbar_scanner_t *scn, unsigned *x, unsigned *cur_edge, unsigned *last_edge, int *y0, int *y1, int *y2, int *y1_thresh); void scan_image (const char *filename) { scanner.reset(); // normally scanner would reset associated decoder, // but this debug program connects them manually // (to make intermediate state more readily available) // so decoder must also be reset manually decoder.reset(); Magick::Image image; image.read(filename); string file = image.baseFilename(); size_t baseidx = file.rfind('/'); if(baseidx != string::npos) file = file.substr(baseidx + 1, file.length() - baseidx - 1); ofstream svg((file + ".svg").c_str()); unsigned inwidth = image.columns(); unsigned width = inwidth + 3; unsigned height = image.rows(); unsigned midy = height / 2; cerr << "x+: " << midy << endl; image.crop(Magick::Geometry(inwidth, 1, 0, midy)); svg << "" << endl << "" << endl << "" << endl << "" << endl << "" << endl << "" << endl; // brute force unsigned raw[inwidth]; { // extract scan from image pixels image.modifyImage(); Magick::Pixels view(image); Magick::PixelPacket *pxp = view.get(0, 0, inwidth, 1); Magick::ColorYUV y; double max = 0; svg << "" << endl << "" << endl; } image.depth(8); image.write(file + ".png"); // process scan and capture calculated values unsigned cur_edge[width], last_edge[width]; int y0[width], y1[width], y2[width], y1_thr[width]; svg << "" << endl; for(unsigned i = 0; i < width; i++) { int edge; if(i < inwidth) edge = scanner.scan_y(raw[i]); else edge = scanner.flush(); unsigned x; zbar_scanner_get_state(scanner, &x, &cur_edge[i], &last_edge[i], &y0[i], &y1[i], &y2[i], &y1_thr[i]); if(edge) { unsigned w = scanner.get_width(); if(w) svg << "" << endl << "" << endl << w << "" << endl; zbar_symbol_type_t sym = decoder.decode_width(w); if(sym > ZBAR_PARTIAL) { svg << "" << decoder.get_data_string() << "" << endl; } } else if((!i) ? last_edge[i] : last_edge[i] == last_edge[i - 1]) last_edge[i] = 0; } svg << "" << endl << "" << endl << "" << endl << "" << endl << "" << endl << "" << endl << "" << endl; svg << "" << endl << "" << endl << "" << endl << "" << endl << "" << endl << "" << endl << "" << endl << "" << endl; svg << "" << endl; } int main (int argc, const char *argv[]) { if(argc < 2) { cerr << "ERROR: specify image file(s) to scan" << endl; return(1); } for(int i = 1; i < argc; i++) scan_image(argv[i]); return(0); } zbar-0.10/zbar/0000777000000000000000000000000011270371535010305 500000000000000zbar-0.10/zbar/video.h0000644000000000000000000001204511270371414011476 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _VIDEO_H_ #define _VIDEO_H_ #include #ifdef HAVE_INTTYPES_H # include #endif #include #include #include #include #include "image.h" #include "error.h" #include "mutex.h" /* number of images to preallocate */ #define ZBAR_VIDEO_IMAGES_MAX 4 typedef enum video_interface_e { VIDEO_INVALID = 0, /* uninitialized */ VIDEO_V4L1, /* v4l protocol version 1 */ VIDEO_V4L2, /* v4l protocol version 2 */ VIDEO_VFW, /* video for windows */ } video_interface_t; typedef enum video_iomode_e { VIDEO_READWRITE = 1, /* standard system calls */ VIDEO_MMAP, /* mmap interface */ VIDEO_USERPTR, /* userspace buffers */ } video_iomode_t; typedef struct video_state_s video_state_t; struct zbar_video_s { errinfo_t err; /* error reporting */ int fd; /* open camera device */ unsigned width, height; /* video frame size */ video_interface_t intf; /* input interface type */ video_iomode_t iomode; /* video data transfer mode */ unsigned initialized : 1; /* format selected and images mapped */ unsigned active : 1; /* current streaming state */ uint32_t format; /* selected fourcc */ unsigned palette; /* v4l1 format index corresponding to format */ uint32_t *formats; /* 0 terminated list of supported formats */ unsigned long datalen; /* size of image data for selected format */ unsigned long buflen; /* total size of image data buffer */ void *buf; /* image data buffer */ unsigned frame; /* frame count */ zbar_mutex_t qlock; /* lock image queue */ int num_images; /* number of allocated images */ zbar_image_t **images; /* indexed list of images */ zbar_image_t *nq_image; /* last image enqueued */ zbar_image_t *dq_image; /* first image to dequeue (when ordered) */ zbar_image_t *shadow_image; /* special case internal double buffering */ video_state_t *state; /* platform/interface specific state */ #ifdef HAVE_LIBJPEG struct jpeg_decompress_struct *jpeg; /* JPEG decompressor */ zbar_image_t *jpeg_img; /* temporary image */ #endif /* interface dependent methods */ int (*init)(zbar_video_t*, uint32_t); int (*cleanup)(zbar_video_t*); int (*start)(zbar_video_t*); int (*stop)(zbar_video_t*); int (*nq)(zbar_video_t*, zbar_image_t*); zbar_image_t* (*dq)(zbar_video_t*); }; /* video.next_image and video.recycle_image have to be thread safe * wrt/other apis */ static inline int video_lock (zbar_video_t *vdo) { int rc = 0; if((rc = _zbar_mutex_lock(&vdo->qlock))) { err_capture(vdo, SEV_FATAL, ZBAR_ERR_LOCKING, __func__, "unable to acquire lock"); vdo->err.errnum = rc; return(-1); } return(0); } static inline int video_unlock (zbar_video_t *vdo) { int rc = 0; if((rc = _zbar_mutex_unlock(&vdo->qlock))) { err_capture(vdo, SEV_FATAL, ZBAR_ERR_LOCKING, __func__, "unable to release lock"); vdo->err.errnum = rc; return(-1); } return(0); } static inline int video_nq_image (zbar_video_t *vdo, zbar_image_t *img) { /* maintains queued buffers in order */ img->next = NULL; if(vdo->nq_image) vdo->nq_image->next = img; vdo->nq_image = img; if(!vdo->dq_image) vdo->dq_image = img; return(video_unlock(vdo)); } static inline zbar_image_t *video_dq_image (zbar_video_t *vdo) { zbar_image_t *img = vdo->dq_image; if(img) { vdo->dq_image = img->next; img->next = NULL; } if(video_unlock(vdo)) /* FIXME reclaim image */ return(NULL); return(img); } /* PAL interface */ extern int _zbar_video_open(zbar_video_t*, const char*); #endif zbar-0.10/zbar/image.h0000644000000000000000000001044311270371414011452 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _IMAGE_H_ #define _IMAGE_H_ #include #ifdef HAVE_INTTYPES_H # include #endif #include #include #include #include "error.h" #include "symbol.h" #include "refcnt.h" /* adapted from v4l2 spec */ #define fourcc(a, b, c, d) \ ((uint32_t)(a) | ((uint32_t)(b) << 8) | \ ((uint32_t)(c) << 16) | ((uint32_t)(d) << 24)) /* unpack size/location of component */ #define RGB_SIZE(c) ((c) >> 5) #define RGB_OFFSET(c) ((c) & 0x1f) /* coarse image format categorization. * to limit conversion variations */ typedef enum zbar_format_group_e { ZBAR_FMT_GRAY, ZBAR_FMT_YUV_PLANAR, ZBAR_FMT_YUV_PACKED, ZBAR_FMT_RGB_PACKED, ZBAR_FMT_YUV_NV, ZBAR_FMT_JPEG, /* enum size */ ZBAR_FMT_NUM } zbar_format_group_t; struct zbar_image_s { uint32_t format; /* fourcc image format code */ unsigned width, height; /* image size */ const void *data; /* image sample data */ unsigned long datalen; /* allocated/mapped size of data */ void *userdata; /* user specified data associated w/image */ /* cleanup handler */ zbar_image_cleanup_handler_t *cleanup; refcnt_t refcnt; /* reference count */ zbar_video_t *src; /* originator */ int srcidx; /* index used by originator */ zbar_image_t *next; /* internal image lists */ unsigned seq; /* page/frame sequence number */ zbar_symbol_set_t *syms; /* decoded result set */ }; /* description of an image format */ typedef struct zbar_format_def_s { uint32_t format; /* fourcc */ zbar_format_group_t group; /* coarse categorization */ union { uint8_t gen[4]; /* raw bytes */ struct { uint8_t bpp; /* bits per pixel */ uint8_t red, green, blue; /* size/location a la RGB_BITS() */ } rgb; struct { uint8_t xsub2, ysub2; /* chroma subsampling in each axis */ uint8_t packorder; /* channel ordering flags * bit0: 0=UV, 1=VU * bit1: 0=Y/chroma, 1=chroma/Y */ } yuv; uint32_t cmp; /* quick compare equivalent formats */ } p; } zbar_format_def_t; extern int _zbar_best_format(uint32_t, uint32_t*, const uint32_t*); extern const zbar_format_def_t *_zbar_format_lookup(uint32_t); extern void _zbar_image_free(zbar_image_t*); #ifdef DEBUG_SVG extern int zbar_image_write_png(const zbar_image_t*, const char*); #else # define zbar_image_write_png(...) #endif static inline void _zbar_image_refcnt (zbar_image_t *img, int delta) { if(!_zbar_refcnt(&img->refcnt, delta) && delta <= 0) { if(img->cleanup) img->cleanup(img); if(!img->src) _zbar_image_free(img); } } static inline void _zbar_image_swap_symbols (zbar_image_t *a, zbar_image_t *b) { zbar_symbol_set_t *tmp = a->syms; a->syms = b->syms; b->syms = tmp; } #endif zbar-0.10/zbar/error.c0000644000000000000000000001327611270371414011523 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "error.h" #include int _zbar_verbosity = 0; static const char * const sev_str[] = { "FATAL ERROR", "ERROR", "OK", "WARNING", "NOTE" }; #define SEV_MAX (strlen(sev_str[0])) static const char * const mod_str[] = { "processor", "video", "window", "image scanner", "" }; #define MOD_MAX (strlen(mod_str[ZBAR_MOD_IMAGE_SCANNER])) static const char const * err_str[] = { "no error", /* OK */ "out of memory", /* NOMEM */ "internal library error", /* INTERNAL */ "unsupported request", /* UNSUPPORTED */ "invalid request", /* INVALID */ "system error", /* SYSTEM */ "locking error", /* LOCKING */ "all resources busy", /* BUSY */ "X11 display error", /* XDISPLAY */ "X11 protocol error", /* XPROTO */ "output window is closed", /* CLOSED */ "windows system error", /* WINAPI */ "unknown error" /* NUM */ }; #define ERR_MAX (strlen(err_str[ZBAR_ERR_CLOSED])) int zbar_version (unsigned *major, unsigned *minor) { if(major) *major = ZBAR_VERSION_MAJOR; if(minor) *minor = ZBAR_VERSION_MINOR; return(0); } void zbar_set_verbosity (int level) { _zbar_verbosity = level; } void zbar_increase_verbosity () { if(!_zbar_verbosity) _zbar_verbosity++; else _zbar_verbosity <<= 1; } int _zbar_error_spew (const void *container, int verbosity) { const errinfo_t *err = container; assert(err->magic == ERRINFO_MAGIC); fprintf(stderr, "%s", _zbar_error_string(err, verbosity)); return(-err->sev); } zbar_error_t _zbar_get_error_code (const void *container) { const errinfo_t *err = container; assert(err->magic == ERRINFO_MAGIC); return(err->type); } /* ERROR: zbar video in v4l1_set_format(): * system error: blah[: blah] */ const char *_zbar_error_string (const void *container, int verbosity) { errinfo_t *err = (errinfo_t*)container; assert(err->magic == ERRINFO_MAGIC); const char *sev; if(err->sev >= SEV_FATAL && err->sev <= SEV_NOTE) sev = sev_str[err->sev + 2]; else sev = sev_str[1]; const char *mod; if(err->module >= ZBAR_MOD_PROCESSOR && err->module < ZBAR_MOD_UNKNOWN) mod = mod_str[err->module]; else mod = mod_str[ZBAR_MOD_UNKNOWN]; const char *func = (err->func) ? err->func : ""; const char *type; if(err->type >= 0 && err->type < ZBAR_ERR_NUM) type = err_str[err->type]; else type = err_str[ZBAR_ERR_NUM]; char basefmt[] = "%s: zbar %s in %s():\n %s: "; int len = SEV_MAX + MOD_MAX + ERR_MAX + strlen(func) + sizeof(basefmt); err->buf = realloc(err->buf, len); len = sprintf(err->buf, basefmt, sev, mod, func, type); if(len <= 0) return(""); if(err->detail) { int newlen = len + strlen(err->detail) + 1; if(strstr(err->detail, "%s")) { if(!err->arg_str) err->arg_str = strdup(""); err->buf = realloc(err->buf, newlen + strlen(err->arg_str)); len += sprintf(err->buf + len, err->detail, err->arg_str); } else if(strstr(err->detail, "%d") || strstr(err->detail, "%x")) { err->buf = realloc(err->buf, newlen + 32); len += sprintf(err->buf + len, err->detail, err->arg_int); } else { err->buf = realloc(err->buf, newlen); len += sprintf(err->buf + len, "%s", err->detail); } if(len <= 0) return(""); } if(err->type == ZBAR_ERR_SYSTEM) { char sysfmt[] = ": %s (%d)\n"; const char *syserr = strerror(err->errnum); err->buf = realloc(err->buf, len + strlen(sysfmt) + strlen(syserr)); len += sprintf(err->buf + len, sysfmt, syserr, err->errnum); } #ifdef _WIN32 else if(err->type == ZBAR_ERR_WINAPI) { char *syserr = NULL; if(FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err->errnum, 0, (LPTSTR)&syserr, 1, NULL) && syserr) { char sysfmt[] = ": %s (%d)\n"; err->buf = realloc(err->buf, len + strlen(sysfmt) + strlen(syserr)); len += sprintf(err->buf + len, sysfmt, syserr, err->errnum); LocalFree(syserr); } } #endif else { err->buf = realloc(err->buf, len + 2); len += sprintf(err->buf + len, "\n"); } return(err->buf); } zbar-0.10/zbar/window.c0000644000000000000000000002422311270371414011673 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "window.h" #include "image.h" #include /* clock_gettime */ #include /* gettimeofday */ zbar_window_t *zbar_window_create () { zbar_window_t *w = calloc(1, sizeof(zbar_window_t)); if(!w) return(NULL); err_init(&w->err, ZBAR_MOD_WINDOW); w->overlay = 1; (void)_zbar_mutex_init(&w->imglock); return(w); } void zbar_window_destroy (zbar_window_t *w) { /* detach */ zbar_window_attach(w, NULL, 0); err_cleanup(&w->err); _zbar_mutex_destroy(&w->imglock); free(w); } int zbar_window_attach (zbar_window_t *w, void *display, unsigned long drawable) { /* release image */ zbar_window_draw(w, NULL); if(w->cleanup) { w->cleanup(w); w->cleanup = NULL; w->draw_image = NULL; } if(w->formats) { free(w->formats); w->formats = NULL; } w->src_format = 0; w->src_width = w->src_height = 0; w->scaled_size.x = w->scaled_size.y = 0; w->dst_width = w->dst_height = 0; w->max_width = w->max_height = 1 << 15; w->scale_num = w->scale_den = 1; return(_zbar_window_attach(w, display, drawable)); } static void window_outline_symbol (zbar_window_t *w, uint32_t color, const zbar_symbol_t *sym) { if(sym->syms) { const zbar_symbol_t *s; for(s = sym->syms->head; s; s = s->next) window_outline_symbol(w, 1, s); } _zbar_window_draw_polygon(w, color, sym->pts, sym->npts); } static inline int window_draw_overlay (zbar_window_t *w) { if(!w->overlay) return(0); if(w->overlay >= 1 && w->image && w->image->syms) { /* FIXME outline each symbol */ const zbar_symbol_t *sym = w->image->syms->head; for(; sym; sym = sym->next) { uint32_t color = ((sym->cache_count < 0) ? 4 : 2); if(sym->type == ZBAR_QRCODE) window_outline_symbol(w, color, sym); else { /* FIXME linear bbox broken */ point_t org = w->scaled_offset; int i; for(i = 0; i < sym->npts; i++) { point_t p = window_scale_pt(w, sym->pts[i]); p.x += org.x; p.y += org.y; if(p.x < 3) p.x = 3; else if(p.x > w->width - 4) p.x = w->width - 4; if(p.y < 3) p.y = 3; else if(p.y > w->height - 4) p.y = w->height - 4; _zbar_window_draw_marker(w, color, p); } } } } if(w->overlay >= 2) { /* calculate/display frame rate */ unsigned long time; #if _POSIX_TIMERS > 0 struct timespec abstime; clock_gettime(CLOCK_REALTIME, &abstime); time = (abstime.tv_sec * 1000) + ((abstime.tv_nsec / 500000) + 1) / 2; #else struct timeval abstime; gettimeofday(&abstime, NULL); time = (abstime.tv_sec * 1000) + ((abstime.tv_usec / 500) + 1) / 2; #endif point_t p = { -8, -1 }; char text[32]; if(w->time) { int avg = w->time_avg = (w->time_avg + time - w->time) / 2; sprintf(text, "%d.%01d fps", 1000 / avg, (10000 / avg) % 10); _zbar_window_draw_text(w, 3, p, text); } w->time = time; } return(0); } inline int zbar_window_redraw (zbar_window_t *w) { if(window_lock(w)) return(-1); if(!w->display || _zbar_window_begin(w)) { (void)window_unlock(w); return(-1); } int rc = 0; zbar_image_t *img = w->image; if(w->init && w->draw_image && img) { int format_change = (w->src_format != img->format && w->format != img->format); if(format_change) { _zbar_best_format(img->format, &w->format, w->formats); if(!w->format) rc = err_capture_int(w, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, __func__, "no conversion from %x to supported formats", img->format); w->src_format = img->format; } if(!rc && (format_change || !w->scaled_size.x || !w->dst_width)) { zprintf(24, "init: src=%.4s(%08x) %dx%d dst=%.4s(%08x) %dx%d\n", (char*)&w->src_format, w->src_format, w->src_width, w->src_height, (char*)&w->format, w->format, w->dst_width, w->dst_height); if(!w->dst_width) { w->src_width = img->width; w->src_height = img->height; } point_t size = { w->width, w->height }; if(size.x > w->max_width) size.x = w->max_width; if(size.y > w->max_height) size.y = w->max_height; if(size.x * w->src_height < size.y * w->src_width) { w->scale_num = size.x; w->scale_den = w->src_width; } else { w->scale_num = size.y; w->scale_den = w->src_height; } rc = w->init(w, img, format_change); if(!rc) { size.x = w->src_width; size.y = w->src_height; w->scaled_size = size = window_scale_pt(w, size); w->scaled_offset.x = ((int)w->width - size.x) / 2; w->scaled_offset.y = ((int)w->height - size.y) / 2; zprintf(24, "scale: src=%dx%d win=%dx%d by %d/%d => %dx%d @%d,%d\n", w->src_width, w->src_height, w->width, w->height, w->scale_num, w->scale_den, size.x, size.y, w->scaled_offset.x, w->scaled_offset.y); } else { /* unable to display this image */ _zbar_image_refcnt(img, -1); w->image = img = NULL; } } if(!rc && (img->format != w->format || img->width != w->dst_width || img->height != w->dst_height)) { /* save *converted* image for redraw */ zprintf(48, "convert: %.4s(%08x) %dx%d => %.4s(%08x) %dx%d\n", (char*)&img->format, img->format, img->width, img->height, (char*)&w->format, w->format, w->dst_width, w->dst_height); w->image = zbar_image_convert_resize(img, w->format, w->dst_width, w->dst_height); w->image->syms = img->syms; if(img->syms) zbar_symbol_set_ref(img->syms, 1); zbar_image_destroy(img); img = w->image; } if(!rc) { rc = w->draw_image(w, img); point_t org = w->scaled_offset; if(org.x > 0) { point_t p = { 0, org.y }; point_t s = { org.x, w->scaled_size.y }; _zbar_window_fill_rect(w, 0, p, s); s.x = w->width - w->scaled_size.x - s.x; if(s.x > 0) { p.x = w->width - s.x; _zbar_window_fill_rect(w, 0, p, s); } } if(org.y > 0) { point_t p = { 0, 0 }; point_t s = { w->width, org.y }; _zbar_window_fill_rect(w, 0, p, s); s.y = w->height - w->scaled_size.y - s.y; if(s.y > 0) { p.y = w->height - s.y; _zbar_window_fill_rect(w, 0, p, s); } } } if(!rc) rc = window_draw_overlay(w); } else rc = 1; if(rc) rc = _zbar_window_draw_logo(w); _zbar_window_end(w); (void)window_unlock(w); return(rc); } int zbar_window_draw (zbar_window_t *w, zbar_image_t *img) { if(window_lock(w)) return(-1); if(!w->draw_image) img = NULL; if(img) { _zbar_image_refcnt(img, 1); if(img->width != w->src_width || img->height != w->src_height) w->dst_width = 0; } if(w->image) _zbar_image_refcnt(w->image, -1); w->image = img; return(window_unlock(w)); } void zbar_window_set_overlay (zbar_window_t *w, int lvl) { if(lvl < 0) lvl = 0; if(lvl > 2) lvl = 2; if(window_lock(w)) return; if(w->overlay != lvl) w->overlay = lvl; (void)window_unlock(w); } int zbar_window_get_overlay (const zbar_window_t *w) { zbar_window_t *ncw = (zbar_window_t*)w; if(window_lock(ncw)) return(-1); int lvl = w->overlay; (void)window_unlock(ncw); return(lvl); } int zbar_window_resize (zbar_window_t *w, unsigned width, unsigned height) { if(window_lock(w)) return(-1); w->width = width; w->height = height; w->scaled_size.x = 0; _zbar_window_resize(w); return(window_unlock(w)); } zbar-0.10/zbar/decoder.c0000644000000000000000000002535611270371414012001 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include /* malloc, calloc, free */ #include /* snprintf */ #include /* memset, strlen */ #include #include "decoder.h" #if defined(DEBUG_DECODER) || defined(DEBUG_EAN) || \ defined(DEBUG_CODE39) || defined(DEBUG_I25) || \ defined(DEBUG_CODE128) || defined(DEBUG_QR_FINDER) || \ (defined(DEBUG_PDF417) && (DEBUG_PDF417 >= 4)) # define DEBUG_LEVEL 1 #endif #include "debug.h" zbar_decoder_t *zbar_decoder_create () { zbar_decoder_t *dcode = calloc(1, sizeof(zbar_decoder_t)); dcode->buf_alloc = BUFFER_MIN; dcode->buf = malloc(dcode->buf_alloc); /* initialize default configs */ #ifdef ENABLE_EAN dcode->ean.enable = 1; dcode->ean.ean13_config = ((1 << ZBAR_CFG_ENABLE) | (1 << ZBAR_CFG_EMIT_CHECK)); dcode->ean.ean8_config = ((1 << ZBAR_CFG_ENABLE) | (1 << ZBAR_CFG_EMIT_CHECK)); dcode->ean.upca_config = 1 << ZBAR_CFG_EMIT_CHECK; dcode->ean.upce_config = 1 << ZBAR_CFG_EMIT_CHECK; dcode->ean.isbn10_config = 1 << ZBAR_CFG_EMIT_CHECK; dcode->ean.isbn13_config = 1 << ZBAR_CFG_EMIT_CHECK; #endif #ifdef ENABLE_I25 dcode->i25.config = 1 << ZBAR_CFG_ENABLE; CFG(dcode->i25, ZBAR_CFG_MIN_LEN) = 6; #endif #ifdef ENABLE_CODE39 dcode->code39.config = 1 << ZBAR_CFG_ENABLE; CFG(dcode->code39, ZBAR_CFG_MIN_LEN) = 1; #endif #ifdef ENABLE_CODE128 dcode->code128.config = 1 << ZBAR_CFG_ENABLE; #endif #ifdef ENABLE_PDF417 dcode->pdf417.config = 1 << ZBAR_CFG_ENABLE; #endif #ifdef ENABLE_QRCODE dcode->qrf.config = 1 << ZBAR_CFG_ENABLE; #endif zbar_decoder_reset(dcode); return(dcode); } void zbar_decoder_destroy (zbar_decoder_t *dcode) { if(dcode->buf) free(dcode->buf); free(dcode); } void zbar_decoder_reset (zbar_decoder_t *dcode) { memset(dcode, 0, (long)&dcode->buf_alloc - (long)dcode); #ifdef ENABLE_EAN ean_reset(&dcode->ean); #endif #ifdef ENABLE_I25 i25_reset(&dcode->i25); #endif #ifdef ENABLE_CODE39 code39_reset(&dcode->code39); #endif #ifdef ENABLE_CODE128 code128_reset(&dcode->code128); #endif #ifdef ENABLE_PDF417 pdf417_reset(&dcode->pdf417); #endif #ifdef ENABLE_QRCODE qr_finder_reset(&dcode->qrf); #endif } void zbar_decoder_new_scan (zbar_decoder_t *dcode) { /* soft reset decoder */ memset(dcode->w, 0, sizeof(dcode->w)); dcode->lock = 0; dcode->idx = 0; #ifdef ENABLE_EAN ean_new_scan(&dcode->ean); #endif #ifdef ENABLE_I25 i25_reset(&dcode->i25); #endif #ifdef ENABLE_CODE39 code39_reset(&dcode->code39); #endif #ifdef ENABLE_CODE128 code128_reset(&dcode->code128); #endif #ifdef ENABLE_PDF417 pdf417_reset(&dcode->pdf417); #endif #ifdef ENABLE_QRCODE qr_finder_reset(&dcode->qrf); #endif } zbar_color_t zbar_decoder_get_color (const zbar_decoder_t *dcode) { return(get_color(dcode)); } const char *zbar_decoder_get_data (const zbar_decoder_t *dcode) { return((char*)dcode->buf); } unsigned int zbar_decoder_get_data_length (const zbar_decoder_t *dcode) { return(dcode->buflen); } zbar_decoder_handler_t * zbar_decoder_set_handler (zbar_decoder_t *dcode, zbar_decoder_handler_t handler) { zbar_decoder_handler_t *result = dcode->handler; dcode->handler = handler; return(result); } void zbar_decoder_set_userdata (zbar_decoder_t *dcode, void *userdata) { dcode->userdata = userdata; } void *zbar_decoder_get_userdata (const zbar_decoder_t *dcode) { return(dcode->userdata); } zbar_symbol_type_t zbar_decoder_get_type (const zbar_decoder_t *dcode) { return(dcode->type); } zbar_symbol_type_t zbar_decode_width (zbar_decoder_t *dcode, unsigned w) { dcode->w[dcode->idx & (DECODE_WINDOW - 1)] = w; dprintf(1, " decode[%x]: w=%d (%g)\n", dcode->idx, w, (w / 32.)); /* each decoder processes width stream in parallel */ zbar_symbol_type_t sym = dcode->type = ZBAR_NONE; #ifdef ENABLE_EAN if((dcode->ean.enable) && (sym = _zbar_decode_ean(dcode))) dcode->type = sym; #endif #ifdef ENABLE_CODE39 if(TEST_CFG(dcode->code39.config, ZBAR_CFG_ENABLE) && (sym = _zbar_decode_code39(dcode)) > ZBAR_PARTIAL) dcode->type = sym; #endif #ifdef ENABLE_CODE128 if(TEST_CFG(dcode->code128.config, ZBAR_CFG_ENABLE) && (sym = _zbar_decode_code128(dcode)) > ZBAR_PARTIAL) dcode->type = sym; #endif #ifdef ENABLE_I25 if(TEST_CFG(dcode->i25.config, ZBAR_CFG_ENABLE) && (sym = _zbar_decode_i25(dcode)) > ZBAR_PARTIAL) dcode->type = sym; #endif #ifdef ENABLE_PDF417 if(TEST_CFG(dcode->pdf417.config, ZBAR_CFG_ENABLE) && (sym = _zbar_decode_pdf417(dcode)) > ZBAR_PARTIAL) dcode->type = sym; #endif #ifdef ENABLE_QRCODE if(TEST_CFG(dcode->qrf.config, ZBAR_CFG_ENABLE) && (sym = _zbar_find_qr(dcode)) > ZBAR_PARTIAL) dcode->type = sym; #endif dcode->idx++; if(dcode->type) { if(dcode->handler) dcode->handler(dcode); if(dcode->lock && dcode->type > ZBAR_PARTIAL) dcode->lock = 0; } return(dcode->type); } static inline int decoder_set_config_bool (zbar_decoder_t *dcode, zbar_symbol_type_t sym, zbar_config_t cfg, int val) { unsigned *config = NULL; switch(sym) { #ifdef ENABLE_EAN case ZBAR_EAN13: config = &dcode->ean.ean13_config; break; case ZBAR_EAN8: config = &dcode->ean.ean8_config; break; case ZBAR_UPCA: config = &dcode->ean.upca_config; break; case ZBAR_UPCE: config = &dcode->ean.upce_config; break; case ZBAR_ISBN10: config = &dcode->ean.isbn10_config; break; case ZBAR_ISBN13: config = &dcode->ean.isbn13_config; break; #endif #ifdef ENABLE_I25 case ZBAR_I25: config = &dcode->i25.config; break; #endif #ifdef ENABLE_CODE39 case ZBAR_CODE39: config = &dcode->code39.config; break; #endif #ifdef ENABLE_CODE128 case ZBAR_CODE128: config = &dcode->code128.config; break; #endif #ifdef ENABLE_PDF417 case ZBAR_PDF417: config = &dcode->pdf417.config; break; #endif #ifdef ENABLE_QRCODE case ZBAR_QRCODE: config = &dcode->qrf.config; break; #endif /* FIXME handle addons */ default: return(1); } if(!config || cfg >= ZBAR_CFG_NUM) return(1); if(!val) *config &= ~(1 << cfg); else if(val == 1) *config |= (1 << cfg); else return(1); #ifdef ENABLE_EAN dcode->ean.enable = TEST_CFG(dcode->ean.ean13_config | dcode->ean.ean8_config | dcode->ean.upca_config | dcode->ean.upce_config | dcode->ean.isbn10_config | dcode->ean.isbn13_config, ZBAR_CFG_ENABLE); #endif return(0); } static inline int decoder_set_config_int (zbar_decoder_t *dcode, zbar_symbol_type_t sym, zbar_config_t cfg, int val) { switch(sym) { #ifdef ENABLE_I25 case ZBAR_I25: CFG(dcode->i25, cfg) = val; break; #endif #ifdef ENABLE_CODE39 case ZBAR_CODE39: CFG(dcode->code39, cfg) = val; break; #endif #ifdef ENABLE_CODE128 case ZBAR_CODE128: CFG(dcode->code128, cfg) = val; break; #endif #ifdef ENABLE_PDF417 case ZBAR_PDF417: CFG(dcode->pdf417, cfg) = val; break; #endif default: return(1); } return(0); } int zbar_decoder_set_config (zbar_decoder_t *dcode, zbar_symbol_type_t sym, zbar_config_t cfg, int val) { if(sym == ZBAR_NONE) { zbar_decoder_set_config(dcode, ZBAR_EAN13, cfg, val); zbar_decoder_set_config(dcode, ZBAR_EAN8, cfg, val); zbar_decoder_set_config(dcode, ZBAR_UPCA, cfg, val); zbar_decoder_set_config(dcode, ZBAR_UPCE, cfg, val); zbar_decoder_set_config(dcode, ZBAR_ISBN10, cfg, val); zbar_decoder_set_config(dcode, ZBAR_ISBN13, cfg, val); zbar_decoder_set_config(dcode, ZBAR_I25, cfg, val); zbar_decoder_set_config(dcode, ZBAR_CODE39, cfg, val); zbar_decoder_set_config(dcode, ZBAR_CODE128, cfg, val); zbar_decoder_set_config(dcode, ZBAR_PDF417, cfg, val); zbar_decoder_set_config(dcode, ZBAR_QRCODE, cfg, val); return(0); } if(cfg >= 0 && cfg < ZBAR_CFG_NUM) return(decoder_set_config_bool(dcode, sym, cfg, val)); else if(cfg >= ZBAR_CFG_MIN_LEN && cfg <= ZBAR_CFG_MAX_LEN) return(decoder_set_config_int(dcode, sym, cfg, val)); else return(1); } static char *decoder_dump = NULL; static unsigned decoder_dumplen = 0; const char *_zbar_decoder_buf_dump (unsigned char *buf, unsigned int buflen) { int dumplen = (buflen * 3) + 12; if(!decoder_dump || dumplen > decoder_dumplen) { if(decoder_dump) free(decoder_dump); decoder_dump = malloc(dumplen); decoder_dumplen = dumplen; } char *p = decoder_dump + snprintf(decoder_dump, 12, "buf[%04x]=", (buflen > 0xffff) ? 0xffff : buflen); int i; for(i = 0; i < buflen; i++) p += snprintf(p, 4, "%s%02x", (i) ? " " : "", buf[i]); return(decoder_dump); } zbar-0.10/zbar/qrcode/0000777000000000000000000000000011270371535011562 500000000000000zbar-0.10/zbar/qrcode/binarize.c0000644000000000000000000004617211270371414013453 00000000000000/*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #include #include #include #include "util.h" #include "image.h" #include "binarize.h" #if 0 /*Binarization based on~\cite{GPP06}. @ARTICLE{GPP06, author="Basilios Gatos and Ioannis E. Pratikakis and Stavros J. Perantonis", title="Adaptive Degraded Document Image Binarization", journal="Pattern Recognition", volume=39, number=3, pages="317-327", month=Mar, year=2006 }*/ #if 0 /*Applies a 5x5 Wiener filter to the image, in-place, emphasizing differences where the local variance is small, and de-emphasizing them where it is large.*/ void qr_wiener_filter(unsigned char *_img,int _width,int _height){ unsigned *m_buf[8]; unsigned *sn2_buf[8]; unsigned char g; int x; int y; if(_width<=0||_height<=0)return; m_buf[0]=(unsigned *)malloc((_width+4<<3)*sizeof(*m_buf)); sn2_buf[0]=(unsigned *)malloc((_width+4<<3)*sizeof(*sn2_buf)); for(y=1;y<8;y++){ m_buf[y]=m_buf[y-1]+_width+4; sn2_buf[y]=sn2_buf[y-1]+_width+4; } for(y=-4;y<_height;y++){ unsigned *pm; unsigned *psn2; int i; int j; pm=m_buf[y+2&7]; psn2=sn2_buf[y+2&7]; for(x=-4;x<_width;x++){ unsigned m; unsigned m2; m=m2=0; if(y>=0&&y<_height-4&&x>=0&&x<_width-4)for(i=0;i<5;i++)for(j=0;j<5;j++){ g=_img[(y+i)*_width+x+j]; m+=g; m2+=g*g; } else for(i=0;i<5;i++)for(j=0;j<5;j++){ g=_img[QR_CLAMPI(0,y+i,_height-1)*_width+QR_CLAMPI(0,x+j,_width-1)]; m+=g; m2+=g*g; } pm[x+4]=m; psn2[x+4]=(m2*25-m*m); } pm=m_buf[y&7]; if(y>=0)for(x=0;x<_width;x++){ int sn2; sn2=sn2_buf[y&7][x+2]; if(sn2){ int vn3; int m; /*Gatos et al. give the expression mu+(s2-v2)*(g-mu)/s2 , which we reduce to mu+(s2-v2)*g/s2-(s2-v2)*mu/s2 , g-(v2/s2)*g+(v2/s2)*mu , g+(mu-g)*(v2/s2) . However, s2 is much noisier than v2, and dividing by it often gives extremely large adjustments, causing speckle near edges. Therefore we limit the ratio (v2/s2) to lie between 0 and 1.*/ vn3=0; for(i=-2;i<3;i++){ psn2=sn2_buf[y+i&7]; for(j=0;j<5;j++)vn3+=psn2[x+j]; } m=m_buf[y&7][x+2]; vn3=vn3+1023>>10; sn2=25*sn2+1023>>10; if(vn3=0&&y<_height-2&&x>=0&&x<_width-2)for(i=0;i<3;i++)for(j=0;j<3;j++){ g=_img[(y+i)*_width+x+j]; m+=g; m2+=g*g; } else for(i=0;i<3;i++)for(j=0;j<3;j++){ g=_img[QR_CLAMPI(0,y+i,_height-1)*_width+QR_CLAMPI(0,x+j,_width-1)]; m+=g; m2+=g*g; } pm[x+2]=m; psn2[x+2]=(m2*9-m*m); } pm=m_buf[y&3]; if(y>=0)for(x=0;x<_width;x++){ int sn2; sn2=sn2_buf[y&3][x+1]; if(sn2){ int m; int vn3; /*Gatos et al. give the expression mu+(s2-v2)*(g-mu)/s2 , which we reduce to mu+(s2-v2)*g/s2-(s2-v2)*mu/s2 , g-(v2/s2)*g+(v2/s2)*mu , g+(mu-g)*(v2/s2) . However, s2 is much noisier than v2, and dividing by it often gives extremely large adjustments, causing speckle near edges. Therefore we limit the ratio (v2/s2) to lie between 0 and 1.*/ vn3=0; for(i=-1;i<2;i++){ psn2=sn2_buf[y+i&3]; for(j=0;j<3;j++)vn3+=psn2[x+j]; } m=m_buf[y&3][x+1]; vn3=vn3+31>>5; sn2=9*sn2+31>>5; if(vn30&&_height>0){ unsigned *col_sums; unsigned *col2_sums; int logwindw; int logwindh; int windw; int windh; int y0offs; int y1offs; unsigned g; unsigned g2; int x; int y; /*We keep the window size fairly large to ensure it doesn't fit completely inside the center of a finder pattern of a version 1 QR code at full resolution.*/ for(logwindw=4;logwindw<8&&(1<>3);logwindw++); for(logwindh=4;logwindh<8&&(1<>3);logwindh++); windw=1<>1);y++){ y1offs=QR_MINI(y,_height-1)*_width; for(x=0;x<_width;x++){ g=_img[y1offs+x]; col_sums[x]+=g; col2_sums[x]+=g*g; } } for(y=0;y<_height;y++){ unsigned m; unsigned m2; int x0; int x1; /*Initialize the sums over the window.*/ m=(col_sums[0]<>1);x++){ x1=QR_MINI(x,_width-1); m+=col_sums[x1]; m2+=col2_sums[x1]; } for(x=0;x<_width;x++){ int d; /*Perform the test against the threshold T = (m/n)*(1+k*(s/R-1)), where n=windw*windh, s=sqrt((m2-(m*m)/n)/n), and R=128. We don't actually compute the threshold directly, as that would require a square root. Instead we perform the equivalent test: (m/n)*(m/n)*(m2/n-(m/n)*(m/n))/16 > (((1/k)*g-((1-k)/k)*(m/n))*32)**2 R is split up across each side of the inequality to maximize the dynamic range available for the right hand side, which requires 31 bits in the worst case.*/ /*(m/n)*(1+(1/5)*(sqrt((m2-m*m/n)/n)/128-1)) > g m*(1+(1/5)*(sqrt((m2-m*m/n)/n)/128-1)) > g*n m*sqrt((m2-m*m/n)/n) > 5*g*n-4*m<<7 m*m*(m2*n-m*m) > (5*g*n-4*m<<7)**2*n*n || 5*g*n-4*m < 0 */ g=_img[y*_width+x]; d=(5*g<=0){ unsigned mm; unsigned mms2; unsigned d2; mm=(m>>logwindw)*(m>>logwindh); mms2=(m2-mm>>logwindw+logwindh)*(mm>>logwindw+logwindh)+15>>4; d2=d>>logwindw+logwindh-5; d2*=d2; if(d2>=mms2){ /*Update the background average.*/ b+=g; nb++; _mask[y*_width+x]=0; } else _mask[y*_width+x]=0xFF; } else _mask[y*_width+x]=0xFF; /*Update the window sums.*/ if(x+1<_width){ x0=QR_MAXI(0,x-(windw>>1)); x1=QR_MINI(x+(windw>>1),_width-1); m+=col_sums[x1]-col_sums[x0]; m2+=col2_sums[x1]-col2_sums[x0]; } } /*Update the column sums.*/ if(y+1<_height){ y0offs=QR_MAXI(0,y-(windh>>1))*_width; y1offs=QR_MINI(y+(windh>>1),_height-1)*_width; for(x=0;x<_width;x++){ g=_img[y0offs+x]; col_sums[x]-=g; col2_sums[x]-=g*g; g=_img[y1offs+x]; col_sums[x]+=g; col2_sums[x]+=g*g; } } } free(col2_sums); free(col_sums); } *_b=b; *_nb=nb; } /*Interpolates a background image given the source and a conservative foreground mask. If the current window contains no foreground pixels, the average background value over the whole image is used. Note on dynamic range: we assume _width*_height<=0x8000000 (23 bits). Returns the average difference between the foreground and the interpolated background.*/ static void qr_interpolate_background(unsigned char *_dst, int *_delta,int *_ndelta,const unsigned char *_img,const unsigned char *_mask, int _width,int _height,unsigned _b,int _nb){ int delta; int ndelta; delta=ndelta=0; if(_width>0&&_height>0){ unsigned *col_sums; unsigned *ncol_sums; int logwindw; int logwindh; int windw; int windh; int y0offs; int y1offs; unsigned b; unsigned g; int x; int y; b=_nb>0?((_b<<1)+_nb)/(_nb<<1):0xFF; for(logwindw=4;logwindw<8&&(1<>4);logwindw++); for(logwindh=4;logwindh<8&&(1<>4);logwindh++); windw=1<>1);y++){ y1offs=QR_MINI(y,_height-1)*_width; for(x=0;x<_width;x++)if(!_mask[y1offs+x]){ col_sums[x]+=_img[y1offs+x]; ncol_sums[x]++; } } for(y=0;y<_height;y++){ unsigned n; unsigned m; int x0; int x1; /*Initialize the sums over the window.*/ m=(col_sums[0]<>1);x++){ x1=QR_MINI(x,_width-1); m+=col_sums[x1]; n+=ncol_sums[x1]; } for(x=0;x<_width;x++){ if(!_mask[y*_width+x])g=_img[y*_width+x]; else{ g=n>0?((m<<1)+n)/(n<<1):b; delta+=(int)g-_img[y*_width+x]; ndelta++; } _dst[y*_width+x]=(unsigned char)g; /*Update the window sums.*/ if(x+1<_width){ x0=QR_MAXI(0,x-(windw>>1)); x1=QR_MINI(x+(windw>>1),_width-1); m+=col_sums[x1]-col_sums[x0]; n+=ncol_sums[x1]-ncol_sums[x0]; } } /*Update the column sums.*/ if(y+1<_height){ y0offs=QR_MAXI(0,y-(windh>>1))*_width; y1offs=QR_MINI(y+(windh>>1),_height-1)*_width; for(x=0;x<_width;x++){ if(!_mask[y0offs+x]){ col_sums[x]-=_img[y0offs+x]; ncol_sums[x]--; } if(!_mask[y1offs+x]){ col_sums[x]+=_img[y1offs+x]; ncol_sums[x]++; } } } } free(ncol_sums); free(col_sums); } *_delta=delta; *_ndelta=ndelta; } /*Parameters of the logistic sigmoid function that defines the threshold based on the background intensity. They should all be between 0 and 1.*/ #define QR_GATOS_Q (0.7) #define QR_GATOS_P1 (0.5) #define QR_GATOS_P2 (0.8) /*Compute the final binarization mask according to Gatos et al.'s method~\cite{GPP06}.*/ static void qr_gatos_mask(unsigned char *_mask,const unsigned char *_img, const unsigned char *_background,int _width,int _height, unsigned _b,int _nb,int _delta,int _ndelta){ unsigned thresh[256]; unsigned g; double delta; double b; int x; int y; /*Construct a lookup table for the thresholds. This bit uses floating point, but doesn't need to do much calculation, so emulation should be fine.*/ b=_nb>0?(_b+0.5)/_nb:0xFF; delta=_ndelta>0?(_delta+0.5)/_ndelta:0xFF; for(g=0;g<256;g++){ double d; d=QR_GATOS_Q*delta*(QR_GATOS_P2+(1-QR_GATOS_P2)/ (1+exp(2*(1+QR_GATOS_P1)/(1-QR_GATOS_P1)-4*g/(b*(1-QR_GATOS_P1))))); if(d<1)d=1; else if(d>0xFF)d=0xFF; thresh[g]=(unsigned)floor(d); } /*Apply the adaptive threshold.*/ for(y=0;y<_height;y++)for(x=0;x<_width;x++){ g=_background[y*_width+x]; /*_background[y*_width+x]=thresh[g];*/ _mask[y*_width+x]=(unsigned char)(-(g-_img[y*_width+x]>thresh[g])&0xFF); } /*{ FILE *fout; fout=fopen("thresh.png","wb"); image_write_png(_background,_width,_height,fout); fclose(fout); }*/ } /*Binarizes a grayscale image.*/ void qr_binarize(unsigned char *_img,int _width,int _height){ unsigned char *mask; unsigned char *background; unsigned b; int nb; int delta; int ndelta; /*qr_wiener_filter(_img,_width,_height); { FILE *fout; fout=fopen("wiener.png","wb"); image_write_png(_img,_width,_height,fout); fclose(fout); }*/ mask=(unsigned char *)malloc(_width*_height*sizeof(*mask)); qr_sauvola_mask(mask,&b,&nb,_img,_width,_height); /*{ FILE *fout; fout=fopen("foreground.png","wb"); image_write_png(mask,_width,_height,fout); fclose(fout); }*/ background=(unsigned char *)malloc(_width*_height*sizeof(*mask)); qr_interpolate_background(background,&delta,&ndelta, _img,mask,_width,_height,b,nb); /*{ FILE *fout; fout=fopen("background.png","wb"); image_write_png(background,_width,_height,fout); fclose(fout); }*/ qr_gatos_mask(_img,_img,background,_width,_height,b,nb,delta,ndelta); free(background); free(mask); } #else /*The above algorithms are computationally expensive, and do not work as well as the simple algorithm below. Sauvola by itself does an excellent job of classifying regions outside the QR code as background, which greatly reduces the chance of false alarms. However, it also tends to over-shrink isolated black dots inside the code, making them easy to miss with even slight mis-alignment. Since the Gatos method uses Sauvola as input to its background interpolation method, it cannot possibly mark any pixels as foreground which Sauvola classified as background, and thus suffers from the same problem. The following simple adaptive threshold method does not have this problem, though it produces essentially random noise outside the QR code region. QR codes are structured well enough that this does not seem to lead to any actual false alarms in practice, and it allows many more codes to be detected and decoded successfully than the Sauvola or Gatos binarization methods.*/ /*A simplified adaptive thresholder. This compares the current pixel value to the mean value of a (large) window surrounding it.*/ unsigned char *qr_binarize(const unsigned char *_img,int _width,int _height){ unsigned char *mask = NULL; if(_width>0&&_height>0){ unsigned *col_sums; int logwindw; int logwindh; int windw; int windh; int y0offs; int y1offs; unsigned g; int x; int y; mask=(unsigned char *)malloc(_width*_height*sizeof(*mask)); /*We keep the window size fairly large to ensure it doesn't fit completely inside the center of a finder pattern of a version 1 QR code at full resolution.*/ for(logwindw=4;logwindw<8&&(1<>3);logwindw++); for(logwindh=4;logwindh<8&&(1<>3);logwindh++); windw=1<>1);y++){ y1offs=QR_MINI(y,_height-1)*_width; for(x=0;x<_width;x++){ g=_img[y1offs+x]; col_sums[x]+=g; } } for(y=0;y<_height;y++){ unsigned m; int x0; int x1; /*Initialize the sum over the window.*/ m=(col_sums[0]<>1);x++){ x1=QR_MINI(x,_width-1); m+=col_sums[x1]; } for(x=0;x<_width;x++){ /*Perform the test against the threshold T = (m/n)-D, where n=windw*windh and D=3.*/ g=_img[y*_width+x]; mask[y*_width+x]=-(g+3<>1)); x1=QR_MINI(x+(windw>>1),_width-1); m+=col_sums[x1]-col_sums[x0]; } } /*Update the column sums.*/ if(y+1<_height){ y0offs=QR_MAXI(0,y-(windh>>1))*_width; y1offs=QR_MINI(y+(windh>>1),_height-1)*_width; for(x=0;x<_width;x++){ col_sums[x]-=_img[y0offs+x]; col_sums[x]+=_img[y1offs+x]; } } } free(col_sums); } #if defined(QR_DEBUG) { FILE *fout; fout=fopen("binary.png","wb"); image_write_png(_img,_width,_height,fout); fclose(fout); } #endif return(mask); } #endif #if defined(TEST_BINARIZE) #include #include "image.c" int main(int _argc,char **_argv){ unsigned char *img; int width; int height; int x; int y; if(_argc<2){ fprintf(stderr,"usage: %s .png\n",_argv[0]); return EXIT_FAILURE; } /*width=1182; height=1181; img=(unsigned char *)malloc(width*height*sizeof(*img)); for(y=0;y(_a)))) #define QR_MINI(_a,_b) ((_a)+((_b)-(_a)&-((_b)<(_a)))) #define QR_SIGNI(_x) (((_x)>0)-((_x)<0)) #define QR_SIGNMASK(_x) (-((_x)<0)) /*Unlike copysign(), simply inverts the sign of _a if _b is negative.*/ #define QR_FLIPSIGNI(_a,_b) ((_a)+QR_SIGNMASK(_b)^QR_SIGNMASK(_b)) #define QR_COPYSIGNI(_a,_b) QR_FLIPSIGNI(abs(_a),_b) /*Divides a signed integer by a positive value with exact rounding.*/ #define QR_DIVROUND(_x,_y) (((_x)+QR_FLIPSIGNI(_y>>1,_x))/(_y)) #define QR_CLAMPI(_a,_b,_c) (QR_MAXI(_a,QR_MINI(_b,_c))) #define QR_CLAMP255(_x) ((unsigned char)((((_x)<0)-1)&((_x)|-((_x)>255)))) /*Swaps two integers _a and _b if _a>_b.*/ #define QR_SORT2I(_a,_b) \ do{ \ int t__; \ t__=QR_MINI(_a,_b)^(_a); \ (_a)^=t__; \ (_b)^=t__; \ } \ while(0) #define QR_ILOG0(_v) (!!((_v)&0x2)) #define QR_ILOG1(_v) (((_v)&0xC)?2+QR_ILOG0((_v)>>2):QR_ILOG0(_v)) #define QR_ILOG2(_v) (((_v)&0xF0)?4+QR_ILOG1((_v)>>4):QR_ILOG1(_v)) #define QR_ILOG3(_v) (((_v)&0xFF00)?8+QR_ILOG2((_v)>>8):QR_ILOG2(_v)) #define QR_ILOG4(_v) (((_v)&0xFFFF0000)?16+QR_ILOG3((_v)>>16):QR_ILOG3(_v)) /*Computes the integer logarithm of a (positive, 32-bit) constant.*/ #define QR_ILOG(_v) ((int)QR_ILOG4((unsigned)(_v))) /*Multiplies 32-bit numbers _a and _b, adds (possibly 64-bit) number _r, and takes bits [_s,_s+31] of the result.*/ #define QR_FIXMUL(_a,_b,_r,_s) ((int)((_a)*(long long)(_b)+(_r)>>(_s))) /*Multiplies 32-bit numbers _a and _b, adds (possibly 64-bit) number _r, and gives all 64 bits of the result.*/ #define QR_EXTMUL(_a,_b,_r) ((_a)*(long long)(_b)+(_r)) unsigned qr_isqrt(unsigned _val); unsigned qr_ihypot(int _x,int _y); int qr_ilog(unsigned _val); #endif zbar-0.10/zbar/qrcode/isaac.c0000644000000000000000000000733711270371414012730 00000000000000/*Written by Timothy B. Terriberry (tterribe@xiph.org) 1999-2009 public domain. Based on the public domain implementation by Robert J. Jenkins Jr.*/ #include #include #include #include "isaac.h" #define ISAAC_MASK (0xFFFFFFFFU) static void isaac_update(isaac_ctx *_ctx){ unsigned *m; unsigned *r; unsigned a; unsigned b; unsigned x; unsigned y; int i; m=_ctx->m; r=_ctx->r; a=_ctx->a; b=_ctx->b+(++_ctx->c)&ISAAC_MASK; for(i=0;i>2]+a+b&ISAAC_MASK; r[i]=b=m[y>>ISAAC_SZ_LOG+2&ISAAC_SZ-1]+x&ISAAC_MASK; x=m[++i]; a=(a^a>>6)+m[i+ISAAC_SZ/2]&ISAAC_MASK; m[i]=y=m[(x&ISAAC_SZ-1<<2)>>2]+a+b&ISAAC_MASK; r[i]=b=m[y>>ISAAC_SZ_LOG+2&ISAAC_SZ-1]+x&ISAAC_MASK; x=m[++i]; a=(a^a<<2)+m[i+ISAAC_SZ/2]&ISAAC_MASK; m[i]=y=m[(x&ISAAC_SZ-1<<2)>>2]+a+b&ISAAC_MASK; r[i]=b=m[y>>ISAAC_SZ_LOG+2&ISAAC_SZ-1]+x&ISAAC_MASK; x=m[++i]; a=(a^a>>16)+m[i+ISAAC_SZ/2]&ISAAC_MASK; m[i]=y=m[(x&ISAAC_SZ-1<<2)>>2]+a+b&ISAAC_MASK; r[i]=b=m[y>>ISAAC_SZ_LOG+2&ISAAC_SZ-1]+x&ISAAC_MASK; } for(i=ISAAC_SZ/2;i>2]+a+b&ISAAC_MASK; r[i]=b=m[y>>ISAAC_SZ_LOG+2&ISAAC_SZ-1]+x&ISAAC_MASK; x=m[++i]; a=(a^a>>6)+m[i-ISAAC_SZ/2]&ISAAC_MASK; m[i]=y=m[(x&ISAAC_SZ-1<<2)>>2]+a+b&ISAAC_MASK; r[i]=b=m[y>>ISAAC_SZ_LOG+2&ISAAC_SZ-1]+x&ISAAC_MASK; x=m[++i]; a=(a^a<<2)+m[i-ISAAC_SZ/2]&ISAAC_MASK; m[i]=y=m[(x&ISAAC_SZ-1<<2)>>2]+a+b&ISAAC_MASK; r[i]=b=m[y>>ISAAC_SZ_LOG+2&ISAAC_SZ-1]+x&ISAAC_MASK; x=m[++i]; a=(a^a>>16)+m[i-ISAAC_SZ/2]&ISAAC_MASK; m[i]=y=m[(x&ISAAC_SZ-1<<2)>>2]+a+b&ISAAC_MASK; r[i]=b=m[y>>ISAAC_SZ_LOG+2&ISAAC_SZ-1]+x&ISAAC_MASK; } _ctx->b=b; _ctx->a=a; _ctx->n=ISAAC_SZ; } static void isaac_mix(unsigned _x[8]){ static const unsigned char SHIFT[8]={11,2,8,16,10,4,8,9}; int i; for(i=0;i<8;i++){ _x[i]^=_x[i+1&7]<>SHIFT[i]; _x[i+3&7]+=_x[i]; _x[i+1&7]+=_x[i+2&7]; } } void isaac_init(isaac_ctx *_ctx,const void *_seed,int _nseed){ const unsigned char *seed; unsigned *m; unsigned *r; unsigned x[8]; int i; int j; _ctx->a=_ctx->b=_ctx->c=0; m=_ctx->m; r=_ctx->r; x[0]=x[1]=x[2]=x[3]=x[4]=x[5]=x[6]=x[7]=0x9E3779B9; for(i=0;i<4;i++)isaac_mix(x); if(_nseed>ISAAC_SEED_SZ_MAX)_nseed=ISAAC_SEED_SZ_MAX; seed=(const unsigned char *)_seed; for(i=0;i<_nseed>>2;i++){ r[i]=seed[i<<2|3]<<24|seed[i<<2|2]<<16|seed[i<<2|1]<<8|seed[i<<2]; } if(_nseed&3){ r[i]=seed[i<<2]; for(j=1;j<(_nseed&3);j++)r[i]+=seed[i<<2|j]<<(j<<3); i++; } memset(r+i,0,(ISAAC_SZ-i)*sizeof(*r)); for(i=0;in)isaac_update(_ctx); return _ctx->r[--_ctx->n]; } /*Returns a uniform random integer less than the given maximum value. _n: The upper bound on the range of numbers returned (not inclusive). This must be strictly less than 2**32. Return: An integer uniformly distributed between 0 (inclusive) and _n (exclusive).*/ unsigned isaac_next_uint(isaac_ctx *_ctx,unsigned _n){ unsigned r; unsigned v; unsigned d; do{ r=isaac_next_uint32(_ctx); v=r%_n; d=r-v; } while((d+_n-1&ISAAC_MASK)0&&!_o[d-1];d--); return d; } /*Find the roots of the error polynomial. Returns the number of roots found, or a negative value if the polynomial did not have enough roots, indicating a decoding error.*/ static int bch15_5_calc_epos(unsigned _epos[3],unsigned _s[3]){ unsigned o[3]; int nerrors; int d; int i; d=bch15_5_calc_omega(o,_s); nerrors=0; if(d==1)_epos[nerrors++]=gf16_log[o[0]]; else if(d>0){ for(i=0;i<15;i++){ int i2; i2=gf16_log[gf16_exp[i<<1]]; if(!(gf16_exp[i+i2]^gf16_hmul(o[0],i2)^gf16_hmul(o[1],i)^o[2])){ _epos[nerrors++]=i; } } if(nerrors0){ /*If we had a non-zero syndrome value, we should always find at least one error location, or we've got a decoding error.*/ for(i=0;i>10)==y){ /*Decoding succeeded.*/ *_y=y; return nerrors; } } /*Decoding failed due to too many bit errors.*/ return -1; } unsigned bch15_5_encode(unsigned _x){ return (-(_x&1)&0x0537)^(-(_x>>1&1)&0x0A6E)^(-(_x>>2&1)&0x11EB)^ (-(_x>>3&1)&0x23D6)^(-(_x>>4&1)&0x429B); } #if 0 #include static unsigned codes[32]; static int hamming(int _a,int _b){ int d; int n; d=_a^_b; for(n=0;d;n++)d&=d-1; return n; } static int closest(int _y){ int min_i; int min_d; int i; int d; min_i=0; min_d=hamming(_y,codes[0]); for(i=1;i<32;i++){ d=hamming(_y,codes[i]); if(dFailed\n",i); if(hamming(i,z)<=3)printf("Error: 0x%04X should map to 0x%04X\n",i,z); } else{ printf("0x%04X->0x%04X\n",i,y); if(z!=y)printf("Error: 0x%04X should map to 0x%04X\n",i,z); } } return 0; } #endif zbar-0.10/zbar/qrcode/qrdectxt.c0000644000000000000000000003403611270371414013502 00000000000000/*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #include #include #include #include #include "qrcode.h" #include "qrdec.h" #include "util.h" #include "image.h" #include "error.h" #include "img_scanner.h" static int text_is_ascii(const unsigned char *_text,int _len){ int i; for(i=0;i<_len;i++)if(_text[i]>=0x80)return 0; return 1; } static int text_is_latin1(const unsigned char *_text,int _len){ int i; for(i=0;i<_len;i++){ /*The following line fails to compile correctly with gcc 3.4.4 on ARM with any optimizations enabled.*/ if(_text[i]>=0x80&&_text[i]<0xA0)return 0; } return 1; } static void enc_list_mtf(iconv_t _enc_list[3],iconv_t _enc){ int i; for(i=0;i<3;i++)if(_enc_list[i]==_enc){ int j; for(j=i;j-->0;)_enc_list[j+1]=_enc_list[j]; _enc_list[0]=_enc; break; } } int qr_code_data_list_extract_text(const qr_code_data_list *_qrlist, zbar_image_scanner_t *iscn, zbar_image_t *img) { iconv_t sjis_cd; iconv_t utf8_cd; iconv_t latin1_cd; const qr_code_data *qrdata; int nqrdata; unsigned char *mark; char **text; int ntext; int i; qrdata=_qrlist->qrdata; nqrdata=_qrlist->nqrdata; text=(char **)malloc(nqrdata*sizeof(*text)); mark=(unsigned char *)calloc(nqrdata,sizeof(*mark)); ntext=0; /*This is the encoding the standard says is the default.*/ latin1_cd=iconv_open("UTF-8","ISO8859-1"); /*But this one is often used, as well.*/ sjis_cd=iconv_open("UTF-8","SJIS"); /*This is a trivial conversion just to check validity without extra code.*/ utf8_cd=iconv_open("UTF-8","UTF-8"); for(i=0;i=0){ qrdataj=qrdata+sa[j]; for(k=0;knentries;k++){ int shift; entry=qrdataj->entries+k; shift=0; switch(entry->mode){ /*FNC1 applies to the entire code and ignores subsequent markers.*/ case QR_MODE_FNC1_1ST: case QR_MODE_FNC1_2ND:fnc1=1;break; /*2 SJIS bytes will be at most 4 UTF-8 bytes.*/ case QR_MODE_KANJI:shift++; /*We assume at most 4 UTF-8 bytes per input byte. I believe this is true for all the encodings we actually use.*/ case QR_MODE_BYTE:shift++; default:{ /*The remaining two modes are already valid UTF-8.*/ if(QR_MODE_HAS_DATA(entry->mode)){ sa_ctext+=entry->payload.data.len<next) { *sym = _zbar_image_scanner_alloc_sym(iscn, ZBAR_QRCODE, 0); (*sym)->datalen = sa_ntext; if(sa[j]<0){ /* generic placeholder for unfinished results */ (*sym)->type = ZBAR_PARTIAL; /*Skip all contiguous missing segments.*/ for(j++;j=sa_size)break; /* mark break in data */ sa_text[sa_ntext++]='\0'; (*sym)->datalen = sa_ntext; /* advance to next symbol */ sym = &(*sym)->next; *sym = _zbar_image_scanner_alloc_sym(iscn, ZBAR_QRCODE, 0); } qrdataj=qrdata+sa[j]; /* expose bounding box */ sym_add_point(*sym, qrdataj->bbox[0][0], qrdataj->bbox[0][1]); sym_add_point(*sym, qrdataj->bbox[2][0], qrdataj->bbox[2][1]); sym_add_point(*sym, qrdataj->bbox[3][0], qrdataj->bbox[3][1]); sym_add_point(*sym, qrdataj->bbox[1][0], qrdataj->bbox[1][1]); for(k=0;knentries&&!err;k++){ size_t inleft; size_t outleft; char *in; char *out; entry=qrdataj->entries+k; switch(entry->mode){ case QR_MODE_NUM:{ if(sa_ctext-sa_ntext>=(size_t)entry->payload.data.len){ memcpy(sa_text+sa_ntext,entry->payload.data.buf, entry->payload.data.len*sizeof(*sa_text)); sa_ntext+=entry->payload.data.len; } else err=1; }break; case QR_MODE_ALNUM:{ char *p; in=(char *)entry->payload.data.buf; inleft=entry->payload.data.len; /*FNC1 uses '%' as an escape character.*/ if(fnc1)for(;;){ size_t plen; char c; p=memchr(in,'%',inleft*sizeof(*in)); if(p==NULL)break; plen=p-in; if(sa_ctext-sa_ntextpayload.data.buf; inleft=entry->payload.data.len; out=sa_text+sa_ntext; outleft=sa_ctext-sa_ntext; /*If we have no specified encoding, attempt to auto-detect it.*/ if(eci<0){ int ei; /*First check for the UTF-8 BOM.*/ if(inleft>=3&& in[0]==(char)0xEF&&in[1]==(char)0xBB&&in[2]==(char)0xBF){ in+=3; inleft-=3; /*Actually try converting (to check validity).*/ err=utf8_cd==(iconv_t)-1|| iconv(utf8_cd,&in,&inleft,&out,&outleft)==(size_t)-1; if(!err){ sa_ntext=out-sa_text; enc_list_mtf(enc_list,utf8_cd); continue; } in=(char *)entry->payload.data.buf; inleft=entry->payload.data.len; out=sa_text+sa_ntext; outleft=sa_ctext-sa_ntext; } /*If the text is 8-bit clean, prefer UTF-8 over SJIS, since SJIS will corrupt the backslashes used for DoCoMo formats.*/ else if(text_is_ascii((unsigned char *)in,inleft)){ enc_list_mtf(enc_list,utf8_cd); } /*Try our list of encodings.*/ for(ei=0;ei<3;ei++)if(enc_list[ei]!=(iconv_t)-1){ /*According to the standard, ISO/IEC 8859-1 (one hyphen) is supposed to be used, but reality is not always so. It's got an invalid range that is used often with SJIS and UTF-8, though, which makes detection easier. However, iconv() does not properly reject characters in those ranges, since ISO-8859-1 (two hyphens) defines a number of seldom-used control code characters there. So if we see any of those characters, move this conversion to the end of the list.*/ if(ei<2&&enc_list[ei]==latin1_cd&& !text_is_latin1((unsigned char *)in,inleft)){ int ej; for(ej=ei+1;ej<3;ej++)enc_list[ej-1]=enc_list[ej]; enc_list[2]=latin1_cd; } err=iconv(enc_list[ei],&in,&inleft,&out,&outleft)==(size_t)-1; if(!err){ sa_ntext=out-sa_text; enc_list_mtf(enc_list,enc_list[ei]); break; } in=(char *)entry->payload.data.buf; inleft=entry->payload.data.len; out=sa_text+sa_ntext; outleft=sa_ctext-sa_ntext; } } /*We were actually given a character set; use it.*/ else{ err=eci_cd==(iconv_t)-1|| iconv(eci_cd,&in,&inleft,&out,&outleft)==(size_t)-1; if(!err)sa_ntext=out-sa_text; } }break; /*Kanji mode always uses SJIS.*/ case QR_MODE_KANJI:{ in=(char *)entry->payload.data.buf; inleft=entry->payload.data.len; out=sa_text+sa_ntext; outleft=sa_ctext-sa_ntext; err=sjis_cd==(iconv_t)-1|| iconv(sjis_cd,&in,&inleft,&out,&outleft)==(size_t)-1; if(!err)sa_ntext=out-sa_text; }break; /*Check to see if a character set was specified.*/ case QR_MODE_ECI:{ const char *enc; char buf[16]; unsigned cur_eci; cur_eci=entry->payload.eci; if(cur_eci<=QR_ECI_ISO8859_16&&cur_eci!=14){ if(cur_eci!=QR_ECI_GLI0&&cur_eci!=QR_ECI_CP437){ sprintf(buf,"ISO8859-%i",QR_MAXI(cur_eci,3)-2); enc=buf; } /*Note that CP437 requires an iconv compiled with --enable-extra-encodings, and thus may not be available.*/ else enc="CP437"; } else if(cur_eci==QR_ECI_SJIS)enc="SJIS"; /*Don't know what this ECI code specifies, but not an encoding that we recognize.*/ else continue; eci=cur_eci; eci_cd=iconv_open("UTF-8",enc); }break; /*Silence stupid compiler warnings.*/ default:break; } } /*If eci should be reset between codes, do so.*/ if(eci<=QR_ECI_GLI1){ eci=-1; if(eci_cd!=(iconv_t)-1)iconv_close(eci_cd); } } if(eci_cd!=(iconv_t)-1)iconv_close(eci_cd); if(!err){ sa_text[sa_ntext++]='\0'; if(sa_ctext+1>sa_ntext){ sa_text=(char *)realloc(sa_text,sa_ntext*sizeof(*sa_text)); } zbar_symbol_t *sa_sym; if(sa_size == 1) sa_sym = syms; else { /* create "virtual" container symbol for composite result */ sa_sym = _zbar_image_scanner_alloc_sym(iscn, ZBAR_QRCODE, 0); sa_sym->syms = _zbar_symbol_set_create(); sa_sym->syms->head = syms; /* cheap out w/axis aligned bbox for now */ int xmin = img->width, xmax = -2; int ymin = img->height, ymax = -2; /* fixup data references */ for(; syms; syms = syms->next) { _zbar_symbol_refcnt(syms, 1); if(syms->type == ZBAR_PARTIAL) sa_sym->type = ZBAR_PARTIAL; else for(j = 0; j < syms->npts; j++) { int u = syms->pts[j].x; if(xmin >= u) xmin = u - 1; if(xmax <= u) xmax = u + 1; u = syms->pts[j].y; if(ymin >= u) ymin = u - 1; if(ymax <= u) ymax = u + 1; } syms->data = sa_text + syms->datalen; int next = (syms->next) ? syms->next->datalen : sa_ntext; assert(next > syms->datalen); syms->datalen = next - syms->datalen - 1; } if(xmax >= -1) { sym_add_point(sa_sym, xmin, ymin); sym_add_point(sa_sym, xmin, ymax); sym_add_point(sa_sym, xmax, ymax); sym_add_point(sa_sym, xmax, ymin); } } sa_sym->data = sa_text; sa_sym->data_alloc = sa_ntext; sa_sym->datalen = sa_ntext - 1; _zbar_image_scanner_add_sym(iscn, sa_sym); } else { _zbar_image_scanner_recycle_syms(iscn, syms); free(sa_text); } } if(utf8_cd!=(iconv_t)-1)iconv_close(utf8_cd); if(sjis_cd!=(iconv_t)-1)iconv_close(sjis_cd); if(latin1_cd!=(iconv_t)-1)iconv_close(latin1_cd); free(mark); return ntext; } zbar-0.10/zbar/qrcode/qrdec.h0000644000000000000000000001232311270371414012742 00000000000000/*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #if !defined(_qrdec_H) # define _qrdec_H (1) #include typedef struct qr_code_data_entry qr_code_data_entry; typedef struct qr_code_data qr_code_data; typedef struct qr_code_data_list qr_code_data_list; typedef enum qr_mode{ /*Numeric digits ('0'...'9').*/ QR_MODE_NUM=1, /*Alphanumeric characters ('0'...'9', 'A'...'Z', plus the punctuation ' ', '$', '%', '*', '+', '-', '.', '/', ':').*/ QR_MODE_ALNUM, /*Structured-append header.*/ QR_MODE_STRUCT, /*Raw 8-bit bytes.*/ QR_MODE_BYTE, /*FNC1 marker (for more info, see http://www.mecsw.com/specs/uccean128.html). In the "first position" data is formatted in accordance with GS1 General Specifications.*/ QR_MODE_FNC1_1ST, /*Mode 6 reserved?*/ /*Extended Channel Interpretation code.*/ QR_MODE_ECI=7, /*SJIS kanji characters.*/ QR_MODE_KANJI, /*FNC1 marker (for more info, see http://www.mecsw.com/specs/uccean128.html). In the "second position" data is formatted in accordance with an industry application as specified by AIM Inc.*/ QR_MODE_FNC1_2ND }qr_mode; /*Check if a mode has a data buffer associated with it. Currently this is only modes with exactly one bit set.*/ #define QR_MODE_HAS_DATA(_mode) (!((_mode)&(_mode)-1)) /*ECI may be used to signal a character encoding for the data.*/ typedef enum qr_eci_encoding{ /*GLI0 is like CP437, but the encoding is reset at the beginning of each structured append symbol.*/ QR_ECI_GLI0, /*GLI1 is like ISO8859_1, but the encoding is reset at the beginning of each structured append symbol.*/ QR_ECI_GLI1, /*The remaining encodings do not reset at the start of the next structured append symbol.*/ QR_ECI_CP437, /*Western European.*/ QR_ECI_ISO8859_1, /*Central European.*/ QR_ECI_ISO8859_2, /*South European.*/ QR_ECI_ISO8859_3, /*North European.*/ QR_ECI_ISO8859_4, /*Cyrillic.*/ QR_ECI_ISO8859_5, /*Arabic.*/ QR_ECI_ISO8859_6, /*Greek.*/ QR_ECI_ISO8859_7, /*Hebrew.*/ QR_ECI_ISO8859_8, /*Turkish.*/ QR_ECI_ISO8859_9, /*Nordic.*/ QR_ECI_ISO8859_10, /*Thai.*/ QR_ECI_ISO8859_11, /*There is no ISO/IEC 8859-12.*/ /*Baltic rim.*/ QR_ECI_ISO8859_13=QR_ECI_ISO8859_11+2, /*Celtic.*/ QR_ECI_ISO8859_14, /*Western European with euro.*/ QR_ECI_ISO8859_15, /*South-Eastern European (with euro).*/ QR_ECI_ISO8859_16, /*ECI 000019 is reserved?*/ /*Shift-JIS.*/ QR_ECI_SJIS=20 }qr_eci_encoding; /*A single unit of parsed QR code data.*/ struct qr_code_data_entry{ /*The mode of this data block.*/ qr_mode mode; union{ /*Data buffer for modes that have one.*/ struct{ unsigned char *buf; int len; }data; /*Decoded "Extended Channel Interpretation" data.*/ unsigned eci; /*Structured-append header data.*/ struct{ unsigned char sa_index; unsigned char sa_size; unsigned char sa_parity; }sa; }payload; }; /*Low-level QR code data.*/ struct qr_code_data{ /*The decoded data entries.*/ qr_code_data_entry *entries; int nentries; /*The code version (1...40).*/ unsigned char version; /*The ECC level (0...3, corresponding to 'L', 'M', 'Q', and 'H').*/ unsigned char ecc_level; /*Structured-append information.*/ /*The index of this code in the structured-append group. If sa_size is zero, this is undefined.*/ unsigned char sa_index; /*The size of the structured-append group, or 0 if there was no S-A header.*/ unsigned char sa_size; /*The parity of the entire structured-append group. If sa_size is zero, this is undefined.*/ unsigned char sa_parity; /*The parity of this code. If sa_size is zero, this is undefined.*/ unsigned char self_parity; /*An approximate bounding box for the code. Points appear in the order up-left, up-right, down-left, down-right, relative to the orientation of the QR code.*/ qr_point bbox[4]; }; struct qr_code_data_list{ qr_code_data *qrdata; int nqrdata; int cqrdata; }; /*Extract symbol data from a list of QR codes and attach to the image. All text is converted to UTF-8. Any structured-append group that does not have all of its members is decoded as ZBAR_PARTIAL with ZBAR_PARTIAL components for the discontinuities. Note that isolated members of a structured-append group may be decoded with the wrong character set, since the correct setting cannot be propagated between codes. Return: The number of symbols which were successfully extracted from the codes; this will be at most the number of codes.*/ int qr_code_data_list_extract_text(const qr_code_data_list *_qrlist, zbar_image_scanner_t *iscn, zbar_image_t *img); /*TODO: Parse DoCoMo standard barcode data formats. See http://www.nttdocomo.co.jp/english/service/imode/make/content/barcode/function/application/ for details.*/ #endif zbar-0.10/zbar/qrcode/util.c0000644000000000000000000000653211270371414012621 00000000000000/*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #include #include "util.h" /*Computes floor(sqrt(_val)) exactly.*/ unsigned qr_isqrt(unsigned _val){ unsigned g; unsigned b; int bshift; /*Uses the second method from http://www.azillionmonkeys.com/qed/sqroot.html The main idea is to search for the largest binary digit b such that (g+b)*(g+b) <= _val, and add it to the solution g.*/ g=0; b=0x8000; for(bshift=16;bshift-->0;){ unsigned t; t=(g<<1)+b<>=1; } return g; } /*Computes sqrt(_x*_x+_y*_y) using CORDIC. This implementation is valid for all 32-bit inputs and returns a result accurate to about 27 bits of precision. It has been tested for all postiive 16-bit inputs, where it returns correctly rounded results in 99.998% of cases and the maximum error is 0.500137134862598032 (for _x=48140, _y=63018). Very nearly all results less than (1<<16) are correctly rounded. All Pythagorean triples with a hypotenuse of less than ((1<<27)-1) evaluate correctly, and the total bias over all Pythagorean triples is -0.04579, with a relative RMS error of 7.2864E-10 and a relative peak error of 7.4387E-9.*/ unsigned qr_ihypot(int _x,int _y){ unsigned x; unsigned y; int mask; int shift; int u; int v; int i; x=_x=abs(_x); y=_y=abs(_y); mask=-(x>y)&(_x^_y); x^=mask; y^=mask; _y^=mask; shift=31-qr_ilog(y); shift=QR_MAXI(shift,0); x=(unsigned)((x<>32); _y=(int)((_y<>32); u=x; mask=-(_y<0); x+=_y+mask^mask; _y-=u+mask^mask; u=x+1>>1; v=_y+1>>1; mask=-(_y<0); x+=v+mask^mask; _y-=u+mask^mask; for(i=1;i<16;i++){ int r; u=x+1>>2; r=(1<<2*i)>>1; v=_y+r>>2*i; mask=-(_y<0); x+=v+mask^mask; _y=_y-(u+mask^mask)<<1; } return x+((1U<>1)>>shift; } #if defined(__GNUC__) && defined(HAVE_FEATURES_H) # include # if __GNUC_PREREQ(3,4) # include # if INT_MAX>=2147483647 # define QR_CLZ0 sizeof(unsigned)*CHAR_BIT # define QR_CLZ(_x) (__builtin_clz(_x)) # elif LONG_MAX>=2147483647L # define QR_CLZ0 sizeof(unsigned long)*CHAR_BIT # define QR_CLZ(_x) (__builtin_clzl(_x)) # endif # endif #endif int qr_ilog(unsigned _v){ #if defined(QR_CLZ) /*Note that __builtin_clz is not defined when _x==0, according to the gcc documentation (and that of the x86 BSR instruction that implements it), so we have to special-case it.*/ return QR_CLZ0-QR_CLZ(_v)&-!!_v; #else int ret; int m; m=!!(_v&0xFFFF0000)<<4; _v>>=m; ret=m; m=!!(_v&0xFF00)<<3; _v>>=m; ret|=m; m=!!(_v&0xF0)<<2; _v>>=m; ret|=m; m=!!(_v&0xC)<<1; _v>>=m; ret|=m; ret|=!!(_v&0x2); return ret + !!_v; #endif } #if defined(QR_TEST_SQRT) #include #include /*Exhaustively test the integer square root function.*/ int main(void){ unsigned u; u=0; do{ unsigned r; unsigned s; r=qr_isqrt(u); s=(int)sqrt(u); if(r!=s)printf("%u: %u!=%u\n",u,r,s); u++; } while(u); return 0; } #endif zbar-0.10/zbar/qrcode/rs.c0000644000000000000000000006334111270371414012271 00000000000000/*Copyright (C) 1991-1995 Henry Minsky (hqm@ua.com, hqm@ai.mit.edu) Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #include #include #include "rs.h" /*Reed-Solomon encoder and decoder. Original implementation (C) Henry Minsky (hqm@ua.com, hqm@ai.mit.edu), Universal Access 1991-1995. Updates by Timothy B. Terriberry (C) 2008-2009: - Properly reject codes when error-locator polynomial has repeated roots or non-trivial irreducible factors. - Removed the hard-coded parity size and performed general API cleanup. - Allow multiple representations of GF(2**8), since different standards use different irreducible polynomials. - Allow different starting indices for the generator polynomial, since different standards use different values. - Greatly reduced the computation by eliminating unnecessary operations. - Explicitly solve for the roots of low-degree polynomials instead of using an exhaustive search. This is another major speed boost when there are few errors.*/ /*Galois Field arithmetic in GF(2**8).*/ void rs_gf256_init(rs_gf256 *_gf,unsigned _ppoly){ unsigned p; int i; /*Initialize the table of powers of a primtive root, alpha=0x02.*/ p=1; for(i=0;i<256;i++){ _gf->exp[i]=_gf->exp[i+255]=p; p=((p<<1)^(-(p>>7)&_ppoly))&0xFF; } /*Invert the table to recover the logs.*/ for(i=0;i<255;i++)_gf->log[_gf->exp[i]]=i; /*Note that we rely on the fact that _gf->log[0]=0 below.*/ _gf->log[0]=0; } /*Multiplication in GF(2**8) using logarithms.*/ static unsigned rs_gmul(const rs_gf256 *_gf,unsigned _a,unsigned _b){ return _a==0||_b==0?0:_gf->exp[_gf->log[_a]+_gf->log[_b]]; } /*Division in GF(2**8) using logarithms. The result of division by zero is undefined.*/ static unsigned rs_gdiv(const rs_gf256 *_gf,unsigned _a,unsigned _b){ return _a==0?0:_gf->exp[_gf->log[_a]+255-_gf->log[_b]]; } /*Multiplication in GF(2**8) when one of the numbers is known to be non-zero (proven by representing it by its logarithm).*/ static unsigned rs_hgmul(const rs_gf256 *_gf,unsigned _a,unsigned _logb){ return _a==0?0:_gf->exp[_gf->log[_a]+_logb]; } /*Square root in GF(2**8) using logarithms.*/ static unsigned rs_gsqrt(const rs_gf256 *_gf,unsigned _a){ unsigned loga; if(!_a)return 0; loga=_gf->log[_a]; return _gf->exp[loga+(255&-(loga&1))>>1]; } /*Polynomial root finding in GF(2**8). Each routine returns a list of the distinct roots (i.e., with duplicates removed).*/ /*Solve a quadratic equation x**2 + _b*x + _c in GF(2**8) using the method of~\cite{Wal99}. Returns the number of distinct roots. ARTICLE{Wal99, author="C. Wayne Walker", title="New Formulas for Solving Quadratic Equations over Certain Finite Fields", journal="{IEEE} Transactions on Information Theory", volume=45, number=1, pages="283--284", month=Jan, year=1999 }*/ static int rs_quadratic_solve(const rs_gf256 *_gf,unsigned _b,unsigned _c, unsigned char _x[2]){ unsigned b; unsigned logb; unsigned logb2; unsigned logb4; unsigned logb8; unsigned logb12; unsigned logb14; unsigned logc; unsigned logc2; unsigned logc4; unsigned c8; unsigned g3; unsigned z3; unsigned l3; unsigned c0; unsigned g2; unsigned l2; unsigned z2; int inc; /*If _b is zero, all we need is a square root.*/ if(!_b){ _x[0]=rs_gsqrt(_gf,_c); return 1; } /*If _c is zero, 0 and _b are the roots.*/ if(!_c){ _x[0]=0; _x[1]=_b; return 2; } logb=_gf->log[_b]; logc=_gf->log[_c]; /*If _b lies in GF(2**4), scale x to move it out.*/ inc=logb%(255/15)==0; if(inc){ b=_gf->exp[logb+254]; logb=_gf->log[b]; _c=_gf->exp[logc+253]; logc=_gf->log[_c]; } else b=_b; logb2=_gf->log[_gf->exp[logb<<1]]; logb4=_gf->log[_gf->exp[logb2<<1]]; logb8=_gf->log[_gf->exp[logb4<<1]]; logb12=_gf->log[_gf->exp[logb4+logb8]]; logb14=_gf->log[_gf->exp[logb2+logb12]]; logc2=_gf->log[_gf->exp[logc<<1]]; logc4=_gf->log[_gf->exp[logc2<<1]]; c8=_gf->exp[logc4<<1]; g3=rs_hgmul(_gf, _gf->exp[logb14+logc]^_gf->exp[logb12+logc2]^_gf->exp[logb8+logc4]^c8,logb); /*If g3 doesn't lie in GF(2**4), then our roots lie in an extension field. Note that we rely on the fact that _gf->log[0]==0 here.*/ if(_gf->log[g3]%(255/15)!=0)return 0; /*Construct the corresponding quadratic in GF(2**4): x**2 + x/alpha**(255/15) + l3/alpha**(2*(255/15))*/ z3=rs_gdiv(_gf,g3,_gf->exp[logb8<<1]^b); l3=rs_hgmul(_gf,rs_gmul(_gf,z3,z3)^rs_hgmul(_gf,z3,logb)^_c,255-logb2); c0=rs_hgmul(_gf,l3,255-2*(255/15)); /*Construct the corresponding quadratic in GF(2**2): x**2 + x/alpha**(255/3) + l2/alpha**(2*(255/3))*/ g2=rs_hgmul(_gf, rs_hgmul(_gf,c0,255-2*(255/15))^rs_gmul(_gf,c0,c0),255-255/15); z2=rs_gdiv(_gf,g2,_gf->exp[255-(255/15)*4]^_gf->exp[255-(255/15)]); l2=rs_hgmul(_gf, rs_gmul(_gf,z2,z2)^rs_hgmul(_gf,z2,255-(255/15))^c0,2*(255/15)); /*Back substitute to the solution in the original field.*/ _x[0]=_gf->exp[_gf->log[z3^rs_hgmul(_gf, rs_hgmul(_gf,l2,255/3)^rs_hgmul(_gf,z2,255/15),logb)]+inc]; _x[1]=_x[0]^_b; return 2; } /*Solve a cubic equation x**3 + _a*x**2 + _b*x + _c in GF(2**8). Returns the number of distinct roots.*/ static int rs_cubic_solve(const rs_gf256 *_gf, unsigned _a,unsigned _b,unsigned _c,unsigned char _x[3]){ unsigned k; unsigned logd; unsigned d2; unsigned logd2; unsigned logw; int nroots; /*If _c is zero, factor out the 0 root.*/ if(!_c){ nroots=rs_quadratic_solve(_gf,_a,_b,_x); if(_b)_x[nroots++]=0; return nroots; } /*Substitute x=_a+y*sqrt(_a**2+_b) to get y**3 + y + k == 0, k = (_a*_b+c)/(_a**2+b)**(3/2).*/ k=rs_gmul(_gf,_a,_b)^_c; d2=rs_gmul(_gf,_a,_a)^_b; if(!d2){ int logx; if(!k){ /*We have a triple root.*/ _x[0]=_a; return 1; } logx=_gf->log[k]; if(logx%3!=0)return 0; logx/=3; _x[0]=_a^_gf->exp[logx]; _x[1]=_a^_gf->exp[logx+255/3]; _x[2]=_a^_x[0]^_x[1]; return 3; } logd2=_gf->log[d2]; logd=logd2+(255&-(logd2&1))>>1; k=rs_gdiv(_gf,k,_gf->exp[logd+logd2]); /*Substitute y=w+1/w and z=w**3 to get z**2 + k*z + 1 == 0.*/ nroots=rs_quadratic_solve(_gf,k,1,_x); if(nroots<1){ /*The Reed-Solomon code is only valid if we can find 3 distinct roots in GF(2**8), so if we know there's only one, we don't actually need to find it. Note that we're also called by the quartic solver, but if we contain a non-trivial irreducible factor, than so does the original quartic~\cite{LW72}, and failing to return a root here actually saves us some work there, also.*/ return 0; } /*Recover w from z.*/ logw=_gf->log[_x[0]]; if(logw){ if(logw%3!=0)return 0; logw/=3; /*Recover x from w.*/ _x[0]=_gf->exp[_gf->log[_gf->exp[logw]^_gf->exp[255-logw]]+logd]^_a; logw+=255/3; _x[1]=_gf->exp[_gf->log[_gf->exp[logw]^_gf->exp[255-logw]]+logd]^_a; _x[2]=_x[0]^_x[1]^_a; return 3; } else{ _x[0]=_a; /*In this case _x[1] is a double root, so we know the Reed-Solomon code is invalid. Note that we still have to return at least one root, because if we're being called by the quartic solver, the quartic might still have 4 distinct roots. But we don't need more than one root, so we can avoid computing the expensive one.*/ /*_x[1]=_gf->exp[_gf->log[_gf->exp[255/3]^_gf->exp[2*(255/3)]]+logd]^_a;*/ return 1; } } /*Solve a quartic equation x**4 + _a*x**3 + _b*x**2 + _c*x + _d in GF(2**8) by decomposing it into the cases given by~\cite{LW72}. Returns the number of distinct roots. @ARTICLE{LW72, author="Philip A. Leonard and Kenneth S. Williams", title="Quartics over $GF(2^n)$", journal="Proceedings of the American Mathematical Society", volume=36, number=2, pages="347--450", month=Dec, year=1972 }*/ static int rs_quartic_solve(const rs_gf256 *_gf, unsigned _a,unsigned _b,unsigned _c,unsigned _d,unsigned char _x[3]){ unsigned r; unsigned s; unsigned t; unsigned b; int nroots; int i; /*If _d is zero, factor out the 0 root.*/ if(!_d){ nroots=rs_cubic_solve(_gf,_a,_b,_c,_x); if(_c)_x[nroots++]=0; return nroots; } if(_a){ unsigned loga; /*Substitute x=(1/y) + sqrt(_c/_a) to eliminate the cubic term.*/ loga=_gf->log[_a]; r=rs_hgmul(_gf,_c,255-loga); s=rs_gsqrt(_gf,r); t=_d^rs_gmul(_gf,_b,r)^rs_gmul(_gf,r,r); if(t){ unsigned logti; logti=255-_gf->log[t]; /*The result is still quartic, but with no cubic term.*/ nroots=rs_quartic_solve(_gf,0,rs_hgmul(_gf,_b^rs_hgmul(_gf,s,loga),logti), _gf->exp[loga+logti],_gf->exp[logti],_x); for(i=0;iexp[255-_gf->log[_x[i]]]^s; } else{ /*s must be a root~\cite{LW72}, and is in fact a double-root~\cite{CCO69}. Thus we're left with only a quadratic to solve. @ARTICLE{CCO69, author="Robert T. Chien and B. D. Cunningham and I. B. Oldham", title="Hybrid Methods for Finding Roots of a Polynomial---With Applications to {BCH} Decoding", journal="{IEEE} Transactions on Information Theory", volume=15, number=2, pages="329--335", month=Mar, year=1969 }*/ nroots=rs_quadratic_solve(_gf,_a,_b^r,_x); /*s may be a triple root if s=_b/_a, but not quadruple, since _a!=0.*/ if(nroots!=2||_x[0]!=s&&_x[1]!=s)_x[nroots++]=s; } return nroots; } /*If there are no odd powers, it's really just a quadratic in disguise.*/ if(!_c)return rs_quadratic_solve(_gf,rs_gsqrt(_gf,_b),rs_gsqrt(_gf,_d),_x); /*Factor into (x**2 + r*x + s)*(x**2 + r*x + t) by solving for r, which can be shown to satisfy r**3 + _b*r + _c == 0.*/ nroots=rs_cubic_solve(_gf,0,_b,_c,_x); if(nroots<1){ /*The Reed-Solomon code is only valid if we can find 4 distinct roots in GF(2**8). If the cubic does not factor into 3 (possibly duplicate) roots, then we know that the quartic must have a non-trivial irreducible factor.*/ return 0; } r=_x[0]; /*Now solve for s and t.*/ b=rs_gdiv(_gf,_c,r); nroots=rs_quadratic_solve(_gf,b,_d,_x); if(nroots<2)return 0; s=_x[0]; t=_x[1]; /*_c=r*(s^t) was non-zero, so s and t must be distinct. But if z is a root of z**2 ^ r*z ^ s, then so is (z^r), and s = z*(z^r). Hence if z is also a root of z**2 ^ r*z ^ t, then t = s, a contradiction. Thus all four roots are distinct, if they exist.*/ nroots=rs_quadratic_solve(_gf,r,s,_x); return nroots+rs_quadratic_solve(_gf,r,t,_x+nroots); } /*Polynomial arithmetic with coefficients in GF(2**8).*/ static void rs_poly_zero(unsigned char *_p,int _dp1){ memset(_p,0,_dp1*sizeof(*_p)); } static void rs_poly_copy(unsigned char *_p,const unsigned char *_q,int _dp1){ memcpy(_p,_q,_dp1*sizeof(*_p)); } /*Multiply the polynomial by the free variable, x (shift the coefficients). The number of coefficients, _dp1, must be non-zero.*/ static void rs_poly_mul_x(unsigned char *_p,const unsigned char *_q,int _dp1){ memmove(_p+1,_q,(_dp1-1)*sizeof(*_p)); _p[0]=0; } /*Divide the polynomial by the free variable, x (shift the coefficients). The number of coefficients, _dp1, must be non-zero.*/ static void rs_poly_div_x(unsigned char *_p,const unsigned char *_q,int _dp1){ memmove(_p,_q+1,(_dp1-1)*sizeof(*_p)); _p[_dp1-1]=0; } /*Compute the first (d+1) coefficients of the product of a degree e and a degree f polynomial.*/ static void rs_poly_mult(const rs_gf256 *_gf,unsigned char *_p,int _dp1, const unsigned char *_q,int _ep1,const unsigned char *_r,int _fp1){ int m; int i; rs_poly_zero(_p,_dp1); m=_ep1<_dp1?_ep1:_dp1; for(i=0;ilog[_q[i]]; for(j=0;jlog[_gf->exp[j+_m0]]; for(i=0;i<_ndata;i++)sj=_data[i]^rs_hgmul(_gf,sj,alphaj); _s[j]=sj; } } /*Berlekamp-Peterson and Berlekamp-Massey Algorithms for error-location, modified to handle known erasures, from \cite{CC81}, p. 205. This finds the coefficients of the error locator polynomial. The roots are then found by looking for the values of alpha**n where evaluating the polynomial yields zero. Error correction is done using the error-evaluator equation on p. 207. @BOOK{CC81, author="George C. Clark, Jr and J. Bibb Cain", title="Error-Correction Coding for Digitial Communications", series="Applications of Communications Theory", publisher="Springer", address="New York, NY", month=Jun, year=1981 }*/ /*Initialize lambda to the product of (1-x*alpha**e[i]) for erasure locations e[i]. Note that the user passes in array indices counting from the beginning of the data, while our polynomial indexes starting from the end, so e[i]=(_ndata-1)-_erasures[i].*/ static void rs_init_lambda(const rs_gf256 *_gf,unsigned char *_lambda,int _npar, const unsigned char *_erasures,int _nerasures,int _ndata){ int i; int j; rs_poly_zero(_lambda,(_npar<4?4:_npar)+1); _lambda[0]=1; for(i=0;i<_nerasures;i++)for(j=i+1;j>0;j--){ _lambda[j]^=rs_hgmul(_gf,_lambda[j-1],_ndata-1-_erasures[i]); } } /*From \cite{CC81}, p. 216. Returns the number of errors detected (degree of _lambda).*/ static int rs_modified_berlekamp_massey(const rs_gf256 *_gf, unsigned char *_lambda,const unsigned char *_s,unsigned char *_omega,int _npar, const unsigned char *_erasures,int _nerasures,int _ndata){ unsigned char tt[256]; int n; int l; int k; int i; /*Initialize _lambda, the error locator-polynomial, with the location of known erasures.*/ rs_init_lambda(_gf,_lambda,_npar,_erasures,_nerasures,_ndata); rs_poly_copy(tt,_lambda,_npar+1); l=_nerasures; k=0; for(n=_nerasures+1;n<=_npar;n++){ unsigned d; rs_poly_mul_x(tt,tt,n-k+1); d=0; for(i=0;i<=l;i++)d^=rs_gmul(_gf,_lambda[i],_s[n-1-i]); if(d!=0){ unsigned logd; logd=_gf->log[d]; if(llog[_epos[i]]; if((int)alpha<_ndata)_epos[nroots++]=alpha; } return nroots; } else for(alpha=0;(int)alpha<_ndata;alpha++){ unsigned alphai; unsigned sum; sum=0; alphai=0; for(i=0;i<=_nerrors;i++){ sum^=rs_hgmul(_gf,_lambda[_nerrors-i],alphai); alphai=_gf->log[_gf->exp[alphai+alpha]]; } if(!sum)_epos[nroots++]=alpha; } return nroots; } /*Corrects a codeword with _ndata<256 bytes, of which the last _npar are parity bytes. Known locations of errors can be passed in the _erasures array. Twice as many (up to _npar) errors with a known location can be corrected compared to errors with an unknown location. Returns the number of errors corrected if successful, or a negative number if the message could not be corrected because too many errors were detected.*/ int rs_correct(const rs_gf256 *_gf,int _m0,unsigned char *_data,int _ndata, int _npar,const unsigned char *_erasures,int _nerasures){ /*lambda must have storage for at least five entries to avoid special cases in the low-degree polynomial solver.*/ unsigned char lambda[256]; unsigned char omega[256]; unsigned char epos[256]; unsigned char s[256]; int i; /*If we already have too many erasures, we can't possibly succeed.*/ if(_nerasures>_npar)return -1; /*Compute the syndrome values.*/ rs_calc_syndrome(_gf,_m0,s,_npar,_data,_ndata); /*Check for a non-zero value.*/ for(i=0;i<_npar;i++)if(s[i]){ int nerrors; int j; /*Construct the error locator polynomial.*/ nerrors=rs_modified_berlekamp_massey(_gf,lambda,s,omega,_npar, _erasures,_nerasures,_ndata); /*If we can't locate any errors, we can't force the syndrome values to zero, and must have a decoding error. Conversely, if we have too many errors, there's no reason to even attempt the root search.*/ if(nerrors<=0||nerrors-_nerasures>_npar-_nerasures>>1)return -1; /*Compute the locations of the errors. If they are not all distinct, or some of them were outside the valid range for our block size, we have a decoding error.*/ if(rs_find_roots(_gf,epos,lambda,nerrors,_ndata)log[_gf->exp[alphanj+alphan1]]; } /*Evaluate the derivative of lambda at alpha**-1 All the odd powers vanish.*/ b=0; alphan2=_gf->log[_gf->exp[alphan1<<1]]; alphanj=alphan1+_m0*alpha%255; for(j=1;j<=_npar;j+=2){ b^=rs_hgmul(_gf,lambda[j],alphanj); alphanj=_gf->log[_gf->exp[alphanj+alphan2]]; } /*Apply the correction.*/ _data[_ndata-1-alpha]^=rs_gdiv(_gf,a,b); } return nerrors; } return 0; } /*Encoding.*/ /*Create an _npar-coefficient generator polynomial for a Reed-Solomon code with _npar<256 parity bytes.*/ void rs_compute_genpoly(const rs_gf256 *_gf,int _m0, unsigned char *_genpoly,int _npar){ int i; if(_npar<=0)return; rs_poly_zero(_genpoly,_npar); _genpoly[0]=1; /*Multiply by (x+alpha^i) for i = 1 ... _ndata.*/ for(i=0;i<_npar;i++){ unsigned alphai; int n; int j; n=i+1<_npar-1?i+1:_npar-1; alphai=_gf->log[_gf->exp[_m0+i]]; for(j=n;j>0;j--)_genpoly[j]=_genpoly[j-1]^rs_hgmul(_gf,_genpoly[j],alphai); _genpoly[0]=rs_hgmul(_gf,_genpoly[0],alphai); } } /*Adds _npar<=_ndata parity bytes to an _ndata-_npar byte message. _data must contain room for _ndata<256 bytes.*/ void rs_encode(const rs_gf256 *_gf,unsigned char *_data,int _ndata, const unsigned char *_genpoly,int _npar){ unsigned char *lfsr; unsigned d; int i; int j; if(_npar<=0)return; lfsr=_data+_ndata-_npar; rs_poly_zero(lfsr,_npar); for(i=0;i<_ndata-_npar;i++){ d=_data[i]^lfsr[0]; if(d){ unsigned logd; logd=_gf->log[d]; for(j=0;j<_npar-1;j++){ lfsr[j]=lfsr[j+1]^rs_hgmul(_gf,_genpoly[_npar-1-j],logd); } lfsr[_npar-1]=rs_hgmul(_gf,_genpoly[0],logd); } else rs_poly_div_x(lfsr,lfsr,_npar); } } #if defined(RS_TEST_ENC) #include #include int main(void){ rs_gf256 gf; int k; rs_gf256_init(&gf,QR_PPOLY); srand(0); for(k=0;k<64*1024;k++){ unsigned char genpoly[256]; unsigned char data[256]; unsigned char epos[256]; int ndata; int npar; int nerrors; int i; ndata=rand()&0xFF; npar=ndata>0?rand()%ndata:0; for(i=0;i0){ /*Corrupt it.*/ nerrors=rand()%(npar+1); if(nerrors>0){ /*This test is not quite correct: there could be so many errors it comes within (npar>>1) errors of another valid codeword. I don't know a simple way to test for that without trying to decode the corrupt codeword, though, which is the very code we're trying to test.*/ if(nerrors<=npar>>1){ fprintf(stderr,"Success!\n",nerrors); for(i=0;i int main(void){ rs_gf256 gf; rs_gf256_init(&gf,QR_PPOLY); for(;;){ unsigned char data[255]; unsigned char erasures[255]; int idata[255]; int ierasures[255]; int ndata; int npar; int nerasures; int nerrors; int i; if(scanf("%i",&ndata)<1||ndata<0||ndata>255|| scanf("%i",&npar)<1||npar<0||npar>ndata)break; for(i=0;i255)break; data[i]=idata[i]; } if(indata)break; for(i=0;i=ndata)break; erasures[i]=ierasures[i]; } nerrors=rs_correct(&gf,QR_M0,data,ndata,npar,erasures,nerasures); if(nerrors>=0){ unsigned char data2[255]; unsigned char genpoly[255]; for(i=0;i /*Exhaustively test the root finder.*/ int main(void){ rs_gf256 gf; int a; int b; int c; int d; rs_gf256_init(&gf,QR_PPOLY); for(a=0;a<256;a++)for(b=0;b<256;b++)for(c=0;c<256;c++)for(d=0;d<256;d++){ unsigned char x[4]; unsigned char r[4]; unsigned x2; unsigned e[5]; int nroots; int mroots; int i; int j; nroots=rs_quartic_solve(&gf,a,b,c,d,x); for(i=0;i=nroots){ printf("Missing root: (0x%02X)**4 ^ 0x%02X*(0x%02X)**3 ^ " "0x%02X*(0x%02X)**2 ^ 0x%02X(0x%02X) ^ 0x%02X = 0x%02X\n", r[j],a,r[j],b,r[j],c,r[j],d,e[j]); } } } return 0; } #endif zbar-0.10/zbar/qrcode/qrdec.c0000644000000000000000000040663111270371414012746 00000000000000/*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #include #include #include #include #include "qrcode.h" #include "qrdec.h" #include "bch15_5.h" #include "rs.h" #include "isaac.h" #include "util.h" #include "binarize.h" #include "image.h" #include "error.h" #include "svg.h" typedef int qr_line[3]; typedef struct qr_finder_cluster qr_finder_cluster; typedef struct qr_finder_edge_pt qr_finder_edge_pt; typedef struct qr_finder_center qr_finder_center; typedef struct qr_aff qr_aff; typedef struct qr_hom qr_hom; typedef struct qr_finder qr_finder; typedef struct qr_hom_cell qr_hom_cell; typedef struct qr_sampling_grid qr_sampling_grid; typedef struct qr_pack_buf qr_pack_buf; /*The number of bits in an int. Note the cast to (int): this prevents this value from "promoting" whole expressions to an (unsigned) size_t.*/ #define QR_INT_BITS ((int)sizeof(int)*CHAR_BIT) #define QR_INT_LOGBITS (QR_ILOG(QR_INT_BITS)) /*A 14 bit resolution for a homography ensures that the ideal module size for a version 40 code differs from that of a version 39 code by at least 2.*/ #define QR_HOM_BITS (14) /*The number of bits of sub-module precision to use when searching for alignment patterns. Two bits allows an alignment pattern to be found even if the modules have been eroded by up to 50% (due to blurring, etc.). This must be at least one, since it affects the dynamic range of the transforms, and we sample at half-module resolution to compute a bounding quadrilateral for the code.*/ #define QR_ALIGN_SUBPREC (2) /* collection of finder lines */ typedef struct qr_finder_lines { qr_finder_line *lines; int nlines, clines; } qr_finder_lines; struct qr_reader { /*The GF(256) representation used in Reed-Solomon decoding.*/ rs_gf256 gf; /*The random number generator used by RANSAC.*/ isaac_ctx isaac; /* current finder state, horizontal and vertical lines */ qr_finder_lines finder_lines[2]; }; /*Initializes a client reader handle.*/ static void qr_reader_init (qr_reader *reader) { /*time_t now; now=time(NULL); isaac_init(&_reader->isaac,&now,sizeof(now));*/ isaac_init(&reader->isaac, NULL, 0); rs_gf256_init(&reader->gf, QR_PPOLY); } /*Allocates a client reader handle.*/ qr_reader *_zbar_qr_create (void) { qr_reader *reader = (qr_reader*)calloc(1, sizeof(*reader)); qr_reader_init(reader); return(reader); } /*Frees a client reader handle.*/ void _zbar_qr_destroy (qr_reader *reader) { zprintf(1, "max finder lines = %dx%d\n", reader->finder_lines[0].clines, reader->finder_lines[1].clines); if(reader->finder_lines[0].lines) free(reader->finder_lines[0].lines); if(reader->finder_lines[1].lines) free(reader->finder_lines[1].lines); free(reader); } /* reset finder state between scans */ void _zbar_qr_reset (qr_reader *reader) { reader->finder_lines[0].nlines = 0; reader->finder_lines[1].nlines = 0; } /*A cluster of lines crossing a finder pattern (all in the same direction).*/ struct qr_finder_cluster{ /*Pointers to the lines crossing the pattern.*/ qr_finder_line **lines; /*The number of lines in the cluster.*/ int nlines; }; /*A point on the edge of a finder pattern. These are obtained from the endpoints of the lines crossing this particular pattern.*/ struct qr_finder_edge_pt{ /*The location of the edge point.*/ qr_point pos; /*A label classifying which edge this belongs to: 0: negative u edge (left) 1: positive u edge (right) 2: negative v edge (top) 3: positive v edge (bottom)*/ int edge; /*The (signed) perpendicular distance of the edge point from a line parallel to the edge passing through the finder center, in (u,v) coordinates. This is also re-used by RANSAC to store inlier flags.*/ int extent; }; /*The center of a finder pattern obtained from the crossing of one or more clusters of horizontal finder lines with one or more clusters of vertical finder lines.*/ struct qr_finder_center{ /*The estimated location of the finder center.*/ qr_point pos; /*The list of edge points from the crossing lines.*/ qr_finder_edge_pt *edge_pts; /*The number of edge points from the crossing lines.*/ int nedge_pts; }; static int qr_finder_vline_cmp(const void *_a,const void *_b){ const qr_finder_line *a; const qr_finder_line *b; a=(const qr_finder_line *)_a; b=(const qr_finder_line *)_b; return ((a->pos[0]>b->pos[0])-(a->pos[0]pos[0])<<1)+ (a->pos[1]>b->pos[1])-(a->pos[1]pos[1]); } /*Clusters adjacent lines into groups that are large enough to be crossing a finder pattern (relative to their length). _clusters: The buffer in which to store the clusters found. _neighbors: The buffer used to store the lists of lines in each cluster. _lines: The list of lines to cluster. Horizontal lines must be sorted in ascending order by Y coordinate, with ties broken by X coordinate. Vertical lines must be sorted in ascending order by X coordinate, with ties broken by Y coordinate. _nlines: The number of lines in the set of lines to cluster. _v: 0 for horizontal lines, or 1 for vertical lines. Return: The number of clusters.*/ static int qr_finder_cluster_lines(qr_finder_cluster *_clusters, qr_finder_line **_neighbors,qr_finder_line *_lines,int _nlines,int _v){ unsigned char *mark; qr_finder_line **neighbors; int nneighbors; int nclusters; int i; /*TODO: Kalman filters!*/ mark=(unsigned char *)calloc(_nlines,sizeof(*mark)); neighbors=_neighbors; nclusters=0; for(i=0;i<_nlines-1;i++)if(!mark[i]){ int len; int j; nneighbors=1; neighbors[0]=_lines+i; len=_lines[i].len; for(j=i+1;j<_nlines;j++)if(!mark[j]){ const qr_finder_line *a; const qr_finder_line *b; int thresh; a=neighbors[nneighbors-1]; b=_lines+j; /*The clustering threshold is proportional to the size of the lines, since minor noise in large areas can interrupt patterns more easily at high resolutions.*/ thresh=a->len+7>>2; if(abs(a->pos[1-_v]-b->pos[1-_v])>thresh)break; if(abs(a->pos[_v]-b->pos[_v])>thresh)continue; if(abs(a->pos[_v]+a->len-b->pos[_v]-b->len)>thresh)continue; if(a->boffs>0&&b->boffs>0&& abs(a->pos[_v]-a->boffs-b->pos[_v]+b->boffs)>thresh){ continue; } if(a->eoffs>0&&b->eoffs>0&& abs(a->pos[_v]+a->len+a->eoffs-b->pos[_v]-b->len-b->eoffs)>thresh){ continue; } neighbors[nneighbors++]=_lines+j; len+=b->len; } /*We require at least three lines to form a cluster, which eliminates a large number of false positives, saving considerable decoding time. This should still be sufficient for 1-pixel codes with no noise.*/ if(nneighbors<3)continue; /*The expected number of lines crossing a finder pattern is equal to their average length. We accept the cluster if size is at least 1/3 their average length (this is a very small threshold, but was needed for some test images).*/ len=((len<<1)+nneighbors)/(nneighbors<<1); if(nneighbors*(5<=len){ _clusters[nclusters].lines=neighbors; _clusters[nclusters].nlines=nneighbors; for(j=0;jnlines;j++){ qr_finder_line *l; l=c->lines[j]; if(l->boffs>0){ _edge_pts[_nedge_pts].pos[0]=l->pos[0]; _edge_pts[_nedge_pts].pos[1]=l->pos[1]; _edge_pts[_nedge_pts].pos[_v]-=l->boffs; _nedge_pts++; } if(l->eoffs>0){ _edge_pts[_nedge_pts].pos[0]=l->pos[0]; _edge_pts[_nedge_pts].pos[1]=l->pos[1]; _edge_pts[_nedge_pts].pos[_v]+=l->len+l->eoffs; _nedge_pts++; } } } return _nedge_pts; } static int qr_finder_center_cmp(const void *_a,const void *_b){ const qr_finder_center *a; const qr_finder_center *b; a=(const qr_finder_center *)_a; b=(const qr_finder_center *)_b; return ((b->nedge_pts>a->nedge_pts)-(b->nedge_ptsnedge_pts)<<2)+ ((a->pos[1]>b->pos[1])-(a->pos[1]pos[1])<<1)+ (a->pos[0]>b->pos[0])-(a->pos[0]pos[0]); } /*Determine if a horizontal line crosses a vertical line. _hline: The horizontal line. _vline: The vertical line. Return: A non-zero value if the lines cross, or zero if they do not.*/ static int qr_finder_lines_are_crossing(const qr_finder_line *_hline, const qr_finder_line *_vline){ return _hline->pos[0]<=_vline->pos[0]&&_vline->pos[0]<_hline->pos[0]+_hline->len&& _vline->pos[1]<=_hline->pos[1]&&_hline->pos[1]<_vline->pos[1]+_vline->len; } /*Finds horizontal clusters that cross corresponding vertical clusters, presumably corresponding to a finder center. _center: The buffer in which to store putative finder centers. _edge_pts: The buffer to use for the edge point lists for each finder center. _hclusters: The clusters of horizontal lines crossing finder patterns. _nhclusters: The number of horizontal line clusters. _vclusters: The clusters of vertical lines crossing finder patterns. _nvclusters: The number of vertical line clusters. Return: The number of putative finder centers.*/ static int qr_finder_find_crossings(qr_finder_center *_centers, qr_finder_edge_pt *_edge_pts,qr_finder_cluster *_hclusters,int _nhclusters, qr_finder_cluster *_vclusters,int _nvclusters){ qr_finder_cluster **hneighbors; qr_finder_cluster **vneighbors; unsigned char *hmark; unsigned char *vmark; int ncenters; int i; int j; hneighbors=(qr_finder_cluster **)malloc(_nhclusters*sizeof(*hneighbors)); vneighbors=(qr_finder_cluster **)malloc(_nvclusters*sizeof(*vneighbors)); hmark=(unsigned char *)calloc(_nhclusters,sizeof(*hmark)); vmark=(unsigned char *)calloc(_nvclusters,sizeof(*vmark)); ncenters=0; /*TODO: This may need some re-working. We should be finding groups of clusters such that _all_ horizontal lines in _all_ horizontal clusters in the group cross _all_ vertical lines in _all_ vertical clusters in the group. This is equivalent to finding the maximum bipartite clique in the connectivity graph, which requires linear progamming to solve efficiently. In principle, that is easy to do, but a realistic implementation without floating point is a lot of work (and computationally expensive). Right now we are relying on a sufficient border around the finder patterns to prevent false positives.*/ for(i=0;i<_nhclusters;i++)if(!hmark[i]){ qr_finder_line *a; qr_finder_line *b; int nvneighbors; int nedge_pts; int y; a=_hclusters[i].lines[_hclusters[i].nlines>>1]; y=nvneighbors=0; for(j=0;j<_nvclusters;j++)if(!vmark[j]){ b=_vclusters[j].lines[_vclusters[j].nlines>>1]; if(qr_finder_lines_are_crossing(a,b)){ vmark[j]=1; y+=(b->pos[1]<<1)+b->len; if(b->boffs>0&&b->eoffs>0)y+=b->eoffs-b->boffs; vneighbors[nvneighbors++]=_vclusters+j; } } if(nvneighbors>0){ qr_finder_center *c; int nhneighbors; int x; x=(a->pos[0]<<1)+a->len; if(a->boffs>0&&a->eoffs>0)x+=a->eoffs-a->boffs; hneighbors[0]=_hclusters+i; nhneighbors=1; j=nvneighbors>>1; b=vneighbors[j]->lines[vneighbors[j]->nlines>>1]; for(j=i+1;j<_nhclusters;j++)if(!hmark[j]){ a=_hclusters[j].lines[_hclusters[j].nlines>>1]; if(qr_finder_lines_are_crossing(a,b)){ hmark[j]=1; x+=(a->pos[0]<<1)+a->len; if(a->boffs>0&&a->eoffs>0)x+=a->eoffs-a->boffs; hneighbors[nhneighbors++]=_hclusters+j; } } c=_centers+ncenters++; c->pos[0]=(x+nhneighbors)/(nhneighbors<<1); c->pos[1]=(y+nvneighbors)/(nvneighbors<<1); c->edge_pts=_edge_pts; nedge_pts=qr_finder_edge_pts_fill(_edge_pts,0, hneighbors,nhneighbors,0); nedge_pts=qr_finder_edge_pts_fill(_edge_pts,nedge_pts, vneighbors,nvneighbors,1); c->nedge_pts=nedge_pts; _edge_pts+=nedge_pts; } } free(vmark); free(hmark); free(vneighbors); free(hneighbors); /*Sort the centers by decreasing numbers of edge points.*/ qsort(_centers,ncenters,sizeof(*_centers),qr_finder_center_cmp); return ncenters; } /*Locates a set of putative finder centers in the image. First we search for horizontal and vertical lines that have (dark:light:dark:light:dark) runs with size ratios of roughly (1:1:3:1:1). Then we cluster them into groups such that each subsequent pair of endpoints is close to the line before it in the cluster. This will locate many line clusters that don't cross a finder pattern, but qr_finder_find_crossings() will filter most of them out. Where horizontal and vertical clusters cross, a prospective finder center is returned. _centers: Returns a pointer to a freshly-allocated list of finder centers. This must be freed by the caller. _edge_pts: Returns a pointer to a freshly-allocated list of edge points around those centers. This must be freed by the caller. _img: The binary image to search. _width: The width of the image. _height: The height of the image. Return: The number of putative finder centers located.*/ static int qr_finder_centers_locate(qr_finder_center **_centers, qr_finder_edge_pt **_edge_pts, qr_reader *reader, int _width,int _height){ qr_finder_line *hlines = reader->finder_lines[0].lines; int nhlines = reader->finder_lines[0].nlines; qr_finder_line *vlines = reader->finder_lines[1].lines; int nvlines = reader->finder_lines[1].nlines; qr_finder_line **hneighbors; qr_finder_cluster *hclusters; int nhclusters; qr_finder_line **vneighbors; qr_finder_cluster *vclusters; int nvclusters; int ncenters; /*Cluster the detected lines.*/ hneighbors=(qr_finder_line **)malloc(nhlines*sizeof(*hneighbors)); /*We require more than one line per cluster, so there are at most nhlines/2.*/ hclusters=(qr_finder_cluster *)malloc((nhlines>>1)*sizeof(*hclusters)); nhclusters=qr_finder_cluster_lines(hclusters,hneighbors,hlines,nhlines,0); /*We need vertical lines to be sorted by X coordinate, with ties broken by Y coordinate, for clustering purposes. We scan the image in the opposite order for cache efficiency, so sort the lines we found here.*/ qsort(vlines,nvlines,sizeof(*vlines),qr_finder_vline_cmp); vneighbors=(qr_finder_line **)malloc(nvlines*sizeof(*vneighbors)); /*We require more than one line per cluster, so there are at most nvlines/2.*/ vclusters=(qr_finder_cluster *)malloc((nvlines>>1)*sizeof(*vclusters)); nvclusters=qr_finder_cluster_lines(vclusters,vneighbors,vlines,nvlines,1); /*Find line crossings among the clusters.*/ if(nhclusters>=3&&nvclusters>=3){ qr_finder_edge_pt *edge_pts; qr_finder_center *centers; int nedge_pts; int i; nedge_pts=0; for(i=0;i>1)); dround=(1<>1; if(_sxx>_syy){ _l[0]=v+dround>>dshift; _l[1]=u+w+dround>>dshift; } else{ _l[0]=u+w+dround>>dshift; _l[1]=v+dround>>dshift; } _l[2]=-(_x0*_l[0]+_y0*_l[1]); } /*Perform a least-squares line fit to a list of points. At least two points are required.*/ static void qr_line_fit_points(qr_line _l,qr_point *_p,int _np,int _res){ int sx; int sy; int xmin; int xmax; int ymin; int ymax; int xbar; int ybar; int dx; int dy; int sxx; int sxy; int syy; int sshift; int sround; int i; sx=sy=0; ymax=xmax=INT_MIN; ymin=xmin=INT_MAX; for(i=0;i<_np;i++){ sx+=_p[i][0]; xmin=QR_MINI(xmin,_p[i][0]); xmax=QR_MAXI(xmax,_p[i][0]); sy+=_p[i][1]; ymin=QR_MINI(ymin,_p[i][1]); ymax=QR_MAXI(ymax,_p[i][1]); } xbar=(sx+(_np>>1))/_np; ybar=(sy+(_np>>1))/_np; sshift=QR_MAXI(0,qr_ilog(_np*QR_MAXI(QR_MAXI(xmax-xbar,xbar-xmin), QR_MAXI(ymax-ybar,ybar-ymin)))-(QR_INT_BITS-1>>1)); sround=(1<>1; sxx=sxy=syy=0; for(i=0;i<_np;i++){ dx=_p[i][0]-xbar+sround>>sshift; dy=_p[i][1]-ybar+sround>>sshift; sxx+=dx*dx; sxy+=dx*dy; syy+=dy*dy; } qr_line_fit(_l,xbar,ybar,sxx,sxy,syy,_res); } static void qr_line_orient(qr_line _l,int _x,int _y){ if(qr_line_eval(_l,_x,_y)<0){ _l[0]=-_l[0]; _l[1]=-_l[1]; _l[2]=-_l[2]; } } static int qr_line_isect(qr_point _p,const qr_line _l0,const qr_line _l1){ int d; int x; int y; d=_l0[0]*_l1[1]-_l0[1]*_l1[0]; if(d==0)return -1; x=_l0[1]*_l1[2]-_l1[1]*_l0[2]; y=_l1[0]*_l0[2]-_l0[0]*_l1[2]; if(d<0){ x=-x; y=-y; d=-d; } _p[0]=QR_DIVROUND(x,d); _p[1]=QR_DIVROUND(y,d); return 0; } /*An affine homography. This maps from the image (at subpel resolution) to a square domain with power-of-two sides (of res bits) and back.*/ struct qr_aff{ int fwd[2][2]; int inv[2][2]; int x0; int y0; int res; }; static void qr_aff_init(qr_aff *_aff, const qr_point _p0,const qr_point _p1,const qr_point _p2,int _res){ int det; int dx1; int dy1; int dx2; int dy2; /*det is ensured to be positive by our caller.*/ det=qr_point_ccw(_p0,_p1,_p2); dx1=_p1[0]-_p0[0]; dx2=_p2[0]-_p0[0]; dy1=_p1[1]-_p0[1]; dy2=_p2[1]-_p0[1]; _aff->fwd[0][0]=dx1; _aff->fwd[0][1]=dx2; _aff->fwd[1][0]=dy1; _aff->fwd[1][1]=dy2; _aff->inv[0][0]=QR_DIVROUND(dy2<<_res,det); _aff->inv[0][1]=QR_DIVROUND(-dx2<<_res,det); _aff->inv[1][0]=QR_DIVROUND(-dy1<<_res,det); _aff->inv[1][1]=QR_DIVROUND(dx1<<_res,det); _aff->x0=_p0[0]; _aff->y0=_p0[1]; _aff->res=_res; } /*Map from the image (at subpel resolution) into the square domain.*/ static void qr_aff_unproject(qr_point _q,const qr_aff *_aff, int _x,int _y){ _q[0]=_aff->inv[0][0]*(_x-_aff->x0)+_aff->inv[0][1]*(_y-_aff->y0); _q[1]=_aff->inv[1][0]*(_x-_aff->x0)+_aff->inv[1][1]*(_y-_aff->y0); } /*Map from the square domain into the image (at subpel resolution).*/ static void qr_aff_project(qr_point _p,const qr_aff *_aff, int _u,int _v){ _p[0]=(_aff->fwd[0][0]*_u+_aff->fwd[0][1]*_v+(1<<_aff->res-1)>>_aff->res) +_aff->x0; _p[1]=(_aff->fwd[1][0]*_u+_aff->fwd[1][1]*_v+(1<<_aff->res-1)>>_aff->res) +_aff->y0; } /*A full homography. Like the affine homography, this maps from the image (at subpel resolution) to a square domain with power-of-two sides (of res bits) and back.*/ struct qr_hom{ int fwd[3][2]; int inv[3][2]; int fwd22; int inv22; int x0; int y0; int res; }; static void qr_hom_init(qr_hom *_hom,int _x0,int _y0, int _x1,int _y1,int _x2,int _y2,int _x3,int _y3,int _res){ int dx10; int dx20; int dx30; int dx31; int dx32; int dy10; int dy20; int dy30; int dy31; int dy32; int a20; int a21; int a22; int b0; int b1; int b2; int s1; int s2; int r1; int r2; dx10=_x1-_x0; dx20=_x2-_x0; dx30=_x3-_x0; dx31=_x3-_x1; dx32=_x3-_x2; dy10=_y1-_y0; dy20=_y2-_y0; dy30=_y3-_y0; dy31=_y3-_y1; dy32=_y3-_y2; a20=dx32*dy10-dx10*dy32; a21=dx20*dy31-dx31*dy20; a22=dx32*dy31-dx31*dy32; /*Figure out if we need to downscale anything.*/ b0=qr_ilog(QR_MAXI(abs(dx10),abs(dy10)))+qr_ilog(abs(a20+a22)); b1=qr_ilog(QR_MAXI(abs(dx20),abs(dy20)))+qr_ilog(abs(a21+a22)); b2=qr_ilog(QR_MAXI(QR_MAXI(abs(a20),abs(a21)),abs(a22))); s1=QR_MAXI(0,_res+QR_MAXI(QR_MAXI(b0,b1),b2)-(QR_INT_BITS-2)); r1=(1<>1; /*Compute the final coefficients of the forward transform. The 32x32->64 bit multiplies are really needed for accuracy with large versions.*/ _hom->fwd[0][0]=QR_FIXMUL(dx10,a20+a22,r1,s1); _hom->fwd[0][1]=QR_FIXMUL(dx20,a21+a22,r1,s1); _hom->x0=_x0; _hom->fwd[1][0]=QR_FIXMUL(dy10,a20+a22,r1,s1); _hom->fwd[1][1]=QR_FIXMUL(dy20,a21+a22,r1,s1); _hom->y0=_y0; _hom->fwd[2][0]=a20+r1>>s1; _hom->fwd[2][1]=a21+r1>>s1; _hom->fwd22=s1>_res?a22+(r1>>_res)>>s1-_res:a22<<_res-s1; /*Now compute the inverse transform.*/ b0=qr_ilog(QR_MAXI(QR_MAXI(abs(dx10),abs(dx20)),abs(dx30)))+ qr_ilog(QR_MAXI(abs(_hom->fwd[0][0]),abs(_hom->fwd[1][0]))); b1=qr_ilog(QR_MAXI(QR_MAXI(abs(dy10),abs(dy20)),abs(dy30)))+ qr_ilog(QR_MAXI(abs(_hom->fwd[0][1]),abs(_hom->fwd[1][1]))); b2=qr_ilog(abs(a22))-s1; s2=QR_MAXI(0,QR_MAXI(b0,b1)+b2-(QR_INT_BITS-3)); r2=(1<>1; s1+=s2; r1<<=s2; /*The 32x32->64 bit multiplies are really needed for accuracy with large versions.*/ _hom->inv[0][0]=QR_FIXMUL(_hom->fwd[1][1],a22,r1,s1); _hom->inv[0][1]=QR_FIXMUL(-_hom->fwd[0][1],a22,r1,s1); _hom->inv[1][0]=QR_FIXMUL(-_hom->fwd[1][0],a22,r1,s1); _hom->inv[1][1]=QR_FIXMUL(_hom->fwd[0][0],a22,r1,s1); _hom->inv[2][0]=QR_FIXMUL(_hom->fwd[1][0],_hom->fwd[2][1], -QR_EXTMUL(_hom->fwd[1][1],_hom->fwd[2][0],r2),s2); _hom->inv[2][1]=QR_FIXMUL(_hom->fwd[0][1],_hom->fwd[2][0], -QR_EXTMUL(_hom->fwd[0][0],_hom->fwd[2][1],r2),s2); _hom->inv22=QR_FIXMUL(_hom->fwd[0][0],_hom->fwd[1][1], -QR_EXTMUL(_hom->fwd[0][1],_hom->fwd[1][0],r2),s2); _hom->res=_res; } /*Map from the image (at subpel resolution) into the square domain. Returns a negative value if the point went to infinity.*/ static int qr_hom_unproject(qr_point _q,const qr_hom *_hom,int _x,int _y){ int x; int y; int w; _x-=_hom->x0; _y-=_hom->y0; x=_hom->inv[0][0]*_x+_hom->inv[0][1]*_y; y=_hom->inv[1][0]*_x+_hom->inv[1][1]*_y; w=_hom->inv[2][0]*_x+_hom->inv[2][1]*_y +_hom->inv22+(1<<_hom->res-1)>>_hom->res; if(w==0){ _q[0]=x<0?INT_MIN:INT_MAX; _q[1]=y<0?INT_MIN:INT_MAX; return -1; } else{ if(w<0){ x=-x; y=-y; w=-w; } _q[0]=QR_DIVROUND(x,w); _q[1]=QR_DIVROUND(y,w); } return 0; } /*Finish a partial projection, converting from homogeneous coordinates to the normal 2-D representation. In loops, we can avoid many multiplies by computing the homogeneous _x, _y, and _w incrementally, but we cannot avoid the divisions, done here.*/ static void qr_hom_fproject(qr_point _p,const qr_hom *_hom, int _x,int _y,int _w){ if(_w==0){ _p[0]=_x<0?INT_MIN:INT_MAX; _p[1]=_y<0?INT_MIN:INT_MAX; } else{ if(_w<0){ _x=-_x; _y=-_y; _w=-_w; } _p[0]=QR_DIVROUND(_x,_w)+_hom->x0; _p[1]=QR_DIVROUND(_y,_w)+_hom->y0; } } #if defined(QR_DEBUG) /*Map from the square domain into the image (at subpel resolution). Currently only used directly by debug code.*/ static void qr_hom_project(qr_point _p,const qr_hom *_hom, int _u,int _v){ qr_hom_fproject(_p,_hom, _hom->fwd[0][0]*_u+_hom->fwd[0][1]*_v, _hom->fwd[1][0]*_u+_hom->fwd[1][1]*_v, _hom->fwd[2][0]*_u+_hom->fwd[2][1]*_v+_hom->fwd22); } #endif /*All the information we've collected about a finder pattern in the current configuration.*/ struct qr_finder{ /*The module size along each axis (in the square domain).*/ int size[2]; /*The version estimated from the module size along each axis.*/ int eversion[2]; /*The list of classified edge points for each edge.*/ qr_finder_edge_pt *edge_pts[4]; /*The number of edge points classified as belonging to each edge.*/ int nedge_pts[4]; /*The number of inliers found after running RANSAC on each edge.*/ int ninliers[4]; /*The center of the finder pattern (in the square domain).*/ qr_point o; /*The finder center information from the original image.*/ qr_finder_center *c; }; static int qr_cmp_edge_pt(const void *_a,const void *_b){ const qr_finder_edge_pt *a; const qr_finder_edge_pt *b; a=(const qr_finder_edge_pt *)_a; b=(const qr_finder_edge_pt *)_b; return ((a->edge>b->edge)-(a->edgeedge)<<1)+ (a->extent>b->extent)-(a->extentextent); } /*Computes the index of the edge each edge point belongs to, and its (signed) distance along the corresponding axis from the center of the finder pattern (in the square domain). The resulting list of edge points is sorted by edge index, with ties broken by extent.*/ static void qr_finder_edge_pts_aff_classify(qr_finder *_f,const qr_aff *_aff){ qr_finder_center *c; int i; int e; c=_f->c; for(e=0;e<4;e++)_f->nedge_pts[e]=0; for(i=0;inedge_pts;i++){ qr_point q; int d; qr_aff_unproject(q,_aff,c->edge_pts[i].pos[0],c->edge_pts[i].pos[1]); qr_point_translate(q,-_f->o[0],-_f->o[1]); d=abs(q[1])>abs(q[0]); e=d<<1|(q[d]>=0); _f->nedge_pts[e]++; c->edge_pts[i].edge=e; c->edge_pts[i].extent=q[d]; } qsort(c->edge_pts,c->nedge_pts,sizeof(*c->edge_pts),qr_cmp_edge_pt); _f->edge_pts[0]=c->edge_pts; for(e=1;e<4;e++)_f->edge_pts[e]=_f->edge_pts[e-1]+_f->nedge_pts[e-1]; } /*Computes the index of the edge each edge point belongs to, and its (signed) distance along the corresponding axis from the center of the finder pattern (in the square domain). The resulting list of edge points is sorted by edge index, with ties broken by extent.*/ static void qr_finder_edge_pts_hom_classify(qr_finder *_f,const qr_hom *_hom){ qr_finder_center *c; int i; int e; c=_f->c; for(e=0;e<4;e++)_f->nedge_pts[e]=0; for(i=0;inedge_pts;i++){ qr_point q; int d; if(qr_hom_unproject(q,_hom, c->edge_pts[i].pos[0],c->edge_pts[i].pos[1])>=0){ qr_point_translate(q,-_f->o[0],-_f->o[1]); d=abs(q[1])>abs(q[0]); e=d<<1|(q[d]>=0); _f->nedge_pts[e]++; c->edge_pts[i].edge=e; c->edge_pts[i].extent=q[d]; } else{ c->edge_pts[i].edge=4; c->edge_pts[i].extent=q[0]; } } qsort(c->edge_pts,c->nedge_pts,sizeof(*c->edge_pts),qr_cmp_edge_pt); _f->edge_pts[0]=c->edge_pts; for(e=1;e<4;e++)_f->edge_pts[e]=_f->edge_pts[e-1]+_f->nedge_pts[e-1]; } /*TODO: Perhaps these thresholds should be on the module size instead? Unfortunately, I'd need real-world images of codes with larger versions to see if these thresholds are still effective, but such versions aren't used often.*/ /*The amount that the estimated version numbers are allowed to differ from the real version number and still be considered valid.*/ #define QR_SMALL_VERSION_SLACK (1) /*Since cell phone cameras can have severe radial distortion, the estimated version for larger versions can be off by larger amounts.*/ #define QR_LARGE_VERSION_SLACK (3) /*Estimates the size of a module after classifying the edge points. _width: The distance between UL and UR in the square domain. _height: The distance between UL and DL in the square domain.*/ static int qr_finder_estimate_module_size_and_version(qr_finder *_f, int _width,int _height){ qr_point offs; int sums[4]; int nsums[4]; int usize; int nusize; int vsize; int nvsize; int uversion; int vversion; int e; offs[0]=offs[1]=0; for(e=0;e<4;e++)if(_f->nedge_pts[e]>0){ qr_finder_edge_pt *edge_pts; int sum; int mean; int n; int i; /*Average the samples for this edge, dropping the top and bottom 25%.*/ edge_pts=_f->edge_pts[e]; n=_f->nedge_pts[e]; sum=0; for(i=(n>>2);i>2);i++)sum+=edge_pts[i].extent; n=n-((n>>2)<<1); mean=QR_DIVROUND(sum,n); offs[e>>1]+=mean; sums[e]=sum; nsums[e]=n; } else nsums[e]=sums[e]=0; /*If we have samples on both sides of an axis, refine our idea of where the unprojected finder center is located.*/ if(_f->nedge_pts[0]>0&&_f->nedge_pts[1]>0){ _f->o[0]-=offs[0]>>1; sums[0]-=offs[0]*nsums[0]>>1; sums[1]-=offs[0]*nsums[1]>>1; } if(_f->nedge_pts[2]>0&&_f->nedge_pts[3]>0){ _f->o[1]-=offs[1]>>1; sums[2]-=offs[1]*nsums[2]>>1; sums[3]-=offs[1]*nsums[3]>>1; } /*We must have _some_ samples along each axis... if we don't, our transform must be pretty severely distorting the original square (e.g., with coordinates so large as to cause overflow).*/ nusize=nsums[0]+nsums[1]; if(nusize<=0)return -1; /*The module size is 1/3 the average edge extent.*/ nusize*=3; usize=sums[1]-sums[0]; usize=((usize<<1)+nusize)/(nusize<<1); if(usize<=0)return -1; /*Now estimate the version directly from the module size and the distance between the finder patterns. This is done independently using the extents along each axis. If either falls significantly outside the valid range (1 to 40), reject the configuration.*/ uversion=(_width-8*usize)/(usize<<2); if(uversion<1||uversion>40+QR_LARGE_VERSION_SLACK)return -1; /*Now do the same for the other axis.*/ nvsize=nsums[2]+nsums[3]; if(nvsize<=0)return -1; nvsize*=3; vsize=sums[3]-sums[2]; vsize=((vsize<<1)+nvsize)/(nvsize<<1); if(vsize<=0)return -1; vversion=(_height-8*vsize)/(vsize<<2); if(vversion<1||vversion>40+QR_LARGE_VERSION_SLACK)return -1; /*If the estimated version using extents along one axis is significantly different than the estimated version along the other axis, then the axes have significantly different scalings (relative to the grid). This can happen, e.g., when we have multiple adjacent QR codes, and we've picked two finder patterns from one and the third finder pattern from another, e.g.: X---DL UL---X |.... |.... X.... UR.... Such a configuration might even pass any other geometric checks if we didn't reject it here.*/ if(abs(uversion-vversion)>QR_LARGE_VERSION_SLACK)return -1; _f->size[0]=usize; _f->size[1]=vsize; /*We intentionally do not compute an average version from the sizes along both axes. In the presence of projective distortion, one of them will be much more accurate than the other.*/ _f->eversion[0]=uversion; _f->eversion[1]=vversion; return 0; } /*Eliminate outliers from the classified edge points with RANSAC.*/ static void qr_finder_ransac(qr_finder *_f,const qr_aff *_hom, isaac_ctx *_isaac,int _e){ qr_finder_edge_pt *edge_pts; int best_ninliers; int n; edge_pts=_f->edge_pts[_e]; n=_f->nedge_pts[_e]; best_ninliers=0; if(n>1){ int max_iters; int i; int j; /*17 iterations is enough to guarantee an outlier-free sample with more than 99% probability given as many as 50% outliers.*/ max_iters=17; for(i=0;i=p0i)p1i++; p0=edge_pts[p0i].pos; p1=edge_pts[p1i].pos; /*If the corresponding line is not within 45 degrees of the proper orientation in the square domain, reject it outright. This can happen, e.g., when highly skewed orientations cause points to be misclassified into the wrong edge. The irony is that using such points might produce a line which _does_ pass the corresponding validity checks.*/ qr_aff_unproject(q0,_hom,p0[0],p0[1]); qr_aff_unproject(q1,_hom,p1[0],p1[1]); qr_point_translate(q0,-_f->o[0],-_f->o[1]); qr_point_translate(q1,-_f->o[0],-_f->o[1]); if(abs(q0[_e>>1]-q1[_e>>1])>abs(q0[1-(_e>>1)]-q1[1-(_e>>1)]))continue; /*Identify the other edge points which are inliers. The squared distance should be distributed as a \Chi^2 distribution with one degree of freedom, which means for a 95% confidence the point should lie within a factor 3.8414588 ~= 4 times the expected variance of the point locations. We grossly approximate the standard deviation as 1 pixel in one direction, and 0.5 pixels in the other (because we average two coordinates).*/ thresh=qr_isqrt(qr_point_distance2(p0,p1)<<2*QR_FINDER_SUBPREC+1); ninliers=0; for(j=0;jbest_ninliers){ for(j=0;jn>>1)max_iters=(67*n-63*ninliers-1)/(n<<1); } } /*Now collect all the inliers at the beginning of the list.*/ for(i=j=0;jninliers[_e]=best_ninliers; } /*Perform a least-squares line fit to an edge of a finder pattern using the inliers found by RANSAC.*/ static int qr_line_fit_finder_edge(qr_line _l, const qr_finder *_f,int _e,int _res){ qr_finder_edge_pt *edge_pts; qr_point *pts; int npts; int i; npts=_f->ninliers[_e]; if(npts<2)return -1; /*We could write a custom version of qr_line_fit_points that accesses edge_pts directly, but this saves on code size and doesn't measurably slow things down.*/ pts=(qr_point *)malloc(npts*sizeof(*pts)); edge_pts=_f->edge_pts[_e]; for(i=0;ic->pos[0],_f->c->pos[1]); free(pts); return 0; } /*Perform a least-squares line fit to a pair of common finder edges using the inliers found by RANSAC. Unlike a normal edge fit, we guarantee that this one succeeds by creating at least one point on each edge using the estimated module size if it has no inliers.*/ static void qr_line_fit_finder_pair(qr_line _l,const qr_aff *_aff, const qr_finder *_f0,const qr_finder *_f1,int _e){ qr_point *pts; int npts; qr_finder_edge_pt *edge_pts; qr_point q; int n0; int n1; int i; n0=_f0->ninliers[_e]; n1=_f1->ninliers[_e]; /*We could write a custom version of qr_line_fit_points that accesses edge_pts directly, but this saves on code size and doesn't measurably slow things down.*/ npts=QR_MAXI(n0,1)+QR_MAXI(n1,1); pts=(qr_point *)malloc(npts*sizeof(*pts)); if(n0>0){ edge_pts=_f0->edge_pts[_e]; for(i=0;io[0]; q[1]=_f0->o[1]; q[_e>>1]+=_f0->size[_e>>1]*(2*(_e&1)-1); qr_aff_project(pts[0],_aff,q[0],q[1]); n0++; } if(n1>0){ edge_pts=_f1->edge_pts[_e]; for(i=0;io[0]; q[1]=_f1->o[1]; q[_e>>1]+=_f1->size[_e>>1]*(2*(_e&1)-1); qr_aff_project(pts[n0],_aff,q[0],q[1]); n1++; } qr_line_fit_points(_l,pts,npts,_aff->res); /*Make sure at least one finder center lies in the positive halfspace.*/ qr_line_orient(_l,_f0->c->pos[0],_f0->c->pos[1]); free(pts); } static int qr_finder_quick_crossing_check(const unsigned char *_img, int _width,int _height,int _x0,int _y0,int _x1,int _y1,int _v){ /*The points must be inside the image, and have a !_v:_v:!_v pattern. We don't scan the whole line initially, but quickly reject if the endpoints aren't !_v, or the midpoint isn't _v. If either end point is out of the image, or we don't encounter a _v pixel, we return a negative value, indicating the region should be considered empty. Otherwise, we return a positive value to indicate it is non-empty.*/ if(_x0<0||_x0>=_width||_y0<0||_y0>=_height|| _x1<0||_x1>=_width||_y1<0||_y1>=_height){ return -1; } if(!_img[_y0*_width+_x0]!=_v||!_img[_y1*_width+_x1]!=_v)return 1; if(!_img[(_y0+_y1>>1)*_width+(_x0+_x1>>1)]==_v)return -1; return 0; } /*Locate the midpoint of a _v segment along a !_v:_v:!_v line from (_x0,_y0) to (_x1,_y1). All coordinates, which are NOT in subpel resolution, must lie inside the image, and the endpoints are already assumed to have the value !_v. The returned value is in subpel resolution.*/ static int qr_finder_locate_crossing(const unsigned char *_img, int _width,int _height,int _x0,int _y0,int _x1,int _y1,int _v,qr_point _p){ qr_point x0; qr_point x1; qr_point dx; int step[2]; int steep; int err; int derr; /*Use Bresenham's algorithm to trace along the line and find the exact transitions from !_v to _v and back.*/ x0[0]=_x0; x0[1]=_y0; x1[0]=_x1; x1[1]=_y1; dx[0]=abs(_x1-_x0); dx[1]=abs(_y1-_y0); steep=dx[1]>dx[0]; err=0; derr=dx[1-steep]; step[0]=((_x0<_x1)<<1)-1; step[1]=((_y0<_y1)<<1)-1; /*Find the first crossing from !_v to _v.*/ for(;;){ /*If we make it all the way to the other side, there's no crossing.*/ if(x0[steep]==x1[steep])return -1; x0[steep]+=step[steep]; err+=derr; if(err<<1>dx[steep]){ x0[1-steep]+=step[1-steep]; err-=dx[steep]; } if(!_img[x0[1]*_width+x0[0]]!=_v)break; } /*Find the last crossing from _v to !_v.*/ err=0; for(;;){ if(x0[steep]==x1[steep])break; x1[steep]-=step[steep]; err+=derr; if(err<<1>dx[steep]){ x1[1-steep]-=step[1-steep]; err-=dx[steep]; } if(!_img[x1[1]*_width+x1[0]]!=_v)break; } /*Return the midpoint of the _v segment.*/ _p[0]=(x0[0]+x1[0]+1<>1; _p[1]=(x0[1]+x1[1]+1<>1; return 0; } static int qr_aff_line_step(const qr_aff *_aff,qr_line _l, int _v,int _du,int *_dv){ int shift; int round; int dv; int n; int d; n=_aff->fwd[0][_v]*_l[0]+_aff->fwd[1][_v]*_l[1]; d=_aff->fwd[0][1-_v]*_l[0]+_aff->fwd[1][1-_v]*_l[1]; if(d<0){ n=-n; d=-d; } shift=QR_MAXI(0,qr_ilog(_du)+qr_ilog(abs(n))+3-QR_INT_BITS); round=(1<>1; n=n+round>>shift; d=d+round>>shift; /*The line should not be outside 45 degrees of horizontal/vertical. TODO: We impose this restriction to help ensure the loop below terminates, but it should not technically be required. It also, however, ensures we avoid division by zero.*/ if(abs(n)>=d)return -1; n=-_du*n; dv=QR_DIVROUND(n,d); if(abs(dv)>=_du)return -1; *_dv=dv; return 0; } /*Computes the Hamming distance between two bit patterns (the number of bits that differ). May stop counting after _maxdiff differences.*/ static int qr_hamming_dist(unsigned _y1,unsigned _y2,int _maxdiff){ unsigned y; int ret; y=_y1^_y2; for(ret=0;ret<_maxdiff&&y;ret++)y&=y-1; return ret; } /*Retrieve a bit (guaranteed to be 0 or 1) from the image, given coordinates in subpel resolution which have not been bounds checked.*/ static int qr_img_get_bit(const unsigned char *_img,int _width,int _height, int _x,int _y){ _x>>=QR_FINDER_SUBPREC; _y>>=QR_FINDER_SUBPREC; return _img[QR_CLAMPI(0,_y,_height-1)*_width+QR_CLAMPI(0,_x,_width-1)]!=0; } #if defined(QR_DEBUG) #include "image.h" static void qr_finder_dump_aff_undistorted(qr_finder *_ul,qr_finder *_ur, qr_finder *_dl,qr_aff *_aff,const unsigned char *_img,int _width,int _height){ unsigned char *gimg; FILE *fout; int lpsz; int pixel_size; int dim; int min; int max; int u; int y; int i; int j; lpsz=qr_ilog(_ur->size[0]+_ur->size[1]+_dl->size[0]+_dl->size[1])-6; pixel_size=1<res-lpsz)+128; gimg=(unsigned char *)malloc(dim*dim*sizeof(*gimg)); for(i=0;i>QR_FINDER_SUBPREC,_height-1)*_width+ QR_CLAMPI(0,p[0]>>QR_FINDER_SUBPREC,_width-1)]; } { min=(_ur->o[0]-7*_ur->size[0]>>lpsz)+64; if(min<0)min=0; max=(_ur->o[0]+7*_ur->size[0]>>lpsz)+64; if(max>dim)max=dim; for(y=-7;y<=7;y++){ i=(_ur->o[1]+y*_ur->size[1]>>lpsz)+64; if(i<0||i>=dim)continue; for(j=min;jo[1]-7*_ur->size[1]>>lpsz)+64; if(min<0)min=0; max=(_ur->o[1]+7*_ur->size[1]>>lpsz)+64; if(max>dim)max=dim; for(u=-7;u<=7;u++){ j=(_ur->o[0]+u*_ur->size[0]>>lpsz)+64; if(j<0||j>=dim)continue; for(i=min;io[0]-7*_dl->size[0]>>lpsz)+64; if(min<0)min=0; max=(_dl->o[0]+7*_dl->size[0]>>lpsz)+64; if(max>dim)max=dim; for(y=-7;y<=7;y++){ i=(_dl->o[1]+y*_dl->size[1]>>lpsz)+64; if(i<0||i>=dim)continue; for(j=min;jo[1]-7*_dl->size[1]>>lpsz)+64; if(min<0)min=0; max=(_dl->o[1]+7*_dl->size[1]>>lpsz)+64; if(max>dim)max=dim; for(u=-7;u<=7;u++){ j=(_dl->o[0]+u*_dl->size[0]>>lpsz)+64; if(j<0||j>=dim)continue; for(i=min;isize[0]+_ur->size[1]+_dl->size[0]+_dl->size[1])-6; pixel_size=1<res-lpsz)+256; gimg=(unsigned char *)malloc(dim*dim*sizeof(*gimg)); for(i=0;i>QR_FINDER_SUBPREC,_height-1)*_width+ QR_CLAMPI(0,p[0]>>QR_FINDER_SUBPREC,_width-1)]; } { min=(_ur->o[0]-7*_ur->size[0]>>lpsz)+128; if(min<0)min=0; max=(_ur->o[0]+7*_ur->size[0]>>lpsz)+128; if(max>dim)max=dim; for(v=-7;v<=7;v++){ i=(_ur->o[1]+v*_ur->size[1]>>lpsz)+128; if(i<0||i>=dim)continue; for(j=min;jo[1]-7*_ur->size[1]>>lpsz)+128; if(min<0)min=0; max=(_ur->o[1]+7*_ur->size[1]>>lpsz)+128; if(max>dim)max=dim; for(u=-7;u<=7;u++){ j=(_ur->o[0]+u*_ur->size[0]>>lpsz)+128; if(j<0||j>=dim)continue; for(i=min;io[0]-7*_dl->size[0]>>lpsz)+128; if(min<0)min=0; max=(_dl->o[0]+7*_dl->size[0]>>lpsz)+128; if(max>dim)max=dim; for(v=-7;v<=7;v++){ i=(_dl->o[1]+v*_dl->size[1]>>lpsz)+128; if(i<0||i>=dim)continue; for(j=min;jo[1]-7*_dl->size[1]>>lpsz)+128; if(min<0)min=0; max=(_dl->o[1]+7*_dl->size[1]>>lpsz)+128; if(max>dim)max=dim; for(u=-7;u<=7;u++){ j=(_dl->o[0]+u*_dl->size[0]>>lpsz)+128; if(j<0||j>=dim)continue; for(i=min;i>1; /*Compute the final coefficients of the forward transform.*/ a00=QR_FIXMUL(dx10,a20+a22,round,shift); a01=QR_FIXMUL(dx20,a21+a22,round,shift); a10=QR_FIXMUL(dy10,a20+a22,round,shift); a11=QR_FIXMUL(dy20,a21+a22,round,shift); /*And compose the two transforms. Since we inverted the coefficients above, we divide by them here instead of multiplying. This lets us take advantage of the full dynamic range. Note a zero divisor is really "infinity", and thus the quotient should also be zero.*/ _cell->fwd[0][0]=(i00?QR_DIVROUND(a00,i00):0)+(i10?QR_DIVROUND(a01,i10):0); _cell->fwd[0][1]=(i01?QR_DIVROUND(a00,i01):0)+(i11?QR_DIVROUND(a01,i11):0); _cell->fwd[1][0]=(i00?QR_DIVROUND(a10,i00):0)+(i10?QR_DIVROUND(a11,i10):0); _cell->fwd[1][1]=(i01?QR_DIVROUND(a10,i01):0)+(i11?QR_DIVROUND(a11,i11):0); _cell->fwd[2][0]=(i00?QR_DIVROUND(a20,i00):0)+(i10?QR_DIVROUND(a21,i10):0) +(i20?QR_DIVROUND(a22,i20):0)+round>>shift; _cell->fwd[2][1]=(i01?QR_DIVROUND(a20,i01):0)+(i11?QR_DIVROUND(a21,i11):0) +(i21?QR_DIVROUND(a22,i21):0)+round>>shift; _cell->fwd[2][2]=a22+round>>shift; /*Mathematically, a02 and a12 are exactly zero. However, that concentrates all of the rounding error in the (_u3,_v3) corner; we compute offsets which distribute it over the whole range.*/ x=_cell->fwd[0][0]*du10+_cell->fwd[0][1]*dv10; y=_cell->fwd[1][0]*du10+_cell->fwd[1][1]*dv10; w=_cell->fwd[2][0]*du10+_cell->fwd[2][1]*dv10+_cell->fwd[2][2]; a02=dx10*w-x; a12=dy10*w-y; x=_cell->fwd[0][0]*du20+_cell->fwd[0][1]*dv20; y=_cell->fwd[1][0]*du20+_cell->fwd[1][1]*dv20; w=_cell->fwd[2][0]*du20+_cell->fwd[2][1]*dv20+_cell->fwd[2][2]; a02+=dx20*w-x; a12+=dy20*w-y; x=_cell->fwd[0][0]*du30+_cell->fwd[0][1]*dv30; y=_cell->fwd[1][0]*du30+_cell->fwd[1][1]*dv30; w=_cell->fwd[2][0]*du30+_cell->fwd[2][1]*dv30+_cell->fwd[2][2]; a02+=dx30*w-x; a12+=dy30*w-y; _cell->fwd[0][2]=a02+2>>2; _cell->fwd[1][2]=a12+2>>2; _cell->x0=_x0; _cell->y0=_y0; _cell->u0=_u0; _cell->v0=_v0; } /*Finish a partial projection, converting from homogeneous coordinates to the normal 2-D representation. In loops, we can avoid many multiplies by computing the homogeneous _x, _y, and _w incrementally, but we cannot avoid the divisions, done here.*/ static void qr_hom_cell_fproject(qr_point _p,const qr_hom_cell *_cell, int _x,int _y,int _w){ if(_w==0){ _p[0]=_x<0?INT_MIN:INT_MAX; _p[1]=_y<0?INT_MIN:INT_MAX; } else{ if(_w<0){ _x=-_x; _y=-_y; _w=-_w; } _p[0]=QR_DIVROUND(_x,_w)+_cell->x0; _p[1]=QR_DIVROUND(_y,_w)+_cell->y0; } } static void qr_hom_cell_project(qr_point _p,const qr_hom_cell *_cell, int _u,int _v,int _res){ _u-=_cell->u0<<_res; _v-=_cell->v0<<_res; qr_hom_cell_fproject(_p,_cell, _cell->fwd[0][0]*_u+_cell->fwd[0][1]*_v+(_cell->fwd[0][2]<<_res), _cell->fwd[1][0]*_u+_cell->fwd[1][1]*_v+(_cell->fwd[1][2]<<_res), _cell->fwd[2][0]*_u+_cell->fwd[2][1]*_v+(_cell->fwd[2][2]<<_res)); } /*Retrieves the bits corresponding to the alignment pattern template centered at the given location in the original image (at subpel precision).*/ static unsigned qr_alignment_pattern_fetch(qr_point _p[5][5],int _x0,int _y0, const unsigned char *_img,int _width,int _height){ unsigned v; int i; int j; int k; int dx; int dy; dx=_x0-_p[2][2][0]; dy=_y0-_p[2][2][1]; v=0; for(k=i=0;i<5;i++)for(j=0;j<5;j++,k++){ v|=qr_img_get_bit(_img,_width,_height,_p[i][j][0]+dx,_p[i][j][1]+dy)<u0; v=(_v-2)-_cell->v0; x0=_cell->fwd[0][0]*u+_cell->fwd[0][1]*v+_cell->fwd[0][2]; y0=_cell->fwd[1][0]*u+_cell->fwd[1][1]*v+_cell->fwd[1][2]; w0=_cell->fwd[2][0]*u+_cell->fwd[2][1]*v+_cell->fwd[2][2]; dxdu=_cell->fwd[0][0]; dydu=_cell->fwd[1][0]; dwdu=_cell->fwd[2][0]; dxdv=_cell->fwd[0][1]; dydv=_cell->fwd[1][1]; dwdv=_cell->fwd[2][1]; for(i=0;i<5;i++){ x=x0; y=y0; w=w0; for(j=0;j<5;j++){ qr_hom_cell_fproject(p[i][j],_cell,x,y,w); x+=dxdu; y+=dydu; w+=dwdu; } x0+=dxdv; y0+=dydv; w0+=dwdv; } bestx=p[2][2][0]; besty=p[2][2][1]; best_match=qr_alignment_pattern_fetch(p,bestx,besty,_img,_width,_height); best_dist=qr_hamming_dist(best_match,0x1F8D63F,25); if(best_dist>0){ u=_u-_cell->u0; v=_v-_cell->v0; x=_cell->fwd[0][0]*u+_cell->fwd[0][1]*v+_cell->fwd[0][2]<fwd[1][0]*u+_cell->fwd[1][1]*v+_cell->fwd[1][2]<fwd[2][0]*u+_cell->fwd[2][1]*v+_cell->fwd[2][2]<=side_len; x+=_cell->fwd[0][dir]; y+=_cell->fwd[1][dir]; w+=_cell->fwd[2][dir]; } else{ dir=j>=3*side_len; x-=_cell->fwd[0][dir]; y-=_cell->fwd[1][dir]; w-=_cell->fwd[2][dir]; } if(!best_dist)break; } if(!best_dist)break; } } /*If the best result we got was sufficiently bad, reject the match. If we're wrong and we include it, we can grossly distort the nearby region, whereas using the initial starting point should at least be consistent with the geometry we already have.*/ if(best_dist>6){ _p[0]=p[2][2][0]; _p[1]=p[2][2][1]; return -1; } /*Now try to get a more accurate location of the pattern center.*/ dx=bestx-p[2][2][0]; dy=besty-p[2][2][1]; memset(nc,0,sizeof(nc)); memset(c,0,sizeof(c)); /*We consider 8 lines across the finder pattern in turn. If we actually found a symmetric pattern along that line, search for its exact center in the image. There are plenty more lines we could use if these don't work, but if we've found anything remotely close to an alignment pattern, we should be able to use most of these.*/ for(i=0;i<8;i++){ static const unsigned MASK_TESTS[8][2]={ {0x1040041,0x1000001},{0x0041040,0x0001000}, {0x0110110,0x0100010},{0x0011100,0x0001000}, {0x0420084,0x0400004},{0x0021080,0x0001000}, {0x0006C00,0x0004400},{0x0003800,0x0001000}, }; static const unsigned char MASK_COORDS[8][2]={ {0,0},{1,1},{4,0},{3,1},{2,0},{2,1},{0,2},{1,2} }; if((best_match&MASK_TESTS[i][0])==MASK_TESTS[i][1]){ int x0; int y0; int x1; int y1; x0=p[MASK_COORDS[i][1]][MASK_COORDS[i][0]][0]+dx>>QR_FINDER_SUBPREC; if(x0<0||x0>=_width)continue; y0=p[MASK_COORDS[i][1]][MASK_COORDS[i][0]][1]+dy>>QR_FINDER_SUBPREC; if(y0<0||y0>=_height)continue; x1=p[4-MASK_COORDS[i][1]][4-MASK_COORDS[i][0]][0]+dx>>QR_FINDER_SUBPREC; if(x1<0||x1>=_width)continue; y1=p[4-MASK_COORDS[i][1]][4-MASK_COORDS[i][0]][1]+dy>>QR_FINDER_SUBPREC; if(y1<0||y1>=_height)continue; if(!qr_finder_locate_crossing(_img,_width,_height,x0,y0,x1,y1,i&1,pc)){ int w; int cx; int cy; cx=pc[0]-bestx; cy=pc[1]-besty; if(i&1){ /*Weight crossings around the center dot more highly, as they are generally more reliable.*/ w=3; cx+=cx<<1; cy+=cy<<1; } else w=1; nc[i>>1]+=w; c[i>>1][0]+=cx; c[i>>1][1]+=cy; } } } /*Sum offsets from lines in orthogonal directions.*/ for(i=0;i<2;i++){ int a; int b; a=nc[i<<1]; b=nc[i<<1|1]; if(a&&b){ int w; w=QR_MAXI(a,b); c[i<<1][0]=QR_DIVROUND(w*(b*c[i<<1][0]+a*c[i<<1|1][0]),a*b); c[i<<1][1]=QR_DIVROUND(w*(b*c[i<<1][1]+a*c[i<<1|1][1]),a*b); nc[i<<1]=w<<1; } else{ c[i<<1][0]+=c[i<<1|1][0]; c[i<<1][1]+=c[i<<1|1][1]; nc[i<<1]+=b; } } /*Average offsets from pairs of orthogonal lines.*/ c[0][0]+=c[2][0]; c[0][1]+=c[2][1]; nc[0]+=nc[2]; /*If we actually found any such lines, apply the adjustment.*/ if(nc[0]){ dx=QR_DIVROUND(c[0][0],nc[0]); dy=QR_DIVROUND(c[0][1],nc[0]); /*But only if it doesn't make things worse.*/ match=qr_alignment_pattern_fetch(p,bestx+dx,besty+dy,_img,_width,_height); dist=qr_hamming_dist(match,0x1F8D63F,best_dist+1); if(dist<=best_dist){ bestx+=dx; besty+=dy; } } _p[0]=bestx; _p[1]=besty; return 0; } static int qr_hom_fit(qr_hom *_hom,qr_finder *_ul,qr_finder *_ur, qr_finder *_dl,qr_point _p[4],const qr_aff *_aff,isaac_ctx *_isaac, const unsigned char *_img,int _width,int _height){ qr_point *b; int nb; int cb; qr_point *r; int nr; int cr; qr_line l[4]; qr_point q; qr_point p; int ox; int oy; int ru; int rv; int dru; int drv; int bu; int bv; int dbu; int dbv; int rx; int ry; int drxi; int dryi; int drxj; int dryj; int rdone; int nrempty; int rlastfit; int bx; int by; int dbxi; int dbyi; int dbxj; int dbyj; int bdone; int nbempty; int blastfit; int shift; int round; int version4; int brx; int bry; int i; /*We attempt to correct large-scale perspective distortion by fitting lines to the edge of the code area. We could also look for an alignment pattern now, but that wouldn't work for version 1 codes, which have no alignment pattern. Even if the code is supposed to have one, there's go guarantee we'd find it intact.*/ /*Fitting lines is easy for the edges on which we have two finder patterns. After the fit, UL is guaranteed to be on the proper side, but if either of the other two finder patterns aren't, something is wrong.*/ qr_finder_ransac(_ul,_aff,_isaac,0); qr_finder_ransac(_dl,_aff,_isaac,0); qr_line_fit_finder_pair(l[0],_aff,_ul,_dl,0); if(qr_line_eval(l[0],_dl->c->pos[0],_dl->c->pos[1])<0|| qr_line_eval(l[0],_ur->c->pos[0],_ur->c->pos[1])<0){ return -1; } qr_finder_ransac(_ul,_aff,_isaac,2); qr_finder_ransac(_ur,_aff,_isaac,2); qr_line_fit_finder_pair(l[2],_aff,_ul,_ur,2); if(qr_line_eval(l[2],_dl->c->pos[0],_dl->c->pos[1])<0|| qr_line_eval(l[2],_ur->c->pos[0],_ur->c->pos[1])<0){ return -1; } /*The edges which only have one finder pattern are more difficult. We start by fitting a line to the edge of the one finder pattern we do have. This can fail due to an insufficient number of sample points, and even if it succeeds can be fairly inaccurate, because all of the points are clustered in one corner of the QR code. If it fails, we just use an axis-aligned line in the affine coordinate system. Then we walk along the edge of the entire code, looking for light:dark:light patterns perpendicular to the edge. Wherever we find one, we take the center of the dark portion as an additional sample point. At the end, we re-fit the line using all such sample points found.*/ drv=_ur->size[1]>>1; qr_finder_ransac(_ur,_aff,_isaac,1); if(qr_line_fit_finder_edge(l[1],_ur,1,_aff->res)>=0){ if(qr_line_eval(l[1],_ul->c->pos[0],_ul->c->pos[1])<0|| qr_line_eval(l[1],_dl->c->pos[0],_dl->c->pos[1])<0){ return -1; } /*Figure out the change in ru for a given change in rv when stepping along the fitted line.*/ if(qr_aff_line_step(_aff,l[1],1,drv,&dru)<0)return -1; } else dru=0; ru=_ur->o[0]+3*_ur->size[0]-2*dru; rv=_ur->o[1]-2*drv; dbu=_dl->size[0]>>1; qr_finder_ransac(_dl,_aff,_isaac,3); if(qr_line_fit_finder_edge(l[3],_dl,3,_aff->res)>=0){ if(qr_line_eval(l[3],_ul->c->pos[0],_ul->c->pos[1])<0|| qr_line_eval(l[3],_ur->c->pos[0],_ur->c->pos[1])<0){ return -1; } /*Figure out the change in bv for a given change in bu when stepping along the fitted line.*/ if(qr_aff_line_step(_aff,l[3],0,dbu,&dbv)<0)return -1; } else dbv=0; bu=_dl->o[0]-2*dbu; bv=_dl->o[1]+3*_dl->size[1]-2*dbv; /*Set up the initial point lists.*/ nr=rlastfit=_ur->ninliers[1]; cr=nr+(_dl->o[1]-rv+drv-1)/drv; r=(qr_point *)malloc(cr*sizeof(*r)); for(i=0;i<_ur->ninliers[1];i++){ memcpy(r[i],_ur->edge_pts[1][i].pos,sizeof(r[i])); } nb=blastfit=_dl->ninliers[3]; cb=nb+(_ur->o[0]-bu+dbu-1)/dbu; b=(qr_point *)malloc(cb*sizeof(*b)); for(i=0;i<_dl->ninliers[3];i++){ memcpy(b[i],_dl->edge_pts[3][i].pos,sizeof(b[i])); } /*Set up the step parameters for the affine projection.*/ ox=(_aff->x0<<_aff->res)+(1<<_aff->res-1); oy=(_aff->y0<<_aff->res)+(1<<_aff->res-1); rx=_aff->fwd[0][0]*ru+_aff->fwd[0][1]*rv+ox; ry=_aff->fwd[1][0]*ru+_aff->fwd[1][1]*rv+oy; drxi=_aff->fwd[0][0]*dru+_aff->fwd[0][1]*drv; dryi=_aff->fwd[1][0]*dru+_aff->fwd[1][1]*drv; drxj=_aff->fwd[0][0]*_ur->size[0]; dryj=_aff->fwd[1][0]*_ur->size[0]; bx=_aff->fwd[0][0]*bu+_aff->fwd[0][1]*bv+ox; by=_aff->fwd[1][0]*bu+_aff->fwd[1][1]*bv+oy; dbxi=_aff->fwd[0][0]*dbu+_aff->fwd[0][1]*dbv; dbyi=_aff->fwd[1][0]*dbu+_aff->fwd[1][1]*dbv; dbxj=_aff->fwd[0][1]*_dl->size[1]; dbyj=_aff->fwd[1][1]*_dl->size[1]; /*Now step along the lines, looking for new sample points.*/ nrempty=nbempty=0; for(;;){ int ret; int x0; int y0; int x1; int y1; /*If we take too many steps without encountering a non-zero pixel, assume we have wandered off the edge and stop looking before we hit the other side of the quiet region. Otherwise, stop when the lines cross (if they do so inside the affine region) or come close to crossing (outside the affine region). TODO: We don't have any way of detecting when we've wandered into the code interior; we could stop if the outside sample ever shows up dark, but this could happen because of noise in the quiet region, too.*/ rdone=rv>=QR_MINI(bv,_dl->o[1]+bv>>1)||nrempty>14; bdone=bu>=QR_MINI(ru,_ur->o[0]+ru>>1)||nbempty>14; if(!rdone&&(bdone||rv>_aff->res+QR_FINDER_SUBPREC; y0=ry+dryj>>_aff->res+QR_FINDER_SUBPREC; x1=rx-drxj>>_aff->res+QR_FINDER_SUBPREC; y1=ry-dryj>>_aff->res+QR_FINDER_SUBPREC; if(nr>=cr){ cr=cr<<1|1; r=(qr_point *)realloc(r,cr*sizeof(*r)); } ret=qr_finder_quick_crossing_check(_img,_width,_height,x0,y0,x1,y1,1); if(!ret){ ret=qr_finder_locate_crossing(_img,_width,_height,x0,y0,x1,y1,1,r[nr]); } if(ret>=0){ if(!ret){ qr_aff_unproject(q,_aff,r[nr][0],r[nr][1]); /*Move the current point halfway towards the crossing. We don't move the whole way to give us some robustness to noise.*/ ru=ru+q[0]>>1; /*But ensure that rv monotonically increases.*/ if(q[1]+drv>rv)rv=rv+q[1]>>1; rx=_aff->fwd[0][0]*ru+_aff->fwd[0][1]*rv+ox; ry=_aff->fwd[1][0]*ru+_aff->fwd[1][1]*rv+oy; nr++; /*Re-fit the line to update the step direction periodically.*/ if(nr>QR_MAXI(1,rlastfit+(rlastfit>>2))){ qr_line_fit_points(l[1],r,nr,_aff->res); if(qr_aff_line_step(_aff,l[1],1,drv,&dru)>=0){ drxi=_aff->fwd[0][0]*dru+_aff->fwd[0][1]*drv; dryi=_aff->fwd[1][0]*dru+_aff->fwd[1][1]*drv; } rlastfit=nr; } } else nrempty=0; } else nrempty++; ru+=dru; /*Our final defense: if we overflow, stop.*/ if(rv+drv>rv)rv+=drv; else nrempty=INT_MAX; rx+=drxi; ry+=dryi; } else if(!bdone){ x0=bx+dbxj>>_aff->res+QR_FINDER_SUBPREC; y0=by+dbyj>>_aff->res+QR_FINDER_SUBPREC; x1=bx-dbxj>>_aff->res+QR_FINDER_SUBPREC; y1=by-dbyj>>_aff->res+QR_FINDER_SUBPREC; if(nb>=cb){ cb=cb<<1|1; b=(qr_point *)realloc(b,cb*sizeof(*b)); } ret=qr_finder_quick_crossing_check(_img,_width,_height,x0,y0,x1,y1,1); if(!ret){ ret=qr_finder_locate_crossing(_img,_width,_height,x0,y0,x1,y1,1,b[nb]); } if(ret>=0){ if(!ret){ qr_aff_unproject(q,_aff,b[nb][0],b[nb][1]); /*Move the current point halfway towards the crossing. We don't move the whole way to give us some robustness to noise.*/ /*But ensure that bu monotonically increases.*/ if(q[0]+dbu>bu)bu=bu+q[0]>>1; bv=bv+q[1]>>1; bx=_aff->fwd[0][0]*bu+_aff->fwd[0][1]*bv+ox; by=_aff->fwd[1][0]*bu+_aff->fwd[1][1]*bv+oy; nb++; /*Re-fit the line to update the step direction periodically.*/ if(nb>QR_MAXI(1,blastfit+(blastfit>>2))){ qr_line_fit_points(l[3],b,nb,_aff->res); if(qr_aff_line_step(_aff,l[3],0,dbu,&dbv)>=0){ dbxi=_aff->fwd[0][0]*dbu+_aff->fwd[0][1]*dbv; dbyi=_aff->fwd[1][0]*dbu+_aff->fwd[1][1]*dbv; } blastfit=nb; } } nbempty=0; } else nbempty++; /*Our final defense: if we overflow, stop.*/ if(bu+dbu>bu)bu+=dbu; else nbempty=INT_MAX; bv+=dbv; bx+=dbxi; by+=dbyi; } else break; } /*Fit the new lines. If we _still_ don't have enough sample points, then just use an axis-aligned line from the affine coordinate system (e.g., one parallel to the opposite edge in the image).*/ if(nr>1)qr_line_fit_points(l[1],r,nr,_aff->res); else{ qr_aff_project(p,_aff,_ur->o[0]+3*_ur->size[0],_ur->o[1]); shift=QR_MAXI(0, qr_ilog(QR_MAXI(abs(_aff->fwd[0][1]),abs(_aff->fwd[1][1]))) -(_aff->res+1>>1)); round=(1<>1; l[1][0]=_aff->fwd[1][1]+round>>shift; l[1][1]=-_aff->fwd[0][1]+round>>shift; l[1][2]=-(l[1][0]*p[0]+l[1][1]*p[1]); } free(r); if(nb>1)qr_line_fit_points(l[3],b,nb,_aff->res); else{ qr_aff_project(p,_aff,_dl->o[0],_dl->o[1]+3*_dl->size[1]); shift=QR_MAXI(0, qr_ilog(QR_MAXI(abs(_aff->fwd[0][1]),abs(_aff->fwd[1][1]))) -(_aff->res+1>>1)); round=(1<>1; l[3][0]=_aff->fwd[1][0]+round>>shift; l[3][1]=-_aff->fwd[0][0]+round>>shift; l[3][2]=-(l[1][0]*p[0]+l[1][1]*p[1]); } free(b); for(i=0;i<4;i++){ if(qr_line_isect(_p[i],l[i&1],l[2+(i>>1)])<0)return -1; /*It's plausible for points to be somewhat outside the image, but too far and too much of the pattern will be gone for it to be decodable.*/ if(_p[i][0]<-_width<=_width<=_height<eversion[0]+_ul->eversion[1]+_ur->eversion[0]+_dl->eversion[1]; if(version4>4){ qr_hom_cell cell; qr_point p3; int dim; dim=17+version4; qr_hom_cell_init(&cell,0,0,dim-1,0,0,dim-1,dim-1,dim-1, _p[0][0],_p[0][1],_p[1][0],_p[1][1], _p[2][0],_p[2][1],_p[3][0],_p[3][1]); if(qr_alignment_pattern_search(p3,&cell,dim-7,dim-7,4, _img,_width,_height)>=0){ int c21; int dx21; int dy21; int mask; int w; /*There's no real need to update the bounding box corner, and in fact we actively perform worse if we do. Clearly it was good enough for us to find this alignment pattern, so it should be good enough to use for grid initialization. The point of doing the search was to get more accurate version estimates and a better chance of decoding the version and format info. This is particularly important for small versions that have no encoded version info, since any mismatch in version renders the code undecodable.*/ /*We do, however, need four points in a square to initialize our homography, so project the point from the alignment center to the corner of the code area.*/ c21=_p[2][0]*_p[1][1]-_p[2][1]*_p[1][0]; dx21=_p[2][0]-_p[1][0]; dy21=_p[2][1]-_p[1][1]; w=(dim-7)*c21 +(dim-13)*(_p[0][0]*dy21-_p[0][1]*dx21)+6*(p3[0]*dy21-p3[1]*dx21); mask=QR_SIGNMASK(w); w=abs(w); brx=(int)QR_DIVROUND(QR_EXTMUL((dim-7)*_p[0][0],p3[0]*dy21, QR_EXTMUL((dim-13)*p3[0],c21-_p[0][1]*dx21, QR_EXTMUL(6*_p[0][0],c21-p3[1]*dx21,0)))+mask^mask,w); bry=(int)QR_DIVROUND(QR_EXTMUL((dim-7)*_p[0][1],-p3[1]*dx21, QR_EXTMUL((dim-13)*p3[1],c21+_p[0][0]*dy21, QR_EXTMUL(6*_p[0][1],c21+p3[0]*dy21,0)))+mask^mask,w); } } /*Now we have four points that map to a square: initialize the projection.*/ qr_hom_init(_hom,_p[0][0],_p[0][1],_p[1][0],_p[1][1], _p[2][0],_p[2][1],brx,bry,QR_HOM_BITS); return 0; } /*The BCH(18,6,3) codes are only used for version information, which must lie between 7 and 40 (inclusive).*/ static const unsigned BCH18_6_CODES[34]={ 0x07C94, 0x085BC,0x09A99,0x0A4D3,0x0BBF6,0x0C762,0x0D847,0x0E60D,0x0F928, 0x10B78,0x1145D,0x12A17,0x13532,0x149A6,0x15683,0x168C9,0x177EC, 0x18EC4,0x191E1,0x1AFAB,0x1B08E,0x1CC1A,0x1D33F,0x1ED75,0x1F250, 0x209D5,0x216F0,0x228BA,0x2379F,0x24B0B,0x2542E,0x26A64,0x27541, 0x28C69 }; /*Corrects a BCH(18,6,3) code word. _y: Contains the code word to be checked on input, and the corrected value on output. Return: The number of errors. If more than 3 errors are detected, returns a negative value and performs no correction.*/ static int bch18_6_correct(unsigned *_y){ unsigned x; unsigned y; int nerrs; y=*_y; /*Check the easy case first: see if the data bits were uncorrupted.*/ x=y>>12; if(x>=7&&x<=40){ nerrs=qr_hamming_dist(y,BCH18_6_CODES[x-7],4); if(nerrs<4){ *_y=BCH18_6_CODES[x-7]; return nerrs; } } /*Exhaustive search is faster than field operations in GF(19).*/ for(x=0;x<34;x++)if(x+7!=y>>12){ nerrs=qr_hamming_dist(y,BCH18_6_CODES[x],4); if(nerrs<4){ *_y=BCH18_6_CODES[x]; return nerrs; } } return -1; } #if 0 static unsigned bch18_6_encode(unsigned _x){ return (-(_x&1)&0x01F25)^(-(_x>>1&1)&0x0216F)^(-(_x>>2&1)&0x042DE)^ (-(_x>>3&1)&0x085BC)^(-(_x>>4&1)&0x10B78)^(-(_x>>5&1)&0x209D5); } #endif /*Reads the version bits near a finder module and decodes the version number.*/ static int qr_finder_version_decode(qr_finder *_f,const qr_hom *_hom, const unsigned char *_img,int _width,int _height,int _dir){ qr_point q; unsigned v; int x0; int y0; int w0; int dxi; int dyi; int dwi; int dxj; int dyj; int dwj; int ret; int i; int j; int k; v=0; q[_dir]=_f->o[_dir]-7*_f->size[_dir]; q[1-_dir]=_f->o[1-_dir]-3*_f->size[1-_dir]; x0=_hom->fwd[0][0]*q[0]+_hom->fwd[0][1]*q[1]; y0=_hom->fwd[1][0]*q[0]+_hom->fwd[1][1]*q[1]; w0=_hom->fwd[2][0]*q[0]+_hom->fwd[2][1]*q[1]+_hom->fwd22; dxi=_hom->fwd[0][1-_dir]*_f->size[1-_dir]; dyi=_hom->fwd[1][1-_dir]*_f->size[1-_dir]; dwi=_hom->fwd[2][1-_dir]*_f->size[1-_dir]; dxj=_hom->fwd[0][_dir]*_f->size[_dir]; dyj=_hom->fwd[1][_dir]*_f->size[_dir]; dwj=_hom->fwd[2][_dir]*_f->size[_dir]; for(k=i=0;i<6;i++){ int x; int y; int w; x=x0; y=y0; w=w0; for(j=0;j<3;j++,k++){ qr_point p; qr_hom_fproject(p,_hom,x,y,w); v|=qr_img_get_bit(_img,_width,_height,p[0],p[1])<o[_dir]+_f->size[_dir]*(-5-i); for(j=0;j<6;j++,k++){ qr_point q; p[1-_dir]=_f->o[1-_dir]+_f->size[1-_dir]*(2-j); qr_hom_project(q,_hom,p[0],p[1]); v|=qr_img_get_bit(_img,_width,_height,q[0],q[1])<=0?(int)(v>>12):ret; } /*Reads the format info bits near the finder modules and decodes them.*/ static int qr_finder_fmt_info_decode(qr_finder *_ul,qr_finder *_ur, qr_finder *_dl,const qr_hom *_hom, const unsigned char *_img,int _width,int _height){ qr_point p; unsigned lo[2]; unsigned hi[2]; int u; int v; int x; int y; int w; int dx; int dy; int dw; int fmt_info[4]; int count[4]; int nerrs[4]; int nfmt_info; int besti; int imax; int di; int i; int k; /*Read the bits around the UL corner.*/ lo[0]=0; u=_ul->o[0]+5*_ul->size[0]; v=_ul->o[1]-3*_ul->size[1]; x=_hom->fwd[0][0]*u+_hom->fwd[0][1]*v; y=_hom->fwd[1][0]*u+_hom->fwd[1][1]*v; w=_hom->fwd[2][0]*u+_hom->fwd[2][1]*v+_hom->fwd22; dx=_hom->fwd[0][1]*_ul->size[1]; dy=_hom->fwd[1][1]*_ul->size[1]; dw=_hom->fwd[2][1]*_ul->size[1]; for(k=i=0;;i++){ /*Skip the timing pattern row.*/ if(i!=6){ qr_hom_fproject(p,_hom,x,y,w); lo[0]|=qr_img_get_bit(_img,_width,_height,p[0],p[1])<=8)break; } x+=dx; y+=dy; w+=dw; } hi[0]=0; dx=-_hom->fwd[0][0]*_ul->size[0]; dy=-_hom->fwd[1][0]*_ul->size[0]; dw=-_hom->fwd[2][0]*_ul->size[0]; while(i-->0){ x+=dx; y+=dy; w+=dw; /*Skip the timing pattern column.*/ if(i!=6){ qr_hom_fproject(p,_hom,x,y,w); hi[0]|=qr_img_get_bit(_img,_width,_height,p[0],p[1])<o[0]+3*_ur->size[0]; v=_ur->o[1]+5*_ur->size[1]; x=_hom->fwd[0][0]*u+_hom->fwd[0][1]*v; y=_hom->fwd[1][0]*u+_hom->fwd[1][1]*v; w=_hom->fwd[2][0]*u+_hom->fwd[2][1]*v+_hom->fwd22; dx=-_hom->fwd[0][0]*_ur->size[0]; dy=-_hom->fwd[1][0]*_ur->size[0]; dw=-_hom->fwd[2][0]*_ur->size[0]; for(k=0;k<8;k++){ qr_hom_fproject(p,_hom,x,y,w); lo[1]|=qr_img_get_bit(_img,_width,_height,p[0],p[1])<o[0]+5*_dl->size[0]; v=_dl->o[1]-3*_dl->size[1]; x=_hom->fwd[0][0]*u+_hom->fwd[0][1]*v; y=_hom->fwd[1][0]*u+_hom->fwd[1][1]*v; w=_hom->fwd[2][0]*u+_hom->fwd[2][1]*v+_hom->fwd22; dx=_hom->fwd[0][1]*_dl->size[1]; dy=_hom->fwd[1][1]*_dl->size[1]; dw=_hom->fwd[2][1]*_dl->size[1]; for(k=8;k<15;k++){ qr_hom_fproject(p,_hom,x,y,w); hi[1]|=qr_img_get_bit(_img,_width,_height,p[0],p[1])<>7&1)+(lo[1]>>7&1)+(hi[1]>>7&1)>>1)<<7; lo[0]=lo[0]&~0x80|i; lo[1]=lo[1]&~0x80|i; hi[1]&=~0x80;*/ /*For the remaining bits we have two samples... try them in all combinations and pick the most popular valid code, breaking ties using the number of bit errors.*/ imax=2<<(hi[0]!=hi[1]); di=1+(lo[0]==lo[1]); nfmt_info=0; for(i=0;i>1])^0x5412; ret=bch15_5_correct(&v); v>>=10; if(ret<0)ret=4; for(j=0;;j++){ if(j>=nfmt_info){ fmt_info[j]=v; count[j]=1; nerrs[j]=ret; nfmt_info++; break; } if(fmt_info[j]==(int)v){ count[j]++; if(ret3&&nerrs[i]<=3|| count[i]>count[besti]||count[i]==count[besti]&&nerrs[i]>QR_INT_LOGBITS; /*Note that we store bits column-wise, since that's how they're read out of the grid.*/ for(j=_u;j<_u+_w;j++)for(i=_v;i<_v+_h;i++){ _grid->fpmask[j*stride+(i>>QR_INT_LOGBITS)]|=1<<(i&QR_INT_BITS-1); } } /*Determine if a given grid location is inside the function pattern.*/ static int qr_sampling_grid_is_in_fp(const qr_sampling_grid *_grid,int _dim, int _u,int _v){ return _grid->fpmask[_u*(_dim+QR_INT_BITS-1>>QR_INT_LOGBITS) +(_v>>QR_INT_LOGBITS)]>>(_v&QR_INT_BITS-1)&1; } /*The spacing between alignment patterns after the second for versions >= 7. We could compact this more, but the code to access it would eliminate the gains.*/ static const unsigned char QR_ALIGNMENT_SPACING[34]={ 16,18,20,22,24,26,28, 20,22,24,24,26,28,28, 22,24,24,26,26,28,28, 24,24,26,26,26,28,28, 24,26,26,26,28,28 }; static inline void qr_svg_points(const char *cls, qr_point *p, int n) { svg_path_start(cls, 1, 0, 0); int i; for(i = 0; i < n; i++, p++) svg_path_moveto(SVG_ABS, p[0][0], p[0][1]); svg_path_end(); } /*Initialize the sampling grid for each region of the code. _version: The (decoded) version number. _ul_pos: The location of the UL finder pattern. _ur_pos: The location of the UR finder pattern. _dl_pos: The location of the DL finder pattern. _p: On input, contains estimated positions of the four corner modules. On output, contains a bounding quadrilateral for the code. _img: The binary input image. _width: The width of the input image. _height: The height of the input image. Return: 0 on success, or a negative value on error.*/ static void qr_sampling_grid_init(qr_sampling_grid *_grid,int _version, const qr_point _ul_pos,const qr_point _ur_pos,const qr_point _dl_pos, qr_point _p[4],const unsigned char *_img,int _width,int _height){ qr_hom_cell base_cell; int align_pos[7]; int dim; int nalign; int i; dim=17+(_version<<2); nalign=(_version/7)+2; /*Create a base cell to bootstrap the alignment pattern search.*/ qr_hom_cell_init(&base_cell,0,0,dim-1,0,0,dim-1,dim-1,dim-1, _p[0][0],_p[0][1],_p[1][0],_p[1][1],_p[2][0],_p[2][1],_p[3][0],_p[3][1]); /*Allocate the array of cells.*/ _grid->ncells=nalign-1; _grid->cells[0]=(qr_hom_cell *)malloc( (nalign-1)*(nalign-1)*sizeof(*_grid->cells[0])); for(i=1;i<_grid->ncells;i++)_grid->cells[i]=_grid->cells[i-1]+_grid->ncells; /*Initialize the function pattern mask.*/ _grid->fpmask=(unsigned *)calloc(dim, (dim+QR_INT_BITS-1>>QR_INT_LOGBITS)*sizeof(*_grid->fpmask)); /*Mask out the finder patterns (and separators and format info bits).*/ qr_sampling_grid_fp_mask_rect(_grid,dim,0,0,9,9); qr_sampling_grid_fp_mask_rect(_grid,dim,0,dim-8,9,8); qr_sampling_grid_fp_mask_rect(_grid,dim,dim-8,0,8,9); /*Mask out the version number bits.*/ if(_version>6){ qr_sampling_grid_fp_mask_rect(_grid,dim,0,dim-11,6,3); qr_sampling_grid_fp_mask_rect(_grid,dim,dim-11,0,3,6); } /*Mask out the timing patterns.*/ qr_sampling_grid_fp_mask_rect(_grid,dim,9,6,dim-17,1); qr_sampling_grid_fp_mask_rect(_grid,dim,6,9,1,dim-17); /*If we have no alignment patterns (e.g., this is a version 1 code), just use the base cell and hope it's good enough.*/ if(_version<2)memcpy(_grid->cells[0],&base_cell,sizeof(base_cell)); else{ qr_point *q; qr_point *p; int j; int k; q=(qr_point *)malloc(nalign*nalign*sizeof(*q)); p=(qr_point *)malloc(nalign*nalign*sizeof(*p)); /*Initialize the alignment pattern position list.*/ align_pos[0]=6; align_pos[nalign-1]=dim-7; if(_version>6){ int d; d=QR_ALIGNMENT_SPACING[_version-7]; for(i=nalign-1;i-->1;)align_pos[i]=align_pos[i+1]-d; } /*Three of the corners use a finder pattern instead of a separate alignment pattern.*/ q[0][0]=3; q[0][1]=3; p[0][0]=_ul_pos[0]; p[0][1]=_ul_pos[1]; q[nalign-1][0]=dim-4; q[nalign-1][1]=3; p[nalign-1][0]=_ur_pos[0]; p[nalign-1][1]=_ur_pos[1]; q[(nalign-1)*nalign][0]=3; q[(nalign-1)*nalign][1]=dim-4; p[(nalign-1)*nalign][0]=_dl_pos[0]; p[(nalign-1)*nalign][1]=_dl_pos[1]; /*Scan for alignment patterns using a diagonal sweep.*/ for(k=1;k<2*nalign-1;k++){ int jmin; int jmax; jmax=QR_MINI(k,nalign-1)-(k==nalign-1); jmin=QR_MAXI(0,k-(nalign-1))+(k==nalign-1); for(j=jmin;j<=jmax;j++){ qr_hom_cell *cell; int u; int v; int k; i=jmax-(j-jmin); k=i*nalign+j; u=align_pos[j]; v=align_pos[i]; q[k][0]=u; q[k][1]=v; /*Mask out the alignment pattern.*/ qr_sampling_grid_fp_mask_rect(_grid,dim,u-2,v-2,5,5); /*Pick a cell to use to govern the alignment pattern search.*/ if(i>1&&j>1){ qr_point p0; qr_point p1; qr_point p2; /*Each predictor is basically a straight-line extrapolation from two neighboring alignment patterns (except possibly near the opposing finder patterns).*/ qr_hom_cell_project(p0,_grid->cells[i-2]+j-1,u,v,0); qr_hom_cell_project(p1,_grid->cells[i-2]+j-2,u,v,0); qr_hom_cell_project(p2,_grid->cells[i-1]+j-2,u,v,0); /*Take the median of the predictions as the search center.*/ QR_SORT2I(p0[0],p1[0]); QR_SORT2I(p0[1],p1[1]); QR_SORT2I(p1[0],p2[0]); QR_SORT2I(p1[1],p2[1]); QR_SORT2I(p0[0],p1[0]); QR_SORT2I(p0[1],p1[1]); /*We need a cell that has the target point at a known (u,v) location. Since our cells don't have inverses, just construct one from our neighboring points.*/ cell=_grid->cells[i-1]+j-1; qr_hom_cell_init(cell, q[k-nalign-1][0],q[k-nalign-1][1],q[k-nalign][0],q[k-nalign][1], q[k-1][0],q[k-1][1],q[k][0],q[k][1], p[k-nalign-1][0],p[k-nalign-1][1],p[k-nalign][0],p[k-nalign][1], p[k-1][0],p[k-1][1],p1[0],p1[1]); } else if(i>1&&j>0)cell=_grid->cells[i-2]+j-1; else if(i>0&&j>1)cell=_grid->cells[i-1]+j-2; else cell=&base_cell; /*Use a very small search radius. A large displacement here usually means a false positive (e.g., when the real alignment pattern is damaged or missing), which can severely distort the projection.*/ qr_alignment_pattern_search(p[k],cell,u,v,2,_img,_width,_height); if(i>0&&j>0){ qr_hom_cell_init(_grid->cells[i-1]+j-1, q[k-nalign-1][0],q[k-nalign-1][1],q[k-nalign][0],q[k-nalign][1], q[k-1][0],q[k-1][1],q[k][0],q[k][1], p[k-nalign-1][0],p[k-nalign-1][1],p[k-nalign][0],p[k-nalign][1], p[k-1][0],p[k-1][1],p[k][0],p[k][1]); } } } qr_svg_points("align", p, nalign * nalign); free(q); free(p); } /*Set the limits over which each cell is used.*/ memcpy(_grid->cell_limits,align_pos+1, (_grid->ncells-1)*sizeof(*_grid->cell_limits)); _grid->cell_limits[_grid->ncells-1]=dim; /*Produce a bounding square for the code (to mark finder centers with). Because of non-linear distortion, this might not actually bound the code, but it should be good enough. I don't think it's worth computing a convex hull or anything silly like that.*/ qr_hom_cell_project(_p[0],_grid->cells[0]+0,-1,-1,1); qr_hom_cell_project(_p[1],_grid->cells[0]+_grid->ncells-1,(dim<<1)-1,-1,1); qr_hom_cell_project(_p[2],_grid->cells[_grid->ncells-1]+0,-1,(dim<<1)-1,1); qr_hom_cell_project(_p[3],_grid->cells[_grid->ncells-1]+_grid->ncells-1, (dim<<1)-1,(dim<<1)-1,1); /*Clamp the points somewhere near the image (this is really just in case a corner is near the plane at infinity).*/ for(i=0;i<4;i++){ _p[i][0]=QR_CLAMPI(-_width<fpmask); free(_grid->cells[0]); } #if defined(QR_DEBUG) static void qr_sampling_grid_dump(qr_sampling_grid *_grid,int _version, const unsigned char *_img,int _width,int _height){ unsigned char *gimg; FILE *fout; int dim; int u; int v; int x; int y; int w; int i; int j; int r; int s; dim=17+(_version<<2)+8<=(4<=(4<>QR_ALIGN_SUBPREC)-4; v=(i>>QR_ALIGN_SUBPREC)-4; for(r=0;r<_grid->ncells-1;r++)if(u<_grid->cell_limits[r])break; for(s=0;s<_grid->ncells-1;s++)if(v<_grid->cell_limits[s])break; cell=_grid->cells[s]+r; u=j-(cell->u0+4<v0+4<fwd[0][0]*u+cell->fwd[0][1]*v+(cell->fwd[0][2]<fwd[1][0]*u+cell->fwd[1][1]*v+(cell->fwd[1][2]<fwd[2][0]*u+cell->fwd[2][1]*v+(cell->fwd[2][2]<>QR_FINDER_SUBPREC,_height-1)*_width+ QR_CLAMPI(0,p[0]>>QR_FINDER_SUBPREC,_width-1)]; } } for(v=0;v<17+(_version<<2);v++)for(u=0;u<17+(_version<<2);u++){ if(qr_sampling_grid_is_in_fp(_grid,17+(_version<<2),u,v)){ j=u+4<>QR_INT_LOGBITS; /*Note that we store bits column-wise, since that's how they're read out of the grid.*/ switch(_pattern){ /*10101010 i+j+1&1 01010101 10101010 01010101*/ case 0:{ int m; m=0x55; for(j=0;j<_dim;j++){ memset(_mask+j*stride,m,stride*sizeof(*_mask)); m^=0xFF; } }break; /*11111111 i+1&1 00000000 11111111 00000000*/ case 1:memset(_mask,0x55,_dim*stride*sizeof(*_mask));break; /*10010010 (j+1)%3&1 10010010 10010010 10010010*/ case 2:{ unsigned m; m=0xFF; for(j=0;j<_dim;j++){ memset(_mask+j*stride,m&0xFF,stride*sizeof(*_mask)); m=m<<8|m>>16; } }break; /*10010010 (i+j+1)%3&1 00100100 01001001 10010010*/ case 3:{ unsigned mi; unsigned mj; mj=0; for(i=0;i<(QR_INT_BITS+2)/3;i++)mj|=1<<3*i; for(j=0;j<_dim;j++){ mi=mj; for(i=0;i>QR_INT_BITS%3|mi<<3-QR_INT_BITS%3; } mj=mj>>1|mj<<2; } }break; /*11100011 (i>>1)+(j/3)+1&1 11100011 00011100 00011100*/ case 4:{ unsigned m; m=7; for(j=0;j<_dim;j++){ memset(_mask+j*stride,(0xCC^-(m&1))&0xFF,stride*sizeof(*_mask)); m=m>>1|m<<5; } }break; /*11111111 !((i*j)%6) 10000010 10010010 10101010*/ case 5:{ for(j=0;j<_dim;j++){ unsigned m; m=0; for(i=0;i<6;i++)m|=!((i*j)%6)<>QR_INT_BITS%6|m<<6-QR_INT_BITS%6; } } }break; /*11111111 (i*j)%3+i*j+1&1 11100011 11011011 10101010*/ case 6:{ for(j=0;j<_dim;j++){ unsigned m; m=0; for(i=0;i<6;i++)m|=((i*j)%3+i*j+1&1)<>QR_INT_BITS%6|m<<6-QR_INT_BITS%6; } } }break; /*10101010 (i*j)%3+i+j+1&1 00011100 10001110 01010101*/ default:{ for(j=0;j<_dim;j++){ unsigned m; m=0; for(i=0;i<6;i++)m|=((i*j)%3+i+j+1&1)<>QR_INT_BITS%6|m<<6-QR_INT_BITS%6; } } }break; } } static void qr_sampling_grid_sample(const qr_sampling_grid *_grid, unsigned *_data_bits,int _dim,int _fmt_info, const unsigned char *_img,int _width,int _height){ int stride; int u0; int u1; int j; /*We initialize the buffer with the data mask and XOR bits into it as we read them out of the image instead of unmasking in a separate step.*/ qr_data_mask_fill(_data_bits,_dim,_fmt_info&7); stride=_dim+QR_INT_BITS-1>>QR_INT_LOGBITS; u0=0; svg_path_start("sampling-grid", 1, 0, 0); /*We read data cell-by-cell to avoid having to constantly change which projection we're using as we read each bit. This (and the position-dependent data mask) is the reason we buffer the bits we read instead of converting them directly to codewords here. Note that bits are stored column-wise, since that's how we'll scan them.*/ for(j=0;j<_grid->ncells;j++){ int i; int v0; int v1; u1=_grid->cell_limits[j]; v0=0; for(i=0;i<_grid->ncells;i++){ qr_hom_cell *cell; int x0; int y0; int w0; int u; int du; int dv; v1=_grid->cell_limits[i]; cell=_grid->cells[i]+j; du=u0-cell->u0; dv=v0-cell->v0; x0=cell->fwd[0][0]*du+cell->fwd[0][1]*dv+cell->fwd[0][2]; y0=cell->fwd[1][0]*du+cell->fwd[1][1]*dv+cell->fwd[1][2]; w0=cell->fwd[2][0]*du+cell->fwd[2][1]*dv+cell->fwd[2][2]; for(u=u0;u>QR_INT_LOGBITS)]^= qr_img_get_bit(_img,_width,_height,p[0],p[1])<<(v&QR_INT_BITS-1); svg_path_moveto(SVG_ABS, p[0], p[1]); } x+=cell->fwd[0][1]; y+=cell->fwd[1][1]; w+=cell->fwd[2][1]; } x0+=cell->fwd[0][0]; y0+=cell->fwd[1][0]; w0+=cell->fwd[2][0]; } v0=v1; } u0=u1; } svg_path_end(); } /*Arranges the sample bits read by qr_sampling_grid_sample() into bytes and groups those bytes into Reed-Solomon blocks. The individual block pointers are destroyed by this routine.*/ static void qr_samples_unpack(unsigned char **_blocks,int _nblocks, int _nshort_data,int _nshort_blocks,const unsigned *_data_bits, const unsigned *_fp_mask,int _dim){ unsigned bits; int biti; int stride; int blocki; int blockj; int i; int j; stride=_dim+QR_INT_BITS-1>>QR_INT_LOGBITS; /*If _all_ the blocks are short, don't skip anything (see below).*/ if(_nshort_blocks>=_nblocks)_nshort_blocks=0; /*Scan columns in pairs from right to left.*/ bits=0; for(blocki=blockj=biti=0,j=_dim-1;j>0;j-=2){ unsigned data1; unsigned data2; unsigned fp_mask1; unsigned fp_mask2; int nbits; int l; /*Scan up a pair of columns.*/ nbits=(_dim-1&QR_INT_BITS-1)+1; l=j*stride; for(i=stride;i-->0;){ data1=_data_bits[l+i]; fp_mask1=_fp_mask[l+i]; data2=_data_bits[l+i-stride]; fp_mask2=_fp_mask[l+i-stride]; while(nbits-->0){ /*Pull a bit from the right column.*/ if(!(fp_mask1>>nbits&1)){ bits=bits<<1|data1>>nbits&1; biti++; } /*Pull a bit from the left column.*/ if(!(fp_mask2>>nbits&1)){ bits=bits<<1|data2>>nbits&1; biti++; } /*If we finished a byte, drop it in a block.*/ if(biti>=8){ biti-=8; *_blocks[blocki++]++=(unsigned char)(bits>>biti); /*For whatever reason, the long blocks are at the _end_ of the list, instead of the beginning. Even worse, the extra bytes they get come at the end of the data bytes, before the parity bytes. Hence the logic here: when we've filled up the data portion of the short blocks, skip directly to the long blocks for the next byte. It's also the reason we increment _blocks[blocki] on each store, instead of just indexing with blockj (after this iteration the number of bytes in each block differs).*/ if(blocki>=_nblocks)blocki=++blockj==_nshort_data?_nshort_blocks:0; } } nbits=QR_INT_BITS; } j-=2; /*Skip the column with the vertical timing pattern.*/ if(j==6)j--; /*Scan down a pair of columns.*/ l=j*stride; for(i=0;i0){ /*Pull a bit from the right column.*/ if(!(fp_mask1&1)){ bits=bits<<1|data1&1; biti++; } data1>>=1; fp_mask1>>=1; /*Pull a bit from the left column.*/ if(!(fp_mask2&1)){ bits=bits<<1|data2&1; biti++; } data2>>=1; fp_mask2>>=1; /*If we finished a byte, drop it in a block.*/ if(biti>=8){ biti-=8; *_blocks[blocki++]++=(unsigned char)(bits>>biti); /*See comments on the "up" loop for the reason behind this mess.*/ if(blocki>=_nblocks)blocki=++blockj==_nshort_data?_nshort_blocks:0; } } } } } /*Bit reading code blatantly stolen^W^Wadapted from libogg/libtheora (because I've already debugged it and I know it works). Portions (C) Xiph.Org Foundation 1994-2008, BSD-style license.*/ struct qr_pack_buf{ const unsigned char *buf; int endbyte; int endbit; int storage; }; static void qr_pack_buf_init(qr_pack_buf *_b, const unsigned char *_data,int _ndata){ _b->buf=_data; _b->storage=_ndata; _b->endbyte=_b->endbit=0; } /*Assumes 0<=_bits<=16.*/ static int qr_pack_buf_read(qr_pack_buf *_b,int _bits){ const unsigned char *p; unsigned ret; int m; int d; m=16-_bits; _bits+=_b->endbit; d=_b->storage-_b->endbyte; if(d<=2){ /*Not the main path.*/ if(d*8<_bits){ _b->endbyte+=_bits>>3; _b->endbit=_bits&7; return -1; } /*Special case to avoid reading p[0] below, which might be past the end of the buffer; also skips some useless accounting.*/ else if(!_bits)return 0; } p=_b->buf+_b->endbyte; ret=p[0]<<8+_b->endbit; if(_bits>8){ ret|=p[1]<<_b->endbit; if(_bits>16)ret|=p[2]>>8-_b->endbit; } _b->endbyte+=_bits>>3; _b->endbit=_bits&7; return (ret&0xFFFF)>>m; } static int qr_pack_buf_avail(const qr_pack_buf *_b){ return (_b->storage-_b->endbyte<<3)-_b->endbit; } /*The characters available in QR_MODE_ALNUM.*/ static const unsigned char QR_ALNUM_TABLE[45]={ '0','1','2','3','4','5','6','7','8','9', 'A','B','C','D','E','F','G','H','I','J', 'K','L','M','N','O','P','Q','R','S','T', 'U','V','W','X','Y','Z',' ','$','%','*', '+','-','.','/',':' }; static int qr_code_data_parse(qr_code_data *_qrdata,int _version, const unsigned char *_data,int _ndata){ qr_pack_buf qpb; int centries; int len_bits_idx; /*Entries are stored directly in the struct during parsing. Caller cleans up any allocated data on failure.*/ _qrdata->entries=NULL; _qrdata->nentries=0; _qrdata->sa_size=0; centries=0; /*The versions are divided into 3 ranges that each use a different number of bits for length fields.*/ len_bits_idx=(_version>9)+(_version>26); qr_pack_buf_init(&qpb,_data,_ndata); /*While we have enough bits to read a mode...*/ while(qr_pack_buf_avail(&qpb)>=4){ qr_code_data_entry *entry; int mode; mode=qr_pack_buf_read(&qpb,4); /*Mode 0 is a terminator.*/ if(!mode)break; if(_qrdata->nentries>=centries){ centries=centries<<1|1; _qrdata->entries=(qr_code_data_entry *)realloc(_qrdata->entries, centries*sizeof(*_qrdata->entries)); } entry=_qrdata->entries+_qrdata->nentries++; /*Set the mode to an invalid value until we allocate a buffer for it. This ensures we don't try to free it on clean-up until then.*/ entry->mode=-1; switch(mode){ /*The number of bits used to encode the character count for each version range and each data mode.*/ static const unsigned char LEN_BITS[3][4]={ {10, 9, 8, 8}, {12,11,16,10}, {14,13,16,12} }; case QR_MODE_NUM:{ unsigned char *buf; unsigned bits; int len; int count; int rem; len=qr_pack_buf_read(&qpb,LEN_BITS[len_bits_idx][0]); if(len<0)return -1; /*Check to see if there are enough bits left now, so we don't have to in the decode loop.*/ count=len/3; rem=len%3; if(qr_pack_buf_avail(&qpb)<10*count+7*(rem>>1&1)+4*(rem&1))return -1; entry->mode=mode; entry->payload.data.buf=buf=(unsigned char *)malloc(len*sizeof(*buf)); entry->payload.data.len=len; /*Read groups of 3 digits encoded in 10 bits.*/ while(count-->0){ bits=qr_pack_buf_read(&qpb,10); if(bits>=1000)return -1; *buf++=(unsigned char)('0'+bits/100); bits%=100; *buf++=(unsigned char)('0'+bits/10); *buf++=(unsigned char)('0'+bits%10); } /*Read the last two digits encoded in 7 bits.*/ if(rem>1){ bits=qr_pack_buf_read(&qpb,7); if(bits>=100)return -1; *buf++=(unsigned char)('0'+bits/10); *buf++=(unsigned char)('0'+bits%10); } /*Or the last one digit encoded in 4 bits.*/ else if(rem){ bits=qr_pack_buf_read(&qpb,4); if(bits>=10)return -1; *buf++=(unsigned char)('0'+bits); } }break; case QR_MODE_ALNUM:{ unsigned char *buf; unsigned bits; int len; int count; int rem; len=qr_pack_buf_read(&qpb,LEN_BITS[len_bits_idx][1]); if(len<0)return -1; /*Check to see if there are enough bits left now, so we don't have to in the decode loop.*/ count=len>>1; rem=len&1; if(qr_pack_buf_avail(&qpb)<11*count+6*rem)return -1; entry->mode=mode; entry->payload.data.buf=buf=(unsigned char *)malloc(len*sizeof(*buf)); entry->payload.data.len=len; /*Read groups of two characters encoded in 11 bits.*/ while(count-->0){ bits=qr_pack_buf_read(&qpb,11); if(bits>=2025)return -1; *buf++=QR_ALNUM_TABLE[bits/45]; *buf++=QR_ALNUM_TABLE[bits%45]; len-=2; } /*Read the last character encoded in 6 bits.*/ if(rem){ bits=qr_pack_buf_read(&qpb,6); if(bits>=45)return -1; *buf++=QR_ALNUM_TABLE[bits]; } }break; /*Structured-append header.*/ case QR_MODE_STRUCT:{ int bits; entry->mode=mode; bits=qr_pack_buf_read(&qpb,16); if(bits<0)return -1; /*We also save a copy of the data in _qrdata for easy reference when grouping structured-append codes. If for some reason the code has multiple S-A headers, last one wins (TODO: should we return an error instead?).*/ _qrdata->sa_index=entry->payload.sa.sa_index= (unsigned char)(bits>>12&0xF); _qrdata->sa_size=entry->payload.sa.sa_size= (unsigned char)((bits>>8&0xF)+1); _qrdata->sa_parity=entry->payload.sa.sa_parity= (unsigned char)(bits&0xFF); }break; case QR_MODE_BYTE:{ unsigned char *buf; int len; len=qr_pack_buf_read(&qpb,LEN_BITS[len_bits_idx][2]); if(len<0)return -1; /*Check to see if there are enough bits left now, so we don't have to in the decode loop.*/ if(qr_pack_buf_avail(&qpb)mode=mode; entry->payload.data.buf=buf=(unsigned char *)malloc(len*sizeof(*buf)); entry->payload.data.len=len; while(len-->0)*buf++=(unsigned char)qr_pack_buf_read(&qpb,8); }break; /*FNC1 first position marker.*/ case QR_MODE_FNC1_1ST:entry->mode=mode;break; /*Extended Channel Interpretation data.*/ case QR_MODE_ECI:{ unsigned val; int bits; /*ECI uses a variable-width encoding similar to UTF-8*/ bits=qr_pack_buf_read(&qpb,8); if(bits<0)return -1; /*One byte:*/ if(!(bits&0x80))val=bits; /*Two bytes:*/ else if(!(bits&0x40)){ val=bits&0x3F<<8; bits=qr_pack_buf_read(&qpb,8); if(bits<0)return -1; val|=bits; } /*Three bytes:*/ else if(!(bits&0x20)){ val=bits&0x1F<<16; bits=qr_pack_buf_read(&qpb,16); if(bits<0)return -1; val|=bits; /*Valid ECI values are 0...999999.*/ if(val>=1000000)return -1; } /*Invalid lead byte.*/ else return -1; entry->mode=mode; entry->payload.eci=val; }break; case QR_MODE_KANJI:{ unsigned char *buf; unsigned bits; int len; len=qr_pack_buf_read(&qpb,LEN_BITS[len_bits_idx][3]); if(len<0)return -1; /*Check to see if there are enough bits left now, so we don't have to in the decode loop.*/ if(qr_pack_buf_avail(&qpb)<13*len)return -1; entry->mode=mode; entry->payload.data.buf=buf=(unsigned char *)malloc(2*len*sizeof(*buf)); entry->payload.data.len=2*len; /*Decode 2-byte SJIS characters encoded in 13 bits.*/ while(len-->0){ bits=qr_pack_buf_read(&qpb,13); bits=(bits/0xC0<<8|bits%0xC0)+0x8140; if(bits>=0xA000)bits+=0x4000; /*Are values 0xXX7F, 0xXXFD...0xXXFF always invalid? Should we reject them here?*/ *buf++=(unsigned char)(bits>>8); *buf++=(unsigned char)(bits&0xFF); } }break; /*FNC1 second position marker.*/ case QR_MODE_FNC1_2ND:entry->mode=mode;break; /*Unknown mode number:*/ default:{ /*Unfortunately, because we have to understand the format of a mode to know how many bits it occupies, we can't skip unknown modes. Therefore we have to fail.*/ return -1; }break; } } /*TODO: If there was a S-A header, we should compute the parity of this code; how are non-data modes handled (ECI, FNC1)?*/ _qrdata->self_parity=0; /*Success.*/ _qrdata->entries=(qr_code_data_entry *)realloc(_qrdata->entries, _qrdata->nentries*sizeof(*_qrdata->entries)); return 0; } static void qr_code_data_clear(qr_code_data *_qrdata){ int i; for(i=0;i<_qrdata->nentries;i++){ if(QR_MODE_HAS_DATA(_qrdata->entries[i].mode)){ free(_qrdata->entries[i].payload.data.buf); } } free(_qrdata->entries); } void qr_code_data_list_init(qr_code_data_list *_qrlist){ _qrlist->qrdata=NULL; _qrlist->nqrdata=_qrlist->cqrdata=0; } void qr_code_data_list_clear(qr_code_data_list *_qrlist){ int i; for(i=0;i<_qrlist->nqrdata;i++)qr_code_data_clear(_qrlist->qrdata+i); free(_qrlist->qrdata); qr_code_data_list_init(_qrlist); } static void qr_code_data_list_add(qr_code_data_list *_qrlist, qr_code_data *_qrdata){ if(_qrlist->nqrdata>=_qrlist->cqrdata){ _qrlist->cqrdata=_qrlist->cqrdata<<1|1; _qrlist->qrdata=(qr_code_data *)realloc(_qrlist->qrdata, _qrlist->cqrdata*sizeof(*_qrlist->qrdata)); } memcpy(_qrlist->qrdata+_qrlist->nqrdata++,_qrdata,sizeof(*_qrdata)); } #if 0 static const unsigned short QR_NCODEWORDS[40]={ 26, 44, 70, 100, 134, 172, 196, 242, 292, 346, 404, 466, 532, 581, 655, 733, 815, 901, 991,1085, 1156,1258,1364,1474,1588,1706,1828,1921,2051,2185, 2323,2465,2611,2761,2876,3034,3196,3362,3532,3706 }; #endif /*The total number of codewords in a QR code.*/ static int qr_code_ncodewords(unsigned _version){ unsigned nalign; /*This is 24-27 instructions on ARM in thumb mode, or a 26-32 byte savings over just using a table (not counting the instructions that would be needed to do the table lookup).*/ if(_version==1)return 26; nalign=(_version/7)+2; return (_version<<4)*(_version+8) -(5*nalign)*(5*nalign-2)+36*(_version<7)+83>>3; } #if 0 /*The number of parity bytes per Reed-Solomon block for each version and error correction level.*/ static const unsigned char QR_RS_NPAR[40][4]={ { 7,10,13,17},{10,16,22,28},{15,26,18,22},{20,18,26,16}, {26,24,18,22},{18,16,24,28},{20,18,18,26},{24,22,22,26}, {30,22,20,24},{18,26,24,28},{20,30,28,24},{24,22,26,28}, {26,22,24,22},{30,24,20,24},{22,24,30,24},{24,28,24,30}, {28,28,28,28},{30,26,28,28},{28,26,26,26},{28,26,30,28}, {28,26,28,30},{28,28,30,24},{30,28,30,30},{30,28,30,30}, {26,28,30,30},{28,28,28,30},{30,28,30,30},{30,28,30,30}, {30,28,30,30},{30,28,30,30},{30,28,30,30},{30,28,30,30}, {30,28,30,30},{30,28,30,30},{30,28,30,30},{30,28,30,30}, {30,28,30,30},{30,28,30,30},{30,28,30,30},{30,28,30,30} }; #endif /*Bulk data for the number of parity bytes per Reed-Solomon block.*/ static const unsigned char QR_RS_NPAR_VALS[71]={ /*[ 0]*/ 7,10,13,17, /*[ 4]*/10,16,22, 28,26,26, 26,22, 24,22,22, 26,24,18,22, /*[19]*/15,26,18, 22,24, 30,24,20,24, /*[28]*/18,16,24, 28, 28, 28,28,30,24, /*[37]*/20,18, 18,26, 24,28,24, 30,26,28, 28, 26,28,30, 30,22,20,24, /*[55]*/20,18,26,16, /*[59]*/20,30,28, 24,22,26, 28,26, 30,28,30,30 }; /*An offset into QR_RS_NPAR_DATA for each version that gives the number of parity bytes per Reed-Solomon block for each error correction level.*/ static const unsigned char QR_RS_NPAR_OFFS[40]={ 0, 4,19,55,15,28,37,12,51,39, 59,62,10,24,22,41,31,44, 7,65, 47,33,67,67,48,32,67,67,67,67, 67,67,67,67,67,67,67,67,67,67 }; /*The number of Reed-Solomon blocks for each version and error correction level.*/ static const unsigned char QR_RS_NBLOCKS[40][4]={ { 1, 1, 1, 1},{ 1, 1, 1, 1},{ 1, 1, 2, 2},{ 1, 2, 2, 4}, { 1, 2, 4, 4},{ 2, 4, 4, 4},{ 2, 4, 6, 5},{ 2, 4, 6, 6}, { 2, 5, 8, 8},{ 4, 5, 8, 8},{ 4, 5, 8,11},{ 4, 8,10,11}, { 4, 9,12,16},{ 4, 9,16,16},{ 6,10,12,18},{ 6,10,17,16}, { 6,11,16,19},{ 6,13,18,21},{ 7,14,21,25},{ 8,16,20,25}, { 8,17,23,25},{ 9,17,23,34},{ 9,18,25,30},{10,20,27,32}, {12,21,29,35},{12,23,34,37},{12,25,34,40},{13,26,35,42}, {14,28,38,45},{15,29,40,48},{16,31,43,51},{17,33,45,54}, {18,35,48,57},{19,37,51,60},{19,38,53,63},{20,40,56,66}, {21,43,59,70},{22,45,62,74},{24,47,65,77},{25,49,68,81} }; /*Attempts to fully decode a QR code. _qrdata: Returns the parsed code data. _gf: Used for Reed-Solomon error correction. _ul_pos: The location of the UL finder pattern. _ur_pos: The location of the UR finder pattern. _dl_pos: The location of the DL finder pattern. _version: The (decoded) version number. _fmt_info: The decoded format info. _img: The binary input image. _width: The width of the input image. _height: The height of the input image. Return: 0 on success, or a negative value on error.*/ static int qr_code_decode(qr_code_data *_qrdata,const rs_gf256 *_gf, const qr_point _ul_pos,const qr_point _ur_pos,const qr_point _dl_pos, int _version,int _fmt_info, const unsigned char *_img,int _width,int _height){ qr_sampling_grid grid; unsigned *data_bits; unsigned char **blocks; unsigned char *block_data; int nblocks; int nshort_blocks; int ncodewords; int block_sz; int ecc_level; int ndata; int npar; int dim; int ret; int i; /*Read the bits out of the image.*/ qr_sampling_grid_init(&grid,_version,_ul_pos,_ur_pos,_dl_pos,_qrdata->bbox, _img,_width,_height); #if defined(QR_DEBUG) qr_sampling_grid_dump(&grid,_version,_img,_width,_height); #endif dim=17+(_version<<2); data_bits=(unsigned *)malloc( dim*(dim+QR_INT_BITS-1>>QR_INT_LOGBITS)*sizeof(*data_bits)); qr_sampling_grid_sample(&grid,data_bits,dim,_fmt_info,_img,_width,_height); /*Group those bits into Reed-Solomon codewords.*/ ecc_level=(_fmt_info>>3)^1; nblocks=QR_RS_NBLOCKS[_version-1][ecc_level]; npar=*(QR_RS_NPAR_VALS+QR_RS_NPAR_OFFS[_version-1]+ecc_level); ncodewords=qr_code_ncodewords(_version); block_sz=ncodewords/nblocks; nshort_blocks=nblocks-(ncodewords%nblocks); blocks=(unsigned char **)malloc(nblocks*sizeof(*blocks)); block_data=(unsigned char *)malloc(ncodewords*sizeof(*block_data)); blocks[0]=block_data; for(i=1;inshort_blocks); qr_samples_unpack(blocks,nblocks,block_sz-npar,nshort_blocks, data_bits,grid.fpmask,dim); qr_sampling_grid_clear(&grid); free(blocks); free(data_bits); /*Perform the error correction.*/ ndata=0; ncodewords=0; ret=0; for(i=0;i=nshort_blocks); if(rs_correct(_gf,QR_M0,block_data+ncodewords,block_szi,npar,NULL,0)<0){ ret=-1; break; } ndatai=block_szi-npar; memmove(block_data+ndata,block_data+ncodewords,ndatai*sizeof(*block_data)); ncodewords+=block_szi; ndata+=ndatai; } /*Parse the corrected bitstream.*/ if(ret>=0){ ret=qr_code_data_parse(_qrdata,_version,block_data,ndata); /*We could return any partially decoded data, but then we'd have to have API support for that; a mode ignoring ECC errors might also be useful.*/ if(ret<0)qr_code_data_clear(_qrdata); _qrdata->version=_version; _qrdata->ecc_level=ecc_level; } free(block_data); return ret; } /*Searches for an arrangement of these three finder centers that yields a valid configuration. _c: On input, the three finder centers to consider in any order. Return: The detected version number, or a negative value on error.*/ static int qr_reader_try_configuration(qr_reader *_reader, qr_code_data *_qrdata,const unsigned char *_img,int _width,int _height, qr_finder_center *_c[3]){ int ci[7]; unsigned maxd; int ccw; int i0; int i; /*Sort the points in counter-clockwise order.*/ ccw=qr_point_ccw(_c[0]->pos,_c[1]->pos,_c[2]->pos); /*Colinear points can't be the corners of a quadrilateral.*/ if(!ccw)return -1; /*Include a few extra copies of the cyclical list to avoid mods.*/ ci[6]=ci[3]=ci[0]=0; ci[4]=ci[1]=1+(ccw<0); ci[5]=ci[2]=2-(ccw<0); /*Assume the points farthest from each other are the opposite corners, and find the top-left point.*/ maxd=qr_point_distance2(_c[1]->pos,_c[2]->pos); i0=0; for(i=1;i<3;i++){ unsigned d; d=qr_point_distance2(_c[ci[i+1]]->pos,_c[ci[i+2]]->pos); if(d>maxd){ i0=i; maxd=d; } } /*However, try all three possible orderings, just to be sure (a severely skewed projection could move opposite corners closer than adjacent).*/ for(i=i0;ipos,ur.c->pos,dl.c->pos,res); qr_aff_unproject(ur.o,&aff,ur.c->pos[0],ur.c->pos[1]); qr_finder_edge_pts_aff_classify(&ur,&aff); if(qr_finder_estimate_module_size_and_version(&ur,1<pos[0],dl.c->pos[1]); qr_finder_edge_pts_aff_classify(&dl,&aff); if(qr_finder_estimate_module_size_and_version(&dl,1<QR_LARGE_VERSION_SLACK)continue; qr_aff_unproject(ul.o,&aff,ul.c->pos[0],ul.c->pos[1]); qr_finder_edge_pts_aff_classify(&ul,&aff); if(qr_finder_estimate_module_size_and_version(&ul,1<QR_LARGE_VERSION_SLACK|| abs(ul.eversion[0]-dl.eversion[0])>QR_LARGE_VERSION_SLACK){ continue; } #if defined(QR_DEBUG) qr_finder_dump_aff_undistorted(&ul,&ur,&dl,&aff,_img,_width,_height); #endif /*If we made it this far, upgrade the affine homography to a full homography.*/ if(qr_hom_fit(&hom,&ul,&ur,&dl,_qrdata->bbox,&aff, &_reader->isaac,_img,_width,_height)<0){ continue; } qr_hom_unproject(ul.o,&hom,ul.c->pos[0],ul.c->pos[1]); qr_hom_unproject(ur.o,&hom,ur.c->pos[0],ur.c->pos[1]); qr_hom_unproject(dl.o,&hom,dl.c->pos[0],dl.c->pos[1]); qr_finder_edge_pts_hom_classify(&ur,&hom); if(qr_finder_estimate_module_size_and_version(&ur, ur.o[0]-ul.o[0],ur.o[0]-ul.o[0])<0){ continue; } qr_finder_edge_pts_hom_classify(&dl,&hom); if(qr_finder_estimate_module_size_and_version(&dl, dl.o[1]-ul.o[1],dl.o[1]-ul.o[1])<0){ continue; } #if defined(QR_DEBUG) qr_finder_dump_hom_undistorted(&ul,&ur,&dl,&hom,_img,_width,_height); #endif /*If we have a small version (less than 7), there's no encoded version information. If the estimated version on the two corners matches and is sufficiently small, we assume this is the case.*/ if(ur.eversion[1]==dl.eversion[0]&&ur.eversion[1]<7){ /*We used to do a whole bunch of extra geometric checks for small versions, because with just an affine correction, it was fairly easy to estimate two consistent module sizes given a random configuration. However, now that we're estimating a full homography, these appear to be unnecessary.*/ #if 0 static const signed char LINE_TESTS[12][6]={ /*DL left, UL > 0, UR > 0*/ {2,0,0, 1,1, 1}, /*DL right, UL > 0, UR < 0*/ {2,1,0, 1,1,-1}, /*UR top, UL > 0, DL > 0*/ {1,2,0, 1,2, 1}, /*UR bottom, UL > 0, DL < 0*/ {1,3,0, 1,2,-1}, /*UR left, DL < 0, UL < 0*/ {1,0,2,-1,0,-1}, /*UR right, DL > 0, UL > 0*/ {1,1,2, 1,0, 1}, /*DL top, UR < 0, UL < 0*/ {2,2,1,-1,0,-1}, /*DL bottom, UR > 0, UL > 0*/ {2,3,1, 1,0, 1}, /*UL left, DL > 0, UR > 0*/ {0,0,2, 1,1, 1}, /*UL right, DL > 0, UR < 0*/ {0,1,2, 1,1,-1}, /*UL top, UR > 0, DL > 0*/ {0,2,1, 1,2, 1}, /*UL bottom, UR > 0, DL < 0*/ {0,3,1, 1,2,-1} }; qr_finder *f[3]; int j; /*Start by decoding the format information. This is cheap, but unlikely to reject invalid configurations. 56.25% of all bitstrings are valid, and we mix and match several pieces until we find a valid combination, so our real chances of finding a valid codeword in random bits are even higher.*/ fmt_info=qr_finder_fmt_info_decode(&ul,&ur,&dl,&aff,_img,_width,_height); if(fmt_info<0)continue; /*Now we fit lines to the edges of each finder pattern and check to make sure the centers of the other finder patterns lie on the proper side.*/ f[0]=&ul; f[1]=&ur; f[2]=&dl; for(j=0;j<12;j++){ const signed char *t; qr_line l0; int *p; t=LINE_TESTS[j]; qr_finder_ransac(f[t[0]],&aff,&_reader->isaac,t[1]); /*We may not have enough points to fit a line accurately here. If not, we just skip the test.*/ if(qr_line_fit_finder_edge(l0,f[t[0]],t[1],res)<0)continue; p=f[t[2]]->c->pos; if(qr_line_eval(l0,p[0],p[1])*t[3]<0)break; p=f[t[4]]->c->pos; if(qr_line_eval(l0,p[0],p[1])*t[5]<0)break; } if(j<12)continue; /*All tests passed.*/ #endif ur_version=ur.eversion[1]; } else{ /*If the estimated versions are significantly different, reject the configuration.*/ if(abs(ur.eversion[1]-dl.eversion[0])>QR_LARGE_VERSION_SLACK)continue; /*Otherwise we try to read the actual version data from the image. If the real version is not sufficiently close to our estimated version, then we assume there was an unrecoverable decoding error (so many bit errors we were within 3 errors of another valid code), and throw that value away. If no decoded version could be sufficiently close, we don't even try.*/ if(ur.eversion[1]>=7-QR_LARGE_VERSION_SLACK){ ur_version=qr_finder_version_decode(&ur,&hom,_img,_width,_height,0); if(abs(ur_version-ur.eversion[1])>QR_LARGE_VERSION_SLACK)ur_version=-1; } else ur_version=-1; if(dl.eversion[0]>=7-QR_LARGE_VERSION_SLACK){ dl_version=qr_finder_version_decode(&dl,&hom,_img,_width,_height,1); if(abs(dl_version-dl.eversion[0])>QR_LARGE_VERSION_SLACK)dl_version=-1; } else dl_version=-1; /*If we got at least one valid version, or we got two and they match, then we found a valid configuration.*/ if(ur_version>=0){ if(dl_version>=0&&dl_version!=ur_version)continue; } else if(dl_version<0)continue; else ur_version=dl_version; } qr_finder_edge_pts_hom_classify(&ul,&hom); if(qr_finder_estimate_module_size_and_version(&ul, ur.o[0]-dl.o[0],dl.o[1]-ul.o[1])<0|| abs(ul.eversion[1]-ur.eversion[1])>QR_SMALL_VERSION_SLACK|| abs(ul.eversion[0]-dl.eversion[0])>QR_SMALL_VERSION_SLACK){ continue; } fmt_info=qr_finder_fmt_info_decode(&ul,&ur,&dl,&hom,_img,_width,_height); if(fmt_info<0)continue; if(qr_code_decode(_qrdata,&_reader->gf,ul.c->pos,ur.c->pos,dl.c->pos, ur_version,fmt_info,_img,_width,_height)<0){ /*TODO: Maybe somebody flipped the code? We'd still get a valid version, and probably valid (but incorrect) format info. After we've come this far, it should be a simple matter to check.*/ continue; } return ur_version; } return -1; } void qr_reader_match_centers(qr_reader *_reader,qr_code_data_list *_qrlist, qr_finder_center *_centers,int _ncenters, const unsigned char *_img,int _width,int _height){ /*The number of centers should be small, so an O(n^3) exhaustive search of which ones go together should be reasonable.*/ unsigned char *mark; int i; int j; int k; mark=(unsigned char *)calloc(_ncenters,sizeof(*mark)); for(i=0;i<_ncenters;i++){ /*TODO: We might be able to accelerate this step significantly by considering the remaining finder centers in a more intelligent order, based on the first finder center we just chose.*/ for(j=i+1;!mark[i]&&j<_ncenters;j++){ for(k=j+1;!mark[j]&&k<_ncenters;k++)if(!mark[k]){ qr_finder_center *c[3]; qr_code_data qrdata; int version; c[0]=_centers+i; c[1]=_centers+j; c[2]=_centers+k; version=qr_reader_try_configuration(_reader,&qrdata, _img,_width,_height,c); if(version>=0){ int ninside; int l; /*Add the data to the list.*/ qr_code_data_list_add(_qrlist,&qrdata); /*Convert the bounding box we're returning to the user to normal image coordinates.*/ for(l=0;l<4;l++){ _qrlist->qrdata[_qrlist->nqrdata-1].bbox[l][0]>>=QR_FINDER_SUBPREC; _qrlist->qrdata[_qrlist->nqrdata-1].bbox[l][1]>>=QR_FINDER_SUBPREC; } /*Mark these centers as used.*/ mark[i]=mark[j]=mark[k]=1; /*Find any other finder centers located inside this code.*/ for(l=ninside=0;l<_ncenters;l++)if(!mark[l]){ if(qr_point_ccw(qrdata.bbox[0],qrdata.bbox[1],_centers[l].pos)>=0&& qr_point_ccw(qrdata.bbox[1],qrdata.bbox[3],_centers[l].pos)>=0&& qr_point_ccw(qrdata.bbox[3],qrdata.bbox[2],_centers[l].pos)>=0&& qr_point_ccw(qrdata.bbox[2],qrdata.bbox[0],_centers[l].pos)>=0){ mark[l]=2; ninside++; } } if(ninside>=3){ /*We might have a "Double QR": a code inside a code. Copy the relevant centers to a new array and do a search confined to that subset.*/ qr_finder_center *inside; inside=(qr_finder_center *)malloc(ninside*sizeof(*inside)); for(l=ninside=0;l<_ncenters;l++){ if(mark[l]==2)*&inside[ninside++]=*&_centers[l]; } qr_reader_match_centers(_reader,_qrlist,inside,ninside, _img,_width,_height); free(inside); } /*Mark _all_ such centers used: codes cannot partially overlap.*/ for(l=0;l<_ncenters;l++)if(mark[l]==2)mark[l]=1; } } } } free(mark); } int _zbar_qr_found_line (qr_reader *reader, int dir, const qr_finder_line *line) { /* minimally intrusive brute force version */ qr_finder_lines *lines = &reader->finder_lines[dir]; if(lines->nlines >= lines->clines) { lines->clines *= 2; lines->lines = realloc(lines->lines, ++lines->clines * sizeof(*lines->lines)); } memcpy(lines->lines + lines->nlines++, line, sizeof(*line)); return(0); } static inline void qr_svg_centers (const qr_finder_center *centers, int ncenters) { int i, j; svg_path_start("centers", 1, 0, 0); for(i = 0; i < ncenters; i++) svg_path_moveto(SVG_ABS, centers[i].pos[0], centers[i].pos[1]); svg_path_end(); svg_path_start("edge-pts", 1, 0, 0); for(i = 0; i < ncenters; i++) { const qr_finder_center *cen = centers + i; for(j = 0; j < cen->nedge_pts; j++) svg_path_moveto(SVG_ABS, cen->edge_pts[j].pos[0], cen->edge_pts[j].pos[1]); } svg_path_end(); } int _zbar_qr_decode (qr_reader *reader, zbar_image_scanner_t *iscn, zbar_image_t *img) { int nqrdata = 0; qr_finder_edge_pt *edge_pts = NULL; qr_finder_center *centers = NULL; if(reader->finder_lines[0].nlines < 9 || reader->finder_lines[1].nlines < 9) return(0); svg_group_start("finder", 0, 1. / (1 << QR_FINDER_SUBPREC), 0, 0, 0); int ncenters = qr_finder_centers_locate(¢ers, &edge_pts, reader, 0, 0); zprintf(14, "%dx%d finders, %d centers:\n", reader->finder_lines[0].nlines, reader->finder_lines[1].nlines, ncenters); qr_svg_centers(centers, ncenters); if(ncenters >= 3) { void *bin = qr_binarize(img->data, img->width, img->height); qr_code_data_list qrlist; qr_code_data_list_init(&qrlist); qr_reader_match_centers(reader, &qrlist, centers, ncenters, bin, img->width, img->height); if(qrlist.nqrdata > 0) nqrdata = qr_code_data_list_extract_text(&qrlist, iscn, img); qr_code_data_list_clear(&qrlist); free(bin); } svg_group_end(); if(centers) free(centers); if(edge_pts) free(edge_pts); return(nqrdata); } zbar-0.10/zbar/qrcode/bch15_5.h0000644000000000000000000000154011270371414012771 00000000000000/*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #if !defined(_bch15_5_H) # define _bch15_5_H (1) /*Encodes a raw 5-bit value _x into a 15-bit BCH(15,5) code. This is capable of correcting up to 3 bit errors, and detecting as many as 5 bit errors in some cases.*/ unsigned bch15_5_encode(unsigned _x); /*Corrects the received code *_y, if possible. The original data is located in the top five bits. Returns the number of errors corrected, or a negative value if decoding failed due to too many bit errors, in which case *_y is left unchanged.*/ int bch15_5_correct(unsigned *_y); #endif zbar-0.10/zbar/qrcode/binarize.h0000644000000000000000000000121511270371414013445 00000000000000/*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #if !defined(_qrcode_binarize_H) # define _qrcode_binarize_H (1) void qr_image_cross_masking_median_filter(unsigned char *_img, int _width,int _height); void qr_wiener_filter(unsigned char *_img,int _width,int _height); /*Binarizes a grayscale image.*/ unsigned char *qr_binarize(const unsigned char *_img,int _width,int _height); #endif zbar-0.10/zbar/convert.c0000644000000000000000000011267111270371414012051 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "image.h" #include "video.h" #include "window.h" /* pack bit size and location offset of a component into one byte */ #define RGB_BITS(off, size) ((((8 - (size)) & 0x7) << 5) | ((off) & 0x1f)) typedef void (conversion_handler_t)(zbar_image_t*, const zbar_format_def_t*, const zbar_image_t*, const zbar_format_def_t*); typedef struct conversion_def_s { int cost; /* conversion "badness" */ conversion_handler_t *func; /* function that accomplishes it */ } conversion_def_t; /* NULL terminated list of known formats, in order of preference * (NB Cr=V Cb=U) */ const uint32_t _zbar_formats[] = { /* planar YUV formats */ fourcc('4','2','2','P'), /* FIXME also YV16? */ fourcc('I','4','2','0'), fourcc('Y','U','1','2'), /* FIXME also IYUV? */ fourcc('Y','V','1','2'), fourcc('4','1','1','P'), /* planar Y + packed UV plane */ fourcc('N','V','1','2'), fourcc('N','V','2','1'), /* packed YUV formats */ fourcc('Y','U','Y','V'), fourcc('U','Y','V','Y'), fourcc('Y','U','Y','2'), /* FIXME add YVYU */ fourcc('Y','U','V','4'), /* FIXME where is this from? */ /* packed rgb formats */ fourcc('R','G','B','3'), fourcc( 3 , 0 , 0 , 0 ), fourcc('B','G','R','3'), fourcc('R','G','B','4'), fourcc('B','G','R','4'), fourcc('R','G','B','P'), fourcc('R','G','B','O'), fourcc('R','G','B','R'), fourcc('R','G','B','Q'), fourcc('Y','U','V','9'), fourcc('Y','V','U','9'), /* basic grayscale format */ fourcc('G','R','E','Y'), fourcc('Y','8','0','0'), fourcc('Y','8',' ',' '), fourcc('Y','8', 0 , 0 ), /* low quality RGB formats */ fourcc('R','G','B','1'), fourcc('R','4','4','4'), fourcc('B','A','8','1'), /* unsupported packed YUV formats */ fourcc('Y','4','1','P'), fourcc('Y','4','4','4'), fourcc('Y','U','V','O'), fourcc('H','M','1','2'), /* unsupported packed RGB format */ fourcc('H','I','2','4'), /* unsupported compressed formats */ fourcc('J','P','E','G'), fourcc('M','J','P','G'), fourcc('M','P','E','G'), /* terminator */ 0 }; const int _zbar_num_formats = sizeof(_zbar_formats) / sizeof(uint32_t); /* format definitions */ static const zbar_format_def_t format_defs[] = { { fourcc('R','G','B','4'), ZBAR_FMT_RGB_PACKED, { { 4, RGB_BITS(8, 8), RGB_BITS(16, 8), RGB_BITS(24, 8) } } }, { fourcc('B','G','R','1'), ZBAR_FMT_RGB_PACKED, { { 1, RGB_BITS(0, 3), RGB_BITS(3, 3), RGB_BITS(6, 2) } } }, { fourcc('4','2','2','P'), ZBAR_FMT_YUV_PLANAR, { { 1, 0, 0 /*UV*/ } } }, { fourcc('Y','8','0','0'), ZBAR_FMT_GRAY, }, { fourcc('Y','U','Y','2'), ZBAR_FMT_YUV_PACKED, { { 1, 0, 0, /*YUYV*/ } } }, { fourcc('J','P','E','G'), ZBAR_FMT_JPEG, }, { fourcc('Y','V','Y','U'), ZBAR_FMT_YUV_PACKED, { { 1, 0, 1, /*YVYU*/ } } }, { fourcc('Y','8', 0 , 0 ), ZBAR_FMT_GRAY, }, { fourcc('N','V','2','1'), ZBAR_FMT_YUV_NV, { { 1, 1, 1 /*VU*/ } } }, { fourcc('N','V','1','2'), ZBAR_FMT_YUV_NV, { { 1, 1, 0 /*UV*/ } } }, { fourcc('B','G','R','3'), ZBAR_FMT_RGB_PACKED, { { 3, RGB_BITS(16, 8), RGB_BITS(8, 8), RGB_BITS(0, 8) } } }, { fourcc('Y','V','U','9'), ZBAR_FMT_YUV_PLANAR, { { 2, 2, 1 /*VU*/ } } }, { fourcc('R','G','B','O'), ZBAR_FMT_RGB_PACKED, { { 2, RGB_BITS(10, 5), RGB_BITS(5, 5), RGB_BITS(0, 5) } } }, { fourcc('R','G','B','Q'), ZBAR_FMT_RGB_PACKED, { { 2, RGB_BITS(2, 5), RGB_BITS(13, 5), RGB_BITS(8, 5) } } }, { fourcc('G','R','E','Y'), ZBAR_FMT_GRAY, }, { fourcc( 3 , 0 , 0 , 0 ), ZBAR_FMT_RGB_PACKED, { { 4, RGB_BITS(16, 8), RGB_BITS(8, 8), RGB_BITS(0, 8) } } }, { fourcc('Y','8',' ',' '), ZBAR_FMT_GRAY, }, { fourcc('I','4','2','0'), ZBAR_FMT_YUV_PLANAR, { { 1, 1, 0 /*UV*/ } } }, { fourcc('R','G','B','1'), ZBAR_FMT_RGB_PACKED, { { 1, RGB_BITS(5, 3), RGB_BITS(2, 3), RGB_BITS(0, 2) } } }, { fourcc('Y','U','1','2'), ZBAR_FMT_YUV_PLANAR, { { 1, 1, 0 /*UV*/ } } }, { fourcc('Y','V','1','2'), ZBAR_FMT_YUV_PLANAR, { { 1, 1, 1 /*VU*/ } } }, { fourcc('R','G','B','3'), ZBAR_FMT_RGB_PACKED, { { 3, RGB_BITS(0, 8), RGB_BITS(8, 8), RGB_BITS(16, 8) } } }, { fourcc('R','4','4','4'), ZBAR_FMT_RGB_PACKED, { { 2, RGB_BITS(8, 4), RGB_BITS(4, 4), RGB_BITS(0, 4) } } }, { fourcc('B','G','R','4'), ZBAR_FMT_RGB_PACKED, { { 4, RGB_BITS(16, 8), RGB_BITS(8, 8), RGB_BITS(0, 8) } } }, { fourcc('Y','U','V','9'), ZBAR_FMT_YUV_PLANAR, { { 2, 2, 0 /*UV*/ } } }, { fourcc('M','J','P','G'), ZBAR_FMT_JPEG, }, { fourcc('4','1','1','P'), ZBAR_FMT_YUV_PLANAR, { { 2, 0, 0 /*UV*/ } } }, { fourcc('R','G','B','P'), ZBAR_FMT_RGB_PACKED, { { 2, RGB_BITS(11, 5), RGB_BITS(5, 6), RGB_BITS(0, 5) } } }, { fourcc('R','G','B','R'), ZBAR_FMT_RGB_PACKED, { { 2, RGB_BITS(3, 5), RGB_BITS(13, 6), RGB_BITS(8, 5) } } }, { fourcc('Y','U','Y','V'), ZBAR_FMT_YUV_PACKED, { { 1, 0, 0, /*YUYV*/ } } }, { fourcc('U','Y','V','Y'), ZBAR_FMT_YUV_PACKED, { { 1, 0, 2, /*UYVY*/ } } }, }; static const int num_format_defs = sizeof(format_defs) / sizeof(zbar_format_def_t); #ifdef DEBUG_CONVERT static int intsort (const void *a, const void *b) { return(*(uint32_t*)a - *(uint32_t*)b); } #endif /* verify that format list is in required sort order */ static inline int verify_format_sort (void) { int i; for(i = 0; i < num_format_defs; i++) { int j = i * 2 + 1; if((j < num_format_defs && format_defs[i].format < format_defs[j].format) || (j + 1 < num_format_defs && format_defs[j + 1].format < format_defs[i].format)) break; } if(i == num_format_defs) return(0); /* spew correct order for fix */ fprintf(stderr, "ERROR: image format list is not sorted!?\n"); #ifdef DEBUG_CONVERT assert(num_format_defs); uint32_t sorted[num_format_defs]; uint32_t ordered[num_format_defs]; for(i = 0; i < num_format_defs; i++) sorted[i] = format_defs[i].format; qsort(sorted, num_format_defs, sizeof(uint32_t), intsort); for(i = 0; i < num_format_defs; i = i << 1 | 1); i = (i - 1) / 2; ordered[i] = sorted[0]; int j, k; for(j = 1; j < num_format_defs; j++) { k = i * 2 + 2; if(k < num_format_defs) { i = k; for(k = k * 2 + 1; k < num_format_defs; k = k * 2 + 1) i = k; } else { for(k = (i - 1) / 2; i != k * 2 + 1; k = (i - 1) / 2) { assert(i); i = k; } i = k; } ordered[i] = sorted[j]; } fprintf(stderr, "correct sort order is:"); for(i = 0; i < num_format_defs; i++) fprintf(stderr, " %4.4s", (char*)&ordered[i]); fprintf(stderr, "\n"); #endif return(-1); } static inline void uv_round (zbar_image_t *img, const zbar_format_def_t *fmt) { img->width >>= fmt->p.yuv.xsub2; img->width <<= fmt->p.yuv.xsub2; img->height >>= fmt->p.yuv.ysub2; img->height <<= fmt->p.yuv.ysub2; } static inline void uv_roundup (zbar_image_t *img, const zbar_format_def_t *fmt) { if(fmt->group == ZBAR_FMT_GRAY) return; unsigned xmask = (1 << fmt->p.yuv.xsub2) - 1; if(img->width & xmask) img->width = (img->width + xmask) & ~xmask; unsigned ymask = (1 << fmt->p.yuv.ysub2) - 1; if(img->height & ymask) img->height = (img->height + ymask) & ~ymask; } static inline unsigned long uvp_size (const zbar_image_t *img, const zbar_format_def_t *fmt) { if(fmt->group == ZBAR_FMT_GRAY) return(0); return((img->width >> fmt->p.yuv.xsub2) * (img->height >> fmt->p.yuv.ysub2)); } static inline uint32_t convert_read_rgb (const uint8_t *srcp, int bpp) { uint32_t p; if(bpp == 3) { p = *srcp; p |= *(srcp + 1) << 8; p |= *(srcp + 2) << 16; } else if(bpp == 4) p = *((uint32_t*)(srcp)); else if(bpp == 2) p = *((uint16_t*)(srcp)); else p = *srcp; return(p); } static inline void convert_write_rgb (uint8_t *dstp, uint32_t p, int bpp) { if(bpp == 3) { *dstp = p & 0xff; *(dstp + 1) = (p >> 8) & 0xff; *(dstp + 2) = (p >> 16) & 0xff; } else if(bpp == 4) *((uint32_t*)dstp) = p; else if(bpp == 2) *((uint16_t*)dstp) = p; else *dstp = p; } /* cleanup linked image by unrefing */ static void cleanup_ref (zbar_image_t *img) { if(img->next) _zbar_image_refcnt(img->next, -1); } /* resize y plane, drop extra columns/rows from the right/bottom, * or duplicate last column/row to pad missing data */ static inline void convert_y_resize (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt, size_t n) { if(dst->width == src->width && dst->height == src->height) { memcpy((void*)dst->data, src->data, n); return; } uint8_t *psrc = (void*)src->data; uint8_t *pdst = (void*)dst->data; unsigned width = (dst->width > src->width) ? src->width : dst->width; unsigned xpad = (dst->width > src->width) ? dst->width - src->width : 0; unsigned height = (dst->height > src->height) ? src->height : dst->height; unsigned y; for(y = 0; y < height; y++) { memcpy(pdst, psrc, width); pdst += width; psrc += src->width; if(xpad) { memset(pdst, *(psrc - 1), xpad); pdst += xpad; } } psrc -= src->width; for(; y < dst->height; y++) { memcpy(pdst, psrc, width); pdst += width; if(xpad) { memset(pdst, *(psrc - 1), xpad); pdst += xpad; } } } /* make new image w/reference to the same image data */ static void convert_copy (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { if(src->width == dst->width && src->height == dst->height) { dst->data = src->data; dst->datalen = src->datalen; dst->cleanup = cleanup_ref; zbar_image_t *s = (zbar_image_t*)src; dst->next = s; _zbar_image_refcnt(s, 1); } else /* NB only for GRAY/YUV_PLANAR formats */ convert_y_resize(dst, dstfmt, src, srcfmt, dst->width * dst->height); } /* append neutral UV plane to grayscale image */ static void convert_uvp_append (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { uv_roundup(dst, dstfmt); dst->datalen = uvp_size(dst, dstfmt) * 2; unsigned long n = dst->width * dst->height; dst->datalen += n; assert(src->datalen >= src->width * src->height); zprintf(24, "dst=%dx%d (%lx) %lx src=%dx%d %lx\n", dst->width, dst->height, n, dst->datalen, src->width, src->height, src->datalen); dst->data = malloc(dst->datalen); if(!dst->data) return; convert_y_resize(dst, dstfmt, src, srcfmt, n); memset((void*)dst->data + n, 0x80, dst->datalen - n); } /* interleave YUV planes into packed YUV */ static void convert_yuv_pack (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { uv_roundup(dst, dstfmt); dst->datalen = dst->width * dst->height + uvp_size(dst, dstfmt) * 2; dst->data = malloc(dst->datalen); if(!dst->data) return; uint8_t *dstp = (void*)dst->data; unsigned long srcm = uvp_size(src, srcfmt); unsigned long srcn = src->width * src->height; assert(src->datalen >= srcn + 2 * srcn); uint8_t flags = dstfmt->p.yuv.packorder ^ srcfmt->p.yuv.packorder; uint8_t *srcy = (void*)src->data; const uint8_t *srcu, *srcv; if(flags & 1) { srcv = src->data + srcn; srcu = srcv + srcm; } else { srcu = src->data + srcn; srcv = srcu + srcm; } flags = dstfmt->p.yuv.packorder & 2; unsigned srcl = src->width >> srcfmt->p.yuv.xsub2; unsigned xmask = (1 << srcfmt->p.yuv.xsub2) - 1; unsigned ymask = (1 << srcfmt->p.yuv.ysub2) - 1; unsigned x, y; uint8_t y0 = 0, y1 = 0, u = 0x80, v = 0x80; for(y = 0; y < dst->height; y++) { if(y >= src->height) { srcy -= src->width; srcu -= srcl; srcv -= srcl; } else if(y & ymask) { srcu -= srcl; srcv -= srcl; } for(x = 0; x < dst->width; x += 2) { if(x < src->width) { y0 = *(srcy++); y1 = *(srcy++); if(!(x & xmask)) { u = *(srcu++); v = *(srcv++); } } if(flags) { *(dstp++) = u; *(dstp++) = y0; *(dstp++) = v; *(dstp++) = y1; } else { *(dstp++) = y0; *(dstp++) = u; *(dstp++) = y1; *(dstp++) = v; } } for(; x < src->width; x += 2) { srcy += 2; if(!(x & xmask)) { srcu++; srcv++; } } } } /* split packed YUV samples and join into YUV planes * FIXME currently ignores color and grayscales the image */ static void convert_yuv_unpack (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { uv_roundup(dst, dstfmt); unsigned long dstn = dst->width * dst->height; unsigned long dstm2 = uvp_size(dst, dstfmt) * 2; dst->datalen = dstn + dstm2; dst->data = malloc(dst->datalen); if(!dst->data) return; if(dstm2) memset((void*)dst->data + dstn, 0x80, dstm2); uint8_t *dsty = (void*)dst->data; uint8_t flags = srcfmt->p.yuv.packorder ^ dstfmt->p.yuv.packorder; flags &= 2; const uint8_t *srcp = src->data; if(flags) srcp++; unsigned srcl = src->width + (src->width >> srcfmt->p.yuv.xsub2); unsigned x, y; uint8_t y0 = 0, y1 = 0; for(y = 0; y < dst->height; y++) { if(y >= src->height) srcp -= srcl; for(x = 0; x < dst->width; x += 2) { if(x < src->width) { y0 = *(srcp++); srcp++; y1 = *(srcp++); srcp++; } *(dsty++) = y0; *(dsty++) = y1; } if(x < src->width) srcp += (src->width - x) * 2; } } /* resample and resize UV plane(s) * FIXME currently ignores color and grayscales the image */ static void convert_uvp_resample (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { uv_roundup(dst, dstfmt); unsigned long dstn = dst->width * dst->height; unsigned long dstm2 = uvp_size(dst, dstfmt) * 2; dst->datalen = dstn + dstm2; dst->data = malloc(dst->datalen); if(!dst->data) return; convert_y_resize(dst, dstfmt, src, srcfmt, dstn); if(dstm2) memset((void*)dst->data + dstn, 0x80, dstm2); } /* rearrange interleaved UV componets */ static void convert_uv_resample (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { uv_roundup(dst, dstfmt); unsigned long dstn = dst->width * dst->height; dst->datalen = dstn + uvp_size(dst, dstfmt) * 2; dst->data = malloc(dst->datalen); if(!dst->data) return; uint8_t *dstp = (void*)dst->data; uint8_t flags = (srcfmt->p.yuv.packorder ^ dstfmt->p.yuv.packorder) & 1; const uint8_t *srcp = src->data; unsigned srcl = src->width + (src->width >> srcfmt->p.yuv.xsub2); unsigned x, y; uint8_t y0 = 0, y1 = 0, u = 0x80, v = 0x80; for(y = 0; y < dst->height; y++) { if(y >= src->height) srcp -= srcl; for(x = 0; x < dst->width; x += 2) { if(x < src->width) { if(!(srcfmt->p.yuv.packorder & 2)) { y0 = *(srcp++); u = *(srcp++); y1 = *(srcp++); v = *(srcp++); } else { u = *(srcp++); y0 = *(srcp++); v = *(srcp++); y1 = *(srcp++); } if(flags) { uint8_t tmp = u; u = v; v = tmp; } } if(!(dstfmt->p.yuv.packorder & 2)) { *(dstp++) = y0; *(dstp++) = u; *(dstp++) = y1; *(dstp++) = v; } else { *(dstp++) = u; *(dstp++) = y0; *(dstp++) = v; *(dstp++) = y1; } } if(x < src->width) srcp += (src->width - x) * 2; } } /* YUV planes to packed RGB * FIXME currently ignores color and grayscales the image */ static void convert_yuvp_to_rgb (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { dst->datalen = dst->width * dst->height * dstfmt->p.rgb.bpp; dst->data = malloc(dst->datalen); if(!dst->data) return; uint8_t *dstp = (void*)dst->data; int drbits = RGB_SIZE(dstfmt->p.rgb.red); int drbit0 = RGB_OFFSET(dstfmt->p.rgb.red); int dgbits = RGB_SIZE(dstfmt->p.rgb.green); int dgbit0 = RGB_OFFSET(dstfmt->p.rgb.green); int dbbits = RGB_SIZE(dstfmt->p.rgb.blue); int dbbit0 = RGB_OFFSET(dstfmt->p.rgb.blue); unsigned long srcm = uvp_size(src, srcfmt); unsigned long srcn = src->width * src->height; assert(src->datalen >= srcn + 2 * srcm); uint8_t *srcy = (void*)src->data; unsigned x, y; uint32_t p = 0; for(y = 0; y < dst->height; y++) { if(y >= src->height) srcy -= src->width; for(x = 0; x < dst->width; x++) { if(x < src->width) { /* FIXME color space? */ unsigned y0 = *(srcy++); p = (((y0 >> drbits) << drbit0) | ((y0 >> dgbits) << dgbit0) | ((y0 >> dbbits) << dbbit0)); } convert_write_rgb(dstp, p, dstfmt->p.rgb.bpp); dstp += dstfmt->p.rgb.bpp; } if(x < src->width) srcy += (src->width - x); } } /* packed RGB to YUV planes * FIXME currently ignores color and grayscales the image */ static void convert_rgb_to_yuvp (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { uv_roundup(dst, dstfmt); unsigned long dstn = dst->width * dst->height; unsigned long dstm2 = uvp_size(dst, dstfmt) * 2; dst->datalen = dstn + dstm2; dst->data = malloc(dst->datalen); if(!dst->data) return; if(dstm2) memset((void*)dst->data + dstn, 0x80, dstm2); uint8_t *dsty = (void*)dst->data; assert(src->datalen >= (src->width * src->height * srcfmt->p.rgb.bpp)); const uint8_t *srcp = src->data; int rbits = RGB_SIZE(srcfmt->p.rgb.red); int rbit0 = RGB_OFFSET(srcfmt->p.rgb.red); int gbits = RGB_SIZE(srcfmt->p.rgb.green); int gbit0 = RGB_OFFSET(srcfmt->p.rgb.green); int bbits = RGB_SIZE(srcfmt->p.rgb.blue); int bbit0 = RGB_OFFSET(srcfmt->p.rgb.blue); unsigned srcl = src->width * srcfmt->p.rgb.bpp; unsigned x, y; uint16_t y0 = 0; for(y = 0; y < dst->height; y++) { if(y >= src->height) srcp -= srcl; for(x = 0; x < dst->width; x++) { if(x < src->width) { uint8_t r, g, b; uint32_t p = convert_read_rgb(srcp, srcfmt->p.rgb.bpp); srcp += srcfmt->p.rgb.bpp; /* FIXME endianness? */ r = ((p >> rbit0) << rbits) & 0xff; g = ((p >> gbit0) << gbits) & 0xff; b = ((p >> bbit0) << bbits) & 0xff; /* FIXME color space? */ y0 = ((77 * r + 150 * g + 29 * b) + 0x80) >> 8; } *(dsty++) = y0; } if(x < src->width) srcp += (src->width - x) * srcfmt->p.rgb.bpp; } } /* packed YUV to packed RGB */ static void convert_yuv_to_rgb (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { unsigned long dstn = dst->width * dst->height; dst->datalen = dstn * dstfmt->p.rgb.bpp; dst->data = malloc(dst->datalen); if(!dst->data) return; uint8_t *dstp = (void*)dst->data; int drbits = RGB_SIZE(dstfmt->p.rgb.red); int drbit0 = RGB_OFFSET(dstfmt->p.rgb.red); int dgbits = RGB_SIZE(dstfmt->p.rgb.green); int dgbit0 = RGB_OFFSET(dstfmt->p.rgb.green); int dbbits = RGB_SIZE(dstfmt->p.rgb.blue); int dbbit0 = RGB_OFFSET(dstfmt->p.rgb.blue); assert(src->datalen >= (src->width * src->height + uvp_size(src, srcfmt) * 2)); const uint8_t *srcp = src->data; if(srcfmt->p.yuv.packorder & 2) srcp++; assert(srcfmt->p.yuv.xsub2 == 1); unsigned srcl = src->width + (src->width >> 1); unsigned x, y; uint32_t p = 0; for(y = 0; y < dst->height; y++) { if(y >= src->height) srcp -= srcl; for(x = 0; x < dst->width; x++) { if(x < src->width) { uint8_t y0 = *(srcp++); srcp++; if(y0 <= 16) y0 = 0; else if(y0 >= 235) y0 = 255; else y0 = (uint16_t)(y0 - 16) * 255 / 219; p = (((y0 >> drbits) << drbit0) | ((y0 >> dgbits) << dgbit0) | ((y0 >> dbbits) << dbbit0)); } convert_write_rgb(dstp, p, dstfmt->p.rgb.bpp); dstp += dstfmt->p.rgb.bpp; } if(x < src->width) srcp += (src->width - x) * 2; } } /* packed RGB to packed YUV * FIXME currently ignores color and grayscales the image */ static void convert_rgb_to_yuv (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { uv_roundup(dst, dstfmt); dst->datalen = dst->width * dst->height + uvp_size(dst, dstfmt) * 2; dst->data = malloc(dst->datalen); if(!dst->data) return; uint8_t *dstp = (void*)dst->data; uint8_t flags = dstfmt->p.yuv.packorder & 2; assert(src->datalen >= (src->width * src->height * srcfmt->p.rgb.bpp)); const uint8_t *srcp = src->data; int rbits = RGB_SIZE(srcfmt->p.rgb.red); int rbit0 = RGB_OFFSET(srcfmt->p.rgb.red); int gbits = RGB_SIZE(srcfmt->p.rgb.green); int gbit0 = RGB_OFFSET(srcfmt->p.rgb.green); int bbits = RGB_SIZE(srcfmt->p.rgb.blue); int bbit0 = RGB_OFFSET(srcfmt->p.rgb.blue); unsigned srcl = src->width * srcfmt->p.rgb.bpp; unsigned x, y; uint16_t y0 = 0; for(y = 0; y < dst->height; y++) { if(y >= src->height) srcp -= srcl; for(x = 0; x < dst->width; x++) { if(x < src->width) { uint8_t r, g, b; uint32_t p = convert_read_rgb(srcp, srcfmt->p.rgb.bpp); srcp += srcfmt->p.rgb.bpp; /* FIXME endianness? */ r = ((p >> rbit0) << rbits) & 0xff; g = ((p >> gbit0) << gbits) & 0xff; b = ((p >> bbit0) << bbits) & 0xff; /* FIXME color space? */ y0 = ((77 * r + 150 * g + 29 * b) + 0x80) >> 8; } if(flags) { *(dstp++) = 0x80; *(dstp++) = y0; } else { *(dstp++) = y0; *(dstp++) = 0x80; } } if(x < src->width) srcp += (src->width - x) * srcfmt->p.rgb.bpp; } } /* resample and resize packed RGB components */ static void convert_rgb_resample (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { unsigned long dstn = dst->width * dst->height; dst->datalen = dstn * dstfmt->p.rgb.bpp; dst->data = malloc(dst->datalen); if(!dst->data) return; uint8_t *dstp = (void*)dst->data; int drbits = RGB_SIZE(dstfmt->p.rgb.red); int drbit0 = RGB_OFFSET(dstfmt->p.rgb.red); int dgbits = RGB_SIZE(dstfmt->p.rgb.green); int dgbit0 = RGB_OFFSET(dstfmt->p.rgb.green); int dbbits = RGB_SIZE(dstfmt->p.rgb.blue); int dbbit0 = RGB_OFFSET(dstfmt->p.rgb.blue); assert(src->datalen >= (src->width * src->height * srcfmt->p.rgb.bpp)); const uint8_t *srcp = src->data; int srbits = RGB_SIZE(srcfmt->p.rgb.red); int srbit0 = RGB_OFFSET(srcfmt->p.rgb.red); int sgbits = RGB_SIZE(srcfmt->p.rgb.green); int sgbit0 = RGB_OFFSET(srcfmt->p.rgb.green); int sbbits = RGB_SIZE(srcfmt->p.rgb.blue); int sbbit0 = RGB_OFFSET(srcfmt->p.rgb.blue); unsigned srcl = src->width * srcfmt->p.rgb.bpp; unsigned x, y; uint32_t p = 0; for(y = 0; y < dst->height; y++) { if(y >= src->height) y -= srcl; for(x = 0; x < dst->width; x++) { if(x < src->width) { uint8_t r, g, b; p = convert_read_rgb(srcp, srcfmt->p.rgb.bpp); srcp += srcfmt->p.rgb.bpp; /* FIXME endianness? */ r = (p >> srbit0) << srbits; g = (p >> sgbit0) << sgbits; b = (p >> sbbit0) << sbbits; p = (((r >> drbits) << drbit0) | ((g >> dgbits) << dgbit0) | ((b >> dbbits) << dbbit0)); } convert_write_rgb(dstp, p, dstfmt->p.rgb.bpp); dstp += dstfmt->p.rgb.bpp; } if(x < src->width) srcp += (src->width - x) * srcfmt->p.rgb.bpp; } } #ifdef HAVE_LIBJPEG void _zbar_convert_jpeg_to_y(zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt); static void convert_jpeg(zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt); #endif /* group conversion matrix */ static conversion_def_t conversions[][ZBAR_FMT_NUM] = { { /* *from* GRAY */ { 0, convert_copy }, /* to GRAY */ { 8, convert_uvp_append }, /* to YUV_PLANAR */ { 24, convert_yuv_pack }, /* to YUV_PACKED */ { 32, convert_yuvp_to_rgb }, /* to RGB_PACKED */ { 8, convert_uvp_append }, /* to YUV_NV */ { -1, NULL }, /* to JPEG */ }, { /* from YUV_PLANAR */ { 1, convert_copy }, /* to GRAY */ { 48, convert_uvp_resample }, /* to YUV_PLANAR */ { 64, convert_yuv_pack }, /* to YUV_PACKED */ { 128, convert_yuvp_to_rgb }, /* to RGB_PACKED */ { 40, convert_uvp_append }, /* to YUV_NV */ { -1, NULL }, /* to JPEG */ }, { /* from YUV_PACKED */ { 24, convert_yuv_unpack }, /* to GRAY */ { 52, convert_yuv_unpack }, /* to YUV_PLANAR */ { 20, convert_uv_resample }, /* to YUV_PACKED */ { 144, convert_yuv_to_rgb }, /* to RGB_PACKED */ { 18, convert_yuv_unpack }, /* to YUV_NV */ { -1, NULL }, /* to JPEG */ }, { /* from RGB_PACKED */ { 112, convert_rgb_to_yuvp }, /* to GRAY */ { 160, convert_rgb_to_yuvp }, /* to YUV_PLANAR */ { 144, convert_rgb_to_yuv }, /* to YUV_PACKED */ { 120, convert_rgb_resample }, /* to RGB_PACKED */ { 152, convert_rgb_to_yuvp }, /* to YUV_NV */ { -1, NULL }, /* to JPEG */ }, { /* from YUV_NV (FIXME treated as GRAY) */ { 1, convert_copy }, /* to GRAY */ { 8, convert_uvp_append }, /* to YUV_PLANAR */ { 24, convert_yuv_pack }, /* to YUV_PACKED */ { 32, convert_yuvp_to_rgb }, /* to RGB_PACKED */ { 8, convert_uvp_append }, /* to YUV_NV */ { -1, NULL }, /* to JPEG */ }, #ifdef HAVE_LIBJPEG { /* from JPEG */ { 96, _zbar_convert_jpeg_to_y }, /* to GRAY */ { 104, convert_jpeg }, /* to YUV_PLANAR */ { 116, convert_jpeg }, /* to YUV_PACKED */ { 256, convert_jpeg }, /* to RGB_PACKED */ { 104, convert_jpeg }, /* to YUV_NV */ { -1, NULL }, /* to JPEG */ }, #else { /* from JPEG */ { -1, NULL }, /* to GRAY */ { -1, NULL }, /* to YUV_PLANAR */ { -1, NULL }, /* to YUV_PACKED */ { -1, NULL }, /* to RGB_PACKED */ { -1, NULL }, /* to YUV_NV */ { -1, NULL }, /* to JPEG */ }, #endif }; const zbar_format_def_t *_zbar_format_lookup (uint32_t fmt) { const zbar_format_def_t *def = NULL; int i = 0; while(i < num_format_defs) { def = &format_defs[i]; if(fmt == def->format) return(def); i = i * 2 + 1; if(fmt > def->format) i++; } return(NULL); } #ifdef HAVE_LIBJPEG /* convert JPEG data via an intermediate format supported by libjpeg */ static void convert_jpeg (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { /* define intermediate image in a format supported by libjpeg * (currently only grayscale) */ zbar_image_t *tmp; if(!src->src) { tmp = zbar_image_create(); tmp->format = fourcc('Y','8','0','0'); tmp->width = dst->width; tmp->height = dst->height; } else { tmp = src->src->jpeg_img; assert(tmp); dst->width = tmp->width; dst->height = tmp->height; } const zbar_format_def_t *tmpfmt = _zbar_format_lookup(tmp->format); assert(tmpfmt); /* convert to intermediate format */ _zbar_convert_jpeg_to_y(tmp, tmpfmt, src, srcfmt); /* now convert to dst */ dst->width = tmp->width; dst->height = tmp->height; conversion_handler_t *func = conversions[tmpfmt->group][dstfmt->group].func; func(dst, dstfmt, tmp, tmpfmt); if(!src->src) zbar_image_destroy(tmp); } #endif zbar_image_t *zbar_image_convert_resize (const zbar_image_t *src, unsigned long fmt, unsigned width, unsigned height) { zbar_image_t *dst = zbar_image_create(); dst->format = fmt; dst->width = width; dst->height = height; if(src->format == fmt && src->width == width && src->height == height) { convert_copy(dst, NULL, src, NULL); return(dst); } const zbar_format_def_t *srcfmt = _zbar_format_lookup(src->format); const zbar_format_def_t *dstfmt = _zbar_format_lookup(dst->format); if(!srcfmt || !dstfmt) /* FIXME free dst */ return(NULL); if(srcfmt->group == dstfmt->group && srcfmt->p.cmp == dstfmt->p.cmp && src->width == width && src->height == height) { convert_copy(dst, NULL, src, NULL); return(dst); } conversion_handler_t *func = conversions[srcfmt->group][dstfmt->group].func; dst->cleanup = zbar_image_free_data; func(dst, dstfmt, src, srcfmt); if(!dst->data) { /* conversion failed */ zbar_image_destroy(dst); return(NULL); } return(dst); } zbar_image_t *zbar_image_convert (const zbar_image_t *src, unsigned long fmt) { return(zbar_image_convert_resize(src, fmt, src->width, src->height)); } static inline int has_format (uint32_t fmt, const uint32_t *fmts) { for(; *fmts; fmts++) if(*fmts == fmt) return(1); return(0); } /* select least cost conversion from src format to available dsts */ int _zbar_best_format (uint32_t src, uint32_t *dst, const uint32_t *dsts) { if(dst) *dst = 0; if(!dsts) return(-1); if(has_format(src, dsts)) { zprintf(8, "shared format: %4.4s\n", (char*)&src); if(dst) *dst = src; return(0); } const zbar_format_def_t *srcfmt = _zbar_format_lookup(src); if(!srcfmt) return(-1); zprintf(8, "from %.4s(%08" PRIx32 ") to", (char*)&src, src); unsigned min_cost = -1; for(; *dsts; dsts++) { const zbar_format_def_t *dstfmt = _zbar_format_lookup(*dsts); if(!dstfmt) continue; int cost; if(srcfmt->group == dstfmt->group && srcfmt->p.cmp == dstfmt->p.cmp) cost = 0; else cost = conversions[srcfmt->group][dstfmt->group].cost; if(_zbar_verbosity >= 8) fprintf(stderr, " %.4s(%08" PRIx32 ")=%d", (char*)dsts, *dsts, cost); if(cost >= 0 && min_cost > cost) { min_cost = cost; if(dst) *dst = *dsts; } } if(_zbar_verbosity >= 8) fprintf(stderr, "\n"); return(min_cost); } int zbar_negotiate_format (zbar_video_t *vdo, zbar_window_t *win) { if(!vdo && !win) return(0); if(win) (void)window_lock(win); errinfo_t *errdst = (vdo) ? &vdo->err : &win->err; if(verify_format_sort()) { if(win) (void)window_unlock(win); return(err_capture(errdst, SEV_FATAL, ZBAR_ERR_INTERNAL, __func__, "image format list is not sorted!?")); } if((vdo && !vdo->formats) || (win && !win->formats)) { if(win) (void)window_unlock(win); return(err_capture(errdst, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, __func__, "no input or output formats available")); } static const uint32_t y800[2] = { fourcc('Y','8','0','0'), 0 }; const uint32_t *srcs = (vdo) ? vdo->formats : y800; const uint32_t *dsts = (win) ? win->formats : y800; unsigned min_cost = -1; uint32_t min_fmt = 0; const uint32_t *fmt; for(fmt = _zbar_formats; *fmt; fmt++) { /* only consider formats supported by video device */ if(!has_format(*fmt, srcs)) continue; uint32_t win_fmt = 0; int cost = _zbar_best_format(*fmt, &win_fmt, dsts); if(cost < 0) { zprintf(4, "%.4s(%08" PRIx32 ") -> ? (unsupported)\n", (char*)fmt, *fmt); continue; } zprintf(4, "%.4s(%08" PRIx32 ") -> %.4s(%08" PRIx32 ") (%d)\n", (char*)fmt, *fmt, (char*)&win_fmt, win_fmt, cost); if(min_cost > cost) { min_cost = cost; min_fmt = *fmt; if(!cost) break; } } if(win) (void)window_unlock(win); if(!min_fmt) return(err_capture(errdst, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, __func__, "no supported image formats available")); if(!vdo) return(0); zprintf(2, "setting best format %.4s(%08" PRIx32 ") (%d)\n", (char*)&min_fmt, min_fmt, min_cost); return(zbar_video_init(vdo, min_fmt)); } zbar-0.10/zbar/video.c0000644000000000000000000002552711270371414011502 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "video.h" #include "image.h" #ifdef HAVE_LIBJPEG extern struct jpeg_decompress_struct *_zbar_jpeg_decomp_create(void); extern void _zbar_jpeg_decomp_destroy(struct jpeg_decompress_struct *cinfo); #endif static void _zbar_video_recycle_image (zbar_image_t *img) { zbar_video_t *vdo = img->src; assert(vdo); assert(img->srcidx >= 0); video_lock(vdo); if(vdo->images[img->srcidx] != img) vdo->images[img->srcidx] = img; if(vdo->active) vdo->nq(vdo, img); else video_unlock(vdo); } static void _zbar_video_recycle_shadow (zbar_image_t *img) { zbar_video_t *vdo = img->src; assert(vdo); assert(img->srcidx == -1); video_lock(vdo); img->next = vdo->shadow_image; vdo->shadow_image = img; video_unlock(vdo); } zbar_video_t *zbar_video_create () { zbar_video_t *vdo = calloc(1, sizeof(zbar_video_t)); if(!vdo) return(NULL); err_init(&vdo->err, ZBAR_MOD_VIDEO); vdo->fd = -1; (void)_zbar_mutex_init(&vdo->qlock); /* pre-allocate images */ vdo->num_images = ZBAR_VIDEO_IMAGES_MAX; vdo->images = calloc(ZBAR_VIDEO_IMAGES_MAX, sizeof(zbar_image_t*)); if(!vdo->images) { zbar_video_destroy(vdo); return(NULL); } int i; for(i = 0; i < ZBAR_VIDEO_IMAGES_MAX; i++) { zbar_image_t *img = vdo->images[i] = zbar_image_create(); if(!img) { zbar_video_destroy(vdo); return(NULL); } img->refcnt = 0; img->cleanup = _zbar_video_recycle_image; img->srcidx = i; img->src = vdo; } return(vdo); } void zbar_video_destroy (zbar_video_t *vdo) { if(vdo->intf != VIDEO_INVALID) zbar_video_open(vdo, NULL); if(vdo->images) { int i; for(i = 0; i < ZBAR_VIDEO_IMAGES_MAX; i++) if(vdo->images[i]) free(vdo->images[i]); free(vdo->images); } while(vdo->shadow_image) { zbar_image_t *img = vdo->shadow_image; vdo->shadow_image = img->next; free((void*)img->data); img->data = NULL; free(img); } if(vdo->buf) free(vdo->buf); if(vdo->formats) free(vdo->formats); err_cleanup(&vdo->err); _zbar_mutex_destroy(&vdo->qlock); #ifdef HAVE_LIBJPEG if(vdo->jpeg_img) { zbar_image_destroy(vdo->jpeg_img); vdo->jpeg_img = NULL; } if(vdo->jpeg) { _zbar_jpeg_decomp_destroy(vdo->jpeg); vdo->jpeg = NULL; } #endif free(vdo); } int zbar_video_open (zbar_video_t *vdo, const char *dev) { zbar_video_enable(vdo, 0); video_lock(vdo); if(vdo->intf != VIDEO_INVALID) { if(vdo->cleanup) { vdo->cleanup(vdo); vdo->cleanup = NULL; } zprintf(1, "closed camera (fd=%d)\n", vdo->fd); vdo->intf = VIDEO_INVALID; } video_unlock(vdo); if(!dev) return(0); char *ldev = NULL; if((unsigned char)dev[0] < 0x10) { /* default linux device, overloaded for other platforms */ int id = dev[0]; dev = ldev = strdup("/dev/video0"); ldev[10] = '0' + id; } int rc = _zbar_video_open(vdo, dev); if(ldev) free(ldev); return(rc); } int zbar_video_get_fd (const zbar_video_t *vdo) { if(vdo->intf == VIDEO_INVALID) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "video device not opened")); if(vdo->intf != VIDEO_V4L2) return(err_capture(vdo, SEV_WARNING, ZBAR_ERR_UNSUPPORTED, __func__, "video driver does not support polling")); return(vdo->fd); } int zbar_video_request_size (zbar_video_t *vdo, unsigned width, unsigned height) { if(vdo->initialized) /* FIXME re-init different format? */ return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "already initialized, unable to resize")); vdo->width = width; vdo->height = height; zprintf(1, "request size: %d x %d\n", width, height); return(0); } int zbar_video_request_interface (zbar_video_t *vdo, int ver) { if(vdo->intf != VIDEO_INVALID) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "device already opened, unable to change interface")); vdo->intf = (video_interface_t)ver; zprintf(1, "request interface version %d\n", vdo->intf); return(0); } int zbar_video_request_iomode (zbar_video_t *vdo, int iomode) { if(vdo->intf != VIDEO_INVALID) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "device already opened, unable to change iomode")); if(iomode < 0 || iomode > VIDEO_USERPTR) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "invalid iomode requested")); vdo->iomode = iomode; return(0); } int zbar_video_get_width (const zbar_video_t *vdo) { return(vdo->width); } int zbar_video_get_height (const zbar_video_t *vdo) { return(vdo->height); } uint32_t zbar_video_get_format (const zbar_video_t *vdo) { return(vdo->format); } static inline int video_init_images (zbar_video_t *vdo) { assert(vdo->datalen); if(vdo->iomode != VIDEO_MMAP) { assert(!vdo->buf); vdo->buflen = vdo->num_images * vdo->datalen; vdo->buf = malloc(vdo->buflen); if(!vdo->buf) return(err_capture(vdo, SEV_FATAL, ZBAR_ERR_NOMEM, __func__, "unable to allocate image buffers")); zprintf(1, "pre-allocated %d %s buffers size=0x%lx\n", vdo->num_images, (vdo->iomode == VIDEO_READWRITE) ? "READ" : "USERPTR", vdo->buflen); } int i; for(i = 0; i < vdo->num_images; i++) { zbar_image_t *img = vdo->images[i]; img->format = vdo->format; img->width = vdo->width; img->height = vdo->height; if(vdo->iomode != VIDEO_MMAP) { img->datalen = vdo->datalen; unsigned long offset = i * vdo->datalen; img->data = vdo->buf + offset; zprintf(2, " [%02d] @%08lx\n", i, offset); } } return(0); } int zbar_video_init (zbar_video_t *vdo, unsigned long fmt) { if(vdo->initialized) /* FIXME re-init different format? */ return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "already initialized, re-init unimplemented")); if(vdo->init(vdo, fmt)) return(-1); vdo->format = fmt; if(video_init_images(vdo)) return(-1); #ifdef HAVE_LIBJPEG const zbar_format_def_t *vidfmt = _zbar_format_lookup(fmt); if(vidfmt && vidfmt->group == ZBAR_FMT_JPEG) { /* prepare for decoding */ if(!vdo->jpeg) vdo->jpeg = _zbar_jpeg_decomp_create(); if(vdo->jpeg_img) zbar_image_destroy(vdo->jpeg_img); /* create intermediate image for decoder to use*/ zbar_image_t *img = vdo->jpeg_img = zbar_image_create(); img->format = fourcc('Y','8','0','0'); img->width = vdo->width; img->height = vdo->height; img->datalen = vdo->width * vdo->height; } #endif vdo->initialized = 1; return(0); } int zbar_video_enable (zbar_video_t *vdo, int enable) { if(vdo->active == enable) return(0); if(enable) { if(vdo->intf == VIDEO_INVALID) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "video device not opened")); if(!vdo->initialized && zbar_negotiate_format(vdo, NULL)) return(-1); } if(video_lock(vdo)) return(-1); vdo->active = enable; if(enable) { /* enqueue all buffers */ int i; for(i = 0; i < vdo->num_images; i++) if(vdo->nq(vdo, vdo->images[i]) || ((i + 1 < vdo->num_images) && video_lock(vdo))) return(-1); return(vdo->start(vdo)); } else { int i; for(i = 0; i < vdo->num_images; i++) vdo->images[i]->next = NULL; vdo->nq_image = vdo->dq_image = NULL; if(video_unlock(vdo)) return(-1); return(vdo->stop(vdo)); } } zbar_image_t *zbar_video_next_image (zbar_video_t *vdo) { if(video_lock(vdo)) return(NULL); if(!vdo->active) { video_unlock(vdo); return(NULL); } unsigned frame = vdo->frame++; zbar_image_t *img = vdo->dq(vdo); if(img) { img->seq = frame; if(vdo->num_images < 2) { /* return a *copy* of the video image and immediately recycle * the driver's buffer to avoid deadlocking the resources */ zbar_image_t *tmp = img; video_lock(vdo); img = vdo->shadow_image; vdo->shadow_image = (img) ? img->next : NULL; video_unlock(vdo); if(!img) { img = zbar_image_create(); assert(img); img->refcnt = 0; img->src = vdo; /* recycle the shadow images */ img->format = vdo->format; img->width = vdo->width; img->height = vdo->height; img->datalen = vdo->datalen; img->data = malloc(vdo->datalen); } img->cleanup = _zbar_video_recycle_shadow; img->seq = frame; memcpy((void*)img->data, tmp->data, img->datalen); _zbar_video_recycle_image(tmp); } else img->cleanup = _zbar_video_recycle_image; _zbar_image_refcnt(img, 1); } return(img); } zbar-0.10/zbar/window/0000777000000000000000000000000011270371535011614 500000000000000zbar-0.10/zbar/window/ximage.c0000644000000000000000000001576111270371414013154 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "window.h" #include "x.h" #include "image.h" static int ximage_cleanup (zbar_window_t *w) { window_state_t *x = w->state; if(x->img.x) free(x->img.x); x->img.x = NULL; return(0); } static inline int ximage_init (zbar_window_t *w, zbar_image_t *img, int format_change) { ximage_cleanup(w); XImage *ximg = w->state->img.x = calloc(1, sizeof(XImage)); ximg->width = img->width; ximg->height = img->height; ximg->format = ZPixmap; ximg->byte_order = LSBFirst; ximg->bitmap_unit = 8; ximg->bitmap_bit_order = MSBFirst; ximg->bitmap_pad = 8; const zbar_format_def_t *fmt = _zbar_format_lookup(w->format); if(fmt->group == ZBAR_FMT_RGB_PACKED) { ximg->depth = ximg->bits_per_pixel = fmt->p.rgb.bpp << 3; ximg->red_mask = (0xff >> RGB_SIZE(fmt->p.rgb.red)) << RGB_OFFSET(fmt->p.rgb.red); ximg->green_mask = (0xff >> RGB_SIZE(fmt->p.rgb.green)) << RGB_OFFSET(fmt->p.rgb.green); ximg->blue_mask = (0xff >> RGB_SIZE(fmt->p.rgb.blue)) << RGB_OFFSET(fmt->p.rgb.blue); } else { ximg->depth = ximg->bits_per_pixel = 8; ximg->red_mask = ximg->green_mask = ximg->blue_mask = 0xff; } if(!XInitImage(ximg)) return(err_capture_int(w, SEV_ERROR, ZBAR_ERR_XPROTO, __func__, "unable to init XImage for format %x", w->format)); w->dst_width = img->width; w->dst_height = img->height; /* FIXME implement some basic scaling */ w->scale_num = w->scale_den = 1; zprintf(3, "new XImage %.4s(%08" PRIx32 ") %dx%d" " from %.4s(%08" PRIx32 ") %dx%d\n", (char*)&w->format, w->format, ximg->width, ximg->height, (char*)&img->format, img->format, img->width, img->height); zprintf(4, " masks: %08lx %08lx %08lx\n", ximg->red_mask, ximg->green_mask, ximg->blue_mask); return(0); } static int ximage_draw (zbar_window_t *w, zbar_image_t *img) { window_state_t *x = w->state; XImage *ximg = x->img.x; assert(ximg); ximg->data = (void*)img->data; point_t src = { 0, 0 }; point_t dst = w->scaled_offset; if(dst.x < 0) { src.x = -dst.x; dst.x = 0; } if(dst.y < 0) { src.y = -dst.y; dst.y = 0; } point_t size = w->scaled_size; if(size.x > w->width) size.x = w->width; if(size.y > w->height) size.y = w->height; XPutImage(w->display, w->xwin, x->gc, ximg, src.x, src.y, dst.x, dst.y, size.x, size.y); ximg->data = NULL; return(0); } static uint32_t ximage_formats[4][5] = { { /* 8bpp */ /* FIXME fourcc('Y','8','0','0'), */ fourcc('R','G','B','1'), fourcc('B','G','R','1'), 0 }, { /* 16bpp */ fourcc('R','G','B','P'), fourcc('R','G','B','O'), fourcc('R','G','B','R'), fourcc('R','G','B','Q'), 0 }, { /* 24bpp */ fourcc('R','G','B','3'), fourcc('B','G','R','3'), 0 }, { /* 32bpp */ fourcc('R','G','B','4'), fourcc('B','G','R','4'), 0 }, }; static int ximage_probe_format (zbar_window_t *w, uint32_t format) { const zbar_format_def_t *fmt = _zbar_format_lookup(format); XVisualInfo visreq, *visuals = NULL; memset(&visreq, 0, sizeof(XVisualInfo)); visreq.depth = fmt->p.rgb.bpp << 3; visreq.red_mask = (0xff >> RGB_SIZE(fmt->p.rgb.red)) << RGB_OFFSET(fmt->p.rgb.red); visreq.green_mask = (0xff >> RGB_SIZE(fmt->p.rgb.green)) << RGB_OFFSET(fmt->p.rgb.green); visreq.blue_mask = (0xff >> RGB_SIZE(fmt->p.rgb.blue)) << RGB_OFFSET(fmt->p.rgb.blue); int n; visuals = XGetVisualInfo(w->display, VisualDepthMask | VisualRedMaskMask | VisualGreenMaskMask | VisualBlueMaskMask, &visreq, &n); zprintf(8, "bits=%d r=%08lx g=%08lx b=%08lx: n=%d visuals=%p\n", visreq.depth, visreq.red_mask, visreq.green_mask, visreq.blue_mask, n, visuals); if(!visuals) return(1); XFree(visuals); if(!n) return(-1); return(0); } int _zbar_window_probe_ximage (zbar_window_t *w) { /* FIXME determine supported formats/depths */ int n; XPixmapFormatValues *formats = XListPixmapFormats(w->display, &n); if(!formats) return(err_capture(w, SEV_ERROR, ZBAR_ERR_XPROTO, __func__, "unable to query XImage formats")); int i; for(i = 0; i < n; i++) { if(formats[i].depth & 0x7 || formats[i].depth > 0x20) { zprintf(2, " [%d] depth=%d bpp=%d: not supported\n", i, formats[i].depth, formats[i].bits_per_pixel); continue; } int fmtidx = formats[i].depth / 8 - 1; int j, n = 0; for(j = 0; ximage_formats[fmtidx][j]; j++) if(!ximage_probe_format(w, ximage_formats[fmtidx][j])) { zprintf(2, " [%d] depth=%d bpp=%d: %.4s(%08" PRIx32 ")\n", i, formats[i].depth, formats[i].bits_per_pixel, (char*)&ximage_formats[fmtidx][j], ximage_formats[fmtidx][j]); _zbar_window_add_format(w, ximage_formats[fmtidx][j]); n++; } if(!n) zprintf(2, " [%d] depth=%d bpp=%d: no visuals\n", i, formats[i].depth, formats[i].bits_per_pixel); } XFree(formats); if(!w->formats || !w->formats[0]) return(err_capture(w, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, __func__, "no usable XImage formats found")); w->init = ximage_init; w->draw_image = ximage_draw; w->cleanup = ximage_cleanup; return(0); } zbar-0.10/zbar/window/dib.c0000644000000000000000000000446611270371414012440 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "window.h" #include "image.h" #include "win.h" static int dib_cleanup (zbar_window_t *w) { return(0); } static int dib_init (zbar_window_t *w, zbar_image_t *img, int new_format) { if(new_format) _zbar_window_bih_init(w, img); window_state_t *win = w->state; w->dst_width = win->bih.biWidth = (img->width + 3) & ~3; w->dst_height = win->bih.biHeight = img->height; return(0); } static int dib_draw (zbar_window_t *w, zbar_image_t *img) { StretchDIBits(w->state->hdc, w->scaled_offset.x, w->scaled_offset.y + w->scaled_size.y - 1, w->scaled_size.x, -w->scaled_size.y, 0, 0, w->src_width, w->src_height, (void*)img->data, (BITMAPINFO*)&w->state->bih, DIB_RGB_COLORS, SRCCOPY); return(0); } static uint32_t dib_formats[] = { fourcc('B','G','R','3'), fourcc('B','G','R','4'), fourcc('J','P','E','G'), 0 }; int _zbar_window_dib_init (zbar_window_t *w) { uint32_t *fmt; for(fmt = dib_formats; *fmt; fmt++) _zbar_window_add_format(w, *fmt); w->init = dib_init; w->draw_image = dib_draw; w->cleanup = dib_cleanup; return(0); } zbar-0.10/zbar/window/x.h0000644000000000000000000000455211270371414012152 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _WINDOW_X_H_ #define _WINDOW_X_H_ #include "window.h" #ifdef HAVE_X # include # include # ifdef HAVE_X11_EXTENSIONS_XSHM_H # include # endif #ifdef HAVE_X11_EXTENSIONS_XVLIB_H # include #endif #endif struct window_state_s { unsigned long colors[8]; /* pre-allocated colors */ GC gc; /* graphics context */ Region exposed; /* region to redraw */ XFontStruct *font; /* overlay font */ /* pre-calculated logo geometries */ int logo_scale; unsigned long logo_colors[2]; Region logo_zbars; XPoint logo_z[4]; XRectangle logo_bars[5]; #ifdef HAVE_X11_EXTENSIONS_XSHM_H XShmSegmentInfo shm; /* shared memory segment */ #endif union { XImage *x; #ifdef HAVE_X11_EXTENSIONS_XVLIB_H XvImage *xv; #endif } img; XID img_port; /* current format port */ XID *xv_ports; /* best port for format */ int num_xv_adaptors; /* number of adaptors */ XID *xv_adaptors; /* port grabbed for each adaptor */ }; extern int _zbar_window_probe_ximage(zbar_window_t*); extern int _zbar_window_probe_xshm(zbar_window_t*); extern int _zbar_window_probe_xv(zbar_window_t*); #endif zbar-0.10/zbar/window/win.c0000644000000000000000000002175711270371414012501 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "window.h" #include "image.h" #include "win.h" #include int _zbar_window_vfw_init(zbar_window_t *w); int _zbar_window_dib_init(zbar_window_t *w); int _zbar_window_resize (zbar_window_t *w) { window_state_t *win = w->state; int lbw; if(w->height * 8 / 10 <= w->width) lbw = w->height / 36; else lbw = w->width * 5 / 144; if(lbw < 1) lbw = 1; win->logo_scale = lbw; zprintf(7, "%dx%d scale=%d\n", w->width, w->height, lbw); if(win->logo_zbars) { DeleteObject(win->logo_zbars); win->logo_zbars = NULL; } if(win->logo_zpen) DeleteObject(win->logo_zpen); if(win->logo_zbpen) DeleteObject(win->logo_zbpen); LOGBRUSH lb = { 0, }; lb.lbStyle = BS_SOLID; lb.lbColor = RGB(0xd7, 0x33, 0x33); win->logo_zpen = ExtCreatePen(PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_ROUND | PS_JOIN_ROUND, lbw * 2, &lb, 0, NULL); lb.lbColor = RGB(0xa4, 0x00, 0x00); win->logo_zbpen = ExtCreatePen(PS_GEOMETRIC | PS_SOLID | PS_ENDCAP_ROUND | PS_JOIN_ROUND, lbw * 2, &lb, 0, NULL); int x0 = w->width / 2; int y0 = w->height / 2; int by0 = y0 - 54 * lbw / 5; int bh = 108 * lbw / 5; static const int bx[5] = { -6, -3, -1, 2, 5 }; static const int bw[5] = { 1, 1, 2, 2, 1 }; int i; for(i = 0; i < 5; i++) { int x = x0 + lbw * bx[i]; HRGN bar = CreateRectRgn(x, by0, x + lbw * bw[i], by0 + bh); if(win->logo_zbars) { CombineRgn(win->logo_zbars, win->logo_zbars, bar, RGN_OR); DeleteObject(bar); } else win->logo_zbars = bar; } static const int zx[4] = { -7, 7, -7, 7 }; static const int zy[4] = { -8, -8, 8, 8 }; for(i = 0; i < 4; i++) { win->logo_z[i].x = x0 + lbw * zx[i]; win->logo_z[i].y = y0 + lbw * zy[i]; } return(0); } int _zbar_window_attach (zbar_window_t *w, void *display, unsigned long unused) { window_state_t *win = w->state; if(w->display) { /* FIXME cleanup existing resources */ w->display = NULL; } if(!display) { if(win) { free(win); w->state = NULL; } return(0); } if(!win) win = w->state = calloc(1, sizeof(window_state_t)); w->display = display; win->bih.biSize = sizeof(win->bih); win->bih.biPlanes = 1; HDC hdc = GetDC(w->display); if(!hdc) return(-1/*FIXME*/); win->bih.biXPelsPerMeter = 1000L * GetDeviceCaps(hdc, HORZRES) / GetDeviceCaps(hdc, HORZSIZE); win->bih.biYPelsPerMeter = 1000L * GetDeviceCaps(hdc, VERTRES) / GetDeviceCaps(hdc, VERTSIZE); int height = -MulDiv(11, GetDeviceCaps(hdc, LOGPIXELSY), 96); HFONT font = CreateFontW(height, 0, 0, 0, 0, 0, 0, 0, ANSI_CHARSET, 0, 0, 0, FF_MODERN | FIXED_PITCH, NULL); SelectObject(hdc, font); DeleteObject(font); TEXTMETRIC tm; GetTextMetrics(hdc, &tm); win->font_height = tm.tmHeight; ReleaseDC(w->display, hdc); return(_zbar_window_dib_init(w)); } int _zbar_window_begin (zbar_window_t *w) { HDC hdc = w->state->hdc = GetDC(w->display); if(!hdc || !SaveDC(hdc)) return(-1/*FIXME*/); return(0); } int _zbar_window_end (zbar_window_t *w) { HDC hdc = w->state->hdc; w->state->hdc = NULL; RestoreDC(hdc, -1); ReleaseDC(w->display, hdc); ValidateRect(w->display, NULL); return(0); } int _zbar_window_clear (zbar_window_t *w) { HDC hdc = GetDC(w->display); if(!hdc) return(-1/*FIXME*/); RECT r = { 0, 0, w->width, w->height }; FillRect(hdc, &r, GetStockObject(BLACK_BRUSH)); ReleaseDC(w->display, hdc); ValidateRect(w->display, NULL); return(0); } static inline void win_set_rgb (HDC hdc, uint32_t rgb) { SelectObject(hdc, GetStockObject(DC_PEN)); SetDCPenColor(hdc, RGB((rgb & 4) * 0x33, (rgb & 2) * 0x66, (rgb & 1) * 0xcc)); } int _zbar_window_draw_polygon (zbar_window_t *w, uint32_t rgb, const point_t *pts, int npts) { HDC hdc = w->state->hdc; win_set_rgb(hdc, rgb); point_t org = w->scaled_offset; POINT gdipts[npts + 1]; int i; for(i = 0; i < npts; i++) { point_t p = window_scale_pt(w, pts[i]); gdipts[i].x = p.x + org.x; gdipts[i].y = p.y + org.y; } gdipts[npts] = gdipts[0]; Polyline(hdc, gdipts, npts + 1); return(0); } int _zbar_window_draw_marker (zbar_window_t *w, uint32_t rgb, point_t p) { HDC hdc = w->state->hdc; win_set_rgb(hdc, rgb); static const DWORD npolys[3] = { 5, 2, 2 }; POINT polys[9] = { { p.x - 2, p.y - 2 }, { p.x - 2, p.y + 2 }, { p.x + 2, p.y + 2 }, { p.x + 2, p.y - 2 }, { p.x - 2, p.y - 2 }, { p.x - 3, p.y }, { p.x + 4, p.y }, { p.x, p.y - 3 }, { p.x, p.y + 4 }, }; PolyPolyline(hdc, polys, npolys, 3); return(0); } int _zbar_window_draw_text (zbar_window_t *w, uint32_t rgb, point_t p, const char *text) { HDC hdc = w->state->hdc; SetTextColor(hdc, RGB((rgb & 4) * 0x33, (rgb & 2) * 0x66, (rgb & 1) * 0xcc)); SetBkMode(hdc, TRANSPARENT); int n = 0; while(n < 32 && text[n] && isprint(text[n])) n++; if(p.x >= 0) SetTextAlign(hdc, TA_BASELINE | TA_CENTER); else { SetTextAlign(hdc, TA_BASELINE | TA_RIGHT); p.x += w->width; } if(p.y < 0) p.y = w->height + p.y * w->state->font_height * 5 / 4; TextOut(hdc, p.x, p.y, text, n); return(0); } int _zbar_window_fill_rect (zbar_window_t *w, uint32_t rgb, point_t org, point_t size) { HDC hdc = w->state->hdc; SetDCBrushColor(hdc, RGB((rgb & 4) * 0x33, (rgb & 2) * 0x66, (rgb & 1) * 0xcc)); RECT r = { org.x, org.y, org.x + size.x, org.y + size.y }; FillRect(hdc, &r, GetStockObject(DC_BRUSH)); return(0); } int _zbar_window_draw_logo (zbar_window_t *w) { HDC hdc = w->state->hdc; window_state_t *win = w->state; /* FIXME buffer offscreen */ HRGN rgn = CreateRectRgn(0, 0, w->width, w->height); CombineRgn(rgn, rgn, win->logo_zbars, RGN_DIFF); FillRgn(hdc, rgn, GetStockObject(WHITE_BRUSH)); DeleteObject(rgn); FillRgn(hdc, win->logo_zbars, GetStockObject(BLACK_BRUSH)); SelectObject(hdc, win->logo_zpen); Polyline(hdc, win->logo_z, 4); ExtSelectClipRgn(hdc, win->logo_zbars, RGN_AND); SelectObject(hdc, win->logo_zbpen); Polyline(hdc, win->logo_z, 4); return(0); } int _zbar_window_bih_init (zbar_window_t *w, zbar_image_t *img) { window_state_t *win = w->state; switch(w->format) { case fourcc('J','P','E','G'): { win->bih.biBitCount = 0; win->bih.biCompression = BI_JPEG; break; } case fourcc('B','G','R','3'): { win->bih.biBitCount = 24; win->bih.biCompression = BI_RGB; break; } case fourcc('B','G','R','4'): { win->bih.biBitCount = 32; win->bih.biCompression = BI_RGB; break; } default: assert(0); /* FIXME PNG? */ } win->bih.biSizeImage = img->datalen; zprintf(20, "biCompression=%d biBitCount=%d\n", (int)win->bih.biCompression, win->bih.biBitCount); return(0); } zbar-0.10/zbar/window/xv.c0000644000000000000000000002243711270371414012335 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "window.h" #include "x.h" #include "image.h" #include /* strcmp */ static int xv_cleanup (zbar_window_t *w) { window_state_t *x = w->state; if(x->img.xv) { XFree(x->img.xv); x->img.xv = NULL; } int i; for(i = 0; i < x->num_xv_adaptors; i++) if(x->xv_adaptors[i]) { XvUngrabPort(w->display, x->xv_adaptors[i], CurrentTime); x->xv_adaptors[i] = 0; } free(x->xv_ports); free(x->xv_adaptors); x->xv_ports = NULL; x->num_xv_adaptors = 0; x->xv_adaptors = NULL; return(0); } static inline int xv_init (zbar_window_t *w, zbar_image_t *img, int format_change) { window_state_t *x = w->state; if(x->img.xv) { XFree(x->img.xv); x->img.xv = NULL; } if(format_change) { /* lookup port for format */ x->img_port = 0; int i; for(i = 0; w->formats[i]; i++) if(w->formats[i] == w->format) { x->img_port = x->xv_ports[i]; break; } assert(x->img_port > 0); } XvImage *xvimg = XvCreateImage(w->display, x->img_port, w->format, NULL, img->width, img->height); zprintf(3, "new XvImage %.4s(%08" PRIx32 ") %dx%d(%d)" " from %.4s(%08" PRIx32 ") %dx%d\n", (char*)&w->format, w->format, xvimg->width, xvimg->height, xvimg->pitches[0], (char*)&img->format, img->format, img->width, img->height); /* FIXME not sure this simple check is always correct * should lookup format to decode/sanitize target width from pitch & bpp */ w->dst_width = ((xvimg->num_planes <= 1) ? xvimg->width : xvimg->pitches[0]); w->dst_height = xvimg->height; /* FIXME datalen check */ if(w->dst_width < img->width || xvimg->height < img->height) { XFree(xvimg); /* FIXME fallback to XImage... */ return(err_capture(w, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, __func__, "output image size mismatch (XvCreateImage)")); } x->img.xv = xvimg; return(0); } static int xv_draw (zbar_window_t *w, zbar_image_t *img) { window_state_t *x = w->state; XvImage *xvimg = x->img.xv; assert(xvimg); xvimg->data = (void*)img->data; zprintf(24, "XvPutImage(%dx%d -> %dx%d (%08lx))\n", w->src_width, w->src_height, w->scaled_size.x, w->scaled_size.y, img->datalen); XvPutImage(w->display, x->img_port, w->xwin, x->gc, xvimg, 0, 0, w->src_width, w->src_height, w->scaled_offset.x, w->scaled_offset.y, w->scaled_size.x, w->scaled_size.y); xvimg->data = NULL; /* FIXME hold shm image until completion */ return(0); } static inline int xv_add_format (zbar_window_t *w, uint32_t fmt, XvPortID port) { int i = _zbar_window_add_format(w, fmt); window_state_t *x = w->state; if(!w->formats[i + 1]) x->xv_ports = realloc(x->xv_ports, (i + 1) * sizeof(*x->xv_ports)); /* FIXME could prioritize by something (rate? size?) */ x->xv_ports[i] = port; return(i); } static int xv_probe_port (zbar_window_t *w, XvPortID port) { unsigned n; XvEncodingInfo *encodings = NULL; if(XvQueryEncodings(w->display, port, &n, &encodings)) return(err_capture(w, SEV_ERROR, ZBAR_ERR_XPROTO, __func__, "querying XVideo encodings")); zprintf(1, "probing port %u with %d encodings:\n", (unsigned)port, n); unsigned width = 0, height = 0; int i; for(i = 0; i < n; i++) { XvEncodingInfo *enc = &encodings[i]; zprintf(2, " [%d] %lu x %lu rate=%d/%d : %s\n", i, enc->width, enc->height, enc->rate.numerator, enc->rate.denominator, enc->name); if(!strcmp(enc->name, "XV_IMAGE")) { if(width < enc->width) width = enc->width; if(height < enc->height) height = enc->height; } } XvFreeEncodingInfo(encodings); encodings = NULL; if(!width || !height) return(err_capture(w, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "no XV_IMAGE encodings found")); zprintf(1, "max XV_IMAGE size %dx%d\n", width, height); if(w->max_width > width) w->max_width = width; if(w->max_height > height) w->max_height = height; XvImageFormatValues *formats = XvListImageFormats(w->display, port, (int*)&n); if(!formats) return(err_capture(w, SEV_ERROR, ZBAR_ERR_XPROTO, __func__, "querying XVideo image formats")); zprintf(1, "%d image formats\n", n); for(i = 0; i < n; i++) { XvImageFormatValues *fmt = &formats[i]; zprintf(2, " [%d] %.4s(%08x) %s %s %s planes=%d bpp=%d : %.16s\n", i, (char*)&fmt->id, fmt->id, (fmt->type == XvRGB) ? "RGB" : "YUV", (fmt->byte_order == LSBFirst) ? "LSBFirst" : "MSBFirst", (fmt->format == XvPacked) ? "packed" : "planar", fmt->num_planes, fmt->bits_per_pixel, fmt->guid); xv_add_format(w, fmt->id, port); } XFree(formats); return(0); } int _zbar_window_probe_xv (zbar_window_t *w) { unsigned xv_major, xv_minor, xv_req, xv_ev, xv_err; if(XvQueryExtension(w->display, &xv_major, &xv_minor, &xv_req, &xv_ev, &xv_err)) { zprintf(1, "XVideo extension not present\n"); return(-1); } zprintf(1, "XVideo extension version %u.%u\n", xv_major, xv_minor); unsigned n; XvAdaptorInfo *adaptors = NULL; if(XvQueryAdaptors(w->display, w->xwin, &n, &adaptors)) return(err_capture(w, SEV_ERROR, ZBAR_ERR_XPROTO, __func__, "unable to query XVideo adaptors")); window_state_t *x = w->state; x->num_xv_adaptors = 0; x->xv_adaptors = calloc(n, sizeof(*x->xv_adaptors)); int i; for(i = 0; i < n; i++) { XvAdaptorInfo *adapt = &adaptors[i]; zprintf(2, " adaptor[%d] %lu ports %u-%u type=0x%x fmts=%lu : %s\n", i, adapt->num_ports, (unsigned)adapt->base_id, (unsigned)(adapt->base_id + adapt->num_ports - 1), adapt->type, adapt->num_formats, adapt->name); if(!(adapt->type & XvImageMask)) continue; int j; for(j = 0; j < adapt->num_ports; j++) if(!XvGrabPort(w->display, adapt->base_id + j, CurrentTime)) { zprintf(3, " grabbed port %u\n", (unsigned)(adapt->base_id + j)); x->xv_adaptors[x->num_xv_adaptors++] = adapt->base_id + j; break; } if(j == adapt->num_ports) zprintf(3, " no available XVideo image port\n"); } XvFreeAdaptorInfo(adaptors); adaptors = NULL; if(!x->num_xv_adaptors) { zprintf(1, "WARNING: no XVideo adaptor supporting XvImages found\n"); free(x->xv_adaptors); x->xv_adaptors = NULL; return(-1); } if(x->num_xv_adaptors < n) x->xv_adaptors = realloc(x->xv_adaptors, x->num_xv_adaptors * sizeof(int)); w->max_width = w->max_height = 65536; w->formats = realloc(w->formats, sizeof(uint32_t)); w->formats[0] = 0; for(i = 0; i < x->num_xv_adaptors; i++) if(xv_probe_port(w, x->xv_adaptors[i])) { XvUngrabPort(w->display, x->xv_adaptors[i], CurrentTime); x->xv_adaptors[i] = 0; } if(!w->formats[0] || w->max_width == 65536 || w->max_height == 65536) { xv_cleanup(w); return(-1); } /* clean out any unused adaptors */ for(i = 0; i < x->num_xv_adaptors; i++) { int j; for(j = 0; w->formats[j]; j++) if(x->xv_ports[j] == x->xv_adaptors[i]) break; if(!w->formats[j]) { XvUngrabPort(w->display, x->xv_adaptors[i], CurrentTime); x->xv_adaptors[i] = 0; } } w->init = xv_init; w->draw_image = xv_draw; w->cleanup = xv_cleanup; return(0); } zbar-0.10/zbar/window/x.c0000644000000000000000000002432111270371414012141 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "window.h" #include "image.h" #include "x.h" #include #ifndef ZBAR_OVERLAY_FONT # define ZBAR_OVERLAY_FONT "-*-fixed-medium-r-*-*-*-120-75-75-*-*-ISO8859-1" #endif static inline unsigned long window_alloc_color (zbar_window_t *w, Colormap cmap, unsigned short r, unsigned short g, unsigned short b) { XColor color; color.red = r; color.green = g; color.blue = b; color.flags = 0; XAllocColor(w->display, cmap, &color); return(color.pixel); } static inline int window_alloc_colors (zbar_window_t *w) { window_state_t *x = w->state; Colormap cmap = DefaultColormap(w->display, DefaultScreen(w->display)); int i; for(i = 0; i < 8; i++) x->colors[i] = window_alloc_color(w, cmap, (i & 4) ? (0xcc * 0x101) : 0, (i & 2) ? (0xcc * 0x101) : 0, (i & 1) ? (0xcc * 0x101) : 0); x->logo_colors[0] = window_alloc_color(w, cmap, 0xd709, 0x3333, 0x3333); x->logo_colors[1] = window_alloc_color(w, cmap, 0xa3d6, 0x0000, 0x0000); return(0); } static inline int window_hide_cursor (zbar_window_t *w) { /* FIXME this seems lame...there must be a better way */ Pixmap empty = XCreatePixmap(w->display, w->xwin, 1, 1, 1); GC gc = XCreateGC(w->display, empty, 0, NULL); XDrawPoint(w->display, empty, gc, 0, 0); XColor black; memset(&black, 0, sizeof(black)); int screen = DefaultScreen(w->display); black.pixel = BlackPixel(w->display, screen); Cursor cursor = XCreatePixmapCursor(w->display, empty, empty, &black, &black, 0, 0); XDefineCursor(w->display, w->xwin, cursor); XFreeCursor(w->display, cursor); XFreeGC(w->display, gc); XFreePixmap(w->display, empty); return(0); } int _zbar_window_resize (zbar_window_t *w) { window_state_t *x = w->state; if(!x) return(0); int lbw; if(w->height * 8 / 10 <= w->width) lbw = w->height / 36; else lbw = w->width * 5 / 144; if(lbw < 1) lbw = 1; x->logo_scale = lbw; if(x->logo_zbars) XDestroyRegion(x->logo_zbars); x->logo_zbars = XCreateRegion(); int x0 = w->width / 2; int y0 = w->height / 2; int by0 = y0 - 54 * lbw / 5; int bh = 108 * lbw / 5; static const int bx[5] = { -6, -3, -1, 2, 5 }; static const int bw[5] = { 1, 1, 2, 2, 1 }; int i; for(i = 0; i < 5; i++) { XRectangle *bar = &x->logo_bars[i]; bar->x = x0 + lbw * bx[i]; bar->y = by0; bar->width = lbw * bw[i]; bar->height = bh; XUnionRectWithRegion(bar, x->logo_zbars, x->logo_zbars); } static const int zx[4] = { -7, 7, -7, 7 }; static const int zy[4] = { -8, -8, 8, 8 }; for(i = 0; i < 4; i++) { x->logo_z[i].x = x0 + lbw * zx[i]; x->logo_z[i].y = y0 + lbw * zy[i]; } return(0); } int _zbar_window_attach (zbar_window_t *w, void *display, unsigned long win) { window_state_t *x = w->state; if(w->display) { /* cleanup existing resources */ if(x->gc) XFreeGC(w->display, x->gc); assert(!x->exposed); if(x->font) { XFreeFont(w->display, x->font); x->font = NULL; } if(x->logo_zbars) { XDestroyRegion(x->logo_zbars); x->logo_zbars = NULL; } if(x->exposed) { XDestroyRegion(x->exposed); x->exposed = NULL; } w->display = NULL; } w->xwin = 0; if(!display || !win) { if(x) { free(x); w->state = NULL; } return(0); } if(!x) x = w->state = calloc(1, sizeof(window_state_t)); w->display = display; w->xwin = win; x->gc = XCreateGC(display, win, 0, NULL); XWindowAttributes attr; XGetWindowAttributes(w->display, w->xwin, &attr); w->width = attr.width; w->height = attr.height; _zbar_window_resize(w); window_alloc_colors(w); window_hide_cursor(w); /* load overlay font */ x->font = XLoadQueryFont(w->display, ZBAR_OVERLAY_FONT); if(x->font) XSetFont(w->display, x->gc, x->font->fid); /* FIXME add interface preference override */ #ifdef HAVE_X11_EXTENSIONS_XVLIB_H if(!_zbar_window_probe_xv(w)) return(0); #endif zprintf(1, "falling back to XImage\n"); return(_zbar_window_probe_ximage(w)); } int _zbar_window_expose (zbar_window_t *w, int x, int y, int width, int height) { window_state_t *xs = w->state; if(!xs->exposed) xs->exposed = XCreateRegion(); XRectangle r; r.x = x; r.y = y; r.width = width; r.height = height; XUnionRectWithRegion(&r, xs->exposed, xs->exposed); return(0); } int _zbar_window_begin (zbar_window_t *w) { window_state_t *xs = w->state; if(xs->exposed) XSetRegion(w->display, xs->gc, xs->exposed); return(0); } int _zbar_window_end (zbar_window_t *w) { window_state_t *x = w->state; XSetClipMask(w->display, x->gc, None); if(x->exposed) { XDestroyRegion(x->exposed); x->exposed = NULL; } XFlush(w->display); return(0); } int _zbar_window_clear (zbar_window_t *w) { if(!w->display) return(0); window_state_t *x = w->state; int screen = DefaultScreen(w->display); XSetForeground(w->display, x->gc, WhitePixel(w->display, screen)); XFillRectangle(w->display, w->xwin, x->gc, 0, 0, w->width, w->height); return(0); } int _zbar_window_draw_polygon (zbar_window_t *w, uint32_t rgb, const point_t *pts, int npts) { window_state_t *xs = w->state; XSetForeground(w->display, xs->gc, xs->colors[rgb]); point_t org = w->scaled_offset; XPoint xpts[npts + 1]; int i; for(i = 0; i < npts; i++) { point_t p = window_scale_pt(w, pts[i]); xpts[i].x = p.x + org.x; xpts[i].y = p.y + org.y; } xpts[npts] = xpts[0]; XDrawLines(w->display, w->xwin, xs->gc, xpts, npts + 1, CoordModeOrigin); return(0); } int _zbar_window_draw_marker (zbar_window_t *w, uint32_t rgb, point_t p) { window_state_t *xs = w->state; XSetForeground(w->display, xs->gc, xs->colors[rgb]); XDrawRectangle(w->display, w->xwin, xs->gc, p.x - 2, p.y - 2, 4, 4); XDrawLine(w->display, w->xwin, xs->gc, p.x, p.y - 3, p.x, p.y + 3); XDrawLine(w->display, w->xwin, xs->gc, p.x - 3, p.y, p.x + 3, p.y); return(0); } int _zbar_window_draw_text (zbar_window_t *w, uint32_t rgb, point_t p, const char *text) { window_state_t *xs = w->state; if(!xs->font) return(-1); XSetForeground(w->display, xs->gc, xs->colors[rgb]); int n = 0; while(n < 32 && text[n] && isprint(text[n])) n++; int width = XTextWidth(xs->font, text, n); if(p.x >= 0) p.x -= width / 2; else p.x += w->width - width; int dy = xs->font->ascent + xs->font->descent; if(p.y >= 0) p.y -= dy / 2; else p.y = w->height + p.y * dy * 5 / 4; XDrawString(w->display, w->xwin, xs->gc, p.x, p.y, text, n); return(0); } int _zbar_window_fill_rect (zbar_window_t *w, uint32_t rgb, point_t org, point_t size) { window_state_t *xs = w->state; XSetForeground(w->display, xs->gc, xs->colors[rgb]); XFillRectangle(w->display, w->xwin, xs->gc, org.x, org.y, size.x, size.y); return(0); } int _zbar_window_draw_logo (zbar_window_t *w) { window_state_t *x = w->state; int screen = DefaultScreen(w->display); /* clear to white */ XSetForeground(w->display, x->gc, WhitePixel(w->display, screen)); XFillRectangle(w->display, w->xwin, x->gc, 0, 0, w->width, w->height); if(!x->logo_scale || !x->logo_zbars) return(0); XSetForeground(w->display, x->gc, BlackPixel(w->display, screen)); XFillRectangles(w->display, w->xwin, x->gc, x->logo_bars, 5); XSetLineAttributes(w->display, x->gc, 2 * x->logo_scale, LineSolid, CapRound, JoinRound); XSetForeground(w->display, x->gc, x->logo_colors[0]); XDrawLines(w->display, w->xwin, x->gc, x->logo_z, 4, CoordModeOrigin); if(x->exposed) { XIntersectRegion(x->logo_zbars, x->exposed, x->exposed); XSetRegion(w->display, x->gc, x->exposed); } else XSetRegion(w->display, x->gc, x->logo_zbars); XSetForeground(w->display, x->gc, x->logo_colors[1]); XDrawLines(w->display, w->xwin, x->gc, x->logo_z, 4, CoordModeOrigin); /* reset GC */ XSetLineAttributes(w->display, x->gc, 0, LineSolid, CapButt, JoinMiter); return(0); } zbar-0.10/zbar/window/win.h0000644000000000000000000000274011270371414012475 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _WINDOW_WIN_H_ #define _WINDOW_WIN_H_ #include struct window_state_s { HDC hdc; void* hdd; BITMAPINFOHEADER bih; /* pre-calculated logo geometries */ int logo_scale; HRGN logo_zbars; HPEN logo_zpen, logo_zbpen; POINT logo_z[4]; int font_height; }; extern int _zbar_window_bih_init(zbar_window_t *w, zbar_image_t *img); #endif zbar-0.10/zbar/window/null.c0000644000000000000000000000561411270371414012650 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "window.h" static inline int null_error (void *m, const char *func) { return(err_capture(m, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, func, "not compiled with output window support")); } int _zbar_window_attach (zbar_window_t *w, void *display, unsigned long win) { return(null_error(w, __func__)); } int _zbar_window_expose (zbar_window_t *w, int x, int y, int width, int height) { return(null_error(w, __func__)); } int _zbar_window_resize (zbar_window_t *w) { return(0); } int _zbar_window_clear (zbar_window_t *w) { return(null_error(w, __func__)); } int _zbar_window_begin (zbar_window_t *w) { return(null_error(w, __func__)); } int _zbar_window_end (zbar_window_t *w) { return(null_error(w, __func__)); } int _zbar_window_draw_marker (zbar_window_t *w, uint32_t rgb, point_t p) { return(null_error(w, __func__)); } int _zbar_window_draw_polygon (zbar_window_t *w, uint32_t rgb, const point_t *pts, int npts) { return(null_error(w, __func__)); } int _zbar_window_draw_text (zbar_window_t *w, uint32_t rgb, point_t p, const char *text) { return(null_error(w, __func__)); } int _zbar_window_fill_rect (zbar_window_t *w, uint32_t rgb, point_t org, point_t size) { return(null_error(w, __func__)); } int _zbar_window_draw_logo (zbar_window_t *w) { return(null_error(w, __func__)); } zbar-0.10/zbar/event.h0000644000000000000000000000332611270371414011513 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _ZBAR_EVENT_H_ #define _ZBAR_EVENT_H_ #include #include "mutex.h" #include "timer.h" /* platform synchronization "event" abstraction */ #if defined(_WIN32) # include typedef HANDLE zbar_event_t; #else # ifdef HAVE_LIBPTHREAD # include # endif typedef struct zbar_event_s { int state; # ifdef HAVE_LIBPTHREAD pthread_cond_t cond; # endif int pollfd; } zbar_event_t; #endif extern int _zbar_event_init(zbar_event_t*); extern void _zbar_event_destroy(zbar_event_t*); extern void _zbar_event_trigger(zbar_event_t*); extern int _zbar_event_wait(zbar_event_t*, zbar_mutex_t*, zbar_timer_t*); #endif zbar-0.10/zbar/svg.h0000644000000000000000000000407011270371414011166 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _SVG_H_ #define _SVG_H_ #ifdef DEBUG_SVG typedef enum { SVG_REL, SVG_ABS } svg_absrel_t; void svg_open(const char *name, double x, double y, double w, double h); void svg_close(void); void svg_commentf(const char *format, ...); void svg_image(const char *name, double width, double height); void svg_group_start(const char *cls, double rotate, double scalex, double scaley, double x, double y); void svg_group_end(void); void svg_path_start(const char *cls, double scale, double x, double y); void svg_path_end(void); void svg_path_close(void); void svg_path_moveto(svg_absrel_t abs, double x, double y); void svg_path_lineto(svg_absrel_t abs, double x, double y); #else # define svg_open(...) # define svg_close(...) # define svg_image(...) # define svg_group_start(...) # define svg_group_end(...) # define svg_path_start(...) # define svg_path_end(...) # define svg_path_moveto(...) # define svg_path_lineto(...) # define svg_path_close(...) #endif #endif zbar-0.10/zbar/mutex.h0000644000000000000000000000714611270371414011540 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _ZBAR_MUTEX_H_ #define _ZBAR_MUTEX_H_ #include /* simple platform mutex abstraction */ #if defined(_WIN32) # include # define DEBUG_LOCKS # ifdef DEBUG_LOCKS typedef struct zbar_mutex_s { int count; CRITICAL_SECTION mutex; } zbar_mutex_t; static inline int _zbar_mutex_init (zbar_mutex_t *lock) { lock->count = 1; InitializeCriticalSection(&lock->mutex); return(0); } static inline void _zbar_mutex_destroy (zbar_mutex_t *lock) { DeleteCriticalSection(&lock->mutex); } static inline int _zbar_mutex_lock (zbar_mutex_t *lock) { EnterCriticalSection(&lock->mutex); if(lock->count++ < 1) assert(0); return(0); } static inline int _zbar_mutex_unlock (zbar_mutex_t *lock) { if(lock->count-- <= 1) assert(0); LeaveCriticalSection(&lock->mutex); return(0); } # else typedef CRITICAL_SECTION zbar_mutex_t; static inline int _zbar_mutex_init (zbar_mutex_t *lock) { InitializeCriticalSection(lock); return(0); } static inline void _zbar_mutex_destroy (zbar_mutex_t *lock) { DeleteCriticalSection(lock); } static inline int _zbar_mutex_lock (zbar_mutex_t *lock) { EnterCriticalSection(lock); return(0); } static inline int _zbar_mutex_unlock (zbar_mutex_t *lock) { LeaveCriticalSection(lock); return(0); } # endif #elif defined(HAVE_LIBPTHREAD) # include typedef pthread_mutex_t zbar_mutex_t; static inline int _zbar_mutex_init (zbar_mutex_t *lock) { # ifdef DEBUG_LOCKS pthread_mutexattr_t attr; pthread_mutexattr_init(&attr); pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_ERRORCHECK); int rc = pthread_mutex_init(lock, &attr); pthread_mutexattr_destroy(&attr); return(rc); # else return(pthread_mutex_init(lock, NULL)); # endif } static inline void _zbar_mutex_destroy (zbar_mutex_t *lock) { pthread_mutex_destroy(lock); } static inline int _zbar_mutex_lock (zbar_mutex_t *lock) { int rc = pthread_mutex_lock(lock); # ifdef DEBUG_LOCKS assert(!rc); # endif /* FIXME save system code */ /*rc = err_capture(proc, SEV_ERROR, ZBAR_ERR_LOCKING, __func__, "unable to lock processor");*/ return(rc); } static inline int _zbar_mutex_unlock (zbar_mutex_t *lock) { int rc = pthread_mutex_unlock(lock); # ifdef DEBUG_LOCKS assert(!rc); # endif /* FIXME save system code */ return(rc); } #else typedef int zbar_mutex_t[0]; #define _zbar_mutex_init(l) -1 #define _zbar_mutex_destroy(l) #define _zbar_mutex_lock(l) 0 #define _zbar_mutex_unlock(l) 0 #endif #endif zbar-0.10/zbar/libzbar.rc0000644000000000000000000000203011270371414012163 00000000000000#include #include #define STR(s) #s #define XSTR(s) STR(s) VS_VERSION_INFO VERSIONINFO FILEVERSION LIB_VERSION_MAJOR, LIB_VERSION_MINOR, LIB_VERSION_REVISION, 0 PRODUCTVERSION ZBAR_VERSION_MAJOR, ZBAR_VERSION_MINOR, 0, 0 FILEOS VOS__WINDOWS32 FILETYPE VFT_DLL { BLOCK "StringFileInfo" { BLOCK "040904E4" { VALUE "ProductName", "ZBar Bar Code Reader" VALUE "Company Name", "ZBar Bar Code Reader" VALUE "InternalName", "libzbar" VALUE "OriginalFilename", "libzbar-" XSTR(LIB_VERSION_MAJOR) ".dll" VALUE "FileVersion", XSTR(LIB_VERSION_MAJOR) "." \ XSTR(LIB_VERSION_MINOR) "." XSTR(LIB_VERSION_REVISION) VALUE "ProductVersion", PACKAGE_VERSION VALUE "FileDescription", "Bar code reader library" VALUE "LegalCopyright", "Copyright 2007-2009 (c) Jeff Brown " } } BLOCK "VarFileInfo" { VALUE "Translation", 0x0409, 0x04e4 } } zbar-0.10/zbar/image.c0000644000000000000000000001715511270371414011454 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "error.h" #include "image.h" #include "refcnt.h" zbar_image_t *zbar_image_create () { zbar_image_t *img = calloc(1, sizeof(zbar_image_t)); _zbar_refcnt_init(); _zbar_image_refcnt(img, 1); img->srcidx = -1; return(img); } void _zbar_image_free (zbar_image_t *img) { if(img->syms) { zbar_symbol_set_ref(img->syms, -1); img->syms = NULL; } free(img); } void zbar_image_destroy (zbar_image_t *img) { _zbar_image_refcnt(img, -1); } void zbar_image_ref (zbar_image_t *img, int refs) { _zbar_image_refcnt(img, refs); } unsigned long zbar_image_get_format (const zbar_image_t *img) { return(img->format); } unsigned zbar_image_get_sequence (const zbar_image_t *img) { return(img->seq); } unsigned zbar_image_get_width (const zbar_image_t *img) { return(img->width); } unsigned zbar_image_get_height (const zbar_image_t *img) { return(img->height); } const void *zbar_image_get_data (const zbar_image_t *img) { return(img->data); } unsigned long zbar_image_get_data_length (const zbar_image_t *img) { return(img->datalen); } void zbar_image_set_format (zbar_image_t *img, unsigned long fmt) { img->format = fmt; } void zbar_image_set_sequence (zbar_image_t *img, unsigned seq) { img->seq = seq; } void zbar_image_set_size (zbar_image_t *img, unsigned w, unsigned h) { img->width = w; img->height = h; } inline void zbar_image_free_data (zbar_image_t *img) { if(!img) return; if(img->src) { /* replace video image w/new copy */ assert(img->refcnt); /* FIXME needs lock */ zbar_image_t *newimg = zbar_image_create(); memcpy(newimg, img, sizeof(zbar_image_t)); /* recycle video image */ newimg->cleanup(newimg); /* detach old image from src */ img->cleanup = NULL; img->src = NULL; img->srcidx = -1; } else if(img->cleanup && img->data) { if(img->cleanup != zbar_image_free_data) { /* using function address to detect this case is a bad idea; * windows link libraries add an extra layer of indirection... * this works around that problem (bug #2796277) */ zbar_image_cleanup_handler_t *cleanup = img->cleanup; img->cleanup = zbar_image_free_data; cleanup(img); } else free((void*)img->data); } img->data = NULL; } void zbar_image_set_data (zbar_image_t *img, const void *data, unsigned long len, zbar_image_cleanup_handler_t *cleanup) { zbar_image_free_data(img); img->data = data; img->datalen = len; img->cleanup = cleanup; } void zbar_image_set_userdata (zbar_image_t *img, void *userdata) { img->userdata = userdata; } void *zbar_image_get_userdata (const zbar_image_t *img) { return(img->userdata); } zbar_image_t *zbar_image_copy (const zbar_image_t *src) { zbar_image_t *dst = zbar_image_create(); dst->format = src->format; dst->width = src->width; dst->height = src->height; dst->datalen = src->datalen; dst->data = malloc(src->datalen); assert(dst->data); memcpy((void*)dst->data, src->data, src->datalen); dst->cleanup = zbar_image_free_data; return(dst); } const zbar_symbol_set_t *zbar_image_get_symbols (const zbar_image_t *img) { return(img->syms); } void zbar_image_set_symbols (zbar_image_t *img, const zbar_symbol_set_t *syms) { if(img->syms) zbar_symbol_set_ref(img->syms, -1); img->syms = (zbar_symbol_set_t*)syms; if(syms) zbar_symbol_set_ref(img->syms, 1); } const zbar_symbol_t *zbar_image_first_symbol (const zbar_image_t *img) { return((img->syms) ? img->syms->head : NULL); } typedef struct zimg_hdr_s { uint32_t magic, format; uint16_t width, height; uint32_t size; } zimg_hdr_t; int zbar_image_write (const zbar_image_t *img, const char *filebase) { int len = strlen(filebase) + 16; char filename[len]; strcpy(filename, filebase); int n = 0; if(*(char*)&img->format >= ' ') n = snprintf(filename, len, "%s.%.4s.zimg", filebase, (char*)&img->format); else n = snprintf(filename, len, "%s.%08" PRIx32 ".zimg", filebase, img->format); assert(n < len); filename[len] = '\0'; zprintf(1, "dumping %.4s(%08" PRIx32 ") image to %s\n", (char*)&img->format, img->format, filename); FILE *f = fopen(filename, "w"); if(!f) { int rc = errno; zprintf(1, "ERROR opening %s: %s\n", filename, strerror(rc)); return(rc); } zimg_hdr_t hdr; hdr.magic = 0x676d697a; hdr.format = img->format; hdr.width = img->width; hdr.height = img->height; hdr.size = img->datalen; if(fwrite(&hdr, sizeof(hdr), 1, f) != 1 || fwrite(img->data, 1, img->datalen, f) != img->datalen) { int rc = errno; zprintf(1, "ERROR writing %s: %s\n", filename, strerror(rc)); fclose(f); return(rc); } return(fclose(f)); } #ifdef DEBUG_SVG # include int zbar_image_write_png (const zbar_image_t *img, const char *filename) { int rc = -1; FILE *file = NULL; png_struct *png = NULL; png_info *info = NULL; const uint8_t **rows = NULL; rows = malloc(img->height * sizeof(*rows)); if(!rows) goto done; rows[0] = img->data; int y; for(y = 1; y < img->height; y++) rows[y] = rows[y - 1] + img->width; file = fopen(filename, "wb"); if(!file) goto done; png = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if(!png) goto done; info = png_create_info_struct(png); if(!info) goto done; if(setjmp(png_jmpbuf(png))) goto done; png_init_io(png, file); png_set_compression_level(png, 9); png_set_IHDR(png, info, img->width, img->height, 8, PNG_COLOR_TYPE_GRAY, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); png_set_rows(png, info, (void*)rows); png_write_png(png, info, PNG_TRANSFORM_IDENTITY, NULL); png_write_end(png,info); rc = 0; done: if(png) png_destroy_write_struct(&png, &info); if(rows) free(rows); if(file) fclose(file); return(rc); } #endif zbar-0.10/zbar/symbol.h0000644000000000000000000000632011270371414011674 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _SYMBOL_H_ #define _SYMBOL_H_ #include #include #include "refcnt.h" typedef struct point_s { int x, y; } point_t; struct zbar_symbol_set_s { refcnt_t refcnt; int nsyms; /* number of filtered symbols */ zbar_symbol_t *head; /* first of decoded symbol results */ zbar_symbol_t *tail; /* last of unfiltered symbol results */ }; struct zbar_symbol_s { zbar_symbol_type_t type; /* symbol type */ unsigned int data_alloc; /* allocation size of data */ unsigned int datalen; /* length of binary symbol data */ char *data; /* symbol data */ unsigned pts_alloc; /* allocation size of pts */ unsigned npts; /* number of points in location polygon */ point_t *pts; /* list of points in location polygon */ refcnt_t refcnt; /* reference count */ zbar_symbol_t *next; /* linked list of results (or siblings) */ zbar_symbol_set_t *syms; /* components of composite result */ unsigned long time; /* relative symbol capture time */ int cache_count; /* cache state */ int quality; /* relative symbol reliability metric */ }; extern void _zbar_symbol_free(zbar_symbol_t*); extern zbar_symbol_set_t *_zbar_symbol_set_create(void); extern void _zbar_symbol_set_free(zbar_symbol_set_t*); static inline void sym_add_point (zbar_symbol_t *sym, int x, int y) { int i = sym->npts; if(++sym->npts >= sym->pts_alloc) sym->pts = realloc(sym->pts, ++sym->pts_alloc * sizeof(point_t)); sym->pts[i].x = x; sym->pts[i].y = y; } static inline void _zbar_symbol_refcnt (zbar_symbol_t *sym, int delta) { if(!_zbar_refcnt(&sym->refcnt, delta) && delta <= 0) _zbar_symbol_free(sym); } static inline void _zbar_symbol_set_add (zbar_symbol_set_t *syms, zbar_symbol_t *sym) { sym->next = syms->head; syms->head = sym; syms->nsyms++; _zbar_symbol_refcnt(sym, 1); } #endif zbar-0.10/zbar/error.h0000644000000000000000000001537711270371414011534 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _ERROR_H_ #define _ERROR_H_ #include #ifdef HAVE_INTTYPES_H # include #endif #include #include #include #include #include #include #ifdef _WIN32 # include #endif #if __STDC_VERSION__ < 199901L # if __GNUC__ >= 2 # define __func__ __FUNCTION__ # else # define __func__ "" # endif #endif #define ERRINFO_MAGIC (0x5252457a) /* "zERR" (LE) */ typedef enum errsev_e { SEV_FATAL = -2, /* application must terminate */ SEV_ERROR = -1, /* might be able to recover and continue */ SEV_OK = 0, SEV_WARNING = 1, /* unexpected condition */ SEV_NOTE = 2, /* fyi */ } errsev_t; typedef enum errmodule_e { ZBAR_MOD_PROCESSOR, ZBAR_MOD_VIDEO, ZBAR_MOD_WINDOW, ZBAR_MOD_IMAGE_SCANNER, ZBAR_MOD_UNKNOWN, } errmodule_t; typedef struct errinfo_s { uint32_t magic; /* just in case */ errmodule_t module; /* reporting module */ char *buf; /* formatted and passed to application */ int errnum; /* errno for system errors */ errsev_t sev; zbar_error_t type; const char *func; /* reporting function */ const char *detail; /* description */ char *arg_str; /* single string argument */ int arg_int; /* single integer argument */ } errinfo_t; extern int _zbar_verbosity; /* FIXME don't we need varargs hacks here? */ #ifdef _WIN32 # define ZFLUSH fflush(stderr); #else # define ZFLUSH #endif #ifdef ZNO_MESSAGES # ifdef __GNUC__ /* older versions of gcc (< 2.95) require a named varargs parameter */ # define zprintf(args...) # else /* unfortunately named vararg parameter is a gcc-specific extension */ # define zprintf(...) # endif #else # ifdef __GNUC__ # define zprintf(level, format, args...) do { \ if(_zbar_verbosity >= level) { \ fprintf(stderr, "%s: " format, __func__ , ##args); \ ZFLUSH \ } \ } while(0) # else # define zprintf(level, format, ...) do { \ if(_zbar_verbosity >= level) { \ fprintf(stderr, "%s: " format, __func__ , ##__VA_ARGS__); \ ZFLUSH \ } \ } while(0) # endif #endif static inline int err_copy (void *dst_c, void *src_c) { errinfo_t *dst = dst_c; errinfo_t *src = src_c; assert(dst->magic == ERRINFO_MAGIC); assert(src->magic == ERRINFO_MAGIC); dst->errnum = src->errnum; dst->sev = src->sev; dst->type = src->type; dst->func = src->func; dst->detail = src->detail; dst->arg_str = src->arg_str; src->arg_str = NULL; /* unused at src, avoid double free */ dst->arg_int = src->arg_int; return(-1); } static inline int err_capture (const void *container, errsev_t sev, zbar_error_t type, const char *func, const char *detail) { errinfo_t *err = (errinfo_t*)container; assert(err->magic == ERRINFO_MAGIC); if(type == ZBAR_ERR_SYSTEM) err->errnum = errno; #ifdef _WIN32 else if(type == ZBAR_ERR_WINAPI) err->errnum = GetLastError(); #endif err->sev = sev; err->type = type; err->func = func; err->detail = detail; if(_zbar_verbosity >= 1) _zbar_error_spew(err, 0); return(-1); } static inline int err_capture_str (const void *container, errsev_t sev, zbar_error_t type, const char *func, const char *detail, const char *arg) { errinfo_t *err = (errinfo_t*)container; assert(err->magic == ERRINFO_MAGIC); if(err->arg_str) free(err->arg_str); err->arg_str = strdup(arg); return(err_capture(container, sev, type, func, detail)); } static inline int err_capture_int (const void *container, errsev_t sev, zbar_error_t type, const char *func, const char *detail, int arg) { errinfo_t *err = (errinfo_t*)container; assert(err->magic == ERRINFO_MAGIC); err->arg_int = arg; return(err_capture(container, sev, type, func, detail)); } static inline int err_capture_num (const void *container, errsev_t sev, zbar_error_t type, const char *func, const char *detail, int num) { errinfo_t *err = (errinfo_t*)container; assert(err->magic == ERRINFO_MAGIC); err->errnum = num; return(err_capture(container, sev, type, func, detail)); } static inline void err_init (errinfo_t *err, errmodule_t module) { err->magic = ERRINFO_MAGIC; err->module = module; } static inline void err_cleanup (errinfo_t *err) { assert(err->magic == ERRINFO_MAGIC); if(err->buf) { free(err->buf); err->buf = NULL; } if(err->arg_str) { free(err->arg_str); err->arg_str = NULL; } } #endif zbar-0.10/zbar/jpeg.c0000644000000000000000000001505411270371414011313 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include #include #include /* FIXME tmp debug */ #undef HAVE_STDLIB_H #include #include "image.h" #include "video.h" #define HAVE_LONGJMP #ifdef HAVE_LONGJMP typedef struct errenv_s { struct jpeg_error_mgr err; int valid; jmp_buf env; } errenv_t; void zbar_jpeg_error (j_common_ptr cinfo) { errenv_t *jerr = (errenv_t*)cinfo->err; assert(jerr->valid); jerr->valid = 0; longjmp(jerr->env, 1); assert(0); } #endif typedef struct zbar_src_mgr_s { struct jpeg_source_mgr src; const zbar_image_t *img; } zbar_src_mgr_t; static const JOCTET fake_eoi[2] = { 0xff, JPEG_EOI }; void init_source (j_decompress_ptr cinfo) { /* buffer/length refer to compressed data */ /* FIXME find img */ const zbar_image_t *img = ((zbar_src_mgr_t*)cinfo->src)->img; cinfo->src->next_input_byte = img->data; cinfo->src->bytes_in_buffer = img->datalen; } int fill_input_buffer (j_decompress_ptr cinfo) { /* buffer underrun error case */ cinfo->src->next_input_byte = fake_eoi; cinfo->src->bytes_in_buffer = 2; return(1); } void skip_input_data (j_decompress_ptr cinfo, long num_bytes) { cinfo->src->next_input_byte = NULL; cinfo->src->bytes_in_buffer = 0; } void term_source (j_decompress_ptr cinfo) { /* nothing todo */ } struct jpeg_decompress_struct * _zbar_jpeg_decomp_create (void) { j_decompress_ptr cinfo = calloc(1, sizeof(struct jpeg_decompress_struct)); if(!cinfo) return(NULL); errenv_t *jerr = calloc(1, sizeof(errenv_t)); if(!jerr) { free(cinfo); return(NULL); } cinfo->err = jpeg_std_error(&jerr->err); jerr->err.error_exit = zbar_jpeg_error; jerr->valid = 1; if(setjmp(jerr->env)) { jpeg_destroy_decompress(cinfo); /* FIXME TBD save error to errinfo_t */ (*cinfo->err->output_message)((j_common_ptr)cinfo); free(jerr); free(cinfo); return(NULL); } jpeg_create_decompress(cinfo); jerr->valid = 0; return(cinfo); } void _zbar_jpeg_decomp_destroy (struct jpeg_decompress_struct *cinfo) { if(cinfo->err) { free(cinfo->err); cinfo->err = NULL; } if(cinfo->src) { free(cinfo->src); cinfo->src = NULL; } /* FIXME can this error? */ jpeg_destroy_decompress(cinfo); free(cinfo); } /* invoke libjpeg to decompress JPEG format to luminance plane */ void _zbar_convert_jpeg_to_y (zbar_image_t *dst, const zbar_format_def_t *dstfmt, const zbar_image_t *src, const zbar_format_def_t *srcfmt) { /* create decompressor, or use cached video stream decompressor */ errenv_t *jerr = NULL; j_decompress_ptr cinfo; if(!src->src) cinfo = _zbar_jpeg_decomp_create(); else { cinfo = src->src->jpeg; assert(cinfo); } if(!cinfo) goto error; jerr = (errenv_t*)cinfo->err; jerr->valid = 1; if(setjmp(jerr->env)) { /* FIXME TBD save error to src->src->err */ (*cinfo->err->output_message)((j_common_ptr)cinfo); if(dst->data) { free((void*)dst->data); dst->data = NULL; } dst->datalen = 0; goto error; } /* setup input image */ if(!cinfo->src) { cinfo->src = calloc(1, sizeof(zbar_src_mgr_t)); cinfo->src->init_source = init_source; cinfo->src->fill_input_buffer = fill_input_buffer; cinfo->src->skip_input_data = skip_input_data; cinfo->src->resync_to_restart = jpeg_resync_to_restart; cinfo->src->term_source = term_source; } cinfo->src->next_input_byte = NULL; cinfo->src->bytes_in_buffer = 0; ((zbar_src_mgr_t*)cinfo->src)->img = src; int rc = jpeg_read_header(cinfo, TRUE); zprintf(30, "header: %s\n", (rc == 2) ? "tables-only" : "normal"); /* supporting color with jpeg became...complicated, * so we skip that for now */ cinfo->out_color_space = JCS_GRAYSCALE; /* FIXME set scaling based on dst->{width,height} * then pass bigger buffer... */ jpeg_start_decompress(cinfo); /* adjust dst image parameters to match(?) decompressor */ if(dst->width < cinfo->output_width) dst->width = cinfo->output_width; if(dst->height < cinfo->output_height) dst->height = cinfo->output_height; unsigned long datalen = (cinfo->output_width * cinfo->output_height * cinfo->out_color_components); zprintf(24, "dst=%dx%d %lx src=%dx%d %lx dct=%x\n", dst->width, dst->height, dst->datalen, src->width, src->height, src->datalen, cinfo->dct_method); if(!dst->data) { dst->datalen = datalen; dst->data = malloc(dst->datalen); dst->cleanup = zbar_image_free_data; } else assert(datalen <= dst->datalen); if(!dst->data) return; unsigned bpl = dst->width * cinfo->output_components; JSAMPROW buf = (void*)dst->data; JSAMPARRAY line = &buf; for(; cinfo->output_scanline < cinfo->output_height; buf += bpl) { jpeg_read_scanlines(cinfo, line, 1); /* FIXME pad out to dst->width */ } /* FIXME always do this? */ jpeg_finish_decompress(cinfo); error: if(jerr) jerr->valid = 0; if(!src->src && cinfo) /* cleanup only if we allocated locally */ _zbar_jpeg_decomp_destroy(cinfo); } zbar-0.10/zbar/decoder.h0000644000000000000000000001437011270371414012000 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _DECODER_H_ #define _DECODER_H_ #include #include /* realloc */ #include #define NUM_CFGS (ZBAR_CFG_MAX_LEN - ZBAR_CFG_MIN_LEN + 1) #ifdef ENABLE_EAN # include "decoder/ean.h" #endif #ifdef ENABLE_I25 # include "decoder/i25.h" #endif #ifdef ENABLE_CODE39 # include "decoder/code39.h" #endif #ifdef ENABLE_CODE128 # include "decoder/code128.h" #endif #ifdef ENABLE_PDF417 # include "decoder/pdf417.h" #endif #ifdef ENABLE_QRCODE # include "decoder/qr_finder.h" #endif /* size of bar width history (implementation assumes power of two) */ #ifndef DECODE_WINDOW # define DECODE_WINDOW 16 #endif /* initial data buffer allocation */ #ifndef BUFFER_MIN # define BUFFER_MIN 0x20 #endif /* maximum data buffer allocation * (longer symbols are rejected) */ #ifndef BUFFER_MAX # define BUFFER_MAX 0x100 #endif /* buffer allocation increment */ #ifndef BUFFER_INCR # define BUFFER_INCR 0x10 #endif #define CFG(dcode, cfg) ((dcode).configs[(cfg) - ZBAR_CFG_MIN_LEN]) #define TEST_CFG(config, cfg) (((config) >> (cfg)) & 1) /* symbology independent decoder state */ struct zbar_decoder_s { unsigned char idx; /* current width index */ unsigned w[DECODE_WINDOW]; /* window of last N bar widths */ zbar_symbol_type_t type; /* type of last decoded data */ zbar_symbol_type_t lock; /* buffer lock */ /* everything above here is automatically reset */ unsigned buf_alloc; /* dynamic buffer allocation */ unsigned buflen; /* binary data length */ unsigned char *buf; /* decoded characters */ void *userdata; /* application data */ zbar_decoder_handler_t *handler; /* application callback */ /* symbology specific state */ #ifdef ENABLE_EAN ean_decoder_t ean; /* EAN/UPC parallel decode attempts */ #endif #ifdef ENABLE_I25 i25_decoder_t i25; /* Interleaved 2 of 5 decode state */ #endif #ifdef ENABLE_CODE39 code39_decoder_t code39; /* Code 39 decode state */ #endif #ifdef ENABLE_CODE128 code128_decoder_t code128; /* Code 128 decode state */ #endif #ifdef ENABLE_PDF417 pdf417_decoder_t pdf417; /* PDF417 decode state */ #endif #ifdef ENABLE_QRCODE qr_finder_t qrf; /* QR Code finder state */ #endif }; /* return current element color */ static inline char get_color (const zbar_decoder_t *dcode) { return(dcode->idx & 1); } /* retrieve i-th previous element width */ static inline unsigned get_width (const zbar_decoder_t *dcode, unsigned char offset) { return(dcode->w[(dcode->idx - offset) & (DECODE_WINDOW - 1)]); } /* retrieve bar+space pair width starting at offset i */ static inline unsigned pair_width (const zbar_decoder_t *dcode, unsigned char offset) { return(get_width(dcode, offset) + get_width(dcode, offset + 1)); } /* calculate total character width "s" * - start of character identified by context sensitive offset * (<= DECODE_WINDOW - n) * - size of character is n elements */ static inline unsigned calc_s (const zbar_decoder_t *dcode, unsigned char offset, unsigned char n) { /* FIXME check that this gets unrolled for constant n */ unsigned s = 0; while(n--) s += get_width(dcode, offset++); return(s); } /* fixed character width decode assist * bar+space width are compared as a fraction of the reference dimension "x" * - +/- 1/2 x tolerance * - measured total character width (s) compared to symbology baseline (n) * (n = 7 for EAN/UPC, 11 for Code 128) * - bar+space *pair width* "e" is used to factor out bad "exposures" * ("blooming" or "swelling" of dark or light areas) * => using like-edge measurements avoids these issues * - n should be > 3 */ static inline int decode_e (unsigned e, unsigned s, unsigned n) { /* result is encoded number of units - 2 * (for use as zero based index) * or -1 if invalid */ unsigned char E = ((e * n * 2 + 1) / s - 3) / 2; return((E >= n - 3) ? -1 : E); } /* acquire shared state lock */ static inline char get_lock (zbar_decoder_t *dcode, zbar_symbol_type_t req) { if(dcode->lock) return(1); dcode->lock = req; return(0); } /* ensure output buffer has sufficient allocation for request */ static inline char size_buf (zbar_decoder_t *dcode, unsigned len) { if(len < dcode->buf_alloc) /* FIXME size reduction heuristic? */ return(0); if(len > BUFFER_MAX) return(1); if(len < dcode->buf_alloc + BUFFER_INCR) { len = dcode->buf_alloc + BUFFER_INCR; if(len > BUFFER_MAX) len = BUFFER_MAX; } unsigned char *buf = realloc(dcode->buf, len); if(!buf) return(1); dcode->buf = buf; dcode->buf_alloc = len; return(0); } extern const char *_zbar_decoder_buf_dump (unsigned char *buf, unsigned int buflen); #endif zbar-0.10/zbar/qrcode.h0000644000000000000000000000503711270371414011650 00000000000000/*Copyright (C) 2008-2009 Timothy B. Terriberry (tterribe@xiph.org) You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version.*/ #ifndef _QRCODE_H_ #define _QRCODE_H_ #include typedef struct qr_reader qr_reader; typedef int qr_point[2]; typedef struct qr_finder_line qr_finder_line; /*The number of bits of subpel precision to store image coordinates in. This helps when estimating positions in low-resolution images, which may have a module pitch only a pixel or two wide, making rounding errors matter a great deal.*/ #define QR_FINDER_SUBPREC (2) /*A line crossing a finder pattern. Whether the line is horizontal or vertical is determined by context. The offsts to various parts of the finder pattern are as follows: |*****| |*****|*****|*****| |*****| |*****| |*****|*****|*****| |*****| ^ ^ ^ ^ | | | | | | | pos[v]+len+eoffs | | pos[v]+len | pos[v] pos[v]-boffs Here v is 0 for horizontal and 1 for vertical lines.*/ struct qr_finder_line { /*The location of the upper/left endpoint of the line. The left/upper edge of the center section is used, since other lines must cross in this region.*/ qr_point pos; /*The length of the center section. This extends to the right/bottom of the center section, since other lines must cross in this region.*/ int len; /*The offset to the midpoint of the upper/left section (part of the outside ring), or 0 if we couldn't identify the edge of the beginning section. We use the midpoint instead of the edge because it can be located more reliably.*/ int boffs; /*The offset to the midpoint of the end section (part of the outside ring), or 0 if we couldn't identify the edge of the end section. We use the midpoint instead of the edge because it can be located more reliably.*/ int eoffs; }; qr_reader *_zbar_qr_create(void); void _zbar_qr_destroy(qr_reader *reader); void _zbar_qr_reset(qr_reader *reader); int _zbar_qr_found_line(qr_reader *reader, int direction, const qr_finder_line *line); int _zbar_qr_decode(qr_reader *reader, zbar_image_scanner_t *iscn, zbar_image_t *img); #endif zbar-0.10/zbar/svg.c0000644000000000000000000001343411270371414011165 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include #include "svg.h" static const char svg_head[] = "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n" "\n"; static FILE *svg = NULL; void svg_open (const char *name, double x, double y, double w, double h) { svg = fopen(name, "w"); if(!svg) return; /* FIXME calc scaled size */ fprintf(svg, svg_head, x, y, w, h); } void svg_close () { if(!svg) return; fprintf(svg, "\n"); fclose(svg); svg = NULL; } void svg_commentf (const char *format, ...) { if(!svg) return; fprintf(svg, "\n"); } void svg_image (const char *name, double width, double height) { if(!svg) return; fprintf(svg, "\n", width, height, name); } void svg_group_start (const char *cls, double deg, double sx, double sy, double x, double y) { if(!svg) return; fprintf(svg, "\n"); } void svg_group_end () { fprintf(svg, "\n"); } void svg_path_start (const char *cls, double scale, double x, double y) { if(!svg) return; fprintf(svg, "\n"); } void svg_path_close () { if(!svg) return; fprintf(svg, "z"); } void svg_path_moveto (svg_absrel_t abs, double x, double y) { if(!svg) return; fprintf(svg, " %c%g,%g", (abs) ? 'M' : 'm', x, y); } void svg_path_lineto(svg_absrel_t abs, double x, double y) { if(!svg) return; if(x && y) fprintf(svg, "%c%g,%g", (abs) ? 'L' : 'l', x, y); else if(x) fprintf(svg, "%c%g", (abs) ? 'H' : 'h', x); else if(y) fprintf(svg, "%c%g", (abs) ? 'V' : 'v', y); } zbar-0.10/zbar/img_scanner.h0000644000000000000000000000320411270371414012652 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _IMG_SCANNER_H_ #define _IMG_SCANNER_H_ #include /* internal image scanner APIs for 2D readers */ extern zbar_symbol_t *_zbar_image_scanner_alloc_sym(zbar_image_scanner_t*, zbar_symbol_type_t, int); extern void _zbar_image_scanner_add_sym(zbar_image_scanner_t*, zbar_symbol_t*); extern void _zbar_image_scanner_recycle_syms(zbar_image_scanner_t*, zbar_symbol_t*); #endif zbar-0.10/zbar/timer.h0000644000000000000000000000664311270371414011517 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _ZBAR_TIMER_H_ #define _ZBAR_TIMER_H_ #include #include /* gettimeofday */ /* platform timer abstraction * * zbar_timer_t stores the absolute expiration of a delay from * when the timer was initialized. * * _zbar_timer_init() initialized timer with specified ms delay. * returns timer or NULL if timeout < 0 (no/infinite timeout) * _zbar_timer_check() returns ms remaining until expiration. * will be <= 0 if timer has expired */ #if _POSIX_TIMERS > 0 typedef struct timespec zbar_timer_t; static inline zbar_timer_t *_zbar_timer_init (zbar_timer_t *timer, int delay) { if(delay < 0) return(NULL); clock_gettime(CLOCK_REALTIME, timer); timer->tv_nsec += (delay % 1000) * 1000000; timer->tv_sec += (delay / 1000) + (timer->tv_nsec / 1000000000); timer->tv_nsec %= 1000000000; return(timer); } static inline int _zbar_timer_check (zbar_timer_t *timer) { if(!timer) return(-1); struct timespec now; clock_gettime(CLOCK_REALTIME, &now); int delay = ((timer->tv_sec - now.tv_sec) * 1000 + (timer->tv_nsec - now.tv_nsec) / 1000000); return((delay >= 0) ? delay : 0); } #elif defined(_WIN32) # include typedef DWORD zbar_timer_t; static inline zbar_timer_t *_zbar_timer_init (zbar_timer_t *timer, int delay) { if(delay < 0) return(NULL); *timer = timeGetTime() + delay; return(timer); } static inline int _zbar_timer_check (zbar_timer_t *timer) { if(!timer) return(INFINITE); int delay = *timer - timeGetTime(); return((delay >= 0) ? delay : 0); } #else typedef struct timeval zbar_timer_t; static inline zbar_timer_t *_zbar_timer_init (zbar_timer_t *timer, int delay) { if(delay < 0) return(NULL); gettimeofday(timer, NULL); timer->tv_usec += (delay % 1000) * 1000; timer->tv_sec += (delay / 1000) + (timer->tv_usec / 1000000); timer->tv_usec %= 1000000; return(timer); } static inline int _zbar_timer_check (zbar_timer_t *timer) { if(!timer) return(-1); struct timeval now; gettimeofday(&now, NULL); return((timer->tv_sec - now.tv_sec) * 1000 + (timer->tv_usec - now.tv_usec) / 1000); } #endif #endif zbar-0.10/zbar/symbol.c0000644000000000000000000001377111270371414011677 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include #include #include #include "symbol.h" const char *zbar_get_symbol_name (zbar_symbol_type_t sym) { switch(sym & ZBAR_SYMBOL) { case ZBAR_EAN8: return("EAN-8"); case ZBAR_UPCE: return("UPC-E"); case ZBAR_ISBN10: return("ISBN-10"); case ZBAR_UPCA: return("UPC-A"); case ZBAR_EAN13: return("EAN-13"); case ZBAR_ISBN13: return("ISBN-13"); case ZBAR_I25: return("I2/5"); case ZBAR_CODE39: return("CODE-39"); case ZBAR_CODE128: return("CODE-128"); case ZBAR_PDF417: return("PDF417"); case ZBAR_QRCODE: return("QR-Code"); default: return("UNKNOWN"); } } const char *zbar_get_addon_name (zbar_symbol_type_t sym) { switch(sym & ZBAR_ADDON) { case ZBAR_ADDON2: return("+2"); case ZBAR_ADDON5: return("+5"); default: return(""); } } void _zbar_symbol_free (zbar_symbol_t *sym) { if(sym->syms) { zbar_symbol_set_ref(sym->syms, -1); sym->syms = NULL; } if(sym->pts) free(sym->pts); if(sym->data_alloc && sym->data) free(sym->data); free(sym); } void zbar_symbol_ref (const zbar_symbol_t *sym, int refs) { zbar_symbol_t *ncsym = (zbar_symbol_t*)sym; _zbar_symbol_refcnt(ncsym, refs); } zbar_symbol_type_t zbar_symbol_get_type (const zbar_symbol_t *sym) { return(sym->type); } const char *zbar_symbol_get_data (const zbar_symbol_t *sym) { return(sym->data); } unsigned int zbar_symbol_get_data_length (const zbar_symbol_t *sym) { return(sym->datalen); } int zbar_symbol_get_count (const zbar_symbol_t *sym) { return(sym->cache_count); } int zbar_symbol_get_quality (const zbar_symbol_t *sym) { return(sym->quality); } unsigned zbar_symbol_get_loc_size (const zbar_symbol_t *sym) { return(sym->npts); } int zbar_symbol_get_loc_x (const zbar_symbol_t *sym, unsigned idx) { if(idx < sym->npts) return(sym->pts[idx].x); else return(-1); } int zbar_symbol_get_loc_y (const zbar_symbol_t *sym, unsigned idx) { if(idx < sym->npts) return(sym->pts[idx].y); else return(-1); } const zbar_symbol_t *zbar_symbol_next (const zbar_symbol_t *sym) { return((sym) ? sym->next : NULL); } const zbar_symbol_set_t* zbar_symbol_get_components (const zbar_symbol_t *sym) { return(sym->syms); } const zbar_symbol_t *zbar_symbol_first_component (const zbar_symbol_t *sym) { return((sym && sym->syms) ? sym->syms->head : NULL); } static const char *xmlfmt[] = { "", }; /* FIXME suspect... */ #define MAX_INT_DIGITS 10 char *zbar_symbol_xml (const zbar_symbol_t *sym, char **buf, unsigned *len) { const char *type = zbar_get_symbol_name(sym->type); /* FIXME binary data */ unsigned datalen = strlen(sym->data); unsigned maxlen = (strlen(xmlfmt[0]) + strlen(xmlfmt[1]) + strlen(xmlfmt[2]) + strlen(xmlfmt[3]) + strlen(type) + datalen + MAX_INT_DIGITS + 1); if(!*buf || (*len < maxlen)) { if(*buf) free(*buf); *buf = malloc(maxlen); /* FIXME check OOM */ *len = maxlen; } int n = snprintf(*buf, maxlen, xmlfmt[0], type, sym->quality); assert(n > 0); assert(n <= maxlen); if(sym->cache_count) { int i = snprintf(*buf + n, maxlen - n, xmlfmt[1], sym->cache_count); assert(i > 0); n += i; assert(n <= maxlen); } int i = strlen(xmlfmt[2]); memcpy(*buf + n, xmlfmt[2], i + 1); n += i; assert(n <= maxlen); /* FIXME binary data */ /* FIXME handle "]]>" */ strncpy(*buf + n, sym->data, datalen + 1); n += datalen; assert(n <= maxlen); i = strlen(xmlfmt[3]); memcpy(*buf + n, xmlfmt[3], i + 1); n += i; assert(n <= maxlen); *len = n; return(*buf); } zbar_symbol_set_t *_zbar_symbol_set_create () { zbar_symbol_set_t *syms = calloc(1, sizeof(*syms)); _zbar_refcnt(&syms->refcnt, 1); return(syms); } inline void _zbar_symbol_set_free (zbar_symbol_set_t *syms) { zbar_symbol_t *sym, *next; for(sym = syms->head; sym; sym = next) { next = sym->next; sym->next = NULL; _zbar_symbol_refcnt(sym, -1); } syms->head = NULL; free(syms); } void zbar_symbol_set_ref (const zbar_symbol_set_t *syms, int delta) { zbar_symbol_set_t *ncsyms = (zbar_symbol_set_t*)syms; if(!_zbar_refcnt(&ncsyms->refcnt, delta) && delta <= 0) _zbar_symbol_set_free(ncsyms); } int zbar_symbol_set_get_size (const zbar_symbol_set_t *syms) { return(syms->nsyms); } const zbar_symbol_t* zbar_symbol_set_first_symbol (const zbar_symbol_set_t *syms) { zbar_symbol_t *sym = syms->tail; if(sym) return(sym->next); return(syms->head); } zbar-0.10/zbar/refcnt.c0000644000000000000000000000260711270371414011647 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "refcnt.h" #ifdef HAVE_LIBPTHREAD pthread_once_t initialized = PTHREAD_ONCE_INIT; pthread_mutex_t _zbar_reflock; static void initialize (void) { pthread_mutex_init(&_zbar_reflock, NULL); } void _zbar_refcnt_init () { pthread_once(&initialized, initialize); } #else void _zbar_refcnt_init () { } #endif zbar-0.10/zbar/video/0000777000000000000000000000000011270371535011413 500000000000000zbar-0.10/zbar/video/v4l1.c0000644000000000000000000003455611270371414012272 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #include #include #include #include #include #include #include #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_MMAN_H # include #endif #include #include "video.h" #include "image.h" extern int _zbar_v4l2_probe(zbar_video_t*); typedef struct v4l1_format_s { uint32_t format; uint8_t bpp; } v4l1_format_t; /* static v4l1 "palette" mappings * documentation for v4l1 formats is terrible... */ static const v4l1_format_t v4l1_formats[17] = { /* format bpp */ { 0, 0 }, { fourcc('G','R','E','Y'), 8 }, /* GREY */ { fourcc('H','I','2','4'), 8 }, /* HI240 (BT848) */ /* component ordering for RGB palettes is unspecified, * convention appears to place red in the most significant bits * FIXME is this true for other drivers? big endian machines? */ { fourcc('R','G','B','P'), 16 }, /* RGB565 */ { fourcc('B','G','R','3'), 24 }, /* RGB24 */ { fourcc('B','G','R','4'), 32 }, /* RGB32 */ { fourcc('R','G','B','O'), 16 }, /* RGB555 */ { fourcc('Y','U','Y','2'), 16 }, /* YUV422 (8 bpp?!) */ { fourcc('Y','U','Y','V'), 16 }, /* YUYV */ { fourcc('U','Y','V','Y'), 16 }, /* UYVY */ { 0, 12 }, /* YUV420 (24 bpp?) FIXME?! */ { fourcc('Y','4','1','P'), 12 }, /* YUV411 */ { 0, 0 }, /* Bt848 raw */ { fourcc('4','2','2','P'), 16 }, /* YUV422P (24 bpp?) */ { fourcc('4','1','1','P'), 12 }, /* YUV411P */ { fourcc('Y','U','1','2'), 12 }, /* YUV420P */ { fourcc('Y','U','V','9'), 9 }, /* YUV410P */ }; static int v4l1_nq (zbar_video_t *vdo, zbar_image_t *img) { if(video_nq_image(vdo, img)) return(-1); if(vdo->iomode != VIDEO_MMAP) return(0); struct video_mmap vmap; vmap.frame = img->srcidx; vmap.width = vdo->width; vmap.height = vdo->height; vmap.format = vdo->palette; if(ioctl(vdo->fd, VIDIOCMCAPTURE, &vmap) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "initiating video capture (VIDIOCMCAPTURE)")); return(0); } static zbar_image_t *v4l1_dq (zbar_video_t *vdo) { video_iomode_t iomode = vdo->iomode; int fd = vdo->fd; zbar_image_t *img = video_dq_image(vdo); if(!img) return(NULL); if(iomode == VIDEO_MMAP) { int frame = img->srcidx; if(ioctl(fd, VIDIOCSYNC, &frame) < 0) return(NULL); } else if(read(fd, (void*)img->data, img->datalen) != img->datalen) return(NULL); return(img); } static int v4l1_mmap_buffers (zbar_video_t *vdo) { #ifdef HAVE_SYS_MMAN_H /* map camera image to memory */ struct video_mbuf vbuf; memset(&vbuf, 0, sizeof(vbuf)); if(ioctl(vdo->fd, VIDIOCGMBUF, &vbuf) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying video frame buffers (VIDIOCGMBUF)")); assert(vbuf.frames && vbuf.size); zprintf(1, "mapping %d buffers size=0x%x\n", vbuf.frames, vbuf.size); vdo->buflen = vbuf.size; vdo->buf = mmap(0, vbuf.size, PROT_READ | PROT_WRITE, MAP_SHARED, vdo->fd, 0); if(vdo->buf == MAP_FAILED) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "mapping video frame buffers")); int i; for(i = 0; i < vbuf.frames; i++) { zbar_image_t *img = vdo->images[i]; zprintf(2, " [%02d] @%08x\n", img->srcidx, vbuf.offsets[i]); img->data = vdo->buf + vbuf.offsets[i]; img->datalen = vdo->datalen; int next_offset = ((i + 1 < vdo->num_images) ? vbuf.offsets[i + 1] : vbuf.size); if(next_offset < vbuf.offsets[i] + vdo->datalen) fprintf(stderr, "WARNING: insufficient v4l1 video buffer size:\n" "\tvbuf[%d]=%x vbuf[%d]=%x datalen=%lx\n" "\timage=%d x %d %.4s(%08x) palette=%d\n", i, vbuf.offsets[i], i + 1, next_offset, vdo->datalen, vdo->width, vdo->height, (char*)&vdo->format, vdo->format, vdo->palette); } return(0); #else return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, __func__, "memory mapping not supported")); #endif } static int v4l1_start (zbar_video_t *vdo) { return(0); } static int v4l1_stop (zbar_video_t *vdo) { return(0); } static inline int v4l1_set_format (zbar_video_t *vdo, uint32_t fmt) { struct video_picture vpic; memset(&vpic, 0, sizeof(vpic)); if(ioctl(vdo->fd, VIDIOCGPICT, &vpic) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying video format (VIDIOCGPICT)")); vdo->palette = 0; int ifmt; for(ifmt = 1; ifmt <= VIDEO_PALETTE_YUV410P; ifmt++) if(v4l1_formats[ifmt].format == fmt) break; if(!fmt || ifmt >= VIDEO_PALETTE_YUV410P) return(err_capture_int(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "invalid v4l1 format: %x", fmt)); vpic.palette = ifmt; vpic.depth = v4l1_formats[ifmt].bpp; if(ioctl(vdo->fd, VIDIOCSPICT, &vpic) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "setting format (VIDIOCSPICT)")); memset(&vpic, 0, sizeof(vpic)); if(ioctl(vdo->fd, VIDIOCGPICT, &vpic) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying video format (VIDIOCGPICT)")); if(vpic.palette != ifmt || vpic.depth != v4l1_formats[ifmt].bpp) { fprintf(stderr, "WARNING: set v4l1 palette %d which should have depth %d bpp\n" " but probed palette %d with depth %d bpp?" " ...continuing anyway\n", ifmt, v4l1_formats[ifmt].bpp, vpic.palette, vpic.depth); err_capture_int(vdo, SEV_WARNING, ZBAR_ERR_INVALID, __func__, "driver format (%x) inconsistency", fmt); } vdo->format = fmt; vdo->palette = ifmt; vdo->datalen = (vdo->width * vdo->height * v4l1_formats[ifmt].bpp + 7) >> 3; zprintf(1, "set new format: %.4s(%08x) depth=%d palette=%d size=0x%lx\n", (char*)&vdo->format, vdo->format, vpic.depth, vdo->palette, vdo->datalen); return(0); } static int v4l1_init (zbar_video_t *vdo, uint32_t fmt) { if(v4l1_set_format(vdo, fmt)) return(-1); if(vdo->iomode == VIDEO_MMAP && v4l1_mmap_buffers(vdo)) return(-1); return(0); } static int v4l1_cleanup (zbar_video_t *vdo) { #ifdef HAVE_SYS_MMAN_H /* FIXME should avoid holding onto mmap'd buffers so long? */ if(vdo->iomode == VIDEO_MMAP && vdo->buf) { if(munmap(vdo->buf, vdo->buflen)) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "unmapping video frame buffers")); vdo->buf = NULL; /* FIXME reset image */ } #endif /* close open device */ if(vdo->fd >= 0) { close(vdo->fd); vdo->fd = -1; } return(0); } static int v4l1_probe_iomode (zbar_video_t *vdo) { vdo->iomode = VIDEO_READWRITE; #ifdef HAVE_SYS_MMAN_H struct video_mbuf vbuf; memset(&vbuf, 0, sizeof(vbuf)); if(ioctl(vdo->fd, VIDIOCGMBUF, &vbuf) < 0) { if(errno != EINVAL) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying video frame buffers (VIDIOCGMBUF)")); /* not supported */ return(0); } if(!vbuf.frames || !vbuf.size) return(0); vdo->iomode = VIDEO_MMAP; if(vdo->num_images > vbuf.frames) vdo->num_images = vbuf.frames; #endif zprintf(1, "using %d images in %s mode\n", vdo->num_images, (vdo->iomode == VIDEO_READWRITE) ? "READ" : "MMAP"); return(0); } static inline int v4l1_probe_formats (zbar_video_t *vdo) { struct video_picture vpic; memset(&vpic, 0, sizeof(vpic)); if(ioctl(vdo->fd, VIDIOCGPICT, &vpic) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying format (VIDIOCGPICT)")); vdo->format = 0; if(vpic.palette <= VIDEO_PALETTE_YUV410P) vdo->format = v4l1_formats[vpic.palette].format; zprintf(1, "current format: %.4s(%08x) depth=%d palette=%d\n", (char*)&vdo->format, vdo->format, vpic.depth, vpic.palette); vdo->formats = calloc(16, sizeof(uint32_t)); if(!vdo->formats) return(err_capture(vdo, SEV_FATAL, ZBAR_ERR_NOMEM, __func__, "allocating format list")); int num_formats = 0; zprintf(2, "probing supported formats:\n"); int i; for(i = 1; i <= VIDEO_PALETTE_YUV410P; i++) { if(!v4l1_formats[i].format) continue; vpic.depth = v4l1_formats[i].bpp; vpic.palette = i; if(ioctl(vdo->fd, VIDIOCSPICT, &vpic) < 0) { zprintf(2, " [%02d] %.4s...no (set fails)\n", i, (char*)&v4l1_formats[i].format); continue; } if(ioctl(vdo->fd, VIDIOCGPICT, &vpic) < 0 || vpic.palette != i) { zprintf(2, " [%02d] %.4s...no (set ignored)\n", i, (char*)&v4l1_formats[i].format); continue; } zprintf(2, " [%02d] %.4s...yes\n", i, (char*)&v4l1_formats[i].format); vdo->formats[num_formats++] = v4l1_formats[i].format; } vdo->formats = realloc(vdo->formats, (num_formats + 1) * sizeof(uint32_t)); assert(vdo->formats); return(v4l1_set_format(vdo, vdo->format)); } static inline int v4l1_init_window (zbar_video_t *vdo) { struct video_window vwin; memset(&vwin, 0, sizeof(vwin)); if(ioctl(vdo->fd, VIDIOCGWIN, &vwin) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying video window settings (VIDIOCGWIN)")); zprintf(1, "current window: %d x %d @(%d, %d)%s\n", vwin.width, vwin.height, vwin.x, vwin.y, (vwin.flags & 1) ? " INTERLACE" : ""); if(vwin.width == vdo->width && vwin.height == vdo->height) /* max window already set */ return(0); struct video_window maxwin; memcpy(&maxwin, &vwin, sizeof(maxwin)); maxwin.width = vdo->width; maxwin.height = vdo->height; zprintf(1, "setting max win: %d x %d @(%d, %d)%s\n", maxwin.width, maxwin.height, maxwin.x, maxwin.y, (maxwin.flags & 1) ? " INTERLACE" : ""); if(ioctl(vdo->fd, VIDIOCSWIN, &maxwin) < 0) { zprintf(1, "set FAILED...trying to recover original window\n"); /* ignore errors (driver broken anyway) */ ioctl(vdo->fd, VIDIOCSWIN, &vwin); } /* re-query resulting parameters */ memset(&vwin, 0, sizeof(vwin)); if(ioctl(vdo->fd, VIDIOCGWIN, &vwin) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying video window settings (VIDIOCGWIN)")); zprintf(1, " final window: %d x %d @(%d, %d)%s\n", vwin.width, vwin.height, vwin.x, vwin.y, (vwin.flags & 1) ? " INTERLACE" : ""); vdo->width = vwin.width; vdo->height = vwin.height; return(0); } static int _zbar_v4l1_probe (zbar_video_t *vdo) { /* check capabilities */ struct video_capability vcap; memset(&vcap, 0, sizeof(vcap)); if(ioctl(vdo->fd, VIDIOCGCAP, &vcap) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, __func__, "video4linux version 1 not supported (VIDIOCGCAP)")); zprintf(1, "%s (%sCAPTURE) (%d x %d) - (%d x %d)\n", vcap.name, (vcap.type & VID_TYPE_CAPTURE) ? "" : "*NO* ", vcap.minwidth, vcap.minheight, vcap.maxwidth, vcap.maxheight); if(!(vcap.type & VID_TYPE_CAPTURE)) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, __func__, "v4l1 device does not support CAPTURE")); if(!vdo->width || !vdo->height) { vdo->width = vcap.maxwidth; vdo->height = vcap.maxheight; } if(v4l1_init_window(vdo) || v4l1_probe_formats(vdo) || v4l1_probe_iomode(vdo)) return(-1); vdo->intf = VIDEO_V4L1; vdo->init = v4l1_init; vdo->cleanup = v4l1_cleanup; vdo->start = v4l1_start; vdo->stop = v4l1_stop; vdo->nq = v4l1_nq; vdo->dq = v4l1_dq; return(0); } int _zbar_video_open (zbar_video_t *vdo, const char *dev) { vdo->fd = open(dev, O_RDWR); if(vdo->fd < 0) return(err_capture_str(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "opening video device '%s'", dev)); zprintf(1, "opened camera device %s (fd=%d)\n", dev, vdo->fd); int rc = -1; #ifdef HAVE_LINUX_VIDEODEV2_H if(vdo->intf != VIDEO_V4L1) rc = _zbar_v4l2_probe(vdo); if(rc) #else zprintf(1, "WARNING: not compiled with v4l2 support, trying v4l1\n"); #endif rc = _zbar_v4l1_probe(vdo); if(rc && vdo->fd >= 0) { close(vdo->fd); vdo->fd = -1; } return(rc); } zbar-0.10/zbar/video/v4l2.c0000644000000000000000000004315711270371414012270 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDLIB_H # include #endif #include #include #include #include #ifdef HAVE_SYS_IOCTL_H # include #endif #ifdef HAVE_SYS_MMAN_H # include #endif #include #include "video.h" #include "image.h" #define V4L2_FORMATS_MAX 64 static int v4l2_nq (zbar_video_t *vdo, zbar_image_t *img) { if(vdo->iomode == VIDEO_READWRITE) return(video_nq_image(vdo, img)); if(video_unlock(vdo)) return(-1); struct v4l2_buffer vbuf; memset(&vbuf, 0, sizeof(vbuf)); vbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(vdo->iomode == VIDEO_MMAP) { vbuf.memory = V4L2_MEMORY_MMAP; vbuf.index = img->srcidx; } else { vbuf.memory = V4L2_MEMORY_USERPTR; vbuf.m.userptr = (unsigned long)img->data; vbuf.length = img->datalen; vbuf.index = img->srcidx; /* FIXME workaround broken drivers */ } if(ioctl(vdo->fd, VIDIOC_QBUF, &vbuf) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "queuing video buffer (VIDIOC_QBUF)")); return(0); } static zbar_image_t *v4l2_dq (zbar_video_t *vdo) { zbar_image_t *img; int fd = vdo->fd; if(vdo->iomode != VIDEO_READWRITE) { video_iomode_t iomode = vdo->iomode; if(video_unlock(vdo)) return(NULL); struct v4l2_buffer vbuf; memset(&vbuf, 0, sizeof(vbuf)); vbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(iomode == VIDEO_MMAP) vbuf.memory = V4L2_MEMORY_MMAP; else vbuf.memory = V4L2_MEMORY_USERPTR; if(ioctl(fd, VIDIOC_DQBUF, &vbuf) < 0) return(NULL); if(iomode == VIDEO_MMAP) { assert(vbuf.index >= 0); assert(vbuf.index < vdo->num_images); img = vdo->images[vbuf.index]; } else { /* reverse map pointer back to image (FIXME) */ assert(vbuf.m.userptr >= (unsigned long)vdo->buf); assert(vbuf.m.userptr < (unsigned long)(vdo->buf + vdo->buflen)); int i = (vbuf.m.userptr - (unsigned long)vdo->buf) / vdo->datalen; assert(i >= 0); assert(i < vdo->num_images); img = vdo->images[i]; assert(vbuf.m.userptr == (unsigned long)img->data); } } else { img = video_dq_image(vdo); if(!img) return(NULL); /* FIXME should read entire image */ unsigned long datalen = read(fd, (void*)img->data, img->datalen); if(datalen < 0) return(NULL); else if(datalen != img->datalen) zprintf(0, "WARNING: read() size mismatch: 0x%lx != 0x%lx\n", datalen, img->datalen); } return(img); } static int v4l2_start (zbar_video_t *vdo) { if(vdo->iomode == VIDEO_READWRITE) return(0); enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(ioctl(vdo->fd, VIDIOC_STREAMON, &type) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "starting video stream (VIDIOC_STREAMON)")); return(0); } static int v4l2_stop (zbar_video_t *vdo) { if(vdo->iomode == VIDEO_READWRITE) return(0); enum v4l2_buf_type type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(ioctl(vdo->fd, VIDIOC_STREAMOFF, &type) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "stopping video stream (VIDIOC_STREAMOFF)")); return(0); } static int v4l2_cleanup (zbar_video_t *vdo) { if(vdo->iomode == VIDEO_READWRITE) return(0); struct v4l2_requestbuffers rb; memset(&rb, 0, sizeof(rb)); rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(vdo->iomode == VIDEO_MMAP) { rb.memory = V4L2_MEMORY_MMAP; int i; for(i = 0; i < vdo->num_images; i++) { zbar_image_t *img = vdo->images[i]; if(img->data && munmap((void*)img->data, img->datalen)) err_capture(vdo, SEV_WARNING, ZBAR_ERR_SYSTEM, __func__, "unmapping video frame buffers"); img->data = NULL; img->datalen = 0; } } else rb.memory = V4L2_MEMORY_USERPTR; /* requesting 0 buffers * should implicitly disable streaming */ if(ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0) err_capture(vdo, SEV_WARNING, ZBAR_ERR_SYSTEM, __func__, "releasing video frame buffers (VIDIOC_REQBUFS)"); /* close open device */ if(vdo->fd >= 0) { close(vdo->fd); vdo->fd = -1; } return(0); } static int v4l2_mmap_buffers (zbar_video_t *vdo) { struct v4l2_requestbuffers rb; memset(&rb, 0, sizeof(rb)); rb.count = vdo->num_images; rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; rb.memory = V4L2_MEMORY_MMAP; if(ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "requesting video frame buffers (VIDIOC_REQBUFS)")); zprintf(1, "mapping %u buffers (of %d requested)\n", rb.count, vdo->num_images); if(!rb.count) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "driver returned 0 buffers")); if(vdo->num_images > rb.count) vdo->num_images = rb.count; struct v4l2_buffer vbuf; memset(&vbuf, 0, sizeof(vbuf)); vbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vbuf.memory = V4L2_MEMORY_MMAP; int i; for(i = 0; i < vdo->num_images; i++) { vbuf.index = i; if(ioctl(vdo->fd, VIDIOC_QUERYBUF, &vbuf) < 0) /* FIXME cleanup */ return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying video buffer (VIDIOC_QUERYBUF)")); if(vbuf.length < vdo->datalen) fprintf(stderr, "WARNING: insufficient v4l2 video buffer size:\n" "\tvbuf[%d].length=%x datalen=%lx image=%d x %d %.4s(%08x)\n", i, vbuf.length, vdo->datalen, vdo->width, vdo->height, (char*)&vdo->format, vdo->format); zbar_image_t *img = vdo->images[i]; img->datalen = vbuf.length; img->data = mmap(NULL, vbuf.length, PROT_READ | PROT_WRITE, MAP_SHARED, vdo->fd, vbuf.m.offset); if(img->data == MAP_FAILED) /* FIXME cleanup */ return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "mapping video frame buffers")); zprintf(2, " buf[%d] 0x%lx bytes @%p\n", i, img->datalen, img->data); } return(0); } static int v4l2_set_format (zbar_video_t *vdo, uint32_t fmt) { struct v4l2_format vfmt; struct v4l2_pix_format *vpix = &vfmt.fmt.pix; memset(&vfmt, 0, sizeof(vfmt)); vfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; vpix->width = vdo->width; vpix->height = vdo->height; vpix->pixelformat = fmt; vpix->field = V4L2_FIELD_NONE; int rc = 0; if((rc = ioctl(vdo->fd, VIDIOC_S_FMT, &vfmt)) < 0) { /* several broken drivers return an error if we request * no interlacing (NB v4l2 spec violation) * ...try again with an interlaced request */ zprintf(1, "VIDIOC_S_FMT returned %d(%d), trying interlaced...\n", rc, errno); /* FIXME this might be _ANY once we can de-interlace */ vpix->field = V4L2_FIELD_INTERLACED; if(ioctl(vdo->fd, VIDIOC_S_FMT, &vfmt) < 0) return(err_capture_int(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "setting format %x (VIDIOC_S_FMT)", fmt)); zprintf(0, "WARNING: broken driver returned error when non-interlaced" " format requested\n"); } struct v4l2_format newfmt; struct v4l2_pix_format *newpix = &newfmt.fmt.pix; memset(&newfmt, 0, sizeof(newfmt)); newfmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(ioctl(vdo->fd, VIDIOC_G_FMT, &newfmt) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying format (VIDIOC_G_FMT)")); if(newpix->field != V4L2_FIELD_NONE) err_capture(vdo, SEV_WARNING, ZBAR_ERR_INVALID, __func__, "video driver only supports interlaced format," " vertical scanning may not work"); if(newpix->pixelformat != fmt /* FIXME bpl/bpp checks? */) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "video driver can't provide compatible format")); vdo->format = fmt; vdo->width = newpix->width; vdo->height = newpix->height; vdo->datalen = newpix->sizeimage; zprintf(1, "set new format: %.4s(%08x) %u x %u (0x%lx)\n", (char*)&vdo->format, vdo->format, vdo->width, vdo->height, vdo->datalen); return(0); } static int v4l2_init (zbar_video_t *vdo, uint32_t fmt) { if(v4l2_set_format(vdo, fmt)) return(-1); if(vdo->iomode == VIDEO_MMAP) return(v4l2_mmap_buffers(vdo)); return(0); } static int v4l2_probe_iomode (zbar_video_t *vdo) { struct v4l2_requestbuffers rb; memset(&rb, 0, sizeof(rb)); rb.count = vdo->num_images; /* FIXME workaround broken drivers */ rb.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(vdo->iomode == VIDEO_MMAP) rb.memory = V4L2_MEMORY_MMAP; else rb.memory = V4L2_MEMORY_USERPTR; if(ioctl(vdo->fd, VIDIOC_REQBUFS, &rb) < 0) { if(vdo->iomode) return(err_capture_int(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "unsupported iomode requested (%d)", vdo->iomode)); else if(errno != EINVAL) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying streaming mode (VIDIOC_REQBUFS)")); #ifdef HAVE_SYS_MMAN_H vdo->iomode = VIDEO_MMAP; #endif } else { if(!vdo->iomode) vdo->iomode = VIDEO_USERPTR; if(rb.count) vdo->num_images = rb.count; } return(0); } static inline int v4l2_probe_formats (zbar_video_t *vdo) { zprintf(2, "enumerating supported formats:\n"); struct v4l2_fmtdesc desc; memset(&desc, 0, sizeof(desc)); desc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; for(desc.index = 0; desc.index < V4L2_FORMATS_MAX; desc.index++) { if(ioctl(vdo->fd, VIDIOC_ENUM_FMT, &desc) < 0) break; zprintf(2, " [%d] %.4s : %s%s\n", desc.index, (char*)&desc.pixelformat, desc.description, (desc.flags & V4L2_FMT_FLAG_COMPRESSED) ? " COMPRESSED" : ""); vdo->formats = realloc(vdo->formats, (desc.index + 2) * sizeof(uint32_t)); vdo->formats[desc.index] = desc.pixelformat; } if(!desc.index) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "enumerating video formats (VIDIOC_ENUM_FMT)")); vdo->formats[desc.index] = 0; struct v4l2_format fmt; struct v4l2_pix_format *pix = &fmt.fmt.pix; memset(&fmt, 0, sizeof(fmt)); fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(ioctl(vdo->fd, VIDIOC_G_FMT, &fmt) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying current video format (VIDIO_G_FMT)")); zprintf(1, "current format: %.4s(%08x) %u x %u%s (line=0x%x size=0x%x)\n", (char*)&pix->pixelformat, pix->pixelformat, pix->width, pix->height, (pix->field != V4L2_FIELD_NONE) ? " INTERLACED" : "", pix->bytesperline, pix->sizeimage); vdo->format = pix->pixelformat; vdo->datalen = pix->sizeimage; if(pix->width == vdo->width && pix->height == vdo->height) return(0); struct v4l2_format maxfmt; struct v4l2_pix_format *maxpix = &maxfmt.fmt.pix; memcpy(&maxfmt, &fmt, sizeof(maxfmt)); maxpix->width = vdo->width; maxpix->height = vdo->height; zprintf(1, "setting requested size: %d x %d\n", vdo->width, vdo->height); if(ioctl(vdo->fd, VIDIOC_S_FMT, &maxfmt) < 0) { zprintf(1, "set FAILED...trying to recover original format\n"); /* ignore errors (driver broken anyway) */ ioctl(vdo->fd, VIDIOC_S_FMT, &fmt); } memset(&fmt, 0, sizeof(fmt)); fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(ioctl(vdo->fd, VIDIOC_G_FMT, &fmt) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying current video format (VIDIOC_G_FMT)")); zprintf(1, "final format: %.4s(%08x) %u x %u%s (line=0x%x size=0x%x)\n", (char*)&pix->pixelformat, pix->pixelformat, pix->width, pix->height, (pix->field != V4L2_FIELD_NONE) ? " INTERLACED" : "", pix->bytesperline, pix->sizeimage); vdo->width = pix->width; vdo->height = pix->height; vdo->datalen = pix->sizeimage; return(0); } static inline int v4l2_reset_crop (zbar_video_t *vdo) { /* check cropping */ struct v4l2_cropcap ccap; memset(&ccap, 0, sizeof(ccap)); ccap.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; if(ioctl(vdo->fd, VIDIOC_CROPCAP, &ccap) < 0) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "querying crop support (VIDIOC_CROPCAP)")); zprintf(1, "crop bounds: %d x %d @ (%d, %d)\n", ccap.bounds.width, ccap.bounds.height, ccap.bounds.left, ccap.bounds.top); zprintf(1, "current crop win: %d x %d @ (%d, %d) aspect %d / %d\n", ccap.defrect.width, ccap.defrect.height, ccap.defrect.left, ccap.defrect.top, ccap.pixelaspect.numerator, ccap.pixelaspect.denominator); if(!vdo->width || !vdo->height) { vdo->width = ccap.defrect.width; vdo->height = ccap.defrect.height; } /* reset crop parameters */ struct v4l2_crop crop; memset(&crop, 0, sizeof(crop)); crop.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; crop.c = ccap.defrect; if(ioctl(vdo->fd, VIDIOC_S_CROP, &crop) < 0 && errno != EINVAL) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "setting default crop window (VIDIOC_S_CROP)")); return(0); } int _zbar_v4l2_probe (zbar_video_t *vdo) { /* check capabilities */ struct v4l2_capability vcap; memset(&vcap, 0, sizeof(vcap)); if(ioctl(vdo->fd, VIDIOC_QUERYCAP, &vcap) < 0) return(err_capture(vdo, SEV_WARNING, ZBAR_ERR_UNSUPPORTED, __func__, "video4linux version 2 not supported (VIDIOC_QUERYCAP)")); zprintf(1, "%.32s on %.32s driver %.16s (version %u.%u.%u)\n", vcap.card, (vcap.bus_info[0]) ? (char*)vcap.bus_info : "", vcap.driver, (vcap.version >> 16) & 0xff, (vcap.version >> 8) & 0xff, vcap.version & 0xff); zprintf(1, " capabilities:%s%s%s%s\n", (vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE) ? " CAPTURE" : "", (vcap.capabilities & V4L2_CAP_VIDEO_OVERLAY) ? " OVERLAY" : "", (vcap.capabilities & V4L2_CAP_READWRITE) ? " READWRITE" : "", (vcap.capabilities & V4L2_CAP_STREAMING) ? " STREAMING" : ""); if(!(vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE) || !(vcap.capabilities & (V4L2_CAP_READWRITE | V4L2_CAP_STREAMING))) return(err_capture(vdo, SEV_WARNING, ZBAR_ERR_UNSUPPORTED, __func__, "v4l2 device does not support usable CAPTURE")); if(v4l2_reset_crop(vdo)) /* ignoring errors (driver cropping support questionable) */; if(!vdo->width || !vdo->height) { /* fallback to large size, driver reduces to max available */ vdo->width = 640 * 64; vdo->height = 480 * 64; } if(v4l2_probe_formats(vdo)) return(-1); /* FIXME report error and fallback to readwrite? (if supported...) */ if(vdo->iomode != VIDEO_READWRITE && (vcap.capabilities & V4L2_CAP_STREAMING) && v4l2_probe_iomode(vdo)) return(-1); if(!vdo->iomode) vdo->iomode = VIDEO_READWRITE; zprintf(1, "using I/O mode: %s\n", (vdo->iomode == VIDEO_READWRITE) ? "READWRITE" : (vdo->iomode == VIDEO_MMAP) ? "MMAP" : (vdo->iomode == VIDEO_USERPTR) ? "USERPTR" : ""); vdo->intf = VIDEO_V4L2; vdo->init = v4l2_init; vdo->cleanup = v4l2_cleanup; vdo->start = v4l2_start; vdo->stop = v4l2_stop; vdo->nq = v4l2_nq; vdo->dq = v4l2_dq; return(0); } zbar-0.10/zbar/video/vfw.c0000644000000000000000000003537611270371414012307 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "video.h" #include "thread.h" #include #include #define MAX_DRIVERS 10 #define MAX_NAME 128 #define BIH_FMT "%ldx%ld @%dbpp (%lx) cmp=%.4s(%08lx) res=%ldx%ld clr=%ld/%ld (%lx)" #define BIH_FIELDS(bih) \ (bih)->biWidth, (bih)->biHeight, (bih)->biBitCount, (bih)->biSizeImage, \ (char*)&(bih)->biCompression, (bih)->biCompression, \ (bih)->biXPelsPerMeter, (bih)->biYPelsPerMeter, \ (bih)->biClrImportant, (bih)->biClrUsed, (bih)->biSize struct video_state_s { zbar_thread_t thread; /* capture message pump */ HANDLE captured; HWND hwnd; /* vfw interface */ HANDLE notify; /* capture thread status change */ int bi_size; /* size of bih */ BITMAPINFOHEADER *bih; /* video format details */ zbar_image_t *image; /* currently capturing frame */ }; static const uint32_t vfw_formats[] = { /* planar YUV formats */ fourcc('I','4','2','0'), /* FIXME YU12 is IYUV in windows */ fourcc('Y','V','1','2'), /* FIXME IMC[1-4]? */ /* planar Y + packed UV plane */ fourcc('N','V','1','2'), /* packed YUV formats */ fourcc('U','Y','V','Y'), fourcc('Y','U','Y','2'), /* FIXME add YVYU */ /* FIXME AYUV? Y411? Y41P? */ /* packed rgb formats */ fourcc('B','G','R','3'), fourcc('B','G','R','4'), fourcc('Y','V','U','9'), /* basic grayscale format */ fourcc('G','R','E','Y'), fourcc('Y','8','0','0'), /* compressed formats */ fourcc('J','P','E','G'), /* terminator */ 0 }; #define VFW_NUM_FORMATS (sizeof(vfw_formats) / sizeof(uint32_t)) static ZTHREAD vfw_capture_thread (void *arg) { zbar_video_t *vdo = arg; video_state_t *state = vdo->state; zbar_thread_t *thr = &state->thread; state->hwnd = capCreateCaptureWindow(NULL, WS_POPUP, 0, 0, 1, 1, NULL, 0); if(!state->hwnd) goto done; _zbar_mutex_lock(&vdo->qlock); _zbar_thread_init(thr); zprintf(4, "spawned vfw capture thread (thr=%04lx)\n", _zbar_thread_self()); MSG msg; int rc = 0; while(thr->started && rc >= 0 && rc <= 1) { _zbar_mutex_unlock(&vdo->qlock); rc = MsgWaitForMultipleObjects(1, &thr->notify, 0, INFINITE, QS_ALLINPUT); if(rc == 1) while(PeekMessage(&msg, NULL, 0, 0, PM_NOYIELD | PM_REMOVE)) if(rc > 0) { TranslateMessage(&msg); DispatchMessage(&msg); } _zbar_mutex_lock(&vdo->qlock); } done: thr->running = 0; _zbar_event_trigger(&thr->activity); _zbar_mutex_unlock(&vdo->qlock); return(0); } static LRESULT CALLBACK vfw_stream_cb (HWND hwnd, VIDEOHDR *hdr) { if(!hwnd || !hdr) return(0); zbar_video_t *vdo = (void*)capGetUserData(hwnd); _zbar_mutex_lock(&vdo->qlock); zbar_image_t *img = vdo->state->image; if(!img) { _zbar_mutex_lock(&vdo->qlock); img = video_dq_image(vdo); } if(img) { img->data = hdr->lpData; img->datalen = hdr->dwBufferLength; vdo->state->image = img; SetEvent(vdo->state->captured); } _zbar_mutex_unlock(&vdo->qlock); return(1); } static LRESULT CALLBACK vfw_error_cb (HWND hwnd, int errid, const char *errmsg) { if(!hwnd) return(0); zbar_video_t *vdo = (void*)capGetUserData(hwnd); zprintf(2, "id=%d msg=%s\n", errid, errmsg); _zbar_mutex_lock(&vdo->qlock); vdo->state->image = NULL; SetEvent(vdo->state->captured); _zbar_mutex_unlock(&vdo->qlock); return(1); } static int vfw_nq (zbar_video_t *vdo, zbar_image_t *img) { img->data = NULL; img->datalen = 0; return(video_nq_image(vdo, img)); } static zbar_image_t *vfw_dq (zbar_video_t *vdo) { zbar_image_t *img = vdo->state->image; if(!img) { _zbar_mutex_unlock(&vdo->qlock); int rc = WaitForSingleObject(vdo->state->captured, INFINITE); _zbar_mutex_lock(&vdo->qlock); if(!rc) img = vdo->state->image; else img = NULL; /*FIXME handle errors? */ } else ResetEvent(vdo->state->captured); if(img) vdo->state->image = NULL; video_unlock(vdo); return(img); } static int vfw_start (zbar_video_t *vdo) { ResetEvent(vdo->state->captured); if(!capCaptureSequenceNoFile(vdo->state->hwnd)) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "starting video stream")); return(0); } static int vfw_stop (zbar_video_t *vdo) { video_state_t *state = vdo->state; if(!capCaptureAbort(state->hwnd)) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "stopping video stream")); _zbar_mutex_lock(&vdo->qlock); if(state->image) state->image = NULL; SetEvent(state->captured); _zbar_mutex_unlock(&vdo->qlock); return(0); } static int vfw_set_format (zbar_video_t *vdo, uint32_t fmt) { const zbar_format_def_t *fmtdef = _zbar_format_lookup(fmt); if(!fmtdef->format) return(err_capture_int(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "unsupported vfw format: %x", fmt)); BITMAPINFOHEADER *bih = vdo->state->bih; assert(bih); bih->biWidth = vdo->width; bih->biHeight = vdo->height; switch(fmtdef->group) { case ZBAR_FMT_GRAY: bih->biBitCount = 8; break; case ZBAR_FMT_YUV_PLANAR: case ZBAR_FMT_YUV_PACKED: case ZBAR_FMT_YUV_NV: bih->biBitCount = 8 + (16 >> (fmtdef->p.yuv.xsub2 + fmtdef->p.yuv.ysub2)); break; case ZBAR_FMT_RGB_PACKED: bih->biBitCount = fmtdef->p.rgb.bpp * 8; break; default: bih->biBitCount = 0; } bih->biClrUsed = bih->biClrImportant = 0; bih->biCompression = fmt; zprintf(8, "seting format: %.4s(%08x) " BIH_FMT "\n", (char*)&fmt, fmt, BIH_FIELDS(bih)); if(!capSetVideoFormat(vdo->state->hwnd, bih, vdo->state->bi_size)) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "setting video format")); if(!capGetVideoFormat(vdo->state->hwnd, bih, vdo->state->bi_size)) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "getting video format")); if(bih->biCompression != fmt) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "video format set ignored")); vdo->format = fmt; vdo->width = bih->biWidth; vdo->height = bih->biHeight; vdo->datalen = bih->biSizeImage; zprintf(4, "set new format: %.4s(%08x) " BIH_FMT "\n", (char*)&fmt, fmt, BIH_FIELDS(bih)); return(0); } static int vfw_init (zbar_video_t *vdo, uint32_t fmt) { if(vfw_set_format(vdo, fmt)) return(-1); HWND hwnd = vdo->state->hwnd; CAPTUREPARMS cp; if(!capCaptureGetSetup(hwnd, &cp, sizeof(cp))) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_WINAPI, __func__, "retrieving capture parameters")); cp.dwRequestMicroSecPerFrame = 33333; cp.fMakeUserHitOKToCapture = 0; cp.wPercentDropForError = 90; cp.fYield = 1; cp.wNumVideoRequested = vdo->num_images; cp.fCaptureAudio = 0; cp.vKeyAbort = 0; cp.fAbortLeftMouse = 0; cp.fAbortRightMouse = 0; cp.fLimitEnabled = 0; if(!capCaptureSetSetup(hwnd, &cp, sizeof(cp))) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_WINAPI, __func__, "setting capture parameters")); if(!capCaptureGetSetup(hwnd, &cp, sizeof(cp))) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_WINAPI, __func__, "checking capture parameters")); /* ignore errors since we skipped checking fHasOverlay */ capOverlay(hwnd, 0); if(!capPreview(hwnd, 0) || !capPreviewScale(hwnd, 0)) err_capture(vdo, SEV_WARNING, ZBAR_ERR_WINAPI, __func__, "disabling preview"); if(!capSetCallbackOnVideoStream(hwnd, vfw_stream_cb) || !capSetCallbackOnError(hwnd, vfw_error_cb)) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_BUSY, __func__, "setting capture callbacks")); vdo->num_images = cp.wNumVideoRequested; vdo->iomode = VIDEO_MMAP; /* driver provides "locked" buffers */ zprintf(3, "initialized video capture: %d buffers %ldms/frame\n", vdo->num_images, cp.dwRequestMicroSecPerFrame); return(0); } static int vfw_cleanup (zbar_video_t *vdo) { /* close open device */ video_state_t *state = vdo->state; /* NB this has to go here so the thread can pump messages during cleanup */ capDriverDisconnect(state->hwnd); DestroyWindow(state->hwnd); state->hwnd = NULL; _zbar_thread_stop(&state->thread, &vdo->qlock); if(state->captured) { CloseHandle(state->captured); state->captured = NULL; } return(0); } static int vfw_probe_format (zbar_video_t *vdo, uint32_t fmt) { const zbar_format_def_t *fmtdef = _zbar_format_lookup(fmt); if(!fmtdef) return(0); zprintf(4, " trying %.4s(%08x)...\n", (char*)&fmt, fmt); BITMAPINFOHEADER *bih = vdo->state->bih; bih->biWidth = vdo->width; bih->biHeight = vdo->height; switch(fmtdef->group) { case ZBAR_FMT_GRAY: bih->biBitCount = 8; break; case ZBAR_FMT_YUV_PLANAR: case ZBAR_FMT_YUV_PACKED: case ZBAR_FMT_YUV_NV: bih->biBitCount = 8 + (16 >> (fmtdef->p.yuv.xsub2 + fmtdef->p.yuv.ysub2)); break; case ZBAR_FMT_RGB_PACKED: bih->biBitCount = fmtdef->p.rgb.bpp * 8; break; default: bih->biBitCount = 0; } bih->biCompression = fmt; if(!capSetVideoFormat(vdo->state->hwnd, bih, vdo->state->bi_size)) { zprintf(4, "\tno (set fails)\n"); return(0); } if(!capGetVideoFormat(vdo->state->hwnd, bih, vdo->state->bi_size)) return(0/*FIXME error...*/); zprintf(6, "\tactual: " BIH_FMT "\n", BIH_FIELDS(bih)); if(bih->biCompression != fmt) { zprintf(4, "\tno (set ignored)\n"); return(0); } zprintf(4, "\tyes\n"); return(1); } static int vfw_probe (zbar_video_t *vdo) { video_state_t *state = vdo->state; state->bi_size = capGetVideoFormatSize(state->hwnd); BITMAPINFOHEADER *bih = state->bih = realloc(state->bih, state->bi_size); /* FIXME check OOM */ if(!capSetUserData(state->hwnd, (LONG)vdo) || !state->bi_size || !bih || !capGetVideoFormat(state->hwnd, bih, state->bi_size)) return(err_capture(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "setting up video capture")); zprintf(3, "initial format: " BIH_FMT " (bisz=%x)\n", BIH_FIELDS(bih), state->bi_size); if(!vdo->width || !vdo->height) { vdo->width = bih->biWidth; vdo->height = bih->biHeight; } vdo->datalen = bih->biSizeImage; zprintf(2, "probing supported formats:\n"); vdo->formats = calloc(VFW_NUM_FORMATS, sizeof(uint32_t)); int n = 0; const uint32_t *fmt; for(fmt = vfw_formats; *fmt; fmt++) if(vfw_probe_format(vdo, *fmt)) vdo->formats[n++] = *fmt; vdo->formats = realloc(vdo->formats, (n + 1) * sizeof(uint32_t)); vdo->width = bih->biWidth; vdo->height = bih->biHeight; vdo->intf = VIDEO_VFW; vdo->init = vfw_init; vdo->start = vfw_start; vdo->stop = vfw_stop; vdo->cleanup = vfw_cleanup; vdo->nq = vfw_nq; vdo->dq = vfw_dq; return(0); } int _zbar_video_open (zbar_video_t *vdo, const char *dev) { video_state_t *state = vdo->state; if(!state) state = vdo->state = calloc(1, sizeof(video_state_t)); int reqid = -1; if((!strncmp(dev, "/dev/video", 10) || !strncmp(dev, "\\dev\\video", 10)) && dev[10] >= '0' && dev[10] <= '9' && !dev[11]) reqid = dev[10] - '0'; else if(strlen(dev) == 1 && dev[0] >= '0' && dev[0] <= '9') reqid = dev[0] - '0'; zprintf(6, "searching for camera: %s (%d)\n", dev, reqid); char name[MAX_NAME], desc[MAX_NAME]; int devid; for(devid = 0; devid < MAX_DRIVERS; devid++) { if(!capGetDriverDescription(devid, name, MAX_NAME, desc, MAX_NAME)) { /* FIXME TBD error */ zprintf(6, " [%d] not found...\n", devid); continue; } zprintf(6, " [%d] %.100s - %.100s\n", devid, name, desc); if((reqid >= 0) ? devid == reqid : !strncmp(dev, name, MAX_NAME)) break; } if(devid >= MAX_DRIVERS) return(err_capture_str(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "video device not found '%s'", dev)); if(!state->captured) state->captured = CreateEvent(NULL, 0, 0, NULL); else ResetEvent(state->captured); if(_zbar_thread_start(&state->thread, vfw_capture_thread, vdo, NULL)) return(-1); /* FIXME error */ assert(state->hwnd); if(!capDriverConnect(state->hwnd, devid)) { _zbar_thread_stop(&state->thread, NULL); return(err_capture_str(vdo, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "failed to connect to camera '%s'", dev)); } zprintf(1, "opened camera: %.60s (%d) (thr=%04lx)\n", name, devid, _zbar_thread_self()); if(vfw_probe(vdo)) { _zbar_thread_stop(&state->thread, NULL); return(-1); } return(0); } zbar-0.10/zbar/video/null.c0000644000000000000000000000266111270371414012446 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "video.h" static inline int null_error (void *m, const char *func) { return(err_capture(m, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, func, "not compiled with video input support")); } int _zbar_video_open (zbar_video_t *vdo, const char *device) { return(null_error(vdo, __func__)); } zbar-0.10/zbar/processor.c0000644000000000000000000004647611270371414012421 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "processor.h" #include "window.h" #include "image.h" static inline int proc_enter (zbar_processor_t *proc) { _zbar_mutex_lock(&proc->mutex); return(_zbar_processor_lock(proc)); } static inline int proc_leave (zbar_processor_t *proc) { int rc = _zbar_processor_unlock(proc, 0); _zbar_mutex_unlock(&proc->mutex); return(rc); } static inline int proc_open (zbar_processor_t *proc) { /* arbitrary default */ int width = 640, height = 480; if(proc->video) { width = zbar_video_get_width(proc->video); height = zbar_video_get_height(proc->video); } return(_zbar_processor_open(proc, "zbar barcode reader", width, height)); } /* API lock is already held */ int _zbar_process_image (zbar_processor_t *proc, zbar_image_t *img) { uint32_t force_fmt = proc->force_output; if(img) { if(proc->dumping) { zbar_image_write(proc->window->image, "zbar"); proc->dumping = 0; } uint32_t format = zbar_image_get_format(img); zprintf(16, "processing: %.4s(%08" PRIx32 ") %dx%d @%p\n", (char*)&format, format, zbar_image_get_width(img), zbar_image_get_height(img), zbar_image_get_data(img)); /* FIXME locking all other interfaces while processing is conservative * but easier for now and we don't expect this to take long... */ zbar_image_t *tmp = zbar_image_convert(img, fourcc('Y','8','0','0')); if(!tmp) goto error; if(proc->syms) { zbar_symbol_set_ref(proc->syms, -1); proc->syms = NULL; } zbar_image_scanner_recycle_image(proc->scanner, img); int nsyms = zbar_scan_image(proc->scanner, tmp); _zbar_image_swap_symbols(img, tmp); zbar_image_destroy(tmp); tmp = NULL; if(nsyms < 0) goto error; proc->syms = zbar_image_scanner_get_results(proc->scanner); if(proc->syms) zbar_symbol_set_ref(proc->syms, 1); if(_zbar_verbosity >= 8) { const zbar_symbol_t *sym = zbar_image_first_symbol(img); while(sym) { zbar_symbol_type_t type = zbar_symbol_get_type(sym); int count = zbar_symbol_get_count(sym); zprintf(8, "%s%s: %s (%d pts) (q=%d) (%s)\n", zbar_get_symbol_name(type), zbar_get_addon_name(type), zbar_symbol_get_data(sym), zbar_symbol_get_loc_size(sym), zbar_symbol_get_quality(sym), (count < 0) ? "uncertain" : (count > 0) ? "duplicate" : "new"); sym = zbar_symbol_next(sym); } } if(nsyms) { /* FIXME only call after filtering */ _zbar_mutex_lock(&proc->mutex); _zbar_processor_notify(proc, EVENT_OUTPUT); _zbar_mutex_unlock(&proc->mutex); if(proc->handler) proc->handler(img, proc->userdata); } if(force_fmt) { zbar_symbol_set_t *syms = img->syms; img = zbar_image_convert(img, force_fmt); if(!img) goto error; img->syms = syms; zbar_symbol_set_ref(syms, 1); } } /* display to window if enabled */ int rc = 0; if(proc->window) { if((rc = zbar_window_draw(proc->window, img))) err_copy(proc, proc->window); _zbar_processor_invalidate(proc); } if(force_fmt && img) zbar_image_destroy(img); return(rc); error: return(err_capture(proc, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, __func__, "unknown image format")); } int _zbar_processor_handle_input (zbar_processor_t *proc, int input) { int event = EVENT_INPUT; switch(input) { case -1: event |= EVENT_CANCELED; _zbar_processor_set_visible(proc, 0); err_capture(proc, SEV_WARNING, ZBAR_ERR_CLOSED, __func__, "user closed display window"); break; case 'd': proc->dumping = 1; return(0); case '+': case '=': if(proc->window) { int ovl = zbar_window_get_overlay(proc->window); zbar_window_set_overlay(proc->window, ovl + 1); } break; case '-': if(proc->window) { int ovl = zbar_window_get_overlay(proc->window); zbar_window_set_overlay(proc->window, ovl - 1); } break; } _zbar_mutex_lock(&proc->mutex); proc->input = input; if(input == -1 && proc->visible && proc->streaming) /* also cancel outstanding output waiters */ event |= EVENT_OUTPUT; _zbar_processor_notify(proc, event); _zbar_mutex_unlock(&proc->mutex); return(input); } #ifdef ZTHREAD static ZTHREAD proc_video_thread (void *arg) { zbar_processor_t *proc = arg; zbar_thread_t *thread = &proc->video_thread; _zbar_mutex_lock(&proc->mutex); _zbar_thread_init(thread); zprintf(4, "spawned video thread\n"); while(thread->started) { /* wait for video stream to be active */ while(thread->started && !proc->streaming) _zbar_event_wait(&thread->notify, &proc->mutex, NULL); if(!thread->started) break; /* blocking capture image from video */ _zbar_mutex_unlock(&proc->mutex); zbar_image_t *img = zbar_video_next_image(proc->video); _zbar_mutex_lock(&proc->mutex); if(!img && !proc->streaming) continue; else if(!img) /* FIXME could abort streaming and keep running? */ break; /* acquire API lock */ _zbar_processor_lock(proc); _zbar_mutex_unlock(&proc->mutex); if(thread->started && proc->streaming) _zbar_process_image(proc, img); zbar_image_destroy(img); _zbar_mutex_lock(&proc->mutex); /* release API lock */ _zbar_processor_unlock(proc, 0); } thread->running = 0; _zbar_event_trigger(&thread->activity); _zbar_mutex_unlock(&proc->mutex); return(0); } static ZTHREAD proc_input_thread (void *arg) { zbar_processor_t *proc = arg; zbar_thread_t *thread = &proc->input_thread; if(proc->window && proc_open(proc)) goto done; _zbar_mutex_lock(&proc->mutex); thread->running = 1; _zbar_event_trigger(&thread->activity); zprintf(4, "spawned input thread\n"); int rc = 0; while(thread->started && rc >= 0) { _zbar_mutex_unlock(&proc->mutex); rc = _zbar_processor_input_wait(proc, &thread->notify, -1); _zbar_mutex_lock(&proc->mutex); } _zbar_mutex_unlock(&proc->mutex); _zbar_processor_close(proc); _zbar_mutex_lock(&proc->mutex); done: thread->running = 0; _zbar_event_trigger(&thread->activity); _zbar_mutex_unlock(&proc->mutex); return(0); } #endif zbar_processor_t *zbar_processor_create (int threaded) { zbar_processor_t *proc = calloc(1, sizeof(zbar_processor_t)); if(!proc) return(NULL); err_init(&proc->err, ZBAR_MOD_PROCESSOR); proc->scanner = zbar_image_scanner_create(); if(!proc->scanner) { free(proc); return(NULL); } proc->threaded = !_zbar_mutex_init(&proc->mutex) && threaded; _zbar_processor_init(proc); return(proc); } void zbar_processor_destroy (zbar_processor_t *proc) { zbar_processor_init(proc, NULL, 0); if(proc->scanner) { zbar_image_scanner_destroy(proc->scanner); proc->scanner = NULL; } _zbar_mutex_destroy(&proc->mutex); _zbar_processor_cleanup(proc); assert(!proc->wait_head); assert(!proc->wait_tail); assert(!proc->wait_next); proc_waiter_t *w, *next; for(w = proc->free_waiter; w; w = next) { next = w->next; _zbar_event_destroy(&w->notify); free(w); } err_cleanup(&proc->err); free(proc); } int zbar_processor_init (zbar_processor_t *proc, const char *dev, int enable_display) { if(proc->video) zbar_processor_set_active(proc, 0); if(proc->window && !proc->input_thread.started) _zbar_processor_close(proc); _zbar_mutex_lock(&proc->mutex); _zbar_thread_stop(&proc->input_thread, &proc->mutex); _zbar_thread_stop(&proc->video_thread, &proc->mutex); _zbar_processor_lock(proc); _zbar_mutex_unlock(&proc->mutex); if(proc->window) { zbar_window_destroy(proc->window); proc->window = NULL; } int rc = 0; if(proc->video) { zbar_video_destroy(proc->video); proc->video = NULL; } if(!dev && !enable_display) /* nothing to do */ goto done; if(enable_display) { proc->window = zbar_window_create(); if(!proc->window) { rc = err_capture(proc, SEV_FATAL, ZBAR_ERR_NOMEM, __func__, "allocating window resources"); goto done; } } if(dev) { proc->video = zbar_video_create(); if(!proc->video) { rc = err_capture(proc, SEV_FATAL, ZBAR_ERR_NOMEM, __func__, "allocating video resources"); goto done; } if(proc->req_width || proc->req_height) zbar_video_request_size(proc->video, proc->req_width, proc->req_height); if(proc->req_intf) zbar_video_request_interface(proc->video, proc->req_intf); if((proc->req_iomode && zbar_video_request_iomode(proc->video, proc->req_iomode)) || zbar_video_open(proc->video, dev)) { rc = err_copy(proc, proc->video); goto done; } } /* spawn blocking video thread */ int video_threaded = (proc->threaded && proc->video && zbar_video_get_fd(proc->video) < 0); if(video_threaded && _zbar_thread_start(&proc->video_thread, proc_video_thread, proc, &proc->mutex)) { rc = err_capture(proc, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "spawning video thread"); goto done; } /* spawn input monitor thread */ int input_threaded = (proc->threaded && (proc->window || (proc->video && !video_threaded))); if(input_threaded && _zbar_thread_start(&proc->input_thread, proc_input_thread, proc, &proc->mutex)) { rc = err_capture(proc, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "spawning input thread"); goto done; } if(proc->window && !input_threaded && (rc = proc_open(proc))) goto done; if(proc->video && proc->force_input) { if(zbar_video_init(proc->video, proc->force_input)) rc = err_copy(proc, proc->video); } else if(proc->video) { int retry = -1; if(proc->window) { retry = zbar_negotiate_format(proc->video, proc->window); if(retry) fprintf(stderr, "WARNING: no compatible input to output format\n" "...trying again with output disabled\n"); } if(retry) retry = zbar_negotiate_format(proc->video, NULL); if(retry) { zprintf(1, "ERROR: no compatible %s format\n", (proc->video) ? "video input" : "window output"); rc = err_capture(proc, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, __func__, "no compatible image format"); } } done: _zbar_mutex_lock(&proc->mutex); proc_leave(proc); return(rc); } zbar_image_data_handler_t* zbar_processor_set_data_handler (zbar_processor_t *proc, zbar_image_data_handler_t *handler, const void *userdata) { zbar_image_data_handler_t *result = NULL; proc_enter(proc); result = proc->handler; proc->handler = handler; proc->userdata = userdata; proc_leave(proc); return(result); } void zbar_processor_set_userdata (zbar_processor_t *proc, void *userdata) { _zbar_mutex_lock(&proc->mutex); proc->userdata = userdata; _zbar_mutex_unlock(&proc->mutex); } void *zbar_processor_get_userdata (const zbar_processor_t *proc) { zbar_processor_t *ncproc = (zbar_processor_t*)proc; _zbar_mutex_lock(&ncproc->mutex); void *userdata = (void*)ncproc->userdata; _zbar_mutex_unlock(&ncproc->mutex); return(userdata); } int zbar_processor_set_config (zbar_processor_t *proc, zbar_symbol_type_t sym, zbar_config_t cfg, int val) { proc_enter(proc); int rc = zbar_image_scanner_set_config(proc->scanner, sym, cfg, val); proc_leave(proc); return(rc); } int zbar_processor_request_size (zbar_processor_t *proc, unsigned width, unsigned height) { proc_enter(proc); proc->req_width = width; proc->req_height = height; proc_leave(proc); return(0); } int zbar_processor_request_interface (zbar_processor_t *proc, int ver) { proc_enter(proc); proc->req_intf = ver; proc_leave(proc); return(0); } int zbar_processor_request_iomode (zbar_processor_t *proc, int iomode) { proc_enter(proc); proc->req_iomode = iomode; proc_leave(proc); return(0); } int zbar_processor_force_format (zbar_processor_t *proc, unsigned long input, unsigned long output) { proc_enter(proc); proc->force_input = input; proc->force_output = output; proc_leave(proc); return(0); } int zbar_processor_is_visible (zbar_processor_t *proc) { proc_enter(proc); int visible = proc->window && proc->visible; proc_leave(proc); return(visible); } int zbar_processor_set_visible (zbar_processor_t *proc, int visible) { proc_enter(proc); _zbar_mutex_unlock(&proc->mutex); int rc = 0; if(proc->window) { if(proc->video) rc = _zbar_processor_set_size(proc, zbar_video_get_width(proc->video), zbar_video_get_height(proc->video)); if(!rc) rc = _zbar_processor_set_visible(proc, visible); if(!rc) proc->visible = (visible != 0); } else if(visible) rc = err_capture(proc, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "processor display window not initialized"); _zbar_mutex_lock(&proc->mutex); proc_leave(proc); return(rc); } const zbar_symbol_set_t* zbar_processor_get_results (const zbar_processor_t *proc) { zbar_processor_t *ncproc = (zbar_processor_t*)proc; proc_enter(ncproc); const zbar_symbol_set_t *syms = proc->syms; if(syms) zbar_symbol_set_ref(syms, 1); proc_leave(ncproc); return(syms); } int zbar_processor_user_wait (zbar_processor_t *proc, int timeout) { proc_enter(proc); _zbar_mutex_unlock(&proc->mutex); int rc = -1; if(proc->visible || proc->streaming || timeout >= 0) { zbar_timer_t timer; rc = _zbar_processor_wait(proc, EVENT_INPUT, _zbar_timer_init(&timer, timeout)); } if(!proc->visible) rc = err_capture(proc, SEV_WARNING, ZBAR_ERR_CLOSED, __func__, "display window not available for input"); if(rc > 0) rc = proc->input; _zbar_mutex_lock(&proc->mutex); proc_leave(proc); return(rc); } int zbar_processor_set_active (zbar_processor_t *proc, int active) { proc_enter(proc); int rc; if(!proc->video) { rc = err_capture(proc, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "video input not initialized"); goto done; } _zbar_mutex_unlock(&proc->mutex); zbar_image_scanner_enable_cache(proc->scanner, active); rc = zbar_video_enable(proc->video, active); if(!rc) { _zbar_mutex_lock(&proc->mutex); proc->streaming = active; _zbar_mutex_unlock(&proc->mutex); rc = _zbar_processor_enable(proc); } else err_copy(proc, proc->video); if(!proc->streaming && proc->window) { if(zbar_window_draw(proc->window, NULL) && !rc) rc = err_copy(proc, proc->window); _zbar_processor_invalidate(proc); } _zbar_mutex_lock(&proc->mutex); if(proc->video_thread.started) _zbar_event_trigger(&proc->video_thread.notify); done: proc_leave(proc); return(rc); } int zbar_process_one (zbar_processor_t *proc, int timeout) { proc_enter(proc); int streaming = proc->streaming; _zbar_mutex_unlock(&proc->mutex); int rc = 0; if(!proc->video) { rc = err_capture(proc, SEV_ERROR, ZBAR_ERR_INVALID, __func__, "video input not initialized"); goto done; } if(!streaming) { rc = zbar_processor_set_active(proc, 1); if(rc) goto done; } zbar_timer_t timer; rc = _zbar_processor_wait(proc, EVENT_OUTPUT, _zbar_timer_init(&timer, timeout)); if(!streaming && zbar_processor_set_active(proc, 0)) rc = -1; done: _zbar_mutex_lock(&proc->mutex); proc_leave(proc); return(rc); } int zbar_process_image (zbar_processor_t *proc, zbar_image_t *img) { proc_enter(proc); _zbar_mutex_unlock(&proc->mutex); int rc = 0; if(img && proc->window) rc = _zbar_processor_set_size(proc, zbar_image_get_width(img), zbar_image_get_height(img)); if(!rc) { zbar_image_scanner_enable_cache(proc->scanner, 0); rc = _zbar_process_image(proc, img); if(proc->streaming) zbar_image_scanner_enable_cache(proc->scanner, 1); } _zbar_mutex_lock(&proc->mutex); proc_leave(proc); return(rc); } zbar-0.10/zbar/processor.h0000644000000000000000000001133611270371414012411 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _PROCESSOR_H_ #define _PROCESSOR_H_ #include #ifdef HAVE_INTTYPES_H # include #endif #include #include #include #include #include "error.h" #include "thread.h" #include "event.h" /* max time to wait for input before looking for the next frame. * only used in unthreaded mode with blocking (non-pollable) video. * NB subject to precision of whatever timer is in use */ #define MAX_INPUT_BLOCK 15/*ms*/ /* platform specific state wrapper */ typedef struct processor_state_s processor_state_t; /* specific notification tracking */ typedef struct proc_waiter_s { struct proc_waiter_s *next; zbar_event_t notify; zbar_thread_id_t requester; unsigned events; } proc_waiter_t; /* high-level API events */ #define EVENT_INPUT 0x01 /* user input */ #define EVENT_OUTPUT 0x02 /* decoded output data available */ #define EVENT_CANCELED 0x80 /* cancelation flag */ #define EVENTS_PENDING (EVENT_INPUT | EVENT_OUTPUT) struct zbar_processor_s { errinfo_t err; /* error reporting */ const void *userdata; /* application data */ zbar_video_t *video; /* input video device abstraction */ zbar_window_t *window; /* output window abstraction */ zbar_image_scanner_t *scanner; /* barcode scanner */ zbar_image_data_handler_t *handler; /* application data handler */ unsigned req_width, req_height; /* application requested video size */ int req_intf, req_iomode; /* application requested interface */ uint32_t force_input; /* force input format (debug) */ uint32_t force_output; /* force format conversion (debug) */ int input; /* user input status */ /* state flags */ int threaded; int visible; /* output window mapped to display */ int streaming; /* video enabled */ int dumping; /* debug image dump */ void *display; /* X display connection */ unsigned long xwin; /* toplevel window */ zbar_thread_t input_thread; /* video input handler */ zbar_thread_t video_thread; /* window event handler */ const zbar_symbol_set_t *syms; /* previous decode results */ zbar_mutex_t mutex; /* shared data mutex */ /* API serialization lock */ int lock_level; zbar_thread_id_t lock_owner; proc_waiter_t *wait_head, *wait_tail, *wait_next; proc_waiter_t *free_waiter; processor_state_t *state; }; /* processor lock API */ extern int _zbar_processor_lock(zbar_processor_t*); extern int _zbar_processor_unlock(zbar_processor_t*, int); extern void _zbar_processor_notify(zbar_processor_t*, unsigned); extern int _zbar_processor_wait(zbar_processor_t*, unsigned, zbar_timer_t*); /* platform API */ extern int _zbar_processor_init(zbar_processor_t*); extern int _zbar_processor_cleanup(zbar_processor_t*); extern int _zbar_processor_input_wait(zbar_processor_t*, zbar_event_t*, int); extern int _zbar_processor_enable(zbar_processor_t*); extern int _zbar_process_image(zbar_processor_t*, zbar_image_t*); extern int _zbar_processor_handle_input(zbar_processor_t*, int); /* windowing platform API */ extern int _zbar_processor_open(zbar_processor_t*, char*, unsigned, unsigned); extern int _zbar_processor_close(zbar_processor_t*); extern int _zbar_processor_set_visible(zbar_processor_t*, int); extern int _zbar_processor_set_size(zbar_processor_t*, unsigned, unsigned); extern int _zbar_processor_invalidate(zbar_processor_t*); #endif zbar-0.10/zbar/debug.h0000644000000000000000000000555411270371414011465 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ /* varargs variations on compile time debug spew */ #ifndef DEBUG_LEVEL # ifdef __GNUC__ /* older versions of gcc (< 2.95) require a named varargs parameter */ # define dprintf(args...) # else /* unfortunately named vararg parameter is a gcc-specific extension */ # define dprintf(...) # endif #else # include # ifdef __GNUC__ # define dprintf(level, args...) \ if((level) <= DEBUG_LEVEL) \ fprintf(stderr, args) # else # define dprintf(level, ...) \ if((level) <= DEBUG_LEVEL) \ fprintf(stderr, __VA_ARGS__) # endif #endif /* DEBUG_LEVEL */ /* spew warnings for non-fatal assertions. * returns specified error code if assertion fails. * NB check/return is still performed for NDEBUG * only the message is inhibited * FIXME don't we need varargs hacks here? */ #ifndef NDEBUG # include #if __STDC_VERSION__ < 199901L && !defined(__func__) # if __GNUC__ >= 2 # define __func__ __FUNCTION__ # else # define __func__ "" # endif #endif # define zassert(condition, retval, format, ...) do { \ if(!(condition)) { \ fprintf(stderr, "WARNING: %s:%d: %s:" \ " Assertion \"%s\" failed.\n\t" format, \ __FILE__, __LINE__, __func__, #condition , \ ##__VA_ARGS__); \ return(retval); \ } \ } while(0) #else # define zassert(condition, retval, format, ...) do { \ if(!(condition)) \ return(retval); \ } while(0) #endif zbar-0.10/zbar/processor/0000777000000000000000000000000011270371535012324 500000000000000zbar-0.10/zbar/processor/win.c0000644000000000000000000002262211270371414013201 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "processor.h" #include #include #define WIN_STYLE (WS_CAPTION | \ WS_SYSMENU | \ WS_THICKFRAME | \ WS_MINIMIZEBOX | \ WS_MAXIMIZEBOX) #define EXT_STYLE (WS_EX_APPWINDOW | WS_EX_OVERLAPPEDWINDOW) int _zbar_event_init (zbar_event_t *event) { *event = CreateEvent(NULL, 0, 0, NULL); return((*event) ? 0 : -1); } void _zbar_event_destroy (zbar_event_t *event) { if(*event) { CloseHandle(*event); *event = NULL; } } void _zbar_event_trigger (zbar_event_t *event) { SetEvent(*event); } /* lock must be held */ int _zbar_event_wait (zbar_event_t *event, zbar_mutex_t *lock, zbar_timer_t *timeout) { if(lock) _zbar_mutex_unlock(lock); int rc = WaitForSingleObject(*event, _zbar_timer_check(timeout)); if(lock) _zbar_mutex_lock(lock); if(!rc) return(1); /* got event */ if(rc == WAIT_TIMEOUT) return(0); /* timed out */ return(-1); /* error (FIXME save info) */ } int _zbar_thread_start (zbar_thread_t *thr, zbar_thread_proc_t *proc, void *arg, zbar_mutex_t *lock) { if(thr->started || thr->running) return(-1/*FIXME*/); thr->started = 1; _zbar_event_init(&thr->notify); _zbar_event_init(&thr->activity); HANDLE hthr = CreateThread(NULL, 0, proc, arg, 0, NULL); int rc = (!hthr || _zbar_event_wait(&thr->activity, NULL, NULL) < 0 || !thr->running); CloseHandle(hthr); if(rc) { thr->started = 0; _zbar_event_destroy(&thr->notify); _zbar_event_destroy(&thr->activity); return(-1/*FIXME*/); } return(0); } int _zbar_thread_stop (zbar_thread_t *thr, zbar_mutex_t *lock) { if(thr->started) { thr->started = 0; _zbar_event_trigger(&thr->notify); while(thr->running) /* FIXME time out and abandon? */ _zbar_event_wait(&thr->activity, lock, NULL); _zbar_event_destroy(&thr->notify); _zbar_event_destroy(&thr->activity); } return(0); } static LRESULT CALLBACK win_handle_event (HWND hwnd, UINT message, WPARAM wparam, LPARAM lparam) { zbar_processor_t *proc = (zbar_processor_t*)GetWindowLongPtr(hwnd, GWL_USERDATA); /* initialized during window creation */ if(message == WM_NCCREATE) { proc = ((LPCREATESTRUCT)lparam)->lpCreateParams; assert(proc); SetWindowLongPtr(hwnd, GWL_USERDATA, (LONG_PTR)proc); proc->display = hwnd; zbar_window_attach(proc->window, proc->display, proc->xwin); } else if(!proc) return(DefWindowProc(hwnd, message, wparam, lparam)); switch(message) { case WM_SIZE: { RECT r; GetClientRect(hwnd, &r); zprintf(3, "WM_SIZE %ldx%ld\n", r.right, r.bottom); assert(proc); zbar_window_resize(proc->window, r.right, r.bottom); InvalidateRect(hwnd, NULL, 0); return(0); } case WM_PAINT: { PAINTSTRUCT ps; BeginPaint(hwnd, &ps); if(zbar_window_redraw(proc->window)) { HDC hdc = GetDC(hwnd); RECT r; GetClientRect(hwnd, &r); FillRect(hdc, &r, GetStockObject(BLACK_BRUSH)); ReleaseDC(hwnd, hdc); } EndPaint(hwnd, &ps); return(0); } case WM_CHAR: { _zbar_processor_handle_input(proc, wparam); return(0); } case WM_LBUTTONDOWN: { _zbar_processor_handle_input(proc, 1); return(0); } case WM_MBUTTONDOWN: { _zbar_processor_handle_input(proc, 2); return(0); } case WM_RBUTTONDOWN: { _zbar_processor_handle_input(proc, 3); return(0); } case WM_CLOSE: { zprintf(3, "WM_CLOSE\n"); _zbar_processor_handle_input(proc, -1); return(1); } case WM_DESTROY: { zprintf(3, "WM_DESTROY\n"); proc->display = NULL; zbar_window_attach(proc->window, NULL, 0); return(0); } } return(DefWindowProc(hwnd, message, wparam, lparam)); } static inline int win_handle_events (zbar_processor_t *proc) { int rc = 0; while(1) { MSG msg; rc = PeekMessage(&msg, proc->display, 0, 0, PM_NOYIELD | PM_REMOVE); if(!rc) return(0); if(rc < 0) return(err_capture(proc, SEV_ERROR, ZBAR_ERR_WINAPI, __func__, "failed to obtain event")); TranslateMessage(&msg); DispatchMessage(&msg); } } int _zbar_processor_init (zbar_processor_t *proc) { return(0); } int _zbar_processor_cleanup (zbar_processor_t *proc) { return(0); } int _zbar_processor_input_wait (zbar_processor_t *proc, zbar_event_t *event, int timeout) { int n = (event) ? 1 : 0; int rc = MsgWaitForMultipleObjects(n, event, 0, timeout, QS_ALLINPUT); if(rc == n) { if(win_handle_events(proc) < 0) return(-1); return(1); } if(!rc) return(1); if(rc == WAIT_TIMEOUT) return(0); return(-1); } int _zbar_processor_enable (zbar_processor_t *proc) { return(0); } static inline ATOM win_register_class (HINSTANCE hmod) { BYTE and_mask[1] = { 0xff }; BYTE xor_mask[1] = { 0x00 }; WNDCLASSEX wc = { sizeof(WNDCLASSEX), 0, }; wc.hIcon = LoadIcon(NULL, IDI_APPLICATION); wc.hInstance = hmod; wc.lpfnWndProc = win_handle_event; wc.lpszClassName = "_ZBar Class"; wc.style = CS_HREDRAW | CS_VREDRAW | CS_OWNDC; wc.hCursor = CreateCursor(hmod, 0, 0, 1, 1, and_mask, xor_mask); return(RegisterClassEx(&wc)); } int _zbar_processor_open (zbar_processor_t *proc, char *title, unsigned width, unsigned height) { HMODULE hmod = NULL; if(!GetModuleHandleEx(GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS | GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT, (void*)_zbar_processor_open, (HINSTANCE*)&hmod)) return(err_capture(proc, SEV_ERROR, ZBAR_ERR_WINAPI, __func__, "failed to obtain module handle")); ATOM wca = win_register_class(hmod); if(!wca) return(err_capture(proc, SEV_ERROR, ZBAR_ERR_WINAPI, __func__, "failed to register window class")); RECT r = { 0, 0, width, height }; AdjustWindowRectEx(&r, WIN_STYLE, 0, EXT_STYLE); proc->display = CreateWindowEx(EXT_STYLE, (LPCTSTR)(long)wca, "ZBar", WIN_STYLE, CW_USEDEFAULT, CW_USEDEFAULT, r.right - r.left, r.bottom - r.top, NULL, NULL, hmod, proc); if(!proc->display) return(err_capture(proc, SEV_ERROR, ZBAR_ERR_WINAPI, __func__, "failed to open window")); return(0); } int _zbar_processor_close (zbar_processor_t *proc) { if(proc->display) { DestroyWindow(proc->display); proc->display = NULL; } return(0); } int _zbar_processor_set_visible (zbar_processor_t *proc, int visible) { ShowWindow(proc->display, (visible) ? SW_SHOWNORMAL : SW_HIDE); if(visible) InvalidateRect(proc->display, NULL, 0); /* no error conditions */ return(0); } int _zbar_processor_set_size (zbar_processor_t *proc, unsigned width, unsigned height) { RECT r = { 0, 0, width, height }; AdjustWindowRectEx(&r, GetWindowLong(proc->display, GWL_STYLE), 0, GetWindowLong(proc->display, GWL_EXSTYLE)); if(!SetWindowPos(proc->display, NULL, 0, 0, r.right - r.left, r.bottom - r.top, SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOZORDER | SWP_NOREPOSITION)) return(-1/*FIXME*/); return(0); } int _zbar_processor_invalidate (zbar_processor_t *proc) { if(!InvalidateRect(proc->display, NULL, 0)) return(-1/*FIXME*/); return(0); } zbar-0.10/zbar/processor/lock.c0000644000000000000000000001556711270371414013346 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "processor.h" #include /* the processor api lock is a recursive mutex with added capabilities * to completely drop all lock levels before blocking and atomically * unblock a waiting set. the lock is implemented using a variation * of the "specific notification pattern" [cargill], which makes it * easy to provide these features across platforms with consistent, * predictable semantics. probably overkill, but additional overhead * associated with this mechanism should fall in the noise, as locks * are only exchanged O(frame/image) * * [cargill] * http://www.profcon.com/profcon/cargill/jgf/9809/SpecificNotification.html */ static inline proc_waiter_t *proc_waiter_queue (zbar_processor_t *proc) { proc_waiter_t *waiter = proc->free_waiter; if(waiter) { proc->free_waiter = waiter->next; waiter->events = 0; } else { waiter = calloc(1, sizeof(proc_waiter_t)); _zbar_event_init(&waiter->notify); } waiter->next = NULL; waiter->requester = _zbar_thread_self(); if(proc->wait_head) proc->wait_tail->next = waiter; else proc->wait_head = waiter; proc->wait_tail = waiter; return(waiter); } static inline proc_waiter_t *proc_waiter_dequeue (zbar_processor_t *proc) { proc_waiter_t *prev = proc->wait_next, *waiter; if(prev) waiter = prev->next; else waiter = proc->wait_head; while(waiter && (waiter->events & EVENTS_PENDING)) { prev = waiter; proc->wait_next = waiter; waiter = waiter->next; } if(waiter) { if(prev) prev->next = waiter->next; else proc->wait_head = waiter->next; if(!waiter->next) proc->wait_tail = prev; waiter->next = NULL; proc->lock_level = 1; proc->lock_owner = waiter->requester; } return(waiter); } static inline void proc_waiter_release (zbar_processor_t *proc, proc_waiter_t *waiter) { if(waiter) { waiter->next = proc->free_waiter; proc->free_waiter = waiter; } } int _zbar_processor_lock (zbar_processor_t *proc) { if(!proc->lock_level) { proc->lock_owner = _zbar_thread_self(); proc->lock_level = 1; return(0); } if(_zbar_thread_is_self(proc->lock_owner)) { proc->lock_level++; return(0); } proc_waiter_t *waiter = proc_waiter_queue(proc); _zbar_event_wait(&waiter->notify, &proc->mutex, NULL); assert(proc->lock_level == 1); assert(_zbar_thread_is_self(proc->lock_owner)); proc_waiter_release(proc, waiter); return(0); } int _zbar_processor_unlock (zbar_processor_t *proc, int all) { assert(proc->lock_level > 0); assert(_zbar_thread_is_self(proc->lock_owner)); if(all) proc->lock_level = 0; else proc->lock_level--; if(!proc->lock_level) { proc_waiter_t *waiter = proc_waiter_dequeue(proc); if(waiter) _zbar_event_trigger(&waiter->notify); } return(0); } void _zbar_processor_notify (zbar_processor_t *proc, unsigned events) { proc->wait_next = NULL; proc_waiter_t *waiter; for(waiter = proc->wait_head; waiter; waiter = waiter->next) waiter->events = ((waiter->events & ~events) | (events & EVENT_CANCELED)); if(!proc->lock_level) { waiter = proc_waiter_dequeue(proc); if(waiter) _zbar_event_trigger(&waiter->notify); } } static inline int proc_wait_unthreaded (zbar_processor_t *proc, proc_waiter_t *waiter, zbar_timer_t *timeout) { int blocking = proc->streaming && zbar_video_get_fd(proc->video) < 0; _zbar_mutex_unlock(&proc->mutex); int rc = 1; while(rc > 0 && (waiter->events & EVENTS_PENDING)) { /* FIXME lax w/the locking (though shouldn't matter...) */ if(blocking) { zbar_image_t *img = zbar_video_next_image(proc->video); if(!img) { rc = -1; break; } /* FIXME reacquire API lock! (refactor w/video thread?) */ _zbar_mutex_lock(&proc->mutex); _zbar_process_image(proc, img); zbar_image_destroy(img); _zbar_mutex_unlock(&proc->mutex); } int reltime = _zbar_timer_check(timeout); if(blocking && (reltime < 0 || reltime > MAX_INPUT_BLOCK)) reltime = MAX_INPUT_BLOCK; rc = _zbar_processor_input_wait(proc, NULL, reltime); } _zbar_mutex_lock(&proc->mutex); return(rc); } int _zbar_processor_wait (zbar_processor_t *proc, unsigned events, zbar_timer_t *timeout) { _zbar_mutex_lock(&proc->mutex); int save_level = proc->lock_level; proc_waiter_t *waiter = proc_waiter_queue(proc); waiter->events = events & EVENTS_PENDING; _zbar_processor_unlock(proc, 1); int rc; if(proc->threaded) rc = _zbar_event_wait(&waiter->notify, &proc->mutex, timeout); else rc = proc_wait_unthreaded(proc, waiter, timeout); if(rc <= 0 || !proc->threaded) { /* reacquire api lock */ waiter->events &= EVENT_CANCELED; proc->wait_next = NULL; if(!proc->lock_level) { proc_waiter_t *w = proc_waiter_dequeue(proc); assert(w == waiter); } else _zbar_event_wait(&waiter->notify, &proc->mutex, NULL); } if(rc > 0 && (waiter->events & EVENT_CANCELED)) rc = -1; assert(proc->lock_level == 1); assert(_zbar_thread_is_self(proc->lock_owner)); proc->lock_level = save_level; proc_waiter_release(proc, waiter); _zbar_mutex_unlock(&proc->mutex); return(rc); } zbar-0.10/zbar/processor/x.c0000644000000000000000000002023111270371414012645 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "window.h" #include "processor.h" #include "posix.h" #include #include #include static inline int x_handle_event (zbar_processor_t *proc) { XEvent ev; XNextEvent(proc->display, &ev); switch(ev.type) { case Expose: { /* FIXME ignore when running(?) */ XExposeEvent *exp = (XExposeEvent*)&ev; while(1) { assert(ev.type == Expose); _zbar_window_expose(proc->window, exp->x, exp->y, exp->width, exp->height); if(!exp->count) break; XNextEvent(proc->display, &ev); } zbar_window_redraw(proc->window); break; } case ConfigureNotify: zprintf(3, "resized to %d x %d\n", ev.xconfigure.width, ev.xconfigure.height); zbar_window_resize(proc->window, ev.xconfigure.width, ev.xconfigure.height); _zbar_processor_invalidate(proc); break; case ClientMessage: if((ev.xclient.message_type == XInternAtom(proc->display, "WM_PROTOCOLS", 0)) && ev.xclient.format == 32 && (ev.xclient.data.l[0] == XInternAtom(proc->display, "WM_DELETE_WINDOW", 0))) { zprintf(3, "WM_DELETE_WINDOW\n"); return(_zbar_processor_handle_input(proc, -1)); } case KeyPress: { KeySym key = XLookupKeysym(&ev.xkey, 0); if(IsModifierKey(key)) break; if((key & 0xff00) == 0xff00) key &= 0x00ff; zprintf(16, "KeyPress(%04lx)\n", key); /* FIXME this doesn't really work... */ return(_zbar_processor_handle_input(proc, key & 0xffff)); } case ButtonPress: { zprintf(16, "ButtonPress(%d)\n", ev.xbutton.button); int idx = 1; switch(ev.xbutton.button) { case Button2: idx = 2; break; case Button3: idx = 3; break; case Button4: idx = 4; break; case Button5: idx = 5; break; } return(_zbar_processor_handle_input(proc, idx)); } case DestroyNotify: zprintf(16, "DestroyNotify\n"); zbar_window_attach(proc->window, NULL, 0); proc->xwin = 0; return(0); default: /* ignored */; } return(0); } static int x_handle_events (zbar_processor_t *proc) { int rc = 0; while(rc >= 0 && XPending(proc->display)) rc = x_handle_event(proc); return(rc); } static int x_connection_handler (zbar_processor_t *proc, int i) { _zbar_mutex_lock(&proc->mutex); _zbar_processor_lock(proc); _zbar_mutex_unlock(&proc->mutex); x_handle_events(proc); _zbar_mutex_lock(&proc->mutex); _zbar_processor_unlock(proc, 0); _zbar_mutex_unlock(&proc->mutex); return(0); } static int x_internal_handler (zbar_processor_t *proc, int i) { XProcessInternalConnection(proc->display, proc->state->polling.fds[i].fd); x_connection_handler(proc, i); return(0); } static void x_internal_watcher (Display *display, XPointer client_arg, int fd, Bool opening, XPointer *watch_arg) { zbar_processor_t *proc = (void*)client_arg; if(opening) add_poll(proc, fd, x_internal_handler); else remove_poll(proc, fd); } int _zbar_processor_open (zbar_processor_t *proc, char *title, unsigned width, unsigned height) { proc->display = XOpenDisplay(NULL); if(!proc->display) return(err_capture_str(proc, SEV_ERROR, ZBAR_ERR_XDISPLAY, __func__, "unable to open X display", XDisplayName(NULL))); add_poll(proc, ConnectionNumber(proc->display), x_connection_handler); XAddConnectionWatch(proc->display, x_internal_watcher, (void*)proc); /* must also flush X event queue before polling */ proc->state->pre_poll_handler = x_connection_handler; int screen = DefaultScreen(proc->display); XSetWindowAttributes attr; attr.event_mask = (ExposureMask | StructureNotifyMask | KeyPressMask | ButtonPressMask); proc->xwin = XCreateWindow(proc->display, RootWindow(proc->display, screen), 0, 0, width, height, 0, CopyFromParent, InputOutput, CopyFromParent, CWEventMask, &attr); if(!proc->xwin) { XCloseDisplay(proc->display); return(err_capture(proc, SEV_ERROR, ZBAR_ERR_XPROTO, __func__, "creating window")); } XStoreName(proc->display, proc->xwin, title); XClassHint *class_hint = XAllocClassHint(); class_hint->res_name = "zbar"; class_hint->res_class = "zbar"; XSetClassHint(proc->display, proc->xwin, class_hint); XFree(class_hint); class_hint = NULL; Atom wm_delete_window = XInternAtom(proc->display, "WM_DELETE_WINDOW", 0); if(wm_delete_window) XSetWMProtocols(proc->display, proc->xwin, &wm_delete_window, 1); if(zbar_window_attach(proc->window, proc->display, proc->xwin)) return(err_copy(proc, proc->window)); return(0); } int _zbar_processor_close (zbar_processor_t *proc) { if(proc->window) zbar_window_attach(proc->window, NULL, 0); if(proc->display) { if(proc->xwin) { XDestroyWindow(proc->display, proc->xwin); proc->xwin = 0; } proc->state->pre_poll_handler = NULL; remove_poll(proc, ConnectionNumber(proc->display)); XCloseDisplay(proc->display); proc->display = NULL; } return(0); } int _zbar_processor_invalidate (zbar_processor_t *proc) { if(!proc->display || !proc->xwin) return(0); XClearArea(proc->display, proc->xwin, 0, 0, 0, 0, 1); XFlush(proc->display); return(0); } int _zbar_processor_set_size (zbar_processor_t *proc, unsigned width, unsigned height) { if(!proc->display || !proc->xwin) return(0); /* refuse to resize greater than (default) screen size */ XWindowAttributes attr; XGetWindowAttributes(proc->display, proc->xwin, &attr); int maxw = WidthOfScreen(attr.screen); int maxh = HeightOfScreen(attr.screen); int w, h; if(width > maxw) { h = (maxw * height + width - 1) / width; w = maxw; } else { w = width; h = height; } if(h > maxh) { w = (maxh * width + height - 1) / height; h = maxh; } assert(w <= maxw); assert(h <= maxh); XResizeWindow(proc->display, proc->xwin, w, h); XFlush(proc->display); return(0); } int _zbar_processor_set_visible (zbar_processor_t *proc, int visible) { if(visible) XMapRaised(proc->display, proc->xwin); else XUnmapWindow(proc->display, proc->xwin); XFlush(proc->display); return(0); } zbar-0.10/zbar/processor/posix.h0000644000000000000000000001037011270371414013550 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _PROCESSOR_POSIX_H_ #define _PROCESSOR_POSIX_H_ #include "processor.h" #ifdef HAVE_POLL_H # include #endif #ifdef HAVE_POLL_H typedef int (poll_handler_t)(zbar_processor_t*, int); /* poll information */ typedef struct poll_desc_s { int num; /* number of descriptors */ struct pollfd *fds; /* poll descriptors */ poll_handler_t **handlers; /* poll handlers */ } poll_desc_t; #endif struct processor_state_s { #ifdef HAVE_POLL_H poll_desc_t polling; /* polling registration */ poll_desc_t thr_polling; /* thread copy */ #endif int kick_fds[2]; /* poll kicker */ poll_handler_t *pre_poll_handler; /* special case */ }; #ifdef HAVE_POLL_H static inline int alloc_polls (volatile poll_desc_t *p) { p->fds = realloc(p->fds, p->num * sizeof(struct pollfd)); p->handlers = realloc(p->handlers, p->num * sizeof(poll_handler_t*)); /* FIXME should check for ENOMEM */ return(0); } static inline int add_poll (zbar_processor_t *proc, int fd, poll_handler_t *handler) { processor_state_t *state = proc->state; _zbar_mutex_lock(&proc->mutex); poll_desc_t *polling = &state->polling; unsigned i = polling->num++; zprintf(5, "[%d] fd=%d handler=%p\n", i, fd, handler); if(!alloc_polls(polling)) { memset(&polling->fds[i], 0, sizeof(struct pollfd)); polling->fds[i].fd = fd; polling->fds[i].events = POLLIN; polling->handlers[i] = handler; } else i = -1; _zbar_mutex_unlock(&proc->mutex); if(proc->input_thread.started) { assert(state->kick_fds[1] >= 0); if(write(state->kick_fds[1], &i /* unused */, sizeof(unsigned)) < 0) return(-1); } else if(!proc->threaded) { state->thr_polling.num = polling->num; state->thr_polling.fds = polling->fds; state->thr_polling.handlers = polling->handlers; } return(i); } static inline int remove_poll (zbar_processor_t *proc, int fd) { processor_state_t *state = proc->state; _zbar_mutex_lock(&proc->mutex); poll_desc_t *polling = &state->polling; int i; for(i = polling->num - 1; i >= 0; i--) if(polling->fds[i].fd == fd) break; zprintf(5, "[%d] fd=%d n=%d\n", i, fd, polling->num); if(i >= 0) { if(i + 1 < polling->num) { int n = polling->num - i - 1; memmove(&polling->fds[i], &polling->fds[i + 1], n * sizeof(struct pollfd)); memmove(&polling->handlers[i], &polling->handlers[i + 1], n * sizeof(poll_handler_t)); } polling->num--; i = alloc_polls(polling); } _zbar_mutex_unlock(&proc->mutex); if(proc->input_thread.started) { if(write(state->kick_fds[1], &i /* unused */, sizeof(unsigned)) < 0) return(-1); } else if(!proc->threaded) { state->thr_polling.num = polling->num; state->thr_polling.fds = polling->fds; state->thr_polling.handlers = polling->handlers; } return(i); } #endif #endif zbar-0.10/zbar/processor/null.c0000644000000000000000000000403611270371414013355 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "processor.h" static inline int null_error (void *m, const char *func) { return(err_capture(m, SEV_ERROR, ZBAR_ERR_UNSUPPORTED, func, "not compiled with output window support")); } int _zbar_processor_open (zbar_processor_t *proc, char *name, unsigned w, unsigned h) { return(null_error(proc, __func__)); } int _zbar_processor_close (zbar_processor_t *proc) { return(null_error(proc, __func__)); } int _zbar_processor_set_visible (zbar_processor_t *proc, int vis) { return(null_error(proc, __func__)); } int _zbar_processor_set_size (zbar_processor_t *proc, unsigned width, unsigned height) { return(null_error(proc, __func__)); } int _zbar_processor_invalidate (zbar_processor_t *proc) { return(null_error(proc, __func__)); } zbar-0.10/zbar/processor/posix.c0000644000000000000000000002220111270371414013537 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "processor.h" #include "posix.h" #include #include #include static inline int proc_sleep (int timeout) { assert(timeout > 0); struct timespec sleepns, remns; sleepns.tv_sec = timeout / 1000; sleepns.tv_nsec = (timeout % 1000) * 1000000; while(nanosleep(&sleepns, &remns) && errno == EINTR) sleepns = remns; return(1); } int _zbar_event_init (zbar_event_t *event) { event->state = 0; event->pollfd = -1; #ifdef HAVE_LIBPTHREAD pthread_cond_init(&event->cond, NULL); #endif return(0); } void _zbar_event_destroy (zbar_event_t *event) { event->state = -1; event->pollfd = -1; #ifdef HAVE_LIBPTHREAD pthread_cond_destroy(&event->cond); #endif } /* lock must be held */ void _zbar_event_trigger (zbar_event_t *event) { event->state = 1; #ifdef HAVE_LIBPTHREAD pthread_cond_broadcast(&event->cond); #endif if(event->pollfd >= 0) { unsigned i = 0; /* unused */ if(write(event->pollfd, &i, sizeof(unsigned)) < 0) perror(""); event->pollfd = -1; } } #ifdef HAVE_LIBPTHREAD /* lock must be held */ int _zbar_event_wait (zbar_event_t *event, zbar_mutex_t *lock, zbar_timer_t *timeout) { int rc = 0; while(!rc && !event->state) { if(!timeout) rc = pthread_cond_wait(&event->cond, lock); else { struct timespec *timer; # if _POSIX_TIMERS > 0 timer = timeout; # else struct timespec tmp; tmp.tv_sec = timeout->tv_sec; tmp.tv_nsec = timeout->tv_usec * 1000; timer = &tmp; # endif rc = pthread_cond_timedwait(&event->cond, lock, timer); } } /* consume/reset event */ event->state = 0; if(!rc) return(1); /* got event */ if(rc == ETIMEDOUT) return(0); /* timed out */ return(-1); /* error (FIXME save info) */ } int _zbar_thread_start (zbar_thread_t *thr, zbar_thread_proc_t *proc, void *arg, zbar_mutex_t *lock) { if(thr->started || thr->running) return(-1/*FIXME*/); thr->started = 1; _zbar_event_init(&thr->notify); _zbar_event_init(&thr->activity); int rc = 0; _zbar_mutex_lock(lock); if(pthread_create(&thr->tid, NULL, proc, arg) || _zbar_event_wait(&thr->activity, lock, NULL) < 0 || !thr->running) { thr->started = 0; _zbar_event_destroy(&thr->notify); _zbar_event_destroy(&thr->activity); /*rc = err_capture_num(proc, SEV_ERROR, ZBAR_ERR_SYSTEM, __func__, "spawning thread", rc);*/ rc = -1/*FIXME*/; } _zbar_mutex_unlock(lock); return(rc); } int _zbar_thread_stop (zbar_thread_t *thr, zbar_mutex_t *lock) { if(thr->started) { thr->started = 0; _zbar_event_trigger(&thr->notify); while(thr->running) /* FIXME time out and abandon? */ _zbar_event_wait(&thr->activity, lock, NULL); pthread_join(thr->tid, NULL); _zbar_event_destroy(&thr->notify); _zbar_event_destroy(&thr->activity); } return(0); } #else int _zbar_event_wait (zbar_event_t *event, zbar_mutex_t *lock, zbar_timer_t *timeout) { int rc = !event->state; if(rc) { if(!timeout) /* FIXME was that error or hang? */ return(-1); int sleep = _zbar_timer_check(timeout); if(sleep) proc_sleep(sleep); } rc = !event->state; /* consume/reset event */ event->state = 0; return(rc); } #endif /* used by poll interface. lock is already held */ static int proc_video_handler (zbar_processor_t *proc, int i) { _zbar_mutex_lock(&proc->mutex); _zbar_processor_lock(proc); _zbar_mutex_unlock(&proc->mutex); zbar_image_t *img = NULL; if(proc->streaming) { /* not expected to block */ img = zbar_video_next_image(proc->video); if(img) _zbar_process_image(proc, img); } _zbar_mutex_lock(&proc->mutex); _zbar_processor_unlock(proc, 0); _zbar_mutex_unlock(&proc->mutex); if(img) zbar_image_destroy(img); return(0); } static inline void proc_cache_polling (processor_state_t *state) { /* make a thread-local copy of polling data */ int n = state->thr_polling.num = state->polling.num; alloc_polls(&state->thr_polling); memcpy(state->thr_polling.fds, state->polling.fds, n * sizeof(struct pollfd)); memcpy(state->thr_polling.handlers, state->polling.handlers, n * sizeof(poll_handler_t*)); } static int proc_kick_handler (zbar_processor_t *proc, int i) { processor_state_t *state = proc->state; zprintf(5, "kicking %d fds\n", state->polling.num); unsigned junk[2]; int rc = read(state->kick_fds[0], junk, 2 * sizeof(unsigned)); assert(proc->threaded); _zbar_mutex_lock(&proc->mutex); proc_cache_polling(proc->state); _zbar_mutex_unlock(&proc->mutex); return(rc); } static inline int proc_poll_inputs (zbar_processor_t *proc, int timeout) { processor_state_t *state = proc->state; if(state->pre_poll_handler) state->pre_poll_handler(proc, -1); poll_desc_t *p = &state->thr_polling; assert(p->num); int rc = poll(p->fds, p->num, timeout); if(rc <= 0) /* FIXME detect and handle fatal errors (somehow) */ return(rc); int i; for(i = p->num - 1; i >= 0; i--) if(p->fds[i].revents) { if(p->handlers[i]) p->handlers[i](proc, i); p->fds[i].revents = 0; /* debug */ rc--; } assert(!rc); return(1); } int _zbar_processor_input_wait (zbar_processor_t *proc, zbar_event_t *event, int timeout) { processor_state_t *state = proc->state; if(state->thr_polling.num) { if(event) { _zbar_mutex_lock(&proc->mutex); event->pollfd = state->kick_fds[1]; _zbar_mutex_unlock(&proc->mutex); } return(proc_poll_inputs(proc, timeout)); } else if(timeout) return(proc_sleep(timeout)); return(-1); } int _zbar_processor_init (zbar_processor_t *proc) { processor_state_t *state = proc->state = calloc(1, sizeof(processor_state_t)); state->kick_fds[0] = state->kick_fds[1] = -1; if(proc->threaded) { /* FIXME check errors */ if(pipe(state->kick_fds)) return(err_capture(proc, SEV_FATAL, ZBAR_ERR_SYSTEM, __func__, "failed to open pipe")); add_poll(proc, state->kick_fds[0], proc_kick_handler); proc_cache_polling(proc->state); } return(0); } int _zbar_processor_cleanup (zbar_processor_t *proc) { processor_state_t *state = proc->state; if(proc->threaded) { close(state->kick_fds[0]); close(state->kick_fds[1]); state->kick_fds[0] = state->kick_fds[1] = -1; } if(state->polling.fds) { free(state->polling.fds); state->polling.fds = NULL; if(!proc->threaded) state->thr_polling.fds = NULL; } if(state->polling.handlers) { free(state->polling.handlers); state->polling.handlers = NULL; if(!proc->threaded) state->thr_polling.handlers = NULL; } if(state->thr_polling.fds) { free(state->thr_polling.fds); state->thr_polling.fds = NULL; } if(state->thr_polling.handlers) { free(state->thr_polling.handlers); state->thr_polling.handlers = NULL; } free(proc->state); proc->state = NULL; return(0); } int _zbar_processor_enable (zbar_processor_t *proc) { int vid_fd = zbar_video_get_fd(proc->video); if(vid_fd < 0) return(0); if(proc->streaming) add_poll(proc, vid_fd, proc_video_handler); else remove_poll(proc, vid_fd); /* FIXME failure recovery? */ return(0); } zbar-0.10/zbar/decoder/0000777000000000000000000000000011270371535011712 500000000000000zbar-0.10/zbar/decoder/i25.h0000644000000000000000000000360211270371414012373 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _I25_H_ #define _I25_H_ /* interleaved 2 of 5 specific decode state */ typedef struct i25_decoder_s { unsigned direction : 1; /* scan direction: 0=fwd/space, 1=rev/bar */ unsigned element : 4; /* element offset 0-8 */ int character : 12; /* character position in symbol */ unsigned s10; /* current character width */ unsigned width; /* last character width */ unsigned config; int configs[NUM_CFGS]; /* int valued configurations */ } i25_decoder_t; /* reset interleaved 2 of 5 specific state */ static inline void i25_reset (i25_decoder_t *i25) { i25->direction = 0; i25->element = 0; i25->character = -1; i25->s10 = 0; } /* decode interleaved 2 of 5 symbols */ zbar_symbol_type_t _zbar_decode_i25(zbar_decoder_t *dcode); #endif zbar-0.10/zbar/decoder/ean.h0000644000000000000000000000570011270371414012540 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _EAN_H_ #define _EAN_H_ /* state of each parallel decode attempt */ typedef struct ean_pass_s { signed char state; /* module position of w[idx] in symbol */ #define STATE_ADDON 0x40 /* scanning add-on */ #define STATE_IDX 0x1f /* element offset into symbol */ unsigned char raw[7]; /* decode in process */ } ean_pass_t; /* EAN/UPC specific decode state */ typedef struct ean_decoder_s { ean_pass_t pass[4]; /* state of each parallel decode attempt */ zbar_symbol_type_t left; /* current holding buffer contents */ zbar_symbol_type_t right; zbar_symbol_type_t addon; unsigned s4; /* character width */ signed char buf[18]; /* holding buffer */ signed char enable; unsigned ean13_config; unsigned ean8_config; unsigned upca_config; unsigned upce_config; unsigned isbn10_config; unsigned isbn13_config; } ean_decoder_t; /* reset EAN/UPC pass specific state */ static inline void ean_new_scan (ean_decoder_t *ean) { ean->pass[0].state = ean->pass[1].state = -1; ean->pass[2].state = ean->pass[3].state = -1; ean->s4 = 0; } /* reset all EAN/UPC state */ static inline void ean_reset (ean_decoder_t *ean) { ean_new_scan(ean); ean->left = ean->right = ean->addon = ZBAR_NONE; } static inline unsigned ean_get_config (ean_decoder_t *ean, zbar_symbol_type_t sym) { switch(sym & ZBAR_SYMBOL) { case ZBAR_EAN13: return(ean->ean13_config); case ZBAR_EAN8: return(ean->ean8_config); case ZBAR_UPCA: return(ean->upca_config); case ZBAR_UPCE: return(ean->upce_config); case ZBAR_ISBN10: return(ean->isbn10_config); case ZBAR_ISBN13: return(ean->isbn13_config); default: return(0); } } /* decode EAN/UPC symbols */ zbar_symbol_type_t _zbar_decode_ean(zbar_decoder_t *dcode); #endif zbar-0.10/zbar/decoder/ean.c0000644000000000000000000005247011270371414012541 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include "decoder.h" #ifdef DEBUG_EAN # define DEBUG_LEVEL (DEBUG_EAN) #endif #include "debug.h" /* partial decode symbol location */ typedef enum symbol_partial_e { EAN_LEFT = 0x0000, EAN_RIGHT = 0x1000, } symbol_partial_t; /* convert compact encoded D2E1E2 to character (bit4 is parity) */ static const unsigned char digits[] = { /* E1 E2 */ 0x06, 0x10, 0x04, 0x13, /* 2 2-5 */ 0x19, 0x08, 0x11, 0x05, /* 3 2-5 (d2 <= thr) */ 0x09, 0x12, 0x07, 0x15, /* 4 2-5 (d2 <= thr) */ 0x16, 0x00, 0x14, 0x03, /* 5 2-5 */ 0x18, 0x01, 0x02, 0x17, /* E1E2=43,44,33,34 (d2 > thr) */ }; static const unsigned char parity_decode[] = { 0xf0, /* [xx] BBBBBB = RIGHT half EAN-13 */ /* UPC-E check digit encoding */ 0xff, 0xff, 0x0f, /* [07] BBBAAA = 0 */ 0xff, 0x1f, /* [0b] BBABAA = 1 */ 0x2f, /* [0d] BBAABA = 2 */ 0xf3, /* [0e] BBAAAB = 3 */ 0xff, 0x4f, /* [13] BABBAA = 4 */ 0x7f, /* [15] BABABA = 7 */ 0xf8, /* [16] BABAAB = 8 */ 0x5f, /* [19] BAABBA = 5 */ 0xf9, /* [1a] BAABAB = 9 */ 0xf6, /* [1c] BAAABB = 6 */ 0xff, /* LEFT half EAN-13 leading digit */ 0xff, 0x6f, /* [23] ABBBAA = 6 */ 0x9f, /* [25] ABBABA = 9 */ 0xf5, /* [26] ABBAAB = 5 */ 0x8f, /* [29] ABABBA = 8 */ 0xf7, /* [2a] ABABAB = 7 */ 0xf4, /* [2c] ABAABB = 4 */ 0xff, 0x3f, /* [31] AABBBA = 3 */ 0xf2, /* [32] AABBAB = 2 */ 0xf1, /* [34] AABABB = 1 */ 0xff, 0xff, 0xff, 0xff, 0x0f, /* [3f] AAAAAA = 0 */ }; #ifdef DEBUG_EAN static unsigned char debug_buf[0x18]; static inline const unsigned char *dsprintbuf(ean_decoder_t *ean) { int i; for(i = 0; i < 7; i++) debug_buf[i] = ((ean->buf[0] < 0 || ean->buf[i] < 0) ? '-' : ean->buf[i] + '0'); debug_buf[i] = ' '; for(; i < 13; i++) debug_buf[i + 1] = ((ean->buf[7] < 0 || ean->buf[i] < 0) ? '-' : ean->buf[i] + '0'); debug_buf[i + 1] = ' '; for(; i < 18; i++) debug_buf[i + 2] = ((ean->buf[13] < 0 || ean->buf[i] < 0) ? '-' : ean->buf[i] + '0'); debug_buf[i + 2] = '\0'; return(debug_buf); } #endif /* evaluate previous N (>= 2) widths as auxiliary pattern, * using preceding 4 as character width */ static inline signed char aux_end (zbar_decoder_t *dcode, unsigned char fwd) { /* reference width from previous character */ unsigned s = calc_s(dcode, 4 + fwd, 4); /* check quiet zone */ unsigned qz = get_width(dcode, 0); if(!fwd && qz && qz < s * 3 / 4) { dprintf(2, " [invalid quiet]"); return(-1); } dprintf(2, " ("); signed char code = 0; unsigned char i; for(i = 1 - fwd; i < 3 + fwd; i++) { unsigned e = get_width(dcode, i) + get_width(dcode, i + 1); dprintf(2, " %d", e); code = (code << 2) | decode_e(e, s, 7); if(code < 0) { dprintf(2, " [invalid end guard]"); return(-1); } } dprintf(2, ") s=%d aux=%x", s, code); return(code); } /* determine possible auxiliary pattern * using current 4 as possible character */ static inline signed char aux_start (zbar_decoder_t *dcode) { /* FIXME NB add-on has no guard in reverse */ unsigned e2 = get_width(dcode, 5) + get_width(dcode, 6); if(decode_e(e2, dcode->ean.s4, 7)) { dprintf(2, " [invalid any]"); return(/*FIXME (get_color(dcode) == ZBAR_SPACE) ? STATE_ADDON : */-1); } unsigned e1 = get_width(dcode, 4) + get_width(dcode, 5); unsigned char E1 = decode_e(e1, dcode->ean.s4, 7); if(get_color(dcode) == ZBAR_BAR) { /* check for quiet-zone */ unsigned qz = get_width(dcode, 7); if(!qz || qz >= dcode->ean.s4 * 3 / 4) { if(!E1) { dprintf(2, " [valid normal]"); return(0); /* normal symbol start */ } else if(E1 == 1) { dprintf(2, " [valid add-on]"); return(STATE_ADDON); /* add-on symbol start */ } } dprintf(2, " [invalid start]"); return(-1); } if(!E1) { /* attempting decode from SPACE => validate center guard */ unsigned e3 = get_width(dcode, 6) + get_width(dcode, 7); if(!decode_e(e3, dcode->ean.s4, 7)) { dprintf(2, " [valid center]"); return(0); /* start after center guard */ } } dprintf(2, " [invalid center]"); return(/*STATE_ADDON*/-1); } /* attempt to decode previous 4 widths (2 bars and 2 spaces) as a character */ static inline signed char decode4 (zbar_decoder_t *dcode) { /* calculate similar edge measurements */ unsigned e1 = ((get_color(dcode) == ZBAR_BAR) ? get_width(dcode, 0) + get_width(dcode, 1) : get_width(dcode, 2) + get_width(dcode, 3)); unsigned e2 = get_width(dcode, 1) + get_width(dcode, 2); dprintf(2, "\n e1=%d e2=%d", e1, e2); /* create compacted encoding for direct lookup */ signed char code = ((decode_e(e1, dcode->ean.s4, 7) << 2) | decode_e(e2, dcode->ean.s4, 7)); if(code < 0) return(-1); dprintf(2, " code=%x", code); /* 4 combinations require additional determinant (D2) E1E2 == 34 (0110) E1E2 == 43 (1001) E1E2 == 33 (0101) E1E2 == 44 (1010) */ if((1 << code) & 0x0660) { /* use sum of bar widths */ unsigned d2 = ((get_color(dcode) == ZBAR_BAR) ? get_width(dcode, 0) + get_width(dcode, 2) : get_width(dcode, 1) + get_width(dcode, 3)); d2 *= 7; unsigned char mid = (((1 << code) & 0x0420) ? 3 /* E1E2 in 33,44 */ : 4); /* E1E2 in 34,43 */ unsigned char alt = d2 > (mid * dcode->ean.s4); if(alt) code = ((code >> 1) & 3) | 0x10; /* compress code space */ dprintf(2, " (d2=%d(%d) alt=%d)", d2, mid * dcode->ean.s4, alt); } dprintf(2, " char=%02x", digits[(unsigned char)code]); zassert(code < 0x14, -1, "code=%02x e1=%x e2=%x s4=%x color=%x\n", code, e1, e2, dcode->ean.s4, get_color(dcode)); return(code); } static inline zbar_symbol_type_t ean_part_end4 (ean_pass_t *pass, unsigned char fwd) { /* extract parity bits */ unsigned char par = ((pass->raw[1] & 0x10) >> 1 | (pass->raw[2] & 0x10) >> 2 | (pass->raw[3] & 0x10) >> 3 | (pass->raw[4] & 0x10) >> 4); dprintf(2, " par=%x", par); if(par && par != 0xf) /* invalid parity combination */ return(ZBAR_NONE); if(!par == fwd) { /* reverse sampled digits */ unsigned char tmp = pass->raw[1]; pass->raw[1] = pass->raw[4]; pass->raw[4] = tmp; tmp = pass->raw[2]; pass->raw[2] = pass->raw[3]; pass->raw[3] = tmp; } dprintf(2, "\n"); dprintf(1, "decode4=%x%x%x%x\n", pass->raw[1] & 0xf, pass->raw[2] & 0xf, pass->raw[3] & 0xf, pass->raw[4] & 0xf); if(!par) return(ZBAR_EAN8 | EAN_RIGHT); return(ZBAR_EAN8 | EAN_LEFT); } static inline zbar_symbol_type_t ean_part_end7 (ean_decoder_t *ean, ean_pass_t *pass, unsigned char fwd) { /* calculate parity index */ unsigned char par = ((fwd) ? ((pass->raw[1] & 0x10) << 1 | (pass->raw[2] & 0x10) | (pass->raw[3] & 0x10) >> 1 | (pass->raw[4] & 0x10) >> 2 | (pass->raw[5] & 0x10) >> 3 | (pass->raw[6] & 0x10) >> 4) : ((pass->raw[1] & 0x10) >> 4 | (pass->raw[2] & 0x10) >> 3 | (pass->raw[3] & 0x10) >> 2 | (pass->raw[4] & 0x10) >> 1 | (pass->raw[5] & 0x10) | (pass->raw[6] & 0x10) << 1)); /* lookup parity combination */ pass->raw[0] = parity_decode[par >> 1]; if(par & 1) pass->raw[0] >>= 4; pass->raw[0] &= 0xf; dprintf(2, " par=%02x(%x)", par, pass->raw[0]); if(pass->raw[0] == 0xf) /* invalid parity combination */ return(ZBAR_NONE); if(!par == fwd) { /* reverse sampled digits */ unsigned char i; for(i = 1; i < 4; i++) { unsigned char tmp = pass->raw[i]; pass->raw[i] = pass->raw[7 - i]; pass->raw[7 - i] = tmp; } } dprintf(2, "\n"); dprintf(1, "decode=%x%x%x%x%x%x%x(%02x)\n", pass->raw[0] & 0xf, pass->raw[1] & 0xf, pass->raw[2] & 0xf, pass->raw[3] & 0xf, pass->raw[4] & 0xf, pass->raw[5] & 0xf, pass->raw[6] & 0xf, par); if(TEST_CFG(ean->ean13_config, ZBAR_CFG_ENABLE)) { if(!par) return(ZBAR_EAN13 | EAN_RIGHT); if(par & 0x20) return(ZBAR_EAN13 | EAN_LEFT); } if(par && !(par & 0x20)) return(ZBAR_UPCE); return(ZBAR_NONE); } /* update state for one of 4 parallel passes */ static inline zbar_symbol_type_t decode_pass (zbar_decoder_t *dcode, ean_pass_t *pass) { pass->state++; unsigned char idx = pass->state & STATE_IDX; unsigned char fwd = pass->state & 1; if(get_color(dcode) == ZBAR_SPACE && (idx == 0x10 || idx == 0x11) && TEST_CFG(dcode->ean.ean8_config, ZBAR_CFG_ENABLE) && !aux_end(dcode, fwd)) { dprintf(2, " fwd=%x", fwd); zbar_symbol_type_t part = ean_part_end4(pass, fwd); pass->state = -1; return(part); } if(!(idx & 0x03) && idx <= 0x14) { if(!dcode->ean.s4) return(0); /* validate guard bars before decoding first char of symbol */ if(!pass->state) { pass->state = aux_start(dcode); if(pass->state < 0) return(0); idx = pass->state & STATE_IDX; } signed char code = decode4(dcode); if(code < 0) pass->state = -1; else { dprintf(2, "\n raw[%x]=%02x =>", idx >> 2, digits[(unsigned char)code]); pass->raw[(idx >> 2) + 1] = digits[(unsigned char)code]; dprintf(2, " raw=%d%d%d%d%d%d%d", pass->raw[0] & 0xf, pass->raw[1] & 0xf, pass->raw[2] & 0xf, pass->raw[3] & 0xf, pass->raw[4] & 0xf, pass->raw[5] & 0xf, pass->raw[6] & 0xf); } } if(get_color(dcode) == ZBAR_SPACE && (idx == 0x18 || idx == 0x19)) { zbar_symbol_type_t part = ZBAR_NONE; dprintf(2, " fwd=%x", fwd); if(!aux_end(dcode, fwd)) part = ean_part_end7(&dcode->ean, pass, fwd); pass->state = -1; return(part); } return(0); } static inline signed char ean_verify_checksum (ean_decoder_t *ean, int n) { unsigned char chk = 0; unsigned char i; for(i = 0; i < n; i++) { unsigned char d = ean->buf[i]; zassert(d < 10, -1, "i=%x d=%x chk=%x %s\n", i, d, chk, _zbar_decoder_buf_dump((void*)ean->buf, 18)); chk += d; if((i ^ n) & 1) { chk += d << 1; if(chk >= 20) chk -= 20; } if(chk >= 10) chk -= 10; } zassert(chk < 10, -1, "chk=%x n=%x %s", chk, n, _zbar_decoder_buf_dump((void*)ean->buf, 18)); if(chk) chk = 10 - chk; unsigned char d = ean->buf[n]; zassert(d < 10, -1, "n=%x d=%x chk=%x %s\n", n, d, chk, _zbar_decoder_buf_dump((void*)ean->buf, 18)); if(chk != d) { dprintf(1, "\nchecksum mismatch %d != %d (%s)\n", chk, d, dsprintbuf(ean)); return(-1); } return(0); } static inline unsigned char isbn10_calc_checksum (ean_decoder_t *ean) { unsigned int chk = 0; unsigned char w; for(w = 10; w > 1; w--) { unsigned char d = ean->buf[13 - w]; zassert(d < 10, '?', "w=%x d=%x chk=%x %s\n", w, d, chk, _zbar_decoder_buf_dump((void*)ean->buf, 18)); chk += d * w; } chk = chk % 11; if(!chk) return('0'); chk = 11 - chk; if(chk < 10) return(chk + '0'); return('X'); } static inline void ean_expand_upce (ean_decoder_t *ean, ean_pass_t *pass) { int i = 0; /* parity encoded digit is checksum */ ean->buf[12] = pass->raw[i++]; unsigned char decode = pass->raw[6] & 0xf; ean->buf[0] = 0; ean->buf[1] = 0; ean->buf[2] = pass->raw[i++] & 0xf; ean->buf[3] = pass->raw[i++] & 0xf; ean->buf[4] = (decode < 3) ? decode : pass->raw[i++] & 0xf; ean->buf[5] = (decode < 4) ? 0 : pass->raw[i++] & 0xf; ean->buf[6] = (decode < 5) ? 0 : pass->raw[i++] & 0xf; ean->buf[7] = 0; ean->buf[8] = 0; ean->buf[9] = (decode < 3) ? pass->raw[i++] & 0xf : 0; ean->buf[10] = (decode < 4) ? pass->raw[i++] & 0xf : 0; ean->buf[11] = (decode < 5) ? pass->raw[i++] & 0xf : decode; } static inline zbar_symbol_type_t integrate_partial (ean_decoder_t *ean, ean_pass_t *pass, zbar_symbol_type_t part) { /* copy raw data into holding buffer */ /* if same partial is not consistent, reset others */ dprintf(2, " integrate part=%x (%s)", part, dsprintbuf(ean)); signed char i, j; if(part & ZBAR_ADDON) { /* FIXME TBD */ for(i = (part == ZBAR_ADDON5) ? 4 : 1; i >= 0; i--) { unsigned char digit = pass->raw[i] & 0xf; if(ean->addon && ean->buf[i + 13] != digit) { /* partial mismatch - reset collected parts */ ean->left = ean->right = ean->addon = ZBAR_NONE; } ean->buf[i + 13] = digit; } ean->addon = part; } else { if((ean->left && ((part & ZBAR_SYMBOL) != ean->left)) || (ean->right && ((part & ZBAR_SYMBOL) != ean->right))) { /* partial mismatch - reset collected parts */ dprintf(2, " rst(type %x %x)", ean->left, ean->right); ean->left = ean->right = ean->addon = ZBAR_NONE; } if(part & EAN_RIGHT) { part &= ZBAR_SYMBOL; j = (part == ZBAR_EAN13) ? 12 : 7; for(i = (part == ZBAR_EAN13) ? 6 : 4; i; i--, j--) { unsigned char digit = pass->raw[i] & 0xf; if(ean->right && ean->buf[j] != digit) { /* partial mismatch - reset collected parts */ dprintf(2, " rst(right)"); ean->left = ean->right = ean->addon = ZBAR_NONE; } ean->buf[j] = digit; } ean->right = part; } else if(part != ZBAR_UPCE) /* EAN_LEFT */ { j = (part == ZBAR_EAN13) ? 6 : 3; for(i = (part == ZBAR_EAN13) ? 6 : 4; j >= 0; i--, j--) { unsigned char digit = pass->raw[i] & 0xf; if(ean->left && ean->buf[j] != digit) { /* partial mismatch - reset collected parts */ dprintf(2, " rst(left)"); ean->left = ean->right = ean->addon = ZBAR_NONE; } ean->buf[j] = digit; } ean->left = part; } else /* ZBAR_UPCE */ ean_expand_upce(ean, pass); } if((part & ZBAR_SYMBOL) != ZBAR_UPCE) { part = (ean->left & ean->right); if(!part) part = ZBAR_PARTIAL; } if(((part == ZBAR_EAN13 || part == ZBAR_UPCE) && ean_verify_checksum(ean, 12)) || (part == ZBAR_EAN8 && ean_verify_checksum(ean, 7))) /* invalid parity */ part = ZBAR_NONE; if(part == ZBAR_EAN13) { /* special case EAN-13 subsets */ if(!ean->buf[0] && TEST_CFG(ean->upca_config, ZBAR_CFG_ENABLE)) part = ZBAR_UPCA; else if(ean->buf[0] == 9 && ean->buf[1] == 7) { /* ISBN-10 has priority over ISBN-13(?) */ if(ean->buf[2] == 8 && TEST_CFG(ean->isbn10_config, ZBAR_CFG_ENABLE)) part = ZBAR_ISBN10; else if((ean->buf[2] == 8 || ean->buf[2] == 9) && TEST_CFG(ean->isbn13_config, ZBAR_CFG_ENABLE)) part = ZBAR_ISBN13; } } else if(part == ZBAR_UPCE) { if(TEST_CFG(ean->upce_config, ZBAR_CFG_ENABLE)) { /* UPC-E was decompressed for checksum verification, * but user requested compressed result */ ean->buf[0] = ean->buf[1] = 0; for(i = 2; i < 8; i++) ean->buf[i] = pass->raw[i - 1] & 0xf; ean->buf[i] = pass->raw[0] & 0xf; } else if(TEST_CFG(ean->upca_config, ZBAR_CFG_ENABLE)) /* UPC-E reported as UPC-A has priority over EAN-13 */ part = ZBAR_UPCA; else if(TEST_CFG(ean->ean13_config, ZBAR_CFG_ENABLE)) part = ZBAR_EAN13; else part = ZBAR_NONE; } if(part > ZBAR_PARTIAL) part |= ean->addon; dprintf(2, " %x/%x=%x", ean->left, ean->right, part); return(part); } /* copy result to output buffer */ static inline void postprocess (zbar_decoder_t *dcode, zbar_symbol_type_t sym) { ean_decoder_t *ean = &dcode->ean; zbar_symbol_type_t base = sym & ZBAR_SYMBOL; int i = 0, j = 0; if(base > ZBAR_PARTIAL) { if(base == ZBAR_UPCA) i = 1; else if(base == ZBAR_UPCE) { i = 1; base--; } else if(base == ZBAR_ISBN13) base = ZBAR_EAN13; else if(base == ZBAR_ISBN10) i = 3; if(base == ZBAR_ISBN10 || !TEST_CFG(ean_get_config(ean, sym), ZBAR_CFG_EMIT_CHECK)) base--; for(; j < base && ean->buf[i] >= 0; i++, j++) dcode->buf[j] = ean->buf[i] + '0'; if((sym & ZBAR_SYMBOL) == ZBAR_ISBN10 && j == 9 && TEST_CFG(ean->isbn10_config, ZBAR_CFG_EMIT_CHECK)) /* recalculate ISBN-10 check digit */ dcode->buf[j++] = isbn10_calc_checksum(ean); } if(sym & ZBAR_ADDON) for(i = 13; ean->buf[i] >= 0; i++, j++) dcode->buf[j] = ean->buf[i] + '0'; dcode->buflen = j; dcode->buf[j] = '\0'; } zbar_symbol_type_t _zbar_decode_ean (zbar_decoder_t *dcode) { /* process upto 4 separate passes */ zbar_symbol_type_t sym = ZBAR_NONE; unsigned char pass_idx = dcode->idx & 3; /* update latest character width */ dcode->ean.s4 -= get_width(dcode, 4); dcode->ean.s4 += get_width(dcode, 0); unsigned char i; for(i = 0; i < 4; i++) { ean_pass_t *pass = &dcode->ean.pass[i]; if(pass->state >= 0 || i == pass_idx) { dprintf(2, " ean[%x/%x]: idx=%x st=%d s=%d", pass_idx, i, dcode->idx, pass->state, dcode->ean.s4); zbar_symbol_type_t part = decode_pass(dcode, pass); if(part) { /* update accumulated data from new partial decode */ sym = integrate_partial(&dcode->ean, pass, part); if(sym) { /* this pass valid => _reset_ all passes */ dprintf(2, " sym=%x", sym); dcode->ean.pass[0].state = dcode->ean.pass[1].state = -1; dcode->ean.pass[2].state = dcode->ean.pass[3].state = -1; if(sym > ZBAR_PARTIAL) { if(!get_lock(dcode, ZBAR_EAN13)) postprocess(dcode, sym); else { dprintf(1, " [locked %d]", dcode->lock); sym = ZBAR_PARTIAL; } } } } dprintf(2, "\n"); } } return(sym); } zbar-0.10/zbar/decoder/qr_finder.h0000644000000000000000000000100611270371414013741 00000000000000#ifndef _DECODER_QR_FINDER_H_ #define _DECODER_QR_FINDER_H_ #include "qrcode.h" /* QR Code symbol finder state */ typedef struct qr_finder_s { unsigned s5; /* finder pattern width */ qr_finder_line line; /* position info needed by decoder */ unsigned config; } qr_finder_t; /* reset QR finder specific state */ static inline void qr_finder_reset (qr_finder_t *qrf) { qrf->s5 = 0; } /* find QR Code symbols */ zbar_symbol_type_t _zbar_find_qr (zbar_decoder_t *dcode); #endif zbar-0.10/zbar/decoder/pdf417.c0000644000000000000000000001526511270371414013004 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include "decoder.h" #include "pdf417_hash.h" #ifdef DEBUG_PDF417 # define DEBUG_LEVEL (DEBUG_PDF417) #endif #include "debug.h" #define PDF417_STOP 0xbff static inline signed short pdf417_decode8 (zbar_decoder_t *dcode) { /* build edge signature of character * from similar edge measurements */ unsigned s = dcode->pdf417.s8; dprintf(2, " s=%d ", s); if(s < 8) return(-1); long sig = 0; signed char e; unsigned char i; for(i = 0; i < 7; i++) { if(get_color(dcode) == ZBAR_SPACE) e = decode_e(get_width(dcode, i) + get_width(dcode, i + 1), s, 17); else e = decode_e(get_width(dcode, 7 - i) + get_width(dcode, 6 - i), s, 17); dprintf(4, "%x", e); if(e < 0 || e > 8) return(-1); sig = (sig << 3) ^ e; } dprintf(2, " sig=%06lx", sig); /* determine cluster number */ int clst = ((sig & 7) - ((sig >> 3) & 7) + ((sig >> 12) & 7) - ((sig >> 15) & 7)); if(clst < 0) clst += 9; dprintf(2, " k=%d", clst); zassert(clst >= 0 && clst < 9, -1, "dir=%x sig=%lx k=%x %s\n", dcode->pdf417.direction, sig, clst, _zbar_decoder_buf_dump(dcode->buf, dcode->pdf417.character)); if(clst != 0 && clst != 3 && clst != 6) { if(get_color(dcode) && clst == 7 && sig == 0x080007) return(PDF417_STOP); return(-1); } signed short g[3]; sig &= 0x3ffff; g[0] = pdf417_hash[(sig - (sig >> 10)) & PDF417_HASH_MASK]; g[1] = pdf417_hash[((sig >> 8) - sig) & PDF417_HASH_MASK]; g[2] = pdf417_hash[((sig >> 14) - (sig >> 1)) & PDF417_HASH_MASK]; zassert(g[0] >= 0 && g[1] >= 0 && g[2] >= 0, -1, "dir=%x sig=%lx k=%x g0=%03x g1=%03x g2=%03x %s\n", dcode->pdf417.direction, sig, clst, g[0], g[1], g[2], _zbar_decoder_buf_dump(dcode->buf, dcode->pdf417.character)); unsigned short c = (g[0] + g[1] + g[2]) & PDF417_HASH_MASK; dprintf(2, " g0=%x g1=%x g2=%x c=%03d(%d)", g[0], g[1], g[2], c & 0x3ff, c >> 10); return(c); } static inline signed char pdf417_decode_start(zbar_decoder_t *dcode) { unsigned s = dcode->pdf417.s8; if(s < 8) return(0); int ei = decode_e(get_width(dcode, 0) + get_width(dcode, 1), s, 17); int ex = (get_color(dcode) == ZBAR_SPACE) ? 2 : 6; if(ei != ex) return(0); ei = decode_e(get_width(dcode, 1) + get_width(dcode, 2), s, 17); if(ei) return(0); ei = decode_e(get_width(dcode, 2) + get_width(dcode, 3), s, 17); ex = (get_color(dcode) == ZBAR_SPACE) ? 0 : 2; if(ei != ex) return(0); ei = decode_e(get_width(dcode, 3) + get_width(dcode, 4), s, 17); ex = (get_color(dcode) == ZBAR_SPACE) ? 0 : 2; if(ei != ex) return(0); ei = decode_e(get_width(dcode, 4) + get_width(dcode, 5), s, 17); if(ei) return(0); ei = decode_e(get_width(dcode, 5) + get_width(dcode, 6), s, 17); if(ei) return(0); ei = decode_e(get_width(dcode, 6) + get_width(dcode, 7), s, 17); ex = (get_color(dcode) == ZBAR_SPACE) ? 7 : 1; if(ei != ex) return(0); ei = decode_e(get_width(dcode, 7) + get_width(dcode, 8), s, 17); ex = (get_color(dcode) == ZBAR_SPACE) ? 8 : 1; if(get_color(dcode) == ZBAR_BAR) { /* stop character has extra bar */ if(ei != 1) return(0); ei = decode_e(get_width(dcode, 8) + get_width(dcode, 9), s, 17); } dprintf(2, " pdf417[%c]: s=%d", (get_color(dcode)) ? '<' : '>', s); /* check quiet zone */ if(ei >= 0 && ei < ex) { dprintf(2, " [invalid quiet]\n"); return(0); } /* lock shared resources */ if(get_lock(dcode, ZBAR_PDF417)) { dprintf(2, " [locked %d]\n", dcode->lock); return(0); } pdf417_decoder_t *dcode417 = &dcode->pdf417; dcode417->direction = get_color(dcode); dcode417->element = 0; dcode417->character = 0; dprintf(2, " [valid start]\n"); return(ZBAR_PARTIAL); } zbar_symbol_type_t _zbar_decode_pdf417 (zbar_decoder_t *dcode) { pdf417_decoder_t *dcode417 = &dcode->pdf417; /* update latest character width */ dcode417->s8 -= get_width(dcode, 8); dcode417->s8 += get_width(dcode, 0); if(dcode417->character < 0) { pdf417_decode_start(dcode); dprintf(4, "\n"); return(0); } /* process every 8th element of active symbol */ if(++dcode417->element) return(0); dcode417->element = 0; dprintf(2, " pdf417[%c%02d]:", (dcode417->direction) ? '<' : '>', dcode417->character); if(get_color(dcode) != dcode417->direction) { int c = dcode417->character; dcode->lock = 0; dcode417->character = -1; zassert(get_color(dcode) == dcode417->direction, ZBAR_NONE, "color=%x dir=%x char=%d elem=0 %s\n", get_color(dcode), dcode417->direction, c, _zbar_decoder_buf_dump(dcode->buf, c)); } signed short c = pdf417_decode8(dcode); if((c < 0) || ((dcode417->character >= BUFFER_MIN) && size_buf(dcode, dcode417->character + 1))) { dprintf(1, (c < 0) ? " [aborted]\n" : " [overflow]\n"); dcode->lock = 0; dcode417->character = -1; return(0); } /* FIXME TBD infer dimensions, save codewords */ if(c == PDF417_STOP) { dprintf(1, " [valid stop]"); /* FIXME check trailing bar and qz */ dcode->lock = 0; dcode417->character = -1; } dprintf(2, "\n"); return(0); } zbar-0.10/zbar/decoder/pdf417_hash.h0000644000000000000000000007340611270371414014015 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _PDF417_HASH_H_ #define _PDF417_HASH_H_ /* PDF417 bar to codeword decode table */ #define PDF417_HASH_MASK 0xfff static const signed short pdf417_hash[PDF417_HASH_MASK + 1] = { 0x170, 0xd8e, 0x02e, 0x000, 0xa21, 0xc99, 0x000, 0xf06, 0xdaa, 0x7a1, 0xc5f, 0x7ff, 0xbcf, 0xac8, 0x000, 0xc51, 0x49a, 0x5c7, 0x000, 0xef2, 0x000, 0x7dd, 0x9ee, 0xe32, 0x1b7, 0x489, 0x3b7, 0xe70, 0x9c8, 0xe5e, 0xdf4, 0x599, 0x4e0, 0x608, 0x639, 0xead, 0x0ac, 0x57c, 0x000, 0x20d, 0x61b, 0x000, 0x7d1, 0x80f, 0x803, 0x000, 0x946, 0x093, 0x79c, 0xf9c, 0xb34, 0x6d8, 0x4f1, 0x975, 0x886, 0x313, 0xe8a, 0xf20, 0x3c9, 0xa92, 0xb90, 0xa1d, 0x091, 0x0ac, 0xb50, 0x3af, 0x90a, 0x45a, 0x815, 0xf29, 0xb20, 0xb6d, 0xc5c, 0x1cd, 0x1e2, 0x1bf, 0x963, 0x80b, 0xa7c, 0x9b7, 0xb65, 0x6b7, 0x117, 0xc04, 0x000, 0x18e, 0x000, 0x77f, 0xe0e, 0xf48, 0x370, 0x818, 0x379, 0x000, 0x090, 0xe77, 0xd99, 0x8b8, 0xb95, 0x8a9, 0x94c, 0xc48, 0x679, 0x000, 0x41a, 0x9ea, 0xb0e, 0x9c1, 0x1b4, 0x000, 0x630, 0x811, 0x4b1, 0xc05, 0x98f, 0xa68, 0x485, 0x706, 0xfff, 0x0d9, 0xddc, 0x000, 0x83f, 0x54e, 0x290, 0xfe7, 0x64f, 0xf36, 0x000, 0x151, 0xb9b, 0x5cd, 0x961, 0x690, -1, 0xa7a, 0x328, 0x707, 0xe6d, 0xe1f, -1, 0x6a0, 0xf3e, 0xb27, 0x315, 0xc8c, 0x6de, 0x996, 0x2f9, 0xc4c, 0x90f, -1, 0xaa7, 0x9e9, 0xfff, 0x0bb, 0x33b, 0xbc6, 0xe17, 0x000, 0x85d, 0x912, 0x5f7, 0x000, 0xff1, 0xba1, 0x086, 0xa1e, 0x85a, 0x4cf, 0xd47, 0x5a9, 0x5dc, 0x0bc, -1, 0x544, 0x522, 0x1ff, 0xfa6, 0xa83, 0xc7d, 0x545, 0xd75, 0xb6f, 0x284, 0xf11, 0xe46, -1, 0x900, 0x0f3, 0xe31, 0x705, 0x06d, 0xd59, 0x67b, 0xe56, -1, 0xde2, 0x000, 0xd42, -1, 0x24b, 0x000, 0xf87, 0x842, -1, 0xbb9, 0x065, 0x626, 0x86a, 0x9f8, -1, 0x7ac, 0xe20, 0xbe9, 0x357, 0xfff, 0xf82, 0x219, 0x9d4, 0x269, 0x8a6, 0x251, 0x0af, 0xd02, 0x09a, 0x803, 0x0a5, 0xfed, 0x278, -1, 0x338, 0x1e5, 0xcad, 0xf9e, 0x73e, 0xb39, 0xe48, 0x754, -1, 0x680, 0xd99, 0x4d4, 0x80b, 0x4be, 0xb0d, 0x5f2, -1, 0x4b1, 0x38a, 0xff5, 0x000, 0xa1b, 0xece, 0xa06, 0x8e6, 0xdcb, 0xcb8, 0xc63, 0x98c, 0x346, 0x69c, 0x299, 0xa52, 0xfff, 0x000, -1, 0x7b2, 0xbf8, 0x2d1, 0xaff, 0x2f2, 0xd69, 0xf20, -1, 0xdcf, 0x9fb, 0x68f, 0x24e, 0xfd7, 0xfdb, 0x894, 0xc8f, 0x615, 0xa25, 0x36d, 0x1bb, 0x064, 0xb80, 0x280, 0xd7a, -1, 0xd75, 0xc90, 0xdce, 0xdce, 0x011, 0x869, 0xb2f, 0xd24, 0xe26, 0x492, 0xe0a, 0xcae, -1, 0x2ac, 0x38c, 0x0b9, 0xc4f, -1, 0x32b, 0x415, 0x49c, 0x11c, 0x816, 0xd08, 0xf5c, 0x356, 0x2b3, 0xfbf, 0x7ff, 0x35d, 0x276, 0x292, 0x4f5, 0x0e2, 0xc68, 0x4c4, 0x000, 0xb5e, 0xd0b, 0xca7, 0x624, 0x247, 0xf0d, 0x017, 0x7ec, 0x2a6, 0x62c, 0x192, 0x610, 0xd98, 0x7a4, 0xfa3, 0x80b, 0x043, 0xd7b, 0x301, 0x69d, 0x7e4, 0x10c, 0xacb, 0x6eb, 0xea7, 0xe65, 0x75d, 0x4f5, 0x5b0, 0xa50, 0x7b6, 0x0ec, -1, 0xcf9, 0x4b4, 0x639, 0x111, 0xbdf, 0xe89, 0x9fa, 0x76b, 0xdf6, 0x2d0, 0x857, 0x3a3, 0x000, 0xa3e, 0x8cb, 0x35f, 0x4f0, 0x022, 0xb38, 0xc12, 0x93c, 0x2fc, 0x546, 0xe6e, 0x91f, 0x145, 0xfff, 0x1af, 0x957, 0xbde, 0x09d, 0xfd2, 0x9df, 0x2dc, 0x07f, 0x115, 0x7bf, 0xa35, 0x061, 0x9bf, 0xc85, 0x918, 0x0c8, 0x317, 0xce5, 0xf28, 0x108, 0x51b, 0x621, 0x188, 0x000, 0x28c, 0xf67, 0x6ef, 0x000, 0xd72, 0xce2, 0x1be, 0x000, 0x000, 0x282, 0x357, -1, 0x4e5, 0x246, 0x859, 0x66c, 0x5d3, 0x9fd, 0x000, 0x000, 0x82f, 0xc29, 0x331, 0xa93, 0x000, 0xae4, 0x48a, 0x254, 0x000, 0x0ba, 0xe83, 0x7c7, 0xb6e, 0x88e, 0x774, 0xf6f, 0x85d, 0x47f, 0xcd6, 0xe41, 0xdb6, 0x000, 0x0f4, 0xb4d, 0x77f, 0x000, 0x901, 0x1a2, 0x44a, 0x482, 0x000, 0xe99, 0xa75, 0x000, 0x7ab, 0x000, 0x0b6, 0x35c, 0x306, 0x11c, 0x08e, 0x6eb, 0x11c, 0x771, 0xff9, 0x1c8, 0x63b, 0x58b, 0x9d2, 0x250, 0x198, 0xfe7, 0xebc, 0x000, 0xa97, 0xacc, 0xd4b, 0x28b, 0x892, 0x150, 0xcf4, 0xbc1, 0x000, 0x662, 0xdd8, 0x61f, 0x903, 0x083, 0x000, 0xc55, 0x02f, 0xc29, 0x4f5, 0xbcf, 0xe27, 0x9e3, 0xb13, 0xadc, 0x845, 0x415, 0x0ae, 0x000, 0xe30, 0x931, 0x84a, 0xb09, 0x250, 0x631, 0x7aa, 0x026, 0xdc9, 0x486, 0x3a7, 0xab0, 0xe04, 0xe1a, 0xe17, 0x611, 0x556, 0xfac, 0x3c6, 0x5ab, 0x002, 0xc16, 0xe60, -1, 0xc51, 0x772, 0x67f, 0xfa9, 0x83c, 0x974, 0x96a, 0xe94, 0x250, 0xa20, 0xc95, 0x65b, 0x479, 0xe48, 0xa35, 0x23f, 0x5cf, 0x40a, 0xcf0, 0xe82, 0x1da, 0x390, 0xc86, 0xa92, 0x433, 0xbed, 0x4a7, 0x09a, 0x15a, 0xb8d, 0x9c7, 0x5fb, 0x8a0, 0x000, 0xf9a, 0xf3c, 0x11c, 0x20c, 0xf23, 0x79d, 0xc79, 0xb71, 0x7af, 0xc5b, 0x771, 0x629, 0x834, 0xb34, 0x20c, 0x940, 0x2ca, 0x60b, 0x000, 0x4cb, 0x70b, 0x000, 0x000, 0x9e8, 0x000, 0xdca, 0x000, 0x1ae, 0xb21, 0xfe3, 0x191, 0x9e1, 0x7f6, 0x04f, 0x64a, 0xba2, 0x59e, 0x1ae, 0x000, 0x728, 0x000, 0x081, 0xecd, 0x946, 0x000, 0xdee, 0x3ff, 0xdf9, 0x1bf, 0x01a, 0x1a9, 0xc58, 0xe05, 0x3bf, 0x5e8, 0x39d, 0xbfa, 0x23f, 0xb8d, -1, 0x000, 0x779, 0x540, 0xf2c, 0x7cc, 0x340, 0x77a, 0xa8e, 0xe8d, 0x2fd, 0xfed, 0x5d1, 0x308, 0x00f, 0xf4a, 0x39b, 0xbe2, 0x0e5, -1, 0xf4d, 0x1fe, 0xf00, 0x867, 0x195, 0x2de, 0x712, 0x000, 0x00c, 0x0a3, 0x1f3, 0x4ee, 0x317, 0x665, 0x000, 0x5d8, 0x291, 0x6c4, 0xa46, 0x492, 0x8d4, 0x647, 0x57f, 0x000, 0x259, 0xd87, 0x5c2, 0x1d8, 0xfad, -1, -1, 0x79f, 0x43a, 0xfd1, 0x164, 0x6e1, 0x350, 0xf00, 0x0e9, 0xac4, 0xe35, 0x307, 0xfff, 0xabb, 0xc1a, 0x768, 0x000, 0x372, 0x839, 0xf4b, 0x1c3, 0xab0, 0xcb6, 0x943, 0xbe9, 0x20f, 0xddc, 0xe18, 0x4eb, 0x21d, 0x530, 0x24c, 0x000, 0xf79, -1, 0x1bd, -1, 0x155, 0x435, -1, 0x132, 0x5c2, 0xb3d, 0x802, 0x733, -1, 0x336, 0xf19, 0xfea, 0xd2a, 0x07f, 0x8e9, 0x000, 0xdab, -1, 0x088, 0x4b1, 0x7ac, 0x000, 0xe66, 0xde0, 0x73c, 0xfff, 0x02f, -1, 0x000, -1, 0x000, 0x562, 0x389, 0xb20, 0x9ea, -1, 0x3f8, 0x567, 0x035, 0xa55, 0x255, 0xc98, 0x65f, -1, 0x1ac, 0x571, 0x13d, 0xf57, 0x32a, 0xbdb, 0x0ec, 0x47d, 0x43a, -1, 0x1aa, 0x9d6, 0x843, -1, 0x244, 0xb03, 0xd0d, 0x579, 0x1b1, 0xea7, 0x000, 0x062, -1, 0x533, 0x1db, 0xf1f, 0x2f7, 0x2df, 0x3e5, 0xdec, 0xc5c, 0x55a, 0xf6c, 0x4c1, 0x5a8, 0xcd4, 0x6fd, 0x1a6, 0x4b8, 0x98a, 0xe17, 0xeb9, 0xfd1, -1, 0x175, 0x4d6, 0xba2, 0x000, 0x614, 0x147, 0x429, 0xfee, -1, 0x0d8, -1, 0x98a, 0xdd2, 0xedd, 0x255, 0xef3, 0x345, 0x000, 0xf3e, -1, -1, 0x210, 0x88a, 0x699, -1, 0x02c, 0xfee, 0x1c1, 0xb38, 0x000, 0x7cc, 0x165, 0x536, -1, 0x1ae, 0xefb, 0x734, -1, 0x1a4, 0x984, 0x804, 0x487, -1, -1, 0x31e, 0x9f2, 0x966, 0x000, 0xcb0, 0x552, 0x0c9, -1, 0x750, 0x650, 0x064, 0xffe, 0xe84, 0x537, 0xee7, 0x834, -1, 0x998, 0xa03, -1, 0xcdf, 0x4be, 0x310, 0x051, 0xf3f, 0x040, 0x973, 0x925, 0x000, 0x000, 0xe51, 0x8b1, 0x468, 0xe11, 0xd4f, 0x374, 0x33a, 0x126, 0x88b, 0x43a, 0xc9b, 0xdb9, 0x3c2, 0x3bd, 0x1ae, 0x000, 0xc4a, 0x000, 0x4c4, 0x859, 0xe5a, 0x000, 0xeb4, 0xd40, 0x87d, 0xc79, 0xe13, 0x50b, -1, 0x724, 0x000, 0x7be, 0x062, 0xe7f, 0xad0, 0x5f3, 0x69e, 0x381, 0x272, 0x50f, 0xac8, 0x053, 0x55e, 0xf19, 0xd71, 0x75b, 0xbf2, 0x000, 0x3ac, 0xdf0, 0xd75, 0x7e3, 0xe75, 0xa13, 0xfd8, 0xbdc, 0x1d9, 0x15f, 0x8cc, 0xba4, 0xb79, 0xb7f, 0x812, 0xfe6, 0x000, 0x2d3, 0xd7b, 0x5d4, 0xad2, 0x316, 0x908, 0x323, 0x758, 0xb0b, 0x965, 0x1a9, 0xdce, 0x660, 0x625, 0xeff, 0x0ed, 0x000, 0x323, 0x986, 0x831, 0x5c5, 0x22f, 0xd49, 0xec6, 0x90e, 0x234, 0x000, 0x80f, 0x16c, 0x528, 0x1f8, 0x2bd, 0x97d, 0xe20, 0xf29, 0x97d, 0x3a0, 0x7fc, 0x086, 0x720, 0x1f9, 0x3eb, 0xf67, 0x423, 0xa55, 0x69e, 0xede, 0x206, 0x7fa, 0x809, 0xfa8, 0xe22, 0x15e, 0x2a0, 0x04a, 0xf7b, 0x4ea, 0xd9a, -1, 0x1d8, 0x0b4, 0xb87, 0x406, -1, 0xcdf, 0x187, 0xf6d, 0x914, 0x4b1, 0x000, 0x104, 0x67e, 0xc74, 0x6da, 0xe67, 0x7d2, 0xd1f, 0x64c, 0x19d, 0x000, 0xa17, 0xfd5, 0x000, 0x8ad, 0xf38, 0xd65, 0xabd, 0x75e, 0x667, 0x632, 0x346, 0xc48, 0xa77, 0x45e, 0x2b5, 0xded, 0x7da, 0x160, 0x560, -1, 0xf4e, 0xb0c, 0xdb0, 0x287, 0x34a, 0x065, 0x439, 0x2ec, 0x679, 0xefa, 0x208, 0xeb1, 0x1b0, 0x8c8, 0xca6, 0x62c, 0xa10, 0x673, 0x000, 0x000, 0xc6a, 0x7b2, 0xbd7, 0xb2b, 0x17a, 0x6f3, 0x1ab, 0xffa, 0x5e0, 0x1fa, 0xb8f, 0xe5c, 0xcab, 0xdbc, 0x10f, 0x000, 0x000, 0xefe, 0x34b, 0x1d9, 0x834, 0x52f, 0xb58, 0x82b, 0x6e8, 0x1f3, 0x719, 0x64e, 0xf55, 0xccd, 0x531, 0x0de, 0x3aa, 0x150, 0x89a, 0x3b9, 0x26e, 0xebc, 0x7ae, 0x670, 0x315, 0x8a9, 0x03b, 0x896, 0x247, 0x2f4, 0x450, 0xd10, 0xb79, 0x0ed, 0x041, -1, 0x707, 0x9e1, 0xed6, 0x6d2, 0x000, 0xfff, 0xb1a, 0x084, 0xaf3, 0x47f, 0x02f, 0xac3, 0x751, 0x8c4, 0x291, 0xadd, 0x000, 0xea1, 0x8ec, 0xf9f, 0x5c2, 0x000, 0xd6b, 0x71e, 0x000, 0xcea, 0x971, 0x5f8, 0x4b9, 0x7c6, 0xb7e, 0x353, 0xd25, 0x423, 0x6ec, 0xb71, 0xf93, 0x000, 0x795, 0xc43, 0xaa2, 0x96a, 0xcbd, 0xb55, 0x184, 0xdf0, 0x3d9, 0xbfe, 0xf79, 0x8f0, 0x22c, 0xeeb, 0x000, 0xa4b, 0xe07, 0xf34, 0xc9d, 0x4be, 0x95b, 0x371, 0x78c, 0x9e9, 0xde6, 0x072, 0xf0d, 0x60b, 0x5a5, 0xab1, 0x000, 0x260, 0x000, 0xd2a, 0xd90, 0x154, 0x4c6, 0x438, 0x5d9, 0x736, 0x062, 0x000, 0x000, 0xb84, 0x72e, 0x0b7, 0x000, 0x050, 0x063, 0xa95, 0x89b, 0x917, 0x049, 0xb14, 0x9a0, 0x734, 0x0c3, 0xd50, 0x917, 0xb02, 0x8cf, 0x453, 0x0af, 0x8e5, 0x000, 0x7aa, 0x5d5, 0x81b, 0x788, 0xb9c, 0x01a, 0x974, 0x000, 0x000, 0x37f, 0xd9f, 0x000, 0xec4, 0x4f4, 0xbff, 0x4fe, 0x860, 0x11c, 0x74e, 0x34a, 0x281, 0x52f, 0xb05, 0xa89, 0xbee, 0x6ad, 0x9fc, 0x9ba, 0xb0b, 0x515, 0x1c7, 0x330, 0xfde, 0x97e, 0x6e7, 0xc45, -1, 0x658, 0x710, 0x28a, 0x921, 0x1de, 0x4a1, 0x9d7, 0xe32, 0xa2d, 0xb0f, 0x545, 0xd6f, 0x329, 0x9b8, 0xb4d, 0x9a0, 0x938, 0x783, 0xfa7, 0xd0a, 0xdc9, 0x0fe, 0x000, 0x249, 0x000, 0x8cd, 0x922, 0x7cd, 0x021, 0xa89, 0x3d5, 0xcee, 0x0a1, 0x6d6, 0x000, -1, 0x48b, 0x000, 0x87a, 0x8bb, 0x9ed, 0x01f, 0xe20, 0xb7f, -1, 0xe95, 0x593, 0x1da, 0x57a, -1, 0xf3a, 0x000, 0x000, -1, -1, 0x160, 0x501, 0x7a3, 0xb59, -1, -1, 0xc7f, -1, 0xf79, -1, -1, 0x48d, 0x781, -1, -1, 0xb74, -1, 0x3c4, 0xbe9, -1, -1, 0x9a4, 0x9ae, 0xa75, -1, -1, 0x9cd, 0x000, -1, -1, -1, 0xc3c, 0x2d4, -1, 0x173, 0xf38, 0x000, -1, 0xee9, -1, 0xb91, 0xcc1, 0x86d, 0x8ab, 0xeb0, 0xec7, 0x687, 0xd98, 0xa95, 0x744, 0xe7c, 0x826, 0x80e, 0x599, 0x3d9, 0xf2f, -1, 0x96a, 0xfd1, 0x174, -1, 0x000, 0x1aa, 0x50e, -1, 0x5a2, 0xbcd, 0x000, -1, 0x019, 0x588, 0x18d, 0x470, 0x812, 0xeec, 0xf63, 0x05c, -1, 0x000, 0xb7f, 0x357, 0x436, 0xbb4, 0x1fb, 0x425, 0x1ed, 0xe13, 0x66c, 0x555, 0xb11, 0x7b5, 0x48d, 0x38d, 0xf72, 0x000, 0x000, 0xa66, 0x4fa, 0xf36, 0x1eb, 0x000, 0x95f, 0x000, 0xd9a, 0x82f, 0x07f, 0x253, 0x70f, 0x915, -1, 0x12d, 0x040, 0x2ca, 0x446, 0x90a, 0x7a8, 0x687, 0x000, 0x04e, 0x74f, 0x1ca, 0x793, 0x3c7, 0x3f0, 0x4c7, 0x000, 0xc30, 0x533, 0x889, 0x9ef, 0xebd, 0x984, 0x18f, 0xfe1, 0x8ea, 0x185, 0x410, 0x107, 0x000, 0x73e, 0xd4b, 0x8fc, 0xd34, 0x1e6, 0x4bf, 0xbac, 0x7c3, 0x000, 0x7c8, 0xb2f, 0x02c, 0xa46, 0x000, 0x0f9, 0x680, 0x94d, 0x6ad, 0x767, 0xfeb, 0x6c7, 0x2d5, 0x43f, 0x9af, 0x261, 0xe83, 0xfa7, 0xb7b, 0xf2d, 0x2f5, 0x4d7, 0x494, 0xbc2, 0x45b, 0x000, 0x17d, 0x5c6, 0xe2b, 0xb20, 0x19e, 0x6ba, 0x973, 0xedd, 0xea8, 0x000, 0x9f3, 0xd9a, 0x7fa, 0xb78, 0x556, 0xbb6, 0xc58, 0x210, 0x000, 0xf9a, 0x56d, 0x48b, 0xf12, 0x000, 0x54d, 0x5f4, 0x1ad, 0x86e, 0xe16, 0x6ff, 0xa35, 0x47e, 0x4c7, 0x93c, -1, -1, 0xc98, 0xd3f, 0x000, 0x788, 0x6ef, 0x959, 0xec2, 0x45e, 0xa4d, 0xa90, 0x000, 0x768, 0x8bb, 0x6ee, 0x7f5, 0x770, 0xfa8, 0xba4, 0xf49, 0x7b8, 0x616, 0x2bd, 0x23f, 0xe8c, 0x9fa, 0xa49, 0x213, 0x98a, 0x2c1, 0x595, 0x885, 0x6de, 0x057, 0x1bc, 0x000, 0xc58, 0x7a8, 0x5c1, 0x3d0, 0xa78, 0xb80, 0x000, 0xc06, -1, 0x428, 0xe92, 0xfa3, 0x341, -1, 0x000, 0x000, 0x1ca, 0x27c, 0xdeb, 0x835, 0x4c8, 0xdb3, 0x000, 0xf9d, 0x000, 0xe81, 0xc22, 0xfce, -1, 0xe6e, 0x96e, 0x161, -1, 0x3b9, 0x945, 0xa95, 0x13d, 0x748, 0x184, 0x588, 0x636, 0xf7e, 0xb44, 0x2b7, 0x217, 0xee5, 0x65a, 0xc47, -1, 0xca3, 0x83e, 0x431, 0xc64, 0x636, 0x06e, 0x404, 0x993, -1, 0xeb3, 0x134, 0x8a3, 0xca9, -1, -1, 0x2ab, 0x000, 0x8ed, 0x877, 0x1a8, 0xc89, 0x000, 0x000, 0xf94, 0x000, 0x709, 0x249, 0x9ac, 0x22a, 0x605, 0x000, 0x000, 0x6b4, 0x00c, 0xc53, 0xf23, 0x005, 0x29f, 0x865, 0xf79, 0x000, 0x5fa, 0x764, 0xe51, 0xbdc, 0xb64, 0x0f3, 0xf29, 0x2f7, 0x5da, 0x000, 0x16f, 0xb8b, 0x255, 0x9cc, 0xe43, 0x279, 0x2c2, 0x483, -1, 0xf7d, 0x7bb, 0x000, 0x9e3, 0xd84, 0xe36, 0x6e6, 0x000, -1, 0x33f, 0x41d, 0x5b5, 0x83e, 0x2f4, 0xf5b, 0x9fc, 0xb1e, -1, 0x8f4, 0xb26, 0x856, 0x3b6, 0x126, 0x4c2, 0x274, 0x0c1, 0xfa9, 0x57d, 0x000, 0x100, 0x7af, 0xc62, 0x000, 0xa55, 0x416, 0x93f, 0x78c, 0xfba, 0x5a2, 0x0c2, 0x4d4, 0xa3e, 0xcc3, 0xe73, 0xd02, 0x8df, 0x3e9, 0xe9a, 0x0f6, 0x32c, 0x23d, 0xdab, 0xf50, 0xfc2, 0x000, 0x065, 0xc23, 0xd3d, 0xc84, 0x35e, 0x000, 0xa24, 0x634, 0x4b4, 0xa52, 0x098, 0xb39, 0x9a4, 0xe71, 0x8aa, 0x741, 0x000, 0xb16, 0x5c2, 0xea1, 0xc01, 0x5c1, 0x30d, 0xca4, 0x201, 0xc9c, 0x717, 0x000, 0xba0, 0x537, 0x619, 0x000, 0xfd9, 0x6dc, 0xdaa, 0x1da, 0xe51, 0xd39, 0xb4c, 0x8a1, 0x098, 0x2f8, 0x191, 0x9dc, 0xdb0, 0x5e1, 0x000, 0xe97, 0xef1, 0x8d3, 0xb0d, 0xfce, 0x336, 0xee1, 0x7a2, 0xbc8, 0x494, 0x580, 0xba7, 0x000, 0x62a, 0x96a, 0x527, 0x859, 0x811, 0xef0, 0x429, 0xef4, 0xf3d, 0x000, 0x9d6, 0xb71, 0x000, 0x14b, 0xf3d, 0xb16, 0x204, 0x0c1, 0xcd4, 0x339, 0x39d, 0xfe3, 0x837, 0x8c7, 0x955, 0x69a, 0x5f6, 0x4c6, -1, 0x3d5, 0x000, 0x0e7, 0x4b1, -1, 0xa3e, 0xb03, 0x1ea, 0xac8, -1, 0x000, 0xed8, -1, 0x4e0, 0x9f7, 0xc91, 0x6b3, -1, -1, 0xa53, 0x290, 0xa64, 0x0e3, 0x3dc, 0xed3, 0xf2f, 0x000, 0xd7c, 0xf44, -1, 0x205, 0x900, 0x864, -1, -1, 0xed3, 0x7d2, 0x000, -1, 0xdd2, 0x79b, 0x000, -1, 0xae6, 0x5cf, 0xde8, 0x000, 0x1f2, -1, 0x2f3, 0x000, -1, 0x2ce, 0xcf2, 0x8f4, 0xee8, 0x165, 0x309, 0x15f, -1, 0x714, 0xbfc, 0x532, 0xad0, 0x151, 0x2d5, 0x0a4, 0x391, -1, 0x0dc, 0x0c1, 0x451, -1, -1, 0x6a0, 0x250, -1, 0xab8, 0x977, 0xa86, 0x407, 0x72f, -1, 0x05f, 0x000, 0xefe, 0x950, 0x4f4, 0x957, -1, 0xd68, 0x26c, 0xa30, 0x4f1, 0x279, 0x584, 0xb34, -1, 0x4d7, 0x258, 0x000, 0x518, 0x685, 0x91c, 0x3ac, 0x0fa, -1, 0x979, 0x40c, 0x506, 0x000, -1, 0x7bd, 0xb97, 0x87f, 0xc06, 0x050, 0x7bf, 0xe3e, 0xc81, 0x000, 0x65e, 0x000, -1, 0xb76, 0xc37, 0x4c4, 0xfc9, 0x336, 0x9fa, 0xaa2, 0x32c, 0xb8b, 0xaa9, 0xc95, 0x85a, 0xa9a, 0x260, 0x4cd, 0x8fe, 0xd3c, 0x982, 0x0d7, 0xbc1, 0xdcf, 0xe62, 0xe0d, 0xf8f, 0xd7b, 0x91a, 0x3e0, 0x33a, 0x1c5, 0xf00, 0xde5, 0xad1, 0xebc, 0xebc, 0x942, 0xd86, 0x3bf, 0x8ce, 0xb8c, 0x000, 0x8d6, 0x784, 0xb74, -1, 0x818, 0x000, 0xfff, 0x07e, 0x029, 0xf48, 0xb65, 0xd81, 0x220, 0x095, 0x21f, 0xac4, 0xb31, -1, 0x864, 0x000, 0x3bd, 0xf85, 0x237, 0x369, 0x2d9, 0xfdf, 0x25a, 0x782, 0x7b8, 0xabd, 0x5e3, 0x438, 0x230, 0xbc4, 0x7ad, 0x00a, 0x441, 0x6dc, 0x2c4, 0xf16, 0x0b3, 0x04c, 0xfd2, 0x8aa, 0xad8, 0x3e4, 0x142, 0x585, 0xc8f, 0x9bf, 0x29b, 0xac9, 0x743, 0xfb5, 0x7fc, 0x05e, 0xd38, 0x002, -1, 0xb4e, 0xd0c, 0x84c, 0xf93, 0x91f, 0xcd2, 0x04f, 0x569, 0xd1b, 0xfc6, 0x630, 0x6f6, 0x1d8, 0x91a, 0x4da, 0x9f5, 0x07a, 0xcf5, 0x634, 0x42f, 0xfff, 0x951, 0x0f9, 0xc01, 0x491, 0xbd6, 0x730, 0xfea, 0x9f4, 0xbfc, 0xf1a, 0x413, 0xa2a, 0xdc6, 0xc87, 0x9db, 0xc2c, 0x30f, 0xdb5, 0x785, 0xbaa, 0x000, 0x000, 0xa49, 0x000, 0x61d, 0xf6f, -1, 0x031, -1, 0x441, 0x7bf, 0x53e, -1, 0x6fd, 0x0f6, -1, 0xadb, -1, 0x000, 0x432, 0x187, 0xd37, 0x154, 0x539, 0xc08, 0xe51, 0x219, 0x1e9, 0x897, 0xa0e, 0x201, 0x447, 0x89f, 0x000, 0x463, 0x726, 0xa05, 0xab9, 0xd01, 0x1e4, 0xfea, 0x895, 0x816, 0x313, 0xae3, 0x3a4, -1, 0x70f, -1, 0xa42, 0x5e9, 0x78e, -1, 0x317, 0x6c8, 0x000, 0xbf7, 0xefd, -1, 0xb17, 0x382, 0xd26, 0x5ff, 0xf81, 0x20b, 0x373, 0x774, 0x081, 0xaae, 0xfdb, 0xe5d, -1, -1, 0xcb7, 0x738, 0x919, 0x933, 0x398, 0x000, 0x14e, -1, 0xe14, 0xbf8, 0x11c, 0x94b, 0x031, -1, 0x000, 0x2d4, 0xd41, 0xdc6, 0x9f6, 0xea7, 0x9e8, 0x2ec, 0x10a, 0x50d, 0xeae, 0xdb0, 0xef0, 0x9c8, 0x000, -1, 0x82e, 0x9d3, 0xdb7, 0x46d, -1, 0x230, 0x73b, 0x45b, -1, -1, 0x000, 0x4a7, -1, -1, 0x47c, 0x10e, 0x4b4, -1, -1, -1, 0x1d7, 0xa5d, 0x233, 0x6b2, 0x6bd, 0x387, 0x7ca, 0xb1a, 0xf75, 0xea4, 0xdc9, 0x98b, 0x80c, 0x702, 0xe22, 0xa6e, 0x6f8, 0x05b, 0x17c, -1, 0x000, 0xebe, 0xc8e, 0xaec, -1, 0x42b, 0xdce, -1, -1, -1, 0xef3, 0xc52, 0x31b, -1, 0xdff, 0xbd0, 0x000, 0xa72, 0x525, 0x9cf, 0x2ff, 0xfc8, 0x37c, 0xbce, 0xd8c, 0xd88, 0x3a6, 0xed8, 0x4ab, 0x000, 0x449, 0x9d7, -1, -1, 0x9be, 0x59f, 0x000, 0x882, -1, 0x742, 0x000, -1, -1, -1, 0xe8b, 0x0f3, 0x771, -1, 0x3ea, 0x8f9, 0xcbb, 0x548, 0x46d, 0x000, -1, 0xf74, 0xa23, 0x15b, -1, 0xaeb, 0x7f8, 0xbe2, 0x000, -1, 0x023, 0x61e, 0x95d, 0x7ac, 0x024, 0x141, 0x561, 0x9fe, 0xb10, -1, 0x623, 0xc47, 0x413, 0x0e7, 0x663, 0xcdf, 0xebe, 0x5c9, 0x573, 0x21d, 0xb28, 0x280, 0xb9f, 0xd1a, 0xecf, 0xff0, 0x000, 0xfc0, 0x085, 0x9c4, 0x48c, 0x000, 0xb0b, 0x43d, -1, 0x73b, 0x802, 0x633, 0x6ef, -1, -1, 0x5c1, 0xea6, 0x0a9, 0xab4, 0xacd, 0xb81, 0xa32, -1, -1, 0xa26, 0x9d5, 0xf7c, -1, 0xf69, 0xdbb, 0x6d5, 0x405, -1, 0xd0a, 0xfe0, 0xf5e, 0xbd7, -1, 0x89a, 0x868, 0xeb2, 0x792, 0x7fe, 0x115, 0x000, 0x8bb, 0xdd1, 0xc40, 0x453, 0xbb3, 0x7cc, 0x3e6, 0x071, 0x0f1, 0xbae, 0xf67, 0x896, 0x38e, 0x86e, 0xfaa, 0xccc, -1, 0x411, 0x8e5, 0x699, 0x2ef, 0x785, 0x9d4, 0xe30, 0xb2e, 0x976, 0x203, 0x035, 0x75d, 0x8f1, 0x144, 0x092, 0x1a5, -1, 0x55f, 0x000, 0xa43, 0x5be, 0x68d, 0x852, 0xb87, 0x9af, 0x0c0, -1, 0xa50, 0x9ca, 0x15f, 0xf06, 0x869, 0x0f3, -1, 0x000, -1, 0x9a9, -1, -1, -1, -1, 0xf05, 0x000, -1, 0x000, 0x4a9, 0xf9d, -1, 0x000, 0xab1, 0x04c, -1, 0xd17, 0x893, 0x763, 0x332, -1, 0xc41, 0x5bd, 0xa72, 0x67c, 0xb78, 0x973, 0x6c7, 0x569, -1, 0x96a, 0xc68, 0x48c, -1, 0x6fa, -1, 0xa2a, 0x44f, -1, 0x73f, 0x28f, 0x536, 0xd91, 0xc86, 0xef8, 0x1f5, 0xfb4, 0x060, 0x230, 0xe10, -1, 0x000, 0x305, 0x0e6, 0xb19, 0x1e2, 0x7fc, 0xf35, -1, 0x7d9, 0x000, 0x000, 0xd2f, 0xb3a, 0x0a2, 0x7c9, 0xda6, 0x37c, 0xe43, -1, 0x7da, 0x0d6, 0x000, -1, 0xd40, -1, 0x156, 0xee9, -1, 0x239, 0x10f, 0x60c, 0x9d4, 0x663, 0x565, 0x603, 0x38b, -1, 0x606, 0x13c, 0x681, 0x436, 0xc29, 0x9c7, 0x1d9, 0x000, 0x0a6, 0x996, 0x231, 0x055, 0x01f, 0x0a3, 0xd96, 0x7c8, 0x0f3, 0xaa7, 0xd99, -1, 0x3be, 0x476, 0x25f, 0x38c, 0xdf3, 0x6d5, 0xcb5, 0xadd, 0x000, 0x136, 0x64d, 0xc0d, 0xe61, 0xd0b, -1, 0x000, 0x535, 0x9c3, 0x279, 0x00c, 0xa87, 0xa31, 0xc4a, 0x167, 0x423, 0xec8, -1, 0x926, 0xa4d, 0x5ba, -1, -1, 0x9bf, 0x000, 0x47f, 0x8f3, 0xd5b, 0xc3b, 0xa18, -1, 0x548, 0x8f7, 0x8cf, 0x000, 0x9bd, 0xaa2, 0x7ec, 0x000, 0xfb8, 0xafd, 0xe68, -1, 0xfa7, 0x31c, 0xef3, 0x288, 0xdf0, 0x1bc, 0xfe9, 0x1ea, 0xa9f, 0x000, 0x53f, 0x000, 0xda6, 0x09c, 0x1bf, 0x09c, 0x31c, 0x0c8, 0x31c, -1, 0x689, 0x211, -1, 0x77f, 0x723, 0xb8f, 0x683, 0x351, -1, 0xb33, 0xce0, -1, 0x61c, 0x073, 0x783, 0x6b2, 0x6a8, 0x729, 0x81b, 0xabf, 0xd15, 0x563, 0x433, -1, 0x823, 0xf99, 0x2c5, -1, 0x367, 0xcc4, 0x934, 0x6f2, 0xdf0, 0xa1f, 0x579, 0x012, -1, 0x508, 0x070, -1, 0x018, 0x270, 0xa6f, -1, 0x7a7, -1, 0x826, 0x4b5, -1, 0x7d8, 0xb20, -1, 0xc28, 0x463, -1, 0xdf9, 0x22c, 0xe17, 0x4f2, 0xe13, 0x4ff, 0x40a, 0xdcb, 0x9ed, 0x34a, 0xeb8, 0xa0e, 0x5f2, 0x594, 0x60d, 0x4b6, 0xd3c, 0x675, 0x1c4, 0xbb5, 0xc73, 0xfad, 0xead, -1, 0xfb6, -1, 0x146, 0xd40, 0x02f, 0x000, 0x302, -1, -1, 0x6e5, 0x000, 0xed7, 0xd8c, 0x7a3, 0x0fc, 0x259, 0x34b, 0xa1b, 0x882, -1, 0x211, 0x000, 0xd30, 0xe02, 0x5cd, 0x53e, 0x11b, 0xa16, -1, 0x24e, -1, 0xace, 0xe9a, -1, 0x5c6, 0x9be, 0x000, 0x169, 0x982, -1, 0x3fd, 0x457, 0x06f, 0x7e7, 0xed1, 0x5ee, 0xcef, 0x62b, 0x26c, 0xc9f, 0xe68, 0x59f, 0x0b5, 0x000, 0x0bc, 0x086, 0x890, 0x005, 0xc42, 0x939, 0xaca, 0xdd9, -1, -1, 0x6e5, 0x0dd, 0x434, 0x297, 0xe21, 0x0f5, -1, 0xa6c, 0x4ad, 0x978, 0x433, 0xa41, 0xd6f, 0x8bf, 0xfb8, -1, 0x928, 0x85e, 0xfb6, 0x5c7, 0x99a, 0x8ec, 0xebc, 0x226, 0x7d4, 0xdcd, 0xc0b, 0x000, 0x7f4, 0xc6f, 0x000, 0x3ad, 0x5b2, -1, 0x67b, -1, 0x568, 0x6e2, -1, -1, -1, 0x3f3, 0xaf5, 0x33f, -1, 0x022, 0x1bd, 0xae5, -1, 0x9c3, 0x000, 0x92b, 0xee5, 0x29c, 0x000, 0x15e, 0xe71, 0xacb, 0x9d2, 0x1a3, 0xb7f, 0xa5b, 0x095, -1, 0xb6e, 0x79f, 0x3d1, 0x7d0, 0x131, 0xcd7, -1, 0x2c3, -1, 0x396, 0x4d2, 0x297, 0x405, 0x634, -1, -1, -1, 0x928, 0xbca, 0xb6c, 0x011, 0xfc0, 0xbaf, 0xbd2, -1, 0x585, 0x000, 0xb8a, 0x7f9, 0xd6b, 0x4eb, 0x9a3, 0x000, -1, 0xaeb, 0xa47, 0xcef, 0x9c6, -1, 0x000, -1, 0x2a9, 0x371, 0xca6, -1, 0xb7d, 0x15f, 0x2a9, -1, 0xe80, 0x7a7, 0x23a, 0x000, 0x000, 0xcc9, 0x60e, -1, 0x130, 0x9cd, 0x498, 0xe25, 0x366, 0x34b, 0x899, 0xe49, 0x1a8, 0xc93, 0x94d, 0x05e, -1, 0x0c2, 0x757, 0xb9d, 0xaa3, 0x086, 0x395, 0x3c3, 0xa2e, 0xf77, 0xcb1, 0x45e, 0x169, 0xbba, 0x367, 0x8cb, 0x260, 0x5a0, 0x8cb, 0x737, 0xa1f, 0xaaf, 0xf92, 0x430, 0x97d, 0x542, 0xb09, -1, 0x774, 0x084, 0x4c0, 0x2b3, 0xaf6, 0x93c, 0x32d, 0xee2, -1, 0x605, 0xece, 0x8eb, 0xc62, 0x01d, 0x000, 0xaba, 0xfc5, 0xb8e, 0xc07, 0xfb6, 0xbca, 0x8f0, 0xd33, -1, 0x283, 0x6d6, 0x6ad, 0x678, 0x51a, 0xc95, 0xda4, 0x962, 0x9ed, 0x307, 0x94a, 0x052, 0xf4e, 0x3bd, 0x210, 0x71a, 0x3c7, 0x5a4, 0x6e7, 0x23a, 0x523, 0x1dc, 0x6b2, 0x5e0, 0xbb0, 0xae4, 0xdb1, 0xd40, 0xc0d, 0x59e, 0x21b, 0x4e6, 0x8be, 0x3b1, 0xc71, 0x5e4, 0x4aa, 0xaf3, 0xa27, 0x43c, 0x9ea, 0x2ee, 0x6b2, 0xd51, 0x59d, 0xd3a, 0xd43, 0x59d, 0x405, 0x2d4, 0x05b, 0x1b9, 0x68b, 0xbfa, 0xbb9, 0x77a, 0xf91, 0xfcb, -1, 0x949, 0x177, 0x68d, 0xcc3, 0xcf2, 0x000, 0xa87, 0x2e6, 0xd2f, 0x111, 0x168, 0x94c, 0x54c, 0x000, 0x0c5, 0x829, 0xcbc, 0xc0b, 0x1ed, 0x836, 0x9d8, 0xbdc, 0xc5e, 0x4e5, 0xb94, 0x6f2, 0x74f, 0x878, 0x3b2, 0x48d, 0xc72, 0xcff, 0xccb, 0x8f9, 0x7ee, 0x869, 0x228, 0x035, 0x81e, 0xcf9, 0x309, 0xdf2, -1, 0x047, 0xdd3, 0xcab, 0x11d, 0xe76, 0xb52, 0xbbd, 0x12d, 0xf37, 0x552, 0x61d, 0xdd8, 0x2cd, 0x298, 0x9e2, 0xf2c, 0x9f7, 0xf41, 0xcb4, 0x277, 0xfde, 0xe7e, 0x82a, 0x86b, 0x9cc, 0x580, 0xfcc, 0x33a, 0x438, 0xd6e, 0x000, 0xc04, 0xd50, 0x681, 0x1b3, 0x322, 0x86c, 0x4a6, 0x000, 0xa17, 0xd53, 0xdc0, 0xb61, 0x323, 0x3d1, 0x3fb, 0x929, 0xa6e, 0x919, 0xae0, 0x283, 0xe6a, 0xed3, 0x371, 0xd51, 0x309, 0x510, 0xd50, 0x6f4, 0xc84, 0x566, 0xba7, 0x75b, 0xbeb, 0x793, 0x58f, 0x974, 0xe77, 0x52c, 0xcef, 0x942, 0xa7c, 0x56a, 0xaa0, 0x784, 0x0ec, 0xad3, 0xccf, 0xecf, 0xc3f, 0x846, 0x1b2, 0x112, 0x4ee, 0x18b, 0xa76, 0xe14, -1, 0xfb1, 0xb4c, -1, 0xd54, 0x0e0, 0x72d, 0xdf0, 0xf0c, 0x881, 0xc60, 0xe1b, 0x000, 0x453, 0xe21, 0xb2a, 0x6df, 0x84f, 0x000, 0x12a, 0x991, 0x587, 0xa4e, 0x522, 0x000, 0xe17, 0xc64, 0x994, 0x4cc, 0x0e5, 0xc2b, 0x8cf, 0x458, 0x992, 0xec0, 0xc80, 0xefb, 0x7b7, 0x863, 0xc0a, 0x250, 0x338, 0xa44, 0x8ab, 0x873, 0x134, 0x23c, 0x4f6, 0x066, 0xd0f, 0xdd6, 0x93d, 0xf20, 0x000, 0x9bb, 0x255, 0xe7b, 0x916, 0x4f3, 0x68e, 0xb82, 0x2b4, 0x9d7, 0xfd1, 0x0fb, 0x11e, 0x204, 0x241, 0x67f, 0x1c4, 0xe91, 0xf41, 0xb4a, -1, 0x6d2, 0xce6, 0xdfb, -1, 0xdd0, 0xb8d, 0x8db, 0x86c, 0x224, 0xdeb, 0x7bb, 0x50e, 0x000, 0xb79, 0x11e, 0x486, 0xd4c, 0x000, 0xa54, 0x946, 0x83a, 0x537, 0x875, 0x000, 0x8e4, 0x95a, 0xdd5, 0x9d5, 0x910, 0x95b, 0x8c8, 0xd22, 0x07c, 0xac0, 0x000, 0x048, 0x170, 0x9b2, 0xcea, 0xb0f, 0x958, 0x0f9, 0xa9e, 0x87a, 0x166, 0x69c, 0x112, 0xde0, 0x487, 0xeca, 0x639, 0x4ee, 0x7fa, 0x2cc, 0x709, 0x87a, 0x5bb, 0xf64, 0x173, 0xdc6, 0xaaf, 0xbff, 0xf2a, 0x8fb, 0xd44, 0x0ca, 0xf34, 0xb3a, 0xeb3, 0xfc5, 0x61d, 0x92f, 0x6fb, 0x1a1, 0xd85, 0x8fe, 0xb6a, 0x0a1, 0x44f, 0x89a, 0xc5d, 0x13b, 0x5cc, 0x000, 0x9ac, 0x9e6, 0xf95, 0x511, 0xf2e, 0xf3c, 0x707, 0xec5, 0xaec, 0xc72, 0xeb1, 0x105, 0xda3, 0xbcb, 0x1d6, 0xf16, 0xd50, 0x306, 0x03f, 0xe6a, 0x25c, 0x9fe, 0xd3f, 0x8a4, 0x7bc, 0x0bc, 0x532, 0x62e, 0x111, 0x797, 0xc2c, 0x9d0, 0x338, 0xbc7, 0xd64, 0xb09, 0x4d6, 0xcba, 0x62c, 0xef2, 0x32b, 0x9c5, 0xc06, 0x38b, 0xbb2, 0x8b7, 0x6f2, 0x7ec, 0xa77, -1, 0x7a3, 0xc95, 0xa91, 0x5d3, 0xffc, -1, 0xe27, 0xa0a, 0x071, 0x9da, 0x000, 0xba3, 0x3fd, 0x120, 0x845, 0x151, 0xb5f, 0x193, 0xe99, 0x0f6, 0x640, 0xef4, 0xe17, 0x46b, 0x432, 0x8a4, 0x415, 0x252, 0x79c, 0xbe5, 0x3f0, 0xb64, 0x984, 0x5a7, 0x1be, 0xedc, -1, 0xd7e, 0x5b4, -1, 0xd27, 0x03e, 0x136, 0xb30, 0xfff, 0x1dc, 0xc32, 0x84a, 0x392, 0xf4f, 0x911, 0x501, 0x836, 0x700, 0x9ac, 0x000, 0xdb5, 0xfa3, 0x5d3, 0x1f8, 0x888, -1, 0xfa4, 0xfe7, 0xd87, 0x9fe, 0x6af, 0x9a5, 0xfd5, 0xf49, 0xded, 0x416, 0x2fc, 0x078, 0xd2e, 0xbf1, 0xcd9, 0x733, -1, 0xb50, 0xd57, 0xaa1, -1, 0x9b0, 0x874, 0x18f, -1, -1, 0x2f9, 0xfbb, 0xf73, 0x646, 0x868, 0x000, 0x000, 0xba2, 0xd74, 0xc8f, 0xe36, 0xcfd, 0x5b8, 0x850, 0x48a, 0x689, 0x7ad, 0xefd, 0x7e1, 0xf45, 0xd9e, 0x0f0, 0x7c0, 0x675, -1, 0xf26, 0x3c0, 0xe2d, 0xb62, 0x276, -1, 0xf90, 0x837, 0xc7c, 0x8ed, 0x08d, 0x1d6, 0x506, 0xac9, 0xd81, 0x1be, 0xf7e, 0x1a3, 0xb2a, 0x5e2, 0x217, 0x1df, 0x5a3, 0x498, 0xfb1, 0x432, 0x2ca, 0x5a1, 0x5d5, 0x135, 0x6f0, -1, 0xf70, 0x000, 0xd4c, 0x634, -1, 0x8ca, 0x198, -1, 0x7b9, 0x629, 0xc16, 0x68c, 0xea2, -1, 0xba0, 0x6d9, 0xce9, 0x7b2, 0x000, 0xf59, 0x252, 0x575, 0x0a8, 0x894, 0x000, 0x824, 0xf63, 0xd70, 0xdd8, 0x856, 0xc77, 0x334, 0xeb2, 0x2b8, 0x307, 0xc34, 0x2e7, 0xa74, 0x6b9, 0x0e1, 0x20f, 0x3ee, 0xf80, 0xa1f, 0x6e6, 0xa03, 0x3c7, 0x72f, 0xfff, 0x156, 0x273, 0x1b7, 0xd90, 0x998, 0x474, 0xf1b, 0x80f, 0xe4c, 0x0ba, 0xfff, 0x85e, 0x3af, 0x58f, 0x000, 0xf6b, 0x71c, 0x4ed, 0xec3, 0x4cb, 0x000, 0xa68, 0x6ca, 0x086, 0x000, 0x6e4, 0xab3, 0xff5, 0x281, 0xf0a, 0xc92, 0x8d5, 0x486, 0xdd1, 0x903, 0x8e3, 0x9df, 0x2ab, 0xd08, 0x144, 0xdcd, 0x281, 0x046, 0x161, 0xe83, 0xf24, 0xce7, 0x30a, 0xf89, 0xf01, 0x308, 0x142, 0x9df, 0x44d, 0x9dd, 0x3ed, 0x81b, 0xd9d, 0x000, 0x8c2, 0xe01, 0xfe6, 0xa20, 0x167, 0xedd, 0xdb1, 0x470, 0xe70, 0x3aa, 0x0ff, 0x4d1, 0xd30, 0x67a, 0xc56, 0x3d8, 0xf2e, 0x86a, 0x18b, 0x3f5, 0x1a7, 0xd97, 0x652, 0x000, 0x00d, 0xbc7, 0xed3, 0x39e, 0xb0d, 0xd8d, 0xc49, 0x2db, 0x44e, 0x820, 0x189, 0xd51, 0x523, 0x161, 0x2eb, 0x41c, 0x951, -1, 0xbb7, -1, -1, 0x0a7, 0x3ed, 0xfaa, 0x18e, 0xa34, 0x820, 0x2b4, -1, 0x8c2, 0x3ee, 0x59d, 0x97b, 0x209, 0x3a2, 0x102, 0x351, 0x6bf, 0xd3f, 0x4fc, 0x55f, 0x4b5, 0xe22, 0xf13, 0x53a, 0x08a, 0x38d, 0xf4b, 0x424, 0xea6, 0x48e, 0x11c, 0x339, 0x5bd, 0xf7c, 0x3bd, 0x15a, 0x35c, 0x854, 0x71b, 0x30f, 0x065, 0x97e, 0x354, 0x28e, 0x344, 0x926, 0xc0b, 0xae0, 0x5db, 0xb3e, 0x661, 0x432, 0x3c8, 0xf5e, 0x368, 0xc85, 0xfff, 0x7f5, 0x0b6, 0x98b, -1, 0x28c, 0x784, 0xb78, 0x50a, 0x696, 0x47c, 0x40d, -1, 0xe4d, 0x5fc, -1, -1, 0xadb, 0x1db, 0x830, 0xd48, -1, 0xf3a, 0xee4, 0xed4, 0xb1a, 0xa14, 0x36d, 0xf1c, 0x774, 0x000, 0x942, 0x278, 0x7ee, 0x000, 0x550, 0x57c, 0x343, 0x22b, 0x324, 0xa34, 0x0ea, 0x230, 0x51b, 0x2d1, 0x500, 0x59f, 0xd56, 0x540, 0x2f4, 0x87d, 0x9e5, 0x9c5, 0x5ea, 0x771, 0x491, 0x206, 0xa4b, 0x4bf, 0xdaf, 0x308, 0xb25, 0x261, 0x991, 0x000, 0x88e, 0x7e8, 0x3d6, 0x15d, 0xebc, 0x6c2, 0xd45, 0x000, 0x3c6, 0x48d, 0x622, 0x758, 0xfa9, 0x3cf, 0x401, 0xcdb, 0xe3f, 0x544, 0xf1f, 0x000, -1, 0x4d4, 0x000, 0x7f1, 0xba4, 0x81c, 0x92f, 0x7d1, 0xa83, 0xa31, 0xe74, 0xa20, 0x475, 0x489, 0xf20, 0x3d1, 0xac1, 0xb2d, 0x6b2, 0x1b6, 0x063, 0xd00, 0xfeb, 0x5ca, 0xb2c, 0xcb2, 0x1cb, 0x251, 0x82b, 0x8ba, 0x40b, 0xf1e, 0xa8a, 0xd24, 0x880, 0x84e, 0x8cb, 0x0a3, 0x000, 0xaf7, 0xf99, 0x6a1, 0x156, 0x382, 0x0a0, 0x000, 0xed1, 0xd07, 0xbf5, 0x000, 0x295, 0xe48, 0x760, 0x019, 0x97f, 0xb46, 0xff5, 0x7c9, 0x1cf, 0xba4, 0x630, 0xe58, 0xda6, 0xd4b, 0xc02, 0xf9f, 0x11c, 0x000, 0xb99, 0x51f, 0x43e, 0x199, 0xdfb, 0x72f, 0x913, 0x509, 0xac5, 0xa2e, 0xcdb, 0x348, 0xb15, 0x472, 0x95d, 0x67f, 0x000, 0x4b9, 0xd78, 0xc87, 0x0f6, 0x281, 0x0bd, 0x924, 0x35e, 0x129, 0xffd, 0xe24, 0x000, 0x640, 0x09b, 0xd10, 0xa0d, 0x000, 0x474, 0x189, 0x49f, 0x62d, 0xcba, 0x561, 0x000, 0x58a, 0xaa1, 0x603, 0x5ab, 0x0c7, 0x00a, 0x784, 0x5e4, 0x7e4, 0xe4d, -1, 0x276, 0x465, 0xee9, 0xe51, 0xdae, 0xbb1, 0x51f, 0xcba, 0x1c3, 0xd70, 0x000, 0x5be, 0x4ea, 0x3cc, 0xf13, 0x811, 0x813, 0x234, 0x7e4, 0xbae, 0xd97, 0xb74, 0x000, 0x76a, 0xda1, 0x000, 0xd8c, 0x53a, 0xc5a, 0x000, 0x000, 0x61b, 0xd87, 0x141, 0x383, 0xe06, 0x6a3, 0x6c3, 0xbcc, 0xc44, 0xf63, 0xd8b, 0x58d, 0x000, 0x839, 0x77a, 0x000, 0x8e4, 0x000, 0xdbe, 0x483, 0xd5b, 0xa9d, 0xca5, 0x431, 0x491, 0x29a, 0x27d, 0x2d2, 0x691, 0x000, 0x19a, 0xa0d, 0xb0b, 0xf32, 0xe49, 0xfbf, 0x399, 0xd20, 0x000, 0x66a, 0x000, 0x447, 0xb20, 0x894, 0x038, 0xc9c, 0xff0, 0x000, 0x0d4, 0xad4, 0x768, 0x65c, 0x000, 0x27b, 0x6c6, 0x9be, 0xd35, 0xc6a, 0xdd3, 0x000, 0x2a7, 0x158, 0x38d, 0x8ef, 0x7b6, 0xd49, 0x30c, 0xec3, 0x211, 0x17c, 0xcd0, 0x61f, 0x000, 0xe6e, 0x1d4, 0x6e9, 0x000, 0xc2d, 0x5c3, 0xcd4, 0x760, 0x532, 0xc94, 0x590, 0x000, 0x4a3, 0xc33, 0x000, 0x426, 0x604, 0xa06, 0xa99, 0x917, 0x0c4, 0xc8d, 0x9e5, 0xcc7, 0x415, 0xf79, 0x000, 0xaf4, 0x622, 0x756, 0x9c2, 0xa51, 0xb0f, 0x4ef, 0xbc4, 0xe15, 0x29e, 0x055, 0x6c9, 0x695, 0x94f, 0x9d6, 0x000, 0xb9f, 0xd46, 0x1d4, 0x000, 0xcb2, 0x9e8, 0x000, 0xa5e, 0xce0, 0x000, 0x098, 0xa98, 0x6d9, 0x5e2, 0x95f, 0x791, 0xeb8, 0x5fa, 0x60a, 0xacc, 0x3d3, 0x4df, 0x0df, 0x9ca, 0x972, 0x3cc, 0x583, 0xca5, 0xe1a, 0x000, 0x2d3, 0x266, 0x000, 0x06c, 0xfff, 0x62d, 0x64e, 0x40c, 0x599, 0x475, 0xaa9, 0xba6, 0x96f, 0xe32, 0x059, 0x342, 0x36d, 0xfd1, 0x09b, 0x878, 0x9f8, 0x000, 0x3ad, 0xdba, 0x000, 0x544, 0xc1a, 0x000, 0xee8, 0x492, 0xa6b, 0x447, 0xd2a, 0xb4e, 0x02c, 0xadb, 0xde2, 0x904, 0x62d, 0xf01, 0xbb8, 0x255, 0x382, 0xfff, 0x29e, 0x000, 0x000, 0x011, 0xfff, }; #endif zbar-0.10/zbar/decoder/code39.h0000644000000000000000000000357711270371414013075 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _CODE39_H_ #define _CODE39_H_ /* Code 39 specific decode state */ typedef struct code39_decoder_s { unsigned direction : 1; /* scan direction: 0=fwd, 1=rev */ unsigned element : 4; /* element offset 0-8 */ int character : 12; /* character position in symbol */ unsigned s9; /* current character width */ unsigned width; /* last character width */ unsigned config; int configs[NUM_CFGS]; /* int valued configurations */ } code39_decoder_t; /* reset Code 39 specific state */ static inline void code39_reset (code39_decoder_t *dcode39) { dcode39->direction = 0; dcode39->element = 0; dcode39->character = -1; dcode39->s9 = 0; } /* decode Code 39 symbols */ zbar_symbol_type_t _zbar_decode_code39(zbar_decoder_t *dcode); #endif zbar-0.10/zbar/decoder/code128.h0000644000000000000000000000352511270371414013145 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _CODE128_H_ #define _CODE128_H_ /* Code 128 specific decode state */ typedef struct code128_decoder_s { unsigned direction : 1; /* scan direction: 0=fwd/space, 1=rev/bar */ unsigned element : 3; /* element offset 0-5 */ int character : 12; /* character position in symbol */ unsigned s6; /* character width */ unsigned config; int configs[NUM_CFGS]; /* int valued configurations */ } code128_decoder_t; /* reset Code 128 specific state */ static inline void code128_reset (code128_decoder_t *dcode128) { dcode128->direction = 0; dcode128->element = 0; dcode128->character = -1; dcode128->s6 = 0; } /* decode Code 128 symbols */ zbar_symbol_type_t _zbar_decode_code128(zbar_decoder_t *dcode); #endif zbar-0.10/zbar/decoder/code39.c0000644000000000000000000002316711270371414013065 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include /* memmove */ #include #include "decoder.h" #ifdef DEBUG_CODE39 # define DEBUG_LEVEL (DEBUG_CODE39) #endif #include "debug.h" #define NUM_CHARS (0x2c) static const unsigned char code39_hi[32] = { 0x80 | 0x00, /* 2 next */ 0x40 | 0x02, /* 4 */ 0x80 | 0x06, /* 2 next */ 0xc0 | 0x08, /* 2 skip */ 0x40 | 0x0a, /* 4 */ 0x80 | 0x0e, /* 2 next */ 0xc0 | 0x10, /* 2 skip */ 0x00 | 0x12, /* direct */ 0x80 | 0x13, /* 2 next */ 0xc0 | 0x15, /* 2 skip */ 0x80 | 0x17, /* 2 next */ 0xff, 0xc0 | 0x19, /* 2 skip */ 0x00 | 0x1b, /* direct */ 0xff, 0xff, 0x40 | 0x1c, /* 4 */ 0x80 | 0x20, /* 2 next */ 0xc0 | 0x22, /* 2 skip */ 0x00 | 0x24, /* direct */ 0x80 | 0x25, /* 2 next */ 0xff, 0x00 | 0x27, /* direct */ 0xff, 0xc0 | 0x28, /* 2 skip */ 0x00 | 0x2a, /* direct */ 0xff, 0xff, 0x00 | 0x2b, /* direct */ 0xff, 0xff, 0xff, }; typedef struct char39_s { unsigned char chk, rev, fwd; } char39_t; static const char39_t code39_encodings[NUM_CHARS] = { { 0x07, 0x1a, 0x20 }, /* 00 */ { 0x0d, 0x10, 0x03 }, /* 01 */ { 0x13, 0x17, 0x22 }, /* 02 */ { 0x16, 0x1d, 0x23 }, /* 03 */ { 0x19, 0x0d, 0x05 }, /* 04 */ { 0x1c, 0x13, 0x06 }, /* 05 */ { 0x25, 0x07, 0x0c }, /* 06 */ { 0x2a, 0x2a, 0x27 }, /* 07 */ { 0x31, 0x04, 0x0e }, /* 08 */ { 0x34, 0x00, 0x0f }, /* 09 */ { 0x43, 0x15, 0x25 }, /* 0a */ { 0x46, 0x1c, 0x26 }, /* 0b */ { 0x49, 0x0b, 0x08 }, /* 0c */ { 0x4c, 0x12, 0x09 }, /* 0d */ { 0x52, 0x19, 0x2b }, /* 0e */ { 0x58, 0x0f, 0x00 }, /* 0f */ { 0x61, 0x02, 0x11 }, /* 10 */ { 0x64, 0x09, 0x12 }, /* 11 */ { 0x70, 0x06, 0x13 }, /* 12 */ { 0x85, 0x24, 0x16 }, /* 13 */ { 0x8a, 0x29, 0x28 }, /* 14 */ { 0x91, 0x21, 0x18 }, /* 15 */ { 0x94, 0x2b, 0x19 }, /* 16 */ { 0xa2, 0x28, 0x29 }, /* 17 */ { 0xa8, 0x27, 0x2a }, /* 18 */ { 0xc1, 0x1f, 0x1b }, /* 19 */ { 0xc4, 0x26, 0x1c }, /* 1a */ { 0xd0, 0x23, 0x1d }, /* 1b */ { 0x03, 0x14, 0x1e }, /* 1c */ { 0x06, 0x1b, 0x1f }, /* 1d */ { 0x09, 0x0a, 0x01 }, /* 1e */ { 0x0c, 0x11, 0x02 }, /* 1f */ { 0x12, 0x18, 0x21 }, /* 20 */ { 0x18, 0x0e, 0x04 }, /* 21 */ { 0x21, 0x01, 0x0a }, /* 22 */ { 0x24, 0x08, 0x0b }, /* 23 */ { 0x30, 0x05, 0x0d }, /* 24 */ { 0x42, 0x16, 0x24 }, /* 25 */ { 0x48, 0x0c, 0x07 }, /* 26 */ { 0x60, 0x03, 0x10 }, /* 27 */ { 0x81, 0x1e, 0x14 }, /* 28 */ { 0x84, 0x25, 0x15 }, /* 29 */ { 0x90, 0x22, 0x17 }, /* 2a */ { 0xc0, 0x20, 0x1a }, /* 2b */ }; static const unsigned char code39_characters[NUM_CHARS] = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+%*"; static inline unsigned char code39_decode1 (unsigned char enc, unsigned e, unsigned s) { unsigned char E = decode_e(e, s, 36); if(E > 7) return(0xff); enc <<= 1; if(E > 2) { enc |= 1; dprintf(2, "1"); } else dprintf(2, "0"); return(enc); } static inline signed char code39_decode9 (zbar_decoder_t *dcode) { code39_decoder_t *dcode39 = &dcode->code39; dprintf(2, " s=%d ", dcode39->s9); if(dcode39->s9 < 9) return(-1); /* threshold bar width ratios */ unsigned char i, enc = 0; for(i = 0; i < 5; i++) { enc = code39_decode1(enc, get_width(dcode, i), dcode39->s9); if(enc == 0xff) return(-1); } zassert(enc < 0x20, -1, " enc=%x s9=%x\n", enc, dcode39->s9); /* lookup first 5 encoded widths for coarse decode */ unsigned char idx = code39_hi[enc]; if(idx == 0xff) return(-1); /* encode remaining widths (NB first encoded width is lost) */ for(; i < 9; i++) { enc = code39_decode1(enc, get_width(dcode, i), dcode39->s9); if(enc == 0xff) return(-1); } if((idx & 0xc0) == 0x80) idx = (idx & 0x3f) + ((enc >> 3) & 1); else if((idx & 0xc0) == 0xc0) idx = (idx & 0x3f) + ((enc >> 2) & 1); else if(idx & 0xc0) idx = (idx & 0x3f) + ((enc >> 2) & 3); zassert(idx < 0x2c, -1, " idx=%x enc=%x s9=%x\n", idx, enc, dcode39->s9); const char39_t *c = &code39_encodings[idx]; dprintf(2, " i=%02x chk=%02x c=%02x/%02x", idx, c->chk, c->fwd, c->rev); if(enc != c->chk) return(-1); dcode39->width = dcode39->s9; return((dcode39->direction) ? c->rev : c->fwd); } static inline signed char code39_decode_start (zbar_decoder_t *dcode) { code39_decoder_t *dcode39 = &dcode->code39; signed char c = code39_decode9(dcode); if(c == 0x19) dcode39->direction ^= 1; else if(c != 0x2b) { dprintf(2, "\n"); return(ZBAR_NONE); } /* check leading quiet zone - spec is 10x */ unsigned quiet = get_width(dcode, 9); if(quiet && quiet < dcode39->s9 / 2) { dprintf(2, " [invalid quiet]\n"); return(ZBAR_NONE); } dcode39->element = 9; dcode39->character = 0; dprintf(1, " dir=%x [valid start]\n", dcode39->direction); return(ZBAR_PARTIAL); } static inline void code39_postprocess (zbar_decoder_t *dcode) { code39_decoder_t *dcode39 = &dcode->code39; int i; if(dcode39->direction) { /* reverse buffer */ dprintf(2, " (rev)"); for(i = 0; i < dcode39->character / 2; i++) { unsigned j = dcode39->character - 1 - i; char code = dcode->buf[i]; dcode->buf[i] = dcode->buf[j]; dcode->buf[j] = code; } } for(i = 0; i < dcode39->character; i++) dcode->buf[i] = ((dcode->buf[i] < 0x2b) ? code39_characters[(unsigned)dcode->buf[i]] : '?'); dcode->buflen = i; dcode->buf[i] = '\0'; } zbar_symbol_type_t _zbar_decode_code39 (zbar_decoder_t *dcode) { code39_decoder_t *dcode39 = &dcode->code39; /* update latest character width */ dcode39->s9 -= get_width(dcode, 9); dcode39->s9 += get_width(dcode, 0); if(dcode39->character < 0) { if(get_color(dcode) != ZBAR_BAR) return(ZBAR_NONE); dprintf(2, " code39:"); return(code39_decode_start(dcode)); } if(++dcode39->element < 9) return(ZBAR_NONE); dprintf(2, " code39[%c%02d+%x]", (dcode39->direction) ? '<' : '>', dcode39->character, dcode39->element); if(dcode39->element == 10) { unsigned space = get_width(dcode, 0); if(dcode39->character && dcode->buf[dcode39->character - 1] == 0x2b) { /* STOP */ /* trim STOP character */ dcode39->character--; zbar_symbol_type_t sym = ZBAR_CODE39; /* trailing quiet zone check */ if(space && space < dcode39->width / 2) { dprintf(2, " [invalid qz]\n"); sym = ZBAR_NONE; } else if(dcode39->character < CFG(*dcode39, ZBAR_CFG_MIN_LEN) || (CFG(*dcode39, ZBAR_CFG_MAX_LEN) > 0 && dcode39->character > CFG(*dcode39, ZBAR_CFG_MAX_LEN))) { dprintf(2, " [invalid len]\n"); sym = ZBAR_NONE; } else { /* FIXME checksum (needs config enable) */ code39_postprocess(dcode); dprintf(2, " [valid end]\n"); } dcode39->character = -1; if(!sym) dcode->lock = 0; return(sym); } if(space > dcode39->width / 2) { /* inter-character space check failure */ dcode->lock = 0; dcode39->character = -1; dprintf(2, " ics>%d [invalid ics]", dcode39->width); } dcode39->element = 0; dprintf(2, "\n"); return(ZBAR_NONE); } signed char c = code39_decode9(dcode); dprintf(2, " c=%d", c); /* lock shared resources */ if(!dcode39->character && get_lock(dcode, ZBAR_CODE39)) { dcode39->character = -1; dprintf(1, " [locked %d]\n", dcode->lock); return(ZBAR_PARTIAL); } if(c < 0 || ((dcode39->character >= BUFFER_MIN) && size_buf(dcode, dcode39->character + 1))) { dprintf(1, (c < 0) ? " [aborted]\n" : " [overflow]\n"); dcode->lock = 0; dcode39->character = -1; return(ZBAR_NONE); } else { zassert(c < 0x2c, ZBAR_NONE, "c=%02x s9=%x\n", c, dcode39->s9); dprintf(2, "\n"); } dcode->buf[dcode39->character++] = c; return(ZBAR_NONE); } zbar-0.10/zbar/decoder/i25.c0000644000000000000000000001561511270371414012375 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include /* memmove */ #include #include "decoder.h" #ifdef DEBUG_I25 # define DEBUG_LEVEL (DEBUG_I25) #endif #include "debug.h" static inline unsigned char i25_decode1 (unsigned char enc, unsigned e, unsigned s) { unsigned char E = decode_e(e, s, 45); if(E > 7) return(0xff); enc <<= 1; if(E > 2) enc |= 1; return(enc); } static inline unsigned char i25_decode10 (zbar_decoder_t *dcode, unsigned char offset) { i25_decoder_t *dcode25 = &dcode->i25; dprintf(2, " s=%d", dcode25->s10); if(dcode25->s10 < 10) return(0xff); /* threshold bar width ratios */ unsigned char enc = 0, par = 0; signed char i; for(i = 8; i >= 0; i -= 2) { unsigned char j = offset + ((dcode25->direction) ? i : 8 - i); enc = i25_decode1(enc, get_width(dcode, j), dcode25->s10); if(enc == 0xff) return(0xff); if(enc & 1) par++; } dprintf(2, " enc=%02x par=%x", enc, par); /* parity check */ if(par != 2) { dprintf(2, " [bad parity]"); return(0xff); } /* decode binary weights */ enc &= 0xf; if(enc & 8) { if(enc == 12) enc = 0; else if(--enc > 9) { dprintf(2, " [invalid encoding]"); return(0xff); } } dprintf(2, " => %x", enc); return(enc); } static inline signed char i25_decode_start (zbar_decoder_t *dcode) { i25_decoder_t *dcode25 = &dcode->i25; if(dcode25->s10 < 10) return(ZBAR_NONE); unsigned char enc = 0; unsigned char i = 10; enc = i25_decode1(enc, get_width(dcode, i++), dcode25->s10); enc = i25_decode1(enc, get_width(dcode, i++), dcode25->s10); enc = i25_decode1(enc, get_width(dcode, i++), dcode25->s10); if((get_color(dcode) == ZBAR_BAR) ? enc != 4 : (enc = i25_decode1(enc, get_width(dcode, i++), dcode25->s10))) { dprintf(4, " i25: s=%d enc=%x [invalid]\n", dcode25->s10, enc); return(ZBAR_NONE); } /* check leading quiet zone - spec is 10n(?) * we require 5.25n for w=2n to 6.75n for w=3n * (FIXME should really factor in w:n ratio) */ unsigned quiet = get_width(dcode, i++); if(quiet && quiet < dcode25->s10 * 3 / 8) { dprintf(3, " i25: s=%d enc=%x q=%d [invalid qz]\n", dcode25->s10, enc, quiet); return(ZBAR_NONE); } dcode25->direction = get_color(dcode); dcode25->element = 1; dcode25->character = 0; return(ZBAR_PARTIAL); } static inline signed char i25_decode_end (zbar_decoder_t *dcode) { i25_decoder_t *dcode25 = &dcode->i25; /* check trailing quiet zone */ unsigned quiet = get_width(dcode, 0); if((quiet && quiet < dcode25->width * 3 / 8) || decode_e(get_width(dcode, 1), dcode25->width, 45) > 2 || decode_e(get_width(dcode, 2), dcode25->width, 45) > 2) { dprintf(3, " s=%d q=%d [invalid qz]\n", dcode25->width, quiet); return(ZBAR_NONE); } /* check exit condition */ unsigned char E = decode_e(get_width(dcode, 3), dcode25->width, 45); if((!dcode25->direction) ? E - 3 > 4 : (E > 2 || decode_e(get_width(dcode, 4), dcode25->width, 45) > 2)) return(ZBAR_NONE); if(dcode25->direction) { /* reverse buffer */ dprintf(2, " (rev)"); int i; for(i = 0; i < dcode25->character / 2; i++) { unsigned j = dcode25->character - 1 - i; char c = dcode->buf[i]; dcode->buf[i] = dcode->buf[j]; dcode->buf[j] = c; } } if(dcode25->character < CFG(*dcode25, ZBAR_CFG_MIN_LEN) || (CFG(*dcode25, ZBAR_CFG_MAX_LEN) > 0 && dcode25->character > CFG(*dcode25, ZBAR_CFG_MAX_LEN))) { dprintf(2, " [invalid len]\n"); dcode->lock = 0; dcode25->character = -1; return(ZBAR_NONE); } dcode->buflen = dcode25->character; dcode->buf[dcode25->character] = '\0'; dprintf(2, " [valid end]\n"); dcode25->character = -1; return(ZBAR_I25); } zbar_symbol_type_t _zbar_decode_i25 (zbar_decoder_t *dcode) { i25_decoder_t *dcode25 = &dcode->i25; /* update latest character width */ dcode25->s10 -= get_width(dcode, 10); dcode25->s10 += get_width(dcode, 0); if(dcode25->character < 0 && !i25_decode_start(dcode)) return(ZBAR_NONE); if(--dcode25->element == 6 - dcode25->direction) return(i25_decode_end(dcode)); else if(dcode25->element) return(ZBAR_NONE); /* FIXME check current character width against previous */ dcode25->width = dcode25->s10; dprintf(2, " i25[%c%02d+%x]", (dcode25->direction) ? '<' : '>', dcode25->character, dcode25->element); /* lock shared resources */ if(!dcode25->character && get_lock(dcode, ZBAR_I25)) { dcode25->character = -1; dprintf(2, " [locked %d]\n", dcode->lock); return(ZBAR_PARTIAL); } unsigned char c = i25_decode10(dcode, 1); dprintf(2, " c=%x", c); if(c > 9 || ((dcode25->character >= BUFFER_MIN) && size_buf(dcode, dcode25->character + 2))) { dprintf(2, (c > 9) ? " [aborted]\n" : " [overflow]\n"); dcode->lock = 0; dcode25->character = -1; return(ZBAR_NONE); } dcode->buf[dcode25->character++] = c + '0'; c = i25_decode10(dcode, 0); dprintf(2, " c=%x", c); if(c > 9) { dprintf(2, " [aborted]\n"); dcode->lock = 0; dcode25->character = -1; return(ZBAR_NONE); } else dprintf(2, "\n"); dcode->buf[dcode25->character++] = c + '0'; dcode25->element = 10; return((dcode25->character == 2) ? ZBAR_PARTIAL : ZBAR_NONE); } zbar-0.10/zbar/decoder/code128.c0000644000000000000000000004522311270371414013141 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include /* memmove */ #include #include "decoder.h" #ifdef DEBUG_CODE128 # define DEBUG_LEVEL (DEBUG_CODE128) #endif #include "debug.h" #define NUM_CHARS 108 /* total number of character codes */ typedef enum code128_char_e { FNC3 = 0x60, FNC2 = 0x61, SHIFT = 0x62, CODE_C = 0x63, CODE_B = 0x64, CODE_A = 0x65, FNC1 = 0x66, START_A = 0x67, START_B = 0x68, START_C = 0x69, STOP_FWD = 0x6a, STOP_REV = 0x6b, FNC4 = 0x6c, } code128_char_t; static const unsigned char characters[NUM_CHARS] = { 0x5c, 0xbf, 0xa1, /* [00] 00 */ 0x2a, 0xc5, 0x0c, 0xa4, /* [03] 01 */ 0x2d, 0xe3, 0x0f, /* [07] 02 */ 0x5f, 0xe4, /* [0a] 03 */ 0x6b, 0xe8, 0x69, 0xa7, 0xe7, /* [0c] 10 */ 0xc1, 0x51, 0x1e, 0x83, 0xd9, 0x00, 0x84, 0x1f, /* [11] 11 */ 0xc7, 0x0d, 0x33, 0x86, 0xb5, 0x0e, 0x15, 0x87, /* [19] 12 */ 0x10, 0xda, 0x11, /* [21] 13 */ 0x36, 0xe5, 0x18, 0x37, /* [24] 20 */ 0xcc, 0x13, 0x39, 0x89, 0x97, 0x14, 0x1b, 0x8a, 0x3a, 0xbd, /* [28] 21 */ 0xa2, 0x5e, 0x01, 0x85, 0xb0, 0x02, 0xa3, /* [32] 22 */ 0xa5, 0x2c, 0x16, 0x88, 0xbc, 0x12, 0xa6, /* [39] 23 */ 0x61, 0xe6, 0x56, 0x62, /* [40] 30 */ 0x19, 0xdb, 0x1a, /* [44] 31 */ 0xa8, 0x32, 0x1c, 0x8b, 0xcd, 0x1d, 0xa9, /* [47] 32 */ 0xc3, 0x20, 0xc4, /* [4e] 33 */ 0x50, 0x5d, 0xc0, /* [51] 0014 0025 0034 */ 0x2b, 0xc6, /* [54] 0134 0143 */ 0x2e, /* [56] 0243 */ 0x53, 0x60, /* [57] 0341 0352 */ 0x31, /* [59] 1024 */ 0x52, 0xc2, /* [5a] 1114 1134 */ 0x34, 0xc8, /* [5c] 1242 1243 */ 0x55, /* [5e] 1441 */ 0x57, 0x3e, 0xce, /* [5f] 4100 5200 4300 */ 0x3b, 0xc9, /* [62] 4310 3410 */ 0x6a, /* [64] 3420 */ 0x54, 0x4f, /* [65] 1430 2530 */ 0x38, /* [67] 4201 */ 0x58, 0xcb, /* [68] 4111 4311 */ 0x2f, 0xca, /* [6a] 2421 3421 */ }; static const unsigned char lo_base[8] = { 0x00, 0x07, 0x0c, 0x19, 0x24, 0x32, 0x40, 0x47 }; static const unsigned char lo_offset[0x80] = { 0xff, 0xf0, 0xff, 0x1f, 0xff, 0xf2, 0xff, 0xff, /* 00 [00] */ 0xff, 0xff, 0xff, 0x3f, 0xf4, 0xf5, 0xff, 0x6f, /* 01 */ 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf1, 0xff, 0x2f, /* 02 [07] */ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0x4f, /* 03 */ 0xff, 0x0f, 0xf1, 0xf2, 0xff, 0x3f, 0xff, 0xf4, /* 10 [0c] */ 0xf5, 0xf6, 0xf7, 0x89, 0xff, 0xab, 0xff, 0xfc, /* 11 */ 0xff, 0xff, 0x0f, 0x1f, 0x23, 0x45, 0xf6, 0x7f, /* 12 [19] */ 0xff, 0xff, 0xff, 0xff, 0xf8, 0xff, 0xf9, 0xaf, /* 13 */ 0xf0, 0xf1, 0xff, 0x2f, 0xff, 0xf3, 0xff, 0xff, /* 20 [24] */ 0x4f, 0x5f, 0x67, 0x89, 0xfa, 0xbf, 0xff, 0xcd, /* 21 */ 0xf0, 0xf1, 0xf2, 0x3f, 0xf4, 0x56, 0xff, 0xff, /* 22 [32] */ 0xff, 0xff, 0x7f, 0x8f, 0x9a, 0xff, 0xbc, 0xdf, /* 23 */ 0x0f, 0x1f, 0xf2, 0xff, 0xff, 0x3f, 0xff, 0xff, /* 30 [40] */ 0xf4, 0xff, 0xf5, 0x6f, 0xff, 0xff, 0xff, 0xff, /* 31 */ 0x0f, 0x1f, 0x23, 0xff, 0x45, 0x6f, 0xff, 0xff, /* 32 [47] */ 0xf7, 0xff, 0xf8, 0x9f, 0xff, 0xff, 0xff, 0xff, /* 33 */ }; static inline signed char decode_lo (int sig) { unsigned char offset = (((sig >> 1) & 0x01) | ((sig >> 3) & 0x06) | ((sig >> 5) & 0x18) | ((sig >> 7) & 0x60)); unsigned char idx = lo_offset[offset]; if(sig & 1) idx &= 0xf; else idx >>= 4; if(idx == 0xf) return(-1); unsigned char base = (sig >> 11) | ((sig >> 9) & 1); zassert(base < 8, -1, "sig=%x offset=%x idx=%x base=%x\n", sig, offset, idx, base); idx += lo_base[base]; zassert(idx <= 0x50, -1, "sig=%x offset=%x base=%x idx=%x\n", sig, offset, base, idx); unsigned char c = characters[idx]; dprintf(2, " %02x(%x(%02x)/%x(%02x)) => %02x", idx, base, lo_base[base], offset, lo_offset[offset], (unsigned char)c); return(c); } static inline signed char decode_hi (int sig) { unsigned char rev = (sig & 0x4400) != 0; if(rev) sig = (((sig >> 12) & 0x000f) | ((sig >> 4) & 0x00f0) | ((sig << 4) & 0x0f00) | ((sig << 12) & 0xf000)); dprintf(2, " rev=%x", rev != 0); unsigned char idx; switch(sig) { case 0x0014: idx = 0x0; break; case 0x0025: idx = 0x1; break; case 0x0034: idx = 0x2; break; case 0x0134: idx = 0x3; break; case 0x0143: idx = 0x4; break; case 0x0243: idx = 0x5; break; case 0x0341: idx = 0x6; break; case 0x0352: idx = 0x7; break; case 0x1024: idx = 0x8; break; case 0x1114: idx = 0x9; break; case 0x1134: idx = 0xa; break; case 0x1242: idx = 0xb; break; case 0x1243: idx = 0xc; break; case 0x1441: idx = 0xd; rev = 0; break; default: return(-1); } if(rev) idx += 0xe; unsigned char c = characters[0x51 + idx]; dprintf(2, " %02x => %02x", idx, c); return(c); } static inline unsigned char calc_check (unsigned char c) { if(!(c & 0x80)) return(0x18); c &= 0x7f; if(c < 0x3d) return((c < 0x30 && c != 0x17) ? 0x10 : 0x20); if(c < 0x50) return((c == 0x4d) ? 0x20 : 0x10); return((c < 0x67) ? 0x20 : 0x10); } static inline signed char decode6 (zbar_decoder_t *dcode) { /* build edge signature of character */ unsigned s = dcode->code128.s6; dprintf(2, " s=%d", s); if(s < 5) return(-1); /* calculate similar edge measurements */ int sig = (get_color(dcode) == ZBAR_BAR) ? ((decode_e(get_width(dcode, 0) + get_width(dcode, 1), s, 11) << 12) | (decode_e(get_width(dcode, 1) + get_width(dcode, 2), s, 11) << 8) | (decode_e(get_width(dcode, 2) + get_width(dcode, 3), s, 11) << 4) | (decode_e(get_width(dcode, 3) + get_width(dcode, 4), s, 11))) : ((decode_e(get_width(dcode, 5) + get_width(dcode, 4), s, 11) << 12) | (decode_e(get_width(dcode, 4) + get_width(dcode, 3), s, 11) << 8) | (decode_e(get_width(dcode, 3) + get_width(dcode, 2), s, 11) << 4) | (decode_e(get_width(dcode, 2) + get_width(dcode, 1), s, 11))); if(sig < 0) return(-1); dprintf(2, " sig=%04x", sig); /* lookup edge signature */ signed char c = (sig & 0x4444) ? decode_hi(sig) : decode_lo(sig); if(c == -1) return(-1); /* character validation */ unsigned bars = (get_color(dcode) == ZBAR_BAR) ? (get_width(dcode, 0) + get_width(dcode, 2) + get_width(dcode, 4)) : (get_width(dcode, 1) + get_width(dcode, 3) + get_width(dcode, 5)); bars = bars * 11 * 4 / s; unsigned char chk = calc_check(c); dprintf(2, " bars=%d chk=%d", bars, chk); if(chk - 7 > bars || bars > chk + 7) return(-1); return(c & 0x7f); } static inline unsigned char validate_checksum (zbar_decoder_t *dcode) { code128_decoder_t *dcode128 = &dcode->code128; if(dcode128->character < 3) return(1); /* add in irregularly weighted start character */ unsigned idx = (dcode128->direction) ? dcode128->character - 1 : 0; unsigned sum = dcode->buf[idx]; if(sum >= 103) sum -= 103; /* calculate sum in reverse to avoid multiply operations */ unsigned i, acc = 0; for(i = dcode128->character - 3; i; i--) { zassert(sum < 103, -1, "dir=%x i=%x sum=%x acc=%x %s\n", dcode128->direction, i, sum, acc, _zbar_decoder_buf_dump(dcode->buf, dcode128->character)); idx = (dcode128->direction) ? dcode128->character - 1 - i : i; acc += dcode->buf[idx]; if(acc >= 103) acc -= 103; zassert(acc < 103, -1, "dir=%x i=%x sum=%x acc=%x %s\n", dcode128->direction, i, sum, acc, _zbar_decoder_buf_dump(dcode->buf, dcode128->character)); sum += acc; if(sum >= 103) sum -= 103; } /* and compare to check character */ idx = (dcode128->direction) ? 1 : dcode128->character - 2; unsigned char check = dcode->buf[idx]; dprintf(2, " chk=%02x(%02x)", sum, check); unsigned char err = (sum != check); if(err) dprintf(1, " [checksum error]\n"); return(err); } /* expand and decode character set C */ static inline unsigned postprocess_c (zbar_decoder_t *dcode, unsigned start, unsigned end, unsigned dst) { /* expand buffer to accomodate 2x set C characters (2 digits per-char) */ unsigned delta = end - start; unsigned newlen = dcode->code128.character + delta; size_buf(dcode, newlen); /* relocate unprocessed data to end of buffer */ memmove(dcode->buf + start + delta, dcode->buf + start, dcode->code128.character - start); dcode->code128.character = newlen; unsigned i, j; for(i = 0, j = dst; i < delta; i++, j += 2) { /* convert each set C character into two ASCII digits */ unsigned char code = dcode->buf[start + delta + i]; dcode->buf[j] = '0'; if(code >= 50) { code -= 50; dcode->buf[j] += 5; } if(code >= 30) { code -= 30; dcode->buf[j] += 3; } if(code >= 20) { code -= 20; dcode->buf[j] += 2; } if(code >= 10) { code -= 10; dcode->buf[j] += 1; } zassert(dcode->buf[j] <= '9', delta, "start=%x end=%x i=%x j=%x %s\n", start, end, i, j, _zbar_decoder_buf_dump(dcode->buf, dcode->code128.character)); zassert(code <= 9, delta, "start=%x end=%x i=%x j=%x %s\n", start, end, i, j, _zbar_decoder_buf_dump(dcode->buf, dcode->code128.character)); dcode->buf[j + 1] = '0' + code; } return(delta); } /* resolve scan direction and convert to ASCII */ static inline unsigned char postprocess (zbar_decoder_t *dcode) { code128_decoder_t *dcode128 = &dcode->code128; dprintf(2, "\n postproc len=%d", dcode128->character); unsigned i, j; unsigned char code = 0; if(dcode128->direction) { /* reverse buffer */ dprintf(2, " (rev)"); for(i = 0; i < dcode128->character / 2; i++) { unsigned j = dcode128->character - 1 - i; code = dcode->buf[i]; dcode->buf[i] = dcode->buf[j]; dcode->buf[j] = code; } zassert(dcode->buf[dcode128->character - 1] == STOP_REV, 1, "dir=%x %s\n", dcode128->direction, _zbar_decoder_buf_dump(dcode->buf, dcode->code128.character)); } else zassert(dcode->buf[dcode128->character - 1] == STOP_FWD, 1, "dir=%x %s\n", dcode128->direction, _zbar_decoder_buf_dump(dcode->buf, dcode->code128.character)); code = dcode->buf[0]; zassert(code >= START_A && code <= START_C, 1, "%s\n", _zbar_decoder_buf_dump(dcode->buf, dcode->code128.character)); unsigned char charset = code - START_A; unsigned cexp = (code == START_C) ? 1 : 0; dprintf(2, " start=%c", 'A' + charset); for(i = 1, j = 0; i < dcode128->character - 2; i++) { unsigned char code = dcode->buf[i]; zassert(!(code & 0x80), 1, "i=%x j=%x code=%02x charset=%x cexp=%x %s\n", i, j, code, charset, cexp, _zbar_decoder_buf_dump(dcode->buf, dcode->code128.character)); if((charset & 0x2) && (code < 100)) /* defer character set C for expansion */ continue; else if(code < 0x60) { /* convert character set B to ASCII */ code = code + 0x20; if((!charset || (charset == 0x81)) && (code >= 0x60)) /* convert character set A to ASCII */ code -= 0x60; dcode->buf[j++] = code; if(charset & 0x80) charset &= 0x7f; } else { dprintf(2, " %02x", code); if(charset & 0x2) { /* expand character set C to ASCII */ zassert(cexp, 1, "i=%x j=%x code=%02x charset=%x cexp=%x %s\n", i, j, code, charset, cexp, _zbar_decoder_buf_dump(dcode->buf, dcode->code128.character)); unsigned delta = postprocess_c(dcode, cexp, i, j); i += delta; j += delta * 2; cexp = 0; } if(code < CODE_C) { if(code == SHIFT) charset |= 0x80; else if(code == FNC2) /* FIXME FNC2 - message append */; else if(code == FNC3) /* FIXME FNC3 - initialize */; } else if(code == FNC1) /* FIXME FNC1 - Code 128 subsets or ASCII 0x1d */; else if(code >= START_A) { dprintf(1, " [truncated]\n"); return(1); } else { zassert(code >= CODE_C && code <= CODE_A, 1, "i=%x j=%x code=%02x charset=%x cexp=%x %s\n", i, j, code, charset, cexp, _zbar_decoder_buf_dump(dcode->buf, dcode->code128.character)); unsigned char newset = CODE_A - code; if(newset != charset) charset = newset; else /* FIXME FNC4 - extended ASCII */; } if(charset & 0x2) cexp = i + 1; } } if(charset & 0x2) { zassert(cexp, 1, "i=%x j=%x code=%02x charset=%x cexp=%x %s\n", i, j, code, charset, cexp, _zbar_decoder_buf_dump(dcode->buf, dcode->code128.character)); j += postprocess_c(dcode, cexp, i, j) * 2; } dcode->buflen = j; dcode->buf[j] = '\0'; dcode->code128.character = j; return(0); } zbar_symbol_type_t _zbar_decode_code128 (zbar_decoder_t *dcode) { code128_decoder_t *dcode128 = &dcode->code128; /* update latest character width */ dcode128->s6 -= get_width(dcode, 6); dcode128->s6 += get_width(dcode, 0); if(/* process every 6th element of active symbol */ (dcode128->character >= 0 && (++dcode128->element) != 6) || /* decode color based on direction */ (get_color(dcode) != dcode128->direction)) return(0); dcode128->element = 0; dprintf(2, " code128[%c%02d+%x]:", (dcode128->direction) ? '<' : '>', dcode128->character, dcode128->element); signed char c = decode6(dcode); if(dcode128->character < 0) { dprintf(2, " c=%02x", c); if(c < START_A || c > STOP_REV || c == STOP_FWD) { dprintf(2, " [invalid]\n"); return(0); } unsigned qz = get_width(dcode, 6); if(qz && qz < (dcode->code128.s6 * 3) / 4) { dprintf(2, " [invalid qz %d]\n", qz); return(0); } /* lock shared resources */ if(get_lock(dcode, ZBAR_CODE128)) { dprintf(2, " [locked %d]\n", dcode->lock); dcode128->character = -1; return(0); } /* decoded valid start/stop */ /* initialize state */ dcode128->character = 0; if(c == STOP_REV) { dcode128->direction = ZBAR_BAR; dcode128->element = 7; } else dcode128->direction = ZBAR_SPACE; dprintf(2, " dir=%x [valid start]", dcode128->direction); } else if((c < 0) || ((dcode128->character >= BUFFER_MIN) && size_buf(dcode, dcode128->character + 1))) { dprintf(1, (c < 0) ? " [aborted]\n" : " [overflow]\n"); dcode->lock = 0; dcode128->character = -1; return(0); } zassert(dcode->buf_alloc > dcode128->character, 0, "alloc=%x idx=%x c=%02x %s\n", dcode->buf_alloc, dcode128->character, c, _zbar_decoder_buf_dump(dcode->buf, dcode->buf_alloc)); dcode->buf[dcode128->character++] = c; if(dcode128->character > 2 && ((dcode128->direction) ? c >= START_A && c <= START_C : c == STOP_FWD)) { /* FIXME STOP_FWD should check extra bar (and QZ!) */ zbar_symbol_type_t sym = ZBAR_CODE128; if(validate_checksum(dcode) || postprocess(dcode)) sym = ZBAR_NONE; else if(dcode128->character < CFG(*dcode128, ZBAR_CFG_MIN_LEN) || (CFG(*dcode128, ZBAR_CFG_MAX_LEN) > 0 && dcode128->character > CFG(*dcode128, ZBAR_CFG_MAX_LEN))) { dprintf(2, " [invalid len]\n"); sym = ZBAR_NONE; } else dprintf(2, " [valid end]\n"); dcode128->character = -1; if(!sym) dcode->lock = 0; return(sym); } dprintf(2, "\n"); return(0); } zbar-0.10/zbar/decoder/pdf417.h0000644000000000000000000000347611270371414013012 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _PDF417_H_ #define _PDF417_H_ /* PDF417 specific decode state */ typedef struct pdf417_decoder_s { unsigned direction : 1; /* scan direction: 0=fwd/space, 1=rev/bar */ unsigned element : 3; /* element offset 0-7 */ int character : 12; /* character position in symbol */ unsigned s8; /* character width */ unsigned config; int configs[NUM_CFGS]; /* int valued configurations */ } pdf417_decoder_t; /* reset PDF417 specific state */ static inline void pdf417_reset (pdf417_decoder_t *pdf417) { pdf417->direction = 0; pdf417->element = 0; pdf417->character = -1; pdf417->s8 = 0; } /* decode PDF417 symbols */ zbar_symbol_type_t _zbar_decode_pdf417(zbar_decoder_t *dcode); #endif zbar-0.10/zbar/decoder/qr_finder.c0000644000000000000000000000347611270371414013751 00000000000000#include #include #include #include "decoder.h" #ifdef DEBUG_QR_FINDER # define DEBUG_LEVEL (DEBUG_QR_FINDER) #endif #include "debug.h" /* at this point lengths are all decode unit offsets from the decode edge * NB owned by finder */ qr_finder_line *_zbar_decoder_get_qr_finder_line (zbar_decoder_t *dcode) { return(&dcode->qrf.line); } zbar_symbol_type_t _zbar_find_qr (zbar_decoder_t *dcode) { qr_finder_t *qrf = &dcode->qrf; /* update latest finder pattern width */ qrf->s5 -= get_width(dcode, 6); qrf->s5 += get_width(dcode, 1); unsigned s = qrf->s5; if(get_color(dcode) != ZBAR_SPACE || s < 7) return(0); dprintf(2, " qrf: s=%d", s); int ei = decode_e(pair_width(dcode, 1), s, 7); dprintf(2, " %d", ei); if(ei) goto invalid; ei = decode_e(pair_width(dcode, 2), s, 7); dprintf(2, "%d", ei); if(ei != 2) goto invalid; ei = decode_e(pair_width(dcode, 3), s, 7); dprintf(2, "%d", ei); if(ei != 2) goto invalid; ei = decode_e(pair_width(dcode, 4), s, 7); dprintf(2, "%d", ei); if(ei) goto invalid; /* valid QR finder symbol * mark positions needed by decoder */ unsigned qz = get_width(dcode, 0); unsigned w = get_width(dcode, 1); qrf->line.eoffs = qz + (w + 1) / 2; qrf->line.len = qz + w + get_width(dcode, 2); qrf->line.pos[0] = qrf->line.len + get_width(dcode, 3); qrf->line.pos[1] = qrf->line.pos[0]; w = get_width(dcode, 5); qrf->line.boffs = qrf->line.pos[0] + get_width(dcode, 4) + (w + 1) / 2; dprintf(2, " boff=%d pos=%d len=%d eoff=%d [valid]\n", qrf->line.boffs, qrf->line.pos[0], qrf->line.len, qrf->line.eoffs); return(ZBAR_QRCODE); invalid: dprintf(2, " [invalid]\n"); return(0); } zbar-0.10/zbar/Makefile.am.inc0000644000000000000000000000576211270371414013033 00000000000000lib_LTLIBRARIES += zbar/libzbar.la zbar_libzbar_la_CPPFLAGS = -I$(srcdir)/zbar $(AM_CPPFLAGS) zbar_libzbar_la_LDFLAGS = -no-undefined -version-info $(LIB_VERSION) \ -export-symbols-regex "^(zbar|_zbar.*_error)_.*" $(AM_LDFLAGS) zbar_libzbar_la_LIBADD = $(LTLIBICONV) zbar_libzbar_la_SOURCES = zbar/debug.h zbar/config.c \ zbar/error.h zbar/error.c zbar/symbol.h zbar/symbol.c \ zbar/image.h zbar/image.c zbar/convert.c \ zbar/processor.c zbar/processor.h zbar/processor/lock.c \ zbar/refcnt.h zbar/refcnt.c zbar/timer.h zbar/mutex.h \ zbar/event.h zbar/thread.h \ zbar/window.h zbar/window.c zbar/video.h zbar/video.c \ zbar/img_scanner.h zbar/img_scanner.c zbar/scanner.c \ zbar/decoder.h zbar/decoder.c EXTRA_zbar_libzbar_la_SOURCES = zbar/svg.h zbar/svg.c if ENABLE_EAN zbar_libzbar_la_SOURCES += zbar/decoder/ean.h zbar/decoder/ean.c endif if ENABLE_CODE128 zbar_libzbar_la_SOURCES += zbar/decoder/code128.h zbar/decoder/code128.c endif if ENABLE_CODE39 zbar_libzbar_la_SOURCES += zbar/decoder/code39.h zbar/decoder/code39.c endif if ENABLE_I25 zbar_libzbar_la_SOURCES += zbar/decoder/i25.h zbar/decoder/i25.c endif if ENABLE_PDF417 zbar_libzbar_la_SOURCES += zbar/decoder/pdf417.h zbar/decoder/pdf417.c \ zbar/decoder/pdf417_hash.h endif if ENABLE_QRCODE zbar_libzbar_la_SOURCES += zbar/qrcode.h \ zbar/decoder/qr_finder.h zbar/decoder/qr_finder.c \ zbar/qrcode/qrdec.h zbar/qrcode/qrdec.c zbar/qrcode/qrdectxt.c \ zbar/qrcode/rs.h zbar/qrcode/rs.c \ zbar/qrcode/isaac.h zbar/qrcode/isaac.c \ zbar/qrcode/bch15_5.h zbar/qrcode/bch15_5.c \ zbar/qrcode/binarize.h zbar/qrcode/binarize.c \ zbar/qrcode/util.h zbar/qrcode/util.c endif if WIN32 zbar_libzbar_la_SOURCES += zbar/processor/win.c zbar/libzbar.rc zbar_libzbar_la_CPPFLAGS += -mthreads zbar_libzbar_la_LDFLAGS += -mthreads # FIXME broken zbar_libzbar_la_LIBADD += zbar/libzbar-rc.lo else zbar_libzbar_la_SOURCES += zbar/processor/posix.h zbar/processor/posix.c endif if HAVE_V4L1 zbar_libzbar_la_SOURCES += zbar/video/v4l1.c if HAVE_V4L2 zbar_libzbar_la_SOURCES += zbar/video/v4l2.c endif endif if WIN32 if HAVE_VIDEO zbar_libzbar_la_SOURCES += zbar/video/vfw.c zbar_libzbar_la_LIBADD += -lvfw32 endif endif if !HAVE_VIDEO zbar_libzbar_la_SOURCES += zbar/video/null.c endif if HAVE_JPEG zbar_libzbar_la_SOURCES += zbar/jpeg.c endif if HAVE_X zbar_libzbar_la_SOURCES += zbar/processor/x.c \ zbar/window/x.h zbar/window/x.c zbar/window/ximage.c zbar_libzbar_la_CPPFLAGS += $(X_CFLAGS) zbar_libzbar_la_LDFLAGS += $(X_LIBS) zbar_libzbar_la_LIBADD += $(X_PRE_LIBS) -lX11 $(X_EXTRA_LIBS) if HAVE_XV zbar_libzbar_la_SOURCES += zbar/window/xv.c zbar_libzbar_la_LIBADD += $(XV_LIBS) endif else if WIN32 zbar_libzbar_la_SOURCES += zbar/window/win.h zbar/window/win.c \ zbar/window/dib.c # zbar/window/vfw.c -lvfw32 zbar_libzbar_la_LIBADD += -lgdi32 -lwinmm else zbar_libzbar_la_SOURCES += zbar/processor/null.c zbar/window/null.c endif endif zbar_libzbar_la_LDFLAGS += $(AM_LDFLAGS) zbar_libzbar_la_LIBADD += $(AM_LIBADD) zbar-0.10/zbar/scanner.c0000644000000000000000000002357311270371414012024 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include /* malloc, free, abs */ #include /* memset */ #include #include "svg.h" #ifdef DEBUG_SCANNER # define DEBUG_LEVEL (DEBUG_SCANNER) #endif #include "debug.h" #ifndef ZBAR_FIXED # define ZBAR_FIXED 5 #endif #define ROUND (1 << (ZBAR_FIXED - 1)) /* FIXME add runtime config API for these */ #ifndef ZBAR_SCANNER_THRESH_MIN # define ZBAR_SCANNER_THRESH_MIN 4 #endif #ifndef ZBAR_SCANNER_THRESH_INIT_WEIGHT # define ZBAR_SCANNER_THRESH_INIT_WEIGHT .44 #endif #define THRESH_INIT ((unsigned)((ZBAR_SCANNER_THRESH_INIT_WEIGHT \ * (1 << (ZBAR_FIXED + 1)) + 1) / 2)) #ifndef ZBAR_SCANNER_THRESH_FADE # define ZBAR_SCANNER_THRESH_FADE 8 #endif #ifndef ZBAR_SCANNER_EWMA_WEIGHT # define ZBAR_SCANNER_EWMA_WEIGHT .78 #endif #define EWMA_WEIGHT ((unsigned)((ZBAR_SCANNER_EWMA_WEIGHT \ * (1 << (ZBAR_FIXED + 1)) + 1) / 2)) /* scanner state */ struct zbar_scanner_s { zbar_decoder_t *decoder; /* associated bar width decoder */ unsigned y1_min_thresh; /* minimum threshold */ unsigned x; /* relative scan position of next sample */ int y0[4]; /* short circular buffer of average intensities */ int y1_sign; /* slope at last crossing */ unsigned y1_thresh; /* current slope threshold */ unsigned cur_edge; /* interpolated position of tracking edge */ unsigned last_edge; /* interpolated position of last located edge */ unsigned width; /* last element width */ }; zbar_scanner_t *zbar_scanner_create (zbar_decoder_t *dcode) { zbar_scanner_t *scn = malloc(sizeof(zbar_scanner_t)); scn->decoder = dcode; scn->y1_min_thresh = ZBAR_SCANNER_THRESH_MIN; zbar_scanner_reset(scn); return(scn); } void zbar_scanner_destroy (zbar_scanner_t *scn) { free(scn); } zbar_symbol_type_t zbar_scanner_reset (zbar_scanner_t *scn) { memset(&scn->x, 0, sizeof(zbar_scanner_t) + (void*)scn - (void*)&scn->x); scn->y1_thresh = scn->y1_min_thresh; if(scn->decoder) zbar_decoder_reset(scn->decoder); return(ZBAR_NONE); } unsigned zbar_scanner_get_width (const zbar_scanner_t *scn) { return(scn->width); } unsigned zbar_scanner_get_edge (const zbar_scanner_t *scn, unsigned offset, int prec) { unsigned edge = scn->last_edge - offset - (1 << ZBAR_FIXED) - ROUND; prec = ZBAR_FIXED - prec; if(prec > 0) return(edge >> prec); else if(!prec) return(edge); else return(edge << -prec); } zbar_color_t zbar_scanner_get_color (const zbar_scanner_t *scn) { return((scn->y1_sign <= 0) ? ZBAR_SPACE : ZBAR_BAR); } static inline unsigned calc_thresh (zbar_scanner_t *scn) { /* threshold 1st to improve noise rejection */ unsigned thresh = scn->y1_thresh; if((thresh <= scn->y1_min_thresh) || !scn->width) { dprintf(1, " tmin=%d", scn->y1_min_thresh); return(scn->y1_min_thresh); } /* slowly return threshold to min */ unsigned dx = (scn->x << ZBAR_FIXED) - scn->last_edge; unsigned long t = thresh * dx; t /= scn->width; t /= ZBAR_SCANNER_THRESH_FADE; dprintf(1, " thr=%d t=%ld x=%d last=%d.%d (%d)", thresh, t, scn->x, scn->last_edge >> ZBAR_FIXED, scn->last_edge & ((1 << ZBAR_FIXED) - 1), dx); if(thresh > t) { thresh -= t; if(thresh > scn->y1_min_thresh) return(thresh); } scn->y1_thresh = scn->y1_min_thresh; return(scn->y1_min_thresh); } static inline zbar_symbol_type_t process_edge (zbar_scanner_t *scn, int y1) { if(!scn->y1_sign) scn->last_edge = scn->cur_edge = (1 << ZBAR_FIXED) + ROUND; else if(!scn->last_edge) scn->last_edge = scn->cur_edge; scn->width = scn->cur_edge - scn->last_edge; dprintf(1, " sgn=%d cur=%d.%d w=%d (%s)\n", scn->y1_sign, scn->cur_edge >> ZBAR_FIXED, scn->cur_edge & ((1 << ZBAR_FIXED) - 1), scn->width, ((y1 > 0) ? "SPACE" : "BAR")); scn->last_edge = scn->cur_edge; #if DEBUG_SVG > 1 svg_path_moveto(SVG_ABS, scn->last_edge - (1 << ZBAR_FIXED) - ROUND, 0); #endif /* pass to decoder */ if(scn->decoder) return(zbar_decode_width(scn->decoder, scn->width)); return(ZBAR_PARTIAL); } inline zbar_symbol_type_t zbar_scanner_flush (zbar_scanner_t *scn) { if(!scn->y1_sign) return(ZBAR_NONE); unsigned x = (scn->x << ZBAR_FIXED) + ROUND; if(scn->cur_edge != x || scn->y1_sign > 0) { dprintf(1, "flush0:"); zbar_symbol_type_t edge = process_edge(scn, -scn->y1_sign); scn->cur_edge = x; scn->y1_sign = -scn->y1_sign; return(edge); } scn->y1_sign = scn->width = 0; if(scn->decoder) return(zbar_decode_width(scn->decoder, 0)); return(ZBAR_PARTIAL); } zbar_symbol_type_t zbar_scanner_new_scan (zbar_scanner_t *scn) { zbar_symbol_type_t edge = ZBAR_NONE; while(scn->y1_sign) { zbar_symbol_type_t tmp = zbar_scanner_flush(scn); if(tmp < 0 || tmp > edge) edge = tmp; } /* reset scanner and associated decoder */ memset(&scn->x, 0, sizeof(zbar_scanner_t) + (void*)scn - (void*)&scn->x); scn->y1_thresh = scn->y1_min_thresh; if(scn->decoder) zbar_decoder_new_scan(scn->decoder); return(edge); } zbar_symbol_type_t zbar_scan_y (zbar_scanner_t *scn, int y) { /* FIXME calc and clip to max y range... */ /* retrieve short value history */ register int x = scn->x; register int y0_1 = scn->y0[(x - 1) & 3]; register int y0_0 = y0_1; if(x) { /* update weighted moving average */ y0_0 += ((int)((y - y0_1) * EWMA_WEIGHT)) >> ZBAR_FIXED; scn->y0[x & 3] = y0_0; } else y0_0 = y0_1 = scn->y0[0] = scn->y0[1] = scn->y0[2] = scn->y0[3] = y; register int y0_2 = scn->y0[(x - 2) & 3]; register int y0_3 = scn->y0[(x - 3) & 3]; /* 1st differential @ x-1 */ register int y1_1 = y0_1 - y0_2; { register int y1_2 = y0_2 - y0_3; if((abs(y1_1) < abs(y1_2)) && ((y1_1 >= 0) == (y1_2 >= 0))) y1_1 = y1_2; } /* 2nd differentials @ x-1 & x-2 */ register int y2_1 = y0_0 - (y0_1 * 2) + y0_2; register int y2_2 = y0_1 - (y0_2 * 2) + y0_3; dprintf(1, "scan: x=%d y=%d y0=%d y1=%d y2=%d", x, y, y0_1, y1_1, y2_1); zbar_symbol_type_t edge = ZBAR_NONE; /* 2nd zero-crossing is 1st local min/max - could be edge */ if((!y2_1 || ((y2_1 > 0) ? y2_2 < 0 : y2_2 > 0)) && (calc_thresh(scn) <= abs(y1_1))) { /* check for 1st sign change */ char y1_rev = (scn->y1_sign > 0) ? y1_1 < 0 : y1_1 > 0; if(y1_rev) /* intensity change reversal - finalize previous edge */ edge = process_edge(scn, y1_1); if(y1_rev || (abs(scn->y1_sign) < abs(y1_1))) { scn->y1_sign = y1_1; /* adaptive thresholding */ /* start at multiple of new min/max */ scn->y1_thresh = (abs(y1_1) * THRESH_INIT + ROUND) >> ZBAR_FIXED; dprintf(1, "\tthr=%d", scn->y1_thresh); if(scn->y1_thresh < scn->y1_min_thresh) scn->y1_thresh = scn->y1_min_thresh; /* update current edge */ int d = y2_1 - y2_2; scn->cur_edge = 1 << ZBAR_FIXED; if(!d) scn->cur_edge >>= 1; else if(y2_1) /* interpolate zero crossing */ scn->cur_edge -= ((y2_1 << ZBAR_FIXED) + 1) / d; scn->cur_edge += x << ZBAR_FIXED; dprintf(1, "\n"); } } else dprintf(1, "\n"); /* FIXME add fall-thru pass to decoder after heuristic "idle" period (eg, 6-8 * last width) */ scn->x = x + 1; return(edge); } /* undocumented API for drawing cutesy debug graphics */ void zbar_scanner_get_state (const zbar_scanner_t *scn, unsigned *x, unsigned *cur_edge, unsigned *last_edge, int *y0, int *y1, int *y2, int *y1_thresh) { register int y0_0 = scn->y0[(scn->x - 1) & 3]; register int y0_1 = scn->y0[(scn->x - 2) & 3]; register int y0_2 = scn->y0[(scn->x - 3) & 3]; if(x) *x = scn->x - 1; if(cur_edge) *cur_edge = scn->cur_edge; if(last_edge) *last_edge = scn->last_edge; if(y0) *y0 = y0_1; if(y1) *y1 = y0_1 - y0_2; if(y2) *y2 = y0_0 - (y0_1 * 2) + y0_2; /* NB not quite accurate (uses updated x) */ zbar_scanner_t *mut_scn = (zbar_scanner_t*)scn; if(y1_thresh) *y1_thresh = calc_thresh(mut_scn); dprintf(1, "\n"); } zbar-0.10/zbar/img_scanner.c0000644000000000000000000005447311270371414012663 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #ifdef HAVE_INTTYPES_H # include #endif #include /* malloc, free */ #include /* clock_gettime */ #include /* gettimeofday */ #include /* memcmp, memset, memcpy */ #include #include #include "error.h" #include "image.h" #ifdef ENABLE_QRCODE # include "qrcode.h" #endif #include "img_scanner.h" #include "svg.h" #if 1 # define ASSERT_POS \ assert(p == data + x + y * (intptr_t)w) #else # define ASSERT_POS #endif /* FIXME cache setting configurability */ /* number of times the same result must be detected * in "nearby" images before being reported */ #define CACHE_CONSISTENCY 3 /* images */ /* time interval for which two images are considered "nearby" */ #define CACHE_PROXIMITY 1000 /* ms */ /* time that a result must *not* be detected before * it will be reported again */ #define CACHE_HYSTERESIS 2000 /* ms */ /* time after which cache entries are invalidated */ #define CACHE_TIMEOUT (CACHE_HYSTERESIS * 2) /* ms */ #define NUM_SCN_CFGS (ZBAR_CFG_Y_DENSITY - ZBAR_CFG_X_DENSITY + 1) #define CFG(iscn, cfg) ((iscn)->configs[(cfg) - ZBAR_CFG_X_DENSITY]) #define TEST_CFG(iscn, cfg) (((iscn)->config >> ((cfg) - ZBAR_CFG_POSITION)) & 1) #ifndef NO_STATS # define STAT(x) iscn->stat_##x++ #else # define STAT(...) # define dump_stats(...) #endif #define RECYCLE_BUCKETS 5 typedef struct recycle_bucket_s { int nsyms; zbar_symbol_t *head; } recycle_bucket_t; /* image scanner state */ struct zbar_image_scanner_s { zbar_scanner_t *scn; /* associated linear intensity scanner */ zbar_decoder_t *dcode; /* associated symbol decoder */ #ifdef ENABLE_QRCODE qr_reader *qr; /* QR Code 2D reader */ #endif const void *userdata; /* application data */ /* user result callback */ zbar_image_data_handler_t *handler; unsigned long time; /* scan start time */ zbar_image_t *img; /* currently scanning image *root* */ int dx, dy, du, umin, v; /* current scan direction */ zbar_symbol_set_t *syms; /* previous decode results */ /* recycled symbols in 4^n size buckets */ recycle_bucket_t recycle[RECYCLE_BUCKETS]; int enable_cache; /* current result cache state */ zbar_symbol_t *cache; /* inter-image result cache entries */ /* configuration settings */ unsigned config; /* config flags */ int configs[NUM_SCN_CFGS]; /* int valued configurations */ #ifndef NO_STATS int stat_syms_new; int stat_iscn_syms_inuse, stat_iscn_syms_recycle; int stat_img_syms_inuse, stat_img_syms_recycle; int stat_sym_new; int stat_sym_recycle[RECYCLE_BUCKETS]; #endif }; void _zbar_image_scanner_recycle_syms (zbar_image_scanner_t *iscn, zbar_symbol_t *sym) { zbar_symbol_t *next = NULL; for(; sym; sym = next) { next = sym->next; if(sym->refcnt && _zbar_refcnt(&sym->refcnt, -1)) { /* unlink referenced symbol */ /* FIXME handle outstanding component refs (currently unsupported) */ assert(sym->data_alloc); sym->next = NULL; } else { /* recycle unreferenced symbol */ if(!sym->data_alloc) { sym->data = NULL; sym->datalen = 0; } if(sym->syms) { if(_zbar_refcnt(&sym->syms->refcnt, -1)) assert(0); _zbar_image_scanner_recycle_syms(iscn, sym->syms->head); sym->syms->head = NULL; _zbar_symbol_set_free(sym->syms); sym->syms = NULL; } int i; for(i = 0; i < RECYCLE_BUCKETS; i++) if(sym->data_alloc < 1 << (i * 2)) break; if(i == RECYCLE_BUCKETS) { assert(sym->data); free(sym->data); sym->data = NULL; sym->data_alloc = 0; i = 0; } recycle_bucket_t *bucket = &iscn->recycle[i]; /* FIXME cap bucket fill */ bucket->nsyms++; sym->next = bucket->head; bucket->head = sym; } } } static inline int recycle_syms (zbar_image_scanner_t *iscn, zbar_symbol_set_t *syms) { if(_zbar_refcnt(&syms->refcnt, -1)) return(1); _zbar_image_scanner_recycle_syms(iscn, syms->head); syms->head = syms->tail = NULL; syms->nsyms = 0; return(0); } inline void zbar_image_scanner_recycle_image (zbar_image_scanner_t *iscn, zbar_image_t *img) { zbar_symbol_set_t *syms = iscn->syms; if(syms && syms->refcnt) { if(recycle_syms(iscn, syms)) { STAT(iscn_syms_inuse); iscn->syms = NULL; } else STAT(iscn_syms_recycle); } syms = img->syms; img->syms = NULL; if(syms && recycle_syms(iscn, syms)) { STAT(img_syms_inuse); syms = iscn->syms; } else if(syms) { STAT(img_syms_recycle); /* select one set to resurrect, destroy the other */ if(iscn->syms) { _zbar_symbol_set_free(syms); syms = iscn->syms; } else iscn->syms = syms; } } inline zbar_symbol_t* _zbar_image_scanner_alloc_sym (zbar_image_scanner_t *iscn, zbar_symbol_type_t type, int datalen) { /* recycle old or alloc new symbol */ int i; for(i = 0; i < RECYCLE_BUCKETS - 1; i++) if(datalen <= 1 << (i * 2)) break; zbar_symbol_t *sym = NULL; for(; i > 0; i--) if((sym = iscn->recycle[i].head)) { STAT(sym_recycle[i]); break; } if(sym) { iscn->recycle[i].head = sym->next; sym->next = NULL; assert(iscn->recycle[i].nsyms); iscn->recycle[i].nsyms--; } else { sym = calloc(1, sizeof(zbar_symbol_t)); STAT(sym_new); } /* init new symbol */ sym->type = type; sym->quality = 1; sym->npts = 0; sym->cache_count = 0; sym->time = iscn->time; assert(!sym->syms); if(datalen > 0) { sym->datalen = datalen - 1; if(sym->data_alloc < datalen) { if(sym->data) free(sym->data); sym->data_alloc = datalen; sym->data = malloc(datalen); } } else { if(sym->data) free(sym->data); sym->data = NULL; sym->datalen = sym->data_alloc = 0; } return(sym); } static inline zbar_symbol_t *cache_lookup (zbar_image_scanner_t *iscn, zbar_symbol_t *sym) { /* search for matching entry in cache */ zbar_symbol_t **entry = &iscn->cache; while(*entry) { if((*entry)->type == sym->type && (*entry)->datalen == sym->datalen && !memcmp((*entry)->data, sym->data, sym->datalen)) break; if((sym->time - (*entry)->time) > CACHE_TIMEOUT) { /* recycle stale cache entry */ zbar_symbol_t *next = (*entry)->next; (*entry)->next = NULL; _zbar_image_scanner_recycle_syms(iscn, *entry); *entry = next; } else entry = &(*entry)->next; } return(*entry); } static inline void cache_sym (zbar_image_scanner_t *iscn, zbar_symbol_t *sym) { if(iscn->enable_cache) { zbar_symbol_t *entry = cache_lookup(iscn, sym); if(!entry) { /* FIXME reuse sym */ entry = _zbar_image_scanner_alloc_sym(iscn, sym->type, sym->datalen + 1); memcpy(entry->data, sym->data, sym->datalen); entry->time = sym->time - CACHE_HYSTERESIS; entry->cache_count = -CACHE_CONSISTENCY; /* add to cache */ entry->next = iscn->cache; iscn->cache = entry; } /* consistency check and hysteresis */ uint32_t age = sym->time - entry->time; entry->time = sym->time; int near_thresh = (age < CACHE_PROXIMITY); int far_thresh = (age >= CACHE_HYSTERESIS); int dup = (entry->cache_count >= 0); if((!dup && !near_thresh) || far_thresh) entry->cache_count = -CACHE_CONSISTENCY; else if(dup || near_thresh) entry->cache_count++; sym->cache_count = entry->cache_count; } else sym->cache_count = 0; } void _zbar_image_scanner_add_sym(zbar_image_scanner_t *iscn, zbar_symbol_t *sym) { cache_sym(iscn, sym); zbar_symbol_set_t *syms = iscn->syms; if(sym->cache_count || !syms->tail) { sym->next = syms->head; syms->head = sym; } else { sym->next = syms->tail->next; syms->tail->next = sym; } if(!sym->cache_count) syms->nsyms++; else if(!syms->tail) syms->tail = sym; _zbar_symbol_refcnt(sym, 1); } #ifdef ENABLE_QRCODE extern qr_finder_line *_zbar_decoder_get_qr_finder_line(zbar_decoder_t*); # define QR_FIXED(v, rnd) ((((v) << 1) + (rnd)) << (QR_FINDER_SUBPREC - 1)) # define PRINT_FIXED(val, prec) \ ((val) >> (prec)), \ (1000 * ((val) & ((1 << (prec)) - 1)) / (1 << (prec))) static inline void qr_handler (zbar_image_scanner_t *iscn) { qr_finder_line *line = _zbar_decoder_get_qr_finder_line(iscn->dcode); assert(line); unsigned u = zbar_scanner_get_edge(iscn->scn, line->pos[0], QR_FINDER_SUBPREC); line->boffs = u - zbar_scanner_get_edge(iscn->scn, line->boffs, QR_FINDER_SUBPREC); line->len = zbar_scanner_get_edge(iscn->scn, line->len, QR_FINDER_SUBPREC); line->eoffs = zbar_scanner_get_edge(iscn->scn, line->eoffs, QR_FINDER_SUBPREC) - line->len; line->len -= u; u = QR_FIXED(iscn->umin, 0) + iscn->du * u; if(iscn->du < 0) { u -= line->len; int tmp = line->boffs; line->boffs = line->eoffs; line->eoffs = tmp; } int vert = !iscn->dx; line->pos[vert] = u; line->pos[!vert] = QR_FIXED(iscn->v, 1); _zbar_qr_found_line(iscn->qr, vert, line); } #endif static void symbol_handler (zbar_decoder_t *dcode) { zbar_image_scanner_t *iscn = zbar_decoder_get_userdata(dcode); zbar_symbol_type_t type = zbar_decoder_get_type(dcode); /* FIXME assert(type == ZBAR_PARTIAL) */ /* FIXME debug flag to save/display all PARTIALs */ if(type <= ZBAR_PARTIAL) return; #ifdef ENABLE_QRCODE if(type == ZBAR_QRCODE) { qr_handler(iscn); return; } #else assert(type != ZBAR_QRCODE); #endif const char *data = zbar_decoder_get_data(dcode); unsigned datalen = zbar_decoder_get_data_length(dcode); int x = 0, y = 0; if(TEST_CFG(iscn, ZBAR_CFG_POSITION)) { /* tmp position fixup */ int w = zbar_scanner_get_width(iscn->scn); int u = iscn->umin + iscn->du * zbar_scanner_get_edge(iscn->scn, w, 0); if(iscn->dx) { x = u; y = iscn->v; } else { x = iscn->v; y = u; } } /* FIXME need better symbol matching */ zbar_symbol_t *sym; for(sym = iscn->syms->head; sym; sym = sym->next) if(sym->type == type && sym->datalen == datalen && !memcmp(sym->data, data, datalen)) { sym->quality++; if(TEST_CFG(iscn, ZBAR_CFG_POSITION)) /* add new point to existing set */ /* FIXME should be polygon */ sym_add_point(sym, x, y); return; } sym = _zbar_image_scanner_alloc_sym(iscn, type, datalen + 1); /* FIXME grab decoder buffer */ memcpy(sym->data, data, datalen + 1); /* initialize first point */ if(TEST_CFG(iscn, ZBAR_CFG_POSITION)) sym_add_point(sym, x, y); _zbar_image_scanner_add_sym(iscn, sym); } zbar_image_scanner_t *zbar_image_scanner_create () { zbar_image_scanner_t *iscn = calloc(1, sizeof(zbar_image_scanner_t)); if(!iscn) return(NULL); iscn->dcode = zbar_decoder_create(); iscn->scn = zbar_scanner_create(iscn->dcode); if(!iscn->dcode || !iscn->scn) { zbar_image_scanner_destroy(iscn); return(NULL); } zbar_decoder_set_userdata(iscn->dcode, iscn); zbar_decoder_set_handler(iscn->dcode, symbol_handler); #ifdef ENABLE_QRCODE iscn->qr = _zbar_qr_create(); #endif /* apply default configuration */ CFG(iscn, ZBAR_CFG_X_DENSITY) = 1; CFG(iscn, ZBAR_CFG_Y_DENSITY) = 1; zbar_image_scanner_set_config(iscn, 0, ZBAR_CFG_POSITION, 1); return(iscn); } #ifndef NO_STATS static inline void dump_stats (const zbar_image_scanner_t *iscn) { zprintf(1, "symbol sets allocated = %-4d\n", iscn->stat_syms_new); zprintf(1, " scanner syms in use = %-4d\trecycled = %-4d\n", iscn->stat_iscn_syms_inuse, iscn->stat_iscn_syms_recycle); zprintf(1, " image syms in use = %-4d\trecycled = %-4d\n", iscn->stat_img_syms_inuse, iscn->stat_img_syms_recycle); zprintf(1, "symbols allocated = %-4d\n", iscn->stat_sym_new); int i; for(i = 0; i < RECYCLE_BUCKETS; i++) zprintf(1, " recycled[%d] = %-4d\n", i, iscn->stat_sym_recycle[i]); } #endif void zbar_image_scanner_destroy (zbar_image_scanner_t *iscn) { dump_stats(iscn); if(iscn->syms) { if(iscn->syms->refcnt) zbar_symbol_set_ref(iscn->syms, -1); else _zbar_symbol_set_free(iscn->syms); iscn->syms = NULL; } if(iscn->scn) zbar_scanner_destroy(iscn->scn); iscn->scn = NULL; if(iscn->dcode) zbar_decoder_destroy(iscn->dcode); iscn->dcode = NULL; int i; for(i = 0; i < RECYCLE_BUCKETS; i++) { zbar_symbol_t *sym, *next; for(sym = iscn->recycle[i].head; sym; sym = next) { next = sym->next; _zbar_symbol_free(sym); } } #ifdef ENABLE_QRCODE if(iscn->qr) { _zbar_qr_destroy(iscn->qr); iscn->qr = NULL; } #endif free(iscn); } zbar_image_data_handler_t* zbar_image_scanner_set_data_handler (zbar_image_scanner_t *iscn, zbar_image_data_handler_t *handler, const void *userdata) { zbar_image_data_handler_t *result = iscn->handler; iscn->handler = handler; iscn->userdata = userdata; return(result); } int zbar_image_scanner_set_config (zbar_image_scanner_t *iscn, zbar_symbol_type_t sym, zbar_config_t cfg, int val) { if(cfg < ZBAR_CFG_POSITION) return(zbar_decoder_set_config(iscn->dcode, sym, cfg, val)); if(sym > ZBAR_PARTIAL) return(1); if(cfg >= ZBAR_CFG_X_DENSITY && cfg <= ZBAR_CFG_Y_DENSITY) { CFG(iscn, cfg) = val; return(0); } if(cfg > ZBAR_CFG_POSITION) return(1); cfg -= ZBAR_CFG_POSITION; if(!val) iscn->config &= ~(1 << cfg); else if(val == 1) iscn->config |= (1 << cfg); else return(1); return(0); } void zbar_image_scanner_enable_cache (zbar_image_scanner_t *iscn, int enable) { if(iscn->cache) { /* recycle all cached syms */ _zbar_image_scanner_recycle_syms(iscn, iscn->cache); iscn->cache = NULL; } iscn->enable_cache = (enable) ? 1 : 0; } const zbar_symbol_set_t * zbar_image_scanner_get_results (const zbar_image_scanner_t *iscn) { return(iscn->syms); } static inline void quiet_border (zbar_image_scanner_t *iscn) { /* flush scanner pipeline */ zbar_scanner_t *scn = iscn->scn; zbar_scanner_flush(scn); zbar_scanner_flush(scn); zbar_scanner_new_scan(scn); } #define movedelta(dx, dy) do { \ x += (dx); \ y += (dy); \ p += (dx) + ((intptr_t)(dy) * w); \ } while(0); int zbar_scan_image (zbar_image_scanner_t *iscn, zbar_image_t *img) { /* timestamp image * FIXME prefer video timestamp */ #if _POSIX_TIMERS > 0 struct timespec abstime; clock_gettime(CLOCK_REALTIME, &abstime); iscn->time = (abstime.tv_sec * 1000) + ((abstime.tv_nsec / 500000) + 1) / 2; #else struct timeval abstime; gettimeofday(&abstime, NULL); iscn->time = (abstime.tv_sec * 1000) + ((abstime.tv_usec / 500) + 1) / 2; #endif #ifdef ENABLE_QRCODE _zbar_qr_reset(iscn->qr); #endif /* get grayscale image, convert if necessary */ if(img->format != fourcc('Y','8','0','0') && img->format != fourcc('G','R','E','Y')) return(-1); iscn->img = img; /* recycle previous scanner and image results */ zbar_image_scanner_recycle_image(iscn, img); zbar_symbol_set_t *syms = iscn->syms; if(!syms) { syms = iscn->syms = _zbar_symbol_set_create(); STAT(syms_new); zbar_symbol_set_ref(syms, 1); } else zbar_symbol_set_ref(syms, 2); img->syms = syms; unsigned w = img->width; unsigned h = img->height; const uint8_t *data = img->data; zbar_image_write_png(img, "debug.png"); svg_open("debug.svg", 0, 0, w, h); svg_image("debug.png", w, h); zbar_scanner_t *scn = iscn->scn; int density = CFG(iscn, ZBAR_CFG_Y_DENSITY); if(density > 0) { svg_group_start("scanner", 0, 1, 1, 0, 0); const uint8_t *p = data; int x = 0, y = 0; iscn->dy = 0; int border = (((h - 1) % density) + 1) / 2; if(border > h / 2) border = h / 2; movedelta(0, border); iscn->v = y; zbar_scanner_new_scan(scn); while(y < h) { zprintf(128, "img_x+: %04d,%04d @%p\n", x, y, p); svg_path_start("vedge", 1. / 32, 0, y + 0.5); iscn->dx = iscn->du = 1; iscn->umin = 0; while(x < w) { uint8_t d = *p; movedelta(1, 0); zbar_scan_y(scn, d); } ASSERT_POS; quiet_border(iscn); svg_path_end(); movedelta(-1, density); iscn->v = y; if(y >= h) break; zprintf(128, "img_x-: %04d,%04d @%p\n", x, y, p); svg_path_start("vedge", -1. / 32, w, y + 0.5); iscn->dx = iscn->du = -1; iscn->umin = w; while(x >= 0) { uint8_t d = *p; movedelta(-1, 0); zbar_scan_y(scn, d); } ASSERT_POS; quiet_border(iscn); svg_path_end(); movedelta(1, density); iscn->v = y; } svg_group_end(); } iscn->dx = 0; density = CFG(iscn, ZBAR_CFG_X_DENSITY); if(density > 0) { svg_group_start("scanner", 90, 1, -1, 0, 0); const uint8_t *p = data; int x = 0, y = 0; int border = (((w - 1) % density) + 1) / 2; if(border > w / 2) border = w / 2; movedelta(border, 0); iscn->v = x; while(x < w) { zprintf(128, "img_y+: %04d,%04d @%p\n", x, y, p); svg_path_start("vedge", 1. / 32, 0, x + 0.5); iscn->dy = iscn->du = 1; iscn->umin = 0; while(y < h) { uint8_t d = *p; movedelta(0, 1); zbar_scan_y(scn, d); } ASSERT_POS; quiet_border(iscn); svg_path_end(); movedelta(density, -1); iscn->v = x; if(x >= w) break; zprintf(128, "img_y-: %04d,%04d @%p\n", x, y, p); svg_path_start("vedge", -1. / 32, h, x + 0.5); iscn->dy = iscn->du = -1; iscn->umin = h; while(y >= 0) { uint8_t d = *p; movedelta(0, -1); zbar_scan_y(scn, d); } ASSERT_POS; quiet_border(iscn); svg_path_end(); movedelta(density, 1); iscn->v = x; } svg_group_end(); } iscn->dy = 0; iscn->img = NULL; #ifdef ENABLE_QRCODE _zbar_qr_decode(iscn->qr, iscn, img); #endif /* FIXME tmp hack to filter bad EAN results */ if(syms->nsyms && !iscn->enable_cache && (density == 1 || CFG(iscn, ZBAR_CFG_Y_DENSITY) == 1)) { zbar_symbol_t **symp = &syms->head, *sym; while((sym = *symp)) { if(sym->type < ZBAR_I25 && sym->type > ZBAR_PARTIAL && sym->quality < 3) { /* recycle */ *symp = sym->next; syms->nsyms--; sym->next = NULL; _zbar_image_scanner_recycle_syms(iscn, sym); } else symp = &sym->next; } } if(syms->nsyms && iscn->handler) iscn->handler(img, iscn->userdata); svg_close(); return(syms->nsyms); } #ifdef DEBUG_SVG /* FIXME lame...*/ # include "svg.c" #endif zbar-0.10/zbar/refcnt.h0000644000000000000000000000424311270371414011652 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _REFCNT_H_ #define _REFCNT_H_ #include #include #if defined(_WIN32) # include typedef volatile LONG refcnt_t; /* FIXME where did volatile come from? */ static inline int _zbar_refcnt (refcnt_t *cnt, int delta) { int rc = -1; if(delta > 0) while(delta--) rc = InterlockedIncrement(cnt); else if(delta < 0) while(delta++) rc = InterlockedDecrement(cnt); assert(rc >= 0); return(rc); } #elif defined(HAVE_LIBPTHREAD) # include typedef int refcnt_t; extern pthread_mutex_t _zbar_reflock; static inline int _zbar_refcnt (refcnt_t *cnt, int delta) { pthread_mutex_lock(&_zbar_reflock); int rc = (*cnt += delta); pthread_mutex_unlock(&_zbar_reflock); assert(rc >= 0); return(rc); } #else typedef int refcnt_t; static inline int _zbar_refcnt (refcnt_t *cnt, int delta) { int rc = (*cnt += delta); assert(rc >= 0); return(rc); } #endif void _zbar_refcnt_init(void); #endif zbar-0.10/zbar/config.c0000644000000000000000000001112211270371414011623 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include /* strtol */ #include /* strchr, strncmp, strlen */ #include #include #include int zbar_parse_config (const char *cfgstr, zbar_symbol_type_t *sym, zbar_config_t *cfg, int *val) { if(!cfgstr) return(1); const char *dot = strchr(cfgstr, '.'); if(dot) { int len = dot - cfgstr; if(!len || (len == 1 && !strncmp(cfgstr, "*", len))) *sym = 0; else if(len < 2) return(1); else if(!strncmp(cfgstr, "qrcode", len)) *sym = ZBAR_QRCODE; else if(len < 3) return(1); else if(!strncmp(cfgstr, "upca", len)) *sym = ZBAR_UPCA; else if(!strncmp(cfgstr, "upce", len)) *sym = ZBAR_UPCE; else if(!strncmp(cfgstr, "ean13", len)) *sym = ZBAR_EAN13; else if(!strncmp(cfgstr, "ean8", len)) *sym = ZBAR_EAN8; else if(!strncmp(cfgstr, "i25", len)) *sym = ZBAR_I25; else if(len < 4) return(1); else if(!strncmp(cfgstr, "scanner", len)) *sym = ZBAR_PARTIAL; /* FIXME lame */ else if(!strncmp(cfgstr, "isbn13", len)) *sym = ZBAR_ISBN13; else if(!strncmp(cfgstr, "isbn10", len)) *sym = ZBAR_ISBN10; #if 0 /* FIXME addons are configured per-main symbol type */ else if(!strncmp(cfgstr, "addon2", len)) *sym = ZBAR_ADDON2; else if(!strncmp(cfgstr, "addon5", len)) *sym = ZBAR_ADDON5; #endif else if(len < 6) return(1); else if(!strncmp(cfgstr, "code39", len)) *sym = ZBAR_CODE39; else if(!strncmp(cfgstr, "pdf417", len)) *sym = ZBAR_PDF417; else if(len < 7) return(1); else if(!strncmp(cfgstr, "code128", len)) *sym = ZBAR_CODE128; else return(1); cfgstr = dot + 1; } else *sym = 0; int len = strlen(cfgstr); const char *eq = strchr(cfgstr, '='); if(eq) len = eq - cfgstr; else *val = 1; /* handle this here so we can override later */ char negate = 0; if(len > 3 && !strncmp(cfgstr, "no-", 3)) { negate = 1; cfgstr += 3; len -= 3; } if(len < 1) return(1); else if(!strncmp(cfgstr, "y-density", len)) *cfg = ZBAR_CFG_Y_DENSITY; else if(!strncmp(cfgstr, "x-density", len)) *cfg = ZBAR_CFG_X_DENSITY; else if(len < 2) return(1); else if(!strncmp(cfgstr, "enable", len)) *cfg = ZBAR_CFG_ENABLE; else if(len < 3) return(1); else if(!strncmp(cfgstr, "disable", len)) { *cfg = ZBAR_CFG_ENABLE; negate = !negate; /* no-disable ?!? */ } else if(!strncmp(cfgstr, "min-length", len)) *cfg = ZBAR_CFG_MIN_LEN; else if(!strncmp(cfgstr, "max-length", len)) *cfg = ZBAR_CFG_MAX_LEN; else if(!strncmp(cfgstr, "ascii", len)) *cfg = ZBAR_CFG_ASCII; else if(!strncmp(cfgstr, "add-check", len)) *cfg = ZBAR_CFG_ADD_CHECK; else if(!strncmp(cfgstr, "emit-check", len)) *cfg = ZBAR_CFG_EMIT_CHECK; else if(!strncmp(cfgstr, "position", len)) *cfg = ZBAR_CFG_POSITION; else return(1); if(eq) { errno = 0; *val = strtol(eq + 1, NULL, 0); if(errno) return(1); } if(negate) *val = !*val; return(0); } zbar-0.10/zbar/thread.h0000644000000000000000000000571711270371414011647 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _ZBAR_THREAD_H_ #define _ZBAR_THREAD_H_ /* simple platform thread abstraction */ #include #include "event.h" #if defined(_WIN32) # include # define HAVE_THREADS # define ZTHREAD DWORD WINAPI typedef ZTHREAD (zbar_thread_proc_t)(void*); typedef DWORD zbar_thread_id_t; #elif defined(HAVE_LIBPTHREAD) # include # include # define HAVE_THREADS # define ZTHREAD void* typedef ZTHREAD (zbar_thread_proc_t)(void*); typedef pthread_t zbar_thread_id_t; #else # undef HAVE_THREADS # undef ZTHREAD typedef void zbar_thread_proc_t; typedef int zbar_thread_id_t; #endif typedef struct zbar_thread_s { zbar_thread_id_t tid; int started, running; zbar_event_t notify, activity; } zbar_thread_t; #if defined(_WIN32) static inline void _zbar_thread_init (zbar_thread_t *thr) { thr->running = 1; _zbar_event_trigger(&thr->activity); } static inline zbar_thread_id_t _zbar_thread_self () { return(GetCurrentThreadId()); } static inline int _zbar_thread_is_self (zbar_thread_id_t tid) { return(tid == GetCurrentThreadId()); } #elif defined(HAVE_LIBPTHREAD) static inline void _zbar_thread_init (zbar_thread_t *thr) { sigset_t sigs; sigfillset(&sigs); pthread_sigmask(SIG_BLOCK, &sigs, NULL); thr->running = 1; _zbar_event_trigger(&thr->activity); } static inline zbar_thread_id_t _zbar_thread_self (void) { return(pthread_self()); } static inline int _zbar_thread_is_self (zbar_thread_id_t tid) { return(pthread_equal(tid, pthread_self())); } #else # define _zbar_thread_start(...) -1 # define _zbar_thread_stop(...) 0 # define _zbar_thread_self(...) 0 # define _zbar_thread_is_self(...) 1 #endif #ifdef HAVE_THREADS extern int _zbar_thread_start(zbar_thread_t*, zbar_thread_proc_t*, void*, zbar_mutex_t*); extern int _zbar_thread_stop(zbar_thread_t*, zbar_mutex_t*); #endif #endif zbar-0.10/zbar/window.h0000644000000000000000000001135711270371414011704 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef _WINDOW_H_ #define _WINDOW_H_ #include #ifdef HAVE_INTTYPES_H # include #endif #include #include #include "symbol.h" #include "error.h" #include "mutex.h" typedef struct window_state_s window_state_t; struct zbar_window_s { errinfo_t err; /* error reporting */ zbar_image_t *image; /* last displayed image * NB image access must be locked! */ unsigned overlay; /* user set overlay level */ uint32_t format; /* output format */ unsigned width, height; /* current output size */ unsigned max_width, max_height; uint32_t src_format; /* current input format */ unsigned src_width; /* last displayed image size */ unsigned src_height; unsigned dst_width; /* conversion target */ unsigned dst_height; unsigned scale_num; /* output scaling */ unsigned scale_den; point_t scaled_offset; /* output position and size */ point_t scaled_size; uint32_t *formats; /* supported formats (zero terminated) */ zbar_mutex_t imglock; /* lock displayed image */ void *display; unsigned long xwin; unsigned long time; /* last image display in milliseconds */ unsigned long time_avg; /* average of inter-frame times */ window_state_t *state; /* platform/interface specific state */ /* interface dependent methods */ int (*init)(zbar_window_t*, zbar_image_t*, int); int (*draw_image)(zbar_window_t*, zbar_image_t*); int (*cleanup)(zbar_window_t*); }; /* window.draw has to be thread safe wrt/other apis * FIXME should be a semaphore */ static inline int window_lock (zbar_window_t *w) { int rc = 0; if((rc = _zbar_mutex_lock(&w->imglock))) { err_capture(w, SEV_FATAL, ZBAR_ERR_LOCKING, __func__, "unable to acquire lock"); w->err.errnum = rc; return(-1); } return(0); } static inline int window_unlock (zbar_window_t *w) { int rc = 0; if((rc = _zbar_mutex_unlock(&w->imglock))) { err_capture(w, SEV_FATAL, ZBAR_ERR_LOCKING, __func__, "unable to release lock"); w->err.errnum = rc; return(-1); } return(0); } static inline int _zbar_window_add_format (zbar_window_t *w, uint32_t fmt) { int i; for(i = 0; w->formats && w->formats[i]; i++) if(w->formats[i] == fmt) return(i); w->formats = realloc(w->formats, (i + 2) * sizeof(uint32_t)); w->formats[i] = fmt; w->formats[i + 1] = 0; return(i); } static inline point_t window_scale_pt (zbar_window_t *w, point_t p) { p.x = ((long)p.x * w->scale_num + w->scale_den - 1) / w->scale_den; p.y = ((long)p.y * w->scale_num + w->scale_den - 1) / w->scale_den; return(p); } /* PAL interface */ extern int _zbar_window_attach(zbar_window_t*, void*, unsigned long); extern int _zbar_window_expose(zbar_window_t*, int, int, int, int); extern int _zbar_window_resize(zbar_window_t*); extern int _zbar_window_clear(zbar_window_t*); extern int _zbar_window_begin(zbar_window_t*); extern int _zbar_window_end(zbar_window_t*); extern int _zbar_window_draw_marker(zbar_window_t*, uint32_t, point_t); extern int _zbar_window_draw_polygon(zbar_window_t*, uint32_t, const point_t*, int); extern int _zbar_window_draw_text(zbar_window_t*, uint32_t, point_t, const char*); extern int _zbar_window_fill_rect(zbar_window_t*, uint32_t, point_t, point_t); extern int _zbar_window_draw_logo(zbar_window_t*); #endif zbar-0.10/INSTALL0000644000000000000000000001722711270371414010321 00000000000000Basic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. To suppress all normal output, redirect it to `/dev/null' (any error messages will still be shown). `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. zbar-0.10/README.windows0000644000000000000000000001006311270371414011630 00000000000000ZBAR BAR CODE READER ==================== ZBar Bar Code Reader is an open source software suite for reading bar codes from various sources, such as video streams, image files and raw intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code. Included with the library are basic applications for decoding captured bar code images and using a video device (eg, webcam) as a bar code scanner. For application developers, language bindings are included for C, C++, Python and Perl as well as GUI widgets for Qt, GTK and PyGTK. Check the ZBar home page for the latest release, mailing lists, etc. http://zbar.sourceforge.net/ License information can be found in 'COPYING'. This Windows distribution also includes pre-compiled binaries of several supporting libraries, for which the copyright, license and source code locations are as follows: * The GNU libiconv character set conversion library Copyright (C) 1999-2008 Free Software Foundation, Inc. This distribution includes GNU libiconv version 1.13.1, licensed under the LGPL version 2. The source code is available from http://www.gnu.org/software/libiconv * The ImageMagick software imaging library Copyright 1999-2009 ImageMagick Studio LLC This distribution includes ImageMagick version 6.5.4-10, licensed under its own terms. The source code is available from http://imagemagick.org * The libxml2 XML C parser and toolkit Copyright (C) 1998-2003 Daniel Veillard. This distribution includes libxml2 version 2.7.3, provided under the MIT license. The source code is available from http://xmlsoft.org * IJG JPEG library Copyright (C) 1991-2009, Thomas G. Lane, Guido Vollbeding. This distribution includes jpeg version 7, licensed under its own terms. The source code is available from http://www.ijg.org * libtiff, a library for reading and writing TIFF Copyright (c) 1988-1997 Sam Leffler Copyright (c) 1991-1997 Silicon Graphics, Inc. This distribution includes libtiff version 3.9.1, which is provided "as-is". The source code is available from http://www.remotesensing.org/libtiff * libpng, the official PNG reference library Copyright (c) 1998-2009 Glenn Randers-Pehrson This distribution includes libpng version 1.2.40, licensed under its own terms. The source code is available from http://www.libpng.org/pub/png/libpng.html * The zlib general purpose compression library Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler. This distribution includes zlib version 1.2.3, licensed under its own terms. The source code is available from http://zlib.net * The bzip2 compression library Copyright (C) 1996-2007 Julian Seward. This distribution includes bzip2 version 1.0.5, licensed under its own terms. The source code is available from http://bzip.org INSTALLING ========== ZBar for Windows is distributed with an installer, simply run the installer and follow the prompts to install the software. RUNNING ======= This version of the package includes *only command line programs*. (The graphical interface is scheduled for a future release) Invoke Start -> Programs -> ZBar Bar Code Reader -> Start ZBar Command Prompt to open a shell that has the zbarimg and zbarcam commands available (in the PATH). To start the webcam reader using the default camera, type: zbarcam To decode an image file, type eg: zbarimg -d examples\barcode.png For basic command instructions, type: zbarimg --help zbarcam --help Check the manual for more details. REPORTING BUGS ============== Bugs can be reported on the SourceForge project page http://www.sourceforge.net/projects/zbar/ Please include the ZBar version number and a detailed description of the problem. You'll probably have better luck if you're also familiar with the concepts from: http://www.catb.org/~esr/faqs/smart-questions.html zbar-0.10/aclocal.m40000644000000000000000000026524311270371461011135 00000000000000# generated automatically by aclocal 1.10.2 -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.63],, [m4_warning([this file was generated for autoconf 2.63. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically `autoreconf'.])]) # iconv.m4 serial AM6 (gettext-0.17) dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], [ dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_LIB_LINKFLAGS_BODY([iconv]) ]) AC_DEFUN([AM_ICONV_LINK], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV dnl accordingly. AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) dnl Add $INCICONV to CPPFLAGS before performing the following checks, dnl because if the user has installed libiconv and not disabled its use dnl via --without-libiconv-prefix, he wants to use it. The first dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. am_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_func_iconv=yes) if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" AC_TRY_LINK([#include #include ], [iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);], am_cv_lib_iconv=yes am_cv_func_iconv=yes) LIBS="$am_save_LIBS" fi ]) if test "$am_cv_func_iconv" = yes; then AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [ dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi AC_TRY_RUN([ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], [case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac]) LIBS="$am_save_LIBS" ]) case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function and it works.]) fi if test "$am_cv_lib_iconv" = yes; then AC_MSG_CHECKING([how to link with libiconv]) AC_MSG_RESULT([$LIBICONV]) else dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV dnl either. CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi AC_SUBST(LIBICONV) AC_SUBST(LTLIBICONV) ]) AC_DEFUN([AM_ICONV], [ AM_ICONV_LINK if test "$am_cv_func_iconv" = yes; then AC_MSG_CHECKING([for iconv declaration]) AC_CACHE_VAL(am_cv_proto_iconv, [ AC_TRY_COMPILE([ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` AC_MSG_RESULT([$]{ac_t:- }[$]am_cv_proto_iconv) AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi ]) # lib-ld.m4 serial 3 (gettext-0.13) dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl Subroutines of libtool.m4, dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision dnl with libtool.m4. dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. AC_DEFUN([AC_LIB_PROG_LD_GNU], [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, [# I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by GCC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]* | [A-Za-z]:[\\/]*)] [re_direlt='/[^/][^/]*/\.\./'] # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(acl_cv_path_LD, [if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi]) LD="$acl_cv_path_LD" if test -n "$LD"; then AC_MSG_RESULT($LD) else AC_MSG_RESULT(no) fi test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) AC_LIB_PROG_LD_GNU ]) # lib-link.m4 serial 13 (gettext-0.17) dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. AC_PREREQ(2.54) dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and dnl augments the CPPFLAGS variable. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ AC_LIB_LINKFLAGS_BODY([$1], [$2]) ac_cv_lib[]Name[]_libs="$LIB[]NAME" ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" ac_cv_lib[]Name[]_cppflags="$INC[]NAME" ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" ]) LIB[]NAME="$ac_cv_lib[]Name[]_libs" LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" INC[]NAME="$ac_cv_lib[]Name[]_cppflags" LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the dnl results of this search when this library appears as a dependency. HAVE_LIB[]NAME=yes undefine([Name]) undefine([NAME]) ]) dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) dnl searches for libname and the libraries corresponding to explicit and dnl implicit dependencies, together with the specified include files and dnl the ability to compile and link the specified testcode. If found, it dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], [ AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) AC_REQUIRE([AC_LIB_RPATH]) define([Name],[translit([$1],[./-], [___])]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME dnl accordingly. AC_LIB_LINKFLAGS_BODY([$1], [$2]) dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, dnl because if the user has installed lib[]Name and not disabled its use dnl via --without-lib[]Name-prefix, he wants to use it. ac_save_CPPFLAGS="$CPPFLAGS" AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ ac_save_LIBS="$LIBS" LIBS="$LIBS $LIB[]NAME" AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) LIBS="$ac_save_LIBS" ]) if test "$ac_cv_lib[]Name" = yes; then HAVE_LIB[]NAME=yes AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) AC_MSG_CHECKING([how to link with lib[]$1]) AC_MSG_RESULT([$LIB[]NAME]) else HAVE_LIB[]NAME=no dnl If $LIB[]NAME didn't lead to a usable library, we don't need dnl $INC[]NAME either. CPPFLAGS="$ac_save_CPPFLAGS" LIB[]NAME= LTLIB[]NAME= LIB[]NAME[]_PREFIX= fi AC_SUBST([HAVE_LIB]NAME) AC_SUBST([LIB]NAME) AC_SUBST([LTLIB]NAME) AC_SUBST([LIB]NAME[_PREFIX]) undefine([Name]) undefine([NAME]) ]) dnl Determine the platform dependent parameters needed to use rpath: dnl acl_libext, dnl acl_shlibext, dnl acl_hardcode_libdir_flag_spec, dnl acl_hardcode_libdir_separator, dnl acl_hardcode_direct, dnl acl_hardcode_minus_L. AC_DEFUN([AC_LIB_RPATH], [ dnl Tell automake >= 1.10 to complain if config.rpath is missing. m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done ]) wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" dnl Determine whether the user wants rpath handling at all. AC_ARG_ENABLE(rpath, [ --disable-rpath do not hardcode runtime library paths], :, enable_rpath=yes) ]) dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and dnl the libraries corresponding to explicit and implicit dependencies. dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. AC_DEFUN([AC_LIB_LINKFLAGS_BODY], [ AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) dnl Autoconf >= 2.61 supports dots in --with options. define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], [ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) dnl Search the library and its dependencies in $additional_libdir and dnl $LDFLAGS. Using breadth-first-seach. LIB[]NAME= LTLIB[]NAME= INC[]NAME= LIB[]NAME[]_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='$1 $2' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" dnl See if it was already located by an earlier AC_LIB_LINKFLAGS dnl or AC_LIB_HAVE_LINKFLAGS call. uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" else dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined dnl that this library doesn't exist. So just drop it. : fi else dnl Search the library lib$name in $additional_libdir and $LDFLAGS dnl and the already constructed $LIBNAME/$LTLIBNAME. found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" dnl The same code as in the loop below: dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` dnl First look for a shared library. if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi dnl Then look for a static library. if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then dnl Found the library. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then dnl Linking with a shared library. We attempt to hardcode its dnl directory into the executable's runpath, unless it's the dnl standard /usr/lib. if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then dnl No hardcoding is needed. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl Use an explicit option to hardcode DIR into the resulting dnl binary. dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi dnl The hardcoding into $LIBNAME is system dependent. if test "$acl_hardcode_direct" = yes; then dnl Using DIR/libNAME.so during linking hardcodes DIR into the dnl resulting binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode DIR into the resulting dnl binary. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else dnl Rely on "-L$found_dir". dnl But don't add it if it's already contained in the LDFLAGS dnl or the already constructed $LIBNAME haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" else dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH dnl here, because this doesn't fit in flags passed to the dnl compiler. So give up. No hardcoding. This affects only dnl very old systems. dnl FIXME: Not sure whether we should use dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" dnl here. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then dnl Linking with a static library. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" else dnl We shouldn't come here, but anyway it's good to have a dnl fallback. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" fi fi dnl Assume the include files are nearby. additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` LIB[]NAME[]_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then dnl Potentially add $additional_includedir to $INCNAME. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's /usr/local/include and we are using GCC on Linux, dnl 3. if it's already present in $CPPFLAGS or the already dnl constructed $INCNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INC[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $INCNAME. INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" fi fi fi fi fi dnl Look for dependencies. if test -n "$found_la"; then dnl Read the .la file. It defines the variables dnl dlname, library_names, old_library, dependency_libs, current, dnl age, revision, installed, dlopen, dlpreopen, libdir. save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" dnl We use only dependency_libs. for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's /usr/local/lib and we are using GCC on Linux, dnl 3. if it's already present in $LDFLAGS or the already dnl constructed $LIBNAME, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LIBNAME. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIB[]NAME; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LTLIBNAME. LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then dnl Potentially add DIR to rpathdirs. dnl The rpathdirs will be appended to $LIBNAME at the end. haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi dnl Potentially add DIR to ltrpathdirs. dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) dnl Handle this in the next round. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) dnl Handle this in the next round. Throw away the .la's dnl directory; it is already contained in a preceding -L dnl option. names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) dnl Most likely an immediate library name. LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" ;; esac done fi else dnl Didn't find the library; assume it is in the system directories dnl known to the linker and runtime loader. (All the system dnl directories known to the linker should also be known to the dnl runtime loader, otherwise the system is severely misconfigured.) LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user must dnl pass all path elements in one option. We can arrange that for a dnl single library, but not when more than one $LIBNAMEs are used. alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" else dnl The -rpath options are cumulative. for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then dnl When using libtool, the option that works for both libraries and dnl executables is -R. The -R options are cumulative. for found_dir in $ltrpathdirs; do LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" done fi ]) dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, dnl unless already present in VAR. dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes dnl contains two or three consecutive elements that belong together. AC_DEFUN([AC_LIB_APPENDTOVAR], [ for element in [$2]; do haveit= for x in $[$1]; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then [$1]="${[$1]}${[$1]:+ }$element" fi done ]) dnl For those cases where a variable contains several -L and -l options dnl referring to unknown libraries and directories, this macro determines the dnl necessary additional linker options for the runtime path. dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) dnl sets LDADDVAR to linker options needed together with LIBSVALUE. dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, dnl otherwise linking without libtool is assumed. AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], [ AC_REQUIRE([AC_LIB_RPATH]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) $1= if test "$enable_rpath" != no; then if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then dnl Use an explicit option to hardcode directories into the resulting dnl binary. rpathdirs= next= for opt in $2; do if test -n "$next"; then dir="$next" dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem"; then rpathdirs="$rpathdirs $dir" fi next= else case $opt in -L) next=yes ;; -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` dnl No need to hardcode the standard /usr/lib. if test "X$dir" != "X/usr/$acl_libdirstem"; then rpathdirs="$rpathdirs $dir" fi next= ;; *) next= ;; esac fi done if test "X$rpathdirs" != "X"; then if test -n ""$3""; then dnl libtool is used for linking. Use -R options. for dir in $rpathdirs; do $1="${$1}${$1:+ }-R$dir" done else dnl The linker is used for linking directly. if test -n "$acl_hardcode_libdir_separator"; then dnl Weird platform: only the last -rpath option counts, the user dnl must pass all path elements in one option. alldirs= for dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="$flag" else dnl The -rpath options are cumulative. for dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" $1="${$1}${$1:+ }$flag" done fi fi fi fi fi AC_SUBST([$1]) ]) # lib-prefix.m4 serial 5 (gettext-0.15) dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. dnl From Bruno Haible. dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't dnl require excessive bracketing. ifdef([AC_HELP_STRING], [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed dnl to access previously installed libraries. The basic assumption is that dnl a user will want packages to use other packages he previously installed dnl with the same --prefix option. dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate dnl libraries, but is otherwise very convenient. AC_DEFUN([AC_LIB_PREFIX], [ AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) dnl By default, look in $includedir and $libdir. use_additional=yes AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) AC_LIB_ARG_WITH([lib-prefix], [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib --without-lib-prefix don't search for libraries in includedir and libdir], [ if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then AC_LIB_WITH_FINAL_PREFIX([ eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" ]) else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi ]) if test $use_additional = yes; then dnl Potentially add $additional_includedir to $CPPFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/include, dnl 2. if it's already present in $CPPFLAGS, dnl 3. if it's /usr/local/include and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_includedir" != "X/usr/include"; then haveit= for x in $CPPFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_includedir"; then dnl Really add $additional_includedir to $CPPFLAGS. CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" fi fi fi fi dnl Potentially add $additional_libdir to $LDFLAGS. dnl But don't add it dnl 1. if it's the standard /usr/lib, dnl 2. if it's already present in $LDFLAGS, dnl 3. if it's /usr/local/lib and we are using GCC on Linux, dnl 4. if it doesn't exist as a directory. if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= for x in $LDFLAGS; do AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux*) haveit=yes;; esac fi fi if test -z "$haveit"; then if test -d "$additional_libdir"; then dnl Really add $additional_libdir to $LDFLAGS. LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" fi fi fi fi fi ]) dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, dnl acl_final_exec_prefix, containing the values to which $prefix and dnl $exec_prefix will expand at the end of the configure script. AC_DEFUN([AC_LIB_PREPARE_PREFIX], [ dnl Unfortunately, prefix and exec_prefix get only finally determined dnl at the end of configure. if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" ]) dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the dnl variables prefix and exec_prefix bound to the values they will have dnl at the end of the configure script. AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], [ acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" $1 exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" ]) dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing dnl the basename of the libdir, either "lib" or "lib64". AC_DEFUN([AC_LIB_PREPARE_MULTILIB], [ dnl There is no formal standard regarding lib and lib64. The current dnl practice is that on a system supporting 32-bit and 64-bit instruction dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit dnl libraries go under $prefix/lib. We determine the compiler's default dnl mode by looking at the compiler's library search path. If at least dnl of its elements ends in /lib64 or points to a directory whose absolute dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the dnl default, namely "lib". acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi ]) # pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_default([$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # # Check to see whether a particular set of modules exists. Similar # to PKG_CHECK_MODULES(), but does not set variables or print errors. # # # Similar to PKG_CHECK_MODULES, make sure that the first instance of # this or PKG_CHECK_MODULES is called, or make sure to call # PKG_CHECK_EXISTS manually # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_EXISTS], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl if test -n "$PKG_CONFIG" && \ AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then m4_ifval([$2], [$2], [:]) m4_ifvaln([$3], [else $3])dnl fi]) # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test -n "$$1"; then pkg_cv_[]$1="$$1" elif test -n "$PKG_CONFIG"; then PKG_CHECK_EXISTS([$3], [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`], [pkg_failed=yes]) else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # _PKG_SHORT_ERRORS_SUPPORTED # ----------------------------- AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], [AC_REQUIRE([PKG_PROG_PKG_CONFIG]) if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi[]dnl ])# _PKG_SHORT_ERRORS_SUPPORTED # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.ac # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_MSG_CHECKING([for $1]) _PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) _PKG_CONFIG([$1][_LIBS], [libs], [$2]) m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS and $1[]_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details.]) if test $pkg_failed = yes; then _PKG_SHORT_ERRORS_SUPPORTED if test $_pkg_short_errors_supported = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "$2" 2>&1` else $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors "$2" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met: $$1_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. _PKG_TEXT ])], [AC_MSG_RESULT([no]) $4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. _PKG_TEXT To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS AC_MSG_RESULT([yes]) ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.10' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.10.2], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.10.2])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to # `$srcdir', `$srcdir/..', or `$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is `.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [dnl Rely on autoconf to set up CDPATH properly. AC_PREREQ([2.50])dnl # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 8 # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ(2.52)dnl ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 9 # There are a few dirty hacks below to avoid letting `AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "GCJ", or "OBJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl ifelse([$1], CC, [depcc="$CC" am_compiler_list=], [$1], CXX, [depcc="$CXX" am_compiler_list=], [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], UPC, [depcc="$UPC" am_compiler_list=], [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE(dependency-tracking, [ --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. #serial 4 # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [# Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each `.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, # 2005, 2006, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 13 # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.60])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version}) AM_MISSING_PROG(AUTOCONF, autoconf) AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version}) AM_MISSING_PROG(AUTOHEADER, autoheader) AM_MISSING_PROG(MAKEINFO, makeinfo) AM_PROG_INSTALL_SH AM_PROG_INSTALL_STRIP AC_REQUIRE([AM_PROG_MKDIR_P])dnl # We need awk for the "check" target. The system "awk" is bad on # some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES(CC)], [define([AC_PROG_CC], defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES(CXX)], [define([AC_PROG_CXX], defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES(OBJC)], [define([AC_PROG_OBJC], defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl ]) ]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} AC_SUBST(install_sh)]) # Copyright (C) 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 3 # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 6 # AM_PROG_CC_C_O # -------------- # Like AC_PROG_CC_C_O, but changed for automake. AC_DEFUN([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC_C_O])dnl AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi dnl Make sure AC_PROG_CC is never called again, or it will override our dnl setting of CC. m4_define([AC_PROG_CC], [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])]) ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 5 # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it supports --run. # If it does, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= AC_MSG_WARN([`missing' script is too old or missing]) fi ]) # Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_MKDIR_P # --------------- # Check for `mkdir -p'. AC_DEFUN([AM_PROG_MKDIR_P], [AC_PREREQ([2.60])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P, dnl while keeping a definition of mkdir_p for backward compatibility. dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile. dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of dnl Makefile.ins that do not define MKDIR_P, so we do our own dnl adjustment using top_builddir (which is defined more often than dnl MKDIR_P). AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl case $mkdir_p in [[\\/$]]* | ?:[[\\/]]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # ------------------------------ # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), 1)]) # _AM_SET_OPTIONS(OPTIONS) # ---------------------------------- # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) # --------------------------------------------------------------------------- # Adds support for distributing Python modules and packages. To # install modules, copy them to $(pythondir), using the python_PYTHON # automake variable. To install a package with the same name as the # automake package, install to $(pkgpythondir), or use the # pkgpython_PYTHON automake variable. # # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as # locations to install python extension modules (shared libraries). # Another macro is required to find the appropriate flags to compile # extension modules. # # If your package is configured with a different prefix to python, # users will have to add the install directory to the PYTHONPATH # environment variable, or create a .pth file (see the python # documentation for details). # # If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will # cause an error if the version of python installed on the system # doesn't meet the requirement. MINIMUM-VERSION should consist of # numbers and dots only. AC_DEFUN([AM_PATH_PYTHON], [ dnl Find a Python interpreter. Python versions prior to 1.5 are not dnl supported because the default installation locations changed from dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages dnl in 1.5. m4_define_default([_AM_PYTHON_INTERPRETER_LIST], [python python2 python2.5 python2.4 python2.3 python2.2 dnl python2.1 python2.0 python1.6 python1.5]) m4_if([$1],[],[ dnl No version check is needed. # Find any Python interpreter. if test -z "$PYTHON"; then AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) fi am_display_PYTHON=python ], [ dnl A version check is needed. if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. AC_MSG_CHECKING([whether $PYTHON version >= $1]) AM_PYTHON_CHECK_VERSION([$PYTHON], [$1], [AC_MSG_RESULT(yes)], [AC_MSG_ERROR(too old)]) am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. AC_CACHE_CHECK([for a Python interpreter with version >= $1], [am_cv_pathless_PYTHON],[ for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do test "$am_cv_pathless_PYTHON" = none && break AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break]) done]) # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) fi am_display_PYTHON=$am_cv_pathless_PYTHON fi ]) if test "$PYTHON" = :; then dnl Run any user-specified action, or abort. m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])]) else dnl Query Python for its version number. Getting [:3] seems to be dnl the best way to do this; it's what "site.py" does in the standard dnl library. AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version], [am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`]) AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) dnl Use the values of $prefix and $exec_prefix for the corresponding dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made dnl distinct variables so they can be overridden if need be. However, dnl general consensus is that you shouldn't need this ability. AC_SUBST([PYTHON_PREFIX], ['${prefix}']) AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) dnl At times (like when building shared libraries) you may want dnl to know which OS platform Python thinks this is. AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform], [am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`]) AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) dnl Set up 4 directories: dnl pythondir -- where to install python scripts. This is the dnl site-packages directory, not the python standard library dnl directory like in previous automake betas. This behavior dnl is more consistent with lispdir.m4 for example. dnl Query distutils for this directory. distutils does not exist in dnl Python 1.5, so we fall back to the hardcoded directory if it dnl doesn't work. AC_CACHE_CHECK([for $am_display_PYTHON script directory], [am_cv_python_pythondir], [am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`]) AC_SUBST([pythondir], [$am_cv_python_pythondir]) dnl pkgpythondir -- $PACKAGE directory under pythondir. Was dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is dnl more consistent with the rest of automake. AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) dnl pyexecdir -- directory for installing python extension modules dnl (shared libraries) dnl Query distutils for this directory. distutils does not exist in dnl Python 1.5, so we fall back to the hardcoded directory if it dnl doesn't work. AC_CACHE_CHECK([for $am_display_PYTHON extension module directory], [am_cv_python_pyexecdir], [am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`]) AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) dnl Run any user-specified action. $2 fi ]) # AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) # --------------------------------------------------------------------------- # Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION. # Run ACTION-IF-FALSE otherwise. # This test uses sys.hexversion instead of the string equivalent (first # word of sys.version), in order to cope with versions such as 2.2c1. # hexversion has been introduced in Python 1.5.2; it's probably not # worth to support older versions (1.5.1 was released on October 31, 1998). AC_DEFUN([AM_PYTHON_CHECK_VERSION], [prog="import sys, string # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. minver = map(int, string.split('$2', '.')) + [[0, 0, 0]] minverhex = 0 for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]] sys.exit(sys.hexversion < minverhex)" AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005 # Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 4 # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT(yes)]) # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor `install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in `make install-strip', and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be `maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004, 2005 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # serial 2 # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of `v7', `ustar', or `pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. AM_MISSING_PROG([AMTAR], [tar]) m4_if([$1], [v7], [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'], [m4_case([$1], [ustar],, [pax],, [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' _am_tools=${am_cv_prog_tar_$1-$_am_tools} # Do not fold the above two line into one, because Tru64 sh and # Solaris sh will not grok spaces in the rhs of `-'. for _am_tool in $_am_tools do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR m4_include([config/libtool.m4]) m4_include([config/ltoptions.m4]) m4_include([config/ltsugar.m4]) m4_include([config/ltversion.m4]) m4_include([config/lt~obsolete.m4]) zbar-0.10/TODO0000644000000000000000000000403211270371414007746 00000000000000general: * finish error handling * handle video destroyed w/images outstanding * dbg_scan background image stretched (still...) * profile and weed out obvious oversights * example using SANE to scan symbol(s) windows port: * libzbar-0.dll should be zbar-0.dll wrappers: * build API docs for zbargtk, zbarpygtk * is zbargtk/QZBar BGR4 alpha swapped? * widget config APIs * drag-and-drop for widgets (configurable...) * Perl build support integration? * GTK and Qt perl bindings * C++ global wrappers symbologies: * PDF417 * extract/resolve symbol matrix parameters (NB multiple symbols) * error detection/correction * high-level decode * Code 39, i25 optional features (check digit and ASCII escapes) * handle Code 128 function characters (FNC1-4) * Code 128 trailing quiet zone checks * finish addon decoding decoder: * start/stop/abort and location detail APIs (PDF417, OMR) * more configuration options * disable for at least UPC-E (maybe UPC-A?) * Code-39/i25 check digit (after implementation) * Code-39 full ASCII (after implementation) * standard symbology identifiers (which standard?) * set consistency requirements * set scanner filter params * fix max length check during decode * revisit noise and resolution independence image scanner: * extract and track symbol polygons * dynamic scan density (PDF417, OMR) * add multi-sample array interface to linear scanner image formats: * fix image data inheritance * de-interlacing * add color support to conversions (also jpeg) * add support for scanline pad throughout * factor conversion redundancy window: * add XShm support * X protocol error handling * Direct2D * API to query used interface (video, window?) (/format?) * simple image manipulations scale(xv?)/mirror * maintain aspect ratio * more overlay details * decoded result(?) * stats zbarcam/zbarimg: * zbarimg multi-frame duplicate suppression * stats/fps at zbarcam exit * decode hook (program/script)? (also zbarimg?) zbar-0.10/README0000644000000000000000000000662711270371414010152 00000000000000ZBAR BAR CODE READER ==================== ZBar Bar Code Reader is an open source software suite for reading bar codes from various sources, such as video streams, image files and raw intensity sensors. It supports EAN-13/UPC-A, UPC-E, EAN-8, Code 128, Code 39, Interleaved 2 of 5 and QR Code. Included with the library are basic applications for decoding captured bar code images and using a video device (eg, webcam) as a bar code scanner. For application developers, language bindings are included for C, C++, Python and Perl as well as GUI widgets for Qt, GTK and PyGTK. Check the ZBar home page for the latest release, mailing lists, etc. http://zbar.sourceforge.net/ License information can be found in 'COPYING'. BUILDING ======== See 'INSTALL' for generic configuration and build instructions. The scanner/decoder library itself only requires a few standard library functions which should be avilable almost anywhere. The zbarcam program uses the video4linux API (v4l1 or v4l2) to access the video device. This interface is part of the linux kernel, a 2.6 kernel is recommended for full support. More information is available at http://www.linuxtv.org/wiki/ pkg-config is used to locate installed libraries. You should have installed pkg-config if you need any of the remaining components. pkg-config may be obtained from http://pkg-config.freedesktop.org/ The zbarimg program uses ImageMagick to read image files in many different formats. You will need at least ImageMagick version 6.2.6 if you want to scan image files. ImageMagick may be obtained from http://www.imagemagick.org/ The Qt widget requires Qt4. You will need Qt4 if you would like to use or develop a Qt GUI application with an integrated bar code scanning widget. Qt4 may be obtained from http://qt.nokia.com/products The GTK+ widget requires GTK+-2.x. You will need GTK+ if you would like to use or develop a GTK+ GUI application with an integrated bar code scanning widget. GTK+ may be obtained from http://www.gtk.org/ The PyGTK wrapper for the GTK+ widget requires Python and PyGTK. You will need both if you would like to use or develop a PyGTK GUI application with an integrated bar code scanning widget. PyGTK may be obtained from http://www.pygtk.org/ The Python bindings require Python (version?). You will need Python if you would like to scan images or video directly using Python. Python is available from http://python.org/ The Perl bindings require Perl (version?). You will need Perl if you would like to scan images or video directly using Perl. Perl is available from http://www.perl.org/ If required libraries are not available you may disable building for the corresponding component using configure (see configure --help). The Perl bindings must be built separately after installing the library. see perl/README RUNNING ======= 'make install' will install the library and application programs. Run 'zbarcam' to start the video scanner. use 'zbarimg barcode.jpg' to decode a saved image file. Check the manual to find specific options for each program. REPORTING BUGS ============== Bugs can be reported on the sourceforge project page http://www.sourceforge.net/projects/zbar/ Please include the ZBar version number and a detailed description of the problem. You'll probably have better luck if you're also familiar with the concepts from: http://www.catb.org/~esr/faqs/smart-questions.html zbar-0.10/doc/0000777000000000000000000000000011270371535010114 500000000000000zbar-0.10/doc/manual.xml0000644000000000000000000000242611270371414012027 00000000000000 ]> ZBar Barcode Reader zbar-&version; &date; JeffBrown
spadix@users.sourceforge.net
Lead developer
2007 2008 2009 Jeff Brown All Rights Reserved
Introduction ZBar Barcode Reader - Command Reference &refzbarcam; &refzbarimg;
zbar-0.10/doc/version.xml0000644000000000000000000000000511270371530012225 000000000000000.10 zbar-0.10/doc/style.xsl0000644000000000000000000000045411270371414011717 00000000000000 zbar-0.10/doc/reldate.xml0000644000000000000000000000001311270371530012157 000000000000002009-10-23 zbar-0.10/doc/man/0000777000000000000000000000000011270371535010667 500000000000000zbar-0.10/doc/man/zbarimg.10000644000000000000000000001770111270371534012325 00000000000000'\" t .\" Title: zbarimg .\" Author: Jeff Brown .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 2009-10-23 .\" Manual: ZBar Barcode Reader .\" Source: zbar-0.10 .\" Language: English .\" .TH "ZBARIMG" "1" "2009-10-23" "zbar-0.10" "ZBar Barcode Reader" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zbarimg \- scan and decode bar codes from image file(s) .SH "SYNOPSIS" .HP \w'\fBzbarimg\fR\ 'u \fBzbarimg\fR [\fB\-qv\fR] [\fB\-\-quiet\fR] [\fB\-\-verbose\fR\fB[=\fIn\fR]\fR] .br {\fB\-dD\fR | \fB\-\-display\fR | \fB\-\-nodisplay\fR | \fB\-\-xml\fR | \fB\-\-noxml\fR | \fB\-S\fR\fB[\fIsymbology\fR\&.]\fR\fB\fIconfig\fR\fR\fB[=\fIvalue\fR]\fR | \fB\-\-set\ \fR\fB[\fIsymbology\fR\&.]\fR\fB\fIconfig\fR\fR\fB[=\fIvalue\fR]\fR | \fIimage\fR...} .HP \w'\fBzbarimg\fR\ 'u \fBzbarimg\fR {\fB\-h\fR | \fB\-\-help\fR | \fB\-\-version\fR} .SH "DESCRIPTION" .PP For each specified \fIimage\fR file \fBzbarimg\fR scans the image for bar codes and prints any decoded data to stdout\&. Images may optionally be displayed to the screen\&. .PP The underlying library currently supports EAN\-13 (including UPC and ISBN subsets), EAN\-8, Code 128, Code 39, and Interleaved 2 of 5 symbologies\&. The specific type of each detected symbol is printed with the decoded data\&. .PP Note that "\fIimage\fR" in this context refers to any format supported by ImageMagick, including many vector formats such as PDF and PostScript\&. Keep in mind that vector formats are rasterized before scanning; manually rasterize vector images before scanning to avoid unintentionally corrupting embedded barcode bitmaps\&. .SH "OPTIONS" .PP This program follows the usual GNU command line syntax\&. Single letter options may be bundled, long options start with two dashes (`\-\')\&. .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Print a short help message describing command line options to standard output and exit .RE .PP \fB\-\-version\fR .RS 4 Print program version information to standard output and exit .RE .PP \fB\-v\fR, \fB\-\-verbose\fR\fB[=\fIn\fR]\fR .RS 4 Increase debug output level\&. Multiple \fB\-v\fR options create more spew\&. Alternatively specify \fIn\fR to set the debug level directly .RE .PP \fB\-S\fR\fB[\fIsymbology\fR\&.]\fR\fB\fIconfig\fR\fR\fB[=\fIvalue\fR]\fR, \fB\-\-set \fR\fB[\fIsymbology\fR\&.]\fR\fB\fIconfig\fR\fR\fB[=\fIvalue\fR]\fR .RS 4 Set decoder configuration option \fIconfig\fR for \fIsymbology\fR to \fIvalue\fR\&. \fIvalue\fR defaults to 1 if omitted\&. \fIsymbology\fR is one of \fBean13\fR, \fBean8\fR, \fBupca\fR, \fBupce\fR, \fBisbn13\fR, \fBisbn10\fR, \fBi25\fR, \fBcode39\fR, \fBcode128\fR or the special value \fB*\fR\&. If \fIsymbology\fR is omitted or \fB*\fR, the \fIconfig\fR will be set for all applicable symbologies\&. These are the currently recognized \fIconfig\fRs\&. Prefix a config with "no\-" to negate it\&. Not all configs are appropriate for every symbology\&. .PP \fBenable\fR .RS 4 Control decoding/reporting of a symbology\&. For symbologies which are just subsets of \fBean13\fR (\fBupca\fR, \fBupce\fR, \fBisbn13\fR, \fBisbn10\fR), this config controls whether the subsets are detected and reported as such\&. These special cases are disabled by default, all other symbologies default to enabled .RE .PP \fBdisable\fR .RS 4 Antonym for \fBenable\fR .RE .PP \fBemit\-check\fR .RS 4 Control whether check digits are included in the decoded output\&. Enabled by default\&. This config does not apply for \fBcode128\fR, which never returns the check digit\&. It also not apply for cases where the check digit is disabled (see \fBadd\-check\fR)\&. Check digits are currently not implemented for \fBi25\fR or \fBcode39\fR .RE .PP \fBadd\-check\fR .RS 4 Enable decode and verification of a check digit for symbologies where it is optional: this will include \fBcode39\fR and \fBi25\fR, neither of which implements the check digit yet .RE .PP \fBascii\fR .RS 4 Enable escape sequences that encode the full ASCII character set\&. This would apply to \fBcode39\fR, except that it\'s not implemented either\&.\&.\&. .RE .PP \fBposition\fR .RS 4 Enable collection of symbol position information\&. Enabled by default\&. Currently, the position information is unusable, so you can save a few cycles by disabling this\&. .RE .PP \fBmin\-length=\fR\fB\fIn\fR\fR, \fBmax\-length=\fR\fB\fIn\fR\fR .RS 4 Bound the number of decoded characters in a valid symbol\&. If a decode result is outside the configured min/max range (inclusive), it will not be reported\&. Set to 0 to disable the corresponding check\&. This setting applies to variable\-length symbologies: \fBi25\fR, \fBcode39\fR, \fBcode128\fR and \fBpdf417\fR\&. \fBmin\-length\fR defaults to 6 for \fBi25\fR and 1 for \fBcode39\fR (per Code 39 autodiscrimination recommendation); all others default to 0 .RE .PP \fBx\-density=\fR\fB\fIn\fR\fR, \fBy\-density=\fR\fB\fIn\fR\fR .RS 4 Adjust the density of the scanner passes\&. Lower values scan more of the image at the cost of decreased performance\&. Setting to 0 disables scanning along that axis\&. Defaults are both 1\&. .RE .RE .PP \fB\-q\fR, \fB\-\-quiet\fR .RS 4 Quiet operation; only output decoded symbol data\&. specifically this disables the statistics line printed (to stderr) before exiting, as well as the warning message printed (also to stderr) when no barcodes are found in an image .RE .PP \fB\-d\fR, \fB\-\-display\fR, \fB\-D\fR, \fB\-\-nodisplay\fR .RS 4 Enable/disable display of subsequent \fIimage\fR files, until next \fB\-\-display\fR or \fB\-\-nodisplay\fR is encountered\&. This option may appear multiple times to enable display of specific images\&. Image display is disabled by default .RE .PP \fB\-\-xml\fR, \fB\-\-noxml\fR .RS 4 Enable/disable result output using an XML format\&. This format wraps the raw data from the symbol with information about the scan (such as page indices) in an easy to parse format\&. The latest schema is available from \m[blue]\fB\%http://zbar.sourceforge.net/2008/barcode.xsd\fR\m[]\&. .RE .PP \fB\-\-raw\fR .RS 4 Enable raw symbol data output\&. This format prints symbol data separated by newlines without the additional symbology type information that is printed by default .RE .SH "EXAMPLES" .PP Scan a PNG image of a UPC bar code symbol and pass resulting data to a script that searches for the code in a database and does something useful with it: .sp .if n \{\ .RS 4 .\} .nf \fBzbarimg\fR product\&.png | \fBupcrpc\&.py\fR .fi .if n \{\ .RE .\} .sp The \fBupcrpc\&.py\fR example script included in the examples/ subdirectory of the distribution will make an XMLRPC call to a popular internet UPC database and print the product description if found\&. .PP Scan a JPEG image containing several barcodes and display the image in a window, also disabling recognition of Interleaved 2 of 5 codes to prevent confusion with other symbologies or background noise: .sp .if n \{\ .RS 4 .\} .nf \fBzbarimg\fR \fB\-\-display\fR \fB\-Si25\&.disable\fR label\&.jpg .fi .if n \{\ .RE .\} .PP Look in a scanned document only for Code 39, using XML output format so the page numbers are available\&. To enable only Code 39, first all symbologies are disabled, then Code 39 is re\-enabled: .sp .if n \{\ .RS 4 .\} .nf \fBzbarimg\fR \fB\-\-xml\fR \fB\-Sdisable\fR \fB\-Scode39\&.enable\fR scan\&.tiff .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .PP zbarcam(1) .PP \m[blue]\fB\%http://zbar.sf.net/\fR\m[] .SH "BUGS" .PP See \m[blue]\fB\%http://sf.net/tracker/?group_id=189236&atid=928515\fR\m[] .SH "AUTHOR" .PP \fBJeff Brown\fR <\&spadix@users.sourceforge.net\&> .RS 4 Lead developer .RE .SH "COPYRIGHT" .br Copyright \(co 2007-2009 Jeff Brown .br .PP All Rights Reserved .sp zbar-0.10/doc/man/zbarcam.10000644000000000000000000001730711270371534012313 00000000000000'\" t .\" Title: zbarcam .\" Author: Jeff Brown .\" Generator: DocBook XSL Stylesheets v1.75.2 .\" Date: 2009-10-23 .\" Manual: ZBar Barcode Reader .\" Source: zbar-0.10 .\" Language: English .\" .TH "ZBARCAM" "1" "2009-10-23" "zbar-0.10" "ZBar Barcode Reader" .\" ----------------------------------------------------------------- .\" * set default formatting .\" ----------------------------------------------------------------- .\" disable hyphenation .nh .\" disable justification (adjust text to left margin only) .ad l .\" ----------------------------------------------------------------- .\" * MAIN CONTENT STARTS HERE * .\" ----------------------------------------------------------------- .SH "NAME" zbarcam \- scan and decode bar codes from a video device .SH "SYNOPSIS" .HP \w'\fBzbarcam\fR\ 'u \fBzbarcam\fR [\fB\-qv\fR] [\fB\-\-quiet\fR] [\fB\-\-nodisplay\fR] [\fB\-\-xml\fR] [\fB\-\-verbose\fR\fB[=\fIn\fR]\fR] [\fB\-\-prescale=\fR\fB\fIW\fR\fR\fBx\fR\fB\fIH\fR\fR] [\fB\-S\fR\fB[\fIsymbology\fR\&.]\fR\fB\fIconfig\fR\fR\fB[=\fIvalue\fR]\fR] [\fB\-\-set\ \fR\fB[\fIsymbology\fR\&.]\fR\fB\fIconfig\fR\fR\fB[=\fIvalue\fR]\fR] [\fIdevice\fR] .HP \w'\fBzbarcam\fR\ 'u \fBzbarcam\fR {\fB\-h\fR | \fB\-\-help\fR | \fB\-\-version\fR} .SH "DESCRIPTION" .PP \fBzbarcam\fR scans a video4linux video source (eg, a webcam) for bar codes and prints any decoded data to the standard output\&. The video stream is also displayed to the screen\&. .PP \fIdevice\fR is the path to the video4linux (version 1 or 2) character device special file (major number 81 and minor number 0 thru 63)\&. It defaults to /dev/video0 .PP The underlying library currently supports EAN\-13 (including UPC and ISBN subsets), EAN\-8, Code 128, Code 39, and Interleaved 2 of 5 symbologies\&. The specific type of each detected symbol is printed with the decoded data\&. .SH "OPTIONS" .PP This program follows the usual GNU command line syntax\&. Single letter options may be bundled, long options start with two dashes (`\-\')\&. .PP \fB\-h\fR, \fB\-\-help\fR .RS 4 Print a short help message describing command line options to standard output and exit .RE .PP \fB\-\-version\fR .RS 4 Print program version information to standard output and exit .RE .PP \fB\-v\fR, \fB\-\-verbose\fR\fB[=\fIn\fR]\fR .RS 4 Increase debug output level\&. Multiple \fB\-v\fR options create more spew\&. Alternatively specify \fIn\fR to set the debug level directly .RE .PP \fB\-S\fR\fB[\fIsymbology\fR\&.]\fR\fB\fIconfig\fR\fR\fB[=\fIvalue\fR]\fR, \fB\-\-set \fR\fB[\fIsymbology\fR\&.]\fR\fB\fIconfig\fR\fR\fB[=\fIvalue\fR]\fR .RS 4 Set decoder configuration option \fIconfig\fR for \fIsymbology\fR to \fIvalue\fR\&. \fIvalue\fR defaults to 1 if omitted\&. \fIsymbology\fR is one of \fBean13\fR, \fBean8\fR, \fBupca\fR, \fBupce\fR, \fBisbn13\fR, \fBisbn10\fR, \fBi25\fR, \fBcode39\fR, \fBcode128\fR or the special value \fB*\fR\&. If \fIsymbology\fR is omitted or \fB*\fR, the \fIconfig\fR will be set for all applicable symbologies\&. These are the currently recognized \fIconfig\fRs\&. Prefix a config with "no\-" to negate it\&. Not all configs are appropriate for every symbology\&. .PP \fBenable\fR .RS 4 Control decoding/reporting of a symbology\&. For symbologies which are just subsets of \fBean13\fR (\fBupca\fR, \fBupce\fR, \fBisbn13\fR, \fBisbn10\fR), this config controls whether the subsets are detected and reported as such\&. These special cases are disabled by default, all other symbologies default to enabled .RE .PP \fBdisable\fR .RS 4 Antonym for \fBenable\fR .RE .PP \fBemit\-check\fR .RS 4 Control whether check digits are included in the decoded output\&. Enabled by default\&. This config does not apply for \fBcode128\fR, which never returns the check digit\&. It also not apply for cases where the check digit is disabled (see \fBadd\-check\fR)\&. Check digits are currently not implemented for \fBi25\fR or \fBcode39\fR .RE .PP \fBadd\-check\fR .RS 4 Enable decode and verification of a check digit for symbologies where it is optional: this will include \fBcode39\fR and \fBi25\fR, neither of which implements the check digit yet .RE .PP \fBascii\fR .RS 4 Enable escape sequences that encode the full ASCII character set\&. This would apply to \fBcode39\fR, except that it\'s not implemented either\&.\&.\&. .RE .PP \fBposition\fR .RS 4 Enable collection of symbol position information\&. Enabled by default\&. Currently, the position information is unusable, so you can save a few cycles by disabling this\&. .RE .PP \fBmin\-length=\fR\fB\fIn\fR\fR, \fBmax\-length=\fR\fB\fIn\fR\fR .RS 4 Bound the number of decoded characters in a valid symbol\&. If a decode result is outside the configured min/max range (inclusive), it will not be reported\&. Set to 0 to disable the corresponding check\&. This setting applies to variable\-length symbologies: \fBi25\fR, \fBcode39\fR, \fBcode128\fR and \fBpdf417\fR\&. \fBmin\-length\fR defaults to 6 for \fBi25\fR and 1 for \fBcode39\fR (per Code 39 autodiscrimination recommendation); all others default to 0 .RE .PP \fBx\-density=\fR\fB\fIn\fR\fR, \fBy\-density=\fR\fB\fIn\fR\fR .RS 4 Adjust the density of the scanner passes\&. Lower values scan more of the image at the cost of decreased performance\&. Setting to 0 disables scanning along that axis\&. Defaults are both 1\&. .RE .RE .PP \fB\-q\fR, \fB\-\-quiet\fR .RS 4 Quiet operation; disable the audible beep otherwise emitted when a symbol is decoded .RE .PP \fB\-\-nodisplay\fR .RS 4 Disable output video window\&. Video input will be scanned until the program is interrupted or otherwise signaled .RE .PP \fB\-\-xml\fR .RS 4 Stream results using an XML output format\&. This format wraps the raw data from the symbol with information about the scan in an easy to parse format\&. The latest schema is available from \m[blue]\fB\%http://zbar.sourceforge.net/2008/barcode.xsd\fR\m[] .RE .PP \fB\-\-raw\fR .RS 4 Use raw symbol data output format\&. This format prints symbol data separated by newlines without the additional symbology type information that is printed by default .RE .PP \fB\-\-prescale=\fR\fB\fIW\fR\fR\fBx\fR\fB\fIH\fR\fR .RS 4 Request video input scaling from the camera driver\&. Possibly useful for reducing huge frames to achieve a higher frame rate\&. Note that the driver may adjust or completely ignore the scaling request .RE .SH "EXAMPLES" .PP Scan for barcodes using the second video device and pipe the resulting data through a script that searches for each code in a database and does something useful with them: .sp .if n \{\ .RS 4 .\} .nf \fBzbarcam\fR /dev/video1 | \fBupcrpc\&.py\fR .fi .if n \{\ .RE .\} .sp The \fBupcrpc\&.py\fR example script included in the examples/ subdirectory of the distribution will make an XMLRPC call to a popular internet UPC database and print the product description if found\&. .PP Scan for barcodes using the default video device and stream results to stdout in XML format, also disable recognition of Interleaved 2 of 5 codes to prevent confusion with other symbologies or background noise: .sp .if n \{\ .RS 4 .\} .nf \fBzbarcam\fR \fB\-\-xml\fR \fB\-Si25\&.disable\fR .fi .if n \{\ .RE .\} .PP Scan only for Code 39, without using the preview window \- maybe for a fixed installation\&. To enable only Code 39, first all symbologies are disabled, then Code 39 is re\-enabled: .sp .if n \{\ .RS 4 .\} .nf \fBzbarcam\fR \fB\-\-nodisplay\fR \fB\-Sdisable\fR \fB\-Scode39\&.enable\fR .fi .if n \{\ .RE .\} .sp .SH "SEE ALSO" .PP zbarimg(1) .PP \m[blue]\fB\%http://zbar.sf.net/\fR\m[] .SH "BUGS" .PP See \m[blue]\fB\%http://sf.net/tracker/?group_id=189236&atid=928515\fR\m[] .SH "AUTHOR" .PP \fBJeff Brown\fR <\&spadix@users.sourceforge.net\&> .RS 4 Lead developer .RE .SH "COPYRIGHT" .br Copyright \(co 2007-2009 Jeff Brown .br .PP All Rights Reserved .sp zbar-0.10/doc/man/man.stamp0000644000000000000000000000000011270371532012407 00000000000000zbar-0.10/doc/api/0000777000000000000000000000000011270371535010665 500000000000000zbar-0.10/doc/api/footer.html0000644000000000000000000000117211270371414012762 00000000000000
spadix@users.sourceforge.net

Copyright 2008-2009 (c) Jeff Brown - All Rights Reserved.

Verbatim copying and distribution of this entire article are permitted worldwide, without royalty, in any medium, provided this notice, and the copyright notice, are preserved.

zbar-0.10/doc/ref/0000777000000000000000000000000011270371535010670 500000000000000zbar-0.10/doc/ref/zbarcam.xml0000644000000000000000000001433711270371414012751 00000000000000 zbarcam 1 zbarcam scan and decode bar codes from a video device zbarcam device zbarcam Description zbarcam scans a video4linux video source (eg, a webcam) for bar codes and prints any decoded data to the standard output. The video stream is also displayed to the screen. device is the path to the video4linux (version 1 or 2) character device special file (major number 81 and minor number 0 thru 63). It defaults to /dev/video0 The underlying library currently supports EAN-13 (including UPC and ISBN subsets), EAN-8, Code 128, Code 39, and Interleaved 2 of 5 symbologies. The specific type of each detected symbol is printed with the decoded data. Options This program follows the usual GNU command line syntax. Single letter options may be bundled, long options start with two dashes (`-'). &refcommonoptions; Quiet operation; disable the audible beep otherwise emitted when a symbol is decoded Disable output video window. Video input will be scanned until the program is interrupted or otherwise signaled Stream results using an XML output format. This format wraps the raw data from the symbol with information about the scan in an easy to parse format. The latest schema is available from Use raw symbol data output format. This format prints symbol data separated by newlines without the additional symbology type information that is printed by default Request video input scaling from the camera driver. Possibly useful for reducing huge frames to achieve a higher frame rate. Note that the driver may adjust or completely ignore the scaling request Examples Scan for barcodes using the second video device and pipe the resulting data through a script that searches for each code in a database and does something useful with them: zbarcam /dev/video1 | upcrpc.py The upcrpc.py example script included in the examples/ subdirectory of the distribution will make an XMLRPC call to a popular internet UPC database and print the product description if found. Scan for barcodes using the default video device and stream results to stdout in XML format, also disable recognition of Interleaved 2 of 5 codes to prevent confusion with other symbologies or background noise: zbarcam Scan only for Code 39, without using the preview window - maybe for a fixed installation. To enable only Code 39, first all symbologies are disabled, then Code 39 is re-enabled: zbarcam See Also Bugs See zbar-0.10/doc/ref/zbarimg.xml0000644000000000000000000001527711270371414012771 00000000000000 zbarimg 1 zbarimg scan and decode bar codes from image file(s) zbarimg image zbarimg Description For each specified image file zbarimg scans the image for bar codes and prints any decoded data to stdout. Images may optionally be displayed to the screen. The underlying library currently supports EAN-13 (including UPC and ISBN subsets), EAN-8, Code 128, Code 39, and Interleaved 2 of 5 symbologies. The specific type of each detected symbol is printed with the decoded data. Note that "image" in this context refers to any format supported by ImageMagick, including many vector formats such as PDF and PostScript. Keep in mind that vector formats are rasterized before scanning; manually rasterize vector images before scanning to avoid unintentionally corrupting embedded barcode bitmaps. Options This program follows the usual GNU command line syntax. Single letter options may be bundled, long options start with two dashes (`-'). &refcommonoptions; Quiet operation; only output decoded symbol data. specifically this disables the statistics line printed (to stderr) before exiting, as well as the warning message printed (also to stderr) when no barcodes are found in an image Enable/disable display of subsequent image files, until next or is encountered. This option may appear multiple times to enable display of specific images. Image display is disabled by default Enable/disable result output using an XML format. This format wraps the raw data from the symbol with information about the scan (such as page indices) in an easy to parse format. The latest schema is available from . Enable raw symbol data output. This format prints symbol data separated by newlines without the additional symbology type information that is printed by default Examples Scan a PNG image of a UPC bar code symbol and pass resulting data to a script that searches for the code in a database and does something useful with it: zbarimg product.png | upcrpc.py The upcrpc.py example script included in the examples/ subdirectory of the distribution will make an XMLRPC call to a popular internet UPC database and print the product description if found. Scan a JPEG image containing several barcodes and display the image in a window, also disabling recognition of Interleaved 2 of 5 codes to prevent confusion with other symbologies or background noise: zbarimg label.jpg Look in a scanned document only for Code 39, using XML output format so the page numbers are available. To enable only Code 39, first all symbologies are disabled, then Code 39 is re-enabled: zbarimg scan.tiff See Also Bugs See zbar-0.10/doc/ref/commonoptions.xml0000644000000000000000000001460611270371414014235 00000000000000 Print a short help message describing command line options to standard output and exit Print program version information to standard output and exit Increase debug output level. Multiple options create more spew. Alternatively specify n to set the debug level directly Set decoder configuration option config for symbology to value. value defaults to 1 if omitted. symbology is one of , , , , , , , , or the special value . If symbology is omitted or , the config will be set for all applicable symbologies. These are the currently recognized configs. Prefix a config with "no-" to negate it. Not all configs are appropriate for every symbology. Control decoding/reporting of a symbology. For symbologies which are just subsets of (, , , ), this config controls whether the subsets are detected and reported as such. These special cases are disabled by default, all other symbologies default to enabled Antonym for Control whether check digits are included in the decoded output. Enabled by default. This config does not apply for , which never returns the check digit. It also not apply for cases where the check digit is disabled (see ). Check digits are currently not implemented for or Enable decode and verification of a check digit for symbologies where it is optional: this will include and , neither of which implements the check digit yet Enable escape sequences that encode the full ASCII character set. This would apply to , except that it's not implemented either... Enable collection of symbol position information. Enabled by default. Currently, the position information is unusable, so you can save a few cycles by disabling this. Bound the number of decoded characters in a valid symbol. If a decode result is outside the configured min/max range (inclusive), it will not be reported. Set to 0 to disable the corresponding check. This setting applies to variable-length symbologies: , , and . defaults to 6 for and 1 for (per Code 39 autodiscrimination recommendation); all others default to 0 Adjust the density of the scanner passes. Lower values scan more of the image at the cost of decreased performance. Setting to 0 disables scanning along that axis. Defaults are both 1. zbar-0.10/doc/Makefile.am.inc0000644000000000000000000000257411270371414012640 00000000000000# documentation sources DOCSOURCES = doc/manual.xml doc/version.xml doc/reldate.xml \ doc/ref/zbarimg.xml doc/ref/zbarcam.xml doc/ref/commonoptions.xml # man page targets to distribute and install dist_man_MANS = if HAVE_MAGICK dist_man_MANS += doc/man/zbarimg.1 endif if HAVE_VIDEO dist_man_MANS += doc/man/zbarcam.1 endif # witness to man page build (many-to-many workaround) man_stamp = doc/man/man.stamp # TBD add manual content #dist_doc_DATA = doc/zbar.pdf doc/zbar.html # distribute all documentation related files to avoid end-user rebuilds EXTRA_DIST += $(DOCSOURCES) $(man_stamp) EXTRA_DIST += doc/api/footer.html doc/style.xsl docs: $(dist_man_MANS) #dist_doc_DATA .PHONY: docs doc_path = --searchpath $(abs_builddir)/doc -m $(abs_srcdir)/doc/style.xsl # xmlto --searchpath broken again... doc_path += --skip-validation #pdf: doc/zbar-manual.pdf #doc/zbar-manual.pdf: $(DOCSOURCES) # $(XMLTO) $(XMLTOFLAGS) -o doc pdf $< html-local: doc/html/index.html doc/html/index.html: $(DOCSOURCES) $(XMLTO) $(doc_path) $(XMLTOFLAGS) -o doc/html xhtml $< $(dist_man_MANS): $(man_stamp) @if test ! -f $@ ; then \ rm -f $(man_stamp) ; \ $(MAKE) $(AM_MAKEFLAGS) $(man_stamp) ; \ fi $(man_stamp): $(DOCSOURCES) @$(mkdir_p) doc/man 2>/dev/null @rm -f $(man_stamp).tmp @touch $(man_stamp).tmp $(XMLTO) $(doc_path) $(XMLTOFLAGS) -o doc/man man $< @mv $(man_stamp).tmp $(man_stamp) zbar-0.10/doc/doxygen.conf.in0000644000000000000000000000144711270371414012763 00000000000000PROJECT_NAME = "ZBar Bar Code Reader Library" PROJECT_NUMBER = "version @VERSION@" INPUT = @top_srcdir@/include RECURSIVE = YES EXCLUDE = @top_srcdir@/include/zbar/zbargtk.h EXCLUDE_PATTERNS = */.svn/* */.hg/* STRIP_FROM_PATH = @top_srcdir@ OUTPUT_DIRECTORY = doc/api CREATE_SUBDIRS = NO OUTPUT_LANGUAGE = English SOURCE_BROWSER = NO VERBATIM_HEADERS = NO TAB_SIZE = 4 JAVADOC_AUTOBRIEF = YES SUBGROUPING = NO SORT_MEMBER_DOCS = NO SORT_BRIEF_DOCS = NO TYPEDEF_HIDES_STRUCT = YES HIDE_FRIEND_COMPOUNDS = YES HIDE_IN_BODY_DOCS = YES INTERNAL_DOCS = NO MAX_INITIALIZER_LINES = 0 SHOW_INCLUDE_FILES = NO EXTRACT_STATIC = YES QUIET = YES WARNINGS = YES WARN_IF_UNDOCUMENTED = YES WARN_IF_DOC_ERROR = YES GENERATE_XML = YES HTML_HEADER = HTML_FOOTER = @top_srcdir@/doc/api/footer.html HTML_STYLESHEET = zbar-0.10/zbar-qt.pc.in0000644000000000000000000000044711270371414011575 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: zbar-qt Description: bar code scanning and decoding Qt4 widget URL: http://zbar.sourceforge.net Version: @VERSION@ Requires: zbar, QtCore >= 4, QtGui >= 4 Libs: -L${libdir} -lzbarqt Cflags: -I${includedir} zbar-0.10/plugin/0000777000000000000000000000000011270371535010645 500000000000000zbar-0.10/plugin/plugin.c0000644000000000000000000000211711270371414012220 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include zbar-0.10/plugin/Makefile.am.inc0000644000000000000000000000034611270371414013364 00000000000000lib_LTLIBRARIES += plugin/libzbarplugin.la plugin_libzbarplugin_la_SOURCES = \ plugin/plugin.c plugin_libzbarplugin_la_CPPFLAGS = $(MOZILLA_CFLAGS) $(AM_CPPFLAGS) plugin_libzbarplugin_la_LDFLAGS = $(MOZILLA_LIBS) $(AM_LDFLAGS) zbar-0.10/zbar.ico0000644000000000000000000001425611270371414010721 00000000000000(6 ¨^00¨ ( ¨üüÿWWÿÿÿÿD@D@DD131DD131DDA4@DDA3@DD@3@DD@C@DD@D0DD@D1DD@D1DD@DADD@D@DD@D@DD131DD131DD@D@D( @õõý^ùùþJ”‘@@Ùè33ÖOOÇÂüüÿ22ÈHHÇïïüc¬¬îccà–‚ƒƒæssÅIIÚ@@Çkµµ¿¬¬ÀééûžÏÏõ=)]]ß}}å&™™Âppâ„&&É66Ö±±Àßßù((ÈÿÿÿEòòü©©î£ÉÉô€€æ. 99×44ÈYYÝ++É¿¿¿  ÁLLÆ2222AA2AA222AA22222222AA2AA222AA22222222AA2AA222AA2222229 ,6, ,6, 666 666 ,6, ?222- ,6, ,6, 666 666 ,6, 2222 ,6, ,6, 666 666 ,6, ?2222*,618AA222AA22222226,BA222AA22222222/, =(A222AA22222222A ,+222AA22222222A)<,6 22AA22222222AA,6,9>22AA22222222AA26, 22AA22222222AA2A, 6#22AA22222222AA2A>D 6;'22AA22222222AA2A?6602AA22222222AA2AA 66(2AA22222222AA2AA2'!6  2AA22222222AA2AA2:! 6>2AA22222222AA2AA23 662AA22222222AA2AA2 6665AA22222222AA2AA2266- A22222222AA2AA226 1$A22222222AA2AA22.7 ,22222222AA2AA22C,62222222AA2AA22"@6,2222% ,6, ,6, 666 666 ,6, 92222 ,6, ,6, 666 666 ,6, 4222% ,6, ,6, 666 666 ,6, &222222AA2AA222AA22222222AA2AA222AA22222222AA2AA222AA2222àààààààààààààààààààààààààààààààà(0` õõý®¦ùùþŸŸì6²>>Cììû¿¿ò::Œ”£&& ²²ï––êDDMMÜ”@@Ù}__bè``ß33ÖPPqzSSÜf%%{üüÿRïïüÂÂó±??B¶ °ââù™™ëÕÕö™))ž¨¬¬îBB‚ccà–VVÝ//e SSo hééû¬ÜÜøž¢¢ì††ç›]]߇}}å&!!„ppâCCÙ„LLwp66Ö```55Vÿÿÿòòü@@@==G©©î´£ååù®ÉÉô€€æ((uMMv+““éffà99×==Ø66Ua^^cQQQQQQOOQQQQOOQQSSQSSQQOOQQQQQQQQQQQQOOQQQQOOQQSSQSSQQOOQQQQQQQQQQQQOOQQQQOOQQSSQSSQQOOQQQQQQQQQQQQOOQQQQOOQQSSQSSQQOOQQQQQQQQ\aaaaaaaaaaaaa`QQQQ/'W''W'(WWW((WWW('W'`QQQQA'W''W'(WWW((WWW('W'aQQQQU'W''W'(WWW((WWW('W'`QQQQQE'W'aaaaaaaaaa`QQQQQa'W'e+QQOOQQSSQSSQQOOQQQQQQQQQQR4'W'=QOOQQSSQSSQQOOQQQQQQQQQQQXW' OOQQSSQSSQQOOQQQQQQQQQQQQ^>'1hOQQSSQSSQQOOQQQQQQQQQQQQO-"OQQSSQSSQQOOQQQQQQQQQQQQON':QQSSQSSQQOOQQQQQQQQQQQQOO'W QQSSQSSQQOOQQQQQQQQQQQQOOQ\'W' QSSQSSQQOOQQQQQQQQQQQQOOQI'W'b[SSQSSQQOOQQQQQQQQQQQQOOQQ'W'PSQSSQQOOQQQQQQQQQQQQOOQQQR.W'iSQSSQQOOQQQQQQQQQQQQOOQQQQ73'(D6SQSSQQOOQQQQQQQQQQQQOOQQQQOF%(W"SQSSQQOOQQQQQQQQQQQQOOQQQQOLb(WW&QSSQQOOQQQQQQQQQQQQOOQQQQOON(WWWQSSQQOOQQQQQQQQQQQQOOQQQQOOQ(WWW(@SSQQOOQQQQQQQQQQQQOOQQQQOOQQGWWW(5SQQOOQQQQQQQQQQQQOOQQQQOOQQSMWW(<_SQQOOQQQQQQQQQQQQOOQQQQOOQQS"KW((BSQQOOQQQQQQQQQQQQOOQQQQOOQQSi ((WZHSQQOOQQQQQQQQQQQQOOQQQQOOQQSc (WWQQOOQQQQQQQQQQQQOOQQQQOOQQSfe(WWW2QOOQQQQQQQQQQQQOOQQQQOOQQSS$YWWW(\ OOQQQQQQQQQQQQOOQQQQOOQQSSQ]WWW(`OOQQQQQQQQQQQQOOQQQQOOQQSSQS!WW(0OQQQQQQQQQQQQOOQQQQOOQQSSQSgW(VFOQQQQQQQQQQQQOOQQQQOOQQSSQSd8(',QQQQQQQQQQQQOOQQQQOOQQSSQS9?'W;QQQQQQQQQQQOOQQQQOOQQSSQST'W'4#QQQQQQQQQQOOQQQQOOQQSSQSS)J'W'CQQQQQ aaaaaaaaaab'W'IQQQQ*'W''W'(WWW((WWW('W'QQQQa'W''W'(WWW((WWW('W'aQQQQ*'W''W'(WWW((WWW('W'@QQQQ *aaaaaaaaaaaaa\QQQQQQQQOOQQQQOOQQSSQSSQQOOQQQQQQQQQQQQOOQQQQOOQQSSQSSQQOOQQQQQQQQQQQQOOQQQQOOQQSSQSSQQOOQQQQQQQQQQQQOOQQQQOOQQSSQSSQQOOQQQQQQððððððððððððððððððððððððððððððððððððððððððððððððzbar-0.10/NEWS0000644000000000000000000000723211270371414007762 00000000000000ZBar Barcode Reader version 0.10 (2009-10-23): ZBar goes 2D! This release introduces support for QR Code, developed by our new project member, Timothy Terriberry. Timothy is an image processing master, providing this sophisticated functionality using only integer arithmetic and maintaining an extremely small image size. Feel free to drop in on #zbar over at freenode to welcome Timothy (aka derf) to the project and congratulate him on his awesome work. Several bugs fixes and enhancements are also found in this release; existing users are encouraged to upgrade. version 0.9 (2009-08-31): Introducing ZBar for Windows! So far we only have straight ports of the command line applications, but work on a cross-platform GUI has already begun. This release also has a few scanner/decoder enhancements and fixes several bugs. Many internal changes are represented, so please open a support request if you experience any problems. version 0.8 (2009-06-05): This is a bugfix release just to clean up a few issues found in the last release. Existing users are encouraged to upgrade to pick up these fixes. version 0.7 (2009-04-21): Welcome to ZBar! In addition to finalizing the project name change, this release adds new bindings for Python and fixes a few bugs with the Perl interface. The decoder also has several new features and addresses missing checks that will improve reliability with excessively noisy images. version 0.6 (2009-02-28): This release fixes many bugs and adds several improvements suggested by users: support for decoding UPC-E is finished. zebraimg is now able to scan all pages of a document (such as PDF or TIFF) and the new XML output includes the page where each barcode is found. Camera support has been significantly improved, including the addition of JPEG image formats. Perl bindings make it even easier to write a document or video scanning application. Finally, we are now able to offer initial support for building the base library for Windows! version 0.5 (2008-07-25): Introducing zebra widgets! Prioritized by popular demand, this release includes fully functional barcode scanning widgets for GTK, PyGTK, and Qt. Application developers may now seamlessly integrate barcode reader support with their user interface. This release also fixes many bugs; existing users are encouraged to upgrade. version 0.4 (2008-05-31): new support for EAN-8, Code 39 and Interleaved 2 of 5! this release also introduces the long awaited decoder configuration options and fixes several bugs version 0.3 (2008-02-25): this is a beta release of the enhanced internal architecture. support has been added for version 2 of the video4linux API and many more image formats. several other feature enhancements and bug fixes are also included. image scanning is slightly improved for some images, but the base scan/decode function is relatively untouched. significant new code is represented in this release - all bug reports are welcome and will be addressed promptly! version 0.2 (2007-05-16): this release introduces significant enhancements, bug fixes and new features! basic EAN-13/UPC-A reading has been improved and should now be much more reliable. by popular request, new support has been added for decoding Code 128. additionally, the build process was improved and there is even basic documentation for the application commands version 0.1 (2007-03-24): first official Zebra release! supports basic scanning and decoding of EAN-13 and UPC-A symbols using a webcam (zebracam) or from stored image files (zebraimg). still need to add support for addons and EAN-8/UPC-E zbar-0.10/COPYING0000644000000000000000000000237711270371414010323 00000000000000The ZBar Bar Code Reader is Copyright (C) 2007-2009 Jeff Brown The QR Code reader is Copyright (C) 1999-2009 Timothy B. Terriberry You can redistribute this library and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ISAAC is based on the public domain implementation by Robert J. Jenkins Jr., and is itself public domain. Portions of the bit stream reader are copyright (C) The Xiph.Org Foundation 1994-2008, and are licensed under a BSD-style license. The Reed-Solomon decoder is derived from an implementation (C) 1991-1995 Henry Minsky (hqm@ua.com, hqm@ai.mit.edu), and is licensed under the LGPL with permission. zbar-0.10/examples/0000777000000000000000000000000011270371535011165 500000000000000zbar-0.10/examples/processor.py0000755000000000000000000000133111270371414013467 00000000000000#!/usr/bin/python from sys import argv import zbar # create a Processor proc = zbar.Processor() # configure the Processor proc.parse_config('enable') # initialize the Processor device = '/dev/video0' if len(argv) > 1: device = argv[1] proc.init(device) # setup a callback def my_handler(proc, image, closure): # extract results for symbol in image.symbols: # do something useful with results print 'decoded', symbol.type, 'symbol', '"%s"' % symbol.data proc.set_data_handler(my_handler) # enable the preview window proc.visible = True # initiate scanning proc.active = True try: # keep scanning until user provides key/mouse input proc.user_wait() except zbar.WindowClosed, e: pass zbar-0.10/examples/read_one.pl0000755000000000000000000000117411270371414013214 00000000000000#!/usr/bin/env perl use warnings; use strict; require Barcode::ZBar; # create a Processor my $proc = Barcode::ZBar::Processor->new(); # configure the Processor $proc->parse_config("enable"); # initialize the Processor $proc->init($ARGV[0] || '/dev/video0'); # enable the preview window $proc->set_visible(); # read at least one barcode (or until window closed) $proc->process_one(); # hide the preview window $proc->set_visible(0); # extract results foreach my $symbol ($proc->get_results()) { # do something useful with results print('decoded ' . $symbol->get_type() . ' symbol "' . $symbol->get_data() . "\"\n"); } zbar-0.10/examples/scan_image.c0000644000000000000000000000537311270371414013337 00000000000000#include #include #include #include zbar_image_scanner_t *scanner = NULL; /* to complete a runnable example, this abbreviated implementation of * get_data() will use libpng to read an image file. refer to libpng * documentation for details */ static void get_data (const char *name, int *width, int *height, void **raw) { FILE *file = fopen(name, "rb"); if(!file) exit(2); png_structp png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if(!png) exit(3); if(setjmp(png_jmpbuf(png))) exit(4); png_infop info = png_create_info_struct(png); if(!info) exit(5); png_init_io(png, file); png_read_info(png, info); /* configure for 8bpp grayscale input */ int color = png_get_color_type(png, info); int bits = png_get_bit_depth(png, info); if(color & PNG_COLOR_TYPE_PALETTE) png_set_palette_to_rgb(png); if(color == PNG_COLOR_TYPE_GRAY && bits < 8) png_set_gray_1_2_4_to_8(png); if(bits == 16) png_set_strip_16(png); if(color & PNG_COLOR_MASK_ALPHA) png_set_strip_alpha(png); if(color & PNG_COLOR_MASK_COLOR) png_set_rgb_to_gray_fixed(png, 1, -1, -1); /* allocate image */ *width = png_get_image_width(png, info); *height = png_get_image_height(png, info); *raw = malloc(*width * *height); png_bytep rows[*height]; int i; for(i = 0; i < *height; i++) rows[i] = *raw + (*width * i); png_read_image(png, rows); } int main (int argc, char **argv) { if(argc < 2) return(1); /* create a reader */ scanner = zbar_image_scanner_create(); /* configure the reader */ zbar_image_scanner_set_config(scanner, 0, ZBAR_CFG_ENABLE, 1); /* obtain image data */ int width = 0, height = 0; void *raw = NULL; get_data(argv[1], &width, &height, &raw); /* wrap image data */ zbar_image_t *image = zbar_image_create(); zbar_image_set_format(image, *(int*)"Y800"); zbar_image_set_size(image, width, height); zbar_image_set_data(image, raw, width * height, zbar_image_free_data); /* scan the image for barcodes */ int n = zbar_scan_image(scanner, image); /* extract results */ const zbar_symbol_t *symbol = zbar_image_first_symbol(image); for(; symbol; symbol = zbar_symbol_next(symbol)) { /* do something useful with results */ zbar_symbol_type_t typ = zbar_symbol_get_type(symbol); const char *data = zbar_symbol_get_data(symbol); printf("decoded %s symbol \"%s\"\n", zbar_get_symbol_name(typ), data); } /* clean up */ zbar_image_destroy(image); zbar_image_scanner_destroy(scanner); return(0); } zbar-0.10/examples/scan_image.vcproj0000644000000000000000000000246211270371414014414 00000000000000 zbar-0.10/examples/processor.pl0000755000000000000000000000140411270371414013453 00000000000000#!/usr/bin/env perl use warnings; use strict; require Barcode::ZBar; # create a Processor my $proc = Barcode::ZBar::Processor->new(); # configure the Processor $proc->parse_config("enable"); # initialize the Processor $proc->init($ARGV[0] || '/dev/video0'); # setup a callback sub my_handler { my ($proc, $image, $closure) = @_; # extract results foreach my $symbol ($proc->get_results()) { # do something useful with results print('decoded ' . $symbol->get_type() . ' symbol "' . $symbol->get_data() . "\"\n"); } } $proc->set_data_handler(\&my_handler); # enable the preview window $proc->set_visible(); # initiate scanning $proc->set_active(); # keep scanning until user provides key/mouse input $proc->user_wait(); zbar-0.10/examples/upcrpc.pl0000755000000000000000000000176711270371414012744 00000000000000#!/usr/bin/perl use warnings; use strict; use Frontier::Client; use Data::Dumper; my $s = Frontier::Client->new('url' => 'http://dev.upcdatabase.com/rpc'); $| = 1; # autoflush foreach (@ARGV) { lookup($_); } if(!-t) { while(1) { my $decode = ; last unless(defined($decode)); chomp($decode); lookup($decode); } } sub lookup { my $decode = shift; if($decode =~ m[^(EAN-13:|UPC-A:)?(\d{11,13})$] && ($1 && $1 eq "UPC-A:") || ($2 && length($2) > 11)) { my $ean = $2; $ean = "0" . $ean if($1 && $1 eq "UPC-A:"); $ean = $s->call('calculateCheckDigit', $ean . "C") if(length($ean) == 12); print("[$decode] "); my $result = $s->call('lookupEAN', $s->string($ean)); if(ref($result)) { print((!$result->{found} || (ref($result->{found}) && !$result->{found}->value())) ? "not found\n" : "$result->{description}\n") } else { print("$result\n"); } } else { print("$decode\n"); } } zbar-0.10/examples/scan_image.cpp0000644000000000000000000000261511270371414013673 00000000000000#include #include #include #define STR(s) #s using namespace std; using namespace zbar; int main (int argc, char **argv) { if(argc < 2) return(1); #ifdef MAGICK_HOME // http://www.imagemagick.org/Magick++/ // under Windows it is necessary to initialize the ImageMagick // library prior to using the Magick++ library Magick::InitializeMagick(MAGICK_HOME); #endif // create a reader ImageScanner scanner; // configure the reader scanner.set_config(ZBAR_NONE, ZBAR_CFG_ENABLE, 1); // obtain image data Magick::Image magick(argv[1]); // read an image file int width = magick.columns(); // extract dimensions int height = magick.rows(); Magick::Blob blob; // extract the raw data magick.modifyImage(); magick.write(&blob, "GRAY", 8); const void *raw = blob.data(); // wrap image data Image image(width, height, "Y800", raw, width * height); // scan the image for barcodes int n = scanner.scan(image); // extract results for(Image::SymbolIterator symbol = image.symbol_begin(); symbol != image.symbol_end(); ++symbol) { // do something useful with results cout << "decoded " << symbol->get_type_name() << " symbol \"" << symbol->get_data() << '"' << endl; } // clean up image.set_data(NULL, 0); return(0); } zbar-0.10/examples/scan_image.pl0000755000000000000000000000151611270371414013526 00000000000000#!/usr/bin/perl use warnings; use strict; require Image::Magick; require Barcode::ZBar; $ARGV[0] || die; # create a reader my $scanner = Barcode::ZBar::ImageScanner->new(); # configure the reader $scanner->parse_config("enable"); # obtain image data my $magick = Image::Magick->new(); $magick->Read($ARGV[0]) && die; my $raw = $magick->ImageToBlob(magick => 'GRAY', depth => 8); # wrap image data my $image = Barcode::ZBar::Image->new(); $image->set_format('Y800'); $image->set_size($magick->Get(qw(columns rows))); $image->set_data($raw); # scan the image for barcodes my $n = $scanner->scan_image($image); # extract results foreach my $symbol ($image->get_symbols()) { # do something useful with results print('decoded ' . $symbol->get_type() . ' symbol "' . $symbol->get_data() . "\"\n"); } # clean up undef($image); zbar-0.10/examples/upcrpc.py0000755000000000000000000000223211270371414012745 00000000000000#!/usr/bin/env python from xmlrpclib import ServerProxy import sys, re server = ServerProxy("http://dev.upcdatabase.com/rpc") ean_re = re.compile(r'^(UPC-A:|EAN-13:)?(\d{11,13})$', re.M) def lookup(decode): match = ean_re.search(decode) if match is None: print decode, return ean = match.group(2) if match.group(1) == "UPC-A:": ean = "0" + ean; elif len(ean) < 12: print decode, return if len(ean) == 12: ean = server.calculateCheckDigit(ean + "C") print "[" + match.group(1) + ean + "]", result = server.lookupEAN(ean) if isinstance(result, dict): if "found" not in result or not result["found"] or \ "description" not in result: print "not found" else: print result["description"] else: print str(result) sys.stdout.flush() if __name__ == "__main__": del sys.argv[0] if len(sys.argv): for decode in sys.argv: lookup(decode) if not sys.stdin.isatty(): while 1: decode = sys.stdin.readline() if not decode: break lookup(decode) zbar-0.10/examples/scan_image.py0000755000000000000000000000111111270371414013532 00000000000000#!/usr/bin/python from sys import argv import zbar import Image if len(argv) < 2: exit(1) # create a reader scanner = zbar.ImageScanner() # configure the reader scanner.parse_config('enable') # obtain image data pil = Image.open(argv[1]).convert('L') width, height = pil.size raw = pil.tostring() # wrap image data image = zbar.Image(width, height, 'Y800', raw) # scan the image for barcodes scanner.scan(image) # extract results for symbol in image: # do something useful with results print 'decoded', symbol.type, 'symbol', '"%s"' % symbol.data # clean up del(image) zbar-0.10/examples/barcode.png0000644000000000000000000000223611270371414013205 00000000000000‰PNG  IHDRrPo°éËgAMA± üasRGB®Îé cHRMz&€„ú€èu0ê`:˜pœºQ<bKGDª#2 pHYs=ƒ=ƒ‡è vpAgrPéƒL—äIDATxÚí•!hcA†£N–ƒªÂAd¡âÅgj 5º#&q¥*DÄDÄ”¸ÀQê*Ž˜@D]*ª …ˆºˆx"®„º˜¹gg÷í¾¼^¡Ç'fBÞ¾·»3;ßÌìn‰ ä„6ò/ËÓ´¶Ÿ‚6?3s:'^?ûÊÛvó³6^qw,ìËû•ù–I©²B/ò/ÉÓ´¶Ÿ‚6?3s:¯Ÿ}åm»ùY¯¸;öåýÊ|SH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TÈÿ2ÑL~2ùËI!dòo3C&™|0“IróqÈ”–ø2Ï%÷§2žú™æmÅÿe4¶Ôë»/–”õRo9lãÝØJÆÂõÒÈŸßB¦4 kzÝ´òD}ñè=uñëá7Ãך†Ð[óœúÌØÒÛ¸âç–n¡=/ “{hÞ`ž“‘´kØŠu#3oûVÖ72ÁûôMÛäšèœZTõK…“0Ú¡SüÌB]†9¤1FËtA <Ö€j ïH‰´è+µi?ÀŒ³õ*5åûZô¶X£á­›@ï X Úú‚À˜@VàM‚ÕÞ…˜‘sÄewr& yüÄþŒ¸à¯\,M^ÔÉN8H“‹6¬C¶€Iø²ÖÛT½)s{ÌyCãH íy0áñ¢%?ælàß"ƒìÃ8E®„Ž,g³x'pÓ(Ÿ¯!˘¾*=æ`‹Å&ÁfŸ`4ËdRí9òfóå‰+ï“ÉÒ3lÖÜL†H‰±\C&k¨¼ß„½†ú›Z›O(™Ÿ¨ô”[|œØrMX÷5Á»‘o07a­9WÁ=9g×.Ù¹A8ªtUi„¸æ Ä'¡Ù¶u>Õü>$zD¥¬¸Šª˜Wõûx×ö£Rcdä¥3,8i뀑#ÉÆ™ÄíT Kqôgdô®•ÄM[ ûô–¤Öhç¸D™´AùíRæœ}æÍ°F[$K$Çìß•±™""ÖÌCÁÔS:Ãûr'u$$M ú.'c&íáTâ$\ÚkÅg1ƒŒ÷dùOÜ^ÛãÒ,¶>„å‘Ü%s¨”‘ÅÌÉJÃìÉš¤ÿPúWÐ2…Yæ…ªÈp3ç9g;|þU‚lçë¤Â!éåô¶°kN×Câ[È ¶G‹xXïX~y%»' Ú((4s“Ù=ð ý+a#]Iôƒ™—ž vwôÌ=9îɾž\ôä4ŸâmBïÉ/¥7«ˆ‚ì>IEND®B`‚zbar-0.10/examples/paginate.pl0000755000000000000000000000456211270371414013234 00000000000000#!/usr/bin/perl #------------------------------------------------------------------------ # Copyright 2009 (c) Jeff Brown # # This file is part of the ZBar Bar Code Reader. # # The ZBar Bar Code Reader is free software; you can redistribute it # and/or modify it under the terms of the GNU Lesser Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # The ZBar Bar Code Reader is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser Public License for more details. # # You should have received a copy of the GNU Lesser Public License # along with the ZBar Bar Code Reader; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA # # http://sourceforge.net/projects/zbar #------------------------------------------------------------------------ use warnings; use strict; use Barcode::ZBar; use Image::Magick; warn("no input files specified?\n") if(!@ARGV); # running output document my $out = undef; # barcode scanner my $scanner = Barcode::ZBar::ImageScanner->new(); foreach my $file (@ARGV) { print "scanning from \"$file\"\n"; my $imseq = Image::Magick->new(); my $err = $imseq->Read($file); warn($err) if($err); foreach my $page (@$imseq) { # convert ImageMagick page to ZBar image my $zimg = Barcode::ZBar::Image->new(); $zimg->set_format('Y800'); $zimg->set_size($page->Get(qw(columns rows))); $zimg->set_data($page->Clone()->ImageToBlob(magick => 'GRAY', depth => 8)); # scan for barcodes if($scanner->scan_image($zimg)) { # write out previous document $out->write() if($out); # use first symbol found to name next image (FIXME sanitize) my $data = ($zimg->get_symbols())[0]->get_data(); my $idx = $page->Get('scene') + 1; print "splitting $data from page $idx\n"; # create new output document $out = Image::Magick->new(filename => $data); } # append this page to current output push(@$out, $page) if($out); } # write out final document $out->write() if($out); } zbar-0.10/examples/read_one.py0000755000000000000000000000110511270371414013223 00000000000000#!/usr/bin/python from sys import argv import zbar # create a Processor proc = zbar.Processor() # configure the Processor proc.parse_config('enable') # initialize the Processor device = '/dev/video0' if len(argv) > 1: device = argv[1] proc.init(device) # enable the preview window proc.visible = True # read at least one barcode (or until window closed) proc.process_one() # hide the preview window proc.visible = False # extract results for symbol in proc.results: # do something useful with results print 'decoded', symbol.type, 'symbol', '"%s"' % symbol.data zbar-0.10/pygtk/0000777000000000000000000000000011270371535010505 500000000000000zbar-0.10/pygtk/zbarpygtk.override0000644000000000000000000000051311270371414014172 00000000000000%% headers #include #include #include %% modulename zbarpygtk %% import gtk.Widget as PyGtkWidget_Type import gtk.gdk.Pixbuf as PyGdkPixbuf_Type %% ignore-type ZBarGtkError %% ignore-glob *_get_type %% ignore zbar_gtk_image_from_pixbuf # until base library wrappers are in place %% zbar-0.10/pygtk/zbarpygtkmodule.c0000644000000000000000000000315011270371414014003 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ /* avoid "multiple definition" darwin link errors * for symbols defined in pygobject.h (bug #2052681) */ #define NO_IMPORT_PYGOBJECT #include void zbarpygtk_register_classes(PyObject*); extern PyMethodDef zbarpygtk_functions[]; DL_EXPORT(void) initzbarpygtk(void) { init_pygobject(); PyObject *mod = Py_InitModule("zbarpygtk", zbarpygtk_functions); PyObject *dict = PyModule_GetDict(mod); zbarpygtk_register_classes(dict); if(PyErr_Occurred()) Py_FatalError("unable to initialise module zbarpygtk"); } zbar-0.10/pygtk/Makefile.am.inc0000644000000000000000000000175411270371414013230 00000000000000pyexec_LTLIBRARIES += pygtk/zbarpygtk.la pygtk_zbarpygtk_la_CPPFLAGS = \ $(GTK_CFLAGS) $(PYTHON_CFLAGS) $(PYGTK_CFLAGS) $(AM_CPPFLAGS) pygtk_zbarpygtk_la_LDFLAGS = -shared -module -avoid-version -export-dynamic \ -export-symbols-regex initzbarpygtk pygtk_zbarpygtk_la_LIBADD = \ $(PYTHON_LIBS) $(PYGTK_LIBS) gtk/libzbargtk.la $(AM_LIBADD) dist_pygtk_zbarpygtk_la_SOURCES = pygtk/zbarpygtkmodule.c nodist_pygtk_zbarpygtk_la_SOURCES = pygtk/zbarpygtk.c BUILT_SOURCES += pygtk/zbarpygtk.c pygtk/zbarpygtk.defs CLEANFILES += pygtk/zbarpygtk.c pygtk/zbarpygtk.defs EXTRA_DIST += pygtk/zbarpygtk.override # FIXME ugly hack to fixup new name... now non-standard? pygtk/zbarpygtk.defs: include/zbar/zbargtk.h $(PYTHON) $(PYGTK_H2DEF) $< | \ $(SED) -e 's/Z_TYPE_BAR_/ZBAR_TYPE_/' > $@ pygtk/%.c: pygtk/%.defs $(srcdir)/pygtk/zbarpygtk.override $(PYGTK_CODEGEN) --prefix zbarpygtk \ --register $(PYGTK_DEFS)/gdk-types.defs \ --override $(srcdir)/pygtk/zbarpygtk.override $< > $@ zbar-0.10/zbarcam/0000777000000000000000000000000011270371535010766 500000000000000zbar-0.10/zbarcam/zbarcam.c0000644000000000000000000002221411270371414012462 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include #include #ifdef _WIN32 # include # include #endif #include #include #define BELL "\a" static const char *note_usage = "usage: zbarcam [options] [/dev/video?]\n" "\n" "scan and decode bar codes from a video stream\n" "\n" "options:\n" " -h, --help display this help text\n" " --version display version information and exit\n" " -q, --quiet disable beep when symbol is decoded\n" " -v, --verbose increase debug output level\n" " --verbose=N set specific debug output level\n" " --xml use XML output format\n" " --raw output decoded symbol data without symbology prefix\n" " --nodisplay disable video display window\n" " --prescale=x\n" " request alternate video image size from driver\n" " -S[=], --set [=]\n" " set decoder/scanner to (or 1)\n" /* FIXME overlay level */ "\n"; static const char *xml_head = "" "\n"; static const char *xml_foot = "\n"; static zbar_processor_t *proc; static int quiet = 0; static enum { DEFAULT, RAW, XML } format = DEFAULT; static char *xml_buf = NULL; static unsigned xml_len = 0; static int usage (int rc) { FILE *out = (rc) ? stderr : stdout; fprintf(out, "%s", note_usage); return(rc); } static inline int parse_config (const char *cfgstr, int i, int n, char *arg) { if(i >= n || !*cfgstr) { fprintf(stderr, "ERROR: need argument for option: %s\n", arg); return(1); } if(zbar_processor_parse_config(proc, cfgstr)) { fprintf(stderr, "ERROR: invalid configuration setting: %s\n", cfgstr); return(1); } return(0); } static void data_handler (zbar_image_t *img, const void *userdata) { const zbar_symbol_t *sym = zbar_image_first_symbol(img); assert(sym); int n = 0; for(; sym; sym = zbar_symbol_next(sym)) { if(zbar_symbol_get_count(sym)) continue; zbar_symbol_type_t type = zbar_symbol_get_type(sym); if(type == ZBAR_PARTIAL) continue; if(!format) printf("%s%s:%s\n", zbar_get_symbol_name(type), zbar_get_addon_name(type), zbar_symbol_get_data(sym)); else if(format == RAW) printf("%s\n", zbar_symbol_get_data(sym)); else if(format == XML) { if(!n) printf("\n", zbar_image_get_sequence(img)); printf("%s\n", zbar_symbol_xml(sym, &xml_buf, &xml_len)); } n++; } if(format == XML && n) printf("\n"); fflush(stdout); if(!quiet && n) fprintf(stderr, BELL); } int main (int argc, const char *argv[]) { /* setup zbar library standalone processor, * threads will be used if available */ proc = zbar_processor_create(1); if(!proc) { fprintf(stderr, "ERROR: unable to allocate memory?\n"); return(1); } zbar_processor_set_data_handler(proc, data_handler, NULL); const char *video_device = ""; int display = 1; unsigned long infmt = 0, outfmt = 0; int i; for(i = 1; i < argc; i++) { if(argv[i][0] != '-') video_device = argv[i]; else if(argv[i][1] != '-') { int j; for(j = 1; argv[i][j]; j++) { if(argv[i][j] == 'S') { if(!argv[i][++j]) { i++; j = 0; } if(parse_config(&argv[i][j], i, argc, "-S")) return(usage(1)); break; } switch(argv[i][j]) { case 'h': return(usage(0)); case 'v': zbar_increase_verbosity(); break; case 'q': quiet = 1; break; default: fprintf(stderr, "ERROR: unknown bundled config: -%c\n\n", argv[i][j]); return(usage(1)); } } } else if(!argv[i][2]) { if(i < argc - 1) video_device = argv[argc - 1]; break; } else if(!strcmp(argv[i], "--help")) return(usage(0)); else if(!strcmp(argv[i], "--version")) return(printf(PACKAGE_VERSION "\n") <= 0); else if(!strcmp(argv[i], "--set")) { i++; if(parse_config(argv[i], i, argc, "--set")) return(usage(1)); } else if(!strncmp(argv[i], "--set=", 6)) { if(parse_config(&argv[i][6], i, argc, "--set=")) return(usage(1)); } else if(!strcmp(argv[i], "--quiet")) quiet = 1; else if(!strcmp(argv[i], "--xml")) format = XML; else if(!strcmp(argv[i], "--raw")) format = RAW; else if(!strcmp(argv[i], "--nodisplay")) display = 0; else if(!strcmp(argv[i], "--verbose")) zbar_increase_verbosity(); else if(!strncmp(argv[i], "--verbose=", 10)) zbar_set_verbosity(strtol(argv[i] + 10, NULL, 0)); else if(!strncmp(argv[i], "--prescale=", 11)) { char *x = NULL; long int w = strtol(argv[i] + 11, &x, 10); long int h = 0; if(x && *x == 'x') h = strtol(x + 1, NULL, 10); if(!w || !h || !x || *x != 'x') { fprintf(stderr, "ERROR: invalid prescale: %s\n\n", argv[i]); return(usage(1)); } zbar_processor_request_size(proc, w, h); } else if(!strncmp(argv[i], "--v4l=", 6)) { long int v = strtol(argv[i] + 6, NULL, 0); zbar_processor_request_interface(proc, v); } else if(!strncmp(argv[i], "--iomode=", 9)) { long int v = strtol(argv[i] + 9, NULL, 0); zbar_processor_request_iomode(proc, v); } else if(!strncmp(argv[i], "--infmt=", 8) && strlen(argv[i]) == 12) infmt = (argv[i][8] | (argv[i][9] << 8) | (argv[i][10] << 16) | (argv[i][11] << 24)); else if(!strncmp(argv[i], "--outfmt=", 9) && strlen(argv[i]) == 13) outfmt = (argv[i][9] | (argv[i][10] << 8) | (argv[i][11] << 16) | (argv[i][12] << 24)); else { fprintf(stderr, "ERROR: unknown option argument: %s\n\n", argv[i]); return(usage(1)); } } if(infmt || outfmt) zbar_processor_force_format(proc, infmt, outfmt); /* open video device, open window */ if(zbar_processor_init(proc, video_device, display) || /* show window */ (display && zbar_processor_set_visible(proc, 1))) return(zbar_processor_error_spew(proc, 0)); if(format == XML) { #ifdef _WIN32 fflush(stdout); _setmode(_fileno(stdout), _O_BINARY); #endif printf(xml_head, video_device); fflush(stdout); } /* start video */ int active = 1; if(zbar_processor_set_active(proc, active)) return(zbar_processor_error_spew(proc, 0)); /* let the callback handle data */ int rc; while((rc = zbar_processor_user_wait(proc, -1)) >= 0) { if(rc == 'q' || rc == 'Q') break; if(rc == ' ') { active = !active; if(zbar_processor_set_active(proc, active)) return(zbar_processor_error_spew(proc, 0)); } } /* report any errors that aren't "window closed" */ if(rc && rc != 'q' && rc != 'Q' && zbar_processor_get_error_code(proc) != ZBAR_ERR_CLOSED) return(zbar_processor_error_spew(proc, 0)); /* free resources (leak check) */ zbar_processor_destroy(proc); if(format == XML) { printf("%s", xml_foot); fflush(stdout); } return(0); } zbar-0.10/zbarcam/zbarcam.rc0000644000000000000000000000162411270371414012646 00000000000000#include #include VS_VERSION_INFO VERSIONINFO FILEVERSION ZBAR_VERSION_MAJOR, ZBAR_VERSION_MINOR, 0, 0 PRODUCTVERSION ZBAR_VERSION_MAJOR, ZBAR_VERSION_MINOR, 0, 0 FILEOS VOS__WINDOWS32 FILETYPE VFT_APP { BLOCK "StringFileInfo" { BLOCK "040904E4" { VALUE "ProductName", "ZBar Bar Code Reader" VALUE "Company Name", "ZBar Bar Code Reader" VALUE "InternalName", "zbarcam" VALUE "OriginalFilename", "zbarcam.exe" VALUE "FileVersion", PACKAGE_VERSION VALUE "ProductVersion", PACKAGE_VERSION VALUE "FileDescription", "Scan bar codes from video devices" VALUE "LegalCopyright", "Copyright 2007-2009 (c) Jeff Brown " } } BLOCK "VarFileInfo" { VALUE "Translation", 0x0409, 0x04e4 } } APP_ICON ICON "zbar.ico" zbar-0.10/zbarcam/Makefile.am.inc0000644000000000000000000000045111270371414013502 00000000000000bin_PROGRAMS += zbarcam/zbarcam zbarcam_zbarcam_SOURCES = zbarcam/zbarcam.c zbarcam_zbarcam_LDADD = zbar/libzbar.la # automake bug in "monolithic mode"? CLEANFILES += zbarcam/.libs/zbarcam if WIN32 zbarcam_zbarcam_SOURCES += zbarcam/zbarcam.rc zbarcam_zbarcam_LDADD += zbarcam/zbarcam-rc.o endif zbar-0.10/config/0000777000000000000000000000000011270371535010614 500000000000000zbar-0.10/config/ltsugar.m40000644000000000000000000001042411270371454012454 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) zbar-0.10/config/config.rpath0000755000000000000000000004364711270371414013052 00000000000000#! /bin/sh # Output a system dependent set of variables, describing how to set the # run time search path of shared libraries in an executable. # # Copyright 1996-2007 Free Software Foundation, Inc. # Taken from GNU libtool, 2001 # Originally by Gordon Matzigkeit , 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # # The first argument passed to this file is the canonical host specification, # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # The environment variables CC, GCC, LDFLAGS, LD, with_gnu_ld # should be set by the caller. # # The set of defined variables is at the end of this script. # Known limitations: # - On IRIX 6.5 with CC="cc", the run time search patch must not be longer # than 256 bytes, otherwise the compiler driver will dump core. The only # known workaround is to choose shorter directory names for the build # directory and/or the installation directory. # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a shrext=.so host="$1" host_cpu=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # Code taken from libtool.m4's _LT_CC_BASENAME. for cc_temp in $CC""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`echo "$cc_temp" | sed -e 's%^.*/%%'` # Code taken from libtool.m4's AC_LIBTOOL_PROG_COMPILER_PIC. wl= if test "$GCC" = yes; then wl='-Wl,' else case "$host_os" in aix*) wl='-Wl,' ;; darwin*) case $cc_basename in xlc*) wl='-Wl,' ;; esac ;; mingw* | cygwin* | pw32* | os2*) ;; hpux9* | hpux10* | hpux11*) wl='-Wl,' ;; irix5* | irix6* | nonstopux*) wl='-Wl,' ;; newsos6) ;; linux* | k*bsd*-gnu) case $cc_basename in icc* | ecc*) wl='-Wl,' ;; pgcc | pgf77 | pgf90) wl='-Wl,' ;; ccc*) wl='-Wl,' ;; como) wl='-lopt=' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) wl='-Wl,' ;; esac ;; esac ;; osf3* | osf4* | osf5*) wl='-Wl,' ;; rdos*) ;; solaris*) wl='-Wl,' ;; sunos4*) wl='-Qoption ld ' ;; sysv4 | sysv4.2uw2* | sysv4.3*) wl='-Wl,' ;; sysv4*MP*) ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) wl='-Wl,' ;; unicos*) wl='-Wl,' ;; uts4*) ;; esac fi # Code taken from libtool.m4's AC_LIBTOOL_PROG_LD_SHLIBS. hardcode_libdir_flag_spec= hardcode_libdir_separator= hardcode_direct=no hardcode_minus_L=no case "$host_os" in cygwin* | mingw* | pw32*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. # Unlike libtool, we use -rpath here, not --rpath, since the documented # option of GNU ld is called -rpath, not --rpath. hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' case "$host_os" in aix3* | aix4* | aix5*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # Samuel A. Falvo II reports # that the semantics of dynamic libraries on AmigaOS, at least up # to version 4, is to share data among multiple programs linked # with the same dynamic library. Since this doesn't match the # behavior of shared libraries on other platforms, we cannot use # them. ld_shlibs=no ;; beos*) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; cygwin* | mingw* | pw32*) # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' if $LD --help 2>&1 | grep 'auto-import' > /dev/null; then : else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; gnu* | linux* | k*bsd*-gnu) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; netbsd*) ;; solaris*) if $LD -v 2>&1 | grep 'BFD 2\.8' > /dev/null; then ld_shlibs=no elif $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-rpath,$libdir`' else ld_shlibs=no fi ;; esac ;; sunos4*) hardcode_direct=yes ;; *) if $LD --help 2>&1 | grep ': supported targets:.* elf' > /dev/null; then : else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then hardcode_libdir_flag_spec= fi else case "$host_os" in aix3*) # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix4* | aix5*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix5*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac fi hardcode_direct=yes hardcode_libdir_separator=':' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && \ strings "$collect2name" | grep resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac fi # Begin _LT_AC_SYS_LIBPATH_AIX. echo 'int main () { return 0; }' > conftest.c ${CC} ${LDFLAGS} conftest.c -o conftest aix_libpath=`dump -H conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest 2>/dev/null | sed -n -e '/Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/; p; } }'` fi if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib" fi rm -f conftest.c conftest # End _LT_AC_SYS_LIBPATH_AIX. if test "$aix_use_runtimelinking" = yes; then hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' else hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" fi fi ;; amigaos*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes # see comment about different semantics on the GNU ld section ld_shlibs=no ;; bsdi[45]*) ;; cygwin* | mingw* | pw32*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' libext=lib ;; darwin* | rhapsody*) hardcode_direct=no if test "$GCC" = yes ; then : else case $cc_basename in xlc*) ;; *) ld_shlibs=no ;; esac fi ;; dgux*) hardcode_libdir_flag_spec='-L$libdir' ;; freebsd1*) ld_shlibs=no ;; freebsd2.2*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; freebsd2*) hardcode_direct=yes hardcode_minus_L=yes ;; freebsd* | dragonfly*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; hpux9*) hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; hpux10*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no ;; *) hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; netbsd*) hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes ;; newsos6) hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then hardcode_libdir_flag_spec='${wl}-rpath,$libdir' else case "$host_os" in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) hardcode_libdir_flag_spec='-R$libdir' ;; *) hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; osf3*) hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) if test "$GCC" = yes; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else # Both cc and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi hardcode_libdir_separator=: ;; solaris*) hardcode_libdir_flag_spec='-R$libdir' ;; sunos4*) hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes ;; sysv4) case $host_vendor in sni) hardcode_direct=yes # is this really true??? ;; siemens) hardcode_direct=no ;; motorola) hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac ;; sysv4.3*) ;; sysv4*MP*) if test -d /usr/nec; then ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) ;; sysv5* | sco3.2v5* | sco5v6*) hardcode_libdir_flag_spec='`test -z "$SCOABSPATH" && echo ${wl}-R,$libdir`' hardcode_libdir_separator=':' ;; uts4*) hardcode_libdir_flag_spec='-L$libdir' ;; *) ld_shlibs=no ;; esac fi # Check dynamic linker characteristics # Code taken from libtool.m4's AC_LIBTOOL_SYS_DYNAMIC_LINKER. # Unlike libtool.m4, here we don't care about _all_ names of the library, but # only about the one the linker finds when passed -lNAME. This is the last # element of library_names_spec in libtool.m4, or possibly two of them if the # linker has special search rules. library_names_spec= # the last element of library_names_spec in libtool.m4 libname_spec='lib$name' case "$host_os" in aix3*) library_names_spec='$libname.a' ;; aix4* | aix5*) library_names_spec='$libname$shrext' ;; amigaos*) library_names_spec='$libname.a' ;; beos*) library_names_spec='$libname$shrext' ;; bsdi[45]*) library_names_spec='$libname$shrext' ;; cygwin* | mingw* | pw32*) shrext=.dll library_names_spec='$libname.dll.a $libname.lib' ;; darwin* | rhapsody*) shrext=.dylib library_names_spec='$libname$shrext' ;; dgux*) library_names_spec='$libname$shrext' ;; freebsd1*) ;; freebsd* | dragonfly*) case "$host_os" in freebsd[123]*) library_names_spec='$libname$shrext$versuffix' ;; *) library_names_spec='$libname$shrext' ;; esac ;; gnu*) library_names_spec='$libname$shrext' ;; hpux9* | hpux10* | hpux11*) case $host_cpu in ia64*) shrext=.so ;; hppa*64*) shrext=.sl ;; *) shrext=.sl ;; esac library_names_spec='$libname$shrext' ;; interix[3-9]*) library_names_spec='$libname$shrext' ;; irix5* | irix6* | nonstopux*) library_names_spec='$libname$shrext' case "$host_os" in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= ;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 ;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 ;; *) libsuff= shlibsuff= ;; esac ;; esac ;; linux*oldld* | linux*aout* | linux*coff*) ;; linux* | k*bsd*-gnu) library_names_spec='$libname$shrext' ;; knetbsd*-gnu) library_names_spec='$libname$shrext' ;; netbsd*) library_names_spec='$libname$shrext' ;; newsos6) library_names_spec='$libname$shrext' ;; nto-qnx*) library_names_spec='$libname$shrext' ;; openbsd*) library_names_spec='$libname$shrext$versuffix' ;; os2*) libname_spec='$name' shrext=.dll library_names_spec='$libname.a' ;; osf3* | osf4* | osf5*) library_names_spec='$libname$shrext' ;; rdos*) ;; solaris*) library_names_spec='$libname$shrext' ;; sunos4*) library_names_spec='$libname$shrext$versuffix' ;; sysv4 | sysv4.3*) library_names_spec='$libname$shrext' ;; sysv4*MP*) library_names_spec='$libname$shrext' ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) library_names_spec='$libname$shrext' ;; uts4*) library_names_spec='$libname$shrext' ;; esac sed_quote_subst='s/\(["`$\\]\)/\\\1/g' escaped_wl=`echo "X$wl" | sed -e 's/^X//' -e "$sed_quote_subst"` shlibext=`echo "$shrext" | sed -e 's,^\.,,'` escaped_libname_spec=`echo "X$libname_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_library_names_spec=`echo "X$library_names_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` escaped_hardcode_libdir_flag_spec=`echo "X$hardcode_libdir_flag_spec" | sed -e 's/^X//' -e "$sed_quote_subst"` LC_ALL=C sed -e 's/^\([a-zA-Z0-9_]*\)=/acl_cv_\1=/' <. case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by `PROGRAMS ARGS'. object Object file output by `PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputing dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts `$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile" # Add `dependent.h:' lines. sed -ne '2,${; s/^ *//; s/ \\*$//; s/$/:/; p;}' "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then # With Tru64 cc, shared objects can also be used to make a # static library. This mechanism is used in libtool 1.4 series to # handle both shared and static libraries in a single compilation. # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d. # # With libtool 1.5 this exception was removed, and libtool now # generates 2 separate objects for the 2 libraries. These two # compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir.libs/$base.lo.d # libtool 1.4 tmpdepfile2=$dir$base.o.d # libtool 1.5 tmpdepfile3=$dir.libs/$base.o.d # libtool 1.5 tmpdepfile4=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.o.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d tmpdepfile4=$dir$base.d "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a tab and a space in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: zbar-0.10/config/missing0000755000000000000000000002557711270371465012151 00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. scriptversion=2006-05-10.23 # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 # Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' sed_minuso='s/.* -o \([^ ]*\).*/\1/p' # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi msg="missing on your system" case $1 in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 # Exit code 63 means version mismatch. This often happens # when the user try to use an ancient version of a tool on # a file that requires a minimum version. In this case we # we should proceed has if the program had been absent, or # if --run hadn't been passed. if test $? = 63; then run=: msg="probably too old" fi ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch] Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; esac # Now exit if we have it, but it failed. Also exit now if we # don't have it and --version was passed (most likely to detect # the program). case $1 in lex|yacc) # Not GNU programs, they don't have --version. ;; tar) if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then exit 1 fi ;; *) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 elif test "x$2" = "x--version" || test "x$2" = "x--help"; then # Could not run --version or --help. This is probably someone # running `$TOOL --version' or `$TOOL --help' to check whether # $TOOL exists and not knowing $TOOL uses missing. exit 1 fi ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case $1 in aclocal*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case $f in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) echo 1>&2 "\ WARNING: \`$1' is needed, but is $msg. You might have modified some files without having the proper tools for further handling them. You can get \`$1' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if test -f "$SRCFILE"; then cp "$SRCFILE" y.tab.h fi ;; esac fi if test ! -f y.tab.h; then echo >y.tab.h fi if test ! -f y.tab.c; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if test $# -ne 1; then eval LASTARG="\${$#}" case $LASTARG in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if test -f "$SRCFILE"; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if test ! -f lex.yy.c; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) echo 1>&2 "\ WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." # The file to touch is that specified with -o ... file=`echo "$*" | sed -n "$sed_output"` test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` if test -z "$file"; then # ... or it is the one specified with @setfilename ... infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n ' /^@setfilename/{ s/.* \([^ ]*\) *$/\1/ p q }' $infile` # ... or it is derived from the source name (dir/f.texi becomes f.info) test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info fi # If the file does not exist, the user really needs makeinfo; # let's fail without touching anything. test -f $file || exit 1 touch $file ;; tar) shift # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case $firstarg in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case $firstarg in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and is $msg. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: zbar-0.10/config/ltversion.m40000644000000000000000000000127511270371454013024 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # Generated from ltversion.in. # serial 3012 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.2.6]) m4_define([LT_PACKAGE_REVISION], [1.3012]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.2.6' macro_revision='1.3012' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) zbar-0.10/config/lt~obsolete.m40000644000000000000000000001311311270371454013343 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 4 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_RC], [AC_DEFUN([AC_LIBTOOL_RC])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) zbar-0.10/config/config.guess0000755000000000000000000013274111270371465013062 00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2009-02-03' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Per Bothner . # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # # The plan is that this can be called by configure scripts if you # don't specify an explicit build system type. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown if [ "${UNAME_SYSTEM}" = "Linux" ] ; then eval $set_cc_for_build cat << EOF > $dummy.c #include #ifdef __UCLIBC__ # ifdef __UCLIBC_CONFIG_VERSION__ LIBC=uclibc __UCLIBC_CONFIG_VERSION__ # else LIBC=uclibc # endif #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep LIBC= | sed -e 's: ::g'` fi # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep __ELF__ >/dev/null then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` exit ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm:riscos:*:*|arm:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep __LP64__ >/dev/null then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) case ${UNAME_MACHINE} in pc98) echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo cris-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo crisv32-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo frv-unknown-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips #undef mipsel #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mipsel #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef mips64 #undef mips64el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=mips64el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=mips64 #else CPU= #endif #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^CPU/{ s: ::g p }'`" test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; or32:Linux:*:*) echo or32-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo x86_64-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so # first see if it will tell us. cd to the root directory to prevent # problems with other programs or directories called `ld' in the path. # Set LC_ALL=C to ensure ld outputs messages in English. ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ | sed -ne '/supported targets:/!d s/[ ][ ]*/ /g s/.*supported targets: *// s/ .*// p'` case "$ld_supported_targets" in elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-${LIBC}" ;; a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-${LIBC}aout" exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. echo "${UNAME_MACHINE}-pc-linux-${LIBC}oldld" exit ;; esac # This should get integrated into the C code below, but now we hack if [ "$LIBC" != "gnu" ] ; then echo "$TENTATIVE" && exit 0 ; fi # Determine whether the default compiler is a.out or elf eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include #ifdef __ELF__ # ifdef __GLIBC__ # if __GLIBC__ >= 2 LIBC=gnu # else LIBC=gnulibc1 # endif # else LIBC=gnulibc1 # endif #else #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) LIBC=gnu #else LIBC=gnuaout #endif #endif #ifdef __dietlibc__ LIBC=dietlibc #endif EOF eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' /^LIBC/{ s: ::g p }'`" test x"${LIBC}" != x && { echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit } test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i386. echo i386-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 #echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 eval $set_cc_for_build cat >$dummy.c < # include #endif main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (__arm) && defined (__acorn) && defined (__unix) printf ("arm-acorn-riscix\n"); exit (0); #endif #if defined (hp300) && !defined (hpux) printf ("m68k-hp-bsd\n"); exit (0); #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) # if !defined (ultrix) # include # if defined (BSD) # if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); # else # if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); # else printf ("vax-dec-bsd\n"); exit (0); # endif # endif # else printf ("vax-dec-bsd\n"); exit (0); # endif # else printf ("vax-dec-ultrix\n"); exit (0); # endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; } # Convex versions that predate uname can use getsysinfo(1) if [ -x /usr/convex/getsysinfo ] then case `getsysinfo -f cpu_type` in c1*) echo c1-convex-bsd exit ;; c2*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; c34*) echo c34-convex-bsd exit ;; c38*) echo c38-convex-bsd exit ;; c4*) echo c4-convex-bsd exit ;; esac fi cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: zbar-0.10/config/libtool.m40000644000000000000000000077400311270371454012451 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 56 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl _LT_PROG_ECHO_BACKSLASH case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "X$" | $Xsed -e "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\[$]0 --fallback-echo"')dnl " lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` ;; esac _LT_OUTPUT_LIBTOOL_INIT ]) # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) cat >"$CONFIG_LT" <<_LTEOF #! $SHELL # Generated by $as_me. # Run this file to recreate a libtool stub with the current configuration. lt_cl_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2008 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. if test "$no_create" != yes; then lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) fi ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_XSI_SHELLFNS sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES # -------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(whole_archive_flag_spec, $1)='' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX # ----------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl AC_LINK_IFELSE(AC_LANG_PROGRAM,[ lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [ifdef([AC_DIVERSION_NOTICE], [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], [AC_DIVERT_PUSH(NOTICE)]) $1 AC_DIVERT_POP ])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Add some code to the start of the generated configure script which # will find an echo command which doesn't interpret backslashes. m4_defun([_LT_PROG_ECHO_BACKSLASH], [_LT_SHELL_INIT([ # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\[$]\\[$]0,'[$]0','` ;; esac ECHO=${lt_ECHO-echo} if test "X[$]1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X[$]1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "[$]0" --no-reexec ${1+"[$]@"} fi if test "X[$]1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF [$]* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "[$]0"' 'sed 20q "[$]0"' 'sed 10q "[$]0"' 'sed 2q "[$]0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "[$]0" --no-reexec ${1+"[$]@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL [$]0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "[$]0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL [$]0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "[$]0"' 'sed 10q "[$]0"' 'sed 20q "[$]0"' 'sed 50q "[$]0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "[$]0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "[$]0" ${1+"[$]@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL [$]0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\[$]0 --fallback-echo" fi AC_SUBST(lt_ECHO) ]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that does not interpret backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line __oline__ "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [AC_CHECK_TOOL(AR, ar, false) test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1]) AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL [$]0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line __oline__ "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:__oline__: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:__oline__: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[123]]*) objformat=aout ;; *) objformat=elf ;; esac fi # Handle Gentoo/FreeBSD as it was Linux case $host_vendor in gentoo) version_type=linux ;; *) version_type=freebsd-$objformat ;; esac case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; linux) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' need_lib_prefix=no need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[[3-9]]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]].[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method == "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. AC_CHECK_TOOLS(DUMPBIN, ["dumpbin -symbols" "link -dump -symbols"], :) AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:__oline__: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:__oline__: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cygwin* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= AC_MSG_CHECKING([for $compiler option to produce PIC]) m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; freebsd1*) _LT_TAGVAR(ld_shlibs, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE(int foo(void) {}, _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' ) LDFLAGS="$save_LDFLAGS" else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_MSG_CHECKING([whether -lc should be explicitly linked in]) $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then _LT_TAGVAR(archive_cmds_need_lc, $1)=no else _LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* AC_MSG_RESULT([$_LT_TAGVAR(archive_cmds_need_lc, $1)]) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1], [[If ld is used when linking, flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [fix_srcfile_path], [1], [Fix the shell variable $srcfile for the compiler]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_PROG_CXX # ------------ # Since AC_PROG_CXX is broken, in that it returns g++ if there is no c++ # compiler, we have our own version here. m4_defun([_LT_PROG_CXX], [ pushdef([AC_MSG_ERROR], [_lt_caught_CXX_error=yes]) AC_PROG_CXX if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_CXX dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_CXX], []) # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [AC_REQUIRE([_LT_PROG_CXX])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd[[12]]*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; gnu*) ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]]* | *pgcpp\ [[1-5]]*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ]) dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_PROG_F77 # ------------ # Since AC_PROG_F77 is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_F77], [ pushdef([AC_MSG_ERROR], [_lt_disable_F77=yes]) AC_PROG_F77 if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_F77 dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_F77], []) # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_REQUIRE([_LT_PROG_F77])dnl AC_LANG_PUSH(Fortran 77) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${F77-"f77"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_PROG_FC # ----------- # Since AC_PROG_FC is broken, in that it returns the empty string # if there is no fortran compiler, we have our own version here. m4_defun([_LT_PROG_FC], [ pushdef([AC_MSG_ERROR], [_lt_disable_FC=yes]) AC_PROG_FC if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi popdef([AC_MSG_ERROR]) ])# _LT_PROG_FC dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([_LT_PROG_FC], []) # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_REQUIRE([_LT_PROG_FC])dnl AC_LANG_PUSH(Fortran) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC CC=${FC-"f95"} compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC="$lt_save_CC" ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC="$lt_save_CC" ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_XSI_SHELLFNS # --------------------- # Bourne and XSI compatible variants of some useful shell functions. m4_defun([_LT_PROG_XSI_SHELLFNS], [case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $[*] )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } dnl func_dirname_and_basename dnl A portable version of this function is already defined in general.m4sh dnl so there is no need for it here. # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[[^=]]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[[^.]]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$[@]"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]+=\$[2]" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$[1]=\$$[1]\$[2]" } _LT_EOF ;; esac ]) zbar-0.10/config/ltmain.sh0000755000000000000000000073310411270371454012363 00000000000000# Generated from ltmain.m4sh. # ltmain.sh (GNU libtool) 2.2.6 # Written by Gordon Matzigkeit , 1996 # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007 2008 Free Software Foundation, Inc. # This is free software; see the source for copying conditions. There is NO # warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # GNU Libtool is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, # or obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # Usage: $progname [OPTION]... [MODE-ARG]... # # Provide generalized library-building support services. # # --config show all configuration variables # --debug enable verbose shell tracing # -n, --dry-run display commands without modifying any files # --features display basic configuration information and exit # --mode=MODE use operation mode MODE # --preserve-dup-deps don't remove duplicate dependency libraries # --quiet, --silent don't print informational messages # --tag=TAG use configuration variables from tag TAG # -v, --verbose print informational messages (default) # --version print version information # -h, --help print short or long help message # # MODE must be one of the following: # # clean remove files from the build directory # compile compile a source file into a libtool object # execute automatically set library path, then run a program # finish complete the installation of libtool libraries # install install libraries or executables # link create a library or an executable # uninstall remove libraries from an installed directory # # MODE-ARGS vary depending on the MODE. # Try `$progname --help --mode=MODE' for a more detailed description of MODE. # # When reporting a bug, please describe a test case to reproduce it and # include the following information: # # host-triplet: $host # shell: $SHELL # compiler: $LTCC # compiler flags: $LTCFLAGS # linker: $LD (gnu? $with_gnu_ld) # $progname: (GNU libtool) 2.2.6 # automake: $automake_version # autoconf: $autoconf_version # # Report bugs to . PROGRAM=ltmain.sh PACKAGE=libtool VERSION=2.2.6 TIMESTAMP="" package_revision=1.3012 # Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # NLS nuisances: We save the old values to restore during execute mode. # Only set LANG and LC_ALL to C if already set. # These must not be set unconditionally because not all systems understand # e.g. LANG=C (notably SCO). lt_user_locale= lt_safe_locale= for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${$lt_var+set}\" = set; then save_$lt_var=\$$lt_var $lt_var=C export $lt_var lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\" lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\" fi" done $lt_unset CDPATH : ${CP="cp -f"} : ${ECHO="echo"} : ${EGREP="/usr/bin/grep -E"} : ${FGREP="/usr/bin/grep -F"} : ${GREP="/usr/bin/grep"} : ${LN_S="ln -s"} : ${MAKE="make"} : ${MKDIR="mkdir"} : ${MV="mv -f"} : ${RM="rm -f"} : ${SED="/opt/local/bin/gsed"} : ${SHELL="${CONFIG_SHELL-/bin/sh}"} : ${Xsed="$SED -e 1s/^X//"} # Global variables: EXIT_SUCCESS=0 EXIT_FAILURE=1 EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing. EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake. exit_status=$EXIT_SUCCESS # Make sure IFS has a sensible default lt_nl=' ' IFS=" $lt_nl" dirname="s,/[^/]*$,," basename="s,^.*/,," # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # Generated shell functions inserted here. # Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh # is ksh but when the shell is invoked as "sh" and the current value of # the _XPG environment variable is not equal to 1 (one), the special # positional parameter $0, within a function call, is the name of the # function. progpath="$0" # The name of this program: # In the unlikely event $progname began with a '-', it would play havoc with # func_echo (imagine progname=-n), so we prepend ./ in that case: func_dirname_and_basename "$progpath" progname=$func_basename_result case $progname in -*) progname=./$progname ;; esac # Make sure we have an absolute path for reexecution: case $progpath in [\\/]*|[A-Za-z]:\\*) ;; *[\\/]*) progdir=$func_dirname_result progdir=`cd "$progdir" && pwd` progpath="$progdir/$progname" ;; *) save_IFS="$IFS" IFS=: for progdir in $PATH; do IFS="$save_IFS" test -x "$progdir/$progname" && break done IFS="$save_IFS" test -n "$progdir" || progdir=`pwd` progpath="$progdir/$progname" ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed="${SED}"' -e 1s/^X//' sed_quote_subst='s/\([`"$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Re-`\' parameter expansions in output of double_quote_subst that were # `\'-ed in input to the same. If an odd number of `\' preceded a '$' # in input to double_quote_subst, that '$' was protected from expansion. # Since each input `\' is now two `\'s, look for any number of runs of # four `\'s followed by two `\'s and then a '$'. `\' that '$'. bs='\\' bs2='\\\\' bs4='\\\\\\\\' dollar='\$' sed_double_backslash="\ s/$bs4/&\\ /g s/^$bs2$dollar/$bs&/ s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g s/\n//g" # Standard options: opt_dry_run=false opt_help=false opt_quiet=false opt_verbose=false opt_warning=: # func_echo arg... # Echo program name prefixed message, along with the current mode # name if it has been set yet. func_echo () { $ECHO "$progname${mode+: }$mode: $*" } # func_verbose arg... # Echo program name prefixed message in verbose mode only. func_verbose () { $opt_verbose && func_echo ${1+"$@"} # A bug in bash halts the script if the last line of a function # fails when set -e is in force, so we need another command to # work around that: : } # func_error arg... # Echo program name prefixed message to standard error. func_error () { $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2 } # func_warning arg... # Echo program name prefixed warning message to standard error. func_warning () { $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2 # bash bug again: : } # func_fatal_error arg... # Echo program name prefixed message to standard error, and exit. func_fatal_error () { func_error ${1+"$@"} exit $EXIT_FAILURE } # func_fatal_help arg... # Echo program name prefixed message to standard error, followed by # a help hint, and exit. func_fatal_help () { func_error ${1+"$@"} func_fatal_error "$help" } help="Try \`$progname --help' for more information." ## default # func_grep expression filename # Check whether EXPRESSION matches any line of FILENAME, without output. func_grep () { $GREP "$1" "$2" >/dev/null 2>&1 } # func_mkdir_p directory-path # Make sure the entire path to DIRECTORY-PATH is available. func_mkdir_p () { my_directory_path="$1" my_dir_list= if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then # Protect directory names starting with `-' case $my_directory_path in -*) my_directory_path="./$my_directory_path" ;; esac # While some portion of DIR does not yet exist... while test ! -d "$my_directory_path"; do # ...make a list in topmost first order. Use a colon delimited # list incase some portion of path contains whitespace. my_dir_list="$my_directory_path:$my_dir_list" # If the last portion added has no slash in it, the list is done case $my_directory_path in */*) ;; *) break ;; esac # ...otherwise throw away the child directory and loop my_directory_path=`$ECHO "X$my_directory_path" | $Xsed -e "$dirname"` done my_dir_list=`$ECHO "X$my_dir_list" | $Xsed -e 's,:*$,,'` save_mkdir_p_IFS="$IFS"; IFS=':' for my_dir in $my_dir_list; do IFS="$save_mkdir_p_IFS" # mkdir can fail with a `File exist' error if two processes # try to create one of the directories concurrently. Don't # stop in that case! $MKDIR "$my_dir" 2>/dev/null || : done IFS="$save_mkdir_p_IFS" # Bail out if we (or some other process) failed to create a directory. test -d "$my_directory_path" || \ func_fatal_error "Failed to create \`$1'" fi } # func_mktempdir [string] # Make a temporary directory that won't clash with other running # libtool processes, and avoids race conditions if possible. If # given, STRING is the basename for that directory. func_mktempdir () { my_template="${TMPDIR-/tmp}/${1-$progname}" if test "$opt_dry_run" = ":"; then # Return a directory name, but don't create it in dry-run mode my_tmpdir="${my_template}-$$" else # If mktemp works, use that first and foremost my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null` if test ! -d "$my_tmpdir"; then # Failing that, at least try and use $RANDOM to avoid a race my_tmpdir="${my_template}-${RANDOM-0}$$" save_mktempdir_umask=`umask` umask 0077 $MKDIR "$my_tmpdir" umask $save_mktempdir_umask fi # If we're not in dry-run mode, bomb out on failure test -d "$my_tmpdir" || \ func_fatal_error "cannot create temporary directory \`$my_tmpdir'" fi $ECHO "X$my_tmpdir" | $Xsed } # func_quote_for_eval arg # Aesthetically quote ARG to be evaled later. # This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT # is double-quoted, suitable for a subsequent eval, whereas # FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters # which are still active within double quotes backslashified. func_quote_for_eval () { case $1 in *[\\\`\"\$]*) func_quote_for_eval_unquoted_result=`$ECHO "X$1" | $Xsed -e "$sed_quote_subst"` ;; *) func_quote_for_eval_unquoted_result="$1" ;; esac case $func_quote_for_eval_unquoted_result in # Double-quote args containing shell metacharacters to delay # word splitting, command substitution and and variable # expansion for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\"" ;; *) func_quote_for_eval_result="$func_quote_for_eval_unquoted_result" esac } # func_quote_for_expand arg # Aesthetically quote ARG to be evaled later; same as above, # but do not quote variable references. func_quote_for_expand () { case $1 in *[\\\`\"]*) my_arg=`$ECHO "X$1" | $Xsed \ -e "$double_quote_subst" -e "$sed_double_backslash"` ;; *) my_arg="$1" ;; esac case $my_arg in # Double-quote args containing shell metacharacters to delay # word splitting and command substitution for a subsequent eval. # Many Bourne shells cannot handle close brackets correctly # in scan sets, so we specify it separately. *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"") my_arg="\"$my_arg\"" ;; esac func_quote_for_expand_result="$my_arg" } # func_show_eval cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. func_show_eval () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$my_cmd" my_status=$? if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_show_eval_locale cmd [fail_exp] # Unless opt_silent is true, then output CMD. Then, if opt_dryrun is # not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP # is given, then evaluate it. Use the saved locale for evaluation. func_show_eval_locale () { my_cmd="$1" my_fail_exp="${2-:}" ${opt_silent-false} || { func_quote_for_expand "$my_cmd" eval "func_echo $func_quote_for_expand_result" } if ${opt_dry_run-false}; then :; else eval "$lt_user_locale $my_cmd" my_status=$? eval "$lt_safe_locale" if test "$my_status" -eq 0; then :; else eval "(exit $my_status); $my_fail_exp" fi fi } # func_version # Echo version message to standard output and exit. func_version () { $SED -n '/^# '$PROGRAM' (GNU /,/# warranty; / { s/^# // s/^# *$// s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/ p }' < "$progpath" exit $? } # func_usage # Echo short help message to standard output and exit. func_usage () { $SED -n '/^# Usage:/,/# -h/ { s/^# // s/^# *$// s/\$progname/'$progname'/ p }' < "$progpath" $ECHO $ECHO "run \`$progname --help | more' for full usage" exit $? } # func_help # Echo long help message to standard output and exit. func_help () { $SED -n '/^# Usage:/,/# Report bugs to/ { s/^# // s/^# *$// s*\$progname*'$progname'* s*\$host*'"$host"'* s*\$SHELL*'"$SHELL"'* s*\$LTCC*'"$LTCC"'* s*\$LTCFLAGS*'"$LTCFLAGS"'* s*\$LD*'"$LD"'* s/\$with_gnu_ld/'"$with_gnu_ld"'/ s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/ s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/ p }' < "$progpath" exit $? } # func_missing_arg argname # Echo program name prefixed message to standard error and set global # exit_cmd. func_missing_arg () { func_error "missing argument for $1" exit_cmd=exit } exit_cmd=: # Check that we have a working $ECHO. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then # Yippee, $ECHO works! : else # Restart under the correct shell, and then maybe $ECHO will work. exec $SHELL "$progpath" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat </dev/null 2>&1; then taglist="$taglist $tagname" # Evaluate the configuration. Be careful to quote the path # and the sed script, to avoid splitting on whitespace, but # also don't use non-portable quotes within backquotes within # quotes we have to do it in 2 steps: extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"` eval "$extractedcf" else func_error "ignoring unknown tag $tagname" fi ;; esac } # Parse options once, thoroughly. This comes as soon as possible in # the script to make things like `libtool --version' happen quickly. { # Shorthand for --mode=foo, only valid as the first argument case $1 in clean|clea|cle|cl) shift; set dummy --mode clean ${1+"$@"}; shift ;; compile|compil|compi|comp|com|co|c) shift; set dummy --mode compile ${1+"$@"}; shift ;; execute|execut|execu|exec|exe|ex|e) shift; set dummy --mode execute ${1+"$@"}; shift ;; finish|finis|fini|fin|fi|f) shift; set dummy --mode finish ${1+"$@"}; shift ;; install|instal|insta|inst|ins|in|i) shift; set dummy --mode install ${1+"$@"}; shift ;; link|lin|li|l) shift; set dummy --mode link ${1+"$@"}; shift ;; uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u) shift; set dummy --mode uninstall ${1+"$@"}; shift ;; esac # Parse non-mode specific arguments: while test "$#" -gt 0; do opt="$1" shift case $opt in --config) func_config ;; --debug) preserve_args="$preserve_args $opt" func_echo "enabling shell trace mode" opt_debug='set -x' $opt_debug ;; -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break execute_dlfiles="$execute_dlfiles $1" shift ;; --dry-run | -n) opt_dry_run=: ;; --features) func_features ;; --finish) mode="finish" ;; --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break case $1 in # Valid mode arguments: clean) ;; compile) ;; execute) ;; finish) ;; install) ;; link) ;; relink) ;; uninstall) ;; # Catch anything else as an error *) func_error "invalid argument for $opt" exit_cmd=exit break ;; esac mode="$1" shift ;; --preserve-dup-deps) opt_duplicate_deps=: ;; --quiet|--silent) preserve_args="$preserve_args $opt" opt_silent=: ;; --verbose| -v) preserve_args="$preserve_args $opt" opt_silent=false ;; --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break preserve_args="$preserve_args $opt $1" func_enable_tag "$1" # tagname is set here shift ;; # Separate optargs to long options: -dlopen=*|--mode=*|--tag=*) func_opt_split "$opt" set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"} shift ;; -\?|-h) func_usage ;; --help) opt_help=: ;; --version) func_version ;; -*) func_fatal_help "unrecognized option \`$opt'" ;; *) nonopt="$opt" break ;; esac done case $host in *cygwin* | *mingw* | *pw32* | *cegcc*) # don't eliminate duplications in $postdeps and $predeps opt_duplicate_compiler_generated_deps=: ;; *) opt_duplicate_compiler_generated_deps=$opt_duplicate_deps ;; esac # Having warned about all mis-specified options, bail out if # anything was wrong. $exit_cmd $EXIT_FAILURE } # func_check_version_match # Ensure that we are using m4 macros, and libtool script from the same # release of libtool. func_check_version_match () { if test "$package_revision" != "$macro_revision"; then if test "$VERSION" != "$macro_version"; then if test -z "$macro_version"; then cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from an older release. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, but the $progname: definition of this LT_INIT comes from $PACKAGE $macro_version. $progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION $progname: and run autoconf again. _LT_EOF fi else cat >&2 <<_LT_EOF $progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision, $progname: but the definition of this LT_INIT comes from revision $macro_revision. $progname: You should recreate aclocal.m4 with macros from revision $package_revision $progname: of $PACKAGE $VERSION and run autoconf again. _LT_EOF fi exit $EXIT_MISMATCH fi } ## ----------- ## ## Main. ## ## ----------- ## $opt_help || { # Sanity checks first: func_check_version_match if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then func_fatal_configuration "not configured to build any kind of library" fi test -z "$mode" && func_fatal_error "error: you must specify a MODE." # Darwin sucks eval std_shrext=\"$shrext_cmds\" # Only execute mode is allowed to have -dlopen flags. if test -n "$execute_dlfiles" && test "$mode" != execute; then func_error "unrecognized option \`-dlopen'" $ECHO "$help" 1>&2 exit $EXIT_FAILURE fi # Change the help message to a mode-specific one. generic_help="$help" help="Try \`$progname --help --mode=$mode' for more information." } # func_lalib_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_lalib_p () { test -f "$1" && $SED -e 4q "$1" 2>/dev/null \ | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1 } # func_lalib_unsafe_p file # True iff FILE is a libtool `.la' library or `.lo' object file. # This function implements the same check as func_lalib_p without # resorting to external programs. To this end, it redirects stdin and # closes it afterwards, without saving the original file descriptor. # As a safety measure, use it only where a negative result would be # fatal anyway. Works if `file' does not exist. func_lalib_unsafe_p () { lalib_p=no if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then for lalib_p_l in 1 2 3 4 do read lalib_p_line case "$lalib_p_line" in \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;; esac done exec 0<&5 5<&- fi test "$lalib_p" = yes } # func_ltwrapper_script_p file # True iff FILE is a libtool wrapper script # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_script_p () { func_lalib_p "$1" } # func_ltwrapper_executable_p file # True iff FILE is a libtool wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_executable_p () { func_ltwrapper_exec_suffix= case $1 in *.exe) ;; *) func_ltwrapper_exec_suffix=.exe ;; esac $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1 } # func_ltwrapper_scriptname file # Assumes file is an ltwrapper_executable # uses $file to determine the appropriate filename for a # temporary ltwrapper_script. func_ltwrapper_scriptname () { func_ltwrapper_scriptname_result="" if func_ltwrapper_executable_p "$1"; then func_dirname_and_basename "$1" "" "." func_stripname '' '.exe' "$func_basename_result" func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper" fi } # func_ltwrapper_p file # True iff FILE is a libtool wrapper script or wrapper executable # This function is only a basic sanity check; it will hardly flush out # determined imposters. func_ltwrapper_p () { func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1" } # func_execute_cmds commands fail_cmd # Execute tilde-delimited COMMANDS. # If FAIL_CMD is given, eval that upon failure. # FAIL_CMD may read-access the current command in variable CMD! func_execute_cmds () { $opt_debug save_ifs=$IFS; IFS='~' for cmd in $1; do IFS=$save_ifs eval cmd=\"$cmd\" func_show_eval "$cmd" "${2-:}" done IFS=$save_ifs } # func_source file # Source FILE, adding directory component if necessary. # Note that it is not necessary on cygwin/mingw to append a dot to # FILE even if both FILE and FILE.exe exist: automatic-append-.exe # behavior happens only for exec(3), not for open(2)! Also, sourcing # `FILE.' does not work on cygwin managed mounts. func_source () { $opt_debug case $1 in */* | *\\*) . "$1" ;; *) . "./$1" ;; esac } # func_infer_tag arg # Infer tagged configuration to use if any are available and # if one wasn't chosen via the "--tag" command line option. # Only attempt this if the compiler in the base compile # command doesn't match the default compiler. # arg is usually of the form 'gcc ...' func_infer_tag () { $opt_debug if test -n "$available_tags" && test -z "$tagname"; then CC_quoted= for arg in $CC; do func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case $@ in # Blanks in the command may have been stripped by the calling shell, # but not from the CC environment variable when configure was run. " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) ;; # Blanks at the start of $base_compile will cause this to fail # if we don't check for them as well. *) for z in $available_tags; do if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then # Evaluate the configuration. eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`" CC_quoted= for arg in $CC; do # Double-quote args containing other shell metacharacters. func_quote_for_eval "$arg" CC_quoted="$CC_quoted $func_quote_for_eval_result" done case "$@ " in " $CC "* | "$CC "* | " `$ECHO $CC` "* | "`$ECHO $CC` "* | " $CC_quoted"* | "$CC_quoted "* | " `$ECHO $CC_quoted` "* | "`$ECHO $CC_quoted` "*) # The compiler in the base compile command matches # the one in the tagged configuration. # Assume this is the tagged configuration we want. tagname=$z break ;; esac fi done # If $tagname still isn't set, then no tagged configuration # was found and let the user know that the "--tag" command # line option must be used. if test -z "$tagname"; then func_echo "unable to infer tagged configuration" func_fatal_error "specify a tag with \`--tag'" # else # func_verbose "using $tagname tagged configuration" fi ;; esac fi } # func_write_libtool_object output_name pic_name nonpic_name # Create a libtool object file (analogous to a ".la" file), # but don't create it if we're doing a dry run. func_write_libtool_object () { write_libobj=${1} if test "$build_libtool_libs" = yes; then write_lobj=\'${2}\' else write_lobj=none fi if test "$build_old_libs" = yes; then write_oldobj=\'${3}\' else write_oldobj=none fi $opt_dry_run || { cat >${write_libobj}T <?"'"'"' &()|`$[]' \ && func_warning "libobj name \`$libobj' may not contain shell special characters." func_dirname_and_basename "$obj" "/" "" objname="$func_basename_result" xdir="$func_dirname_result" lobj=${xdir}$objdir/$objname test -z "$base_compile" && \ func_fatal_help "you must specify a compilation command" # Delete any leftover library objects. if test "$build_old_libs" = yes; then removelist="$obj $lobj $libobj ${libobj}T" else removelist="$lobj $libobj ${libobj}T" fi # On Cygwin there's no "real" PIC flag so we must build both object types case $host_os in cygwin* | mingw* | pw32* | os2* | cegcc*) pic_mode=default ;; esac if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then # non-PIC code in shared libraries is not supported pic_mode=default fi # Calculate the filename of the output object if compiler does # not support -o with -c if test "$compiler_c_o" = no; then output_obj=`$ECHO "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext} lockfile="$output_obj.lock" else output_obj= need_locks=no lockfile= fi # Lock this critical section if it is needed # We use this script file to make the link, it avoids creating a new file if test "$need_locks" = yes; then until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do func_echo "Waiting for $lockfile to be removed" sleep 2 done elif test "$need_locks" = warn; then if test -f "$lockfile"; then $ECHO "\ *** ERROR, $lockfile exists and contains: `cat $lockfile 2>/dev/null` This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi removelist="$removelist $output_obj" $ECHO "$srcfile" > "$lockfile" fi $opt_dry_run || $RM $removelist removelist="$removelist $lockfile" trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15 if test -n "$fix_srcfile_path"; then eval srcfile=\"$fix_srcfile_path\" fi func_quote_for_eval "$srcfile" qsrcfile=$func_quote_for_eval_result # Only build a PIC object if we are building libtool libraries. if test "$build_libtool_libs" = yes; then # Without this assignment, base_compile gets emptied. fbsd_hideous_sh_bug=$base_compile if test "$pic_mode" != no; then command="$base_compile $qsrcfile $pic_flag" else # Don't build PIC code command="$base_compile $qsrcfile" fi func_mkdir_p "$xdir$objdir" if test -z "$output_obj"; then # Place PIC objects in $objdir command="$command -o $lobj" fi func_show_eval_locale "$command" \ 'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed, then go on to compile the next one if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then func_show_eval '$MV "$output_obj" "$lobj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi # Allow error messages only from the first compilation. if test "$suppress_opt" = yes; then suppress_output=' >/dev/null 2>&1' fi fi # Only build a position-dependent object if we build old libraries. if test "$build_old_libs" = yes; then if test "$pic_mode" != yes; then # Don't build PIC code command="$base_compile $qsrcfile$pie_flag" else command="$base_compile $qsrcfile $pic_flag" fi if test "$compiler_c_o" = yes; then command="$command -o $obj" fi # Suppress compiler output if we already did a PIC compilation. command="$command$suppress_output" func_show_eval_locale "$command" \ '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' if test "$need_locks" = warn && test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then $ECHO "\ *** ERROR, $lockfile contains: `cat $lockfile 2>/dev/null` but it should contain: $srcfile This indicates that another process is trying to use the same temporary object file, and libtool could not work around it because your compiler does not support \`-c' and \`-o' together. If you repeat this compilation, it may succeed, by chance, but you had better avoid parallel builds (make -j) in this platform, or get a better compiler." $opt_dry_run || $RM $removelist exit $EXIT_FAILURE fi # Just move the object if needed if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then func_show_eval '$MV "$output_obj" "$obj"' \ 'error=$?; $opt_dry_run || $RM $removelist; exit $error' fi fi $opt_dry_run || { func_write_libtool_object "$libobj" "$objdir/$objname" "$objname" # Unlock the critical section if it was locked if test "$need_locks" != no; then removelist=$lockfile $RM "$lockfile" fi } exit $EXIT_SUCCESS } $opt_help || { test "$mode" = compile && func_mode_compile ${1+"$@"} } func_mode_help () { # We need to display help for each of the modes. case $mode in "") # Generic help is extracted from the usage comments # at the start of this file. func_help ;; clean) $ECHO \ "Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE... Remove files from the build directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, object or program, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; compile) $ECHO \ "Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE Compile a source file into a libtool library object. This mode accepts the following additional options: -o OUTPUT-FILE set the output file name to OUTPUT-FILE -no-suppress do not suppress compiler output for multiple passes -prefer-pic try to building PIC objects only -prefer-non-pic try to building non-PIC objects only -shared do not build a \`.o' file suitable for static linking -static only build a \`.o' file suitable for static linking COMPILE-COMMAND is a command to be used in creating a \`standard' object file from the given SOURCEFILE. The output file name is determined by removing the directory component from SOURCEFILE, then substituting the C source code suffix \`.c' with the library object suffix, \`.lo'." ;; execute) $ECHO \ "Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]... Automatically set library path, then run a program. This mode accepts the following additional options: -dlopen FILE add the directory containing FILE to the library path This mode sets the library path environment variable according to \`-dlopen' flags. If any of the ARGS are libtool executable wrappers, then they are translated into their corresponding uninstalled binary, and any of their required library directories are added to the library path. Then, COMMAND is executed, with ARGS as arguments." ;; finish) $ECHO \ "Usage: $progname [OPTION]... --mode=finish [LIBDIR]... Complete the installation of libtool libraries. Each LIBDIR is a directory that contains libtool libraries. The commands that this mode executes may require superuser privileges. Use the \`--dry-run' option if you just want to see what would be executed." ;; install) $ECHO \ "Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND... Install executables or libraries. INSTALL-COMMAND is the installation command. The first component should be either the \`install' or \`cp' program. The following components of INSTALL-COMMAND are treated specially: -inst-prefix PREFIX-DIR Use PREFIX-DIR as a staging area for installation The rest of the components are interpreted as arguments to that command (only BSD-compatible install options are recognized)." ;; link) $ECHO \ "Usage: $progname [OPTION]... --mode=link LINK-COMMAND... Link object files or libraries together to form another library, or to create an executable program. LINK-COMMAND is a command using the C compiler that you would use to create a program from several object files. The following components of LINK-COMMAND are treated specially: -all-static do not do any dynamic linking at all -avoid-version do not add a version suffix if possible -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) -export-symbols SYMFILE try to export only the symbols listed in SYMFILE -export-symbols-regex REGEX try to export only the symbols matching REGEX -LLIBDIR search LIBDIR for required installed libraries -lNAME OUTPUT-FILE requires the installed library libNAME -module build a library that can dlopened -no-fast-install disable the fast-install mode -no-install link a not-installable executable -no-undefined declare that a library does not refer to external symbols -o OUTPUT-FILE create OUTPUT-FILE from the specified objects -objectlist FILE Use a list of object files found in FILE to specify objects -precious-files-regex REGEX don't remove output files matching REGEX -release RELEASE specify package release information -rpath LIBDIR the created library will eventually be installed in LIBDIR -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries -shared only do dynamic linking of libtool libraries -shrext SUFFIX override the standard shared library file extension -static do not do any dynamic linking of uninstalled libtool libraries -static-libtool-libs do not do any dynamic linking of libtool libraries -version-info CURRENT[:REVISION[:AGE]] specify library version info [each variable defaults to 0] -weak LIBNAME declare that the target provides the LIBNAME interface All other options (arguments beginning with \`-') are ignored. Every other argument is treated as a filename. Files ending in \`.la' are treated as uninstalled libtool libraries, other files are standard or library object files. If the OUTPUT-FILE ends in \`.la', then a libtool library is created, only library objects (\`.lo' files) may be specified, and \`-rpath' is required, except when creating a convenience library. If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created using \`ar' and \`ranlib', or on Windows using \`lib'. If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file is created, otherwise an executable program is created." ;; uninstall) $ECHO \ "Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... Remove libraries from an installation directory. RM is the name of the program to use to delete files associated with each FILE (typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed to RM. If FILE is a libtool library, all the files associated with it are deleted. Otherwise, only FILE itself is deleted using RM." ;; *) func_fatal_help "invalid operation mode \`$mode'" ;; esac $ECHO $ECHO "Try \`$progname --help' for more information about other modes." exit $? } # Now that we've collected a possible --mode arg, show help if necessary $opt_help && func_mode_help # func_mode_execute arg... func_mode_execute () { $opt_debug # The first argument is the command name. cmd="$nonopt" test -z "$cmd" && \ func_fatal_help "you must specify a COMMAND" # Handle -dlopen flags immediately. for file in $execute_dlfiles; do test -f "$file" \ || func_fatal_help "\`$file' is not a file" dir= case $file in *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$lib' is not a valid libtool archive" # Read the libtool library. dlname= library_names= func_source "$file" # Skip this library if it cannot be dlopened. if test -z "$dlname"; then # Warn if it was a shared library. test -n "$library_names" && \ func_warning "\`$file' was not linked with \`-export-dynamic'" continue fi func_dirname "$file" "" "." dir="$func_dirname_result" if test -f "$dir/$objdir/$dlname"; then dir="$dir/$objdir" else if test ! -f "$dir/$dlname"; then func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" fi fi ;; *.lo) # Just add the directory containing the .lo file. func_dirname "$file" "" "." dir="$func_dirname_result" ;; *) func_warning "\`-dlopen' is ignored for non-libtool libraries and objects" continue ;; esac # Get the absolute pathname. absdir=`cd "$dir" && pwd` test -n "$absdir" && dir="$absdir" # Now add the directory to shlibpath_var. if eval "test -z \"\$$shlibpath_var\""; then eval "$shlibpath_var=\"\$dir\"" else eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" fi done # This variable tells wrapper scripts just to set shlibpath_var # rather than running their programs. libtool_execute_magic="$magic" # Check if any of the arguments is a wrapper script. args= for file do case $file in -*) ;; *) # Do a test to see if this is really a libtool program. if func_ltwrapper_script_p "$file"; then func_source "$file" # Transform arg to wrapped name. file="$progdir/$program" elif func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" func_source "$func_ltwrapper_scriptname_result" # Transform arg to wrapped name. file="$progdir/$program" fi ;; esac # Quote arguments (to preserve shell metacharacters). func_quote_for_eval "$file" args="$args $func_quote_for_eval_result" done if test "X$opt_dry_run" = Xfalse; then if test -n "$shlibpath_var"; then # Export the shlibpath_var. eval "export $shlibpath_var" fi # Restore saved environment variables for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES do eval "if test \"\${save_$lt_var+set}\" = set; then $lt_var=\$save_$lt_var; export $lt_var else $lt_unset $lt_var fi" done # Now prepare to actually exec the command. exec_cmd="\$cmd$args" else # Display what would be done. if test -n "$shlibpath_var"; then eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\"" $ECHO "export $shlibpath_var" fi $ECHO "$cmd$args" exit $EXIT_SUCCESS fi } test "$mode" = execute && func_mode_execute ${1+"$@"} # func_mode_finish arg... func_mode_finish () { $opt_debug libdirs="$nonopt" admincmds= if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then for dir do libdirs="$libdirs $dir" done for libdir in $libdirs; do if test -n "$finish_cmds"; then # Do each command in the finish commands. func_execute_cmds "$finish_cmds" 'admincmds="$admincmds '"$cmd"'"' fi if test -n "$finish_eval"; then # Do the single finish_eval. eval cmds=\"$finish_eval\" $opt_dry_run || eval "$cmds" || admincmds="$admincmds $cmds" fi done fi # Exit here if they wanted silent mode. $opt_silent && exit $EXIT_SUCCESS $ECHO "X----------------------------------------------------------------------" | $Xsed $ECHO "Libraries have been installed in:" for libdir in $libdirs; do $ECHO " $libdir" done $ECHO $ECHO "If you ever happen to want to link against installed libraries" $ECHO "in a given directory, LIBDIR, you must either use libtool, and" $ECHO "specify the full pathname of the library, or use the \`-LLIBDIR'" $ECHO "flag during linking and do at least one of the following:" if test -n "$shlibpath_var"; then $ECHO " - add LIBDIR to the \`$shlibpath_var' environment variable" $ECHO " during execution" fi if test -n "$runpath_var"; then $ECHO " - add LIBDIR to the \`$runpath_var' environment variable" $ECHO " during linking" fi if test -n "$hardcode_libdir_flag_spec"; then libdir=LIBDIR eval flag=\"$hardcode_libdir_flag_spec\" $ECHO " - use the \`$flag' linker flag" fi if test -n "$admincmds"; then $ECHO " - have your system administrator run these commands:$admincmds" fi if test -f /etc/ld.so.conf; then $ECHO " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" fi $ECHO $ECHO "See any operating system documentation about shared libraries for" case $host in solaris2.[6789]|solaris2.1[0-9]) $ECHO "more information, such as the ld(1), crle(1) and ld.so(8) manual" $ECHO "pages." ;; *) $ECHO "more information, such as the ld(1) and ld.so(8) manual pages." ;; esac $ECHO "X----------------------------------------------------------------------" | $Xsed exit $EXIT_SUCCESS } test "$mode" = finish && func_mode_finish ${1+"$@"} # func_mode_install arg... func_mode_install () { $opt_debug # There may be an optional sh(1) argument at the beginning of # install_prog (especially on Windows NT). if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh || # Allow the use of GNU shtool's install command. $ECHO "X$nonopt" | $GREP shtool >/dev/null; then # Aesthetically quote it. func_quote_for_eval "$nonopt" install_prog="$func_quote_for_eval_result " arg=$1 shift else install_prog= arg=$nonopt fi # The real first argument should be the name of the installation program. # Aesthetically quote it. func_quote_for_eval "$arg" install_prog="$install_prog$func_quote_for_eval_result" # We need to accept at least all the BSD install flags. dest= files= opts= prev= install_type= isdir=no stripme= for arg do if test -n "$dest"; then files="$files $dest" dest=$arg continue fi case $arg in -d) isdir=yes ;; -f) case " $install_prog " in *[\\\ /]cp\ *) ;; *) prev=$arg ;; esac ;; -g | -m | -o) prev=$arg ;; -s) stripme=" -s" continue ;; -*) ;; *) # If the previous option needed an argument, then skip it. if test -n "$prev"; then prev= else dest=$arg continue fi ;; esac # Aesthetically quote the argument. func_quote_for_eval "$arg" install_prog="$install_prog $func_quote_for_eval_result" done test -z "$install_prog" && \ func_fatal_help "you must specify an install program" test -n "$prev" && \ func_fatal_help "the \`$prev' option requires an argument" if test -z "$files"; then if test -z "$dest"; then func_fatal_help "no file or destination specified" else func_fatal_help "you must specify a destination" fi fi # Strip any trailing slash from the destination. func_stripname '' '/' "$dest" dest=$func_stripname_result # Check to see that the destination is a directory. test -d "$dest" && isdir=yes if test "$isdir" = yes; then destdir="$dest" destname= else func_dirname_and_basename "$dest" "" "." destdir="$func_dirname_result" destname="$func_basename_result" # Not a directory, so check to see that there is only one file specified. set dummy $files; shift test "$#" -gt 1 && \ func_fatal_help "\`$dest' is not a directory" fi case $destdir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) for file in $files; do case $file in *.lo) ;; *) func_fatal_help "\`$destdir' must be an absolute directory name" ;; esac done ;; esac # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" staticlibs= future_libdirs= current_libdirs= for file in $files; do # Do each installation. case $file in *.$libext) # Do the static libraries later. staticlibs="$staticlibs $file" ;; *.la) # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$file" \ || func_fatal_help "\`$file' is not a valid libtool archive" library_names= old_library= relink_command= func_source "$file" # Add the libdir to current_libdirs if it is the destination. if test "X$destdir" = "X$libdir"; then case "$current_libdirs " in *" $libdir "*) ;; *) current_libdirs="$current_libdirs $libdir" ;; esac else # Note the libdir as a future libdir. case "$future_libdirs " in *" $libdir "*) ;; *) future_libdirs="$future_libdirs $libdir" ;; esac fi func_dirname "$file" "/" "" dir="$func_dirname_result" dir="$dir$objdir" if test -n "$relink_command"; then # Determine the prefix the user has applied to our future dir. inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"` # Don't allow the user to place us outside of our expected # location b/c this prevents finding dependent libraries that # are installed to the same prefix. # At present, this check doesn't affect windows .dll's that # are installed into $libdir/../bin (currently, that works fine) # but it's something to keep an eye on. test "$inst_prefix_dir" = "$destdir" && \ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir" if test -n "$inst_prefix_dir"; then # Stick the inst_prefix_dir data into the link command. relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"` else relink_command=`$ECHO "X$relink_command" | $Xsed -e "s%@inst_prefix_dir@%%"` fi func_warning "relinking \`$file'" func_show_eval "$relink_command" \ 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"' fi # See the names of the shared library. set dummy $library_names; shift if test -n "$1"; then realname="$1" shift srcname="$realname" test -n "$relink_command" && srcname="$realname"T # Install the shared library and build the symlinks. func_show_eval "$install_prog $dir/$srcname $destdir/$realname" \ 'exit $?' tstripme="$stripme" case $host_os in cygwin* | mingw* | pw32* | cegcc*) case $realname in *.dll.a) tstripme="" ;; esac ;; esac if test -n "$tstripme" && test -n "$striplib"; then func_show_eval "$striplib $destdir/$realname" 'exit $?' fi if test "$#" -gt 0; then # Delete the old symlinks, and create new ones. # Try `ln -sf' first, because the `ln' binary might depend on # the symlink we replace! Solaris /bin/ln does not understand -f, # so we also need to try rm && ln -s. for linkname do test "$linkname" != "$realname" \ && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })" done fi # Do each command in the postinstall commands. lib="$destdir/$realname" func_execute_cmds "$postinstall_cmds" 'exit $?' fi # Install the pseudo-library for information purposes. func_basename "$file" name="$func_basename_result" instname="$dir/$name"i func_show_eval "$install_prog $instname $destdir/$name" 'exit $?' # Maybe install the static library, too. test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" ;; *.lo) # Install (i.e. copy) a libtool object. # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # Deduce the name of the destination old-style object file. case $destfile in *.lo) func_lo2o "$destfile" staticdest=$func_lo2o_result ;; *.$objext) staticdest="$destfile" destfile= ;; *) func_fatal_help "cannot copy a libtool object to \`$destfile'" ;; esac # Install the libtool object if requested. test -n "$destfile" && \ func_show_eval "$install_prog $file $destfile" 'exit $?' # Install the old object if enabled. if test "$build_old_libs" = yes; then # Deduce the name of the old-style object file. func_lo2o "$file" staticobj=$func_lo2o_result func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?' fi exit $EXIT_SUCCESS ;; *) # Figure out destination file name, if it wasn't already specified. if test -n "$destname"; then destfile="$destdir/$destname" else func_basename "$file" destfile="$func_basename_result" destfile="$destdir/$destfile" fi # If the file is missing, and there is a .exe on the end, strip it # because it is most likely a libtool script we actually want to # install stripped_ext="" case $file in *.exe) if test ! -f "$file"; then func_stripname '' '.exe' "$file" file=$func_stripname_result stripped_ext=".exe" fi ;; esac # Do a test to see if this is really a libtool program. case $host in *cygwin* | *mingw*) if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" wrapper=$func_ltwrapper_scriptname_result else func_stripname '' '.exe' "$file" wrapper=$func_stripname_result fi ;; *) wrapper=$file ;; esac if func_ltwrapper_script_p "$wrapper"; then notinst_deplibs= relink_command= func_source "$wrapper" # Check the variables that should have been set. test -z "$generated_by_libtool_version" && \ func_fatal_error "invalid libtool wrapper script \`$wrapper'" finalize=yes for lib in $notinst_deplibs; do # Check to see that each library is installed. libdir= if test -f "$lib"; then func_source "$lib" fi libfile="$libdir/"`$ECHO "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test if test -n "$libdir" && test ! -f "$libfile"; then func_warning "\`$lib' has not been installed in \`$libdir'" finalize=no fi done relink_command= func_source "$wrapper" outputname= if test "$fast_install" = no && test -n "$relink_command"; then $opt_dry_run || { if test "$finalize" = yes; then tmpdir=`func_mktempdir` func_basename "$file$stripped_ext" file="$func_basename_result" outputname="$tmpdir/$file" # Replace the output file specification. relink_command=`$ECHO "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` $opt_silent || { func_quote_for_expand "$relink_command" eval "func_echo $func_quote_for_expand_result" } if eval "$relink_command"; then : else func_error "error: relink \`$file' with the above command before installing it" $opt_dry_run || ${RM}r "$tmpdir" continue fi file="$outputname" else func_warning "cannot relink \`$file'" fi } else # Install the binary that we compiled earlier. file=`$ECHO "X$file$stripped_ext" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` fi fi # remove .exe since cygwin /usr/bin/install will append another # one anyway case $install_prog,$host in */usr/bin/install*,*cygwin*) case $file:$destfile in *.exe:*.exe) # this is ok ;; *.exe:*) destfile=$destfile.exe ;; *:*.exe) func_stripname '' '.exe' "$destfile" destfile=$func_stripname_result ;; esac ;; esac func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?' $opt_dry_run || if test -n "$outputname"; then ${RM}r "$tmpdir" fi ;; esac done for file in $staticlibs; do func_basename "$file" name="$func_basename_result" # Set up the ranlib parameters. oldlib="$destdir/$name" func_show_eval "$install_prog \$file \$oldlib" 'exit $?' if test -n "$stripme" && test -n "$old_striplib"; then func_show_eval "$old_striplib $oldlib" 'exit $?' fi # Do each command in the postinstall commands. func_execute_cmds "$old_postinstall_cmds" 'exit $?' done test -n "$future_libdirs" && \ func_warning "remember to run \`$progname --finish$future_libdirs'" if test -n "$current_libdirs"; then # Maybe just do a dry run. $opt_dry_run && current_libdirs=" -n$current_libdirs" exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs' else exit $EXIT_SUCCESS fi } test "$mode" = install && func_mode_install ${1+"$@"} # func_generate_dlsyms outputname originator pic_p # Extract symbols from dlprefiles and create ${outputname}S.o with # a dlpreopen symbol table. func_generate_dlsyms () { $opt_debug my_outputname="$1" my_originator="$2" my_pic_p="${3-no}" my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'` my_dlsyms= if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then if test -n "$NM" && test -n "$global_symbol_pipe"; then my_dlsyms="${my_outputname}S.c" else func_error "not configured to extract global symbols from dlpreopened files" fi fi if test -n "$my_dlsyms"; then case $my_dlsyms in "") ;; *.c) # Discover the nlist of each of the dlfiles. nlist="$output_objdir/${my_outputname}.nm" func_show_eval "$RM $nlist ${nlist}S ${nlist}T" # Parse the name list into a source file. func_verbose "creating $output_objdir/$my_dlsyms" $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\ /* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */ /* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */ #ifdef __cplusplus extern \"C\" { #endif /* External symbol declarations for the compiler. */\ " if test "$dlself" = yes; then func_verbose "generating symbol list for \`$output'" $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist" # Add our own program objects to the symbol list. progfiles=`$ECHO "X$objs$old_deplibs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` for progfile in $progfiles; do func_verbose "extracting global C symbols from \`$progfile'" $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'" done if test -n "$exclude_expsyms"; then $opt_dry_run || { eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi if test -n "$export_symbols_regex"; then $opt_dry_run || { eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' } fi # Prepare the list of exported symbols if test -z "$export_symbols"; then export_symbols="$output_objdir/$outputname.exp" $opt_dry_run || { $RM $export_symbols eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' case $host in *cygwin* | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"' ;; esac } else $opt_dry_run || { eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"' eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T' eval '$MV "$nlist"T "$nlist"' case $host in *cygwin | *mingw* | *cegcc* ) eval "echo EXPORTS "'> "$output_objdir/$outputname.def"' eval 'cat "$nlist" >> "$output_objdir/$outputname.def"' ;; esac } fi fi for dlprefile in $dlprefiles; do func_verbose "extracting global C symbols from \`$dlprefile'" func_basename "$dlprefile" name="$func_basename_result" $opt_dry_run || { eval '$ECHO ": $name " >> "$nlist"' eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'" } done $opt_dry_run || { # Make sure we have at least an empty file. test -f "$nlist" || : > "$nlist" if test -n "$exclude_expsyms"; then $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T $MV "$nlist"T "$nlist" fi # Try sorting and uniquifying the output. if $GREP -v "^: " < "$nlist" | if sort -k 3 /dev/null 2>&1; then sort -k 3 else sort +2 fi | uniq > "$nlist"S; then : else $GREP -v "^: " < "$nlist" > "$nlist"S fi if test -f "$nlist"S; then eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"' else $ECHO '/* NONE */' >> "$output_objdir/$my_dlsyms" fi $ECHO >> "$output_objdir/$my_dlsyms" "\ /* The mapping between symbol names and symbols. */ typedef struct { const char *name; void *address; } lt_dlsymlist; " case $host in *cygwin* | *mingw* | *cegcc* ) $ECHO >> "$output_objdir/$my_dlsyms" "\ /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */" lt_dlsym_const= ;; *osf5*) echo >> "$output_objdir/$my_dlsyms" "\ /* This system does not cope well with relocations in const data */" lt_dlsym_const= ;; *) lt_dlsym_const=const ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ extern $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[]; $lt_dlsym_const lt_dlsymlist lt_${my_prefix}_LTX_preloaded_symbols[] = {\ { \"$my_originator\", (void *) 0 }," case $need_lib_prefix in no) eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; *) eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms" ;; esac $ECHO >> "$output_objdir/$my_dlsyms" "\ {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt_${my_prefix}_LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif\ " } # !$opt_dry_run pic_flag_for_symtable= case "$compile_command " in *" -static "*) ;; *) case $host in # compiling the symbol table file with pic_flag works around # a FreeBSD bug that causes programs to crash when -lm is # linked before any other PIC object. But we must not use # pic_flag when linking with -static. The problem exists in # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;; *-*-hpux*) pic_flag_for_symtable=" $pic_flag" ;; *) if test "X$my_pic_p" != Xno; then pic_flag_for_symtable=" $pic_flag" fi ;; esac ;; esac symtab_cflags= for arg in $LTCFLAGS; do case $arg in -pie | -fpie | -fPIE) ;; *) symtab_cflags="$symtab_cflags $arg" ;; esac done # Now compile the dynamic symbol file. func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?' # Clean up the generated files. func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"' # Transform the symbol file into the correct name. symfileobj="$output_objdir/${my_outputname}S.$objext" case $host in *cygwin* | *mingw* | *cegcc* ) if test -f "$output_objdir/$my_outputname.def"; then compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"` else compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` fi ;; *) compile_command=`$ECHO "X$compile_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$symfileobj%"` ;; esac ;; *) func_fatal_error "unknown suffix for \`$my_dlsyms'" ;; esac else # We keep going just in case the user didn't refer to # lt_preloaded_symbols. The linker will fail if global_symbol_pipe # really was required. # Nullify the symbol file. compile_command=`$ECHO "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` finalize_command=`$ECHO "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` fi } # func_win32_libid arg # return the library type of file 'arg' # # Need a lot of goo to handle *both* DLLs and import libs # Has to be a shell function in order to 'eat' the argument # that is supplied when $file_magic_command is called. func_win32_libid () { $opt_debug win32_libid_type="unknown" win32_fileres=`file -L $1 2>/dev/null` case $win32_fileres in *ar\ archive\ import\ library*) # definitely import win32_libid_type="x86 archive import" ;; *ar\ archive*) # could be an import, or static if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null | $EGREP 'file format pe-i386(.*architecture: i386)?' >/dev/null ; then win32_nmres=`eval $NM -f posix -A $1 | $SED -n -e ' 1,100{ / I /{ s,.*,import, p q } }'` case $win32_nmres in import*) win32_libid_type="x86 archive import";; *) win32_libid_type="x86 archive static";; esac fi ;; *DLL*) win32_libid_type="x86 DLL" ;; *executable*) # but shell scripts are "executable" too... case $win32_fileres in *MS\ Windows\ PE\ Intel*) win32_libid_type="x86 DLL" ;; esac ;; esac $ECHO "$win32_libid_type" } # func_extract_an_archive dir oldlib func_extract_an_archive () { $opt_debug f_ex_an_ar_dir="$1"; shift f_ex_an_ar_oldlib="$1" func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" 'exit $?' if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then : else func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib" fi } # func_extract_archives gentop oldlib ... func_extract_archives () { $opt_debug my_gentop="$1"; shift my_oldlibs=${1+"$@"} my_oldobjs="" my_xlib="" my_xabs="" my_xdir="" for my_xlib in $my_oldlibs; do # Extract the objects. case $my_xlib in [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;; *) my_xabs=`pwd`"/$my_xlib" ;; esac func_basename "$my_xlib" my_xlib="$func_basename_result" my_xlib_u=$my_xlib while :; do case " $extracted_archives " in *" $my_xlib_u "*) func_arith $extracted_serial + 1 extracted_serial=$func_arith_result my_xlib_u=lt$extracted_serial-$my_xlib ;; *) break ;; esac done extracted_archives="$extracted_archives $my_xlib_u" my_xdir="$my_gentop/$my_xlib_u" func_mkdir_p "$my_xdir" case $host in *-darwin*) func_verbose "Extracting $my_xabs" # Do not bother doing anything if just a dry run $opt_dry_run || { darwin_orig_dir=`pwd` cd $my_xdir || exit $? darwin_archive=$my_xabs darwin_curdir=`pwd` darwin_base_archive=`basename "$darwin_archive"` darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true` if test -n "$darwin_arches"; then darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'` darwin_arch= func_verbose "$darwin_base_archive has multiple architectures $darwin_arches" for darwin_arch in $darwin_arches ; do func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}" $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}" cd "unfat-$$/${darwin_base_archive}-${darwin_arch}" func_extract_an_archive "`pwd`" "${darwin_base_archive}" cd "$darwin_curdir" $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" done # $darwin_arches ## Okay now we've a bunch of thin objects, gotta fatten them up :) darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u` darwin_file= darwin_files= for darwin_file in $darwin_filelist; do darwin_files=`find unfat-$$ -name $darwin_file -print | $NL2SP` $LIPO -create -output "$darwin_file" $darwin_files done # $darwin_filelist $RM -rf unfat-$$ cd "$darwin_orig_dir" else cd $darwin_orig_dir func_extract_an_archive "$my_xdir" "$my_xabs" fi # $darwin_arches } # !$opt_dry_run ;; *) func_extract_an_archive "$my_xdir" "$my_xabs" ;; esac my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP` done func_extract_archives_result="$my_oldobjs" } # func_emit_wrapper_part1 [arg=no] # # Emit the first part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part1 () { func_emit_wrapper_part1_arg1=no if test -n "$1" ; then func_emit_wrapper_part1_arg1=$1 fi $ECHO "\ #! $SHELL # $output - temporary wrapper script for $objdir/$outputname # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # The $output program cannot be directly executed until all the libtool # libraries that it depends on are installed. # # This wrapper script should never be moved out of the build directory. # If it is, it will not operate correctly. # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='${SED} -e 1s/^X//' sed_quote_subst='$sed_quote_subst' # Be Bourne compatible if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac fi BIN_SH=xpg4; export BIN_SH # for Tru64 DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH relink_command=\"$relink_command\" # This environment variable determines our operation mode. if test \"\$libtool_install_magic\" = \"$magic\"; then # install mode needs the following variables: generated_by_libtool_version='$macro_version' notinst_deplibs='$notinst_deplibs' else # When we are sourced in execute mode, \$file and \$ECHO are already set. if test \"\$libtool_execute_magic\" != \"$magic\"; then ECHO=\"$qecho\" file=\"\$0\" # Make sure echo works. if test \"X\$1\" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test \"X\`{ \$ECHO '\t'; } 2>/dev/null\`\" = 'X\t'; then # Yippee, \$ECHO works! : else # Restart under the correct shell, and then maybe \$ECHO will work. exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} fi fi\ " $ECHO "\ # Find the directory that this script lives in. thisdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` test \"x\$thisdir\" = \"x\$file\" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=\`ls -ld \"\$file\" | ${SED} -n 's/.*-> //p'\` while test -n \"\$file\"; do destdir=\`\$ECHO \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` # If there was a directory component, then change thisdir. if test \"x\$destdir\" != \"x\$file\"; then case \"\$destdir\" in [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;; *) thisdir=\"\$thisdir/\$destdir\" ;; esac fi file=\`\$ECHO \"X\$file\" | \$Xsed -e 's%^.*/%%'\` file=\`ls -ld \"\$thisdir/\$file\" | ${SED} -n 's/.*-> //p'\` done " } # end: func_emit_wrapper_part1 # func_emit_wrapper_part2 [arg=no] # # Emit the second part of a libtool wrapper script on stdout. # For more information, see the description associated with # func_emit_wrapper(), below. func_emit_wrapper_part2 () { func_emit_wrapper_part2_arg1=no if test -n "$1" ; then func_emit_wrapper_part2_arg1=$1 fi $ECHO "\ # Usually 'no', except on cygwin/mingw when embedded into # the cwrapper. WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_part2_arg1 if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then # special case for '.' if test \"\$thisdir\" = \".\"; then thisdir=\`pwd\` fi # remove .libs from thisdir case \"\$thisdir\" in *[\\\\/]$objdir ) thisdir=\`\$ECHO \"X\$thisdir\" | \$Xsed -e 's%[\\\\/][^\\\\/]*$%%'\` ;; $objdir ) thisdir=. ;; esac fi # Try to get the absolute directory name. absdir=\`cd \"\$thisdir\" && pwd\` test -n \"\$absdir\" && thisdir=\"\$absdir\" " if test "$fast_install" = yes; then $ECHO "\ program=lt-'$outputname'$exeext progdir=\"\$thisdir/$objdir\" if test ! -f \"\$progdir/\$program\" || { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\ test \"X\$file\" != \"X\$progdir/\$program\"; }; then file=\"\$\$-\$program\" if test ! -d \"\$progdir\"; then $MKDIR \"\$progdir\" else $RM \"\$progdir/\$file\" fi" $ECHO "\ # relink executable if necessary if test -n \"\$relink_command\"; then if relink_command_output=\`eval \$relink_command 2>&1\`; then : else $ECHO \"\$relink_command_output\" >&2 $RM \"\$progdir/\$file\" exit 1 fi fi $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || { $RM \"\$progdir/\$program\"; $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; } $RM \"\$progdir/\$file\" fi" else $ECHO "\ program='$outputname' progdir=\"\$thisdir/$objdir\" " fi $ECHO "\ if test -f \"\$progdir/\$program\"; then" # Export our shlibpath_var if we have one. if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then $ECHO "\ # Add our own library path to $shlibpath_var $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" # Some systems cannot cope with colon-terminated $shlibpath_var # The second colon is a workaround for a bug in BeOS R4 sed $shlibpath_var=\`\$ECHO \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` export $shlibpath_var " fi # fixup the dll searchpath if we need to. if test -n "$dllsearchpath"; then $ECHO "\ # Add the dll search path components to the executable PATH PATH=$dllsearchpath:\$PATH " fi $ECHO "\ if test \"\$libtool_execute_magic\" != \"$magic\"; then # Run the actual program with our arguments. " case $host in # Backslashes separate directories on plain windows *-*-mingw | *-*-os2* | *-cegcc*) $ECHO "\ exec \"\$progdir\\\\\$program\" \${1+\"\$@\"} " ;; *) $ECHO "\ exec \"\$progdir/\$program\" \${1+\"\$@\"} " ;; esac $ECHO "\ \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2 exit 1 fi else # The program doesn't exist. \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2 \$ECHO \"This script is just a wrapper for \$program.\" 1>&2 $ECHO \"See the $PACKAGE documentation for more information.\" 1>&2 exit 1 fi fi\ " } # end: func_emit_wrapper_part2 # func_emit_wrapper [arg=no] # # Emit a libtool wrapper script on stdout. # Don't directly open a file because we may want to # incorporate the script contents within a cygwin/mingw # wrapper executable. Must ONLY be called from within # func_mode_link because it depends on a number of variables # set therein. # # ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR # variable will take. If 'yes', then the emitted script # will assume that the directory in which it is stored is # the $objdir directory. This is a cygwin/mingw-specific # behavior. func_emit_wrapper () { func_emit_wrapper_arg1=no if test -n "$1" ; then func_emit_wrapper_arg1=$1 fi # split this up so that func_emit_cwrapperexe_src # can call each part independently. func_emit_wrapper_part1 "${func_emit_wrapper_arg1}" func_emit_wrapper_part2 "${func_emit_wrapper_arg1}" } # func_to_host_path arg # # Convert paths to host format when used with build tools. # Intended for use with "native" mingw (where libtool itself # is running under the msys shell), or in the following cross- # build environments: # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # where wine is equipped with the `winepath' executable. # In the native mingw case, the (msys) shell automatically # converts paths for any non-msys applications it launches, # but that facility isn't available from inside the cwrapper. # Similar accommodations are necessary for $host mingw and # $build cygwin. Calling this function does no harm for other # $host/$build combinations not listed above. # # ARG is the path (on $build) that should be converted to # the proper representation for $host. The result is stored # in $func_to_host_path_result. func_to_host_path () { func_to_host_path_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' case $build in *mingw* ) # actually, msys # awkward: cmd appends spaces to result lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_path_tmp1=`( cmd //c echo "$1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_path_tmp1=`cygpath -w "$1"` func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # Unfortunately, winepath does not exit with a non-zero # error code, so we are forced to check the contents of # stdout. On the other hand, if the command is not # found, the shell will set an exit code of 127 and print # *an error message* to stdout. So we must check for both # error code of zero AND non-empty stdout, which explains # the odd construction: func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null` if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then func_to_host_path_result=`echo "$func_to_host_path_tmp1" |\ $SED -e "$lt_sed_naive_backslashify"` else # Allow warning below. func_to_host_path_result="" fi ;; esac if test -z "$func_to_host_path_result" ; then func_error "Could not determine host path corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback: func_to_host_path_result="$1" fi ;; esac fi } # end: func_to_host_path # func_to_host_pathlist arg # # Convert pathlists to host format when used with build tools. # See func_to_host_path(), above. This function supports the # following $build/$host combinations (but does no harm for # combinations not listed here): # $build $host # mingw (msys) mingw [e.g. native] # cygwin mingw # *nix + wine mingw # # Path separators are also converted from $build format to # $host format. If ARG begins or ends with a path separator # character, it is preserved (but converted to $host format) # on output. # # ARG is a pathlist (on $build) that should be converted to # the proper representation on $host. The result is stored # in $func_to_host_pathlist_result. func_to_host_pathlist () { func_to_host_pathlist_result="$1" if test -n "$1" ; then case $host in *mingw* ) lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g' # Remove leading and trailing path separator characters from # ARG. msys behavior is inconsistent here, cygpath turns them # into '.;' and ';.', and winepath ignores them completely. func_to_host_pathlist_tmp2="$1" # Once set for this call, this variable should not be # reassigned. It is used in tha fallback case. func_to_host_pathlist_tmp1=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e 's|^:*||' -e 's|:*$||'` case $build in *mingw* ) # Actually, msys. # Awkward: cmd appends spaces to result. lt_sed_strip_trailing_spaces="s/[ ]*\$//" func_to_host_pathlist_tmp2=`( cmd //c echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_sed_strip_trailing_spaces" ) 2>/dev/null || echo ""` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; *cygwin* ) func_to_host_pathlist_tmp2=`cygpath -w -p "$func_to_host_pathlist_tmp1"` func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp2" |\ $SED -e "$lt_sed_naive_backslashify"` ;; * ) # unfortunately, winepath doesn't convert pathlists func_to_host_pathlist_result="" func_to_host_pathlist_oldIFS=$IFS IFS=: for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do IFS=$func_to_host_pathlist_oldIFS if test -n "$func_to_host_pathlist_f" ; then func_to_host_path "$func_to_host_pathlist_f" if test -n "$func_to_host_path_result" ; then if test -z "$func_to_host_pathlist_result" ; then func_to_host_pathlist_result="$func_to_host_path_result" else func_to_host_pathlist_result="$func_to_host_pathlist_result;$func_to_host_path_result" fi fi fi IFS=: done IFS=$func_to_host_pathlist_oldIFS ;; esac if test -z "$func_to_host_pathlist_result" ; then func_error "Could not determine the host path(s) corresponding to" func_error " '$1'" func_error "Continuing, but uninstalled executables may not work." # Fallback. This may break if $1 contains DOS-style drive # specifications. The fix is not to complicate the expression # below, but for the user to provide a working wine installation # with winepath so that path translation in the cross-to-mingw # case works properly. lt_replace_pathsep_nix_to_dos="s|:|;|g" func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\ $SED -e "$lt_replace_pathsep_nix_to_dos"` fi # Now, add the leading and trailing path separators back case "$1" in :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result" ;; esac case "$1" in *: ) func_to_host_pathlist_result="$func_to_host_pathlist_result;" ;; esac ;; esac fi } # end: func_to_host_pathlist # func_emit_cwrapperexe_src # emit the source code for a wrapper executable on stdout # Must ONLY be called from within func_mode_link because # it depends on a number of variable set therein. func_emit_cwrapperexe_src () { cat < #include #ifdef _MSC_VER # include # include # include # define setmode _setmode #else # include # include # ifdef __CYGWIN__ # include # define HAVE_SETENV # ifdef __STRICT_ANSI__ char *realpath (const char *, char *); int putenv (char *); int setenv (const char *, const char *, int); # endif # endif #endif #include #include #include #include #include #include #include #include #if defined(PATH_MAX) # define LT_PATHMAX PATH_MAX #elif defined(MAXPATHLEN) # define LT_PATHMAX MAXPATHLEN #else # define LT_PATHMAX 1024 #endif #ifndef S_IXOTH # define S_IXOTH 0 #endif #ifndef S_IXGRP # define S_IXGRP 0 #endif #ifdef _MSC_VER # define S_IXUSR _S_IEXEC # define stat _stat # ifndef _INTPTR_T_DEFINED # define intptr_t int # endif #endif #ifndef DIR_SEPARATOR # define DIR_SEPARATOR '/' # define PATH_SEPARATOR ':' #endif #if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \ defined (__OS2__) # define HAVE_DOS_BASED_FILE_SYSTEM # define FOPEN_WB "wb" # ifndef DIR_SEPARATOR_2 # define DIR_SEPARATOR_2 '\\' # endif # ifndef PATH_SEPARATOR_2 # define PATH_SEPARATOR_2 ';' # endif #endif #ifndef DIR_SEPARATOR_2 # define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR) #else /* DIR_SEPARATOR_2 */ # define IS_DIR_SEPARATOR(ch) \ (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2)) #endif /* DIR_SEPARATOR_2 */ #ifndef PATH_SEPARATOR_2 # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR) #else /* PATH_SEPARATOR_2 */ # define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2) #endif /* PATH_SEPARATOR_2 */ #ifdef __CYGWIN__ # define FOPEN_WB "wb" #endif #ifndef FOPEN_WB # define FOPEN_WB "w" #endif #ifndef _O_BINARY # define _O_BINARY 0 #endif #define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type))) #define XFREE(stale) do { \ if (stale) { free ((void *) stale); stale = 0; } \ } while (0) #undef LTWRAPPER_DEBUGPRINTF #if defined DEBUGWRAPPER # define LTWRAPPER_DEBUGPRINTF(args) ltwrapper_debugprintf args static void ltwrapper_debugprintf (const char *fmt, ...) { va_list args; va_start (args, fmt); (void) vfprintf (stderr, fmt, args); va_end (args); } #else # define LTWRAPPER_DEBUGPRINTF(args) #endif const char *program_name = NULL; void *xmalloc (size_t num); char *xstrdup (const char *string); const char *base_name (const char *name); char *find_executable (const char *wrapper); char *chase_symlinks (const char *pathspec); int make_executable (const char *path); int check_executable (const char *path); char *strendzap (char *str, const char *pat); void lt_fatal (const char *message, ...); void lt_setenv (const char *name, const char *value); char *lt_extend_str (const char *orig_value, const char *add, int to_end); void lt_opt_process_env_set (const char *arg); void lt_opt_process_env_prepend (const char *arg); void lt_opt_process_env_append (const char *arg); int lt_split_name_value (const char *arg, char** name, char** value); void lt_update_exe_path (const char *name, const char *value); void lt_update_lib_path (const char *name, const char *value); static const char *script_text_part1 = EOF func_emit_wrapper_part1 yes | $SED -e 's/\([\\"]\)/\\\1/g' \ -e 's/^/ "/' -e 's/$/\\n"/' echo ";" cat <"))); for (i = 0; i < newargc; i++) { LTWRAPPER_DEBUGPRINTF (("(main) newargz[%d] : %s\n", i, (newargz[i] ? newargz[i] : ""))); } EOF case $host_os in mingw*) cat <<"EOF" /* execv doesn't actually work on mingw as expected on unix */ rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz); if (rval == -1) { /* failed to start process */ LTWRAPPER_DEBUGPRINTF (("(main) failed to launch target \"%s\": errno = %d\n", lt_argv_zero, errno)); return 127; } return rval; EOF ;; *) cat <<"EOF" execv (lt_argv_zero, newargz); return rval; /* =127, but avoids unused variable warning */ EOF ;; esac cat <<"EOF" } void * xmalloc (size_t num) { void *p = (void *) malloc (num); if (!p) lt_fatal ("Memory exhausted"); return p; } char * xstrdup (const char *string) { return string ? strcpy ((char *) xmalloc (strlen (string) + 1), string) : NULL; } const char * base_name (const char *name) { const char *base; #if defined (HAVE_DOS_BASED_FILE_SYSTEM) /* Skip over the disk name in MSDOS pathnames. */ if (isalpha ((unsigned char) name[0]) && name[1] == ':') name += 2; #endif for (base = name; *name; name++) if (IS_DIR_SEPARATOR (*name)) base = name + 1; return base; } int check_executable (const char *path) { struct stat st; LTWRAPPER_DEBUGPRINTF (("(check_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if ((stat (path, &st) >= 0) && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH))) return 1; else return 0; } int make_executable (const char *path) { int rval = 0; struct stat st; LTWRAPPER_DEBUGPRINTF (("(make_executable) : %s\n", path ? (*path ? path : "EMPTY!") : "NULL!")); if ((!path) || (!*path)) return 0; if (stat (path, &st) >= 0) { rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR); } return rval; } /* Searches for the full path of the wrapper. Returns newly allocated full path name if found, NULL otherwise Does not chase symlinks, even on platforms that support them. */ char * find_executable (const char *wrapper) { int has_slash = 0; const char *p; const char *p_next; /* static buffer for getcwd */ char tmp[LT_PATHMAX + 1]; int tmp_len; char *concat_name; LTWRAPPER_DEBUGPRINTF (("(find_executable) : %s\n", wrapper ? (*wrapper ? wrapper : "EMPTY!") : "NULL!")); if ((wrapper == NULL) || (*wrapper == '\0')) return NULL; /* Absolute path? */ #if defined (HAVE_DOS_BASED_FILE_SYSTEM) if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':') { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } else { #endif if (IS_DIR_SEPARATOR (wrapper[0])) { concat_name = xstrdup (wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } #if defined (HAVE_DOS_BASED_FILE_SYSTEM) } #endif for (p = wrapper; *p; p++) if (*p == '/') { has_slash = 1; break; } if (!has_slash) { /* no slashes; search PATH */ const char *path = getenv ("PATH"); if (path != NULL) { for (p = path; *p; p = p_next) { const char *q; size_t p_len; for (q = p; *q; q++) if (IS_PATH_SEPARATOR (*q)) break; p_len = q - p; p_next = (*q == '\0' ? q : q + 1); if (p_len == 0) { /* empty path: current directory */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); } else { concat_name = XMALLOC (char, p_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, p, p_len); concat_name[p_len] = '/'; strcpy (concat_name + p_len + 1, wrapper); } if (check_executable (concat_name)) return concat_name; XFREE (concat_name); } } /* not found in PATH; assume curdir */ } /* Relative path | not found in path: prepend cwd */ if (getcwd (tmp, LT_PATHMAX) == NULL) lt_fatal ("getcwd failed"); tmp_len = strlen (tmp); concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1); memcpy (concat_name, tmp, tmp_len); concat_name[tmp_len] = '/'; strcpy (concat_name + tmp_len + 1, wrapper); if (check_executable (concat_name)) return concat_name; XFREE (concat_name); return NULL; } char * chase_symlinks (const char *pathspec) { #ifndef S_ISLNK return xstrdup (pathspec); #else char buf[LT_PATHMAX]; struct stat s; char *tmp_pathspec = xstrdup (pathspec); char *p; int has_symlinks = 0; while (strlen (tmp_pathspec) && !has_symlinks) { LTWRAPPER_DEBUGPRINTF (("checking path component for symlinks: %s\n", tmp_pathspec)); if (lstat (tmp_pathspec, &s) == 0) { if (S_ISLNK (s.st_mode) != 0) { has_symlinks = 1; break; } /* search backwards for last DIR_SEPARATOR */ p = tmp_pathspec + strlen (tmp_pathspec) - 1; while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) p--; if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p))) { /* no more DIR_SEPARATORS left */ break; } *p = '\0'; } else { char *errstr = strerror (errno); lt_fatal ("Error accessing file %s (%s)", tmp_pathspec, errstr); } } XFREE (tmp_pathspec); if (!has_symlinks) { return xstrdup (pathspec); } tmp_pathspec = realpath (pathspec, buf); if (tmp_pathspec == 0) { lt_fatal ("Could not follow symlinks for %s", pathspec); } return xstrdup (tmp_pathspec); #endif } char * strendzap (char *str, const char *pat) { size_t len, patlen; assert (str != NULL); assert (pat != NULL); len = strlen (str); patlen = strlen (pat); if (patlen <= len) { str += len - patlen; if (strcmp (str, pat) == 0) *str = '\0'; } return str; } static void lt_error_core (int exit_status, const char *mode, const char *message, va_list ap) { fprintf (stderr, "%s: %s: ", program_name, mode); vfprintf (stderr, message, ap); fprintf (stderr, ".\n"); if (exit_status >= 0) exit (exit_status); } void lt_fatal (const char *message, ...) { va_list ap; va_start (ap, message); lt_error_core (EXIT_FAILURE, "FATAL", message, ap); va_end (ap); } void lt_setenv (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_setenv) setting '%s' to '%s'\n", (name ? name : ""), (value ? value : ""))); { #ifdef HAVE_SETENV /* always make a copy, for consistency with !HAVE_SETENV */ char *str = xstrdup (value); setenv (name, str, 1); #else int len = strlen (name) + 1 + strlen (value) + 1; char *str = XMALLOC (char, len); sprintf (str, "%s=%s", name, value); if (putenv (str) != EXIT_SUCCESS) { XFREE (str); } #endif } } char * lt_extend_str (const char *orig_value, const char *add, int to_end) { char *new_value; if (orig_value && *orig_value) { int orig_value_len = strlen (orig_value); int add_len = strlen (add); new_value = XMALLOC (char, add_len + orig_value_len + 1); if (to_end) { strcpy (new_value, orig_value); strcpy (new_value + orig_value_len, add); } else { strcpy (new_value, add); strcpy (new_value + add_len, orig_value); } } else { new_value = xstrdup (add); } return new_value; } int lt_split_name_value (const char *arg, char** name, char** value) { const char *p; int len; if (!arg || !*arg) return 1; p = strchr (arg, (int)'='); if (!p) return 1; *value = xstrdup (++p); len = strlen (arg) - strlen (*value); *name = XMALLOC (char, len); strncpy (*name, arg, len-1); (*name)[len - 1] = '\0'; return 0; } void lt_opt_process_env_set (const char *arg) { char *name = NULL; char *value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_set_opt, arg); } lt_setenv (name, value); XFREE (name); XFREE (value); } void lt_opt_process_env_prepend (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_prepend_opt, arg); } new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_opt_process_env_append (const char *arg) { char *name = NULL; char *value = NULL; char *new_value = NULL; if (lt_split_name_value (arg, &name, &value) != 0) { XFREE (name); XFREE (value); lt_fatal ("bad argument for %s: '%s'", env_append_opt, arg); } new_value = lt_extend_str (getenv (name), value, 1); lt_setenv (name, new_value); XFREE (new_value); XFREE (name); XFREE (value); } void lt_update_exe_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_exe_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); /* some systems can't cope with a ':'-terminated path #' */ int len = strlen (new_value); while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1])) { new_value[len-1] = '\0'; } lt_setenv (name, new_value); XFREE (new_value); } } void lt_update_lib_path (const char *name, const char *value) { LTWRAPPER_DEBUGPRINTF (("(lt_update_lib_path) modifying '%s' by prepending '%s'\n", (name ? name : ""), (value ? value : ""))); if (name && *name && value && *value) { char *new_value = lt_extend_str (getenv (name), value, 0); lt_setenv (name, new_value); XFREE (new_value); } } EOF } # end: func_emit_cwrapperexe_src # func_mode_link arg... func_mode_link () { $opt_debug case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) # It is impossible to link a dll without this setting, and # we shouldn't force the makefile maintainer to figure out # which system we are compiling for in order to pass an extra # flag for every libtool invocation. # allow_undefined=no # FIXME: Unfortunately, there are problems with the above when trying # to make a dll which has undefined symbols, in which case not # even a static library is built. For now, we need to specify # -no-undefined on the libtool link line when we can be certain # that all symbols are satisfied, otherwise we get a static library. allow_undefined=yes ;; *) allow_undefined=yes ;; esac libtool_args=$nonopt base_compile="$nonopt $@" compile_command=$nonopt finalize_command=$nonopt compile_rpath= finalize_rpath= compile_shlibpath= finalize_shlibpath= convenience= old_convenience= deplibs= old_deplibs= compiler_flags= linker_flags= dllsearchpath= lib_search_path=`pwd` inst_prefix_dir= new_inherited_linker_flags= avoid_version=no dlfiles= dlprefiles= dlself=no export_dynamic=no export_symbols= export_symbols_regex= generated= libobjs= ltlibs= module=no no_install=no objs= non_pic_objects= precious_files_regex= prefer_static_libs=no preload=no prev= prevarg= release= rpath= xrpath= perm_rpath= temp_rpath= thread_safe=no vinfo= vinfo_number=no weak_libs= single_module="${wl}-single_module" func_infer_tag $base_compile # We need to know -static, to get the right output filenames. for arg do case $arg in -shared) test "$build_libtool_libs" != yes && \ func_fatal_configuration "can not build a shared library" build_old_libs=no break ;; -all-static | -static | -static-libtool-libs) case $arg in -all-static) if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then func_warning "complete static linking is impossible in this configuration" fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; -static) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=built ;; -static-libtool-libs) if test -z "$pic_flag" && test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static fi prefer_static_libs=yes ;; esac build_libtool_libs=no build_old_libs=yes break ;; esac done # See if our shared archives depend on static archives. test -n "$old_archive_from_new_cmds" && build_old_libs=yes # Go through the arguments, transforming them on the way. while test "$#" -gt 0; do arg="$1" shift func_quote_for_eval "$arg" qarg=$func_quote_for_eval_unquoted_result func_append libtool_args " $func_quote_for_eval_result" # If the previous option needs an argument, assign it. if test -n "$prev"; then case $prev in output) func_append compile_command " @OUTPUT@" func_append finalize_command " @OUTPUT@" ;; esac case $prev in dlfiles|dlprefiles) if test "$preload" = no; then # Add the symbol object into the linking commands. func_append compile_command " @SYMFILE@" func_append finalize_command " @SYMFILE@" preload=yes fi case $arg in *.la | *.lo) ;; # We handle these cases below. force) if test "$dlself" = no; then dlself=needless export_dynamic=yes fi prev= continue ;; self) if test "$prev" = dlprefiles; then dlself=yes elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then dlself=yes else dlself=needless export_dynamic=yes fi prev= continue ;; *) if test "$prev" = dlfiles; then dlfiles="$dlfiles $arg" else dlprefiles="$dlprefiles $arg" fi prev= continue ;; esac ;; expsyms) export_symbols="$arg" test -f "$arg" \ || func_fatal_error "symbol file \`$arg' does not exist" prev= continue ;; expsyms_regex) export_symbols_regex="$arg" prev= continue ;; framework) case $host in *-*-darwin*) case "$deplibs " in *" $qarg.ltframework "*) ;; *) deplibs="$deplibs $qarg.ltframework" # this is fixed later ;; esac ;; esac prev= continue ;; inst_prefix) inst_prefix_dir="$arg" prev= continue ;; objectlist) if test -f "$arg"; then save_arg=$arg moreargs= for fil in `cat "$save_arg"` do # moreargs="$moreargs $fil" arg=$fil # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi done else func_fatal_error "link input file \`$arg' does not exist" fi arg=$save_arg prev= continue ;; precious_regex) precious_files_regex="$arg" prev= continue ;; release) release="-$arg" prev= continue ;; rpath | xrpath) # We need an absolute path. case $arg in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac if test "$prev" = rpath; then case "$rpath " in *" $arg "*) ;; *) rpath="$rpath $arg" ;; esac else case "$xrpath " in *" $arg "*) ;; *) xrpath="$xrpath $arg" ;; esac fi prev= continue ;; shrext) shrext_cmds="$arg" prev= continue ;; weak) weak_libs="$weak_libs $arg" prev= continue ;; xcclinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xcompiler) compiler_flags="$compiler_flags $qarg" prev= func_append compile_command " $qarg" func_append finalize_command " $qarg" continue ;; xlinker) linker_flags="$linker_flags $qarg" compiler_flags="$compiler_flags $wl$qarg" prev= func_append compile_command " $wl$qarg" func_append finalize_command " $wl$qarg" continue ;; *) eval "$prev=\"\$arg\"" prev= continue ;; esac fi # test -n "$prev" prevarg="$arg" case $arg in -all-static) if test -n "$link_static_flag"; then # See comment for -static flag below, for more details. func_append compile_command " $link_static_flag" func_append finalize_command " $link_static_flag" fi continue ;; -allow-undefined) # FIXME: remove this flag sometime in the future. func_fatal_error "\`-allow-undefined' must not be used because it is the default" ;; -avoid-version) avoid_version=yes continue ;; -dlopen) prev=dlfiles continue ;; -dlpreopen) prev=dlprefiles continue ;; -export-dynamic) export_dynamic=yes continue ;; -export-symbols | -export-symbols-regex) if test -n "$export_symbols" || test -n "$export_symbols_regex"; then func_fatal_error "more than one -exported-symbols argument is not allowed" fi if test "X$arg" = "X-export-symbols"; then prev=expsyms else prev=expsyms_regex fi continue ;; -framework) prev=framework continue ;; -inst-prefix-dir) prev=inst_prefix continue ;; # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:* # so, if we see these flags be careful not to treat them like -L -L[A-Z][A-Z]*:*) case $with_gcc/$host in no/*-*-irix* | /*-*-irix*) func_append compile_command " $arg" func_append finalize_command " $arg" ;; esac continue ;; -L*) func_stripname '-L' '' "$arg" dir=$func_stripname_result if test -z "$dir"; then if test "$#" -gt 0; then func_fatal_error "require no space between \`-L' and \`$1'" else func_fatal_error "need path for \`-L' option" fi fi # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) absdir=`cd "$dir" && pwd` test -z "$absdir" && \ func_fatal_error "cannot determine absolute directory name of \`$dir'" dir="$absdir" ;; esac case "$deplibs " in *" -L$dir "*) ;; *) deplibs="$deplibs -L$dir" lib_search_path="$lib_search_path $dir" ;; esac case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`$ECHO "X$dir" | $Xsed -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$dir:"*) ;; ::) dllsearchpath=$dir;; *) dllsearchpath="$dllsearchpath:$dir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac continue ;; -l*) if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc*) # These systems don't actually have a C or math library (as such) continue ;; *-*-os2*) # These systems don't actually have a C library (as such) test "X$arg" = "X-lc" && continue ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. test "X$arg" = "X-lc" && continue ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C and math libraries are in the System framework deplibs="$deplibs System.ltframework" continue ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype test "X$arg" = "X-lc" && continue ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work test "X$arg" = "X-lc" && continue ;; esac elif test "X$arg" = "X-lc_r"; then case $host in *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc_r directly, use -pthread flag. continue ;; esac fi deplibs="$deplibs $arg" continue ;; -module) module=yes continue ;; # Tru64 UNIX uses -model [arg] to determine the layout of C++ # classes, name mangling, and exception handling. # Darwin uses the -arch flag to determine output architecture. -model|-arch|-isysroot) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" prev=xcompiler continue ;; -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) compiler_flags="$compiler_flags $arg" func_append compile_command " $arg" func_append finalize_command " $arg" case "$new_inherited_linker_flags " in *" $arg "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;; esac continue ;; -multi_module) single_module="${wl}-multi_module" continue ;; -no-fast-install) fast_install=no continue ;; -no-install) case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*) # The PATH hackery in wrapper scripts is required on Windows # and Darwin in order for the loader to find any dlls it needs. func_warning "\`-no-install' is ignored for $host" func_warning "assuming \`-no-fast-install' instead" fast_install=no ;; *) no_install=yes ;; esac continue ;; -no-undefined) allow_undefined=no continue ;; -objectlist) prev=objectlist continue ;; -o) prev=output ;; -precious-files-regex) prev=precious_regex continue ;; -release) prev=release continue ;; -rpath) prev=rpath continue ;; -R) prev=xrpath continue ;; -R*) func_stripname '-R' '' "$arg" dir=$func_stripname_result # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) ;; *) func_fatal_error "only absolute run-paths are allowed" ;; esac case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac continue ;; -shared) # The effects of -shared are defined in a previous loop. continue ;; -shrext) prev=shrext continue ;; -static | -static-libtool-libs) # The effects of -static are defined in a previous loop. # We used to do the same as -all-static on platforms that # didn't have a PIC flag, but the assumption that the effects # would be equivalent was wrong. It would break on at least # Digital Unix and AIX. continue ;; -thread-safe) thread_safe=yes continue ;; -version-info) prev=vinfo continue ;; -version-number) prev=vinfo vinfo_number=yes continue ;; -weak) prev=weak continue ;; -Wc,*) func_stripname '-Wc,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Wl,*) func_stripname '-Wl,' '' "$arg" args=$func_stripname_result arg= save_ifs="$IFS"; IFS=',' for flag in $args; do IFS="$save_ifs" func_quote_for_eval "$flag" arg="$arg $wl$func_quote_for_eval_result" compiler_flags="$compiler_flags $wl$func_quote_for_eval_result" linker_flags="$linker_flags $func_quote_for_eval_result" done IFS="$save_ifs" func_stripname ' ' '' "$arg" arg=$func_stripname_result ;; -Xcompiler) prev=xcompiler continue ;; -Xlinker) prev=xlinker continue ;; -XCClinker) prev=xcclinker continue ;; # -msg_* for osf cc -msg_*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; # -64, -mips[0-9] enable 64-bit mode on the SGI compiler # -r[0-9][0-9]* specifies the processor on the SGI compiler # -xarch=*, -xtarget=* enable 64-bit mode on the Sun compiler # +DA*, +DD* enable 64-bit mode on the HP compiler # -q* pass through compiler args for the IBM compiler # -m*, -t[45]*, -txscale* pass through architecture-specific # compiler args for GCC # -F/path gives path to uninstalled frameworks, gcc on darwin # -p, -pg, --coverage, -fprofile-* pass through profiling flag for GCC # @file GCC response files -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" func_append compile_command " $arg" func_append finalize_command " $arg" compiler_flags="$compiler_flags $arg" continue ;; # Some other compiler flag. -* | +*) func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; *.$objext) # A standard object. objs="$objs $arg" ;; *.lo) # A libtool-controlled object. # Check to see that this really is a libtool object. if func_lalib_unsafe_p "$arg"; then pic_object= non_pic_object= # Read the .lo file func_source "$arg" if test -z "$pic_object" || test -z "$non_pic_object" || test "$pic_object" = none && test "$non_pic_object" = none; then func_fatal_error "cannot find name of object for \`$arg'" fi # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" if test "$pic_object" != none; then # Prepend the subdirectory the object is found in. pic_object="$xdir$pic_object" if test "$prev" = dlfiles; then if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then dlfiles="$dlfiles $pic_object" prev= continue else # If libtool objects are unsupported, then we need to preload. prev=dlprefiles fi fi # CHECK ME: I think I busted this. -Ossama if test "$prev" = dlprefiles; then # Preload the old-style object. dlprefiles="$dlprefiles $pic_object" prev= fi # A PIC object. func_append libobjs " $pic_object" arg="$pic_object" fi # Non-PIC object. if test "$non_pic_object" != none; then # Prepend the subdirectory the object is found in. non_pic_object="$xdir$non_pic_object" # A standard non-PIC object func_append non_pic_objects " $non_pic_object" if test -z "$pic_object" || test "$pic_object" = none ; then arg="$non_pic_object" fi else # If the PIC object exists, use it instead. # $xdir was prepended to $pic_object above. non_pic_object="$pic_object" func_append non_pic_objects " $non_pic_object" fi else # Only an error if not doing a dry-run. if $opt_dry_run; then # Extract subdirectory from the argument. func_dirname "$arg" "/" "" xdir="$func_dirname_result" func_lo2o "$arg" pic_object=$xdir$objdir/$func_lo2o_result non_pic_object=$xdir$func_lo2o_result func_append libobjs " $pic_object" func_append non_pic_objects " $non_pic_object" else func_fatal_error "\`$arg' is not a valid libtool object" fi fi ;; *.$libext) # An archive. deplibs="$deplibs $arg" old_deplibs="$old_deplibs $arg" continue ;; *.la) # A libtool-controlled library. if test "$prev" = dlfiles; then # This library was specified with -dlopen. dlfiles="$dlfiles $arg" prev= elif test "$prev" = dlprefiles; then # The library was specified with -dlpreopen. dlprefiles="$dlprefiles $arg" prev= else deplibs="$deplibs $arg" fi continue ;; # Some other compiler argument. *) # Unknown arguments in both finalize_command and compile_command need # to be aesthetically quoted because they are evaled later. func_quote_for_eval "$arg" arg="$func_quote_for_eval_result" ;; esac # arg # Now actually substitute the argument into the commands. if test -n "$arg"; then func_append compile_command " $arg" func_append finalize_command " $arg" fi done # argument parsing loop test -n "$prev" && \ func_fatal_help "the \`$prevarg' option requires an argument" if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then eval arg=\"$export_dynamic_flag_spec\" func_append compile_command " $arg" func_append finalize_command " $arg" fi oldlibs= # calculate the name of the file, without its directory func_basename "$output" outputname="$func_basename_result" libobjs_save="$libobjs" if test -n "$shlibpath_var"; then # get the directories listed in $shlibpath_var eval shlib_search_path=\`\$ECHO \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` else shlib_search_path= fi eval sys_lib_search_path=\"$sys_lib_search_path_spec\" eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" func_dirname "$output" "/" "" output_objdir="$func_dirname_result$objdir" # Create the object directory. func_mkdir_p "$output_objdir" # Determine the type of output case $output in "") func_fatal_help "you must specify an output file" ;; *.$libext) linkmode=oldlib ;; *.lo | *.$objext) linkmode=obj ;; *.la) linkmode=lib ;; *) linkmode=prog ;; # Anything else should be a program. esac specialdeplibs= libs= # Find all interdependent deplibs by searching for libraries # that are linked more than once (e.g. -la -lb -la) for deplib in $deplibs; do if $opt_duplicate_deps ; then case "$libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi libs="$libs $deplib" done if test "$linkmode" = lib; then libs="$predeps $libs $compiler_lib_search_path $postdeps" # Compute libraries that are listed more than once in $predeps # $postdeps and mark them as special (i.e., whose duplicates are # not to be eliminated). pre_post_deps= if $opt_duplicate_compiler_generated_deps; then for pre_post_dep in $predeps $postdeps; do case "$pre_post_deps " in *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;; esac pre_post_deps="$pre_post_deps $pre_post_dep" done fi pre_post_deps= fi deplibs= newdependency_libs= newlib_search_path= need_relink=no # whether we're linking any uninstalled libtool libraries notinst_deplibs= # not-installed libtool libraries notinst_path= # paths that contain not-installed libtool libraries case $linkmode in lib) passes="conv dlpreopen link" for file in $dlfiles $dlprefiles; do case $file in *.la) ;; *) func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file" ;; esac done ;; prog) compile_deplibs= finalize_deplibs= alldeplibs=no newdlfiles= newdlprefiles= passes="conv scan dlopen dlpreopen link" ;; *) passes="conv" ;; esac for pass in $passes; do # The preopen pass in lib mode reverses $deplibs; put it back here # so that -L comes before libs that need it for instance... if test "$linkmode,$pass" = "lib,link"; then ## FIXME: Find the place where the list is rebuilt in the wrong ## order, and fix it there properly tmp_deplibs= for deplib in $deplibs; do tmp_deplibs="$deplib $tmp_deplibs" done deplibs="$tmp_deplibs" fi if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan"; then libs="$deplibs" deplibs= fi if test "$linkmode" = prog; then case $pass in dlopen) libs="$dlfiles" ;; dlpreopen) libs="$dlprefiles" ;; link) libs="$deplibs %DEPLIBS% $dependency_libs" ;; esac fi if test "$linkmode,$pass" = "lib,dlpreopen"; then # Collect and forward deplibs of preopened libtool libs for lib in $dlprefiles; do # Ignore non-libtool-libs dependency_libs= case $lib in *.la) func_source "$lib" ;; esac # Collect preopened libtool deplibs, except any this library # has declared as weak libs for deplib in $dependency_libs; do deplib_base=`$ECHO "X$deplib" | $Xsed -e "$basename"` case " $weak_libs " in *" $deplib_base "*) ;; *) deplibs="$deplibs $deplib" ;; esac done done libs="$dlprefiles" fi if test "$pass" = dlopen; then # Collect dlpreopened libraries save_deplibs="$deplibs" deplibs= fi for deplib in $libs; do lib= found=no case $deplib in -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else compiler_flags="$compiler_flags $deplib" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -l*) if test "$linkmode" != lib && test "$linkmode" != prog; then func_warning "\`-l' is ignored for archives/objects" continue fi func_stripname '-l' '' "$deplib" name=$func_stripname_result if test "$linkmode" = lib; then searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path" else searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path" fi for searchdir in $searchdirs; do for search_ext in .la $std_shrext .so .a; do # Search the libtool library lib="$searchdir/lib${name}${search_ext}" if test -f "$lib"; then if test "$search_ext" = ".la"; then found=yes else found=no fi break 2 fi done done if test "$found" != yes; then # deplib doesn't seem to be a libtool library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue else # deplib is a libtool library # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib, # We need to do some special things here, and not later. if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $deplib "*) if func_lalib_p "$lib"; then library_names= old_library= func_source "$lib" for l in $old_library $library_names; do ll="$l" done if test "X$ll" = "X$old_library" ; then # only static version available found=no func_dirname "$lib" "" "." ladir="$func_dirname_result" lib=$ladir/$old_library if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs" fi continue fi fi ;; *) ;; esac fi fi ;; # -l *.ltframework) if test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else deplibs="$deplib $deplibs" if test "$linkmode" = lib ; then case "$new_inherited_linker_flags " in *" $deplib "*) ;; * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;; esac fi fi continue ;; -L*) case $linkmode in lib) deplibs="$deplib $deplibs" test "$pass" = conv && continue newdependency_libs="$deplib $newdependency_libs" func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; prog) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi if test "$pass" = scan; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; *) func_warning "\`-L' is ignored for archives/objects" ;; esac # linkmode continue ;; # -L -R*) if test "$pass" = link; then func_stripname '-R' '' "$deplib" dir=$func_stripname_result # Make sure the xrpath contains only unique directories. case "$xrpath " in *" $dir "*) ;; *) xrpath="$xrpath $dir" ;; esac fi deplibs="$deplib $deplibs" continue ;; *.la) lib="$deplib" ;; *.$libext) if test "$pass" = conv; then deplibs="$deplib $deplibs" continue fi case $linkmode in lib) # Linking convenience modules into shared libraries is allowed, # but linking other static libraries is non-portable. case " $dlpreconveniencelibs " in *" $deplib "*) ;; *) valid_a_lib=no case $deplibs_check_method in match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` if eval "\$ECHO \"X$deplib\"" 2>/dev/null | $Xsed -e 10q \ | $EGREP "$match_pattern_regex" > /dev/null; then valid_a_lib=yes fi ;; pass_all) valid_a_lib=yes ;; esac if test "$valid_a_lib" != yes; then $ECHO $ECHO "*** Warning: Trying to link with static lib archive $deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because the file extensions .$libext of this argument makes me believe" $ECHO "*** that it is just a static archive that I should not use here." else $ECHO $ECHO "*** Warning: Linking the shared library $output against the" $ECHO "*** static library $deplib is not portable!" deplibs="$deplib $deplibs" fi ;; esac continue ;; prog) if test "$pass" != link; then deplibs="$deplib $deplibs" else compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" fi continue ;; esac # linkmode ;; # *.$libext *.lo | *.$objext) if test "$pass" = conv; then deplibs="$deplib $deplibs" elif test "$linkmode" = prog; then if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlopen support or we're linking statically, # we need to preload. newdlprefiles="$newdlprefiles $deplib" compile_deplibs="$deplib $compile_deplibs" finalize_deplibs="$deplib $finalize_deplibs" else newdlfiles="$newdlfiles $deplib" fi fi continue ;; %DEPLIBS%) alldeplibs=yes continue ;; esac # case $deplib if test "$found" = yes || test -f "$lib"; then : else func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'" fi # Check to see that this really is a libtool archive. func_lalib_unsafe_p "$lib" \ || func_fatal_error "\`$lib' is not a valid libtool archive" func_dirname "$lib" "" "." ladir="$func_dirname_result" dlname= dlopen= dlpreopen= libdir= library_names= old_library= inherited_linker_flags= # If the library was installed with an old release of libtool, # it will not redefine variables installed, or shouldnotlink installed=yes shouldnotlink=no avoidtemprpath= # Read the .la file func_source "$lib" # Convert "-framework foo" to "foo.ltframework" if test -n "$inherited_linker_flags"; then tmp_inherited_linker_flags=`$ECHO "X$inherited_linker_flags" | $Xsed -e 's/-framework \([^ $]*\)/\1.ltframework/g'` for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do case " $new_inherited_linker_flags " in *" $tmp_inherited_linker_flag "*) ;; *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";; esac done fi dependency_libs=`$ECHO "X $dependency_libs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` if test "$linkmode,$pass" = "lib,link" || test "$linkmode,$pass" = "prog,scan" || { test "$linkmode" != prog && test "$linkmode" != lib; }; then test -n "$dlopen" && dlfiles="$dlfiles $dlopen" test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen" fi if test "$pass" = conv; then # Only check for convenience libraries deplibs="$lib $deplibs" if test -z "$libdir"; then if test -z "$old_library"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # It is a libtool convenience library, so add in its objects. convenience="$convenience $ladir/$objdir/$old_library" old_convenience="$old_convenience $ladir/$objdir/$old_library" elif test "$linkmode" != prog && test "$linkmode" != lib; then func_fatal_error "\`$lib' is not a convenience library" fi tmp_libs= for deplib in $dependency_libs; do deplibs="$deplib $deplibs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done continue fi # $pass = conv # Get the name of the library we link against. linklib= for l in $old_library $library_names; do linklib="$l" done if test -z "$linklib"; then func_fatal_error "cannot find name of link library for \`$lib'" fi # This library was specified with -dlopen. if test "$pass" = dlopen; then if test -z "$libdir"; then func_fatal_error "cannot -dlopen a convenience library: \`$lib'" fi if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then # If there is no dlname, no dlopen support or we're linking # statically, we need to preload. We also need to preload any # dependent libraries so libltdl's deplib preloader doesn't # bomb out in the load deplibs phase. dlprefiles="$dlprefiles $lib $dependency_libs" else newdlfiles="$newdlfiles $lib" fi continue fi # $pass = dlopen # We need an absolute path. case $ladir in [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;; *) abs_ladir=`cd "$ladir" && pwd` if test -z "$abs_ladir"; then func_warning "cannot determine absolute directory name of \`$ladir'" func_warning "passing it literally to the linker, although it might fail" abs_ladir="$ladir" fi ;; esac func_basename "$lib" laname="$func_basename_result" # Find the relevant object directory and library name. if test "X$installed" = Xyes; then if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then func_warning "library \`$lib' was moved." dir="$ladir" absdir="$abs_ladir" libdir="$abs_ladir" else dir="$libdir" absdir="$libdir" fi test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes else if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then dir="$ladir" absdir="$abs_ladir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" else dir="$ladir/$objdir" absdir="$abs_ladir/$objdir" # Remove this search path later notinst_path="$notinst_path $abs_ladir" fi fi # $installed = yes func_stripname 'lib' '.la' "$laname" name=$func_stripname_result # This library was specified with -dlpreopen. if test "$pass" = dlpreopen; then if test -z "$libdir" && test "$linkmode" = prog; then func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'" fi # Prefer using a static library (so that no silly _DYNAMIC symbols # are required to link). if test -n "$old_library"; then newdlprefiles="$newdlprefiles $dir/$old_library" # Keep a list of preopened convenience libraries to check # that they are being used correctly in the link pass. test -z "$libdir" && \ dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library" # Otherwise, use the dlname, so that lt_dlopen finds it. elif test -n "$dlname"; then newdlprefiles="$newdlprefiles $dir/$dlname" else newdlprefiles="$newdlprefiles $dir/$linklib" fi fi # $pass = dlpreopen if test -z "$libdir"; then # Link the convenience library if test "$linkmode" = lib; then deplibs="$dir/$old_library $deplibs" elif test "$linkmode,$pass" = "prog,link"; then compile_deplibs="$dir/$old_library $compile_deplibs" finalize_deplibs="$dir/$old_library $finalize_deplibs" else deplibs="$lib $deplibs" # used for prog,scan pass fi continue fi if test "$linkmode" = prog && test "$pass" != link; then newlib_search_path="$newlib_search_path $ladir" deplibs="$lib $deplibs" linkalldeplibs=no if test "$link_all_deplibs" != no || test -z "$library_names" || test "$build_libtool_libs" = no; then linkalldeplibs=yes fi tmp_libs= for deplib in $dependency_libs; do case $deplib in -L*) func_stripname '-L' '' "$deplib" newlib_search_path="$newlib_search_path $func_stripname_result" ;; esac # Need to link against all dependency_libs? if test "$linkalldeplibs" = yes; then deplibs="$deplib $deplibs" else # Need to hardcode shared library paths # or/and link against static libraries newdependency_libs="$deplib $newdependency_libs" fi if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done # for deplib continue fi # $linkmode = prog... if test "$linkmode,$pass" = "prog,link"; then if test -n "$library_names" && { { test "$prefer_static_libs" = no || test "$prefer_static_libs,$installed" = "built,yes"; } || test -z "$old_library"; }; then # We need to hardcode the library path if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then # Make sure the rpath contains only unique directories. case "$temp_rpath:" in *"$absdir:"*) ;; *) temp_rpath="$temp_rpath$absdir:" ;; esac fi # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi # $linkmode,$pass = prog,link... if test "$alldeplibs" = yes && { test "$deplibs_check_method" = pass_all || { test "$build_libtool_libs" = yes && test -n "$library_names"; }; }; then # We only need to search for static libraries continue fi fi link_static=no # Whether the deplib will be linked statically use_static_libs=$prefer_static_libs if test "$use_static_libs" = built && test "$installed" = yes; then use_static_libs=no fi if test -n "$library_names" && { test "$use_static_libs" = no || test -z "$old_library"; }; then case $host in *cygwin* | *mingw* | *cegcc*) # No point in relinking DLLs because paths are not encoded notinst_deplibs="$notinst_deplibs $lib" need_relink=no ;; *) if test "$installed" = no; then notinst_deplibs="$notinst_deplibs $lib" need_relink=yes fi ;; esac # This is a shared library # Warn about portability, can't link against -module's on some # systems (darwin). Don't bleat about dlopened modules though! dlopenmodule="" for dlpremoduletest in $dlprefiles; do if test "X$dlpremoduletest" = "X$lib"; then dlopenmodule="$dlpremoduletest" break fi done if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then $ECHO if test "$linkmode" = prog; then $ECHO "*** Warning: Linking the executable $output against the loadable module" else $ECHO "*** Warning: Linking the shared library $output against the loadable module" fi $ECHO "*** $linklib is not portable!" fi if test "$linkmode" = lib && test "$hardcode_into_libs" = yes; then # Hardcode the library path. # Skip directories that are in the system default run-time # search path. case " $sys_lib_dlsearch_path " in *" $absdir "*) ;; *) case "$compile_rpath " in *" $absdir "*) ;; *) compile_rpath="$compile_rpath $absdir" esac ;; esac case " $sys_lib_dlsearch_path " in *" $libdir "*) ;; *) case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" esac ;; esac fi if test -n "$old_archive_from_expsyms_cmds"; then # figure out the soname set dummy $library_names shift realname="$1" shift libname=`eval "\\$ECHO \"$libname_spec\""` # use dlname if we got it. it's perfectly good, no? if test -n "$dlname"; then soname="$dlname" elif test -n "$soname_spec"; then # bleh windows case $host in *cygwin* | mingw* | *cegcc*) func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; esac eval soname=\"$soname_spec\" else soname="$realname" fi # Make a new name for the extract_expsyms_cmds to use soroot="$soname" func_basename "$soroot" soname="$func_basename_result" func_stripname 'lib' '.dll' "$soname" newlib=libimp-$func_stripname_result.a # If the library has no export list, then create one now if test -f "$output_objdir/$soname-def"; then : else func_verbose "extracting exported symbol list from \`$soname'" func_execute_cmds "$extract_expsyms_cmds" 'exit $?' fi # Create $newlib if test -f "$output_objdir/$newlib"; then :; else func_verbose "generating import library for \`$soname'" func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?' fi # make sure the library variables are pointing to the new library dir=$output_objdir linklib=$newlib fi # test -n "$old_archive_from_expsyms_cmds" if test "$linkmode" = prog || test "$mode" != relink; then add_shlibpath= add_dir= add= lib_linked=yes case $hardcode_action in immediate | unsupported) if test "$hardcode_direct" = no; then add="$dir/$linklib" case $host in *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;; *-*-sysv4*uw2*) add_dir="-L$dir" ;; *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \ *-*-unixware7*) add_dir="-L$dir" ;; *-*-darwin* ) # if the lib is a (non-dlopened) module then we can not # link against it, someone is ignoring the earlier warnings if /usr/bin/file -L $add 2> /dev/null | $GREP ": [^:]* bundle" >/dev/null ; then if test "X$dlopenmodule" != "X$lib"; then $ECHO "*** Warning: lib $linklib is a module, not a shared library" if test -z "$old_library" ; then $ECHO $ECHO "*** And there doesn't seem to be a static archive available" $ECHO "*** The link will probably fail, sorry" else add="$dir/$old_library" fi elif test -n "$old_library"; then add="$dir/$old_library" fi fi esac elif test "$hardcode_minus_L" = no; then case $host in *-*-sunos*) add_shlibpath="$dir" ;; esac add_dir="-L$dir" add="-l$name" elif test "$hardcode_shlibpath_var" = no; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; relink) if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$dir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$dir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then add_shlibpath="$dir" add="-l$name" else lib_linked=no fi ;; *) lib_linked=no ;; esac if test "$lib_linked" != yes; then func_fatal_configuration "unsupported hardcode properties" fi if test -n "$add_shlibpath"; then case :$compile_shlibpath: in *":$add_shlibpath:"*) ;; *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;; esac fi if test "$linkmode" = prog; then test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs" test -n "$add" && compile_deplibs="$add $compile_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" if test "$hardcode_direct" != yes && test "$hardcode_minus_L" != yes && test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac fi fi fi if test "$linkmode" = prog || test "$mode" = relink; then add_shlibpath= add_dir= add= # Finalize command for both is simple: just hardcode it. if test "$hardcode_direct" = yes && test "$hardcode_direct_absolute" = no; then add="$libdir/$linklib" elif test "$hardcode_minus_L" = yes; then add_dir="-L$libdir" add="-l$name" elif test "$hardcode_shlibpath_var" = yes; then case :$finalize_shlibpath: in *":$libdir:"*) ;; *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;; esac add="-l$name" elif test "$hardcode_automatic" = yes; then if test -n "$inst_prefix_dir" && test -f "$inst_prefix_dir$libdir/$linklib" ; then add="$inst_prefix_dir$libdir/$linklib" else add="$libdir/$linklib" fi else # We cannot seem to hardcode it, guess we'll fake it. add_dir="-L$libdir" # Try looking first in the location we're being installed to. if test -n "$inst_prefix_dir"; then case $libdir in [\\/]*) add_dir="$add_dir -L$inst_prefix_dir$libdir" ;; esac fi add="-l$name" fi if test "$linkmode" = prog; then test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs" test -n "$add" && finalize_deplibs="$add $finalize_deplibs" else test -n "$add_dir" && deplibs="$add_dir $deplibs" test -n "$add" && deplibs="$add $deplibs" fi fi elif test "$linkmode" = prog; then # Here we assume that one of hardcode_direct or hardcode_minus_L # is not unsupported. This is valid on all known static and # shared platforms. if test "$hardcode_direct" != unsupported; then test -n "$old_library" && linklib="$old_library" compile_deplibs="$dir/$linklib $compile_deplibs" finalize_deplibs="$dir/$linklib $finalize_deplibs" else compile_deplibs="-l$name -L$dir $compile_deplibs" finalize_deplibs="-l$name -L$dir $finalize_deplibs" fi elif test "$build_libtool_libs" = yes; then # Not a shared library if test "$deplibs_check_method" != pass_all; then # We're trying link a shared library against a static one # but the system doesn't support it. # Just print a warning and add the library to dependency_libs so # that the program can be linked against the static library. $ECHO $ECHO "*** Warning: This system can not link to static lib archive $lib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have." if test "$module" = yes; then $ECHO "*** But as you try to build a module library, libtool will still create " $ECHO "*** a static module, that should work as long as the dlopening application" $ECHO "*** is linked with the -dlopen flag to resolve symbols at runtime." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi else deplibs="$dir/$old_library $deplibs" link_static=yes fi fi # link shared/static library? if test "$linkmode" = lib; then if test -n "$dependency_libs" && { test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes || test "$link_static" = yes; }; then # Extract -R from dependency_libs temp_deplibs= for libdir in $dependency_libs; do case $libdir in -R*) func_stripname '-R' '' "$libdir" temp_xrpath=$func_stripname_result case " $xrpath " in *" $temp_xrpath "*) ;; *) xrpath="$xrpath $temp_xrpath";; esac;; *) temp_deplibs="$temp_deplibs $libdir";; esac done dependency_libs="$temp_deplibs" fi newlib_search_path="$newlib_search_path $absdir" # Link against this library test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs" # ... and its dependency_libs tmp_libs= for deplib in $dependency_libs; do newdependency_libs="$deplib $newdependency_libs" if $opt_duplicate_deps ; then case "$tmp_libs " in *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;; esac fi tmp_libs="$tmp_libs $deplib" done if test "$link_all_deplibs" != no; then # Add the search paths of all dependency libraries for deplib in $dependency_libs; do case $deplib in -L*) path="$deplib" ;; *.la) func_dirname "$deplib" "" "." dir="$func_dirname_result" # We need an absolute path. case $dir in [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;; *) absdir=`cd "$dir" && pwd` if test -z "$absdir"; then func_warning "cannot determine absolute directory name of \`$dir'" absdir="$dir" fi ;; esac if $GREP "^installed=no" $deplib > /dev/null; then case $host in *-*-darwin*) depdepl= eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib` if test -n "$deplibrary_names" ; then for tmp in $deplibrary_names ; do depdepl=$tmp done if test -f "$absdir/$objdir/$depdepl" ; then depdepl="$absdir/$objdir/$depdepl" darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` if test -z "$darwin_install_name"; then darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'` fi compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}" linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}" path= fi fi ;; *) path="-L$absdir/$objdir" ;; esac else eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" test "$absdir" != "$libdir" && \ func_warning "\`$deplib' seems to be moved" path="-L$absdir" fi ;; esac case " $deplibs " in *" $path "*) ;; *) deplibs="$path $deplibs" ;; esac done fi # link_all_deplibs != no fi # linkmode = lib done # for deplib in $libs if test "$pass" = link; then if test "$linkmode" = "prog"; then compile_deplibs="$new_inherited_linker_flags $compile_deplibs" finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs" else compiler_flags="$compiler_flags "`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` fi fi dependency_libs="$newdependency_libs" if test "$pass" = dlpreopen; then # Link the dlpreopened libraries before other libraries for deplib in $save_deplibs; do deplibs="$deplib $deplibs" done fi if test "$pass" != dlopen; then if test "$pass" != conv; then # Make sure lib_search_path contains only unique directories. lib_search_path= for dir in $newlib_search_path; do case "$lib_search_path " in *" $dir "*) ;; *) lib_search_path="$lib_search_path $dir" ;; esac done newlib_search_path= fi if test "$linkmode,$pass" != "prog,link"; then vars="deplibs" else vars="compile_deplibs finalize_deplibs" fi for var in $vars dependency_libs; do # Add libraries to $var in reverse order eval tmp_libs=\"\$$var\" new_libs= for deplib in $tmp_libs; do # FIXME: Pedantically, this is the right thing to do, so # that some nasty dependency loop isn't accidentally # broken: #new_libs="$deplib $new_libs" # Pragmatically, this seems to cause very few problems in # practice: case $deplib in -L*) new_libs="$deplib $new_libs" ;; -R*) ;; *) # And here is the reason: when a library appears more # than once as an explicit dependence of a library, or # is implicitly linked in more than once by the # compiler, it is considered special, and multiple # occurrences thereof are not removed. Compare this # with having the same library being listed as a # dependency of multiple other libraries: in this case, # we know (pedantically, we assume) the library does not # need to be listed more than once, so we keep only the # last copy. This is not always right, but it is rare # enough that we require users that really mean to play # such unportable linking tricks to link the library # using -Wl,-lname, so that libtool does not consider it # for duplicate removal. case " $specialdeplibs " in *" $deplib "*) new_libs="$deplib $new_libs" ;; *) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$deplib $new_libs" ;; esac ;; esac ;; esac done tmp_libs= for deplib in $new_libs; do case $deplib in -L*) case " $tmp_libs " in *" $deplib "*) ;; *) tmp_libs="$tmp_libs $deplib" ;; esac ;; *) tmp_libs="$tmp_libs $deplib" ;; esac done eval $var=\"$tmp_libs\" done # for var fi # Last step: remove runtime libs from dependency_libs # (they stay in deplibs) tmp_libs= for i in $dependency_libs ; do case " $predeps $postdeps $compiler_lib_search_path " in *" $i "*) i="" ;; esac if test -n "$i" ; then tmp_libs="$tmp_libs $i" fi done dependency_libs=$tmp_libs done # for pass if test "$linkmode" = prog; then dlfiles="$newdlfiles" fi if test "$linkmode" = prog || test "$linkmode" = lib; then dlprefiles="$newdlprefiles" fi case $linkmode in oldlib) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for archives" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for archives" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for archives" test -n "$xrpath" && \ func_warning "\`-R' is ignored for archives" test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for archives" test -n "$release" && \ func_warning "\`-release' is ignored for archives" test -n "$export_symbols$export_symbols_regex" && \ func_warning "\`-export-symbols' is ignored for archives" # Now set the variables for building old libraries. build_libtool_libs=no oldlibs="$output" objs="$objs$old_deplibs" ;; lib) # Make sure we only generate libraries of the form `libNAME.la'. case $outputname in lib*) func_stripname 'lib' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" ;; *) test "$module" = no && \ func_fatal_help "libtool library \`$output' must begin with \`lib'" if test "$need_lib_prefix" != no; then # Add the "lib" prefix for modules if required func_stripname '' '.la' "$outputname" name=$func_stripname_result eval shared_ext=\"$shrext_cmds\" eval libname=\"$libname_spec\" else func_stripname '' '.la' "$outputname" libname=$func_stripname_result fi ;; esac if test -n "$objs"; then if test "$deplibs_check_method" != pass_all; then func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs" else $ECHO $ECHO "*** Warning: Linking the shared library $output against the non-libtool" $ECHO "*** objects $objs is not portable!" libobjs="$libobjs $objs" fi fi test "$dlself" != no && \ func_warning "\`-dlopen self' is ignored for libtool libraries" set dummy $rpath shift test "$#" -gt 1 && \ func_warning "ignoring multiple \`-rpath's for a libtool library" install_libdir="$1" oldlibs= if test -z "$rpath"; then if test "$build_libtool_libs" = yes; then # Building a libtool convenience library. # Some compilers have problems with a `.al' extension so # convenience libraries should have the same extension an # archive normally would. oldlibs="$output_objdir/$libname.$libext $oldlibs" build_libtool_libs=convenience build_old_libs=yes fi test -n "$vinfo" && \ func_warning "\`-version-info/-version-number' is ignored for convenience libraries" test -n "$release" && \ func_warning "\`-release' is ignored for convenience libraries" else # Parse the version information argument. save_ifs="$IFS"; IFS=':' set dummy $vinfo 0 0 0 shift IFS="$save_ifs" test -n "$7" && \ func_fatal_help "too many parameters to \`-version-info'" # convert absolute version numbers to libtool ages # this retains compatibility with .la files and attempts # to make the code below a bit more comprehensible case $vinfo_number in yes) number_major="$1" number_minor="$2" number_revision="$3" # # There are really only two kinds -- those that # use the current revision as the major version # and those that subtract age and use age as # a minor version. But, then there is irix # which has an extra 1 added just for fun # case $version_type in darwin|linux|osf|windows|none) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_revision" ;; freebsd-aout|freebsd-elf|sunos) current="$number_major" revision="$number_minor" age="0" ;; irix|nonstopux) func_arith $number_major + $number_minor current=$func_arith_result age="$number_minor" revision="$number_minor" lt_irix_increment=no ;; esac ;; no) current="$1" revision="$2" age="$3" ;; esac # Check that each of the things are valid numbers. case $current in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "CURRENT \`$current' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $revision in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "REVISION \`$revision' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac case $age in 0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;; *) func_error "AGE \`$age' must be a nonnegative integer" func_fatal_error "\`$vinfo' is not valid version information" ;; esac if test "$age" -gt "$current"; then func_error "AGE \`$age' is greater than the current interface number \`$current'" func_fatal_error "\`$vinfo' is not valid version information" fi # Calculate the version variables. major= versuffix= verstring= case $version_type in none) ;; darwin) # Like Linux, but with the current version available in # verstring for coding it into the library header func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" # Darwin ld doesn't like 0 for these options... func_arith $current + 1 minor_current=$func_arith_result xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision" verstring="-compatibility_version $minor_current -current_version $minor_current.$revision" ;; freebsd-aout) major=".$current" versuffix=".$current.$revision"; ;; freebsd-elf) major=".$current" versuffix=".$current" ;; irix | nonstopux) if test "X$lt_irix_increment" = "Xno"; then func_arith $current - $age else func_arith $current - $age + 1 fi major=$func_arith_result case $version_type in nonstopux) verstring_prefix=nonstopux ;; *) verstring_prefix=sgi ;; esac verstring="$verstring_prefix$major.$revision" # Add in all the interfaces that we are compatible with. loop=$revision while test "$loop" -ne 0; do func_arith $revision - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring_prefix$major.$iface:$verstring" done # Before this point, $major must not contain `.'. major=.$major versuffix="$major.$revision" ;; linux) func_arith $current - $age major=.$func_arith_result versuffix="$major.$age.$revision" ;; osf) func_arith $current - $age major=.$func_arith_result versuffix=".$current.$age.$revision" verstring="$current.$age.$revision" # Add in all the interfaces that we are compatible with. loop=$age while test "$loop" -ne 0; do func_arith $current - $loop iface=$func_arith_result func_arith $loop - 1 loop=$func_arith_result verstring="$verstring:${iface}.0" done # Make executables depend on our current version. verstring="$verstring:${current}.0" ;; qnx) major=".$current" versuffix=".$current" ;; sunos) major=".$current" versuffix=".$current.$revision" ;; windows) # Use '-' rather than '.', since we only want one # extension on DOS 8.3 filesystems. func_arith $current - $age major=$func_arith_result versuffix="-$major" ;; *) func_fatal_configuration "unknown library version type \`$version_type'" ;; esac # Clear the version info if we defaulted, and they specified a release. if test -z "$vinfo" && test -n "$release"; then major= case $version_type in darwin) # we can't check for "0.0" in archive_cmds due to quoting # problems, so we reset it completely verstring= ;; *) verstring="0.0" ;; esac if test "$need_version" = no; then versuffix= else versuffix=".0.0" fi fi # Remove version info from name if versioning should be avoided if test "$avoid_version" = yes && test "$need_version" = no; then major= versuffix= verstring="" fi # Check to see if the archive will have undefined symbols. if test "$allow_undefined" = yes; then if test "$allow_undefined_flag" = unsupported; then func_warning "undefined symbols not allowed in $host shared libraries" build_libtool_libs=no build_old_libs=yes fi else # Don't allow undefined symbols. allow_undefined_flag="$no_undefined_flag" fi fi func_generate_dlsyms "$libname" "$libname" "yes" libobjs="$libobjs $symfileobj" test "X$libobjs" = "X " && libobjs= if test "$mode" != relink; then # Remove our outputs, but don't remove object files since they # may have been created when compiling PIC objects. removelist= tempremovelist=`$ECHO "$output_objdir/*"` for p in $tempremovelist; do case $p in *.$objext | *.gcno) ;; $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*) if test "X$precious_files_regex" != "X"; then if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1 then continue fi fi removelist="$removelist $p" ;; *) ;; esac done test -n "$removelist" && \ func_show_eval "${RM}r \$removelist" fi # Now set the variables for building old libraries. if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then oldlibs="$oldlibs $output_objdir/$libname.$libext" # Transform .lo files to .o files. oldobjs="$objs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` fi # Eliminate all temporary directories. #for path in $notinst_path; do # lib_search_path=`$ECHO "X$lib_search_path " | $Xsed -e "s% $path % %g"` # deplibs=`$ECHO "X$deplibs " | $Xsed -e "s% -L$path % %g"` # dependency_libs=`$ECHO "X$dependency_libs " | $Xsed -e "s% -L$path % %g"` #done if test -n "$xrpath"; then # If the user specified any rpath flags, then add them. temp_xrpath= for libdir in $xrpath; do temp_xrpath="$temp_xrpath -R$libdir" case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then dependency_libs="$temp_xrpath $dependency_libs" fi fi # Make sure dlfiles contains only unique files that won't be dlpreopened old_dlfiles="$dlfiles" dlfiles= for lib in $old_dlfiles; do case " $dlprefiles $dlfiles " in *" $lib "*) ;; *) dlfiles="$dlfiles $lib" ;; esac done # Make sure dlprefiles contains only unique files old_dlprefiles="$dlprefiles" dlprefiles= for lib in $old_dlprefiles; do case "$dlprefiles " in *" $lib "*) ;; *) dlprefiles="$dlprefiles $lib" ;; esac done if test "$build_libtool_libs" = yes; then if test -n "$rpath"; then case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc*) # these systems don't actually have a c library (as such)! ;; *-*-rhapsody* | *-*-darwin1.[012]) # Rhapsody C library is in the System framework deplibs="$deplibs System.ltframework" ;; *-*-netbsd*) # Don't link with libc until the a.out ld.so is fixed. ;; *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*) # Do not include libc due to us having libc/libc_r. ;; *-*-sco3.2v5* | *-*-sco5v6*) # Causes problems with __ctype ;; *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*) # Compiler inserts libc in the correct place for threads to work ;; *) # Add libc to deplibs on all other systems if necessary. if test "$build_libtool_need_lc" = "yes"; then deplibs="$deplibs -lc" fi ;; esac fi # Transform deplibs into only deplibs that can be linked in shared. name_save=$name libname_save=$libname release_save=$release versuffix_save=$versuffix major_save=$major # I'm not sure if I'm treating the release correctly. I think # release should show up in the -l (ie -lgmp5) so we don't want to # add it in twice. Is that correct? release="" versuffix="" major="" newdeplibs= droppeddeps=no case $deplibs_check_method in pass_all) # Don't check for shared/static. Everything works. # This might be a little naive. We might want to check # whether the library exists or not. But this is on # osf3 & osf4 and I'm not really sure... Just # implementing what was already the behavior. newdeplibs=$deplibs ;; test_compile) # This code stresses the "libraries are programs" paradigm to its # limits. Maybe even breaks it. We compile a program, linking it # against the deplibs as a proxy for the library. Then we can check # whether they linked in statically or dynamically with ldd. $opt_dry_run || $RM conftest.c cat > conftest.c </dev/null` for potent_lib in $potential_libs; do # Follow soft links. if ls -lLd "$potent_lib" 2>/dev/null | $GREP " -> " >/dev/null; then continue fi # The statement above tries to avoid entering an # endless loop below, in case of cyclic links. # We might still enter an endless loop, since a link # loop can be closed while we follow links, # but so what? potlib="$potent_lib" while test -h "$potlib" 2>/dev/null; do potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'` case $potliblink in [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; *) potlib=`$ECHO "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; esac done if eval $file_magic_cmd \"\$potlib\" 2>/dev/null | $SED -e 10q | $EGREP "$file_magic_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for file magic test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a file magic. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; match_pattern*) set dummy $deplibs_check_method; shift match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"` for a_deplib in $deplibs; do case $a_deplib in -l*) func_stripname -l '' "$a_deplib" name=$func_stripname_result if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then case " $predeps $postdeps " in *" $a_deplib "*) newdeplibs="$newdeplibs $a_deplib" a_deplib="" ;; esac fi if test -n "$a_deplib" ; then libname=`eval "\\$ECHO \"$libname_spec\""` for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do potential_libs=`ls $i/$libname[.-]* 2>/dev/null` for potent_lib in $potential_libs; do potlib="$potent_lib" # see symlink-check above in file_magic test if eval "\$ECHO \"X$potent_lib\"" 2>/dev/null | $Xsed -e 10q | \ $EGREP "$match_pattern_regex" > /dev/null; then newdeplibs="$newdeplibs $a_deplib" a_deplib="" break 2 fi done done fi if test -n "$a_deplib" ; then droppeddeps=yes $ECHO $ECHO "*** Warning: linker path does not have real file for library $a_deplib." $ECHO "*** I have the capability to make that library automatically link in when" $ECHO "*** you link to this library. But I can only do this if you have a" $ECHO "*** shared version of the library, which you do not appear to have" $ECHO "*** because I did check the linker path looking for a file starting" if test -z "$potlib" ; then $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)" else $ECHO "*** with $libname and none of the candidates passed a file format test" $ECHO "*** using a regex pattern. Last file checked: $potlib" fi fi ;; *) # Add a -L argument. newdeplibs="$newdeplibs $a_deplib" ;; esac done # Gone through all deplibs. ;; none | unknown | *) newdeplibs="" tmp_deplibs=`$ECHO "X $deplibs" | $Xsed \ -e 's/ -lc$//' -e 's/ -[LR][^ ]*//g'` if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then for i in $predeps $postdeps ; do # can't use Xsed below, because $i might contain '/' tmp_deplibs=`$ECHO "X $tmp_deplibs" | $Xsed -e "s,$i,,"` done fi if $ECHO "X $tmp_deplibs" | $Xsed -e 's/[ ]//g' | $GREP . >/dev/null; then $ECHO if test "X$deplibs_check_method" = "Xnone"; then $ECHO "*** Warning: inter-library dependencies are not supported in this platform." else $ECHO "*** Warning: inter-library dependencies are not known to be supported." fi $ECHO "*** All declared inter-library dependencies are being dropped." droppeddeps=yes fi ;; esac versuffix=$versuffix_save major=$major_save release=$release_save libname=$libname_save name=$name_save case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library with the System framework newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac if test "$droppeddeps" = yes; then if test "$module" = yes; then $ECHO $ECHO "*** Warning: libtool could not satisfy all declared inter-library" $ECHO "*** dependencies of module $libname. Therefore, libtool will create" $ECHO "*** a static module, that should work as long as the dlopening" $ECHO "*** application is linked with the -dlopen flag." if test -z "$global_symbol_pipe"; then $ECHO $ECHO "*** However, this would only work if libtool was able to extract symbol" $ECHO "*** lists from a program, using \`nm' or equivalent, but libtool could" $ECHO "*** not find such a program. So, this module is probably useless." $ECHO "*** \`nm' from GNU binutils and a full rebuild may help." fi if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi else $ECHO "*** The inter-library dependencies that have been dropped here will be" $ECHO "*** automatically added whenever a program is linked with this library" $ECHO "*** or is declared to -dlopen it." if test "$allow_undefined" = no; then $ECHO $ECHO "*** Since this library must not contain undefined symbols," $ECHO "*** because either the platform does not support them or" $ECHO "*** it was explicitly requested with -no-undefined," $ECHO "*** libtool will only create a static version of it." if test "$build_old_libs" = no; then oldlibs="$output_objdir/$libname.$libext" build_libtool_libs=module build_old_libs=yes else build_libtool_libs=no fi fi fi fi # Done checking deplibs! deplibs=$newdeplibs fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" case $host in *-*-darwin*) newdeplibs=`$ECHO "X $newdeplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` new_inherited_linker_flags=`$ECHO "X $new_inherited_linker_flags" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` deplibs=`$ECHO "X $deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done deplibs="$new_libs" # All the library-specific variables (install_libdir is set above). library_names= old_library= dlname= # Test again, we may have decided not to build it any more if test "$build_libtool_libs" = yes; then if test "$hardcode_into_libs" = yes; then # Hardcode the library paths hardcode_libdirs= dep_rpath= rpath="$finalize_rpath" test "$mode" != relink && rpath="$compile_rpath$rpath" for libdir in $rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" dep_rpath="$dep_rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" if test -n "$hardcode_libdir_flag_spec_ld"; then eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\" else eval dep_rpath=\"$hardcode_libdir_flag_spec\" fi fi if test -n "$runpath_var" && test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var" fi test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs" fi shlibpath="$finalize_shlibpath" test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath" if test -n "$shlibpath"; then eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var" fi # Get the real and link names of the library. eval shared_ext=\"$shrext_cmds\" eval library_names=\"$library_names_spec\" set dummy $library_names shift realname="$1" shift if test -n "$soname_spec"; then eval soname=\"$soname_spec\" else soname="$realname" fi if test -z "$dlname"; then dlname=$soname fi lib="$output_objdir/$realname" linknames= for link do linknames="$linknames $link" done # Use standard objects if they are pic test -z "$pic_flag" && libobjs=`$ECHO "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` test "X$libobjs" = "X " && libobjs= delfiles= if test -n "$export_symbols" && test -n "$include_expsyms"; then $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp" export_symbols="$output_objdir/$libname.uexp" delfiles="$delfiles $export_symbols" fi orig_export_symbols= case $host_os in cygwin* | mingw* | cegcc*) if test -n "$export_symbols" && test -z "$export_symbols_regex"; then # exporting using user supplied symfile if test "x`$SED 1q $export_symbols`" != xEXPORTS; then # and it's NOT already a .def file. Must figure out # which of the given symbols are data symbols and tag # them as such. So, trigger use of export_symbols_cmds. # export_symbols gets reassigned inside the "prepare # the list of exported symbols" if statement, so the # include_expsyms logic still works. orig_export_symbols="$export_symbols" export_symbols= always_export_symbols=yes fi fi ;; esac # Prepare the list of exported symbols if test -z "$export_symbols"; then if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols cmds=$export_symbols_cmds save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" func_len " $cmd" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then func_show_eval "$cmd" 'exit $?' skipped_export=false else # The command line is too long to execute in one step. func_verbose "using reloadable object file for export list..." skipped_export=: # Break out early, otherwise skipped_export may be # set to false by a later but shorter cmd. break fi done IFS="$save_ifs" if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi fi if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi tmp_deplibs= for test_deplib in $deplibs; do case " $convenience " in *" $test_deplib "*) ;; *) tmp_deplibs="$tmp_deplibs $test_deplib" ;; esac done deplibs="$tmp_deplibs" if test -n "$convenience"; then if test -n "$whole_archive_flag_spec" && test "$compiler_needs_object" = yes && test -z "$libobjs"; then # extract the archives, so we have objects to list. # TODO: could optimize this to just extract one archive. whole_archive_flag_spec= fi if test -n "$whole_archive_flag_spec"; then save_libobjs=$libobjs eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= else gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $convenience libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi fi if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then eval flag=\"$thread_safe_flag_spec\" linker_flags="$linker_flags $flag" fi # Make a backup of the uninstalled library when relinking if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $? fi # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then eval test_cmds=\"$module_expsym_cmds\" cmds=$module_expsym_cmds else eval test_cmds=\"$module_cmds\" cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval test_cmds=\"$archive_expsym_cmds\" cmds=$archive_expsym_cmds else eval test_cmds=\"$archive_cmds\" cmds=$archive_cmds fi fi if test "X$skipped_export" != "X:" && func_len " $test_cmds" && len=$func_len_result && test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then : else # The command line is too long to link in one step, link piecewise # or, if using GNU ld and skipped_export is not :, use a linker # script. # Save the value of $output and $libobjs because we want to # use them later. If we have whole_archive_flag_spec, we # want to use save_libobjs as it was before # whole_archive_flag_spec was expanded, because we can't # assume the linker understands whole_archive_flag_spec. # This may have to be revisited, in case too many # convenience libraries get linked in and end up exceeding # the spec. if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then save_libobjs=$libobjs fi save_output=$output output_la=`$ECHO "X$output" | $Xsed -e "$basename"` # Clear the reloadable object creation command queue and # initialize k to one. test_cmds= concat_cmds= objlist= last_robj= k=1 if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then output=${output_objdir}/${output_la}.lnkscript func_verbose "creating GNU ld script: $output" $ECHO 'INPUT (' > $output for obj in $save_libobjs do $ECHO "$obj" >> $output done $ECHO ')' >> $output delfiles="$delfiles $output" elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then output=${output_objdir}/${output_la}.lnk func_verbose "creating linker input file list: $output" : > $output set x $save_libobjs shift firstobj= if test "$compiler_needs_object" = yes; then firstobj="$1 " shift fi for obj do $ECHO "$obj" >> $output done delfiles="$delfiles $output" output=$firstobj\"$file_list_spec$output\" else if test -n "$save_libobjs"; then func_verbose "creating reloadable object files..." output=$output_objdir/$output_la-${k}.$objext eval test_cmds=\"$reload_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 # Loop over the list of objects to be linked. for obj in $save_libobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result if test "X$objlist" = X || test "$len" -lt "$max_cmd_len"; then func_append objlist " $obj" else # The command $test_cmds is almost too long, add a # command to the queue. if test "$k" -eq 1 ; then # The first file doesn't have a previous command to add. eval concat_cmds=\"$reload_cmds $objlist $last_robj\" else # All subsequent reloadable object files will link in # the last one created. eval concat_cmds=\"\$concat_cmds~$reload_cmds $objlist $last_robj~\$RM $last_robj\" fi last_robj=$output_objdir/$output_la-${k}.$objext func_arith $k + 1 k=$func_arith_result output=$output_objdir/$output_la-${k}.$objext objlist=$obj func_len " $last_robj" func_arith $len0 + $func_len_result len=$func_arith_result fi done # Handle the remaining objects by creating one last # reloadable object file. All subsequent reloadable object # files will link in the last one created. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$reload_cmds $objlist $last_robj\" if test -n "$last_robj"; then eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\" fi delfiles="$delfiles $output" else output= fi if ${skipped_export-false}; then func_verbose "generating symbol list for \`$libname.la'" export_symbols="$output_objdir/$libname.exp" $opt_dry_run || $RM $export_symbols libobjs=$output # Append the command to create the export file. test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\" if test -n "$last_robj"; then eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\" fi fi test -n "$save_libobjs" && func_verbose "creating a temporary reloadable object file: $output" # Loop through the commands generated above and execute them. save_ifs="$IFS"; IFS='~' for cmd in $concat_cmds; do IFS="$save_ifs" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" if test -n "$export_symbols_regex" && ${skipped_export-false}; then func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' func_show_eval '$MV "${export_symbols}T" "$export_symbols"' fi fi if ${skipped_export-false}; then if test -n "$export_symbols" && test -n "$include_expsyms"; then tmp_export_symbols="$export_symbols" test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols" $opt_dry_run || eval '$ECHO "X$include_expsyms" | $Xsed | $SP2NL >> "$tmp_export_symbols"' fi if test -n "$orig_export_symbols"; then # The given exports_symbols file has to be filtered, so filter it. func_verbose "filter symbol list for \`$libname.la' to tag DATA exports" # FIXME: $output_objdir/$libname.filter potentially contains lots of # 's' commands which not all seds can handle. GNU sed should be fine # though. Also, the filter scales superlinearly with the number of # global variables. join(1) would be nice here, but unfortunately # isn't a blessed tool. $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter delfiles="$delfiles $export_symbols $output_objdir/$libname.filter" export_symbols=$output_objdir/$libname.def $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols fi fi libobjs=$output # Restore the value of output. output=$save_output if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then eval libobjs=\"\$libobjs $whole_archive_flag_spec\" test "X$libobjs" = "X " && libobjs= fi # Expand the library linking commands again to reset the # value of $libobjs for piecewise linking. # Do each of the archive commands. if test "$module" = yes && test -n "$module_cmds" ; then if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then cmds=$module_expsym_cmds else cmds=$module_cmds fi else if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then cmds=$archive_expsym_cmds else cmds=$archive_cmds fi fi fi if test -n "$delfiles"; then # Append the command to remove temporary files to $cmds. eval cmds=\"\$cmds~\$RM $delfiles\" fi # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles libobjs="$libobjs $func_extract_archives_result" test "X$libobjs" = "X " && libobjs= fi save_ifs="$IFS"; IFS='~' for cmd in $cmds; do IFS="$save_ifs" eval cmd=\"$cmd\" $opt_silent || { func_quote_for_expand "$cmd" eval "func_echo $func_quote_for_expand_result" } $opt_dry_run || eval "$cmd" || { lt_exit=$? # Restore the uninstalled library and exit if test "$mode" = relink; then ( cd "$output_objdir" && \ $RM "${realname}T" && \ $MV "${realname}U" "$realname" ) fi exit $lt_exit } done IFS="$save_ifs" # Restore the uninstalled library and exit if test "$mode" = relink; then $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $? if test -n "$convenience"; then if test -z "$whole_archive_flag_spec"; then func_show_eval '${RM}r "$gentop"' fi fi exit $EXIT_SUCCESS fi # Create links to the real library. for linkname in $linknames; do if test "$realname" != "$linkname"; then func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?' fi done # If -module or -export-dynamic was specified, set the dlname. if test "$module" = yes || test "$export_dynamic" = yes; then # On all known operating systems, these are identical. dlname="$soname" fi fi ;; obj) if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then func_warning "\`-dlopen' is ignored for objects" fi case " $deplibs" in *\ -l* | *\ -L*) func_warning "\`-l' and \`-L' are ignored for objects" ;; esac test -n "$rpath" && \ func_warning "\`-rpath' is ignored for objects" test -n "$xrpath" && \ func_warning "\`-R' is ignored for objects" test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for objects" test -n "$release" && \ func_warning "\`-release' is ignored for objects" case $output in *.lo) test -n "$objs$old_deplibs" && \ func_fatal_error "cannot build library object \`$output' from non-libtool objects" libobj=$output func_lo2o "$libobj" obj=$func_lo2o_result ;; *) libobj= obj="$output" ;; esac # Delete the old objects. $opt_dry_run || $RM $obj $libobj # Objects from convenience libraries. This assumes # single-version convenience libraries. Whenever we create # different ones for PIC/non-PIC, this we'll have to duplicate # the extraction. reload_conv_objs= gentop= # reload_cmds runs $LD directly, so let us get rid of # -Wl from whole_archive_flag_spec and hope we can get by with # turning comma into space.. wl= if test -n "$convenience"; then if test -n "$whole_archive_flag_spec"; then eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\" reload_conv_objs=$reload_objs\ `$ECHO "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'` else gentop="$output_objdir/${obj}x" generated="$generated $gentop" func_extract_archives $gentop $convenience reload_conv_objs="$reload_objs $func_extract_archives_result" fi fi # Create the old-style object. reload_objs="$objs$old_deplibs "`$ECHO "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test output="$obj" func_execute_cmds "$reload_cmds" 'exit $?' # Exit if we aren't doing a library object file. if test -z "$libobj"; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS fi if test "$build_libtool_libs" != yes; then if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi # Create an invalid libtool object if no PIC, so that we don't # accidentally link it into a program. # $show "echo timestamp > $libobj" # $opt_dry_run || eval "echo timestamp > $libobj" || exit $? exit $EXIT_SUCCESS fi if test -n "$pic_flag" || test "$pic_mode" != default; then # Only do commands if we really have different PIC objects. reload_objs="$libobjs $reload_conv_objs" output="$libobj" func_execute_cmds "$reload_cmds" 'exit $?' fi if test -n "$gentop"; then func_show_eval '${RM}r "$gentop"' fi exit $EXIT_SUCCESS ;; prog) case $host in *cygwin*) func_stripname '' '.exe' "$output" output=$func_stripname_result.exe;; esac test -n "$vinfo" && \ func_warning "\`-version-info' is ignored for programs" test -n "$release" && \ func_warning "\`-release' is ignored for programs" test "$preload" = yes \ && test "$dlopen_support" = unknown \ && test "$dlopen_self" = unknown \ && test "$dlopen_self_static" = unknown && \ func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support." case $host in *-*-rhapsody* | *-*-darwin1.[012]) # On Rhapsody replace the C library is the System framework compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's/ -lc / System.ltframework /'` ;; esac case $host in *-*-darwin*) # Don't allow lazy linking, it breaks C++ global constructors # But is supposedly fixed on 10.4 or later (yay!). if test "$tagname" = CXX ; then case ${MACOSX_DEPLOYMENT_TARGET-10.0} in 10.[0123]) compile_command="$compile_command ${wl}-bind_at_load" finalize_command="$finalize_command ${wl}-bind_at_load" ;; esac fi # Time to change all our "foo.ltframework" stuff back to "-framework foo" compile_deplibs=`$ECHO "X $compile_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` finalize_deplibs=`$ECHO "X $finalize_deplibs" | $Xsed -e 's% \([^ $]*\).ltframework% -framework \1%g'` ;; esac # move library search paths that coincide with paths to not yet # installed libraries to the beginning of the library search list new_libs= for path in $notinst_path; do case " $new_libs " in *" -L$path/$objdir "*) ;; *) case " $compile_deplibs " in *" -L$path/$objdir "*) new_libs="$new_libs -L$path/$objdir" ;; esac ;; esac done for deplib in $compile_deplibs; do case $deplib in -L*) case " $new_libs " in *" $deplib "*) ;; *) new_libs="$new_libs $deplib" ;; esac ;; *) new_libs="$new_libs $deplib" ;; esac done compile_deplibs="$new_libs" compile_command="$compile_command $compile_deplibs" finalize_command="$finalize_command $finalize_deplibs" if test -n "$rpath$xrpath"; then # If the user specified any rpath flags, then add them. for libdir in $rpath $xrpath; do # This is the magic to use -rpath. case "$finalize_rpath " in *" $libdir "*) ;; *) finalize_rpath="$finalize_rpath $libdir" ;; esac done fi # Now hardcode the library paths rpath= hardcode_libdirs= for libdir in $compile_rpath $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$perm_rpath " in *" $libdir "*) ;; *) perm_rpath="$perm_rpath $libdir" ;; esac fi case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*) testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'` case :$dllsearchpath: in *":$libdir:"*) ;; ::) dllsearchpath=$libdir;; *) dllsearchpath="$dllsearchpath:$libdir";; esac case :$dllsearchpath: in *":$testbindir:"*) ;; ::) dllsearchpath=$testbindir;; *) dllsearchpath="$dllsearchpath:$testbindir";; esac ;; esac done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi compile_rpath="$rpath" rpath= hardcode_libdirs= for libdir in $finalize_rpath; do if test -n "$hardcode_libdir_flag_spec"; then if test -n "$hardcode_libdir_separator"; then if test -z "$hardcode_libdirs"; then hardcode_libdirs="$libdir" else # Just accumulate the unique libdirs. case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) ;; *) hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" ;; esac fi else eval flag=\"$hardcode_libdir_flag_spec\" rpath="$rpath $flag" fi elif test -n "$runpath_var"; then case "$finalize_perm_rpath " in *" $libdir "*) ;; *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; esac fi done # Substitute the hardcoded libdirs into the rpath. if test -n "$hardcode_libdir_separator" && test -n "$hardcode_libdirs"; then libdir="$hardcode_libdirs" eval rpath=\" $hardcode_libdir_flag_spec\" fi finalize_rpath="$rpath" if test -n "$libobjs" && test "$build_old_libs" = yes; then # Transform all the library objects into standard objects. compile_command=`$ECHO "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` finalize_command=`$ECHO "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` fi func_generate_dlsyms "$outputname" "@PROGRAM@" "no" # template prelinking step if test -n "$prelink_cmds"; then func_execute_cmds "$prelink_cmds" 'exit $?' fi wrappers_required=yes case $host in *cygwin* | *mingw* ) if test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; *cegcc) # Disable wrappers for cegcc, we are cross compiling anyway. wrappers_required=no ;; *) if test "$need_relink" = no || test "$build_libtool_libs" != yes; then wrappers_required=no fi ;; esac if test "$wrappers_required" = no; then # Replace the output file specification. compile_command=`$ECHO "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` link_command="$compile_command$compile_rpath" # We have no uninstalled library dependencies, so finalize right now. exit_status=0 func_show_eval "$link_command" 'exit_status=$?' # Delete the generated files. if test -f "$output_objdir/${outputname}S.${objext}"; then func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"' fi exit $exit_status fi if test -n "$compile_shlibpath$finalize_shlibpath"; then compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" fi if test -n "$finalize_shlibpath"; then finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" fi compile_var= finalize_var= if test -n "$runpath_var"; then if test -n "$perm_rpath"; then # We should set the runpath_var. rpath= for dir in $perm_rpath; do rpath="$rpath$dir:" done compile_var="$runpath_var=\"$rpath\$$runpath_var\" " fi if test -n "$finalize_perm_rpath"; then # We should set the runpath_var. rpath= for dir in $finalize_perm_rpath; do rpath="$rpath$dir:" done finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " fi fi if test "$no_install" = yes; then # We don't need to create a wrapper script. link_command="$compile_var$compile_command$compile_rpath" # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` # Delete the old output file. $opt_dry_run || $RM $output # Link the executable and exit func_show_eval "$link_command" 'exit $?' exit $EXIT_SUCCESS fi if test "$hardcode_action" = relink; then # Fast installation is not supported link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" func_warning "this platform does not like uninstalled shared libraries" func_warning "\`$output' will be relinked during installation" else if test "$fast_install" != no; then link_command="$finalize_var$compile_command$finalize_rpath" if test "$fast_install" = yes; then relink_command=`$ECHO "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` else # fast_install is set to needless relink_command= fi else link_command="$compile_var$compile_command$compile_rpath" relink_command="$finalize_var$finalize_command$finalize_rpath" fi fi # Replace the output file specification. link_command=`$ECHO "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` # Delete the old output files. $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname func_show_eval "$link_command" 'exit $?' # Now create the wrapper script. func_verbose "creating $output" # Quote the relink command for shipping. if test -n "$relink_command"; then # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done relink_command="(cd `pwd`; $relink_command)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` fi # Quote $ECHO for shipping. if test "X$ECHO" = "X$SHELL $progpath --fallback-echo"; then case $progpath in [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $progpath --fallback-echo";; *) qecho="$SHELL `pwd`/$progpath --fallback-echo";; esac qecho=`$ECHO "X$qecho" | $Xsed -e "$sed_quote_subst"` else qecho=`$ECHO "X$ECHO" | $Xsed -e "$sed_quote_subst"` fi # Only actually do things if not in dry run mode. $opt_dry_run || { # win32 will think the script is a binary if it has # a .exe suffix, so we strip it off here. case $output in *.exe) func_stripname '' '.exe' "$output" output=$func_stripname_result ;; esac # test for cygwin because mv fails w/o .exe extensions case $host in *cygwin*) exeext=.exe func_stripname '' '.exe' "$outputname" outputname=$func_stripname_result ;; *) exeext= ;; esac case $host in *cygwin* | *mingw* ) func_dirname_and_basename "$output" "" "." output_name=$func_basename_result output_path=$func_dirname_result cwrappersource="$output_path/$objdir/lt-$output_name.c" cwrapper="$output_path/$output_name.exe" $RM $cwrappersource $cwrapper trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15 func_emit_cwrapperexe_src > $cwrappersource # The wrapper executable is built using the $host compiler, # because it contains $host paths and files. If cross- # compiling, it, like the target executable, must be # executed on the $host or under an emulation environment. $opt_dry_run || { $LTCC $LTCFLAGS -o $cwrapper $cwrappersource $STRIP $cwrapper } # Now, create the wrapper script for func_source use: func_ltwrapper_scriptname $cwrapper $RM $func_ltwrapper_scriptname_result trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15 $opt_dry_run || { # note: this script will not be executed, so do not chmod. if test "x$build" = "x$host" ; then $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result else func_emit_wrapper no > $func_ltwrapper_scriptname_result fi } ;; * ) $RM $output trap "$RM $output; exit $EXIT_FAILURE" 1 2 15 func_emit_wrapper no > $output chmod +x $output ;; esac } exit $EXIT_SUCCESS ;; esac # See if we need to build an old-fashioned archive. for oldlib in $oldlibs; do if test "$build_libtool_libs" = convenience; then oldobjs="$libobjs_save $symfileobj" addlibs="$convenience" build_libtool_libs=no else if test "$build_libtool_libs" = module; then oldobjs="$libobjs_save" build_libtool_libs=no else oldobjs="$old_deplibs $non_pic_objects" if test "$preload" = yes && test -f "$symfileobj"; then oldobjs="$oldobjs $symfileobj" fi fi addlibs="$old_convenience" fi if test -n "$addlibs"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $addlibs oldobjs="$oldobjs $func_extract_archives_result" fi # Do each command in the archive commands. if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then cmds=$old_archive_from_new_cmds else # Add any objects from preloaded convenience libraries if test -n "$dlprefiles"; then gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_extract_archives $gentop $dlprefiles oldobjs="$oldobjs $func_extract_archives_result" fi # POSIX demands no paths to be encoded in archives. We have # to avoid creating archives with duplicate basenames if we # might have to extract them afterwards, e.g., when creating a # static archive out of a convenience library, or when linking # the entirety of a libtool archive into another (currently # not supported by libtool). if (for obj in $oldobjs do func_basename "$obj" $ECHO "$func_basename_result" done | sort | sort -uc >/dev/null 2>&1); then : else $ECHO "copying selected object files to avoid basename conflicts..." gentop="$output_objdir/${outputname}x" generated="$generated $gentop" func_mkdir_p "$gentop" save_oldobjs=$oldobjs oldobjs= counter=1 for obj in $save_oldobjs do func_basename "$obj" objbase="$func_basename_result" case " $oldobjs " in " ") oldobjs=$obj ;; *[\ /]"$objbase "*) while :; do # Make sure we don't pick an alternate name that also # overlaps. newobj=lt$counter-$objbase func_arith $counter + 1 counter=$func_arith_result case " $oldobjs " in *[\ /]"$newobj "*) ;; *) if test ! -f "$gentop/$newobj"; then break; fi ;; esac done func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj" oldobjs="$oldobjs $gentop/$newobj" ;; *) oldobjs="$oldobjs $obj" ;; esac done fi eval cmds=\"$old_archive_cmds\" func_len " $cmds" len=$func_len_result if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then cmds=$old_archive_cmds else # the command line is too long to link in one step, link in parts func_verbose "using piecewise archive linking..." save_RANLIB=$RANLIB RANLIB=: objlist= concat_cmds= save_oldobjs=$oldobjs oldobjs= # Is there a better way of finding the last object in the list? for obj in $save_oldobjs do last_oldobj=$obj done eval test_cmds=\"$old_archive_cmds\" func_len " $test_cmds" len0=$func_len_result len=$len0 for obj in $save_oldobjs do func_len " $obj" func_arith $len + $func_len_result len=$func_arith_result func_append objlist " $obj" if test "$len" -lt "$max_cmd_len"; then : else # the above command should be used before it gets too long oldobjs=$objlist if test "$obj" = "$last_oldobj" ; then RANLIB=$save_RANLIB fi test -z "$concat_cmds" || concat_cmds=$concat_cmds~ eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\" objlist= len=$len0 fi done RANLIB=$save_RANLIB oldobjs=$objlist if test "X$oldobjs" = "X" ; then eval cmds=\"\$concat_cmds\" else eval cmds=\"\$concat_cmds~\$old_archive_cmds\" fi fi fi func_execute_cmds "$cmds" 'exit $?' done test -n "$generated" && \ func_show_eval "${RM}r$generated" # Now create the libtool archive. case $output in *.la) old_library= test "$build_old_libs" = yes && old_library="$libname.$libext" func_verbose "creating $output" # Preserve any variables that may affect compiler behavior for var in $variables_saved_for_relink; do if eval test -z \"\${$var+set}\"; then relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command" elif eval var_value=\$$var; test -z "$var_value"; then relink_command="$var=; export $var; $relink_command" else func_quote_for_eval "$var_value" relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command" fi done # Quote the link command for shipping. relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)" relink_command=`$ECHO "X$relink_command" | $Xsed -e "$sed_quote_subst"` if test "$hardcode_automatic" = yes ; then relink_command= fi # Only create the output if not a dry run. $opt_dry_run || { for installed in no yes; do if test "$installed" = yes; then if test -z "$install_libdir"; then break fi output="$output_objdir/$outputname"i # Replace all uninstalled libtool libraries with the installed ones newdependency_libs= for deplib in $dependency_libs; do case $deplib in *.la) func_basename "$deplib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib` test -z "$libdir" && \ func_fatal_error "\`$deplib' is not a valid libtool archive" newdependency_libs="$newdependency_libs $libdir/$name" ;; *) newdependency_libs="$newdependency_libs $deplib" ;; esac done dependency_libs="$newdependency_libs" newdlfiles= for lib in $dlfiles; do case $lib in *.la) func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlfiles="$newdlfiles $libdir/$name" ;; *) newdlfiles="$newdlfiles $lib" ;; esac done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in *.la) # Only pass preopened files to the pseudo-archive (for # eventual linking with the app. that links it) if we # didn't already link the preopened objects directly into # the library: func_basename "$lib" name="$func_basename_result" eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib` test -z "$libdir" && \ func_fatal_error "\`$lib' is not a valid libtool archive" newdlprefiles="$newdlprefiles $libdir/$name" ;; esac done dlprefiles="$newdlprefiles" else newdlfiles= for lib in $dlfiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlfiles="$newdlfiles $abs" done dlfiles="$newdlfiles" newdlprefiles= for lib in $dlprefiles; do case $lib in [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;; *) abs=`pwd`"/$lib" ;; esac newdlprefiles="$newdlprefiles $abs" done dlprefiles="$newdlprefiles" fi $RM $output # place dlname in correct position for cygwin tdlname=$dlname case $host,$output,$installed,$module,$dlname in *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll) tdlname=../bin/$dlname ;; esac $ECHO > $output "\ # $outputname - a libtool library file # Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION # # Please DO NOT delete this file! # It is necessary for linking the library. # The name that we can dlopen(3). dlname='$tdlname' # Names of this library. library_names='$library_names' # The name of the static archive. old_library='$old_library' # Linker flags that can not go in dependency_libs. inherited_linker_flags='$new_inherited_linker_flags' # Libraries that this one depends upon. dependency_libs='$dependency_libs' # Names of additional weak libraries provided by this library weak_library_names='$weak_libs' # Version information for $libname. current=$current age=$age revision=$revision # Is this an already installed library? installed=$installed # Should we warn about portability when linking against -modules? shouldnotlink=$module # Files to dlopen/dlpreopen dlopen='$dlfiles' dlpreopen='$dlprefiles' # Directory that this library needs to be installed in: libdir='$install_libdir'" if test "$installed" = no && test "$need_relink" = yes; then $ECHO >> $output "\ relink_command=\"$relink_command\"" fi done } # Do a symbolic link so that the libtool archive can be found in # LD_LIBRARY_PATH before the program is installed. func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?' ;; esac exit $EXIT_SUCCESS } { test "$mode" = link || test "$mode" = relink; } && func_mode_link ${1+"$@"} # func_mode_uninstall arg... func_mode_uninstall () { $opt_debug RM="$nonopt" files= rmforce= exit_status=0 # This variable tells wrapper scripts just to set variables rather # than running their programs. libtool_install_magic="$magic" for arg do case $arg in -f) RM="$RM $arg"; rmforce=yes ;; -*) RM="$RM $arg" ;; *) files="$files $arg" ;; esac done test -z "$RM" && \ func_fatal_help "you must specify an RM program" rmdirs= origobjdir="$objdir" for file in $files; do func_dirname "$file" "" "." dir="$func_dirname_result" if test "X$dir" = X.; then objdir="$origobjdir" else objdir="$dir/$origobjdir" fi func_basename "$file" name="$func_basename_result" test "$mode" = uninstall && objdir="$dir" # Remember objdir for removal later, being careful to avoid duplicates if test "$mode" = clean; then case " $rmdirs " in *" $objdir "*) ;; *) rmdirs="$rmdirs $objdir" ;; esac fi # Don't error if the file doesn't exist and rm -f was used. if { test -L "$file"; } >/dev/null 2>&1 || { test -h "$file"; } >/dev/null 2>&1 || test -f "$file"; then : elif test -d "$file"; then exit_status=1 continue elif test "$rmforce" = yes; then continue fi rmfiles="$file" case $name in *.la) # Possibly a libtool archive, so verify it. if func_lalib_p "$file"; then func_source $dir/$name # Delete the libtool libraries and symlinks. for n in $library_names; do rmfiles="$rmfiles $objdir/$n" done test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library" case "$mode" in clean) case " $library_names " in # " " in the beginning catches empty $dlname *" $dlname "*) ;; *) rmfiles="$rmfiles $objdir/$dlname" ;; esac test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i" ;; uninstall) if test -n "$library_names"; then # Do each command in the postuninstall commands. func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi if test -n "$old_library"; then # Do each command in the old_postuninstall commands. func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1' fi # FIXME: should reinstall the best remaining shared library. ;; esac fi ;; *.lo) # Possibly a libtool object, so verify it. if func_lalib_p "$file"; then # Read the .lo file func_source $dir/$name # Add PIC object to the list of files to remove. if test -n "$pic_object" && test "$pic_object" != none; then rmfiles="$rmfiles $dir/$pic_object" fi # Add non-PIC object to the list of files to remove. if test -n "$non_pic_object" && test "$non_pic_object" != none; then rmfiles="$rmfiles $dir/$non_pic_object" fi fi ;; *) if test "$mode" = clean ; then noexename=$name case $file in *.exe) func_stripname '' '.exe' "$file" file=$func_stripname_result func_stripname '' '.exe' "$name" noexename=$func_stripname_result # $file with .exe has already been added to rmfiles, # add $file without .exe rmfiles="$rmfiles $file" ;; esac # Do a test to see if this is a libtool program. if func_ltwrapper_p "$file"; then if func_ltwrapper_executable_p "$file"; then func_ltwrapper_scriptname "$file" relink_command= func_source $func_ltwrapper_scriptname_result rmfiles="$rmfiles $func_ltwrapper_scriptname_result" else relink_command= func_source $dir/$noexename fi # note $name still contains .exe if it was in $file originally # as does the version of $file that was added into $rmfiles rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}" if test "$fast_install" = yes && test -n "$relink_command"; then rmfiles="$rmfiles $objdir/lt-$name" fi if test "X$noexename" != "X$name" ; then rmfiles="$rmfiles $objdir/lt-${noexename}.c" fi fi fi ;; esac func_show_eval "$RM $rmfiles" 'exit_status=1' done objdir="$origobjdir" # Try to remove the ${objdir}s in the directories where we deleted files for dir in $rmdirs; do if test -d "$dir"; then func_show_eval "rmdir $dir >/dev/null 2>&1" fi done exit $exit_status } { test "$mode" = uninstall || test "$mode" = clean; } && func_mode_uninstall ${1+"$@"} test -z "$mode" && { help="$generic_help" func_fatal_help "you must specify a MODE" } test -z "$exec_cmd" && \ func_fatal_help "invalid operation mode \`$mode'" if test -n "$exec_cmd"; then eval exec "$exec_cmd" exit $EXIT_FAILURE fi exit $exit_status # The TAGs below are defined such that we never get into a situation # in which we disable both kinds of libraries. Given conflicting # choices, we go for a static library, that is the most portable, # since we can't tell whether shared libraries were disabled because # the user asked for that or because the platform doesn't support # them. This is particularly important on AIX, because we don't # support having both static and shared libraries enabled at the same # time on that platform, so we default to a shared-only configuration. # If a disable-shared tag is given, we'll fallback to a static-only # configuration. But we'll never go from static-only to shared-only. # ### BEGIN LIBTOOL TAG CONFIG: disable-shared build_libtool_libs=no build_old_libs=yes # ### END LIBTOOL TAG CONFIG: disable-shared # ### BEGIN LIBTOOL TAG CONFIG: disable-static build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac` # ### END LIBTOOL TAG CONFIG: disable-static # Local Variables: # mode:shell-script # sh-indentation:2 # End: # vi:sw=2 zbar-0.10/config/install-sh0000755000000000000000000003246411270371465012547 00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. nl=' ' IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit=${DOITPROG-} if test -z "$doit"; then doit_exec=exec else doit_exec=$doit fi # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_glob='?' initialize_posix_glob=' test "$posix_glob" != "?" || { if (set -f) 2>/dev/null; then posix_glob= else posix_glob=: fi } ' posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false no_target_directory= usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *' '* | *' '* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) dst_arg=$2 shift;; -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call `install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then trap '(exit $?); exit' 1 2 13 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names starting with `-'. case $src in -*) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # Protect names starting with `-'. case $dst in -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else # Prefer dirname, but fall back on a substitute if dirname fails. dstdir=` (dirname "$dst") 2>/dev/null || expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$dst" : 'X\(//\)[^/]' \| \ X"$dst" : 'X\(//\)$' \| \ X"$dst" : 'X\(/\)' \| . 2>/dev/null || echo X"$dst" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q' ` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writeable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; -*) prefix='./';; *) prefix='';; esac eval "$initialize_posix_glob" oIFS=$IFS IFS=/ $posix_glob set -f set fnord $dstdir shift $posix_glob set +f IFS=$oIFS prefixes= for d do test -z "$d" && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && eval "$initialize_posix_glob" && $posix_glob set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && $posix_glob set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: zbar-0.10/config/ltoptions.m40000644000000000000000000002724211270371454013034 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [0], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [0], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [0], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [pic_mode="$withval"], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) zbar-0.10/config/config.sub0000755000000000000000000010260311270371465012517 00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. timestamp='2009-02-03' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software # can handle that machine. It does not imply ALL GNU software can. # # This file is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA # 02110-1301, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Please send patches to . Submit a context # diff and a properly formatted ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray) os= basic_machine=$1 ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ | bfin \ | c4x | clipper \ | d10v | d30v | dlx | dsp16xx | dvp \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | mt \ | msp430 \ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ | tahoe | thumb | tic4x | tic80 | tron \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; # I'm not sure what "Sysv32" means. Should this be sysv3.2? i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; mingw32) basic_machine=i386-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mipsEE* | ee | ps2) basic_machine=mips64r5900el-scei case $os in -linux*) ;; *) os=-elf ;; esac ;; iop) basic_machine=mipsel-scei os=-irx ;; dvp) basic_machine=dvp-scei os=-elf ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; mvs) basic_machine=i370-ibm os=-mvs ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc) basic_machine=powerpc-unknown ;; ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tic54x | c54x*) basic_machine=tic54x-unknown os=-coff ;; tic55x | c55x*) basic_machine=tic55x-unknown os=-coff ;; tic6x | c6x*) basic_machine=tic6x-unknown os=-coff ;; tile*) basic_machine=tile-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -irx*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -kaos*) os=-kaos ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 # This also exists in the configure program, but was not the # default. # os=-sunos4 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: zbar-0.10/config/compile0000755000000000000000000000717311270371465012120 00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. scriptversion=2005-05-14.22 # Copyright (C) 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . case $1 in '') echo "$0: No command. Try \`$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand `-c -o'. Remove `-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file `INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; esac ofile= cfile= eat= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we strip `-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-end: "$" # End: zbar-0.10/zbar.pc.in0000644000000000000000000000035711270371414011153 00000000000000prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ includedir=@includedir@ Name: zbar Description: bar code scanning and decoding URL: http://zbar.sourceforge.net Version: @VERSION@ Libs: -L${libdir} -lzbar Cflags: -I${includedir} zbar-0.10/configure0000755000000000000000000310145511270371464011204 00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.63 for zbar 0.10. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, # 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH if test "x$CONFIG_SHELL" = x; then if (eval ":") 2>/dev/null; then as_have_required=yes else as_have_required=no fi if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=\$LINENO as_lineno_2=\$LINENO test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } ") 2> /dev/null; then : else as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. case $as_dir in /*) for as_base in sh bash ksh sh5; do as_candidate_shells="$as_candidate_shells $as_dir/$as_base" done;; esac done IFS=$as_save_IFS for as_shell in $as_candidate_shells $SHELL; do # Try only shells that exist, to save several forks. if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { ("$as_shell") 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : _ASEOF }; then CONFIG_SHELL=$as_shell as_have_required=yes if { "$as_shell" 2> /dev/null <<\_ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi : (as_func_return () { (exit $1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = "$1" ); then : else exitcode=1 echo positional parameters were not saved. fi test $exitcode = 0) || { (exit 1); exit 1; } ( as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } _ASEOF }; then break fi fi done if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done export CONFIG_SHELL exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi if test $as_have_required = no; then echo This script requires a shell more modern than all the echo shells that I found on your system. Please install a echo modern shell, or manually run the script under such a echo shell if you do have one. { (exit 1); exit 1; } fi fi fi (eval "as_func_return () { (exit \$1) } as_func_success () { as_func_return 0 } as_func_failure () { as_func_return 1 } as_func_ret_success () { return 0 } as_func_ret_failure () { return 1 } exitcode=0 if as_func_success; then : else exitcode=1 echo as_func_success failed. fi if as_func_failure; then exitcode=1 echo as_func_failure succeeded. fi if as_func_ret_success; then : else exitcode=1 echo as_func_ret_success failed. fi if as_func_ret_failure; then exitcode=1 echo as_func_ret_failure succeeded. fi if ( set x; as_func_ret_success y && test x = \"\$1\" ); then : else exitcode=1 echo positional parameters were not saved. fi test \$exitcode = 0") || { echo No shell found that supports shell functions. echo Please tell bug-autoconf@gnu.org about your system, echo including any error possibly output before this message. echo This can help us improve future autoconf versions. echo Configuration will now proceed without shell functions. } as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" # Check that we are running under the correct shell. SHELL=${CONFIG_SHELL-/bin/sh} case X$lt_ECHO in X*--fallback-echo) # Remove one level of quotation (which was required for Make). ECHO=`echo "$lt_ECHO" | sed 's,\\\\\$\\$0,'$0','` ;; esac ECHO=${lt_ECHO-echo} if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift elif test "X$1" = X--fallback-echo; then # Avoid inline document here, it may be left over : elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' ; then # Yippee, $ECHO works! : else # Restart under the correct shell. exec $SHELL "$0" --no-reexec ${1+"$@"} fi if test "X$1" = X--fallback-echo; then # used as fallback echo shift cat <<_LT_EOF $* _LT_EOF exit 0 fi # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH if test -z "$lt_ECHO"; then if test "X${echo_test_string+set}" != Xset; then # find a string as large as possible, as long as the shell can cope with it for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... if { echo_test_string=`eval $cmd`; } 2>/dev/null && { test "X$echo_test_string" = "X$echo_test_string"; } 2>/dev/null then break fi done fi if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then : else # The Solaris, AIX, and Digital Unix default echo programs unquote # backslashes. This makes it impossible to quote backslashes using # echo "$something" | sed 's/\\/\\\\/g' # # So, first we look for a working echo in the user's PATH. lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for dir in $PATH /usr/ucb; do IFS="$lt_save_ifs" if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && echo_testing_string=`($dir/echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$dir/echo" break fi done IFS="$lt_save_ifs" if test "X$ECHO" = Xecho; then # We didn't find a better echo, so look for alternatives. if test "X`{ print -r '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ print -r "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # This shell has a builtin print -r that does the trick. ECHO='print -r' elif { test -f /bin/ksh || test -f /bin/ksh$ac_exeext; } && test "X$CONFIG_SHELL" != X/bin/ksh; then # If we have ksh, try running configure again with it. ORIGINAL_CONFIG_SHELL=${CONFIG_SHELL-/bin/sh} export ORIGINAL_CONFIG_SHELL CONFIG_SHELL=/bin/ksh export CONFIG_SHELL exec $CONFIG_SHELL "$0" --no-reexec ${1+"$@"} else # Try using printf. ECHO='printf %s\n' if test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t' && echo_testing_string=`{ $ECHO "$echo_test_string"; } 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then # Cool, printf works : elif echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($ORIGINAL_CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then CONFIG_SHELL=$ORIGINAL_CONFIG_SHELL export CONFIG_SHELL SHELL="$CONFIG_SHELL" export SHELL ECHO="$CONFIG_SHELL $0 --fallback-echo" elif echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo '\t') 2>/dev/null` && test "X$echo_testing_string" = 'X\t' && echo_testing_string=`($CONFIG_SHELL "$0" --fallback-echo "$echo_test_string") 2>/dev/null` && test "X$echo_testing_string" = "X$echo_test_string"; then ECHO="$CONFIG_SHELL $0 --fallback-echo" else # maybe with a smaller string... prev=: for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do if { test "X$echo_test_string" = "X`eval $cmd`"; } 2>/dev/null then break fi prev="$cmd" done if test "$prev" != 'sed 50q "$0"'; then echo_test_string=`eval $prev` export echo_test_string exec ${ORIGINAL_CONFIG_SHELL-${CONFIG_SHELL-/bin/sh}} "$0" ${1+"$@"} else # Oops. We lost completely, so just stick with echo. ECHO=echo fi fi fi fi fi fi # Copy echo and quote the copy suitably for passing to libtool from # the Makefile, instead of quoting the original, which is used later. lt_ECHO=$ECHO if test "X$lt_ECHO" = "X$CONFIG_SHELL $0 --fallback-echo"; then lt_ECHO="$CONFIG_SHELL \\\$\$0 --fallback-echo" fi exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Identity of this package. PACKAGE_NAME='zbar' PACKAGE_TARNAME='zbar' PACKAGE_VERSION='0.10' PACKAGE_STRING='zbar 0.10' PACKAGE_BUGREPORT='spadix@users.sourceforge.net' ac_unique_file="zbar/scanner.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='LTLIBOBJS LIBOBJS HAVE_QT_FALSE HAVE_QT_TRUE QT_LIBS QT_CFLAGS MOC HAVE_PYTHON_FALSE HAVE_PYTHON_TRUE PYGTK_LIBS PYGTK_CFLAGS pkgpyexecdir pyexecdir pkgpythondir pythondir PYTHON_PLATFORM PYTHON_EXEC_PREFIX PYTHON_PREFIX PYTHON_VERSION PYTHON PYGTK_DEFS PYGTK_CODEGEN PYGTK_H2DEF PYTHON_LIBS PYTHON_CFLAGS PYTHON_CONFIG HAVE_GTK_FALSE HAVE_GTK_TRUE GTK_LIBS GTK_CFLAGS GLIB_GENMARSHAL HAVE_NPAPI_FALSE HAVE_NPAPI_TRUE NPAPI_LIBS NPAPI_CFLAGS HAVE_MAGICK_FALSE HAVE_MAGICK_TRUE MAGICK_LIBS MAGICK_CFLAGS HAVE_JPEG_FALSE HAVE_JPEG_TRUE HAVE_XV_FALSE HAVE_XV_TRUE XV_LIBS HAVE_XSHM_FALSE HAVE_XSHM_TRUE HAVE_X_FALSE HAVE_X_TRUE X_EXTRA_LIBS X_LIBS X_PRE_LIBS X_CFLAGS XMKMF XSHM_LIBS HAVE_V4L2_FALSE HAVE_V4L2_TRUE HAVE_V4L1_FALSE HAVE_V4L1_TRUE HAVE_VIDEO_FALSE HAVE_VIDEO_TRUE HAVE_POLL_FALSE HAVE_POLL_TRUE LTLIBICONV LIBICONV ENABLE_QRCODE_FALSE ENABLE_QRCODE_TRUE ENABLE_I25_FALSE ENABLE_I25_TRUE ENABLE_PDF417_FALSE ENABLE_PDF417_TRUE ENABLE_CODE39_FALSE ENABLE_CODE39_TRUE ENABLE_CODE128_FALSE ENABLE_CODE128_TRUE ENABLE_EAN_FALSE ENABLE_EAN_TRUE XMLTOFLAGS XMLTO PKG_CONFIG CXXCPP am__fastdepCXX_FALSE am__fastdepCXX_TRUE CXXDEPMODE ac_ct_CXX CXXFLAGS CXX WIN32_FALSE WIN32_TRUE ZQT_LIB_VERSION ZGTK_LIB_VERSION RELDATE LIB_VERSION RC CPP OTOOL64 OTOOL LIPO NMEDIT DSYMUTIL lt_ECHO RANLIB AR LN_S NM ac_ct_DUMPBIN DUMPBIN LD FGREP EGREP GREP SED am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC host_os host_vendor host_cpu host build_os build_vendor build_cpu build LIBTOOL OBJDUMP DLLTOOL AS am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_shared enable_static with_pic enable_fast_install enable_dependency_tracking with_gnu_ld enable_libtool_lock enable_codes enable_rpath with_libiconv_prefix enable_pthread enable_video with_x with_xshm with_xv with_jpeg with_imagemagick with_npapi with_gtk with_python with_qt enable_assert ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP CXX CXXFLAGS CCC CXXCPP PKG_CONFIG XMLTO XMLTOFLAGS XSHM_LIBS XMKMF XV_LIBS MAGICK_CFLAGS MAGICK_LIBS NPAPI_CFLAGS NPAPI_LIBS GLIB_GENMARSHAL GTK_CFLAGS GTK_LIBS PYTHON_CONFIG PYTHON_CFLAGS PYTHON_LIBS PYGTK_H2DEF PYGTK_CODEGEN PYGTK_DEFS PYGTK_CFLAGS PYGTK_LIBS MOC QT_CFLAGS QT_LIBS' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 { (exit 1); exit 1; }; } ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures zbar 0.10 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/zbar] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names X features: --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of zbar 0.10:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared[=PKGS] build shared libraries [default=yes] --enable-static[=PKGS] build static libraries [default=yes] --enable-fast-install[=PKGS] optimize for fast installation [default=yes] --disable-dependency-tracking speeds up one-time build --enable-dependency-tracking do not reject slow dependency extractors --disable-libtool-lock avoid locking (might break parallel builds) --enable-codes=SYMS select symbologies to compile [default=ean,i25,code39,code128,qrcode] --disable-rpath do not hardcode runtime library paths --disable-pthread omit support for threaded applications --disable-video exclude video scanner features --disable-assert turn off assertions Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-pic try to use only PIC/non-PIC objects [default=use both] --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-gnu-ld assume the C compiler uses GNU ld default=no --with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib --without-libiconv-prefix don't search for libiconv in includedir and libdir --with-x use the X Window System --without-xshm disable support for X shared memory extension --without-xv disable support for XVideo extension --without-jpeg disable support for JPEG image conversions --without-imagemagick disable support for scanning images using ImageMagick --with-npapi enable support for Firefox/Mozilla/OpenOffice NPAPI plugin --without-gtk disable support for GTK+ widget --without-python disable support for Python bindings --without-qt disable support for Qt4 widget Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags CXXCPP C++ preprocessor PKG_CONFIG path to pkg-config utility XMLTO location of xmlto, used for optional documentation generation XMLTOFLAGS additional arguments for xmlto XSHM_LIBS linker flags for X shared memory extension XMKMF Path to xmkmf, Makefile generator for X Window System XV_LIBS linker flags for XVideo extension MAGICK_CFLAGS C compiler flags for MAGICK, overriding pkg-config MAGICK_LIBS linker flags for MAGICK, overriding pkg-config NPAPI_CFLAGS C compiler flags for NPAPI, overriding pkg-config NPAPI_LIBS linker flags for NPAPI, overriding pkg-config GLIB_GENMARSHAL full path to glib-genmarshal GTK_CFLAGS C compiler flags for GTK, overriding pkg-config GTK_LIBS linker flags for GTK, overriding pkg-config PYTHON_CONFIG full path to python-config program PYTHON_CFLAGS compiler flags for building python extensions PYTHON_LIBS linker flags for building python extensions PYGTK_H2DEF full path to PyGTK h2def.py module PYGTK_CODEGEN full path to pygtk-codegen program PYGTK_DEFS directory where PyGTK definitions may be found PYGTK_CFLAGS C compiler flags for PYGTK, overriding pkg-config PYGTK_LIBS linker flags for PYGTK, overriding pkg-config MOC full path to Qt moc program QT_CFLAGS C compiler flags for QT, overriding pkg-config QT_LIBS linker flags for QT, overriding pkg-config Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF zbar configure 0.10 generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by zbar $as_me 0.10, which was generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; 2) ac_configure_args1="$ac_configure_args1 '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done done $as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo cat <<\_ASBOX ## ---------------- ## ## Cache variables. ## ## ---------------- ## _ASBOX echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo cat <<\_ASBOX ## ----------------- ## ## Output variables. ## ## ----------------- ## _ASBOX echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX ## ------------------- ## ## File substitutions. ## ## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then cat <<\_ASBOX ## ----------- ## ## confdefs.h. ## ## ----------- ## _ASBOX echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 $as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in config "$srcdir"/config; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&5 $as_echo "$as_me: error: cannot find install-sh or install.sh in config \"$srcdir\"/config" >&2;} { (exit 1); exit 1; }; } fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.10' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in ./ | .// | /cC/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:$LINENO: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Just in case sleep 1 echo timestamp > conftest.file # Do `set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t $srcdir/configure conftest.file` fi rm -f conftest.file if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". { { $as_echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&5 $as_echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken alias in your environment" >&2;} { (exit 1); exit 1; }; } fi test "$2" = conftest.file ) then # Ok. : else { { $as_echo "$as_me:$LINENO: error: newly created file is older than distributed files! Check your system clock" >&5 $as_echo "$as_me: error: newly created file is older than distributed files! Check your system clock" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # expand $ac_aux_dir to an absolute path am_aux_dir=`cd $ac_aux_dir && pwd` test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing" # Use eval to expand $SHELL if eval "$MISSING --run true"; then am_missing_run="$MISSING --run " else am_missing_run= { $as_echo "$as_me:$LINENO: WARNING: \`missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;} fi { $as_echo "$as_me:$LINENO: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if test "${ac_cv_path_mkdir+set}" = set; then $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. test -d ./--version && rmdir ./--version MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:$LINENO: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } mkdir_p="$MKDIR_P" case $mkdir_p in [\\/$]* | ?:[\\/]*) ;; */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;; esac for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:$LINENO: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then { { $as_echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 $as_echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} { (exit 1); exit 1; }; } fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='zbar' VERSION='0.10' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} install_sh=${install_sh-"\$(SHELL) $am_aux_dir/install-sh"} # Installed binaries are usually stripped using `strip' when the user # run `make install-strip'. However `strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the `STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" # We need awk for the "check" target. The system "awk" is bad on # some platforms. # Always define AMTAR for backward compatibility. AMTAR=${AMTAR-"${am_missing_run}tar"} am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -' ac_config_headers="$ac_config_headers include/config.h" case `pwd` in *\ * | *\ *) { $as_echo "$as_me:$LINENO: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5 $as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;; esac macro_version='2.2.6' macro_revision='1.3012' ltmain="$ac_aux_dir/ltmain.sh" # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 $as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 $as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi { $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 $as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo done .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:$LINENO: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # We grep out `Entering directory' and `Leaving directory' # messages which can occur if `w' ends up in MAKEFLAGS. # In particular we don't look at `^make:' because GNU make might # be invoked under some other name (usually "gmake"), in which # case it prints its new name instead of `make'. if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then am__include=include am__quote= _am_result=GNU fi # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then am__include=.include am__quote="\"" _am_result=BSD fi fi { $as_echo "$as_me:$LINENO: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { (ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi { $as_echo "$as_me:$LINENO: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } if test -z "$ac_file"; then $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 $as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } { $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } { $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext { $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT { $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 $as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:$LINENO: checking for a sed that does not truncate output" >&5 $as_echo_n "checking for a sed that does not truncate output... " >&6; } if test "${ac_cv_path_SED+set}" = set; then $as_echo_n "(cached) " >&6 else ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/ for ac_i in 1 2 3 4 5 6 7; do ac_script="$ac_script$as_nl$ac_script" done echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed $as_unset ac_script || ac_script= if test -z "$SED"; then ac_path_SED_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_SED="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue # Check for GNU ac_path_SED and select it if it is found. # Check for GNU $ac_path_SED case `"$ac_path_SED" --version 2>&1` in *GNU*) ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo '' >> "conftest.nl" "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_SED_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_SED="$ac_path_SED" ac_path_SED_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_SED_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_SED"; then { { $as_echo "$as_me:$LINENO: error: no acceptable sed could be found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable sed could be found in \$PATH" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_SED=$SED fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_SED" >&5 $as_echo "$ac_cv_path_SED" >&6; } SED="$ac_cv_path_SED" rm -f conftest.sed test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" { $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:$LINENO: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:$LINENO: checking for fgrep" >&5 $as_echo_n "checking for fgrep... " >&6; } if test "${ac_cv_path_FGREP+set}" = set; then $as_echo_n "(cached) " >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else if test -z "$FGREP"; then ac_path_FGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in fgrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext" { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue # Check for GNU ac_path_FGREP and select it if it is found. # Check for GNU $ac_path_FGREP case `"$ac_path_FGREP" --version 2>&1` in *GNU*) ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'FGREP' >> "conftest.nl" "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` if test $ac_count -gt ${ac_path_FGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_FGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_FGREP"; then { { $as_echo "$as_me:$LINENO: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 $as_echo "$as_me: error: no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } fi else ac_cv_path_FGREP=$FGREP fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_path_FGREP" >&5 $as_echo "$ac_cv_path_FGREP" >&6; } FGREP="$ac_cv_path_FGREP" test -z "$GREP" && GREP=grep # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld { $as_echo "$as_me:$LINENO: checking for BSD- or MS-compatible name lister (nm)" >&5 $as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; } if test "${lt_cv_path_NM+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi fi { $as_echo "$as_me:$LINENO: result: $lt_cv_path_NM" >&5 $as_echo "$lt_cv_path_NM" >&6; } if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$ac_tool_prefix"; then for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DUMPBIN+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$DUMPBIN"; then ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DUMPBIN=$ac_cv_prog_DUMPBIN if test -n "$DUMPBIN"; then { $as_echo "$as_me:$LINENO: result: $DUMPBIN" >&5 $as_echo "$DUMPBIN" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$DUMPBIN" && break done fi if test -z "$DUMPBIN"; then ac_ct_DUMPBIN=$DUMPBIN for ac_prog in "dumpbin -symbols" "link -dump -symbols" do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DUMPBIN+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DUMPBIN"; then ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DUMPBIN="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN if test -n "$ac_ct_DUMPBIN"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_DUMPBIN" >&5 $as_echo "$ac_ct_DUMPBIN" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_DUMPBIN" && break done if test "x$ac_ct_DUMPBIN" = x; then DUMPBIN=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DUMPBIN=$ac_ct_DUMPBIN fi fi if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm { $as_echo "$as_me:$LINENO: checking the name lister ($NM) interface" >&5 $as_echo_n "checking the name lister ($NM) interface... " >&6; } if test "${lt_cv_nm_interface+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:4512: $ac_compile\"" >&5) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&5 (eval echo "\"\$as_me:4515: $NM \\\"conftest.$ac_objext\\\"\"" >&5) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&5 (eval echo "\"\$as_me:4518: output\"" >&5) cat conftest.out >&5 if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_nm_interface" >&5 $as_echo "$lt_cv_nm_interface" >&6; } { $as_echo "$as_me:$LINENO: checking whether ln -s works" >&5 $as_echo_n "checking whether ln -s works... " >&6; } LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no, using $LN_S" >&5 $as_echo "no, using $LN_S" >&6; } fi # find the maximum length of command line arguments { $as_echo "$as_me:$LINENO: checking the maximum length of command line arguments" >&5 $as_echo_n "checking the maximum length of command line arguments... " >&6; } if test "${lt_cv_sys_max_cmd_len+set}" = set; then $as_echo_n "(cached) " >&6 else i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[ ]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`$SHELL $0 --fallback-echo "X$teststring$teststring" 2>/dev/null` \ = "XX$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac fi if test -n $lt_cv_sys_max_cmd_len ; then { $as_echo "$as_me:$LINENO: result: $lt_cv_sys_max_cmd_len" >&5 $as_echo "$lt_cv_sys_max_cmd_len" >&6; } else { $as_echo "$as_me:$LINENO: result: none" >&5 $as_echo "none" >&6; } fi max_cmd_len=$lt_cv_sys_max_cmd_len : ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} { $as_echo "$as_me:$LINENO: checking whether the shell understands some XSI constructs" >&5 $as_echo_n "checking whether the shell understands some XSI constructs... " >&6; } # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes { $as_echo "$as_me:$LINENO: result: $xsi_shell" >&5 $as_echo "$xsi_shell" >&6; } { $as_echo "$as_me:$LINENO: checking whether the shell understands \"+=\"" >&5 $as_echo_n "checking whether the shell understands \"+=\"... " >&6; } lt_shell_append=no ( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes { $as_echo "$as_me:$LINENO: result: $lt_shell_append" >&5 $as_echo "$lt_shell_append" >&6; } if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac { $as_echo "$as_me:$LINENO: checking for $LD option to reload object files" >&5 $as_echo_n "checking for $LD option to reload object files... " >&6; } if test "${lt_cv_ld_reload_flag+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_ld_reload_flag='-r' fi { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_reload_flag" >&5 $as_echo "$lt_cv_ld_reload_flag" >&6; } reload_flag=$lt_cv_ld_reload_flag case $reload_flag in "" | " "*) ;; *) reload_flag=" $reload_flag" ;; esac reload_cmds='$LD$reload_flag -o $output$reload_objs' case $host_os in darwin*) if test "$GCC" = yes; then reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs' else reload_cmds='$LD$reload_flag -o $output$reload_objs' fi ;; esac if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi test -z "$OBJDUMP" && OBJDUMP=objdump { $as_echo "$as_me:$LINENO: checking how to recognize dependent libraries" >&5 $as_echo_n "checking how to recognize dependent libraries... " >&6; } if test "${lt_cv_deplibs_check_method+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_file_magic_cmd='$MAGIC_CMD' lt_cv_file_magic_test_file= lt_cv_deplibs_check_method='unknown' # Need to set the preceding variable on all platforms that support # interlibrary dependencies. # 'none' -- dependencies not supported. # `unknown' -- same as none, but documents that we really don't know. # 'pass_all' -- all dependencies passed with no checks. # 'test_compile' -- check by making test program. # 'file_magic [[regex]]' -- check by looking for files in library path # which responds to the $file_magic_cmd with a given extended regex. # If you have `file' or equivalent on your system and you're not sure # whether `pass_all' will *always* work, you probably want this one. case $host_os in aix[4-9]*) lt_cv_deplibs_check_method=pass_all ;; beos*) lt_cv_deplibs_check_method=pass_all ;; bsdi[45]*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' lt_cv_file_magic_cmd='/usr/bin/file -L' lt_cv_file_magic_test_file=/shlib/libc.so ;; cygwin*) # func_win32_libid is a shell function defined in ltmain.sh lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' ;; mingw* | pw32*) # Base MSYS/MinGW do not provide the 'file' command needed by # func_win32_libid shell function, so use a weaker test based on 'objdump', # unless we find 'file', for example because we are cross-compiling. if ( file / ) >/dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; gnu*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - PA-RISC [0-9].[0-9]' lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[3-9]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be Linux ELF. linux* | k*bsd*-gnu) lt_cv_deplibs_check_method=pass_all ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac fi { $as_echo "$as_me:$LINENO: result: $lt_cv_deplibs_check_method" >&5 $as_echo "$lt_cv_deplibs_check_method" >&6; } file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AR+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then { $as_echo "$as_me:$LINENO: result: $AR" >&5 $as_echo "$AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AR+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_AR" >&5 $as_echo "$ac_ct_AR" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AR" = x; then AR="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AR=$ac_ct_AR fi else AR="$ac_cv_prog_AR" fi test -z "$AR" && AR=ar test -z "$AR_FLAGS" && AR_FLAGS=cru if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi test -z "$STRIP" && STRIP=: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then { $as_echo "$as_me:$LINENO: result: $RANLIB" >&5 $as_echo "$RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5 $as_echo "$ac_ct_RANLIB" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RANLIB" = x; then RANLIB=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RANLIB=$ac_ct_RANLIB fi else RANLIB="$ac_cv_prog_RANLIB" fi test -z "$RANLIB" && RANLIB=: # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" fi # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Check for command to grab the raw symbol name followed by C symbol from nm. { $as_echo "$as_me:$LINENO: checking command to parse $NM output from $compiler object" >&5 $as_echo_n "checking command to parse $NM output from $compiler object... " >&6; } if test "${lt_cv_sys_global_symbol_pipe+set}" = set; then $as_echo_n "(cached) " >&6 else # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[BCDEGRST]' # Regexp to match symbols that can be accessed directly from C. sympat='\([_A-Za-z][_A-Za-z0-9]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[BCDT]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[ABCDGISTW]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[ABCDEGRST]' fi ;; irix* | nonstopux*) symcode='[BCDEGRST]' ;; osf*) symcode='[BCDEGQRST]' ;; solaris*) symcode='[BDRT]' ;; sco3.2v5*) symcode='[DT]' ;; sysv4.2uw2*) symcode='[DT]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[ABDT]' ;; sysv4) symcode='[DFNSTU]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[ABCDGIRSTW]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK '"\ " {last_section=section; section=\$ 3};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Now try to grab the symbols. nlist=conftest.nm if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist\"") >&5 (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $nlist) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ const struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_save_LIBS="$LIBS" lt_save_CFLAGS="$CFLAGS" LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag" if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS="$lt_save_LIBS" CFLAGS="$lt_save_CFLAGS" else echo "cannot find nm_test_func in $nlist" >&5 fi else echo "cannot find nm_test_var in $nlist" >&5 fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5 fi else echo "$progname: failed program was:" >&5 cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done fi if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then { $as_echo "$as_me:$LINENO: result: failed" >&5 $as_echo "failed" >&6; } else { $as_echo "$as_me:$LINENO: result: ok" >&5 $as_echo "ok" >&6; } fi # Check whether --enable-libtool-lock was given. if test "${enable_libtool_lock+set}" = set; then enableval=$enable_libtool_lock; fi test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '#line 5721 "configure"' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" { $as_echo "$as_me:$LINENO: checking whether the C compiler needs -belf" >&5 $as_echo_n "checking whether the C compiler needs -belf... " >&6; } if test "${lt_cv_cc_needs_belf+set}" = set; then $as_echo_n "(cached) " >&6 else ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_cc_needs_belf=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_cc_needs_belf=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $lt_cv_cc_needs_belf" >&5 $as_echo "$lt_cv_cc_needs_belf" >&6; } if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; sparc*-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) LD="${LD-ld} -m elf64_sparc" ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" case $host_os in rhapsody* | darwin*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args. set dummy ${ac_tool_prefix}dsymutil; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DSYMUTIL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$DSYMUTIL"; then ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DSYMUTIL=$ac_cv_prog_DSYMUTIL if test -n "$DSYMUTIL"; then { $as_echo "$as_me:$LINENO: result: $DSYMUTIL" >&5 $as_echo "$DSYMUTIL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DSYMUTIL"; then ac_ct_DSYMUTIL=$DSYMUTIL # Extract the first word of "dsymutil", so it can be a program name with args. set dummy dsymutil; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DSYMUTIL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DSYMUTIL"; then ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DSYMUTIL="dsymutil" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL if test -n "$ac_ct_DSYMUTIL"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_DSYMUTIL" >&5 $as_echo "$ac_ct_DSYMUTIL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DSYMUTIL" = x; then DSYMUTIL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DSYMUTIL=$ac_ct_DSYMUTIL fi else DSYMUTIL="$ac_cv_prog_DSYMUTIL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args. set dummy ${ac_tool_prefix}nmedit; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NMEDIT+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$NMEDIT"; then ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi NMEDIT=$ac_cv_prog_NMEDIT if test -n "$NMEDIT"; then { $as_echo "$as_me:$LINENO: result: $NMEDIT" >&5 $as_echo "$NMEDIT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_NMEDIT"; then ac_ct_NMEDIT=$NMEDIT # Extract the first word of "nmedit", so it can be a program name with args. set dummy nmedit; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NMEDIT+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NMEDIT"; then ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NMEDIT="nmedit" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT if test -n "$ac_ct_NMEDIT"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_NMEDIT" >&5 $as_echo "$ac_ct_NMEDIT" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_NMEDIT" = x; then NMEDIT=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NMEDIT=$ac_ct_NMEDIT fi else NMEDIT="$ac_cv_prog_NMEDIT" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args. set dummy ${ac_tool_prefix}lipo; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_LIPO+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$LIPO"; then ac_cv_prog_LIPO="$LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_LIPO="${ac_tool_prefix}lipo" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi LIPO=$ac_cv_prog_LIPO if test -n "$LIPO"; then { $as_echo "$as_me:$LINENO: result: $LIPO" >&5 $as_echo "$LIPO" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_LIPO"; then ac_ct_LIPO=$LIPO # Extract the first word of "lipo", so it can be a program name with args. set dummy lipo; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_LIPO+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_LIPO"; then ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_LIPO="lipo" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO if test -n "$ac_ct_LIPO"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_LIPO" >&5 $as_echo "$ac_ct_LIPO" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_LIPO" = x; then LIPO=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac LIPO=$ac_ct_LIPO fi else LIPO="$ac_cv_prog_LIPO" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args. set dummy ${ac_tool_prefix}otool; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OTOOL"; then ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL="${ac_tool_prefix}otool" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL=$ac_cv_prog_OTOOL if test -n "$OTOOL"; then { $as_echo "$as_me:$LINENO: result: $OTOOL" >&5 $as_echo "$OTOOL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL"; then ac_ct_OTOOL=$OTOOL # Extract the first word of "otool", so it can be a program name with args. set dummy otool; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL"; then ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL="otool" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL if test -n "$ac_ct_OTOOL"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL" >&5 $as_echo "$ac_ct_OTOOL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL" = x; then OTOOL=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL=$ac_ct_OTOOL fi else OTOOL="$ac_cv_prog_OTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args. set dummy ${ac_tool_prefix}otool64; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OTOOL64+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OTOOL64"; then ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OTOOL64=$ac_cv_prog_OTOOL64 if test -n "$OTOOL64"; then { $as_echo "$as_me:$LINENO: result: $OTOOL64" >&5 $as_echo "$OTOOL64" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OTOOL64"; then ac_ct_OTOOL64=$OTOOL64 # Extract the first word of "otool64", so it can be a program name with args. set dummy otool64; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OTOOL64+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OTOOL64"; then ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OTOOL64="otool64" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64 if test -n "$ac_ct_OTOOL64"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OTOOL64" >&5 $as_echo "$ac_ct_OTOOL64" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OTOOL64" = x; then OTOOL64=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OTOOL64=$ac_ct_OTOOL64 fi else OTOOL64="$ac_cv_prog_OTOOL64" fi { $as_echo "$as_me:$LINENO: checking for -single_module linker flag" >&5 $as_echo_n "checking for -single_module linker flag... " >&6; } if test "${lt_cv_apple_cc_single_mod+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&5 $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&5 fi rm -rf libconftest.dylib* rm -f conftest.* fi fi { $as_echo "$as_me:$LINENO: result: $lt_cv_apple_cc_single_mod" >&5 $as_echo "$lt_cv_apple_cc_single_mod" >&6; } { $as_echo "$as_me:$LINENO: checking for -exported_symbols_list linker flag" >&5 $as_echo_n "checking for -exported_symbols_list linker flag... " >&6; } if test "${lt_cv_ld_exported_symbols_list+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_cv_ld_exported_symbols_list=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 lt_cv_ld_exported_symbols_list=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_ld_exported_symbols_list" >&5 $as_echo "$lt_cv_ld_exported_symbols_list" >&6; } case $host_os in rhapsody* | darwin1.[012]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[91]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[012]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:$LINENO: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 $as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF #define STDC_HEADERS 1 _ACEOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in dlfcn.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done # Set options enable_dlopen=yes enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-cegcc*) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args. set dummy ${ac_tool_prefix}as; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AS+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$AS"; then ac_cv_prog_AS="$AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AS="${ac_tool_prefix}as" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AS=$ac_cv_prog_AS if test -n "$AS"; then { $as_echo "$as_me:$LINENO: result: $AS" >&5 $as_echo "$AS" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_AS"; then ac_ct_AS=$AS # Extract the first word of "as", so it can be a program name with args. set dummy as; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_AS+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AS"; then ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_AS="as" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_AS=$ac_cv_prog_ac_ct_AS if test -n "$ac_ct_AS"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_AS" >&5 $as_echo "$ac_ct_AS" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_AS" = x; then AS="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac AS=$ac_ct_AS fi else AS="$ac_cv_prog_AS" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args. set dummy ${ac_tool_prefix}dlltool; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_DLLTOOL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$DLLTOOL"; then ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DLLTOOL=$ac_cv_prog_DLLTOOL if test -n "$DLLTOOL"; then { $as_echo "$as_me:$LINENO: result: $DLLTOOL" >&5 $as_echo "$DLLTOOL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_DLLTOOL"; then ac_ct_DLLTOOL=$DLLTOOL # Extract the first word of "dlltool", so it can be a program name with args. set dummy dlltool; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_DLLTOOL+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_DLLTOOL"; then ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_DLLTOOL="dlltool" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL if test -n "$ac_ct_DLLTOOL"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_DLLTOOL" >&5 $as_echo "$ac_ct_DLLTOOL" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_DLLTOOL" = x; then DLLTOOL="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac DLLTOOL=$ac_ct_DLLTOOL fi else DLLTOOL="$ac_cv_prog_DLLTOOL" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args. set dummy ${ac_tool_prefix}objdump; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJDUMP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$OBJDUMP"; then ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi OBJDUMP=$ac_cv_prog_OBJDUMP if test -n "$OBJDUMP"; then { $as_echo "$as_me:$LINENO: result: $OBJDUMP" >&5 $as_echo "$OBJDUMP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_OBJDUMP"; then ac_ct_OBJDUMP=$OBJDUMP # Extract the first word of "objdump", so it can be a program name with args. set dummy objdump; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJDUMP+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJDUMP"; then ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJDUMP="objdump" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP if test -n "$ac_ct_OBJDUMP"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJDUMP" >&5 $as_echo "$ac_ct_OBJDUMP" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_OBJDUMP" = x; then OBJDUMP="false" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJDUMP=$ac_ct_OBJDUMP fi else OBJDUMP="$ac_cv_prog_OBJDUMP" fi ;; esac test -z "$AS" && AS=as test -z "$DLLTOOL" && DLLTOOL=dlltool test -z "$OBJDUMP" && OBJDUMP=objdump # Check whether --enable-shared was given. if test "${enable_shared+set}" = set; then enableval=$enable_shared; p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac else enable_shared=yes fi # Check whether --enable-static was given. if test "${enable_static+set}" = set; then enableval=$enable_static; p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac else enable_static=yes fi # Check whether --with-pic was given. if test "${with_pic+set}" = set; then withval=$with_pic; pic_mode="$withval" else pic_mode=default fi test -z "$pic_mode" && pic_mode=default # Check whether --enable-fast-install was given. if test "${enable_fast_install+set}" = set; then enableval=$enable_fast_install; p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac else enable_fast_install=yes fi # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' test -z "$LN_S" && LN_S="ln -s" if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi { $as_echo "$as_me:$LINENO: checking for objdir" >&5 $as_echo_n "checking for objdir... " >&6; } if test "${lt_cv_objdir+set}" = set; then $as_echo_n "(cached) " >&6 else rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null fi { $as_echo "$as_me:$LINENO: result: $lt_cv_objdir" >&5 $as_echo "$lt_cv_objdir" >&6; } objdir=$lt_cv_objdir cat >>confdefs.h <<_ACEOF #define LT_OBJDIR "$lt_cv_objdir/" _ACEOF case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. sed_quote_subst='s/\(["`$\\]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\(["`\\]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then { $as_echo "$as_me:$LINENO: checking for ${ac_tool_prefix}file" >&5 $as_echo_n "checking for ${ac_tool_prefix}file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/${ac_tool_prefix}file; then lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then { $as_echo "$as_me:$LINENO: checking for file" >&5 $as_echo_n "checking for file... " >&6; } if test "${lt_cv_path_MAGIC_CMD+set}" = set; then $as_echo_n "(cached) " >&6 else case $MAGIC_CMD in [\\/*] | ?:[\\/]*) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR ac_dummy="/usr/bin$PATH_SEPARATOR$PATH" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/file; then lt_cv_path_MAGIC_CMD="$ac_dir/file" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac fi MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then { $as_echo "$as_me:$LINENO: result: $MAGIC_CMD" >&5 $as_echo "$MAGIC_CMD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi else MAGIC_CMD=: fi fi fi ;; esac # Use C for the default configuration in the libtool script lt_save_CC="$CC" ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o objext=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then lt_prog_compiler_no_builtin_flag= if test "$GCC" = yes; then lt_prog_compiler_no_builtin_flag=' -fno-builtin' { $as_echo "$as_me:$LINENO: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 $as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; } if test "${lt_cv_prog_compiler_rtti_exceptions+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_rtti_exceptions=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-fno-rtti -fno-exceptions" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:7875: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:7879: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_rtti_exceptions=yes fi fi $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_rtti_exceptions" >&5 $as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; } if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions" else : fi fi lt_prog_compiler_wl= lt_prog_compiler_pic= lt_prog_compiler_static= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } if test "$GCC" = yes; then lt_prog_compiler_wl='-Wl,' lt_prog_compiler_static='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic='-fno-common' ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) lt_prog_compiler_pic='-fPIC' ;; esac ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. lt_prog_compiler_can_build_shared=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic=-Kconform_pic fi ;; *) lt_prog_compiler_pic='-fPIC' ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) lt_prog_compiler_wl='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static='-Bstatic' else lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). lt_prog_compiler_pic='-DDLL_EXPORT' ;; hpux9* | hpux10* | hpux11*) lt_prog_compiler_wl='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? lt_prog_compiler_static='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) lt_prog_compiler_wl='-Wl,' # PIC (with -KPIC) is the default. lt_prog_compiler_static='-non_shared' ;; linux* | k*bsd*-gnu) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fPIC' lt_prog_compiler_static='-static' ;; # Lahey Fortran 8.1. lf95*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='--shared' lt_prog_compiler_static='--static' ;; pgcc* | pgf77* | pgf90* | pgf95*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-fpic' lt_prog_compiler_static='-Bstatic' ;; ccc*) lt_prog_compiler_wl='-Wl,' # All Alpha code is PIC. lt_prog_compiler_static='-non_shared' ;; xl*) # IBM XL C 8.0/Fortran 10.1 on PPC lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-qpic' lt_prog_compiler_static='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='-Wl,' ;; *Sun\ F*) # Sun Fortran 8.3 passes all unrecognized flags to the linker lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' lt_prog_compiler_wl='' ;; esac ;; esac ;; newsos6) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic='-fPIC -shared' ;; osf3* | osf4* | osf5*) lt_prog_compiler_wl='-Wl,' # All OSF/1 code is PIC. lt_prog_compiler_static='-non_shared' ;; rdos*) lt_prog_compiler_static='-non_shared' ;; solaris*) lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' case $cc_basename in f77* | f90* | f95*) lt_prog_compiler_wl='-Qoption ld ';; *) lt_prog_compiler_wl='-Wl,';; esac ;; sunos4*) lt_prog_compiler_wl='-Qoption ld ' lt_prog_compiler_pic='-PIC' lt_prog_compiler_static='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then lt_prog_compiler_pic='-Kconform_pic' lt_prog_compiler_static='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_pic='-KPIC' lt_prog_compiler_static='-Bstatic' ;; unicos*) lt_prog_compiler_wl='-Wl,' lt_prog_compiler_can_build_shared=no ;; uts4*) lt_prog_compiler_pic='-pic' lt_prog_compiler_static='-Bstatic' ;; *) lt_prog_compiler_can_build_shared=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic= ;; *) lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC" ;; esac { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic" >&5 $as_echo "$lt_prog_compiler_pic" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; } if test "${lt_cv_prog_compiler_pic_works+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8214: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:8218: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works=yes fi fi $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works" >&5 $as_echo "$lt_cv_prog_compiler_pic_works" >&6; } if test x"$lt_cv_prog_compiler_pic_works" = xyes; then case $lt_prog_compiler_pic in "" | " "*) ;; *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;; esac else lt_prog_compiler_pic= lt_prog_compiler_can_build_shared=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\" { $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works=yes fi else lt_cv_prog_compiler_static_works=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works" >&5 $as_echo "$lt_cv_prog_compiler_static_works" >&6; } if test x"$lt_cv_prog_compiler_static_works" = xyes; then : else lt_prog_compiler_static= fi { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8319: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8323: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:8374: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:8378: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o" >&5 $as_echo "$lt_cv_prog_compiler_c_o" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } runpath_var= allow_undefined_flag= always_export_symbols=no archive_cmds= archive_expsym_cmds= compiler_needs_object=no enable_shared_with_static_runtimes=no export_dynamic_flag_spec= export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' hardcode_automatic=no hardcode_direct=no hardcode_direct_absolute=no hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld= hardcode_libdir_separator= hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no link_all_deplibs=unknown module_cmds= module_expsym_cmds= old_archive_from_new_cmds= old_archive_from_expsyms_cmds= thread_safe_flag_spec= whole_archive_flag_spec= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list include_expsyms= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; esac ld_shlibs=yes if test "$with_gnu_ld" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec= fi supports_anon_versioning=no case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[3-9]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.9.1, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to modify your PATH *** so that a non-GNU linker is found, and then restart. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec='-L$libdir' allow_undefined_flag=unsupported always_export_symbols=no enable_shared_with_static_runtimes=yes export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols' if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs=no fi ;; interix[3-9]*) hardcode_direct=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag= tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95*) # Portland Group f77 and f90 compilers whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 whole_archive_flag_spec= tmp_sharedflag='--shared' ;; xl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive' hardcode_libdir_flag_spec= hardcode_libdir_flag_spec_ld='-rpath $libdir' archive_cmds='$LD -shared $libobjs $deplibs $compiler_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $compiler_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else ld_shlibs=no fi ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*) ld_shlibs=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac ;; sunos4*) archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= hardcode_direct=yes hardcode_shlibpath_var=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else ld_shlibs=no fi ;; esac if test "$ld_shlibs" = no; then runpath_var= hardcode_libdir_flag_spec= export_dynamic_flag_spec= whole_archive_flag_spec= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) allow_undefined_flag=unsupported always_export_symbols=yes archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. hardcode_minus_L=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. hardcode_direct=unsupported fi ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds='' hardcode_direct=yes hardcode_direct_absolute=yes hardcode_libdir_separator=':' link_all_deplibs=yes file_list_spec='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L=yes hardcode_libdir_flag_spec='-L$libdir' hardcode_libdir_separator= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. always_export_symbols=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag='-berok' # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag="-z nodefs" archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag=' ${wl}-bernotok' allow_undefined_flag=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec='$convenience' archive_cmds_need_lc=yes # This is similar to how AIX traditionally builds its shared libraries. archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds='' ;; m68k) archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes ;; esac ;; bsdi[45]*) export_dynamic_flag_spec=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. hardcode_libdir_flag_spec=' ' allow_undefined_flag=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. archive_cmds='$CC -o $lib $libobjs $compiler_flags `$ECHO "X$deplibs" | $Xsed -e '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. old_archive_from_new_cmds='true' # FIXME: Should let the user specify the lib program. old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs' fix_srcfile_path='`cygpath -w "$srcfile"`' enable_shared_with_static_runtimes=yes ;; darwin* | rhapsody*) archive_cmds_need_lc=no hardcode_direct=no hardcode_automatic=yes hardcode_shlibpath_var=unsupported whole_archive_flag_spec='' link_all_deplibs=yes allow_undefined_flag="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" else ld_shlibs=no fi ;; dgux*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; freebsd1*) ld_shlibs=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: hardcode_direct=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes export_dynamic_flag_spec='${wl}-E' ;; hpux10*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_flag_spec_ld='+b $libdir' hardcode_libdir_separator=: hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes fi ;; hpux11*) if test "$GCC" = yes -a "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac fi if test "$with_gnu_ld" = no; then hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' hardcode_libdir_separator=: case $host_cpu in hppa*64*|ia64*) hardcode_direct=no hardcode_shlibpath_var=no ;; *) hardcode_direct=yes hardcode_direct_absolute=yes export_dynamic_flag_spec='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. hardcode_minus_L=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" cat >conftest.$ac_ext <<_ACEOF int foo(void) {} _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: inherit_rpath=yes link_all_deplibs=yes ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi hardcode_libdir_flag_spec='-R$libdir' hardcode_direct=yes hardcode_shlibpath_var=no ;; newsos6) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: hardcode_shlibpath_var=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct=yes hardcode_shlibpath_var=no hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else case $host_os in openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*) archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-R$libdir' ;; *) archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' ;; esac fi else ld_shlibs=no fi ;; os2*) hardcode_libdir_flag_spec='-L$libdir' hardcode_minus_L=yes allow_undefined_flag=unsupported archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~$ECHO DATA >> $output_objdir/$libname.def~$ECHO " SINGLE NONSHARED" >> $output_objdir/$libname.def~$ECHO EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' fi archive_cmds_need_lc='no' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' else allow_undefined_flag=' -expect_unresolved \*' archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly hardcode_libdir_flag_spec='-rpath $libdir' fi archive_cmds_need_lc='no' hardcode_libdir_separator=: ;; solaris*) no_undefined_flag=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi hardcode_libdir_flag_spec='-R$libdir' hardcode_shlibpath_var=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else whole_archive_flag_spec='-z allextract$convenience -z defaultextract' fi ;; esac link_all_deplibs=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi hardcode_libdir_flag_spec='-L$libdir' hardcode_direct=yes hardcode_minus_L=yes hardcode_shlibpath_var=no ;; sysv4) case $host_vendor in sni) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags' reload_cmds='$CC -r -o $output$reload_objs' hardcode_direct=no ;; motorola) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_direct=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' hardcode_shlibpath_var=no ;; sysv4.3*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no export_dynamic_flag_spec='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_shlibpath_var=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes ld_shlibs=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag='${wl}-z,text' archive_cmds_need_lc=no hardcode_shlibpath_var=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag='${wl}-z,text' allow_undefined_flag='${wl}-z,nodefs' archive_cmds_need_lc=no hardcode_shlibpath_var=no hardcode_libdir_flag_spec='${wl}-R,$libdir' hardcode_libdir_separator=':' link_all_deplibs=yes export_dynamic_flag_spec='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' hardcode_libdir_flag_spec='-L$libdir' hardcode_shlibpath_var=no ;; *) ld_shlibs=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) export_dynamic_flag_spec='${wl}-Blargedynsym' ;; esac fi fi { $as_echo "$as_me:$LINENO: result: $ld_shlibs" >&5 $as_echo "$ld_shlibs" >&6; } test "$ld_shlibs" = no && can_build_shared=no with_gnu_ld=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc" in x|xyes) # Assume -lc should be added archive_cmds_need_lc=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl pic_flag=$lt_prog_compiler_pic compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag allow_undefined_flag= if { (eval echo "$as_me:$LINENO: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc=no else archive_cmds_need_lc=yes fi allow_undefined_flag=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc" >&5 $as_echo "$archive_cmds_need_lc" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$lt_search_path_spec" | $GREP ';' >/dev/null ; then # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e 's/;/ /g'` else lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO $lt_tmp_lt_search_path_spec | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[lt_foo]++; } if (lt_freq[lt_foo] == 1) { print lt_foo; } }'` sys_lib_search_path_spec=`$ECHO $lt_search_path_spec` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib" sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi # Handle Gentoo/FreeBSD as it was Linux case $host_vendor in gentoo) version_type=linux ;; *) version_type=freebsd-$objformat ;; esac case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; linux) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' need_lib_prefix=no need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\"" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then shlibpath_overrides_runpath=yes fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action= if test -n "$hardcode_libdir_flag_spec" || test -n "$runpath_var" || test "X$hardcode_automatic" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no && test "$hardcode_minus_L" != no; then # Linking always hardcodes the temporary library directory. hardcode_action=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action=unsupported fi { $as_echo "$as_me:$LINENO: result: $hardcode_action" >&5 $as_echo "$hardcode_action" >&6; } if test "$hardcode_action" = relink || test "$inherit_rpath" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes fi ;; *) { $as_echo "$as_me:$LINENO: checking for shl_load" >&5 $as_echo_n "checking for shl_load... " >&6; } if test "${ac_cv_func_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shl_load to an innocuous variant, in case declares shl_load. For example, HP-UX 11i declares gettimeofday. */ #define shl_load innocuous_shl_load /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shl_load (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shl_load /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shl_load || defined __stub___shl_load choke me #endif int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shl_load" >&5 $as_echo "$ac_cv_func_shl_load" >&6; } if test "x$ac_cv_func_shl_load" = x""yes; then lt_cv_dlopen="shl_load" else { $as_echo "$as_me:$LINENO: checking for shl_load in -ldld" >&5 $as_echo_n "checking for shl_load in -ldld... " >&6; } if test "${ac_cv_lib_dld_shl_load+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shl_load (); int main () { return shl_load (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_shl_load=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_shl_load=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_shl_load" >&5 $as_echo "$ac_cv_lib_dld_shl_load" >&6; } if test "x$ac_cv_lib_dld_shl_load" = x""yes; then lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" else { $as_echo "$as_me:$LINENO: checking for dlopen" >&5 $as_echo_n "checking for dlopen... " >&6; } if test "${ac_cv_func_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define dlopen to an innocuous variant, in case declares dlopen. For example, HP-UX 11i declares gettimeofday. */ #define dlopen innocuous_dlopen /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlopen (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef dlopen /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_dlopen || defined __stub___dlopen choke me #endif int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5 $as_echo "$ac_cv_func_dlopen" >&6; } if test "x$ac_cv_func_dlopen" = x""yes; then lt_cv_dlopen="dlopen" else { $as_echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } if test "${ac_cv_lib_dl_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dl_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dl_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } if test "x$ac_cv_lib_dl_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" else { $as_echo "$as_me:$LINENO: checking for dlopen in -lsvld" >&5 $as_echo_n "checking for dlopen in -lsvld... " >&6; } if test "${ac_cv_lib_svld_dlopen+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsvld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dlopen (); int main () { return dlopen (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_svld_dlopen=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_svld_dlopen=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_svld_dlopen" >&5 $as_echo "$ac_cv_lib_svld_dlopen" >&6; } if test "x$ac_cv_lib_svld_dlopen" = x""yes; then lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld" else { $as_echo "$as_me:$LINENO: checking for dld_link in -ldld" >&5 $as_echo_n "checking for dld_link in -ldld... " >&6; } if test "${ac_cv_lib_dld_dld_link+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldld $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dld_link (); int main () { return dld_link (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dld_dld_link=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dld_dld_link=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dld_dld_link" >&5 $as_echo "$ac_cv_lib_dld_dld_link" >&6; } if test "x$ac_cv_lib_dld_dld_link" = x""yes; then lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" fi fi fi fi fi fi ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" { $as_echo "$as_me:$LINENO: checking whether a program can dlopen itself" >&5 $as_echo_n "checking whether a program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 11187 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;; esac else : # compilation failed lt_cv_dlopen_self=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self" >&5 $as_echo "$lt_cv_dlopen_self" >&6; } if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" { $as_echo "$as_me:$LINENO: checking whether a statically linked program can dlopen itself" >&5 $as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; } if test "${lt_cv_dlopen_self_static+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : lt_cv_dlopen_self_static=cross else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF #line 11283 "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif void fnord() { int i=42;} int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; /* dlclose (self); */ } else puts (dlerror ()); return status; } _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&5 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;; x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;; esac else : # compilation failed lt_cv_dlopen_self_static=no fi fi rm -fr conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_dlopen_self_static" >&5 $as_echo "$lt_cv_dlopen_self_static" >&6; } fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi striplib= old_striplib= { $as_echo "$as_me:$LINENO: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi ;; *) { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } ;; esac fi # Report which library types will actually be built { $as_echo "$as_me:$LINENO: checking if libtool supports shared libraries" >&5 $as_echo_n "checking if libtool supports shared libraries... " >&6; } { $as_echo "$as_me:$LINENO: result: $can_build_shared" >&5 $as_echo "$can_build_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build shared libraries" >&5 $as_echo_n "checking whether to build shared libraries... " >&6; } test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[4-9]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac { $as_echo "$as_me:$LINENO: result: $enable_shared" >&5 $as_echo "$enable_shared" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build static libraries" >&5 $as_echo_n "checking whether to build static libraries... " >&6; } # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes { $as_echo "$as_me:$LINENO: result: $enable_static" >&5 $as_echo "$enable_static" >&6; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" ac_config_commands="$ac_config_commands libtool" # Only expand once: if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}windres", so it can be a program name with args. set dummy ${ac_tool_prefix}windres; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_RC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$RC"; then ac_cv_prog_RC="$RC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_RC="${ac_tool_prefix}windres" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi RC=$ac_cv_prog_RC if test -n "$RC"; then { $as_echo "$as_me:$LINENO: result: $RC" >&5 $as_echo "$RC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_RC"; then ac_ct_RC=$RC # Extract the first word of "windres", so it can be a program name with args. set dummy windres; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_RC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RC"; then ac_cv_prog_ac_ct_RC="$ac_ct_RC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_RC="windres" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_RC=$ac_cv_prog_ac_ct_RC if test -n "$ac_ct_RC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_RC" >&5 $as_echo "$ac_ct_RC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_RC" = x; then RC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac RC=$ac_ct_RC fi else RC="$ac_cv_prog_RC" fi # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o objext_RC=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC GCC= CC=${RC-"windres"} compiler=$CC compiler_RC=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` lt_cv_prog_compiler_c_o_RC=yes if test -n "$compiler"; then : fi GCC=$lt_save_GCC ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu CC="$lt_save_CC" LIB_VERSION=2:0:2 RELDATE=2009-10-23 ZGTK_LIB_VERSION=0:2:0 ZQT_LIB_VERSION=0:2:0 cat >>confdefs.h <<_ACEOF #define ZBAR_VERSION_MAJOR `echo "$PACKAGE_VERSION" | sed -e 's/\..*$//'` _ACEOF cat >>confdefs.h <<_ACEOF #define ZBAR_VERSION_MINOR `echo "$PACKAGE_VERSION" | sed -e 's/^[^.]*\.\([^.]*\)$/\1/'` _ACEOF cur=`echo "$LIB_VERSION" | sed -e 's/:.*$//'` age=`echo "$LIB_VERSION" | sed -e 's/^.*://'` cat >>confdefs.h <<_ACEOF #define LIB_VERSION_MAJOR $(( $cur - $age )) _ACEOF cat >>confdefs.h <<_ACEOF #define LIB_VERSION_MINOR $age _ACEOF cat >>confdefs.h <<_ACEOF #define LIB_VERSION_REVISION `echo "$LIB_VERSION" | sed -e 's/^[^:]*:\([^:]*\):.*$/\1/'` _ACEOF { $as_echo "$as_me:$LINENO: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 $as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 $as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac case $host_os in *cygwin* | *mingw* | *uwin* | *djgpp* | *ems* ) win32="yes" cat >>confdefs.h <<\_ACEOF #define _WIN32_WINNT 0x0500 _ACEOF ;; * ) win32="no" ;; esac if test "x$win32" = "xyes"; then WIN32_TRUE= WIN32_FALSE='#' else WIN32_TRUE='#' WIN32_FALSE= fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:$LINENO: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 $as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:$LINENO: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:$LINENO: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CC" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CC_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi if test "x$CC" != xcc; then { $as_echo "$as_me:$LINENO: checking whether $CC and cc understand -c and -o together" >&5 $as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; } else { $as_echo "$as_me:$LINENO: checking whether cc understands -c and -o together" >&5 $as_echo_n "checking whether cc understands -c and -o together... " >&6; } fi set dummy $CC; ac_cc=`$as_echo "$2" | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then eval ac_cv_prog_cc_${ac_cc}_c_o=yes if test "x$CC" != xcc; then # Test first that cc exists at all. if { ac_try='cc -c conftest.$ac_ext >&5' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5' rm -f conftest2.* if { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -f conftest2.$ac_objext && { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # cc works too. : else # cc exists but doesn't like -o. eval ac_cv_prog_cc_${ac_cc}_c_o=no fi fi fi else eval ac_cv_prog_cc_${ac_cc}_c_o=no fi rm -f core conftest* fi if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } cat >>confdefs.h <<\_ACEOF #define NO_MINUS_C_MINUS_O 1 _ACEOF fi # FIXME: we rely on the cache variable name because # there is no other way. set dummy $CC am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'` eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o if test "$am_t" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:$LINENO: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { $as_echo "$as_me:$LINENO: result: $CXX" >&5 $as_echo "$CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { $as_echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 $as_echo "$ac_ct_CXX" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. $as_echo "$as_me:$LINENO: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { $as_echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } if test "${ac_cv_cxx_compiler_gnu+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 $as_echo "$ac_cv_cxx_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } if test "${ac_cv_prog_cxx_g+set}" = set; then $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CXXFLAGS="" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cxx_g=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 $as_echo "$ac_cv_prog_cxx_g" >&6; } if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu depcc="$CXX" am_compiler_list= { $as_echo "$as_me:$LINENO: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if test "${am_cv_CXX_dependencies_compiler_type+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named `D' -- because `-MD' means `put the output # in D'. mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CXX_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with # Solaris 8's {/usr,}/bin/sh. touch sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf case $depmode in nosideeffect) # after this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; none) break ;; esac # We check with `-c' and `-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle `-M -o', and we need to detect this. if depmode=$depmode \ source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CXX_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CXX_dependencies_compiler_type=none fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_CXX_dependencies_compiler_type" >&5 $as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; } CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then am__fastdepCXX_TRUE= am__fastdepCXX_FALSE='#' else am__fastdepCXX_TRUE='#' am__fastdepCXX_FALSE= fi if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu { $as_echo "$as_me:$LINENO: checking how to run the C++ preprocessor" >&5 $as_echo_n "checking how to run the C++ preprocessor... " >&6; } if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then $as_echo_n "(cached) " >&6 else # Double quotes because CXXCPP needs to be expanded for CXXCPP in "$CXX -E" "/lib/cpp" do ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then break fi done ac_cv_prog_CXXCPP=$CXXCPP fi CXXCPP=$ac_cv_prog_CXXCPP else ac_cv_prog_CXXCPP=$CXXCPP fi { $as_echo "$as_me:$LINENO: result: $CXXCPP" >&5 $as_echo "$CXXCPP" >&6; } ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" || test ! -s conftest.err }; then # Broken: success on invalid input. continue else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} _lt_caught_CXX_error=yes; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu else _lt_caught_CXX_error=yes fi ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu archive_cmds_need_lc_CXX=no allow_undefined_flag_CXX= always_export_symbols_CXX=no archive_expsym_cmds_CXX= compiler_needs_object_CXX=no export_dynamic_flag_spec_CXX= hardcode_direct_CXX=no hardcode_direct_absolute_CXX=no hardcode_libdir_flag_spec_CXX= hardcode_libdir_flag_spec_ld_CXX= hardcode_libdir_separator_CXX= hardcode_minus_L_CXX=no hardcode_shlibpath_var_CXX=unsupported hardcode_automatic_CXX=no inherit_rpath_CXX=no module_cmds_CXX= module_expsym_cmds_CXX= link_all_deplibs_CXX=unknown old_archive_cmds_CXX=$old_archive_cmds no_undefined_flag_CXX= whole_archive_flag_spec_CXX= enable_shared_with_static_runtimes_CXX=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o objext_CXX=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC # save warnings/boilerplate of simple test code ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} compiler=$CC compiler_CXX=$CC for cc_temp in $compiler""; do case $cc_temp in compile | *[\\/]compile | ccache | *[\\/]ccache ) ;; distcc | *[\\/]distcc | purify | *[\\/]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin' else lt_prog_compiler_no_builtin_flag_CXX= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:$LINENO: checking for ld used by $CC" >&5 $as_echo_n "checking for ld used by $CC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | ?:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${lt_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${lt_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU lds only accept -v. case `$LD -v 2>&1 &5 $as_echo "$lt_cv_prog_gnu_ld" >&6; } with_gnu_ld=$lt_cv_prog_gnu_ld # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else whole_archive_flag_spec_CXX= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } ld_shlibs_CXX=yes case $host_os in aix3*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aix[4-9]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. archive_cmds_CXX='' hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes file_list_spec_CXX='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[012]|aix4.[012].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 hardcode_direct_CXX=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking hardcode_minus_L_CXX=yes hardcode_libdir_flag_spec_CXX='-L$libdir' hardcode_libdir_separator_CXX= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi export_dynamic_flag_spec_CXX='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. always_export_symbols_CXX=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. allow_undefined_flag_CXX='-berok' # Determine the default libpath from the value encoded in an empty # executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then $ECHO "X${wl}${allow_undefined_flag}" | $Xsed; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib' allow_undefined_flag_CXX="-z nodefs" archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then lt_aix_libpath_sed=' /Import File Strings/,/^$/ { /^0/ { s/^0 *\(.*\)$/\1/ p } }' aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$aix_libpath"; then aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. no_undefined_flag_CXX=' ${wl}-bernotok' allow_undefined_flag_CXX=' ${wl}-berok' # Exported symbols can be pulled into shared objects from archives whole_archive_flag_spec_CXX='$convenience' archive_cmds_need_lc_CXX=yes # This is similar to how AIX traditionally builds its shared # libraries. archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then allow_undefined_flag_CXX=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else ld_shlibs_CXX=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless, # as there is no search path for DLLs. hardcode_libdir_flag_spec_CXX='-L$libdir' allow_undefined_flag_CXX=unsupported always_export_symbols_CXX=no enable_shared_with_static_runtimes_CXX=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else ld_shlibs_CXX=no fi ;; darwin* | rhapsody*) archive_cmds_need_lc_CXX=no hardcode_direct_CXX=no hardcode_automatic_CXX=yes hardcode_shlibpath_var_CXX=unsupported whole_archive_flag_spec_CXX='' link_all_deplibs_CXX=yes allow_undefined_flag_CXX="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=echo archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" if test "$lt_cv_apple_cc_single_mod" != "yes"; then archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi else ld_shlibs_CXX=no fi ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; freebsd[12]*) # C++ shared libraries reported to be fairly broken before # switch to ELF ld_shlibs_CXX=no ;; freebsd-elf*) archive_cmds_need_lc_CXX=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions ld_shlibs_CXX=yes ;; gnu*) ;; hpux9*) hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: export_dynamic_flag_spec_CXX='${wl}-E' hardcode_direct_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir' hardcode_libdir_separator_CXX=: case $host_cpu in hppa*64*|ia64*) ;; *) export_dynamic_flag_spec_CXX='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no ;; *) hardcode_direct_CXX=yes hardcode_direct_absolute_CXX=yes hardcode_minus_L_CXX=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; aCC*) case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; interix[3-9]*) hardcode_direct_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` -o $lib' fi fi link_all_deplibs_CXX=yes ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: inherit_rpath_CXX=yes ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac archive_cmds_need_lc_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [1-5]* | *pgcpp\ [1-5]*) prelink_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | $NL2SP`"' old_archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | $NL2SP`~ $RANLIB $oldlib' archive_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 will use weak symbols archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH hardcode_libdir_flag_spec_CXX='-rpath $libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; xl*) # IBM XL 8.0 on PPC, with GNU ld hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' export_dynamic_flag_spec_CXX='${wl}--export-dynamic' archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' hardcode_libdir_flag_spec_CXX='-R$libdir' whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; $ECHO \"$new_convenience\"` ${wl}--no-whole-archive' compiler_needs_object_CXX=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; m88k*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then archive_cmds_CXX='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) ld_shlibs_CXX=yes ;; openbsd2*) # C++ shared libraries are fairly broken ld_shlibs_CXX=no ;; openbsd*) if test -f /usr/libexec/ld.so; then hardcode_direct_CXX=yes hardcode_shlibpath_var_CXX=no hardcode_direct_absolute_CXX=yes archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' export_dynamic_flag_spec_CXX='${wl}-E' whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=echo else ld_shlibs_CXX=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir' hardcode_libdir_separator_CXX=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;; *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; cxx*) case $host in osf3*) allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && $ECHO "X${wl}-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' ;; *) allow_undefined_flag_CXX=' -expect_unresolved \*' archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib' archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "X-set_version $verstring" | $Xsed` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' hardcode_libdir_flag_spec_CXX='-rpath $libdir' ;; esac hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`$ECHO "X$templist" | $Xsed -e "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; $ECHO "X$list" | $Xsed' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "X${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && $ECHO "${wl}-set_version ${wl}$verstring" | $Xsed` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir' hardcode_libdir_separator_CXX=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # FIXME: insert proper C++ library support ld_shlibs_CXX=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ archive_cmds_need_lc_CXX=yes no_undefined_flag_CXX=' -zdefs' archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' hardcode_libdir_flag_spec_CXX='-R$libdir' hardcode_shlibpath_var_CXX=no case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract' ;; esac link_all_deplibs_CXX=yes output_verbose_link_cmd='echo' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then no_undefined_flag_CXX=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP "\-L"' fi hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir' case $host_os in solaris2.[0-5] | solaris2.[0-5].*) ;; *) whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*) no_undefined_flag_CXX='${wl}-z,text' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. no_undefined_flag_CXX='${wl}-z,text' allow_undefined_flag_CXX='${wl}-z,nodefs' archive_cmds_need_lc_CXX=no hardcode_shlibpath_var_CXX=no hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir' hardcode_libdir_separator_CXX=':' link_all_deplibs_CXX=yes export_dynamic_flag_spec_CXX='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; *) # FIXME: insert proper C++ library support ld_shlibs_CXX=no ;; esac { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no GCC_CXX="$GXX" LD_CXX="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... # Dependencies to place before and after the object being linked: predep_objects_CXX= postdep_objects_CXX= predeps_CXX= postdeps_CXX= compiler_lib_search_path_CXX= cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case $p in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue else prev= fi if test "$pre_test_object_deps_done" = no; then case $p in -L* | -R*) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$compiler_lib_search_path_CXX"; then compiler_lib_search_path_CXX="${prev}${p}" else compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$postdeps_CXX"; then postdeps_CXX="${prev}${p}" else postdeps_CXX="${postdeps_CXX} ${prev}${p}" fi fi ;; *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$predep_objects_CXX"; then predep_objects_CXX="$p" else predep_objects_CXX="$predep_objects_CXX $p" fi else if test -z "$postdep_objects_CXX"; then postdep_objects_CXX="$p" else postdep_objects_CXX="$postdep_objects_CXX $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling CXX test program" fi $RM -f confest.$objext # PORTME: override above test on systems where it is broken case $host_os in interix[3-9]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. predep_objects_CXX= postdep_objects_CXX= postdeps_CXX= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then postdeps_CXX='-library=Cstd -library=Crun' fi ;; esac ;; esac case " $postdeps_CXX " in *" -lc "*) archive_cmds_need_lc_CXX=no ;; esac compiler_lib_search_dirs_CXX= if test -n "${compiler_lib_search_path_CXX}"; then compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi lt_prog_compiler_wl_CXX= lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX= { $as_echo "$as_me:$LINENO: checking for $compiler option to produce PIC" >&5 $as_echo_n "checking for $compiler option to produce PIC... " >&6; } # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support lt_prog_compiler_pic_CXX='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries lt_prog_compiler_pic_CXX='-DDLL_EXPORT' ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files lt_prog_compiler_pic_CXX='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all lt_prog_compiler_pic_CXX= ;; interix[3-9]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then lt_prog_compiler_pic_CXX=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; *) lt_prog_compiler_pic_CXX='-fPIC' ;; esac else case $host_os in aix[4-9]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor lt_prog_compiler_static_CXX='-Bstatic' else lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; dgux*) case $cc_basename in ec++*) lt_prog_compiler_pic_CXX='-KPIC' ;; ghcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then lt_prog_compiler_pic_CXX='+Z' fi ;; aCC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) lt_prog_compiler_pic_CXX='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_static_CXX='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu) case $cc_basename in KCC*) # KAI C++ Compiler lt_prog_compiler_wl_CXX='--backend -Wl,' lt_prog_compiler_pic_CXX='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fPIC' lt_prog_compiler_static_CXX='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-fpic' lt_prog_compiler_static_CXX='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; xlc* | xlC*) # IBM XL 8.0 on PPC lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-qpic' lt_prog_compiler_static_CXX='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) lt_prog_compiler_pic_CXX='-W c,exportall' ;; *) ;; esac ;; netbsd*) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. lt_prog_compiler_pic_CXX='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) lt_prog_compiler_wl_CXX='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 lt_prog_compiler_pic_CXX='-pic' ;; cxx*) # Digital/Compaq C++ lt_prog_compiler_wl_CXX='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. lt_prog_compiler_pic_CXX= lt_prog_compiler_static_CXX='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC*) # Sun C++ 4.2, 5.x and Centerline C++ lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' lt_prog_compiler_wl_CXX='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler lt_prog_compiler_pic_CXX='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x lt_prog_compiler_pic_CXX='-pic' lt_prog_compiler_static_CXX='-Bstatic' ;; lcc*) # Lucid lt_prog_compiler_pic_CXX='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) lt_prog_compiler_wl_CXX='-Wl,' lt_prog_compiler_pic_CXX='-KPIC' lt_prog_compiler_static_CXX='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 lt_prog_compiler_pic_CXX='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) lt_prog_compiler_can_build_shared_CXX=no ;; esac fi case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) lt_prog_compiler_pic_CXX= ;; *) lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC" ;; esac { $as_echo "$as_me:$LINENO: result: $lt_prog_compiler_pic_CXX" >&5 $as_echo "$lt_prog_compiler_pic_CXX" >&6; } # # Check to make sure the PIC flag actually works. # if test -n "$lt_prog_compiler_pic_CXX"; then { $as_echo "$as_me:$LINENO: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5 $as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; } if test "${lt_cv_prog_compiler_pic_works_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_pic_works_CXX=no ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15719: $lt_compile\"" >&5) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&5 echo "$as_me:15723: \$? = $ac_status" >&5 if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_pic_works_CXX=yes fi fi $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_pic_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then case $lt_prog_compiler_pic_CXX in "" | " "*) ;; *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;; esac else lt_prog_compiler_pic_CXX= lt_prog_compiler_can_build_shared_CXX=no fi fi # # Check to make sure the static flag actually works. # wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\" { $as_echo "$as_me:$LINENO: checking if $compiler static flag $lt_tmp_static_flag works" >&5 $as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; } if test "${lt_cv_prog_compiler_static_works_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_static_works_CXX=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $lt_tmp_static_flag" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&5 $ECHO "X$_lt_linker_boilerplate" | $Xsed -e '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then lt_cv_prog_compiler_static_works_CXX=yes fi else lt_cv_prog_compiler_static_works_CXX=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_static_works_CXX" >&5 $as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; } if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then : else lt_prog_compiler_static_CXX= fi { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15818: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15822: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } { $as_echo "$as_me:$LINENO: checking if $compiler supports -c -o file.$ac_objext" >&5 $as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; } if test "${lt_cv_prog_compiler_c_o_CXX+set}" = set; then $as_echo_n "(cached) " >&6 else lt_cv_prog_compiler_c_o_CXX=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:15870: $lt_compile\"" >&5) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&5 echo "$as_me:15874: \$? = $ac_status" >&5 if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "X$_lt_compiler_boilerplate" | $Xsed -e '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then lt_cv_prog_compiler_c_o_CXX=yes fi fi chmod u+w . 2>&5 $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* fi { $as_echo "$as_me:$LINENO: result: $lt_cv_prog_compiler_c_o_CXX" >&5 $as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; } hard_links="nottested" if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user { $as_echo "$as_me:$LINENO: checking if we can lock with hard links" >&5 $as_echo_n "checking if we can lock with hard links... " >&6; } hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no { $as_echo "$as_me:$LINENO: result: $hard_links" >&5 $as_echo "$hard_links" >&6; } if test "$hard_links" = no; then { $as_echo "$as_me:$LINENO: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5 $as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;} need_locks=warn fi else need_locks=no fi { $as_echo "$as_me:$LINENO: checking whether the $compiler linker ($LD) supports shared libraries" >&5 $as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; } export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' case $host_os in aix[4-9]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) export_symbols_cmds_CXX="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols' ;; *) export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*' { $as_echo "$as_me:$LINENO: result: $ld_shlibs_CXX" >&5 $as_echo "$ld_shlibs_CXX" >&6; } test "$ld_shlibs_CXX" = no && can_build_shared=no with_gnu_ld_CXX=$with_gnu_ld # # Do we need to explicitly link libc? # case "x$archive_cmds_need_lc_CXX" in x|xyes) # Assume -lc should be added archive_cmds_need_lc_CXX=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $archive_cmds_CXX in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. { $as_echo "$as_me:$LINENO: checking whether -lc should be explicitly linked in" >&5 $as_echo_n "checking whether -lc should be explicitly linked in... " >&6; } $RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$lt_prog_compiler_wl_CXX pic_flag=$lt_prog_compiler_pic_CXX compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$allow_undefined_flag_CXX allow_undefined_flag_CXX= if { (eval echo "$as_me:$LINENO: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\"") >&5 (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } then archive_cmds_need_lc_CXX=no else archive_cmds_need_lc_CXX=yes fi allow_undefined_flag_CXX=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* { $as_echo "$as_me:$LINENO: result: $archive_cmds_need_lc_CXX" >&5 $as_echo "$archive_cmds_need_lc_CXX" >&6; } ;; esac fi ;; esac { $as_echo "$as_me:$LINENO: checking dynamic linker characteristics" >&5 $as_echo_n "checking dynamic linker characteristics... " >&6; } library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[4-9]*) version_type=linux need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[01] | aix4.[01].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$ECHO "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[45]*) version_type=linux need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$host_os in yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*) library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec="/usr/lib /lib/w32api /lib /usr/local/lib" ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' sys_lib_search_path_spec=`$CC -print-search-dirs | $GREP "^libraries:" | $SED -e "s/^libraries://" -e "s,=/,/,g"` if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then # It is most probably a Windows format PATH printed by # mingw gcc, but we are running on Cygwin. Gcc prints its search # path with ; separators, and with drive letters. We can handle the # drive letters (cygwin fileutils understands them), so leave them, # especially as we might pass files found there to a mingw objdump, # which wouldn't understand a cygwinified path. Ahh. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}' ;; esac ;; *) library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib' ;; esac dynamic_linker='Win32 ld.exe' # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd1*) dynamic_linker=no ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[123]*) objformat=aout ;; *) objformat=elf ;; esac fi # Handle Gentoo/FreeBSD as it was Linux case $host_vendor in gentoo) version_type=linux ;; *) version_type=freebsd-$objformat ;; esac case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; linux) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' need_lib_prefix=no need_version=no ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2*) shlibpath_overrides_runpath=yes ;; freebsd3.[01]* | freebsdelf3.[01]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[2-9]* | freebsdelf3.[2-9]* | \ freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; gnu*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555. postinstall_cmds='chmod 555 $lib' ;; interix[3-9]*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be Linux ELF. linux* | k*bsd*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \ LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\"" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then shlibpath_overrides_runpath=yes fi else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS=$save_LDFLAGS libdir=$save_libdir # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[89] | openbsd2.[89].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac { $as_echo "$as_me:$LINENO: result: $dynamic_linker" >&5 $as_echo "$dynamic_linker" >&6; } test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi { $as_echo "$as_me:$LINENO: checking how to hardcode library paths into programs" >&5 $as_echo_n "checking how to hardcode library paths into programs... " >&6; } hardcode_action_CXX= if test -n "$hardcode_libdir_flag_spec_CXX" || test -n "$runpath_var_CXX" || test "X$hardcode_automatic_CXX" = "Xyes" ; then # We can hardcode non-existent directories. if test "$hardcode_direct_CXX" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no && test "$hardcode_minus_L_CXX" != no; then # Linking always hardcodes the temporary library directory. hardcode_action_CXX=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. hardcode_action_CXX=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. hardcode_action_CXX=unsupported fi { $as_echo "$as_me:$LINENO: result: $hardcode_action_CXX" >&5 $as_echo "$hardcode_action_CXX" >&6; } if test "$hardcode_action_CXX" = relink || test "$inherit_rpath_CXX" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi fi # test -n "$compiler" CC=$lt_save_CC LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PKG_CONFIG+set}" = set; then $as_echo_n "(cached) " >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then { $as_echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5 $as_echo "$PKG_CONFIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then $as_echo_n "(cached) " >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then { $as_echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5 $as_echo "$ac_pt_PKG_CONFIG" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_pt_PKG_CONFIG" = x; then PKG_CONFIG="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac PKG_CONFIG=$ac_pt_PKG_CONFIG fi else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi fi if test -n "$PKG_CONFIG"; then _pkg_min_version=0.9.0 { $as_echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5 $as_echo_n "checking pkg-config is at least version $_pkg_min_version... " >&6; } if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } PKG_CONFIG="" fi fi for ac_prog in xmlto do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_XMLTO+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$XMLTO"; then ac_cv_prog_XMLTO="$XMLTO" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_XMLTO="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi XMLTO=$ac_cv_prog_XMLTO if test -n "$XMLTO"; then { $as_echo "$as_me:$LINENO: result: $XMLTO" >&5 $as_echo "$XMLTO" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$XMLTO" && break done test -n "$XMLTO" || XMLTO=":" # Check whether --enable-codes was given. if test "${enable_codes+set}" = set; then enableval=$enable_codes; else enable_codes="ean,code39,code128,i25,qrcode" fi { $as_echo "$as_me:$LINENO: checking whether to build EAN symbologies" >&5 $as_echo_n "checking whether to build EAN symbologies... " >&6; } enable_ean="no" case $enable_codes in *ean* | *all*) enable_ean="yes" cat >>confdefs.h <<\_ACEOF #define ENABLE_EAN 1 _ACEOF ;; esac if test "x$enable_ean" = "xyes"; then ENABLE_EAN_TRUE= ENABLE_EAN_FALSE='#' else ENABLE_EAN_TRUE='#' ENABLE_EAN_FALSE= fi { $as_echo "$as_me:$LINENO: result: $enable_ean" >&5 $as_echo "$enable_ean" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build Code 128 symbology" >&5 $as_echo_n "checking whether to build Code 128 symbology... " >&6; } enable_code128="no" case $enable_codes in *code128* | *all*) enable_code128="yes" cat >>confdefs.h <<\_ACEOF #define ENABLE_CODE128 1 _ACEOF ;; esac if test "x$enable_code128" = "xyes"; then ENABLE_CODE128_TRUE= ENABLE_CODE128_FALSE='#' else ENABLE_CODE128_TRUE='#' ENABLE_CODE128_FALSE= fi { $as_echo "$as_me:$LINENO: result: $enable_code128" >&5 $as_echo "$enable_code128" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build Code 39 symbology" >&5 $as_echo_n "checking whether to build Code 39 symbology... " >&6; } enable_code39="no" case $enable_codes in *code39* | *all*) enable_code39="yes" cat >>confdefs.h <<\_ACEOF #define ENABLE_CODE39 1 _ACEOF ;; esac if test "x$enable_code39" = "xyes"; then ENABLE_CODE39_TRUE= ENABLE_CODE39_FALSE='#' else ENABLE_CODE39_TRUE='#' ENABLE_CODE39_FALSE= fi { $as_echo "$as_me:$LINENO: result: $enable_code39" >&5 $as_echo "$enable_code39" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build PDF417 symbology" >&5 $as_echo_n "checking whether to build PDF417 symbology... " >&6; } enable_pdf417="no" case $enable_codes in *pdf417* | *all*) enable_pdf417="yes" cat >>confdefs.h <<\_ACEOF #define ENABLE_PDF417 1 _ACEOF ;; esac if test "x$enable_pdf417" = "xyes"; then ENABLE_PDF417_TRUE= ENABLE_PDF417_FALSE='#' else ENABLE_PDF417_TRUE='#' ENABLE_PDF417_FALSE= fi { $as_echo "$as_me:$LINENO: result: $enable_pdf417" >&5 $as_echo "$enable_pdf417" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build Interleaved 2 of 5 symbology" >&5 $as_echo_n "checking whether to build Interleaved 2 of 5 symbology... " >&6; } enable_i25="no" case $enable_codes in *i25* | *all*) enable_i25="yes" cat >>confdefs.h <<\_ACEOF #define ENABLE_I25 1 _ACEOF ;; esac if test "x$enable_i25" = "xyes"; then ENABLE_I25_TRUE= ENABLE_I25_FALSE='#' else ENABLE_I25_TRUE='#' ENABLE_I25_FALSE= fi { $as_echo "$as_me:$LINENO: result: $enable_i25" >&5 $as_echo "$enable_i25" >&6; } { $as_echo "$as_me:$LINENO: checking whether to build QR Code" >&5 $as_echo_n "checking whether to build QR Code... " >&6; } enable_qrcode="no" case $enable_codes in *qrcode* | *all*) enable_qrcode="yes" cat >>confdefs.h <<\_ACEOF #define ENABLE_QRCODE 1 _ACEOF ;; esac if test "x$enable_qrcode" = "xyes"; then ENABLE_QRCODE_TRUE= ENABLE_QRCODE_FALSE='#' else ENABLE_QRCODE_TRUE='#' ENABLE_QRCODE_FALSE= fi { $as_echo "$as_me:$LINENO: result: $enable_qrcode" >&5 $as_echo "$enable_qrcode" >&6; } { $as_echo "$as_me:$LINENO: checking for library containing clock_gettime" >&5 $as_echo_n "checking for library containing clock_gettime... " >&6; } if test "${ac_cv_search_clock_gettime+set}" = set; then $as_echo_n "(cached) " >&6 else ac_func_search_save_LIBS=$LIBS cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char clock_gettime (); int main () { return clock_gettime (); ; return 0; } _ACEOF for ac_lib in '' rt; do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_search_clock_gettime=$ac_res else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext if test "${ac_cv_search_clock_gettime+set}" = set; then break fi done if test "${ac_cv_search_clock_gettime+set}" = set; then : else ac_cv_search_clock_gettime=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_search_clock_gettime" >&5 $as_echo "$ac_cv_search_clock_gettime" >&6; } ac_res=$ac_cv_search_clock_gettime if test "$ac_res" != no; then test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi if test "X$prefix" = "XNONE"; then acl_final_prefix="$ac_default_prefix" else acl_final_prefix="$prefix" fi if test "X$exec_prefix" = "XNONE"; then acl_final_exec_prefix='${prefix}' else acl_final_exec_prefix="$exec_prefix" fi acl_save_prefix="$prefix" prefix="$acl_final_prefix" eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" prefix="$acl_save_prefix" # Check whether --with-gnu-ld was given. if test "${with_gnu_ld+set}" = set; then withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes else with_gnu_ld=no fi # Prepare PATH_SEPARATOR. # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then echo "#! /bin/sh" >conf$$.sh echo "exit 0" >>conf$$.sh chmod +x conf$$.sh if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then PATH_SEPARATOR=';' else PATH_SEPARATOR=: fi rm -f conf$$.sh fi ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. { $as_echo "$as_me:$LINENO: checking for ld used by GCC" >&5 $as_echo_n "checking for ld used by GCC... " >&6; } case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [\\/]* | [A-Za-z]:[\\/]*) re_direlt='/[^/][^/]*/\.\./' # Canonicalize the path of ld ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then { $as_echo "$as_me:$LINENO: checking for GNU ld" >&5 $as_echo_n "checking for GNU ld... " >&6; } else { $as_echo "$as_me:$LINENO: checking for non-GNU ld" >&5 $as_echo_n "checking for non-GNU ld... " >&6; } fi if test "${acl_cv_path_LD+set}" = set; then $as_echo_n "(cached) " >&6 else if test -z "$LD"; then IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" for ac_dir in $PATH; do test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then acl_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some GNU ld's only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in *GNU* | *'with BFD'*) test "$with_gnu_ld" != no && break ;; *) test "$with_gnu_ld" != yes && break ;; esac fi done IFS="$ac_save_ifs" else acl_cv_path_LD="$LD" # Let the user override the test with a path. fi fi LD="$acl_cv_path_LD" if test -n "$LD"; then { $as_echo "$as_me:$LINENO: result: $LD" >&5 $as_echo "$LD" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -z "$LD" && { { $as_echo "$as_me:$LINENO: error: no acceptable ld found in \$PATH" >&5 $as_echo "$as_me: error: no acceptable ld found in \$PATH" >&2;} { (exit 1); exit 1; }; } { $as_echo "$as_me:$LINENO: checking if the linker ($LD) is GNU ld" >&5 $as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; } if test "${acl_cv_prog_gnu_ld+set}" = set; then $as_echo_n "(cached) " >&6 else # I'd rather use --version here, but apparently some GNU ld's only accept -v. case `$LD -v 2>&1 &5 $as_echo "$acl_cv_prog_gnu_ld" >&6; } with_gnu_ld=$acl_cv_prog_gnu_ld { $as_echo "$as_me:$LINENO: checking for shared library run path origin" >&5 $as_echo_n "checking for shared library run path origin... " >&6; } if test "${acl_cv_rpath+set}" = set; then $as_echo_n "(cached) " >&6 else CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh . ./conftest.sh rm -f ./conftest.sh acl_cv_rpath=done fi { $as_echo "$as_me:$LINENO: result: $acl_cv_rpath" >&5 $as_echo "$acl_cv_rpath" >&6; } wl="$acl_cv_wl" acl_libext="$acl_cv_libext" acl_shlibext="$acl_cv_shlibext" acl_libname_spec="$acl_cv_libname_spec" acl_library_names_spec="$acl_cv_library_names_spec" acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" acl_hardcode_direct="$acl_cv_hardcode_direct" acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" # Check whether --enable-rpath was given. if test "${enable_rpath+set}" = set; then enableval=$enable_rpath; : else enable_rpath=yes fi acl_libdirstem=lib searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` if test -n "$searchpath"; then acl_save_IFS="${IFS= }"; IFS=":" for searchdir in $searchpath; do if test -d "$searchdir"; then case "$searchdir" in */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; *) searchdir=`cd "$searchdir" && pwd` case "$searchdir" in */lib64 ) acl_libdirstem=lib64 ;; esac ;; esac fi done IFS="$acl_save_IFS" fi use_additional=yes acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" # Check whether --with-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval=$with_libiconv_prefix; if test "X$withval" = "Xno"; then use_additional=no else if test "X$withval" = "X"; then acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval additional_includedir=\"$includedir\" eval additional_libdir=\"$libdir\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" else additional_includedir="$withval/include" additional_libdir="$withval/$acl_libdirstem" fi fi fi LIBICONV= LTLIBICONV= INCICONV= LIBICONV_PREFIX= rpathdirs= ltrpathdirs= names_already_handled= names_next_round='iconv ' while test -n "$names_next_round"; do names_this_round="$names_next_round" names_next_round= for name in $names_this_round; do already_handled= for n in $names_already_handled; do if test "$n" = "$name"; then already_handled=yes break fi done if test -z "$already_handled"; then names_already_handled="$names_already_handled $name" uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` eval value=\"\$HAVE_LIB$uppername\" if test -n "$value"; then if test "$value" = yes; then eval value=\"\$LIB$uppername\" test -z "$value" || LIBICONV="${LIBICONV}${LIBICONV:+ }$value" eval value=\"\$LTLIB$uppername\" test -z "$value" || LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$value" else : fi else found_dir= found_la= found_so= found_a= eval libname=\"$acl_libname_spec\" # typically: libname=lib$name if test -n "$acl_shlibext"; then shrext=".$acl_shlibext" # typically: shrext=.so else shrext= fi if test $use_additional = yes; then dir="$additional_libdir" if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi fi if test "X$found_dir" = "X"; then for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" case "$x" in -L*) dir=`echo "X$x" | sed -e 's/^X-L//'` if test -n "$acl_shlibext"; then if test -f "$dir/$libname$shrext"; then found_dir="$dir" found_so="$dir/$libname$shrext" else if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then ver=`(cd "$dir" && \ for f in "$libname$shrext".*; do echo "$f"; done \ | sed -e "s,^$libname$shrext\\\\.,," \ | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ | sed 1q ) 2>/dev/null` if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then found_dir="$dir" found_so="$dir/$libname$shrext.$ver" fi else eval library_names=\"$acl_library_names_spec\" for f in $library_names; do if test -f "$dir/$f"; then found_dir="$dir" found_so="$dir/$f" break fi done fi fi fi if test "X$found_dir" = "X"; then if test -f "$dir/$libname.$acl_libext"; then found_dir="$dir" found_a="$dir/$libname.$acl_libext" fi fi if test "X$found_dir" != "X"; then if test -f "$dir/$libname.la"; then found_la="$dir/$libname.la" fi fi ;; esac if test "X$found_dir" != "X"; then break fi done fi if test "X$found_dir" != "X"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$found_dir -l$name" if test "X$found_so" != "X"; then if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else haveit= for x in $ltrpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $found_dir" fi if test "$acl_hardcode_direct" = yes; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" haveit= for x in $rpathdirs; do if test "X$x" = "X$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $found_dir" fi else haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$found_dir"; then haveit=yes break fi done if test -z "$haveit"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir" fi if test "$acl_hardcode_minus_L" != no; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_so" else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" fi fi fi fi else if test "X$found_a" != "X"; then LIBICONV="${LIBICONV}${LIBICONV:+ }$found_a" else LIBICONV="${LIBICONV}${LIBICONV:+ }-L$found_dir -l$name" fi fi additional_includedir= case "$found_dir" in */$acl_libdirstem | */$acl_libdirstem/) basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` LIBICONV_PREFIX="$basedir" additional_includedir="$basedir/include" ;; esac if test "X$additional_includedir" != "X"; then if test "X$additional_includedir" != "X/usr/include"; then haveit= if test "X$additional_includedir" = "X/usr/local/include"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then for x in $CPPFLAGS $INCICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-I$additional_includedir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_includedir"; then INCICONV="${INCICONV}${INCICONV:+ }-I$additional_includedir" fi fi fi fi fi if test -n "$found_la"; then save_libdir="$libdir" case "$found_la" in */* | *\\*) . "$found_la" ;; *) . "./$found_la" ;; esac libdir="$save_libdir" for dep in $dependency_libs; do case "$dep" in -L*) additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then haveit= if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then if test -n "$GCC"; then case $host_os in linux* | gnu* | k*bsd*-gnu) haveit=yes;; esac fi fi if test -z "$haveit"; then haveit= for x in $LDFLAGS $LIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LIBICONV="${LIBICONV}${LIBICONV:+ }-L$additional_libdir" fi fi haveit= for x in $LDFLAGS $LTLIBICONV; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X-L$additional_libdir"; then haveit=yes break fi done if test -z "$haveit"; then if test -d "$additional_libdir"; then LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-L$additional_libdir" fi fi fi fi ;; -R*) dir=`echo "X$dep" | sed -e 's/^X-R//'` if test "$enable_rpath" != no; then haveit= for x in $rpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then rpathdirs="$rpathdirs $dir" fi haveit= for x in $ltrpathdirs; do if test "X$x" = "X$dir"; then haveit=yes break fi done if test -z "$haveit"; then ltrpathdirs="$ltrpathdirs $dir" fi fi ;; -l*) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` ;; *.la) names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` ;; *) LIBICONV="${LIBICONV}${LIBICONV:+ }$dep" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }$dep" ;; esac done fi else LIBICONV="${LIBICONV}${LIBICONV:+ }-l$name" LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-l$name" fi fi fi done done if test "X$rpathdirs" != "X"; then if test -n "$acl_hardcode_libdir_separator"; then alldirs= for found_dir in $rpathdirs; do alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" done acl_save_libdir="$libdir" libdir="$alldirs" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" else for found_dir in $rpathdirs; do acl_save_libdir="$libdir" libdir="$found_dir" eval flag=\"$acl_hardcode_libdir_flag_spec\" libdir="$acl_save_libdir" LIBICONV="${LIBICONV}${LIBICONV:+ }$flag" done fi fi if test "X$ltrpathdirs" != "X"; then for found_dir in $ltrpathdirs; do LTLIBICONV="${LTLIBICONV}${LTLIBICONV:+ }-R$found_dir" done fi am_save_CPPFLAGS="$CPPFLAGS" for element in $INCICONV; do haveit= for x in $CPPFLAGS; do acl_save_prefix="$prefix" prefix="$acl_final_prefix" acl_save_exec_prefix="$exec_prefix" exec_prefix="$acl_final_exec_prefix" eval x=\"$x\" exec_prefix="$acl_save_exec_prefix" prefix="$acl_save_prefix" if test "X$x" = "X$element"; then haveit=yes break fi done if test -z "$haveit"; then CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }$element" fi done { $as_echo "$as_me:$LINENO: checking for iconv" >&5 $as_echo_n "checking for iconv... " >&6; } if test "${am_cv_func_iconv+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_func_iconv="no, consider installing GNU libiconv" am_cv_lib_iconv=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then am_cv_func_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext if test "$am_cv_func_iconv" != yes; then am_save_LIBS="$LIBS" LIBS="$LIBS $LIBICONV" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then am_cv_lib_iconv=yes am_cv_func_iconv=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$am_save_LIBS" fi fi { $as_echo "$as_me:$LINENO: result: $am_cv_func_iconv" >&5 $as_echo "$am_cv_func_iconv" >&6; } if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:$LINENO: checking for working iconv" >&5 $as_echo_n "checking for working iconv... " >&6; } if test "${am_cv_func_iconv_works+set}" = set; then $as_echo_n "(cached) " >&6 else am_save_LIBS="$LIBS" if test $am_cv_lib_iconv = yes; then LIBS="$LIBS $LIBICONV" fi if test "$cross_compiling" = yes; then case "$host_os" in aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; *) am_cv_func_iconv_works="guessing yes" ;; esac else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include int main () { /* Test against AIX 5.1 bug: Failures are not distinguishable from successful returns. */ { iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); if (cd_utf8_to_88591 != (iconv_t)(-1)) { static const char input[] = "\342\202\254"; /* EURO SIGN */ char buf[10]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_utf8_to_88591, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if (res == 0) return 1; } } #if 0 /* This bug could be worked around by the caller. */ /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ { iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); if (cd_88591_to_utf8 != (iconv_t)(-1)) { static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; char buf[50]; const char *inptr = input; size_t inbytesleft = strlen (input); char *outptr = buf; size_t outbytesleft = sizeof (buf); size_t res = iconv (cd_88591_to_utf8, (char **) &inptr, &inbytesleft, &outptr, &outbytesleft); if ((int)res > 0) return 1; } } #endif /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is provided. */ if (/* Try standardized names. */ iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) /* Try IRIX, OSF/1 names. */ && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) /* Try AIX names. */ && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) /* Try HP-UX names. */ && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) return 1; return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_func_iconv_works=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) am_cv_func_iconv_works=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi LIBS="$am_save_LIBS" fi { $as_echo "$as_me:$LINENO: result: $am_cv_func_iconv_works" >&5 $as_echo "$am_cv_func_iconv_works" >&6; } case "$am_cv_func_iconv_works" in *no) am_func_iconv=no am_cv_lib_iconv=no ;; *) am_func_iconv=yes ;; esac else am_func_iconv=no am_cv_lib_iconv=no fi if test "$am_func_iconv" = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_ICONV 1 _ACEOF fi if test "$am_cv_lib_iconv" = yes; then { $as_echo "$as_me:$LINENO: checking how to link with libiconv" >&5 $as_echo_n "checking how to link with libiconv... " >&6; } { $as_echo "$as_me:$LINENO: result: $LIBICONV" >&5 $as_echo "$LIBICONV" >&6; } else CPPFLAGS="$am_save_CPPFLAGS" LIBICONV= LTLIBICONV= fi if test "$am_cv_func_iconv" = yes; then { $as_echo "$as_me:$LINENO: checking for iconv declaration" >&5 $as_echo_n "checking for iconv declaration... " >&6; } if test "${am_cv_proto_iconv+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then am_cv_proto_iconv_arg1="" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 am_cv_proto_iconv_arg1="const" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" fi am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` { $as_echo "$as_me:$LINENO: result: ${ac_t:- }$am_cv_proto_iconv" >&5 $as_echo "${ac_t:- }$am_cv_proto_iconv" >&6; } cat >>confdefs.h <<_ACEOF #define ICONV_CONST $am_cv_proto_iconv_arg1 _ACEOF fi for ac_header in poll.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to spadix@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF have_poll="yes" else have_poll="no" fi done if test "x$have_poll" = "xyes"; then HAVE_POLL_TRUE= HAVE_POLL_FALSE='#' else HAVE_POLL_TRUE='#' HAVE_POLL_FALSE= fi # Check whether --enable-pthread was given. if test "${enable_pthread+set}" = set; then enableval=$enable_pthread; else if test "x$win32" = "xno"; then enable_pthread="yes" else enable_pthread="no" fi fi if test "x$enable_pthread" != "xno"; then for ac_header in pthread.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to spadix@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: test for pthread support failed! configure --disable-pthread to skip threaded support. See \`config.log' for more details." >&5 $as_echo "$as_me: error: test for pthread support failed! configure --disable-pthread to skip threaded support. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi done { $as_echo "$as_me:$LINENO: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pthread_create (); int main () { return pthread_create (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_pthread_pthread_create=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_pthread_pthread_create=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF LIBS="-lpthread $LIBS" else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: unable to link against -lpthread, although you appear to have pthread.h? set LDFLAGS and/or LIBS to help the linker, or configure --disable-pthread to skip threaded support. See \`config.log' for more details." >&5 $as_echo "$as_me: error: unable to link against -lpthread, although you appear to have pthread.h? set LDFLAGS and/or LIBS to help the linker, or configure --disable-pthread to skip threaded support. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi cat >>confdefs.h <<\_ACEOF #define __USE_UNIX98 1 _ACEOF fi # Check whether --enable-video was given. if test "${enable_video+set}" = set; then enableval=$enable_video; else enable_video="yes" fi with_video="no" if test "x$enable_video" != "xno"; then if test "x$win32" = "xno"; then for ac_header in linux/videodev.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to spadix@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF with_video="v4l1" else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: test for video support failed! rebuild your kernel to include video4linux support or configure --disable-video to skip building video support. See \`config.log' for more details." >&5 $as_echo "$as_me: error: test for video support failed! rebuild your kernel to include video4linux support or configure --disable-video to skip building video support. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi done for ac_header in linux/videodev2.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to spadix@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF with_video="v4l2" else { $as_echo "$as_me:$LINENO: WARNING: v4l2 API not detected, upgrade your kernel!" >&5 $as_echo "$as_me: WARNING: v4l2 API not detected, upgrade your kernel!" >&2;} fi done else for ac_header in vfw.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to spadix@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF with_video="vfw" else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: test for VfW video support failed! configure --disable-video to skip building vidoe support. See \`config.log' for more details." >&5 $as_echo "$as_me: error: test for VfW video support failed! configure --disable-video to skip building vidoe support. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi done fi fi if test "x$enable_video" != "xno"; then HAVE_VIDEO_TRUE= HAVE_VIDEO_FALSE='#' else HAVE_VIDEO_TRUE='#' HAVE_VIDEO_FALSE= fi if test "x$with_video" = "xv4l1" || test "x$with_video" = "xv4l2"; then HAVE_V4L1_TRUE= HAVE_V4L1_FALSE='#' else HAVE_V4L1_TRUE='#' HAVE_V4L1_FALSE= fi if test "x$with_video" = "xv4l2"; then HAVE_V4L2_TRUE= HAVE_V4L2_FALSE='#' else HAVE_V4L2_TRUE='#' HAVE_V4L2_FALSE= fi { $as_echo "$as_me:$LINENO: checking for X" >&5 $as_echo_n "checking for X... " >&6; } # Check whether --with-x was given. if test "${with_x+set}" = set; then withval=$with_x; fi # $have_x is `yes', `no', `disabled', or empty when we do not yet know. if test "x$with_x" = xno; then # The user explicitly disabled X. have_x=disabled else case $x_includes,$x_libraries in #( *\'*) { { $as_echo "$as_me:$LINENO: error: cannot use X directory names containing '" >&5 $as_echo "$as_me: error: cannot use X directory names containing '" >&2;} { (exit 1); exit 1; }; };; #( *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then $as_echo_n "(cached) " >&6 else # One or both of the vars are not set, and there is no cached value. ac_x_includes=no ac_x_libraries=no rm -f -r conftest.dir if mkdir conftest.dir; then cd conftest.dir cat >Imakefile <<'_ACEOF' incroot: @echo incroot='${INCROOT}' usrlibdir: @echo usrlibdir='${USRLIBDIR}' libdir: @echo libdir='${LIBDIR}' _ACEOF if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then # GNU make sometimes prints "make[1]: Entering...", which would confuse us. for ac_var in incroot usrlibdir libdir; do eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`" done # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. for ac_extension in a so sl dylib la dll; do if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" && test -f "$ac_im_libdir/libX11.$ac_extension"; then ac_im_usrlibdir=$ac_im_libdir; break fi done # Screen out bogus values from the imake configuration. They are # bogus both because they are the default anyway, and because # using them would break gcc on systems where it needs fixed includes. case $ac_im_incroot in /usr/include) ac_x_includes= ;; *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; esac case $ac_im_usrlibdir in /usr/lib | /usr/lib64 | /lib | /lib64) ;; *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; esac fi cd .. rm -f -r conftest.dir fi # Standard set of common directories for X headers. # Check X11 before X11Rn because it is often a symlink to the current release. ac_x_header_dirs=' /usr/X11/include /usr/X11R6/include /usr/X11R5/include /usr/X11R4/include /usr/include/X11 /usr/include/X11R6 /usr/include/X11R5 /usr/include/X11R4 /usr/local/X11/include /usr/local/X11R6/include /usr/local/X11R5/include /usr/local/X11R4/include /usr/local/include/X11 /usr/local/include/X11R6 /usr/local/include/X11R5 /usr/local/include/X11R4 /usr/X386/include /usr/x386/include /usr/XFree86/include/X11 /usr/include /usr/local/include /usr/unsupported/include /usr/athena/include /usr/local/x11r5/include /usr/lpp/Xamples/include /usr/openwin/include /usr/openwin/share/include' if test "$ac_x_includes" = no; then # Guess where to find include files, by looking for Xlib.h. # First, try using that file with no special directory specified. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then # We can compile using X headers with no special include directory. ac_x_includes= else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 for ac_dir in $ac_x_header_dirs; do if test -r "$ac_dir/X11/Xlib.h"; then ac_x_includes=$ac_dir break fi done fi rm -f conftest.err conftest.$ac_ext fi # $ac_x_includes = no if test "$ac_x_libraries" = no; then # Check for the libraries. # See if we find them without any special options. # Don't add to $LIBS permanently. ac_save_LIBS=$LIBS LIBS="-lX11 $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include int main () { XrmInitialize () ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then LIBS=$ac_save_LIBS # We can link X programs with no special library path. ac_x_libraries= else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS=$ac_save_LIBS for ac_dir in `$as_echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` do # Don't even attempt the hair of trying to link an X program! for ac_extension in a so sl dylib la dll; do if test -r "$ac_dir/libX11.$ac_extension"; then ac_x_libraries=$ac_dir break 2 fi done done fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi # $ac_x_libraries = no case $ac_x_includes,$ac_x_libraries in #( no,* | *,no | *\'*) # Didn't find X, or a directory has "'" in its name. ac_cv_have_x="have_x=no";; #( *) # Record where we found X for the cache. ac_cv_have_x="have_x=yes\ ac_x_includes='$ac_x_includes'\ ac_x_libraries='$ac_x_libraries'" esac fi ;; #( *) have_x=yes;; esac eval "$ac_cv_have_x" fi # $with_x != no if test "$have_x" != yes; then { $as_echo "$as_me:$LINENO: result: $have_x" >&5 $as_echo "$have_x" >&6; } no_x=yes else # If each of the values was on the command line, it overrides each guess. test "x$x_includes" = xNONE && x_includes=$ac_x_includes test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries # Update the cache value to reflect the command line values. ac_cv_have_x="have_x=yes\ ac_x_includes='$x_includes'\ ac_x_libraries='$x_libraries'" { $as_echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi if test "x$win32" != "xno"; then have_x="no" else if test "$no_x" = yes; then # Not all programs may use this symbol, but it does not hurt to define it. cat >>confdefs.h <<\_ACEOF #define X_DISPLAY_MISSING 1 _ACEOF X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= else if test -n "$x_includes"; then X_CFLAGS="$X_CFLAGS -I$x_includes" fi # It would also be nice to do this for all -L options, not just this one. if test -n "$x_libraries"; then X_LIBS="$X_LIBS -L$x_libraries" # For Solaris; some versions of Sun CC require a space after -R and # others require no space. Words are not sufficient . . . . { $as_echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 $as_echo_n "checking whether -R must be followed by a space... " >&6; } ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" ac_xsave_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } X_LIBS="$X_LIBS -R$x_libraries" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 LIBS="$ac_xsave_LIBS -R $x_libraries" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } X_LIBS="$X_LIBS -R $x_libraries" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { $as_echo "$as_me:$LINENO: result: neither works" >&5 $as_echo "neither works" >&6; } fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext ac_c_werror_flag=$ac_xsave_c_werror_flag LIBS=$ac_xsave_LIBS fi # Check for system-dependent libraries X programs must link with. # Do this before checking for the system-independent R6 libraries # (-lICE), since we may need -lsocket or whatever for X linking. if test "$ISC" = yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" else # Martyn Johnson says this is needed for Ultrix, if the X # libraries were built with DECnet support. And Karl Berry says # the Alpha needs dnet_stub (dnet does not exist). ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XOpenDisplay (); int main () { return XOpenDisplay (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet... " >&6; } if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dnet_dnet_ntoa=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_dnet_ntoa=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_dnet_ntoa" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then { $as_echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 $as_echo_n "checking for dnet_ntoa in -ldnet_stub... " >&6; } if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldnet_stub $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char dnet_ntoa (); int main () { return dnet_ntoa (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_dnet_stub_dnet_ntoa=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_dnet_stub_dnet_ntoa=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 $as_echo "$ac_cv_lib_dnet_stub_dnet_ntoa" >&6; } if test "x$ac_cv_lib_dnet_stub_dnet_ntoa" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" fi fi fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS="$ac_xsave_LIBS" # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, # to get the SysV transport functions. # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) # needs -lnsl. # The nsl library prevents programs from opening the X display # on Irix 5.2, according to T.E. Dickey. # The functions gethostbyname, getservbyname, and inet_addr are # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. { $as_echo "$as_me:$LINENO: checking for gethostbyname" >&5 $as_echo_n "checking for gethostbyname... " >&6; } if test "${ac_cv_func_gethostbyname+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define gethostbyname to an innocuous variant, in case declares gethostbyname. For example, HP-UX 11i declares gettimeofday. */ #define gethostbyname innocuous_gethostbyname /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gethostbyname (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef gethostbyname /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_gethostbyname || defined __stub___gethostbyname choke me #endif int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_gethostbyname=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_gethostbyname=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 $as_echo "$ac_cv_func_gethostbyname" >&6; } if test $ac_cv_func_gethostbyname = no; then { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 $as_echo_n "checking for gethostbyname in -lnsl... " >&6; } if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lnsl $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_nsl_gethostbyname=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_nsl_gethostbyname=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 $as_echo "$ac_cv_lib_nsl_gethostbyname" >&6; } if test "x$ac_cv_lib_nsl_gethostbyname" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" fi if test $ac_cv_lib_nsl_gethostbyname = no; then { $as_echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 $as_echo_n "checking for gethostbyname in -lbsd... " >&6; } if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char gethostbyname (); int main () { return gethostbyname (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_bsd_gethostbyname=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_bsd_gethostbyname=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 $as_echo "$ac_cv_lib_bsd_gethostbyname" >&6; } if test "x$ac_cv_lib_bsd_gethostbyname" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" fi fi fi # lieder@skyler.mavd.honeywell.com says without -lsocket, # socket/setsockopt and other routines are undefined under SCO ODT # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary # on later versions), says Simon Leinen: it contains gethostby* # variants that don't use the name server (or something). -lsocket # must be given before -lnsl if both are needed. We assume that # if connect needs -lnsl, so does gethostbyname. { $as_echo "$as_me:$LINENO: checking for connect" >&5 $as_echo_n "checking for connect... " >&6; } if test "${ac_cv_func_connect+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define connect to an innocuous variant, in case declares connect. For example, HP-UX 11i declares gettimeofday. */ #define connect innocuous_connect /* System header to define __stub macros and hopefully few prototypes, which can conflict with char connect (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef connect /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_connect || defined __stub___connect choke me #endif int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_connect=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_connect=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 $as_echo "$ac_cv_func_connect" >&6; } if test $ac_cv_func_connect = no; then { $as_echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 $as_echo_n "checking for connect in -lsocket... " >&6; } if test "${ac_cv_lib_socket_connect+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char connect (); int main () { return connect (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_socket_connect=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_socket_connect=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 $as_echo "$ac_cv_lib_socket_connect" >&6; } if test "x$ac_cv_lib_socket_connect" = x""yes; then X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" fi fi # Guillermo Gomez says -lposix is necessary on A/UX. { $as_echo "$as_me:$LINENO: checking for remove" >&5 $as_echo_n "checking for remove... " >&6; } if test "${ac_cv_func_remove+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define remove to an innocuous variant, in case declares remove. For example, HP-UX 11i declares gettimeofday. */ #define remove innocuous_remove /* System header to define __stub macros and hopefully few prototypes, which can conflict with char remove (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef remove /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_remove || defined __stub___remove choke me #endif int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_remove=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_remove=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 $as_echo "$ac_cv_func_remove" >&6; } if test $ac_cv_func_remove = no; then { $as_echo "$as_me:$LINENO: checking for remove in -lposix" >&5 $as_echo_n "checking for remove in -lposix... " >&6; } if test "${ac_cv_lib_posix_remove+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lposix $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char remove (); int main () { return remove (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_posix_remove=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_posix_remove=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 $as_echo "$ac_cv_lib_posix_remove" >&6; } if test "x$ac_cv_lib_posix_remove" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" fi fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. { $as_echo "$as_me:$LINENO: checking for shmat" >&5 $as_echo_n "checking for shmat... " >&6; } if test "${ac_cv_func_shmat+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define shmat to an innocuous variant, in case declares shmat. For example, HP-UX 11i declares gettimeofday. */ #define shmat innocuous_shmat /* System header to define __stub macros and hopefully few prototypes, which can conflict with char shmat (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef shmat /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_shmat || defined __stub___shmat choke me #endif int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_func_shmat=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_shmat=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 $as_echo "$ac_cv_func_shmat" >&6; } if test $ac_cv_func_shmat = no; then { $as_echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 $as_echo_n "checking for shmat in -lipc... " >&6; } if test "${ac_cv_lib_ipc_shmat+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lipc $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char shmat (); int main () { return shmat (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_ipc_shmat=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ipc_shmat=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 $as_echo "$ac_cv_lib_ipc_shmat" >&6; } if test "x$ac_cv_lib_ipc_shmat" = x""yes; then X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" fi fi fi # Check for libraries that X11R6 Xt/Xaw programs need. ac_save_LDFLAGS=$LDFLAGS test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to # check for ICE first), but we must link in the order -lSM -lICE or # we get undefined symbols. So assume we have SM if we have ICE. # These have to be linked with before -lX11, unlike the other # libraries we check for below, so use a different variable. # John Interrante, Karl Berry { $as_echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 $as_echo_n "checking for IceConnectionNumber in -lICE... " >&6; } if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char IceConnectionNumber (); int main () { return IceConnectionNumber (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_ICE_IceConnectionNumber=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ICE_IceConnectionNumber=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 $as_echo "$ac_cv_lib_ICE_IceConnectionNumber" >&6; } if test "x$ac_cv_lib_ICE_IceConnectionNumber" = x""yes; then X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" fi LDFLAGS=$ac_save_LDFLAGS fi fi if test "x$have_x" = "xyes"; then HAVE_X_TRUE= HAVE_X_FALSE='#' else HAVE_X_TRUE='#' HAVE_X_FALSE= fi if test "x$XSHM_LIBS" = "x"; then XSHM_LIBS="-lXext" fi # Check whether --with-xshm was given. if test "${with_xshm+set}" = set; then withval=$with_xshm; else with_xshm="check" fi if test "x$with_xshm" != "xno"; then for ac_header in X11/extensions/XShm.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include #include #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF with_xshm="yes" else if test "x$with_xshm" = "xcheck"; then with_xshm="no" else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: test for X shared memory extension failed! install the X shared memory extension, specify --x-includes or configure --without-xshm to disable the extension See \`config.log' for more details." >&5 $as_echo "$as_me: error: test for X shared memory extension failed! install the X shared memory extension, specify --x-includes or configure --without-xshm to disable the extension See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi done if test "x$with_xshm" != "xno"; then { $as_echo "$as_me:$LINENO: checking for XShmQueryVersion in -lXext" >&5 $as_echo_n "checking for XShmQueryVersion in -lXext... " >&6; } if test "${ac_cv_lib_Xext_XShmQueryVersion+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXext "$X_LIBS" "$X_PRE_LIBS" -lX11 "$X_EXTRA_LIBS" "$XSHM_LIBS" $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XShmQueryVersion (); int main () { return XShmQueryVersion (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_Xext_XShmQueryVersion=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xext_XShmQueryVersion=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XShmQueryVersion" >&5 $as_echo "$ac_cv_lib_Xext_XShmQueryVersion" >&6; } if test "x$ac_cv_lib_Xext_XShmQueryVersion" = x""yes; then with_xshm="yes" else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: unable to find XShmQueryVersion in $XSHM_LIBS! specify XSHM_LIBS or configure --without-xshm to disable the extension See \`config.log' for more details." >&5 $as_echo "$as_me: error: unable to find XShmQueryVersion in $XSHM_LIBS! specify XSHM_LIBS or configure --without-xshm to disable the extension See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi if test "x$with_xshm" = "xyes"; then HAVE_XSHM_TRUE= HAVE_XSHM_FALSE='#' else HAVE_XSHM_TRUE='#' HAVE_XSHM_FALSE= fi if test "x$XV_LIBS" = "x"; then XV_LIBS="-lXv" fi # Check whether --with-xv was given. if test "${with_xv+set}" = set; then withval=$with_xv; else with_xv="check" fi if test "x$with_xv" != "xno"; then for ac_header in X11/extensions/Xvlib.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF with_xv="yes" else if test "x$with_xv" = "xcheck"; then with_xv="no" else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: test for XVideo extension failed! install the XVideo extension, specify --x-includes or configure --without-xv to disable the extension See \`config.log' for more details." >&5 $as_echo "$as_me: error: test for XVideo extension failed! install the XVideo extension, specify --x-includes or configure --without-xv to disable the extension See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi done if test "x$with_xv" != "xno"; then { $as_echo "$as_me:$LINENO: checking for XvQueryExtension in -lXv" >&5 $as_echo_n "checking for XvQueryExtension in -lXv... " >&6; } if test "${ac_cv_lib_Xv_XvQueryExtension+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lXv "$X_LIBS" "$X_PRE_LIBS" -lX11 "$X_EXTRA_LIBS" "$XV_LIBS" $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char XvQueryExtension (); int main () { return XvQueryExtension (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_Xv_XvQueryExtension=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_Xv_XvQueryExtension=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_Xv_XvQueryExtension" >&5 $as_echo "$ac_cv_lib_Xv_XvQueryExtension" >&6; } if test "x$ac_cv_lib_Xv_XvQueryExtension" = x""yes; then with_xv="yes" else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: unable to find XvQueryExtension in $XV_LIBS! specify XV_LIBS or configure --without-xv to disable the extension See \`config.log' for more details." >&5 $as_echo "$as_me: error: unable to find XvQueryExtension in $XV_LIBS! specify XV_LIBS or configure --without-xv to disable the extension See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi fi fi if test "x$with_xv" = "xyes"; then HAVE_XV_TRUE= HAVE_XV_FALSE='#' else HAVE_XV_TRUE='#' HAVE_XV_FALSE= fi # Check whether --with-jpeg was given. if test "${with_jpeg+set}" = set; then withval=$with_jpeg; else with_jpeg="check" fi have_jpeg="maybe" if test "x$with_jpeg" != "xno"; then for ac_header in jpeglib.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to spadix@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else have_jpeg="no" fi done if test "${ac_cv_header_jerror_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for jerror.h" >&5 $as_echo_n "checking for jerror.h... " >&6; } if test "${ac_cv_header_jerror_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_jerror_h" >&5 $as_echo "$ac_cv_header_jerror_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking jerror.h usability" >&5 $as_echo_n "checking jerror.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking jerror.h presence" >&5 $as_echo_n "checking jerror.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: jerror.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: jerror.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jerror.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: jerror.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: jerror.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: jerror.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jerror.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: jerror.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jerror.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: jerror.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jerror.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: jerror.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jerror.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: jerror.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: jerror.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: jerror.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to spadix@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for jerror.h" >&5 $as_echo_n "checking for jerror.h... " >&6; } if test "${ac_cv_header_jerror_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_jerror_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_jerror_h" >&5 $as_echo "$ac_cv_header_jerror_h" >&6; } fi if test "x$ac_cv_header_jerror_h" = x""yes; then : else have_jpeg="no" fi { $as_echo "$as_me:$LINENO: checking for jpeg_read_header in -ljpeg" >&5 $as_echo_n "checking for jpeg_read_header in -ljpeg... " >&6; } if test "${ac_cv_lib_jpeg_jpeg_read_header+set}" = set; then $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ljpeg $LIBS" cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char jpeg_read_header (); int main () { return jpeg_read_header (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then ac_cv_lib_jpeg_jpeg_read_header=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_jpeg_jpeg_read_header=no fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:$LINENO: result: $ac_cv_lib_jpeg_jpeg_read_header" >&5 $as_echo "$ac_cv_lib_jpeg_jpeg_read_header" >&6; } if test "x$ac_cv_lib_jpeg_jpeg_read_header" = x""yes; then cat >>confdefs.h <<_ACEOF #define HAVE_LIBJPEG 1 _ACEOF LIBS="-ljpeg $LIBS" else have_jpeg="no" fi if test "x$have_jpeg" != "xno"; then with_jpeg="yes" elif test "x$with_jpeg" = "xyes"; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: unable to find libjpeg! ensure CFLAGS/LDFLAGS are set appropriately or configure --without-jpeg See \`config.log' for more details." >&5 $as_echo "$as_me: error: unable to find libjpeg! ensure CFLAGS/LDFLAGS are set appropriately or configure --without-jpeg See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else with_jpeg="no" fi fi if test "x$with_jpeg" = "xyes"; then HAVE_JPEG_TRUE= HAVE_JPEG_FALSE='#' else HAVE_JPEG_TRUE='#' HAVE_JPEG_FALSE= fi # Check whether --with-imagemagick was given. if test "${with_imagemagick+set}" = set; then withval=$with_imagemagick; else with_imagemagick="yes" fi if test "x$with_imagemagick" != "xno"; then pkg_failed=no { $as_echo "$as_me:$LINENO: checking for MAGICK" >&5 $as_echo_n "checking for MAGICK... " >&6; } if test -n "$MAGICK_CFLAGS"; then pkg_cv_MAGICK_CFLAGS="$MAGICK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"MagickWand >= 6.2.6\"") >&5 ($PKG_CONFIG --exists --print-errors "MagickWand >= 6.2.6") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_MAGICK_CFLAGS=`$PKG_CONFIG --cflags "MagickWand >= 6.2.6" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MAGICK_LIBS"; then pkg_cv_MAGICK_LIBS="$MAGICK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"MagickWand >= 6.2.6\"") >&5 ($PKG_CONFIG --exists --print-errors "MagickWand >= 6.2.6") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_MAGICK_LIBS=`$PKG_CONFIG --libs "MagickWand >= 6.2.6" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MAGICK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "MagickWand >= 6.2.6" 2>&1` else MAGICK_PKG_ERRORS=`$PKG_CONFIG --print-errors "MagickWand >= 6.2.6" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MAGICK_PKG_ERRORS" >&5 { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } saved_error=$MAGICK_PKG_ERRORS pkg_failed=no { $as_echo "$as_me:$LINENO: checking for MAGICK" >&5 $as_echo_n "checking for MAGICK... " >&6; } if test -n "$MAGICK_CFLAGS"; then pkg_cv_MAGICK_CFLAGS="$MAGICK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"Wand >= 6.2.6\"") >&5 ($PKG_CONFIG --exists --print-errors "Wand >= 6.2.6") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_MAGICK_CFLAGS=`$PKG_CONFIG --cflags "Wand >= 6.2.6" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MAGICK_LIBS"; then pkg_cv_MAGICK_LIBS="$MAGICK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"Wand >= 6.2.6\"") >&5 ($PKG_CONFIG --exists --print-errors "Wand >= 6.2.6") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_MAGICK_LIBS=`$PKG_CONFIG --libs "Wand >= 6.2.6" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MAGICK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "Wand >= 6.2.6" 2>&1` else MAGICK_PKG_ERRORS=`$PKG_CONFIG --print-errors "Wand >= 6.2.6" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MAGICK_PKG_ERRORS" >&5 { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: Unable to find ImageMagick >= 6.2.6: $saved_error * Ensure that you installed any \"development\" packages for ImageMagick. * Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. * You may set the environment variables MAGICK_CFLAGS and MAGICK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. * To avoid using ImageMagick altogether you may add the --without-imagemagick flag to the configure command; the zbarimg program will not be built. See \`config.log' for more details." >&5 $as_echo "$as_me: error: Unable to find ImageMagick >= 6.2.6: $saved_error * Ensure that you installed any \"development\" packages for ImageMagick. * Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. * You may set the environment variables MAGICK_CFLAGS and MAGICK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. * To avoid using ImageMagick altogether you may add the --without-imagemagick flag to the configure command; the zbarimg program will not be built. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: Unable to find ImageMagick >= 6.2.6: $saved_error * Ensure that you installed any \"development\" packages for ImageMagick. * Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. * You may set the environment variables MAGICK_CFLAGS and MAGICK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. * To avoid using ImageMagick altogether you may add the --without-imagemagick flag to the configure command; the zbarimg program will not be built. See \`config.log' for more details." >&5 $as_echo "$as_me: error: Unable to find ImageMagick >= 6.2.6: $saved_error * Ensure that you installed any \"development\" packages for ImageMagick. * Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. * You may set the environment variables MAGICK_CFLAGS and MAGICK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. * To avoid using ImageMagick altogether you may add the --without-imagemagick flag to the configure command; the zbarimg program will not be built. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else MAGICK_CFLAGS=$pkg_cv_MAGICK_CFLAGS MAGICK_LIBS=$pkg_cv_MAGICK_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi elif test $pkg_failed = untried; then saved_error=$MAGICK_PKG_ERRORS pkg_failed=no { $as_echo "$as_me:$LINENO: checking for MAGICK" >&5 $as_echo_n "checking for MAGICK... " >&6; } if test -n "$MAGICK_CFLAGS"; then pkg_cv_MAGICK_CFLAGS="$MAGICK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"Wand >= 6.2.6\"") >&5 ($PKG_CONFIG --exists --print-errors "Wand >= 6.2.6") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_MAGICK_CFLAGS=`$PKG_CONFIG --cflags "Wand >= 6.2.6" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$MAGICK_LIBS"; then pkg_cv_MAGICK_LIBS="$MAGICK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"Wand >= 6.2.6\"") >&5 ($PKG_CONFIG --exists --print-errors "Wand >= 6.2.6") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_MAGICK_LIBS=`$PKG_CONFIG --libs "Wand >= 6.2.6" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then MAGICK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "Wand >= 6.2.6" 2>&1` else MAGICK_PKG_ERRORS=`$PKG_CONFIG --print-errors "Wand >= 6.2.6" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$MAGICK_PKG_ERRORS" >&5 { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: Unable to find ImageMagick >= 6.2.6: $saved_error * Ensure that you installed any \"development\" packages for ImageMagick. * Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. * You may set the environment variables MAGICK_CFLAGS and MAGICK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. * To avoid using ImageMagick altogether you may add the --without-imagemagick flag to the configure command; the zbarimg program will not be built. See \`config.log' for more details." >&5 $as_echo "$as_me: error: Unable to find ImageMagick >= 6.2.6: $saved_error * Ensure that you installed any \"development\" packages for ImageMagick. * Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. * You may set the environment variables MAGICK_CFLAGS and MAGICK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. * To avoid using ImageMagick altogether you may add the --without-imagemagick flag to the configure command; the zbarimg program will not be built. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: Unable to find ImageMagick >= 6.2.6: $saved_error * Ensure that you installed any \"development\" packages for ImageMagick. * Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. * You may set the environment variables MAGICK_CFLAGS and MAGICK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. * To avoid using ImageMagick altogether you may add the --without-imagemagick flag to the configure command; the zbarimg program will not be built. See \`config.log' for more details." >&5 $as_echo "$as_me: error: Unable to find ImageMagick >= 6.2.6: $saved_error * Ensure that you installed any \"development\" packages for ImageMagick. * Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. * You may set the environment variables MAGICK_CFLAGS and MAGICK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. * To avoid using ImageMagick altogether you may add the --without-imagemagick flag to the configure command; the zbarimg program will not be built. See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else MAGICK_CFLAGS=$pkg_cv_MAGICK_CFLAGS MAGICK_LIBS=$pkg_cv_MAGICK_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi else MAGICK_CFLAGS=$pkg_cv_MAGICK_CFLAGS MAGICK_LIBS=$pkg_cv_MAGICK_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi MAGICK_VERSION=`$PKG_CONFIG MagickWand --modversion` { $as_echo "$as_me:$LINENO: using ImageMagick version $MAGICK_VERSION" >&5 $as_echo "$as_me: using ImageMagick version $MAGICK_VERSION" >&6;} CPPFLAGS_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $MAGICK_CFLAGS" if test "${ac_cv_header_wand_MagickWand_h+set}" = set; then { $as_echo "$as_me:$LINENO: checking for wand/MagickWand.h" >&5 $as_echo_n "checking for wand/MagickWand.h... " >&6; } if test "${ac_cv_header_wand_MagickWand_h+set}" = set; then $as_echo_n "(cached) " >&6 fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_wand_MagickWand_h" >&5 $as_echo "$ac_cv_header_wand_MagickWand_h" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking wand/MagickWand.h usability" >&5 $as_echo_n "checking wand/MagickWand.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking wand/MagickWand.h presence" >&5 $as_echo_n "checking wand/MagickWand.h presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: wand/MagickWand.h: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: wand/MagickWand.h: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: wand/MagickWand.h: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: wand/MagickWand.h: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: wand/MagickWand.h: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: wand/MagickWand.h: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: wand/MagickWand.h: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: wand/MagickWand.h: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: wand/MagickWand.h: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: wand/MagickWand.h: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: wand/MagickWand.h: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: wand/MagickWand.h: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: wand/MagickWand.h: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: wand/MagickWand.h: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: wand/MagickWand.h: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: wand/MagickWand.h: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to spadix@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for wand/MagickWand.h" >&5 $as_echo_n "checking for wand/MagickWand.h... " >&6; } if test "${ac_cv_header_wand_MagickWand_h+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_header_wand_MagickWand_h=$ac_header_preproc fi { $as_echo "$as_me:$LINENO: result: $ac_cv_header_wand_MagickWand_h" >&5 $as_echo "$ac_cv_header_wand_MagickWand_h" >&6; } fi if test "x$ac_cv_header_wand_MagickWand_h" = x""yes; then : else { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: ImageMagick package found but wand/MagickWand.h not installed?! this is a problem with your ImageMagick install, please resolve the inconsistency and try again... See \`config.log' for more details." >&5 $as_echo "$as_me: error: ImageMagick package found but wand/MagickWand.h not installed?! this is a problem with your ImageMagick install, please resolve the inconsistency and try again... See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } fi CPPFLAGS="$CPPFLAGS_save" fi if test "x$with_imagemagick" = "xyes"; then HAVE_MAGICK_TRUE= HAVE_MAGICK_FALSE='#' else HAVE_MAGICK_TRUE='#' HAVE_MAGICK_FALSE= fi # Check whether --with-npapi was given. if test "${with_npapi+set}" = set; then withval=$with_npapi; else with_npapi="no" fi if test "x$with_npapi" != "xno"; then pkg_failed=no { $as_echo "$as_me:$LINENO: checking for NPAPI" >&5 $as_echo_n "checking for NPAPI... " >&6; } if test -n "$NPAPI_CFLAGS"; then pkg_cv_NPAPI_CFLAGS="$NPAPI_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"firefox-plugin\"") >&5 ($PKG_CONFIG --exists --print-errors "firefox-plugin") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_NPAPI_CFLAGS=`$PKG_CONFIG --cflags "firefox-plugin" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$NPAPI_LIBS"; then pkg_cv_NPAPI_LIBS="$NPAPI_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"firefox-plugin\"") >&5 ($PKG_CONFIG --exists --print-errors "firefox-plugin") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_NPAPI_LIBS=`$PKG_CONFIG --libs "firefox-plugin" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then NPAPI_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "firefox-plugin" 2>&1` else NPAPI_PKG_ERRORS=`$PKG_CONFIG --print-errors "firefox-plugin" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$NPAPI_PKG_ERRORS" >&5 { { $as_echo "$as_me:$LINENO: error: Package requirements (firefox-plugin) were not met: $NPAPI_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NPAPI_CFLAGS and NPAPI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 $as_echo "$as_me: error: Package requirements (firefox-plugin) were not met: $NPAPI_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables NPAPI_CFLAGS and NPAPI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables NPAPI_CFLAGS and NPAPI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables NPAPI_CFLAGS and NPAPI_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else NPAPI_CFLAGS=$pkg_cv_NPAPI_CFLAGS NPAPI_LIBS=$pkg_cv_NPAPI_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi NPAPI_VERSION=`$PKG_CONFIG firefox-plugin --modversion` { $as_echo "$as_me:$LINENO: using firefox-plugin version $NPAPI_VERSION" >&5 $as_echo "$as_me: using firefox-plugin version $NPAPI_VERSION" >&6;} fi if test "x$with_npapi" = "xyes"; then HAVE_NPAPI_TRUE= HAVE_NPAPI_FALSE='#' else HAVE_NPAPI_TRUE='#' HAVE_NPAPI_FALSE= fi # Check whether --with-gtk was given. if test "${with_gtk+set}" = set; then withval=$with_gtk; else with_gtk="yes" fi if test "x$with_gtk" != "xno"; then pkg_failed=no { $as_echo "$as_me:$LINENO: checking for GTK" >&5 $as_echo_n "checking for GTK... " >&6; } if test -n "$GTK_CFLAGS"; then pkg_cv_GTK_CFLAGS="$GTK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 gthread-2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 gthread-2.0") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_GTK_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 gthread-2.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$GTK_LIBS"; then pkg_cv_GTK_LIBS="$GTK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 gthread-2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 gthread-2.0") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_GTK_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 gthread-2.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then GTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "gtk+-2.0 gthread-2.0" 2>&1` else GTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "gtk+-2.0 gthread-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$GTK_PKG_ERRORS" >&5 { { $as_echo "$as_me:$LINENO: error: Package requirements (gtk+-2.0 gthread-2.0) were not met: $GTK_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GTK_CFLAGS and GTK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 $as_echo "$as_me: error: Package requirements (gtk+-2.0 gthread-2.0) were not met: $GTK_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables GTK_CFLAGS and GTK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GTK_CFLAGS and GTK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables GTK_CFLAGS and GTK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else GTK_CFLAGS=$pkg_cv_GTK_CFLAGS GTK_LIBS=$pkg_cv_GTK_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi GLIB_GENMARSHAL=`$PKG_CONFIG glib-2.0 --variable=glib_genmarshal` GTK_VERSION=`$PKG_CONFIG gtk+-2.0 --modversion` { $as_echo "$as_me:$LINENO: using GTK+ version $GTK_VERSION" >&5 $as_echo "$as_me: using GTK+ version $GTK_VERSION" >&6;} GTHREAD_VERSION=`$PKG_CONFIG gthread-2.0 --modversion` { $as_echo "$as_me:$LINENO: using gthread-2.0 version $GTHREAD_VERSION" >&5 $as_echo "$as_me: using gthread-2.0 version $GTHREAD_VERSION" >&6;} fi if test "x$with_gtk" = "xyes"; then HAVE_GTK_TRUE= HAVE_GTK_FALSE='#' else HAVE_GTK_TRUE='#' HAVE_GTK_FALSE= fi # Check whether --with-python was given. if test "${with_python+set}" = set; then withval=$with_python; else with_python="yes" fi if test "x$with_python" != "xno"; then if test -n "$PYTHON"; then # If the user set $PYTHON, use it and don't search something else. { $as_echo "$as_me:$LINENO: checking whether $PYTHON version >= 2.3.5" >&5 $as_echo_n "checking whether $PYTHON version >= 2.3.5... " >&6; } prog="import sys, string # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. minver = map(int, string.split('2.3.5', '.')) + [0, 0, 0] minverhex = 0 for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $PYTHON -c "$prog"" >&5 ($PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } else { { $as_echo "$as_me:$LINENO: error: too old" >&5 $as_echo "$as_me: error: too old" >&2;} { (exit 1); exit 1; }; } fi am_display_PYTHON=$PYTHON else # Otherwise, try each interpreter until we find one that satisfies # VERSION. { $as_echo "$as_me:$LINENO: checking for a Python interpreter with version >= 2.3.5" >&5 $as_echo_n "checking for a Python interpreter with version >= 2.3.5... " >&6; } if test "${am_cv_pathless_PYTHON+set}" = set; then $as_echo_n "(cached) " >&6 else for am_cv_pathless_PYTHON in python python2 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 none; do test "$am_cv_pathless_PYTHON" = none && break prog="import sys, string # split strings by '.' and convert to numeric. Append some zeros # because we need at least 4 digits for the hex conversion. minver = map(int, string.split('2.3.5', '.')) + [0, 0, 0] minverhex = 0 for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[i] sys.exit(sys.hexversion < minverhex)" if { echo "$as_me:$LINENO: $am_cv_pathless_PYTHON -c "$prog"" >&5 ($am_cv_pathless_PYTHON -c "$prog") >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then break fi done fi { $as_echo "$as_me:$LINENO: result: $am_cv_pathless_PYTHON" >&5 $as_echo "$am_cv_pathless_PYTHON" >&6; } # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. if test "$am_cv_pathless_PYTHON" = none; then PYTHON=: else # Extract the first word of "$am_cv_pathless_PYTHON", so it can be a program name with args. set dummy $am_cv_pathless_PYTHON; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_PYTHON+set}" = set; then $as_echo_n "(cached) " >&6 else case $PYTHON in [\\/]* | ?:[\\/]*) ac_cv_path_PYTHON="$PYTHON" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_PYTHON="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi PYTHON=$ac_cv_path_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:$LINENO: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi fi am_display_PYTHON=$am_cv_pathless_PYTHON fi if test "$PYTHON" = :; then { { $as_echo "$as_me:$LINENO: error: no suitable Python interpreter found" >&5 $as_echo "$as_me: error: no suitable Python interpreter found" >&2;} { (exit 1); exit 1; }; } else { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON version" >&5 $as_echo_n "checking for $am_display_PYTHON version... " >&6; } if test "${am_cv_python_version+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_python_version=`$PYTHON -c "import sys; print sys.version[:3]"` fi { $as_echo "$as_me:$LINENO: result: $am_cv_python_version" >&5 $as_echo "$am_cv_python_version" >&6; } PYTHON_VERSION=$am_cv_python_version PYTHON_PREFIX='${prefix}' PYTHON_EXEC_PREFIX='${exec_prefix}' { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON platform" >&5 $as_echo_n "checking for $am_display_PYTHON platform... " >&6; } if test "${am_cv_python_platform+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"` fi { $as_echo "$as_me:$LINENO: result: $am_cv_python_platform" >&5 $as_echo "$am_cv_python_platform" >&6; } PYTHON_PLATFORM=$am_cv_python_platform { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON script directory" >&5 $as_echo_n "checking for $am_display_PYTHON script directory... " >&6; } if test "${am_cv_python_pythondir+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` fi { $as_echo "$as_me:$LINENO: result: $am_cv_python_pythondir" >&5 $as_echo "$am_cv_python_pythondir" >&6; } pythondir=$am_cv_python_pythondir pkgpythondir=\${pythondir}/$PACKAGE { $as_echo "$as_me:$LINENO: checking for $am_display_PYTHON extension module directory" >&5 $as_echo_n "checking for $am_display_PYTHON extension module directory... " >&6; } if test "${am_cv_python_pyexecdir+set}" = set; then $as_echo_n "(cached) " >&6 else am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"` fi { $as_echo "$as_me:$LINENO: result: $am_cv_python_pyexecdir" >&5 $as_echo "$am_cv_python_pyexecdir" >&6; } pyexecdir=$am_cv_python_pyexecdir pkgpyexecdir=\${pyexecdir}/$PACKAGE fi if test "x$PYTHON_CFLAGS" != "x"; then : elif test "x$PYTHON_CONFIG" != "x" && test -x "$PYTHON_CONFIG"; then PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags` elif test -x "$PYTHON-config"; then PYTHON_CFLAGS=`$PYTHON-config --cflags` else PYTHON_CFLAGS=`$PYTHON -c 'import distutils.sysconfig as s; print " ".join(s.get_config_vars("CFLAGS")) + " -I"+s.get_python_inc() + " -I"+s.get_python_inc(plat_specific=True)'` fi if test "x$with_gtk" = "xyes"; then pkg_failed=no { $as_echo "$as_me:$LINENO: checking for PYGTK" >&5 $as_echo_n "checking for PYGTK... " >&6; } if test -n "$PYGTK_CFLAGS"; then pkg_cv_PYGTK_CFLAGS="$PYGTK_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pygtk-2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "pygtk-2.0") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_PYGTK_CFLAGS=`$PKG_CONFIG --cflags "pygtk-2.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$PYGTK_LIBS"; then pkg_cv_PYGTK_LIBS="$PYGTK_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"pygtk-2.0\"") >&5 ($PKG_CONFIG --exists --print-errors "pygtk-2.0") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_PYGTK_LIBS=`$PKG_CONFIG --libs "pygtk-2.0" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then PYGTK_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "pygtk-2.0" 2>&1` else PYGTK_PKG_ERRORS=`$PKG_CONFIG --print-errors "pygtk-2.0" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$PYGTK_PKG_ERRORS" >&5 { { $as_echo "$as_me:$LINENO: error: Package requirements (pygtk-2.0) were not met: $PYGTK_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PYGTK_CFLAGS and PYGTK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 $as_echo "$as_me: error: Package requirements (pygtk-2.0) were not met: $PYGTK_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables PYGTK_CFLAGS and PYGTK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PYGTK_CFLAGS and PYGTK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables PYGTK_CFLAGS and PYGTK_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else PYGTK_CFLAGS=$pkg_cv_PYGTK_CFLAGS PYGTK_LIBS=$pkg_cv_PYGTK_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi for ac_prog in pygtk-codegen-2.0 pygtk-codegen do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_PYGTK_CODEGEN+set}" = set; then $as_echo_n "(cached) " >&6 else if test -n "$PYGTK_CODEGEN"; then ac_cv_prog_PYGTK_CODEGEN="$PYGTK_CODEGEN" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_PYGTK_CODEGEN="$ac_prog" $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PYGTK_CODEGEN=$ac_cv_prog_PYGTK_CODEGEN if test -n "$PYGTK_CODEGEN"; then { $as_echo "$as_me:$LINENO: result: $PYGTK_CODEGEN" >&5 $as_echo "$PYGTK_CODEGEN" >&6; } else { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } fi test -n "$PYGTK_CODEGEN" && break done test -n "$PYGTK_CODEGEN" || PYGTK_CODEGEN=":" if test "x$PYGTK_H2DEF" = "x"; then PYGTK_H2DEF=`$PKG_CONFIG pygtk-2.0 --variable=codegendir`/h2def.py if test -f "$PYGTK_H2DEF"; then : else PYGTK_H2DEF=":" fi fi if test "x$PYGTK_DEFS" = "x"; then PYGTK_DEFS=`$PKG_CONFIG pygtk-2.0 --variable=defsdir` fi fi fi if test "x$with_python" = "xyes"; then HAVE_PYTHON_TRUE= HAVE_PYTHON_FALSE='#' else HAVE_PYTHON_TRUE='#' HAVE_PYTHON_FALSE= fi # Check whether --with-qt was given. if test "${with_qt+set}" = set; then withval=$with_qt; else with_qt="yes" fi if test "x$with_qt" != "xno"; then pkg_failed=no { $as_echo "$as_me:$LINENO: checking for QT" >&5 $as_echo_n "checking for QT... " >&6; } if test -n "$QT_CFLAGS"; then pkg_cv_QT_CFLAGS="$QT_CFLAGS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"QtCore >= 4 QtGui >= 4\"") >&5 ($PKG_CONFIG --exists --print-errors "QtCore >= 4 QtGui >= 4") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_QT_CFLAGS=`$PKG_CONFIG --cflags "QtCore >= 4 QtGui >= 4" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test -n "$QT_LIBS"; then pkg_cv_QT_LIBS="$QT_LIBS" elif test -n "$PKG_CONFIG"; then if test -n "$PKG_CONFIG" && \ { ($as_echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"QtCore >= 4 QtGui >= 4\"") >&5 ($PKG_CONFIG --exists --print-errors "QtCore >= 4 QtGui >= 4") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then pkg_cv_QT_LIBS=`$PKG_CONFIG --libs "QtCore >= 4 QtGui >= 4" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi if test $pkg_failed = yes; then if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then _pkg_short_errors_supported=yes else _pkg_short_errors_supported=no fi if test $_pkg_short_errors_supported = yes; then QT_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "QtCore >= 4 QtGui >= 4" 2>&1` else QT_PKG_ERRORS=`$PKG_CONFIG --print-errors "QtCore >= 4 QtGui >= 4" 2>&1` fi # Put the nasty error message in config.log where it belongs echo "$QT_PKG_ERRORS" >&5 { { $as_echo "$as_me:$LINENO: error: Package requirements (QtCore >= 4 QtGui >= 4) were not met: $QT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables QT_CFLAGS and QT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&5 $as_echo "$as_me: error: Package requirements (QtCore >= 4 QtGui >= 4) were not met: $QT_PKG_ERRORS Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively, you may set the environment variables QT_CFLAGS and QT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. " >&2;} { (exit 1); exit 1; }; } elif test $pkg_failed = untried; then { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { { $as_echo "$as_me:$LINENO: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables QT_CFLAGS and QT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&5 $as_echo "$as_me: error: The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively, you may set the environment variables QT_CFLAGS and QT_LIBS to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see . See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; }; } else QT_CFLAGS=$pkg_cv_QT_CFLAGS QT_LIBS=$pkg_cv_QT_LIBS { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } : fi MOC=`$PKG_CONFIG QtGui --variable=moc_location` { $as_echo "$as_me:$LINENO: using moc from $MOC" >&5 $as_echo "$as_me: using moc from $MOC" >&6;} QT_VERSION=`$PKG_CONFIG QtGui --modversion` { $as_echo "$as_me:$LINENO: using Qt version $QT_VERSION" >&5 $as_echo "$as_me: using Qt version $QT_VERSION" >&6;} fi if test "x$with_qt" = "xyes"; then HAVE_QT_TRUE= HAVE_QT_FALSE='#' else HAVE_QT_TRUE='#' HAVE_QT_FALSE= fi { $as_echo "$as_me:$LINENO: checking whether to enable assertions" >&5 $as_echo_n "checking whether to enable assertions... " >&6; } # Check whether --enable-assert was given. if test "${enable_assert+set}" = set; then enableval=$enable_assert; { $as_echo "$as_me:$LINENO: result: no" >&5 $as_echo "no" >&6; } cat >>confdefs.h <<\_ACEOF #define NDEBUG 1 _ACEOF else { $as_echo "$as_me:$LINENO: result: yes" >&5 $as_echo "yes" >&6; } fi for ac_header in fcntl.h features.h inttypes.h stdlib.h string.h unistd.h \ sys/ioctl.h sys/time.h sys/times.h sys/ipc.h sys/shm.h sys/mman.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to spadix@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for int32_t" >&5 $as_echo_n "checking for int32_t... " >&6; } if test "${ac_cv_c_int32_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_int32_t=no for ac_type in 'int32_t' 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(0 < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1))]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 1) < ($ac_type) (((($ac_type) 1 << (32 - 2)) - 1) * 2 + 2))]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 case $ac_type in int32_t) ac_cv_c_int32_t=yes ;; *) ac_cv_c_int32_t=$ac_type ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_int32_t" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_int32_t" >&5 $as_echo "$ac_cv_c_int32_t" >&6; } case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int32_t $ac_cv_c_int32_t _ACEOF ;; esac { $as_echo "$as_me:$LINENO: checking for uint32_t" >&5 $as_echo_n "checking for uint32_t... " >&6; } if test "${ac_cv_c_uint32_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_uint32_t=no for ac_type in 'uint32_t' 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(($ac_type) -1 >> (32 - 1) == 1)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then case $ac_type in uint32_t) ac_cv_c_uint32_t=yes ;; *) ac_cv_c_uint32_t=$ac_type ;; esac else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_uint32_t" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint32_t" >&5 $as_echo "$ac_cv_c_uint32_t" >&6; } case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<\_ACEOF #define _UINT32_T 1 _ACEOF cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac { $as_echo "$as_me:$LINENO: checking for uint8_t" >&5 $as_echo_n "checking for uint8_t... " >&6; } if test "${ac_cv_c_uint8_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_uint8_t=no for ac_type in 'uint8_t' 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(($ac_type) -1 >> (8 - 1) == 1)]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then case $ac_type in uint8_t) ac_cv_c_uint8_t=yes ;; *) ac_cv_c_uint8_t=$ac_type ;; esac else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_uint8_t" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_uint8_t" >&5 $as_echo "$ac_cv_c_uint8_t" >&6; } case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) cat >>confdefs.h <<\_ACEOF #define _UINT8_T 1 _ACEOF cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac { $as_echo "$as_me:$LINENO: checking for uintptr_t" >&5 $as_echo_n "checking for uintptr_t... " >&6; } if test "${ac_cv_type_uintptr_t+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_type_uintptr_t=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof (uintptr_t)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { if (sizeof ((uintptr_t))) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_type_uintptr_t=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_type_uintptr_t" >&5 $as_echo "$ac_cv_type_uintptr_t" >&6; } if test "x$ac_cv_type_uintptr_t" = x""yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_UINTPTR_T 1 _ACEOF else for ac_type in 'unsigned int' 'unsigned long int' \ 'unsigned long long int'; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !(sizeof (void *) <= sizeof ($ac_type))]; test_array [0] = 0 ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then cat >>confdefs.h <<_ACEOF #define uintptr_t $ac_type _ACEOF ac_type= else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test -z "$ac_type" && break done fi { $as_echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 $as_echo_n "checking for an ANSI C-conforming const... " >&6; } if test "${ac_cv_c_const+set}" = set; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ int main () { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset cs; /* SunOS 4.1.1 cc rejects this. */ char const *const *pcpcc; char **ppc; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; pcpcc = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++pcpcc; ppc = (char**) pcpcc; pcpcc = (char const *const *) ppc; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; if (s) return 0; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; if (!foo) return 0; } return !cs[0] && !zero.x; #endif ; return 0; } _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_const=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_const=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 $as_echo "$ac_cv_c_const" >&6; } if test $ac_cv_c_const = no; then cat >>confdefs.h <<\_ACEOF #define const /**/ _ACEOF fi { $as_echo "$as_me:$LINENO: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } if test "${ac_cv_c_inline+set}" = set; then $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #ifndef __cplusplus typedef int foo_t; static $ac_kw foo_t static_foo () {return 0; } $ac_kw foo_t foo () {return 0; } #endif _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_inline=$ac_kw else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext test "$ac_cv_c_inline" != no && break done fi { $as_echo "$as_me:$LINENO: result: $ac_cv_c_inline" >&5 $as_echo "$ac_cv_c_inline" >&6; } case $ac_cv_c_inline in inline | yes) ;; *) case $ac_cv_c_inline in no) ac_val=;; *) ac_val=$ac_cv_c_inline;; esac cat >>confdefs.h <<_ACEOF #ifndef __cplusplus #define inline $ac_val #endif _ACEOF ;; esac for ac_header in stdlib.h unistd.h do as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 $as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext if { (ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 $as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF if { (ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext { $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 $as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 $as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------------------- ## ## Report this to spadix@users.sourceforge.net ## ## ------------------------------------------- ## _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 $as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi ac_res=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi as_val=`eval 'as_val=${'$as_ac_Header'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_func in getpagesize do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done { $as_echo "$as_me:$LINENO: checking for working mmap" >&5 $as_echo_n "checking for working mmap... " >&6; } if test "${ac_cv_func_mmap_fixed_mapped+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then ac_cv_func_mmap_fixed_mapped=no else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default /* malloc might have been renamed as rpl_malloc. */ #undef malloc /* Thanks to Mike Haertel and Jim Avera for this test. Here is a matrix of mmap possibilities: mmap private not fixed mmap private fixed at somewhere currently unmapped mmap private fixed at somewhere already mapped mmap shared not fixed mmap shared fixed at somewhere currently unmapped mmap shared fixed at somewhere already mapped For private mappings, we should verify that changes cannot be read() back from the file, nor mmap's back from the file at a different address. (There have been systems where private was not correctly implemented like the infamous i386 svr4.0, and systems where the VM page cache was not coherent with the file system buffer cache like early versions of FreeBSD and possibly contemporary NetBSD.) For shared mappings, we should conversely verify that changes get propagated back to all the places they're supposed to be. Grep wants private fixed already mapped. The main things grep needs to know about mmap are: * does it exist and is it safe to write into the mmap'd area * how to use it (BSD variants) */ #include #include #if !defined STDC_HEADERS && !defined HAVE_STDLIB_H char *malloc (); #endif /* This mess was copied from the GNU getpagesize.h. */ #ifndef HAVE_GETPAGESIZE /* Assume that all systems that can run configure have sys/param.h. */ # ifndef HAVE_SYS_PARAM_H # define HAVE_SYS_PARAM_H 1 # endif # ifdef _SC_PAGESIZE # define getpagesize() sysconf(_SC_PAGESIZE) # else /* no _SC_PAGESIZE */ # ifdef HAVE_SYS_PARAM_H # include # ifdef EXEC_PAGESIZE # define getpagesize() EXEC_PAGESIZE # else /* no EXEC_PAGESIZE */ # ifdef NBPG # define getpagesize() NBPG * CLSIZE # ifndef CLSIZE # define CLSIZE 1 # endif /* no CLSIZE */ # else /* no NBPG */ # ifdef NBPC # define getpagesize() NBPC # else /* no NBPC */ # ifdef PAGESIZE # define getpagesize() PAGESIZE # endif /* PAGESIZE */ # endif /* no NBPC */ # endif /* no NBPG */ # endif /* no EXEC_PAGESIZE */ # else /* no HAVE_SYS_PARAM_H */ # define getpagesize() 8192 /* punt totally */ # endif /* no HAVE_SYS_PARAM_H */ # endif /* no _SC_PAGESIZE */ #endif /* no HAVE_GETPAGESIZE */ int main () { char *data, *data2, *data3; int i, pagesize; int fd; pagesize = getpagesize (); /* First, make a file with some known garbage in it. */ data = (char *) malloc (pagesize); if (!data) return 1; for (i = 0; i < pagesize; ++i) *(data + i) = rand (); umask (0); fd = creat ("conftest.mmap", 0600); if (fd < 0) return 1; if (write (fd, data, pagesize) != pagesize) return 1; close (fd); /* Next, try to mmap the file at a fixed address which already has something else allocated at it. If we can, also make sure that we see the same garbage. */ fd = open ("conftest.mmap", O_RDWR); if (fd < 0) return 1; data2 = (char *) malloc (2 * pagesize); if (!data2) return 1; data2 += (pagesize - ((long int) data2 & (pagesize - 1))) & (pagesize - 1); if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_FIXED, fd, 0L)) return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data2 + i)) return 1; /* Finally, make sure that changes to the mapped area do not percolate back to the file as seen by read(). (This is a bug on some variants of i386 svr4.0.) */ for (i = 0; i < pagesize; ++i) *(data2 + i) = *(data2 + i) + 1; data3 = (char *) malloc (pagesize); if (!data3) return 1; if (read (fd, data3, pagesize) != pagesize) return 1; for (i = 0; i < pagesize; ++i) if (*(data + i) != *(data3 + i)) return 1; close (fd); return 0; } _ACEOF rm -f conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mmap_fixed_mapped=yes else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_func_mmap_fixed_mapped=no fi rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi { $as_echo "$as_me:$LINENO: result: $ac_cv_func_mmap_fixed_mapped" >&5 $as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; } if test $ac_cv_func_mmap_fixed_mapped = yes; then cat >>confdefs.h <<\_ACEOF #define HAVE_MMAP 1 _ACEOF fi rm -f conftest.mmap for ac_func in memset atexit setenv do as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` { $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 $as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ /* Define $ac_func to an innocuous variant, in case declares $ac_func. For example, HP-UX 11i declares gettimeofday. */ #define $ac_func innocuous_$ac_func /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $ac_func /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$ac_func || defined __stub___$ac_func choke me #endif int main () { return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" $as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || $as_test_x conftest$ac_exeext }; then eval "$as_ac_var=yes" else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi ac_res=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } as_val=`eval 'as_val=${'$as_ac_var'} $as_echo "$as_val"'` if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_commands="$ac_config_commands doc/version.xml" ac_config_commands="$ac_config_commands doc/reldate.xml" ac_config_files="$ac_config_files Makefile zbar.pc zbar-gtk.pc zbar-qt.pc doc/doxygen.conf" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${WIN32_TRUE}" && test -z "${WIN32_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"WIN32\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"am__fastdepCXX\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_EAN_TRUE}" && test -z "${ENABLE_EAN_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_EAN\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ENABLE_EAN\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_CODE128_TRUE}" && test -z "${ENABLE_CODE128_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_CODE128\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ENABLE_CODE128\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_CODE39_TRUE}" && test -z "${ENABLE_CODE39_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_CODE39\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ENABLE_CODE39\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_PDF417_TRUE}" && test -z "${ENABLE_PDF417_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_PDF417\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ENABLE_PDF417\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_I25_TRUE}" && test -z "${ENABLE_I25_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_I25\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ENABLE_I25\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${ENABLE_QRCODE_TRUE}" && test -z "${ENABLE_QRCODE_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"ENABLE_QRCODE\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"ENABLE_QRCODE\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_POLL_TRUE}" && test -z "${HAVE_POLL_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_POLL\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_POLL\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_VIDEO_TRUE}" && test -z "${HAVE_VIDEO_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_VIDEO\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_VIDEO\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_V4L1_TRUE}" && test -z "${HAVE_V4L1_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_V4L1\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_V4L1\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_V4L2_TRUE}" && test -z "${HAVE_V4L2_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_V4L2\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_V4L2\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_X_TRUE}" && test -z "${HAVE_X_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_X\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_X\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_XSHM_TRUE}" && test -z "${HAVE_XSHM_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_XSHM\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_XSHM\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_XV_TRUE}" && test -z "${HAVE_XV_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_XV\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_XV\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_JPEG_TRUE}" && test -z "${HAVE_JPEG_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_JPEG\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_JPEG\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_MAGICK_TRUE}" && test -z "${HAVE_MAGICK_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_MAGICK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_MAGICK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_NPAPI_TRUE}" && test -z "${HAVE_NPAPI_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_NPAPI\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_NPAPI\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_GTK_TRUE}" && test -z "${HAVE_GTK_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_GTK\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_GTK\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi if test -z "${HAVE_QT_TRUE}" && test -z "${HAVE_QT_FALSE}"; then { { $as_echo "$as_me:$LINENO: error: conditional \"HAVE_QT\" was never defined. Usually this means the macro was only invoked conditionally." >&5 $as_echo "$as_me: error: conditional \"HAVE_QT\" was never defined. Usually this means the macro was only invoked conditionally." >&2;} { (exit 1); exit 1; }; } fi : ${CONFIG_STATUS=./config.status} ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac fi # PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Support unset when possible. if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then as_unset=unset else as_unset=false fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. case $0 in *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi # Work around bugs in pre-3.0 UWIN ksh. for as_var in ENV MAIL MAILPATH do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi # Name of the executable. as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # CDPATH. $as_unset CDPATH as_lineno_1=$LINENO as_lineno_2=$LINENO test "x$as_lineno_1" != "x$as_lineno_2" && test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a # line-number line after each line using $LINENO; the second 'sed' # does the real work. The second script uses 'N' to pair each # line-number line with the line containing $LINENO, and appends # trailing '-' during substitution so that $LINENO is not a special # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the # scripts with optimization help from Paolo Bonzini. Blame Lee # E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in -n*) case `echo 'x\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. *) ECHO_C='\c';; esac;; *) ECHO_N='-n';; esac if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -p'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi else as_ln_s='cp -p' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: else test -d ./-p && rmdir ./-p as_mkdir_p=false fi if test -x / >/dev/null 2>&1; then as_test_x='test -x' else if ls -dL / >/dev/null 2>&1; then as_ls_L_option=L else as_ls_L_option= fi as_test_x=' eval sh -c '\'' if test -d "$1"; then test -d "$1/."; else case $1 in -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi '\'' sh ' fi as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 # Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by zbar $as_me 0.10, which was generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ zbar config.status 0.10 configured by $0, generated by GNU Autoconf 2.63, with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *) ac_config_targets="$ac_config_targets $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' macro_version='`$ECHO "X$macro_version" | $Xsed -e "$delay_single_quote_subst"`' macro_revision='`$ECHO "X$macro_revision" | $Xsed -e "$delay_single_quote_subst"`' AS='`$ECHO "X$AS" | $Xsed -e "$delay_single_quote_subst"`' DLLTOOL='`$ECHO "X$DLLTOOL" | $Xsed -e "$delay_single_quote_subst"`' OBJDUMP='`$ECHO "X$OBJDUMP" | $Xsed -e "$delay_single_quote_subst"`' enable_shared='`$ECHO "X$enable_shared" | $Xsed -e "$delay_single_quote_subst"`' enable_static='`$ECHO "X$enable_static" | $Xsed -e "$delay_single_quote_subst"`' pic_mode='`$ECHO "X$pic_mode" | $Xsed -e "$delay_single_quote_subst"`' enable_fast_install='`$ECHO "X$enable_fast_install" | $Xsed -e "$delay_single_quote_subst"`' host_alias='`$ECHO "X$host_alias" | $Xsed -e "$delay_single_quote_subst"`' host='`$ECHO "X$host" | $Xsed -e "$delay_single_quote_subst"`' host_os='`$ECHO "X$host_os" | $Xsed -e "$delay_single_quote_subst"`' build_alias='`$ECHO "X$build_alias" | $Xsed -e "$delay_single_quote_subst"`' build='`$ECHO "X$build" | $Xsed -e "$delay_single_quote_subst"`' build_os='`$ECHO "X$build_os" | $Xsed -e "$delay_single_quote_subst"`' SED='`$ECHO "X$SED" | $Xsed -e "$delay_single_quote_subst"`' Xsed='`$ECHO "X$Xsed" | $Xsed -e "$delay_single_quote_subst"`' GREP='`$ECHO "X$GREP" | $Xsed -e "$delay_single_quote_subst"`' EGREP='`$ECHO "X$EGREP" | $Xsed -e "$delay_single_quote_subst"`' FGREP='`$ECHO "X$FGREP" | $Xsed -e "$delay_single_quote_subst"`' LD='`$ECHO "X$LD" | $Xsed -e "$delay_single_quote_subst"`' NM='`$ECHO "X$NM" | $Xsed -e "$delay_single_quote_subst"`' LN_S='`$ECHO "X$LN_S" | $Xsed -e "$delay_single_quote_subst"`' max_cmd_len='`$ECHO "X$max_cmd_len" | $Xsed -e "$delay_single_quote_subst"`' ac_objext='`$ECHO "X$ac_objext" | $Xsed -e "$delay_single_quote_subst"`' exeext='`$ECHO "X$exeext" | $Xsed -e "$delay_single_quote_subst"`' lt_unset='`$ECHO "X$lt_unset" | $Xsed -e "$delay_single_quote_subst"`' lt_SP2NL='`$ECHO "X$lt_SP2NL" | $Xsed -e "$delay_single_quote_subst"`' lt_NL2SP='`$ECHO "X$lt_NL2SP" | $Xsed -e "$delay_single_quote_subst"`' reload_flag='`$ECHO "X$reload_flag" | $Xsed -e "$delay_single_quote_subst"`' reload_cmds='`$ECHO "X$reload_cmds" | $Xsed -e "$delay_single_quote_subst"`' deplibs_check_method='`$ECHO "X$deplibs_check_method" | $Xsed -e "$delay_single_quote_subst"`' file_magic_cmd='`$ECHO "X$file_magic_cmd" | $Xsed -e "$delay_single_quote_subst"`' AR='`$ECHO "X$AR" | $Xsed -e "$delay_single_quote_subst"`' AR_FLAGS='`$ECHO "X$AR_FLAGS" | $Xsed -e "$delay_single_quote_subst"`' STRIP='`$ECHO "X$STRIP" | $Xsed -e "$delay_single_quote_subst"`' RANLIB='`$ECHO "X$RANLIB" | $Xsed -e "$delay_single_quote_subst"`' old_postinstall_cmds='`$ECHO "X$old_postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_postuninstall_cmds='`$ECHO "X$old_postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds='`$ECHO "X$old_archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' CC='`$ECHO "X$CC" | $Xsed -e "$delay_single_quote_subst"`' CFLAGS='`$ECHO "X$CFLAGS" | $Xsed -e "$delay_single_quote_subst"`' compiler='`$ECHO "X$compiler" | $Xsed -e "$delay_single_quote_subst"`' GCC='`$ECHO "X$GCC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_pipe='`$ECHO "X$lt_cv_sys_global_symbol_pipe" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_cdecl='`$ECHO "X$lt_cv_sys_global_symbol_to_cdecl" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "X$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' objdir='`$ECHO "X$objdir" | $Xsed -e "$delay_single_quote_subst"`' SHELL='`$ECHO "X$SHELL" | $Xsed -e "$delay_single_quote_subst"`' ECHO='`$ECHO "X$ECHO" | $Xsed -e "$delay_single_quote_subst"`' MAGIC_CMD='`$ECHO "X$MAGIC_CMD" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag='`$ECHO "X$lt_prog_compiler_no_builtin_flag" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl='`$ECHO "X$lt_prog_compiler_wl" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic='`$ECHO "X$lt_prog_compiler_pic" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static='`$ECHO "X$lt_prog_compiler_static" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o='`$ECHO "X$lt_cv_prog_compiler_c_o" | $Xsed -e "$delay_single_quote_subst"`' need_locks='`$ECHO "X$need_locks" | $Xsed -e "$delay_single_quote_subst"`' DSYMUTIL='`$ECHO "X$DSYMUTIL" | $Xsed -e "$delay_single_quote_subst"`' NMEDIT='`$ECHO "X$NMEDIT" | $Xsed -e "$delay_single_quote_subst"`' LIPO='`$ECHO "X$LIPO" | $Xsed -e "$delay_single_quote_subst"`' OTOOL='`$ECHO "X$OTOOL" | $Xsed -e "$delay_single_quote_subst"`' OTOOL64='`$ECHO "X$OTOOL64" | $Xsed -e "$delay_single_quote_subst"`' libext='`$ECHO "X$libext" | $Xsed -e "$delay_single_quote_subst"`' shrext_cmds='`$ECHO "X$shrext_cmds" | $Xsed -e "$delay_single_quote_subst"`' extract_expsyms_cmds='`$ECHO "X$extract_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc='`$ECHO "X$archive_cmds_need_lc" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes='`$ECHO "X$enable_shared_with_static_runtimes" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec='`$ECHO "X$export_dynamic_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec='`$ECHO "X$whole_archive_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object='`$ECHO "X$compiler_needs_object" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds='`$ECHO "X$old_archive_from_new_cmds" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds='`$ECHO "X$old_archive_from_expsyms_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds='`$ECHO "X$archive_cmds" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds='`$ECHO "X$archive_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_cmds='`$ECHO "X$module_cmds" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds='`$ECHO "X$module_expsym_cmds" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld='`$ECHO "X$with_gnu_ld" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag='`$ECHO "X$allow_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag='`$ECHO "X$no_undefined_flag" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec='`$ECHO "X$hardcode_libdir_flag_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld='`$ECHO "X$hardcode_libdir_flag_spec_ld" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator='`$ECHO "X$hardcode_libdir_separator" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct='`$ECHO "X$hardcode_direct" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute='`$ECHO "X$hardcode_direct_absolute" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L='`$ECHO "X$hardcode_minus_L" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var='`$ECHO "X$hardcode_shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic='`$ECHO "X$hardcode_automatic" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath='`$ECHO "X$inherit_rpath" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs='`$ECHO "X$link_all_deplibs" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path='`$ECHO "X$fix_srcfile_path" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols='`$ECHO "X$always_export_symbols" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds='`$ECHO "X$export_symbols_cmds" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms='`$ECHO "X$exclude_expsyms" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms='`$ECHO "X$include_expsyms" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds='`$ECHO "X$prelink_cmds" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec='`$ECHO "X$file_list_spec" | $Xsed -e "$delay_single_quote_subst"`' variables_saved_for_relink='`$ECHO "X$variables_saved_for_relink" | $Xsed -e "$delay_single_quote_subst"`' need_lib_prefix='`$ECHO "X$need_lib_prefix" | $Xsed -e "$delay_single_quote_subst"`' need_version='`$ECHO "X$need_version" | $Xsed -e "$delay_single_quote_subst"`' version_type='`$ECHO "X$version_type" | $Xsed -e "$delay_single_quote_subst"`' runpath_var='`$ECHO "X$runpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_var='`$ECHO "X$shlibpath_var" | $Xsed -e "$delay_single_quote_subst"`' shlibpath_overrides_runpath='`$ECHO "X$shlibpath_overrides_runpath" | $Xsed -e "$delay_single_quote_subst"`' libname_spec='`$ECHO "X$libname_spec" | $Xsed -e "$delay_single_quote_subst"`' library_names_spec='`$ECHO "X$library_names_spec" | $Xsed -e "$delay_single_quote_subst"`' soname_spec='`$ECHO "X$soname_spec" | $Xsed -e "$delay_single_quote_subst"`' postinstall_cmds='`$ECHO "X$postinstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' postuninstall_cmds='`$ECHO "X$postuninstall_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_cmds='`$ECHO "X$finish_cmds" | $Xsed -e "$delay_single_quote_subst"`' finish_eval='`$ECHO "X$finish_eval" | $Xsed -e "$delay_single_quote_subst"`' hardcode_into_libs='`$ECHO "X$hardcode_into_libs" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_search_path_spec='`$ECHO "X$sys_lib_search_path_spec" | $Xsed -e "$delay_single_quote_subst"`' sys_lib_dlsearch_path_spec='`$ECHO "X$sys_lib_dlsearch_path_spec" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action='`$ECHO "X$hardcode_action" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen='`$ECHO "X$enable_dlopen" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self='`$ECHO "X$enable_dlopen_self" | $Xsed -e "$delay_single_quote_subst"`' enable_dlopen_self_static='`$ECHO "X$enable_dlopen_self_static" | $Xsed -e "$delay_single_quote_subst"`' old_striplib='`$ECHO "X$old_striplib" | $Xsed -e "$delay_single_quote_subst"`' striplib='`$ECHO "X$striplib" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_dirs='`$ECHO "X$compiler_lib_search_dirs" | $Xsed -e "$delay_single_quote_subst"`' predep_objects='`$ECHO "X$predep_objects" | $Xsed -e "$delay_single_quote_subst"`' postdep_objects='`$ECHO "X$postdep_objects" | $Xsed -e "$delay_single_quote_subst"`' predeps='`$ECHO "X$predeps" | $Xsed -e "$delay_single_quote_subst"`' postdeps='`$ECHO "X$postdeps" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_path='`$ECHO "X$compiler_lib_search_path" | $Xsed -e "$delay_single_quote_subst"`' LD_RC='`$ECHO "X$LD_RC" | $Xsed -e "$delay_single_quote_subst"`' LD_CXX='`$ECHO "X$LD_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds_RC='`$ECHO "X$old_archive_cmds_RC" | $Xsed -e "$delay_single_quote_subst"`' old_archive_cmds_CXX='`$ECHO "X$old_archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_RC='`$ECHO "X$compiler_RC" | $Xsed -e "$delay_single_quote_subst"`' compiler_CXX='`$ECHO "X$compiler_CXX" | $Xsed -e "$delay_single_quote_subst"`' GCC_RC='`$ECHO "X$GCC_RC" | $Xsed -e "$delay_single_quote_subst"`' GCC_CXX='`$ECHO "X$GCC_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_RC='`$ECHO "X$lt_prog_compiler_no_builtin_flag_RC" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "X$lt_prog_compiler_no_builtin_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl_RC='`$ECHO "X$lt_prog_compiler_wl_RC" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_wl_CXX='`$ECHO "X$lt_prog_compiler_wl_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic_RC='`$ECHO "X$lt_prog_compiler_pic_RC" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_pic_CXX='`$ECHO "X$lt_prog_compiler_pic_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static_RC='`$ECHO "X$lt_prog_compiler_static_RC" | $Xsed -e "$delay_single_quote_subst"`' lt_prog_compiler_static_CXX='`$ECHO "X$lt_prog_compiler_static_CXX" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_RC='`$ECHO "X$lt_cv_prog_compiler_c_o_RC" | $Xsed -e "$delay_single_quote_subst"`' lt_cv_prog_compiler_c_o_CXX='`$ECHO "X$lt_cv_prog_compiler_c_o_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc_RC='`$ECHO "X$archive_cmds_need_lc_RC" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_need_lc_CXX='`$ECHO "X$archive_cmds_need_lc_CXX" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_RC='`$ECHO "X$enable_shared_with_static_runtimes_RC" | $Xsed -e "$delay_single_quote_subst"`' enable_shared_with_static_runtimes_CXX='`$ECHO "X$enable_shared_with_static_runtimes_CXX" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec_RC='`$ECHO "X$export_dynamic_flag_spec_RC" | $Xsed -e "$delay_single_quote_subst"`' export_dynamic_flag_spec_CXX='`$ECHO "X$export_dynamic_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec_RC='`$ECHO "X$whole_archive_flag_spec_RC" | $Xsed -e "$delay_single_quote_subst"`' whole_archive_flag_spec_CXX='`$ECHO "X$whole_archive_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object_RC='`$ECHO "X$compiler_needs_object_RC" | $Xsed -e "$delay_single_quote_subst"`' compiler_needs_object_CXX='`$ECHO "X$compiler_needs_object_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds_RC='`$ECHO "X$old_archive_from_new_cmds_RC" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_new_cmds_CXX='`$ECHO "X$old_archive_from_new_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_RC='`$ECHO "X$old_archive_from_expsyms_cmds_RC" | $Xsed -e "$delay_single_quote_subst"`' old_archive_from_expsyms_cmds_CXX='`$ECHO "X$old_archive_from_expsyms_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_RC='`$ECHO "X$archive_cmds_RC" | $Xsed -e "$delay_single_quote_subst"`' archive_cmds_CXX='`$ECHO "X$archive_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds_RC='`$ECHO "X$archive_expsym_cmds_RC" | $Xsed -e "$delay_single_quote_subst"`' archive_expsym_cmds_CXX='`$ECHO "X$archive_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' module_cmds_RC='`$ECHO "X$module_cmds_RC" | $Xsed -e "$delay_single_quote_subst"`' module_cmds_CXX='`$ECHO "X$module_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds_RC='`$ECHO "X$module_expsym_cmds_RC" | $Xsed -e "$delay_single_quote_subst"`' module_expsym_cmds_CXX='`$ECHO "X$module_expsym_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld_RC='`$ECHO "X$with_gnu_ld_RC" | $Xsed -e "$delay_single_quote_subst"`' with_gnu_ld_CXX='`$ECHO "X$with_gnu_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag_RC='`$ECHO "X$allow_undefined_flag_RC" | $Xsed -e "$delay_single_quote_subst"`' allow_undefined_flag_CXX='`$ECHO "X$allow_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag_RC='`$ECHO "X$no_undefined_flag_RC" | $Xsed -e "$delay_single_quote_subst"`' no_undefined_flag_CXX='`$ECHO "X$no_undefined_flag_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_RC='`$ECHO "X$hardcode_libdir_flag_spec_RC" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_CXX='`$ECHO "X$hardcode_libdir_flag_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld_RC='`$ECHO "X$hardcode_libdir_flag_spec_ld_RC" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_flag_spec_ld_CXX='`$ECHO "X$hardcode_libdir_flag_spec_ld_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator_RC='`$ECHO "X$hardcode_libdir_separator_RC" | $Xsed -e "$delay_single_quote_subst"`' hardcode_libdir_separator_CXX='`$ECHO "X$hardcode_libdir_separator_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_RC='`$ECHO "X$hardcode_direct_RC" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_CXX='`$ECHO "X$hardcode_direct_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute_RC='`$ECHO "X$hardcode_direct_absolute_RC" | $Xsed -e "$delay_single_quote_subst"`' hardcode_direct_absolute_CXX='`$ECHO "X$hardcode_direct_absolute_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L_RC='`$ECHO "X$hardcode_minus_L_RC" | $Xsed -e "$delay_single_quote_subst"`' hardcode_minus_L_CXX='`$ECHO "X$hardcode_minus_L_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var_RC='`$ECHO "X$hardcode_shlibpath_var_RC" | $Xsed -e "$delay_single_quote_subst"`' hardcode_shlibpath_var_CXX='`$ECHO "X$hardcode_shlibpath_var_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic_RC='`$ECHO "X$hardcode_automatic_RC" | $Xsed -e "$delay_single_quote_subst"`' hardcode_automatic_CXX='`$ECHO "X$hardcode_automatic_CXX" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath_RC='`$ECHO "X$inherit_rpath_RC" | $Xsed -e "$delay_single_quote_subst"`' inherit_rpath_CXX='`$ECHO "X$inherit_rpath_CXX" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs_RC='`$ECHO "X$link_all_deplibs_RC" | $Xsed -e "$delay_single_quote_subst"`' link_all_deplibs_CXX='`$ECHO "X$link_all_deplibs_CXX" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path_RC='`$ECHO "X$fix_srcfile_path_RC" | $Xsed -e "$delay_single_quote_subst"`' fix_srcfile_path_CXX='`$ECHO "X$fix_srcfile_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols_RC='`$ECHO "X$always_export_symbols_RC" | $Xsed -e "$delay_single_quote_subst"`' always_export_symbols_CXX='`$ECHO "X$always_export_symbols_CXX" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds_RC='`$ECHO "X$export_symbols_cmds_RC" | $Xsed -e "$delay_single_quote_subst"`' export_symbols_cmds_CXX='`$ECHO "X$export_symbols_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms_RC='`$ECHO "X$exclude_expsyms_RC" | $Xsed -e "$delay_single_quote_subst"`' exclude_expsyms_CXX='`$ECHO "X$exclude_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms_RC='`$ECHO "X$include_expsyms_RC" | $Xsed -e "$delay_single_quote_subst"`' include_expsyms_CXX='`$ECHO "X$include_expsyms_CXX" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds_RC='`$ECHO "X$prelink_cmds_RC" | $Xsed -e "$delay_single_quote_subst"`' prelink_cmds_CXX='`$ECHO "X$prelink_cmds_CXX" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec_RC='`$ECHO "X$file_list_spec_RC" | $Xsed -e "$delay_single_quote_subst"`' file_list_spec_CXX='`$ECHO "X$file_list_spec_CXX" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action_RC='`$ECHO "X$hardcode_action_RC" | $Xsed -e "$delay_single_quote_subst"`' hardcode_action_CXX='`$ECHO "X$hardcode_action_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_dirs_RC='`$ECHO "X$compiler_lib_search_dirs_RC" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_dirs_CXX='`$ECHO "X$compiler_lib_search_dirs_CXX" | $Xsed -e "$delay_single_quote_subst"`' predep_objects_RC='`$ECHO "X$predep_objects_RC" | $Xsed -e "$delay_single_quote_subst"`' predep_objects_CXX='`$ECHO "X$predep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' postdep_objects_RC='`$ECHO "X$postdep_objects_RC" | $Xsed -e "$delay_single_quote_subst"`' postdep_objects_CXX='`$ECHO "X$postdep_objects_CXX" | $Xsed -e "$delay_single_quote_subst"`' predeps_RC='`$ECHO "X$predeps_RC" | $Xsed -e "$delay_single_quote_subst"`' predeps_CXX='`$ECHO "X$predeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' postdeps_RC='`$ECHO "X$postdeps_RC" | $Xsed -e "$delay_single_quote_subst"`' postdeps_CXX='`$ECHO "X$postdeps_CXX" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_path_RC='`$ECHO "X$compiler_lib_search_path_RC" | $Xsed -e "$delay_single_quote_subst"`' compiler_lib_search_path_CXX='`$ECHO "X$compiler_lib_search_path_CXX" | $Xsed -e "$delay_single_quote_subst"`' LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # Quote evaled strings. for var in SED \ GREP \ EGREP \ FGREP \ LD \ NM \ LN_S \ lt_SP2NL \ lt_NL2SP \ reload_flag \ deplibs_check_method \ file_magic_cmd \ AR \ AR_FLAGS \ STRIP \ RANLIB \ CC \ CFLAGS \ compiler \ lt_cv_sys_global_symbol_pipe \ lt_cv_sys_global_symbol_to_cdecl \ lt_cv_sys_global_symbol_to_c_name_address \ lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \ SHELL \ ECHO \ lt_prog_compiler_no_builtin_flag \ lt_prog_compiler_wl \ lt_prog_compiler_pic \ lt_prog_compiler_static \ lt_cv_prog_compiler_c_o \ need_locks \ DSYMUTIL \ NMEDIT \ LIPO \ OTOOL \ OTOOL64 \ shrext_cmds \ export_dynamic_flag_spec \ whole_archive_flag_spec \ compiler_needs_object \ with_gnu_ld \ allow_undefined_flag \ no_undefined_flag \ hardcode_libdir_flag_spec \ hardcode_libdir_flag_spec_ld \ hardcode_libdir_separator \ fix_srcfile_path \ exclude_expsyms \ include_expsyms \ file_list_spec \ variables_saved_for_relink \ libname_spec \ library_names_spec \ soname_spec \ finish_eval \ old_striplib \ striplib \ compiler_lib_search_dirs \ predep_objects \ postdep_objects \ predeps \ postdeps \ compiler_lib_search_path \ LD_RC \ LD_CXX \ compiler_RC \ compiler_CXX \ lt_prog_compiler_no_builtin_flag_RC \ lt_prog_compiler_no_builtin_flag_CXX \ lt_prog_compiler_wl_RC \ lt_prog_compiler_wl_CXX \ lt_prog_compiler_pic_RC \ lt_prog_compiler_pic_CXX \ lt_prog_compiler_static_RC \ lt_prog_compiler_static_CXX \ lt_cv_prog_compiler_c_o_RC \ lt_cv_prog_compiler_c_o_CXX \ export_dynamic_flag_spec_RC \ export_dynamic_flag_spec_CXX \ whole_archive_flag_spec_RC \ whole_archive_flag_spec_CXX \ compiler_needs_object_RC \ compiler_needs_object_CXX \ with_gnu_ld_RC \ with_gnu_ld_CXX \ allow_undefined_flag_RC \ allow_undefined_flag_CXX \ no_undefined_flag_RC \ no_undefined_flag_CXX \ hardcode_libdir_flag_spec_RC \ hardcode_libdir_flag_spec_CXX \ hardcode_libdir_flag_spec_ld_RC \ hardcode_libdir_flag_spec_ld_CXX \ hardcode_libdir_separator_RC \ hardcode_libdir_separator_CXX \ fix_srcfile_path_RC \ fix_srcfile_path_CXX \ exclude_expsyms_RC \ exclude_expsyms_CXX \ include_expsyms_RC \ include_expsyms_CXX \ file_list_spec_RC \ file_list_spec_CXX \ compiler_lib_search_dirs_RC \ compiler_lib_search_dirs_CXX \ predep_objects_RC \ predep_objects_CXX \ postdep_objects_RC \ postdep_objects_CXX \ predeps_RC \ predeps_CXX \ postdeps_RC \ postdeps_CXX \ compiler_lib_search_path_RC \ compiler_lib_search_path_CXX; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in reload_cmds \ old_postinstall_cmds \ old_postuninstall_cmds \ old_archive_cmds \ extract_expsyms_cmds \ old_archive_from_new_cmds \ old_archive_from_expsyms_cmds \ archive_cmds \ archive_expsym_cmds \ module_cmds \ module_expsym_cmds \ export_symbols_cmds \ prelink_cmds \ postinstall_cmds \ postuninstall_cmds \ finish_cmds \ sys_lib_search_path_spec \ sys_lib_dlsearch_path_spec \ old_archive_cmds_RC \ old_archive_cmds_CXX \ old_archive_from_new_cmds_RC \ old_archive_from_new_cmds_CXX \ old_archive_from_expsyms_cmds_RC \ old_archive_from_expsyms_cmds_CXX \ archive_cmds_RC \ archive_cmds_CXX \ archive_expsym_cmds_RC \ archive_expsym_cmds_CXX \ module_cmds_RC \ module_cmds_CXX \ module_expsym_cmds_RC \ module_expsym_cmds_CXX \ export_symbols_cmds_RC \ export_symbols_cmds_CXX \ prelink_cmds_RC \ prelink_cmds_CXX; do case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in *[\\\\\\\`\\"\\\$]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Fix-up fallback echo if it was mangled by the above quoting rules. case \$lt_ECHO in *'\\\$0 --fallback-echo"') lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\$0 --fallback-echo"\$/\$0 --fallback-echo"/'\` ;; esac ac_aux_dir='$ac_aux_dir' xsi_shell='$xsi_shell' lt_shell_append='$lt_shell_append' # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile' VERSION="$VERSION" RELDATE="$RELDATE" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;; "doc/version.xml") CONFIG_COMMANDS="$CONFIG_COMMANDS doc/version.xml" ;; "doc/reldate.xml") CONFIG_COMMANDS="$CONFIG_COMMANDS doc/reldate.xml" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "zbar.pc") CONFIG_FILES="$CONFIG_FILES zbar.pc" ;; "zbar-gtk.pc") CONFIG_FILES="$CONFIG_FILES zbar-gtk.pc" ;; "zbar-qt.pc") CONFIG_FILES="$CONFIG_FILES zbar-qt.pc" ;; "doc/doxygen.conf") CONFIG_FILES="$CONFIG_FILES doc/doxygen.conf" ;; *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 $as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= trap 'exit_status=$? { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status ' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || { $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=' ' ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 $as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\).*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\).*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 $as_echo "$as_me: error: could not setup config files machinery" >&2;} { (exit 1); exit 1; }; } _ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/ s/:*\${srcdir}:*/:/ s/:*@srcdir@:*/:/ s/^\([^=]*=[ ]*\):*/\1/ s/:*$// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_t=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_t"; then break elif $ac_last_try; then { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 $as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 $as_echo "$as_me: error: could not setup config headers machinery" >&2;} { (exit 1); exit 1; }; } fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 $as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$tmp/stdin" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir="$ac_dir" case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p ' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in -) cat "$tmp/out" && rm -f "$tmp/out";; *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; esac \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" } >"$tmp/config.h" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" \ || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 $as_echo "$as_me: error: could not create $ac_file" >&2;} { (exit 1); exit 1; }; } fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 $as_echo "$as_me: error: could not create -" >&2;} { (exit 1); exit 1; }; } fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:$LINENO: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || # Autoconf 2.62 quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named `Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running `make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # When using ansi2knr, U may be empty or an underscore; expand it U=`sed -n 's/^U = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` { as_dir=$dirpart/$fdir case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 $as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done ;; "libtool":C) # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008 Free Software Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. # The names of the tagged configurations supported by this script. available_tags="RC CXX " # ### BEGIN LIBTOOL CONFIG # Which release of libtool.m4 was used? macro_version=$macro_version macro_revision=$macro_revision # Assembler program. AS=$AS # DLL creation program. DLLTOOL=$DLLTOOL # Object dumper program. OBJDUMP=$OBJDUMP # Whether or not to build shared libraries. build_libtool_libs=$enable_shared # Whether or not to build static libraries. build_old_libs=$enable_static # What type of objects to build. pic_mode=$pic_mode # Whether or not to optimize for fast installation. fast_install=$enable_fast_install # The host system. host_alias=$host_alias host=$host host_os=$host_os # The build system. build_alias=$build_alias build=$build build_os=$build_os # A sed program that does not truncate output. SED=$lt_SED # Sed that helps us avoid accidentally triggering echo(1) options like -n. Xsed="\$SED -e 1s/^X//" # A grep program that handles long lines. GREP=$lt_GREP # An ERE matcher. EGREP=$lt_EGREP # A literal string matcher. FGREP=$lt_FGREP # A BSD- or MS-compatible name lister. NM=$lt_NM # Whether we need soft or hard links. LN_S=$lt_LN_S # What is the maximum length of a command? max_cmd_len=$max_cmd_len # Object file suffix (normally "o"). objext=$ac_objext # Executable file suffix (normally ""). exeext=$exeext # whether the shell understands "unset". lt_unset=$lt_unset # turn spaces into newlines. SP2NL=$lt_lt_SP2NL # turn newlines into spaces. NL2SP=$lt_lt_NL2SP # How to create reloadable object files. reload_flag=$lt_reload_flag reload_cmds=$lt_reload_cmds # Method to check whether dependent libraries are shared objects. deplibs_check_method=$lt_deplibs_check_method # Command to use when deplibs_check_method == "file_magic". file_magic_cmd=$lt_file_magic_cmd # The archiver. AR=$lt_AR AR_FLAGS=$lt_AR_FLAGS # A symbol stripping program. STRIP=$lt_STRIP # Commands used to install an old-style archive. RANLIB=$lt_RANLIB old_postinstall_cmds=$lt_old_postinstall_cmds old_postuninstall_cmds=$lt_old_postuninstall_cmds # A C compiler. LTCC=$lt_CC # LTCC compiler flags. LTCFLAGS=$lt_CFLAGS # Take the output of nm and produce a listing of raw symbols and C names. global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe # Transform the output of nm in a proper C declaration. global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl # Transform the output of nm in a C name address pair. global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address # Transform the output of nm in a C name address pair when lib prefix is needed. global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix # The name of the directory that contains temporary libtool files. objdir=$objdir # Shell to use when invoking shell scripts. SHELL=$lt_SHELL # An echo program that does not interpret backslashes. ECHO=$lt_ECHO # Used to examine libraries when file_magic_cmd begins with "file". MAGIC_CMD=$MAGIC_CMD # Must we lock files when doing compilation? need_locks=$lt_need_locks # Tool to manipulate archived DWARF debug symbol files on Mac OS X. DSYMUTIL=$lt_DSYMUTIL # Tool to change global to local symbols on Mac OS X. NMEDIT=$lt_NMEDIT # Tool to manipulate fat objects and archives on Mac OS X. LIPO=$lt_LIPO # ldd/readelf like tool for Mach-O binaries on Mac OS X. OTOOL=$lt_OTOOL # ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4. OTOOL64=$lt_OTOOL64 # Old archive suffix (normally "a"). libext=$libext # Shared library suffix (normally ".so"). shrext_cmds=$lt_shrext_cmds # The commands to extract the exported symbol list from a shared archive. extract_expsyms_cmds=$lt_extract_expsyms_cmds # Variables whose values should be saved in libtool wrapper scripts and # restored at link time. variables_saved_for_relink=$lt_variables_saved_for_relink # Do we need the "lib" prefix for modules? need_lib_prefix=$need_lib_prefix # Do we need a version for libraries? need_version=$need_version # Library versioning type. version_type=$version_type # Shared library runtime path variable. runpath_var=$runpath_var # Shared library path variable. shlibpath_var=$shlibpath_var # Is shlibpath searched before the hard-coded library search path? shlibpath_overrides_runpath=$shlibpath_overrides_runpath # Format of library name prefix. libname_spec=$lt_libname_spec # List of archive names. First name is the real one, the rest are links. # The last name is the one that the linker finds with -lNAME library_names_spec=$lt_library_names_spec # The coded name of the library, if different from the real name. soname_spec=$lt_soname_spec # Command to use after installation of a shared archive. postinstall_cmds=$lt_postinstall_cmds # Command to use after uninstallation of a shared archive. postuninstall_cmds=$lt_postuninstall_cmds # Commands used to finish a libtool library installation in a directory. finish_cmds=$lt_finish_cmds # As "finish_cmds", except a single script fragment to be evaled but # not shown. finish_eval=$lt_finish_eval # Whether we should hardcode library paths into libraries. hardcode_into_libs=$hardcode_into_libs # Compile-time system search path for libraries. sys_lib_search_path_spec=$lt_sys_lib_search_path_spec # Run-time system search path for libraries. sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec # Whether dlopen is supported. dlopen_support=$enable_dlopen # Whether dlopen of programs is supported. dlopen_self=$enable_dlopen_self # Whether dlopen of statically linked programs is supported. dlopen_self_static=$enable_dlopen_self_static # Commands to strip libraries. old_striplib=$lt_old_striplib striplib=$lt_striplib # The linker used to build libraries. LD=$lt_LD # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds # A language specific compiler. CC=$lt_compiler # Is the compiler the GNU compiler? with_gcc=$GCC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds archive_expsym_cmds=$lt_archive_expsym_cmds # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds module_expsym_cmds=$lt_module_expsym_cmds # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms # Symbols that must always be exported. include_expsyms=$lt_include_expsyms # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds # Specify filename containing input files. file_list_spec=$lt_file_list_spec # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects postdep_objects=$lt_postdep_objects predeps=$lt_predeps postdeps=$lt_postdeps # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac ltmain="$ac_aux_dir/ltmain.sh" # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) case $xsi_shell in yes) cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac } # func_basename file func_basename () { func_basename_result="${1##*/}" } # func_dirname_and_basename file append nondir_replacement # perform func_basename and func_dirname in a single function # call: # dirname: Compute the dirname of FILE. If nonempty, # add APPEND to the result, otherwise set result # to NONDIR_REPLACEMENT. # value returned in "$func_dirname_result" # basename: Compute filename of FILE. # value retuned in "$func_basename_result" # Implementation must be kept synchronized with func_dirname # and func_basename. For efficiency, we do not delegate to # those functions but instead duplicate the functionality here. func_dirname_and_basename () { case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}" } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). func_stripname () { # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"} } # func_opt_split func_opt_split () { func_opt_split_opt=${1%%=*} func_opt_split_arg=${1#*=} } # func_lo2o object func_lo2o () { case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac } # func_xform libobj-or-source func_xform () { func_xform_result=${1%.*}.lo } # func_arith arithmetic-term... func_arith () { func_arith_result=$(( $* )) } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=${#1} } _LT_EOF ;; *) # Bourne compatible functions. cat << \_LT_EOF >> "$cfgfile" # func_dirname file append nondir_replacement # Compute the dirname of FILE. If nonempty, add APPEND to the result, # otherwise set result to NONDIR_REPLACEMENT. func_dirname () { # Extract subdirectory from the argument. func_dirname_result=`$ECHO "X${1}" | $Xsed -e "$dirname"` if test "X$func_dirname_result" = "X${1}"; then func_dirname_result="${3}" else func_dirname_result="$func_dirname_result${2}" fi } # func_basename file func_basename () { func_basename_result=`$ECHO "X${1}" | $Xsed -e "$basename"` } # func_stripname prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # func_strip_suffix prefix name func_stripname () { case ${2} in .*) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "X${3}" \ | $Xsed -e "s%^${1}%%" -e "s%${2}\$%%"`;; esac } # sed scripts: my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q' my_sed_long_arg='1s/^-[^=]*=//' # func_opt_split func_opt_split () { func_opt_split_opt=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_opt"` func_opt_split_arg=`$ECHO "X${1}" | $Xsed -e "$my_sed_long_arg"` } # func_lo2o object func_lo2o () { func_lo2o_result=`$ECHO "X${1}" | $Xsed -e "$lo2o"` } # func_xform libobj-or-source func_xform () { func_xform_result=`$ECHO "X${1}" | $Xsed -e 's/\.[^.]*$/.lo/'` } # func_arith arithmetic-term... func_arith () { func_arith_result=`expr "$@"` } # func_len string # STRING may not start with a hyphen. func_len () { func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len` } _LT_EOF esac case $lt_shell_append in yes) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1+=\$2" } _LT_EOF ;; *) cat << \_LT_EOF >> "$cfgfile" # func_append var value # Append VALUE to the end of shell variable VAR. func_append () { eval "$1=\$$1\$2" } _LT_EOF ;; esac sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: RC # The linker used to build libraries. LD=$lt_LD_RC # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_RC # A language specific compiler. CC=$lt_compiler_RC # Is the compiler the GNU compiler? with_gcc=$GCC_RC # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_RC # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_RC # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_RC # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_RC # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_RC # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_RC # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_RC # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_RC # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_RC # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_RC # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_RC # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_RC # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_RC archive_expsym_cmds=$lt_archive_expsym_cmds_RC # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_RC module_expsym_cmds=$lt_module_expsym_cmds_RC # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_RC # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_RC # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_RC # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_RC # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_RC # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_RC # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_RC # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_RC # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_RC # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_RC # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_RC # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_RC # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_RC # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path_RC # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_RC # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_RC # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_RC # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_RC # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_RC # Specify filename containing input files. file_list_spec=$lt_file_list_spec_RC # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_RC # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_RC # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_RC postdep_objects=$lt_postdep_objects_RC predeps=$lt_predeps_RC postdeps=$lt_postdeps_RC # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_RC # ### END LIBTOOL TAG CONFIG: RC _LT_EOF cat <<_LT_EOF >> "$ofile" # ### BEGIN LIBTOOL TAG CONFIG: CXX # The linker used to build libraries. LD=$lt_LD_CXX # Commands used to build an old-style archive. old_archive_cmds=$lt_old_archive_cmds_CXX # A language specific compiler. CC=$lt_compiler_CXX # Is the compiler the GNU compiler? with_gcc=$GCC_CXX # Compiler flag to turn off builtin functions. no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX # How to pass a linker flag through the compiler. wl=$lt_lt_prog_compiler_wl_CXX # Additional compiler flags for building library objects. pic_flag=$lt_lt_prog_compiler_pic_CXX # Compiler flag to prevent dynamic linking. link_static_flag=$lt_lt_prog_compiler_static_CXX # Does compiler simultaneously support -c and -o options? compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX # Whether or not to add -lc for building shared libraries. build_libtool_need_lc=$archive_cmds_need_lc_CXX # Whether or not to disallow shared libs when runtime libs are static. allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX # Compiler flag to allow reflexive dlopens. export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX # Compiler flag to generate shared objects directly from archives. whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX # Whether the compiler copes with passing no objects directly. compiler_needs_object=$lt_compiler_needs_object_CXX # Create an old-style archive from a shared archive. old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX # Create a temporary old-style archive to link instead of a shared archive. old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX # Commands used to build a shared archive. archive_cmds=$lt_archive_cmds_CXX archive_expsym_cmds=$lt_archive_expsym_cmds_CXX # Commands used to build a loadable module if different from building # a shared archive. module_cmds=$lt_module_cmds_CXX module_expsym_cmds=$lt_module_expsym_cmds_CXX # Whether we are building with GNU ld or not. with_gnu_ld=$lt_with_gnu_ld_CXX # Flag that allows shared libraries with undefined symbols to be built. allow_undefined_flag=$lt_allow_undefined_flag_CXX # Flag that enforces no undefined symbols. no_undefined_flag=$lt_no_undefined_flag_CXX # Flag to hardcode \$libdir into a binary during linking. # This must work even if \$libdir does not exist hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX # If ld is used when linking, flag to hardcode \$libdir into a binary # during linking. This must work even if \$libdir does not exist. hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX # Whether we need a single "-rpath" flag with a separated argument. hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary. hardcode_direct=$hardcode_direct_CXX # Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes # DIR into the resulting binary and the resulting library dependency is # "absolute",i.e impossible to change by setting \${shlibpath_var} if the # library is relocated. hardcode_direct_absolute=$hardcode_direct_absolute_CXX # Set to "yes" if using the -LDIR flag during linking hardcodes DIR # into the resulting binary. hardcode_minus_L=$hardcode_minus_L_CXX # Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR # into the resulting binary. hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX # Set to "yes" if building a shared library automatically hardcodes DIR # into the library and all subsequent libraries and executables linked # against it. hardcode_automatic=$hardcode_automatic_CXX # Set to yes if linker adds runtime paths of dependent libraries # to runtime path list. inherit_rpath=$inherit_rpath_CXX # Whether libtool must link a program against all its dependency libraries. link_all_deplibs=$link_all_deplibs_CXX # Fix the shell variable \$srcfile for the compiler. fix_srcfile_path=$lt_fix_srcfile_path_CXX # Set to "yes" if exported symbols are required. always_export_symbols=$always_export_symbols_CXX # The commands to list exported symbols. export_symbols_cmds=$lt_export_symbols_cmds_CXX # Symbols that should not be listed in the preloaded symbols. exclude_expsyms=$lt_exclude_expsyms_CXX # Symbols that must always be exported. include_expsyms=$lt_include_expsyms_CXX # Commands necessary for linking programs (against libraries) with templates. prelink_cmds=$lt_prelink_cmds_CXX # Specify filename containing input files. file_list_spec=$lt_file_list_spec_CXX # How to hardcode a shared library path into an executable. hardcode_action=$hardcode_action_CXX # The directories searched by this compiler when creating a shared library. compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX # Dependencies to place before and after the objects being linked to # create a shared library. predep_objects=$lt_predep_objects_CXX postdep_objects=$lt_postdep_objects_CXX predeps=$lt_predeps_CXX postdeps=$lt_postdeps_CXX # The library search path used internally by the compiler when linking # a shared library. compiler_lib_search_path=$lt_compiler_lib_search_path_CXX # ### END LIBTOOL TAG CONFIG: CXX _LT_EOF ;; "doc/version.xml":C) if test -f doc/version.xml && \ ! echo $VERSION | diff doc/version.xml - >/dev/null 2>&1 || \ ! echo $VERSION | diff $srcdir/doc/version.xml - >/dev/null 2>&1 ; then echo "writing new doc/version.xml" ; echo $VERSION > doc/version.xml fi ;; "doc/reldate.xml":C) if test -f doc/reldate.xml && \ ! echo $RELDATE | diff doc/reldate.xml - >/dev/null 2>&1 || \ ! echo $RELDATE | diff $srcdir/doc/reldate.xml - >/dev/null 2>&1 ; then echo "writing new doc/reldate.xml" ; echo $RELDATE > doc/reldate.xml fi ;; esac done # for ac_tag { (exit 0); exit 0; } _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 $as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi echo "" echo "please verify that the detected configuration matches your expectations:" echo "------------------------------------------------------------------------" echo "X --with-x=$have_x" echo "pthreads --enable-pthread=$enable_pthread" echo "v4l --enable-video=$enable_video" if test "x$enable_video" != "xyes"; then echo " => zbarcam video scanner will *NOT* be built" fi echo "jpeg --with-jpeg=$with_jpeg" if test "x$with_jpeg" != "xyes"; then echo " => JPEG image conversions will *NOT* be supported" fi echo "Magick++ --with-imagemagick=$with_imagemagick" if test "x$with_imagemagick" != "xyes"; then echo " => the zbarimg file scanner will *NOT* be built" fi echo "Python --with-python=$with_python" echo "GTK+ --with-gtk=$with_gtk" if test "x$with_gtk" != "xyes"; then echo " => the GTK+ widget will *NOT* be built" else if test "x$with_python" != "xyes"; then echo " => the PyGTK widget wrapper will *NOT* be built" fi fi echo "Qt4 --with-qt=$with_qt" if test "x$with_qt" != "xyes"; then echo " => the Qt4 widget will *NOT* be built" fi #echo "NPAPI Plugin --with-npapi=$with_npapi" #AS_IF([test "x$with_mozilla" != "xyes"], # [echo " => the Mozilla/Firefox/OpenOffice plugin will *NOT* be built"]) echo "" zbar-0.10/zbarimg/0000777000000000000000000000000011270371535011002 500000000000000zbar-0.10/zbarimg/zbarimg.rc0000644000000000000000000000162211270371414012674 00000000000000#include #include VS_VERSION_INFO VERSIONINFO FILEVERSION ZBAR_VERSION_MAJOR, ZBAR_VERSION_MINOR, 0, 0 PRODUCTVERSION ZBAR_VERSION_MAJOR, ZBAR_VERSION_MINOR, 0, 0 FILEOS VOS__WINDOWS32 FILETYPE VFT_APP { BLOCK "StringFileInfo" { BLOCK "040904E4" { VALUE "ProductName", "ZBar Bar Code Reader" VALUE "Company Name", "ZBar Bar Code Reader" VALUE "InternalName", "zbarimg" VALUE "OriginalFilename", "zbarimg.exe" VALUE "FileVersion", PACKAGE_VERSION VALUE "ProductVersion", PACKAGE_VERSION VALUE "FileDescription", "Scan bar codes from image files" VALUE "LegalCopyright", "Copyright 2007-2009 (c) Jeff Brown " } } BLOCK "VarFileInfo" { VALUE "Translation", 0x0409, 0x04e4 } } APP_ICON ICON "zbar.ico" zbar-0.10/zbarimg/zbarimg.c0000644000000000000000000003126011270371414012513 00000000000000/*------------------------------------------------------------------------ * Copyright 2007-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include #include #ifdef HAVE_UNISTD_H # include #endif #ifdef HAVE_SYS_TIMES_H # include #endif #ifdef _WIN32 # include # include #endif #include #include #include /* in 6.4.5.4 MagickGetImagePixels changed to MagickExportImagePixels. * (still not sure this check is quite right... * how does MagickGetAuthenticImagePixels fit in?) * ref http://bugs.gentoo.org/247292 */ #if MagickLibVersion < 0x645 # define MagickExportImagePixels MagickGetImagePixels #endif static const char *note_usage = "usage: zbarimg [options] ...\n" "\n" "scan and decode bar codes from one or more image files\n" "\n" "options:\n" " -h, --help display this help text\n" " --version display version information and exit\n" " -q, --quiet minimal output, only print decoded symbol data\n" " -v, --verbose increase debug output level\n" " --verbose=N set specific debug output level\n" " -d, --display enable display of following images to the screen\n" " -D, --nodisplay disable display of following images (default)\n" " --xml, --noxml enable/disable XML output format\n" " --raw output decoded symbol data without symbology prefix\n" " -S[=], --set [=]\n" " set decoder/scanner to (or 1)\n" // FIXME overlay level "\n" ; static const char *warning_not_found = "\n" "WARNING: barcode data was not detected in some image(s)\n" " things to check:\n" " - is the barcode type supported?" " currently supported symbologies are:\n" " EAN/UPC (EAN-13, EAN-8, UPC-A, UPC-E, ISBN-10, ISBN-13),\n" " Code 128, Code 39 and Interleaved 2 of 5\n" " - is the barcode large enough in the image?\n" " - is the barcode mostly in focus?\n" " - is there sufficient contrast/illumination?\n" "\n"; static const char *xml_head = "\n"; static const char *xml_foot = "\n"; static int notfound = 0, exit_code = 0; static int num_images = 0, num_symbols = 0; static int xmllvl = 0; char *xmlbuf = NULL; unsigned xmlbuflen = 0; static zbar_processor_t *processor = NULL; static inline int dump_error(MagickWand *wand) { char *desc; ExceptionType severity; desc = MagickGetException(wand, &severity); if(severity >= FatalErrorException) exit_code = 2; else if(severity >= ErrorException) exit_code = 1; else exit_code = 0; static const char *sevdesc[] = { "WARNING", "ERROR", "FATAL" }; fprintf(stderr, "%s: %s\n", sevdesc[exit_code], desc); MagickRelinquishMemory(desc); return(exit_code); } static int scan_image (const char *filename) { if(exit_code == 3) return(-1); int found = 0; MagickWand *images = NewMagickWand(); if(!MagickReadImage(images, filename) && dump_error(images)) return(-1); unsigned seq, n = MagickGetNumberImages(images); for(seq = 0; seq < n; seq++) { if(exit_code == 3) return(-1); if(!MagickSetIteratorIndex(images, seq) && dump_error(images)) return(-1); zbar_image_t *zimage = zbar_image_create(); assert(zimage); zbar_image_set_format(zimage, *(unsigned long*)"Y800"); int width = MagickGetImageWidth(images); int height = MagickGetImageHeight(images); zbar_image_set_size(zimage, width, height); // extract grayscale image pixels // FIXME color!! ...preserve most color w/422P // (but only if it's a color image) size_t bloblen = width * height; unsigned char *blob = malloc(bloblen); zbar_image_set_data(zimage, blob, bloblen, zbar_image_free_data); if(!MagickExportImagePixels(images, 0, 0, width, height, "I", CharPixel, blob)) return(-1); if(xmllvl == 1) { xmllvl++; printf("\n", filename); } zbar_process_image(processor, zimage); // output result data const zbar_symbol_t *sym = zbar_image_first_symbol(zimage); for(; sym; sym = zbar_symbol_next(sym)) { zbar_symbol_type_t typ = zbar_symbol_get_type(sym); if(typ == ZBAR_PARTIAL) continue; else if(!xmllvl) printf("%s%s:%s\n", zbar_get_symbol_name(typ), zbar_get_addon_name(typ), zbar_symbol_get_data(sym)); else if(xmllvl < 0) printf("%s\n", zbar_symbol_get_data(sym)); else { if(xmllvl < 3) { xmllvl++; printf("\n", seq); } zbar_symbol_xml(sym, &xmlbuf, &xmlbuflen); printf("%s\n", xmlbuf); } found++; num_symbols++; } if(xmllvl > 2) { xmllvl--; printf("\n"); } fflush(stdout); zbar_image_destroy(zimage); num_images++; if(zbar_processor_is_visible(processor)) { int rc = zbar_processor_user_wait(processor, -1); if(rc < 0 || rc == 'q' || rc == 'Q') exit_code = 3; } } if(xmllvl > 1) { xmllvl--; printf("\n"); } if(!found) notfound++; DestroyMagickWand(images); return(0); } int usage (int rc, const char *msg, const char *arg) { FILE *out = (rc) ? stderr : stdout; if(msg) { fprintf(out, "%s", msg); if(arg) fprintf(out, "%s", arg); fprintf(out, "\n\n"); } fprintf(out, "%s", note_usage); return(rc); } static inline int parse_config (const char *cfgstr, const char *arg) { if(!cfgstr || !cfgstr[0]) return(usage(1, "ERROR: need argument for option: ", arg)); if(zbar_processor_parse_config(processor, cfgstr)) return(usage(1, "ERROR: invalid configuration setting: ", cfgstr)); return(0); } int main (int argc, const char *argv[]) { // option pre-scan int quiet = 0; int display = 0; int i, j; for(i = 1; i < argc; i++) { const char *arg = argv[i]; if(arg[0] != '-') // first pass, skip images num_images++; else if(arg[1] != '-') for(j = 1; arg[j]; j++) { if(arg[j] == 'S') { if(!arg[++j] && ++i >= argc) /* FIXME parse check */ return(parse_config("", "-S")); break; } switch(arg[j]) { case 'h': return(usage(0, NULL, NULL)); case 'q': quiet = 1; break; case 'v': zbar_increase_verbosity(); break; case 'd': display = 1; break; case 'D': break; default: return(usage(1, "ERROR: unknown bundled option: -", arg + j)); } } else if(!strcmp(arg, "--help")) return(usage(0, NULL, NULL)); else if(!strcmp(arg, "--version")) { printf("%s\n", PACKAGE_VERSION); return(0); } else if(!strcmp(arg, "--quiet")) { quiet = 1; argv[i] = NULL; } else if(!strcmp(arg, "--verbose")) zbar_increase_verbosity(); else if(!strncmp(arg, "--verbose=", 10)) zbar_set_verbosity(strtol(argv[i] + 10, NULL, 0)); else if(!strcmp(arg, "--display")) display++; else if(!strcmp(arg, "--nodisplay") || !strcmp(arg, "--set") || !strcmp(arg, "--xml") || !strcmp(arg, "--noxml") || !strcmp(arg, "--raw") || !strncmp(arg, "--set=", 6)) continue; else if(!strcmp(arg, "--")) { num_images += argc - i - 1; break; } else return(usage(1, "ERROR: unknown option: ", arg)); } if(!num_images) return(usage(1, "ERROR: specify image file(s) to scan", NULL)); num_images = 0; MagickWandGenesis(); processor = zbar_processor_create(0); assert(processor); if(zbar_processor_init(processor, NULL, display)) { zbar_processor_error_spew(processor, 0); return(1); } for(i = 1; i < argc; i++) { const char *arg = argv[i]; if(!arg) continue; if(arg[0] != '-') { if(scan_image(arg)) return(exit_code); } else if(arg[1] != '-') for(j = 1; arg[j]; j++) { if(arg[j] == 'S') { if((arg[++j]) ? parse_config(arg + j, "-S") : parse_config(argv[++i], "-S")) return(1); break; } switch(arg[j]) { case 'd': zbar_processor_set_visible(processor, 1); break; case 'D': zbar_processor_set_visible(processor, 0); break; } } else if(!strcmp(arg, "--display")) zbar_processor_set_visible(processor, 1); else if(!strcmp(arg, "--nodisplay")) zbar_processor_set_visible(processor, 0); else if(!strcmp(arg, "--xml")) { if(xmllvl < 1) { xmllvl = 1; #ifdef _WIN32 fflush(stdout); _setmode(_fileno(stdout), _O_BINARY); #endif printf("%s", xml_head); } } else if(!strcmp(arg, "--noxml") || !strcmp(arg, "--raw")) { if(xmllvl > 0) { xmllvl = 0; printf("%s", xml_foot); fflush(stdout); #ifdef _WIN32 _setmode(_fileno(stdout), _O_TEXT); #endif } if(!strcmp(arg, "--raw")) { xmllvl = -1; #ifdef _WIN32 fflush(stdout); _setmode(_fileno(stdout), _O_BINARY); #endif } } else if(!strcmp(arg, "--set")) { if(parse_config(argv[++i], "--set")) return(1); } else if(!strncmp(arg, "--set=", 6)) { if(parse_config(arg + 6, "--set=")) return(1); } else if(!strcmp(arg, "--")) break; } for(i++; i < argc; i++) if(scan_image(argv[i])) return(exit_code); /* ignore quit during last image */ if(exit_code == 3) exit_code = 0; if(xmllvl > 0) { xmllvl = -1; printf("%s", xml_foot); fflush(stdout); } if(xmlbuf) free(xmlbuf); if(num_images && !quiet && xmllvl <= 0) { fprintf(stderr, "scanned %d barcode symbols from %d images", num_symbols, num_images); #ifdef HAVE_SYS_TIMES_H #ifdef HAVE_UNISTD_H long clk_tck = sysconf(_SC_CLK_TCK); struct tms tms; if(clk_tck > 0 && times(&tms) >= 0) { double secs = tms.tms_utime + tms.tms_stime; secs /= clk_tck; fprintf(stderr, " in %.2g seconds\n", secs); } #endif #endif fprintf(stderr, "\n"); if(notfound) fprintf(stderr, "%s", warning_not_found); } if(num_images && notfound && !exit_code) exit_code = 4; zbar_processor_destroy(processor); MagickWandTerminus(); return(exit_code); } zbar-0.10/zbarimg/Makefile.am.inc0000644000000000000000000000115211270371414013515 00000000000000bin_PROGRAMS += zbarimg/zbarimg zbarimg_zbarimg_SOURCES = zbarimg/zbarimg.c zbarimg_zbarimg_CPPFLAGS = $(MAGICK_CFLAGS) $(AM_CPPFLAGS) zbarimg_zbarimg_LDADD = $(MAGICK_LIBS) zbar/libzbar.la # automake bug in "monolithic mode"? CLEANFILES += zbarimg/.libs/zbarimg if WIN32 zbarimg_zbarimg_SOURCES += zbarimg/zbarimg.rc zbarimg_zbarimg_LDADD += zbarimg/zbarimg-rc.o endif EXTRA_DIST += test/barcodetest.py check-local: $(PYTHON) $(srcdir)/test/barcodetest.py regress: suite='$(ZBAR_TESTS)'; \ if test "x$$suite" = "x"; then suite='http://zbar.sf.net/test'; fi ; \ $(PYTHON) $(srcdir)/test/barcodetest.py $$suite zbar-0.10/perl/0000777000000000000000000000000011270371535010311 500000000000000zbar-0.10/perl/typemap0000644000000000000000000000324011270371414011622 00000000000000# objects Barcode::ZBar::Error T_PTROBJ Barcode::ZBar::Symbol T_PTROBJ Barcode::ZBar::Image T_PTROBJ Barcode::ZBar::Processor T_PTROBJ Barcode::ZBar::Video T_PTROBJ Barcode::ZBar::Window T_PTROBJ Barcode::ZBar::ImageScanner T_PTROBJ Barcode::ZBar::Decoder T_PTROBJ Barcode::ZBar::Scanner T_PTROBJ # enums zbar_color_t T_ENUM zbar_error_t T_ENUM zbar_symbol_type_t T_ENUM zbar_config_t T_ENUM # special scalars fourcc_t T_FOURCC timeout_t T_TIMEOUT # error handling config_error T_CONFIG_ERROR INPUT T_ENUM $var = ($type)SvIV($arg) T_FOURCC { if(SvPOK($arg)) { STRLEN len; char *str = SvPV($arg, len); if(len != 4) croak(\"invalid fourcc: \%s\", str); $var = ((unsigned long)str[0] | ((unsigned long)str[1] << 8) | ((unsigned long)str[2] << 16) | ((unsigned long)str[3] << 24)); } else $var = SvUV($arg); } T_TIMEOUT if(($var = ($type)(SvNV($arg) * 1000.)) < 0) $var = -1; T_PV $var = SvOK($arg) ? SvPV_nolen($arg) : NULL; OUTPUT T_ENUM $arg = SvREFCNT_inc(lookup_enum(LOOKUP_$ntype, (int)$var)); T_FOURCC { char str[4] = { $var & 0xff, ($var >> 8) & 0xff, ($var >> 16) & 0xff, ($var >> 24) & 0xff, }; sv_setuv($arg, $var); sv_setpvn($arg, str, 4); SvIOK_on($arg); } T_CONFIG_ERROR if($var) croak("invalid configuration setting: %s", config_string); zbar-0.10/perl/inc/0000777000000000000000000000000011270371535011062 500000000000000zbar-0.10/perl/inc/Devel/0000777000000000000000000000000011270371535012121 500000000000000zbar-0.10/perl/inc/Devel/CheckLib.pm0000644000000000000000000002455511270371414014046 00000000000000# $Id: CheckLib.pm,v 1.22 2008/03/12 19:52:50 drhyde Exp $ package Devel::CheckLib; use strict; use vars qw($VERSION @ISA @EXPORT); $VERSION = '0.5'; use Config; use File::Spec; use File::Temp; require Exporter; @ISA = qw(Exporter); @EXPORT = qw(assert_lib check_lib_or_exit); # localising prevents the warningness leaking out of this module local $^W = 1; # use warnings is a 5.6-ism _findcc(); # bomb out early if there's no compiler =head1 NAME Devel::CheckLib - check that a library is available =head1 DESCRIPTION Devel::CheckLib is a perl module that checks whether a particular C library and its headers are available. =head1 SYNOPSIS # in a Makefile.PL or Build.PL use lib qw(inc); use Devel::CheckLib; check_lib_or_exit( lib => 'jpeg', header => 'jpeglib.h' ); check_lib_or_exit( lib => [ 'iconv', 'jpeg' ] ); # or prompt for path to library and then do this: check_lib_or_exit( lib => 'jpeg', libpath => $additional_path ); =head1 HOW IT WORKS You pass named parameters to a function, describing to it how to build and link to the libraries. It works by trying to compile this: int main(void) { return 0; } and linking it to the specified libraries. If something pops out the end which looks executable, then we know that it worked. That tiny program is built once for each library that you specify, and (without linking) once for each header file. =head1 FUNCTIONS All of these take the same named parameters and are exported by default. To avoid exporting them, C. =head2 assert_lib This takes several named parameters, all of which are optional, and dies with an error message if any of the libraries listed can not be found. B: dying in a Makefile.PL or Build.PL may provoke a 'FAIL' report from CPAN Testers' automated smoke testers. Use C instead. The named parameters are: =over =item lib Must be either a string with the name of a single library or a reference to an array of strings of library names. Depending on the compiler found, library names will be fed to the compiler either as C<-l> arguments or as C<.lib> file names. (E.g. C<-ljpeg> or C) =item libpath a string or an array of strings representing additional paths to search for libraries. =item LIBS a C-style space-seperated list of libraries (each preceded by '-l') and directories (preceded by '-L'). =back And libraries are no use without header files, so ... =over =item header Must be either a string with the name of a single header file or a reference to an array of strings of header file names. =item incpath a string or an array of strings representing additional paths to search for headers. =item INC a C-style space-seperated list of incpaths, each preceded by '-I'. =back =head2 check_lib_or_exit This behaves exactly the same as C except that instead of dieing, it warns (with exactly the same error message) and exits. This is intended for use in Makefile.PL / Build.PL when you might want to prompt the user for various paths and things before checking that what they've told you is sane. If any library or header is missing, it exits with an exit value of 0 to avoid causing a CPAN Testers 'FAIL' report. CPAN Testers should ignore this result -- which is what you want if an external library dependency is not available. =cut sub check_lib_or_exit { eval 'assert_lib(@_)'; if($@) { warn $@; exit; } } sub assert_lib { my %args = @_; my (@libs, @libpaths, @headers, @incpaths); # FIXME: these four just SCREAM "refactor" at me @libs = (ref($args{lib}) ? @{$args{lib}} : $args{lib}) if $args{lib}; @libpaths = (ref($args{libpath}) ? @{$args{libpath}} : $args{libpath}) if $args{libpath}; @headers = (ref($args{header}) ? @{$args{header}} : $args{header}) if $args{header}; @incpaths = (ref($args{incpath}) ? @{$args{incpath}} : $args{incpath}) if $args{incpath}; # work-a-like for Makefile.PL's LIBS and INC arguments if(defined($args{LIBS})) { foreach my $arg (split(/\s+/, $args{LIBS})) { die("LIBS argument badly-formed: $arg\n") unless($arg =~ /^-l/i); push @{$arg =~ /^-l/ ? \@libs : \@libpaths}, substr($arg, 2); } } if(defined($args{INC})) { foreach my $arg (split(/\s+/, $args{INC})) { die("INC argument badly-formed: $arg\n") unless($arg =~ /^-I/); push @incpaths, substr($arg, 2); } } my @cc = _findcc(); my @missing; # first figure out which headers we can't find ... for my $header (@headers) { my($ch, $cfile) = File::Temp::tempfile( 'assertlibXXXXXXXX', SUFFIX => '.c' ); print $ch qq{#include <$header>\nint main(void) { return 0; }\n}; close($ch); my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe}; my @sys_cmd; # FIXME: re-factor - almost identical code later when linking if ( $Config{cc} eq 'cl' ) { # Microsoft compiler require Win32; @sys_cmd = (@cc, $cfile, "/Fe$exefile", (map { '/I'.Win32::GetShortPathName($_) } @incpaths)); } elsif($Config{cc} =~ /bcc32(\.exe)?/) { # Borland @sys_cmd = (@cc, (map { "-I$_" } @incpaths), "-o$exefile", $cfile); } else { # Unix-ish # gcc, Sun, AIX (gcc, cc) @sys_cmd = (@cc, $cfile, (map { "-I$_" } @incpaths), "-o", "$exefile"); } warn "# @sys_cmd\n" if $args{debug}; my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd); push @missing, $header if $rv != 0 || ! -x $exefile; _cleanup_exe($exefile); unlink $cfile; } # now do each library in turn with no headers my($ch, $cfile) = File::Temp::tempfile( 'assertlibXXXXXXXX', SUFFIX => '.c' ); print $ch "int main(void) { return 0; }\n"; close($ch); for my $lib ( @libs ) { my $exefile = File::Temp::mktemp( 'assertlibXXXXXXXX' ) . $Config{_exe}; my @sys_cmd; if ( $Config{cc} eq 'cl' ) { # Microsoft compiler require Win32; my @libpath = map { q{/libpath:} . Win32::GetShortPathName($_) } @libpaths; @sys_cmd = (@cc, $cfile, "${lib}.lib", "/Fe$exefile", "/link", @libpath ); } elsif($Config{cc} eq 'CC/DECC') { # VMS } elsif($Config{cc} =~ /bcc32(\.exe)?/) { # Borland my @libpath = map { "-L$_" } @libpaths; @sys_cmd = (@cc, "-o$exefile", "-l$lib", @libpath, $cfile); } else { # Unix-ish # gcc, Sun, AIX (gcc, cc) my @libpath = map { "-L$_" } @libpaths; @sys_cmd = (@cc, $cfile, "-o", "$exefile", "-l$lib", @libpath); } warn "# @sys_cmd\n" if $args{debug}; my $rv = $args{debug} ? system(@sys_cmd) : _quiet_system(@sys_cmd); push @missing, $lib if $rv != 0 || ! -x $exefile; _cleanup_exe($exefile); } unlink $cfile; my $miss_string = join( q{, }, map { qq{'$_'} } @missing ); die("Can't link/include $miss_string\n") if @missing; } sub _cleanup_exe { my ($exefile) = @_; my $ofile = $exefile; $ofile =~ s/$Config{_exe}$/$Config{_o}/; unlink $exefile if -f $exefile; unlink $ofile if -f $ofile; unlink "$exefile\.manifest" if -f "$exefile\.manifest"; return } sub _findcc { my @paths = split(/$Config{path_sep}/, $ENV{PATH}); my @cc = split(/\s+/, $Config{cc}); return @cc if -x $cc[0]; foreach my $path (@paths) { my $compiler = File::Spec->catfile($path, $cc[0]) . $Config{_exe}; return ($compiler, @cc[1 .. $#cc]) if -x $compiler; } die("Couldn't find your C compiler\n"); } # code substantially borrowed from IPC::Run3 sub _quiet_system { my (@cmd) = @_; # save handles local *STDOUT_SAVE; local *STDERR_SAVE; open STDOUT_SAVE, ">&STDOUT" or die "CheckLib: $! saving STDOUT"; open STDERR_SAVE, ">&STDERR" or die "CheckLib: $! saving STDERR"; # redirect to nowhere local *DEV_NULL; open DEV_NULL, ">" . File::Spec->devnull or die "CheckLib: $! opening handle to null device"; open STDOUT, ">&" . fileno DEV_NULL or die "CheckLib: $! redirecting STDOUT to null handle"; open STDERR, ">&" . fileno DEV_NULL or die "CheckLib: $! redirecting STDERR to null handle"; # run system command my $rv = system(@cmd); # restore handles open STDOUT, ">&" . fileno STDOUT_SAVE or die "CheckLib: $! restoring STDOUT handle"; open STDERR, ">&" . fileno STDERR_SAVE or die "CheckLib: $! restoring STDERR handle"; return $rv; } =head1 PLATFORMS SUPPORTED You must have a C compiler installed. We check for C<$Config{cc}>, both literally as it is in Config.pm and also in the $PATH. It has been tested with varying degrees on rigourousness on: =over =item gcc (on Linux, *BSD, Mac OS X, Solaris, Cygwin) =item Sun's compiler tools on Solaris =item IBM's tools on AIX =item Microsoft's tools on Windows =item MinGW on Windows (with Strawberry Perl) =item Borland's tools on Windows =back =head1 WARNINGS, BUGS and FEEDBACK This is a very early release intended primarily for feedback from people who have discussed it. The interface may change and it has not been adequately tested. Feedback is most welcome, including constructive criticism. Bug reports should be made using L or by email. When submitting a bug report, please include the output from running: perl -V perl -MDevel::CheckLib -e0 =head1 SEE ALSO L L =head1 AUTHORS David Cantrell Edavid@cantrell.org.ukE David Golden Edagolden@cpan.orgE Thanks to the cpan-testers-discuss mailing list for prompting us to write it in the first place; to Chris Williams for help with Borland support. =head1 COPYRIGHT and LICENCE Copyright 2007 David Cantrell. Portions copyright 2007 David Golden. This module is free-as-in-speech software, and may be used, distributed, and modified under the same conditions as perl itself. =head1 CONSPIRACY This module is also free-as-in-mason software. =cut 1; zbar-0.10/perl/t/0000777000000000000000000000000011270371535010554 500000000000000zbar-0.10/perl/t/Scanner.t0000755000000000000000000000103011270371414012237 00000000000000# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl Scanner.t' use warnings; use strict; use Test::More tests => 3; ######################### BEGIN { use_ok('Barcode::ZBar') } ######################### my $scanner = Barcode::ZBar::Scanner->new(); isa_ok($scanner, 'Barcode::ZBar::Scanner', 'scanner'); ######################### can_ok($scanner, qw(reset new_scan scan_y get_width get_color)); ######################### # FIXME more scanner tests zbar-0.10/perl/t/Decoder.t0000755000000000000000000000421511270371414012223 00000000000000# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl Decoder.t' use warnings; use strict; use Test::More tests => 13; ######################### BEGIN { use_ok('Barcode::ZBar') } ######################### my $decoder = Barcode::ZBar::Decoder->new(); isa_ok($decoder, 'Barcode::ZBar::Decoder', 'decoder'); $decoder->parse_config('enable'); ######################### can_ok($decoder, qw(set_config parse_config reset new_scan decode_width get_color get_data get_type set_handler)); ######################### my $sym = $decoder->decode_width(5); is($sym, Barcode::ZBar::Symbol::NONE, 'enum/enum compare'); ######################### ok($sym == 0, 'enum/numeric compare'); ######################### is($sym, 'None', 'enum/string compare'); ######################### my $handler_type = 0; my $explicit_closure = 0; $decoder->set_handler(sub { if(!$handler_type) { is($_[0], $decoder, 'handler decoder'); } my $type = $_[0]->get_type(); $handler_type = $type if(!$handler_type or $type > Barcode::ZBar::Symbol::PARTIAL); ${$_[1]} += 1 }, \$explicit_closure); ######################### $decoder->reset(); is($decoder->get_color(), Barcode::ZBar::SPACE, 'reset color'); ######################### $decoder->set_config(Barcode::ZBar::Symbol::QRCODE, Barcode::ZBar::Config::ENABLE, 0); my $encoded = '9 111 212241113121211311141132 11111 311213121312121332111132 111 9'; foreach my $width (split(/ */, $encoded)) { my $tmp = $decoder->decode_width($width); if($tmp > Barcode::ZBar::Symbol::PARTIAL) { $sym = ($sym == Barcode::ZBar::Symbol::NONE) ? $tmp : -1; } } is($sym, Barcode::ZBar::Symbol::EAN13, 'EAN-13 type'); ######################### is($decoder->get_data(), '6268964977804', 'EAN-13 data'); ######################### is($decoder->get_color(), Barcode::ZBar::BAR, 'post-scan color'); ######################### is($handler_type, Barcode::ZBar::Symbol::EAN13, 'handler type'); ######################### is($explicit_closure, 2, 'handler explicit closure'); ######################### zbar-0.10/perl/t/barcode.png0000644000000000000000000000223611270371414012574 00000000000000‰PNG  IHDRrPo°éËgAMA± üasRGB®Îé cHRMz&€„ú€èu0ê`:˜pœºQ<bKGDª#2 pHYs=ƒ=ƒ‡è vpAgrPéƒL—äIDATxÚí•!hcA†£N–ƒªÂAd¡âÅgj 5º#&q¥*DÄDÄ”¸ÀQê*Ž˜@D]*ª …ˆºˆx"®„º˜¹gg÷í¾¼^¡Ç'fBÞ¾·»3;ßÌìn‰ ä„6ò/ËÓ´¶Ÿ‚6?3s:'^?ûÊÛvó³6^qw,ìËû•ù–I©²B/ò/ÉÓ´¶Ÿ‚6?3s:¯Ÿ}åm»ùY¯¸;öåýÊ|SH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TÈÿ2ÑL~2ùËI!dòo3C&™|0“IróqÈ”–ø2Ï%÷§2žú™æmÅÿe4¶Ôë»/–”õRo9lãÝØJÆÂõÒÈŸßB¦4 kzÝ´òD}ñè=uñëá7Ãך†Ð[óœúÌØÒÛ¸âç–n¡=/ “{hÞ`ž“‘´kØŠu#3oûVÖ72ÁûôMÛäšèœZTõK…“0Ú¡SüÌB]†9¤1FËtA <Ö€j ïH‰´è+µi?ÀŒ³õ*5åûZô¶X£á­›@ï X Úú‚À˜@VàM‚ÕÞ…˜‘sÄewr& yüÄþŒ¸à¯\,M^ÔÉN8H“‹6¬C¶€Iø²ÖÛT½)s{ÌyCãH íy0áñ¢%?ælàß"ƒìÃ8E®„Ž,g³x'pÓ(Ÿ¯!˘¾*=æ`‹Å&ÁfŸ`4ËdRí9òfóå‰+ï“ÉÒ3lÖÜL†H‰±\C&k¨¼ß„½†ú›Z›O(™Ÿ¨ô”[|œØrMX÷5Á»‘o07a­9WÁ=9g×.Ù¹A8ªtUi„¸æ Ä'¡Ù¶u>Õü>$zD¥¬¸Šª˜Wõûx×ö£Rcdä¥3,8i뀑#ÉÆ™ÄíT Kqôgdô®•ÄM[ ûô–¤Öhç¸D™´AùíRæœ}æÍ°F[$K$Çìß•±™""ÖÌCÁÔS:Ãûr'u$$M ú.'c&íáTâ$\ÚkÅg1ƒŒ÷dùOÜ^ÛãÒ,¶>„å‘Ü%s¨”‘ÅÌÉJÃìÉš¤ÿPúWÐ2…Yæ…ªÈp3ç9g;|þU‚lçë¤Â!éåô¶°kN×Câ[È ¶G‹xXïX~y%»' Ú((4s“Ù=ð ý+a#]Iôƒ™—ž vwôÌ=9îɾž\ôä4ŸâmBïÉ/¥7«ˆ‚ì>IEND®B`‚zbar-0.10/perl/t/Processor.t0000755000000000000000000000537011270371414012640 00000000000000# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl Processor.t' use warnings; use strict; use Test::More tests => 20; ######################### BEGIN { use_ok('Barcode::ZBar') } Barcode::ZBar::set_verbosity(32); ######################### my $proc = Barcode::ZBar::Processor->new(); isa_ok($proc, 'Barcode::ZBar::Processor', 'processor'); ######################### can_ok($proc, qw(init set_config parse_config)); ######################### ok(!$proc->parse_config('enable'), 'configuration'); ######################### my $cnt = 0; my $explicit_closure = 0; $proc->set_data_handler(sub { ok(!$cnt, 'handler invocations'); $cnt += 1; ######################### is($_[0], $proc, 'handler processor'); ######################### my $image = $_[1]; isa_ok($image, 'Barcode::ZBar::Image', 'image'); ######################### my @symbols = $image->get_symbols(); is(scalar(@symbols), 1, 'result size'); ######################### my $sym = $symbols[0]; isa_ok($sym, 'Barcode::ZBar::Symbol', 'symbol'); ######################### is($sym->get_type(), Barcode::ZBar::Symbol::EAN13, 'result type'); ######################### is($sym->get_data(), '9876543210128', 'result data'); ######################### ok($sym->get_quality() > 0, 'quality'); ######################### my @loc = $sym->get_loc(); ok(scalar(@loc) >= 4, 'location size'); # structure checked by Image.t ${$_[2]} += 1 }, \$explicit_closure); ######################### $proc->init($ENV{VIDEO_DEVICE}); ok(!$proc->is_visible(), 'initial visibility'); ######################### $proc->set_visible(); ok($proc->is_visible(), 'enabled visiblity'); ######################### ok($proc->user_wait(1.1) >= 0, 'wait w/timeout'); ######################### SKIP: { # FIXME factor out image read utility eval { require Image::Magick }; skip "Image::Magick not installed", 11 if $@; my $im = Image::Magick->new(); my $err = $im->Read('t/barcode.png'); die($err) if($err); my $image = Barcode::ZBar::Image->new(); $image->set_format('422P'); $image->set_size($im->Get(qw(columns rows))); $image->set_data($im->ImageToBlob( magick => 'YUV', 'sampling-factor' => '4:2:2', interlace => 'Plane') ); my $rc = $proc->process_image($image); ok(!$rc, 'process result'); $proc->user_wait(.9); ######################### is($explicit_closure, 1, 'handler explicit closure'); } ######################### $proc->set_data_handler(); pass('unset handler'); ######################### # FIXME more processor tests $proc = undef; pass('cleanup'); ######################### zbar-0.10/perl/t/ZBar.t0000755000000000000000000000074411270371414011517 00000000000000# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl ZBar.t' use warnings; use strict; use Test::More tests => 3; ######################### BEGIN { use_ok('Barcode::ZBar') } ######################### like(Barcode::ZBar::version(), qr<\d.\d>, 'version'); ######################### Barcode::ZBar::set_verbosity(16); Barcode::ZBar::increase_verbosity(); pass('verbosity'); ######################### zbar-0.10/perl/t/pod.t0000644000000000000000000000045411270371414011436 00000000000000# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl pod.t' use warnings; use strict; use Test::More; eval "use Test::Pod 1.00"; plan skip_all => "Test::Pod 1.00 required for testing POD" if $@; all_pod_files_ok(); zbar-0.10/perl/t/Image.t0000755000000000000000000000706511270371414011706 00000000000000# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl Image.t' use warnings; use strict; use Test::More tests => 22; ######################### BEGIN { use_ok('Barcode::ZBar') } Barcode::ZBar::set_verbosity(16); ######################### my $image = Barcode::ZBar::Image->new(); isa_ok($image, 'Barcode::ZBar::Image', 'image'); ######################### my $scanner = Barcode::ZBar::ImageScanner->new(); isa_ok($scanner, 'Barcode::ZBar::ImageScanner', 'image scanner'); ######################### can_ok($image, qw(convert convert_resize get_format get_size get_data set_format set_size set_data)); ######################### can_ok($scanner, qw(set_config parse_config enable_cache scan_image)); ######################### $image->set_format('422P'); my $fmt = $image->get_format(); is($fmt, '422P', 'string format accessors'); ######################### ok($fmt == 0x50323234, 'numeric format accessors'); ######################### $image->set_size(114, 80); is_deeply([$image->get_size()], [114, 80], 'size accessors'); ######################### # FIXME avoid skipping these (eg embed image vs ImageMagick) SKIP: { eval { require Image::Magick }; skip "Image::Magick not installed", 13 if $@; my $im = Image::Magick->new(); my $err = $im->Read('t/barcode.png'); die($err) if($err); $image->set_size($im->Get(qw(columns rows))); { my $data = $im->ImageToBlob( magick => 'YUV', 'sampling-factor' => '4:2:2', interlace => 'Plane'); $image->set_data($data); } $image = $image->convert('Y800'); isa_ok($image, 'Barcode::ZBar::Image', 'image'); ######################### is($image->get_format(), 'Y800', 'converted image format'); ######################### is_deeply([$image->get_size()], [114, 80], 'converted image size'); ######################### is($scanner->scan_image($image), 1, 'scan result'); ######################### my @symbols = $image->get_symbols(); is(scalar(@symbols), 1, 'result size'); ######################### my $sym = $symbols[0]; isa_ok($sym, 'Barcode::ZBar::Symbol', 'symbol'); ######################### can_ok($sym, qw(get_type get_data get_quality get_count get_loc)); ######################### is($sym->get_type(), Barcode::ZBar::Symbol::EAN13, 'result type'); ######################### is($sym->get_data(), '9876543210128', 'result data'); ######################### ok($sym->get_quality() > 0, 'quality'); ######################### my @loc = $sym->get_loc(); ok(scalar(@loc) >= 4, 'location size'); ######################### my $failure = undef; foreach my $pt (@loc) { if(ref($pt) ne 'ARRAY') { $failure = ("location entry is wrong type:" . " expecting ARRAY ref, got " . ref($pt)); last; } if(scalar(@{$pt}) != 2) { $failure = ("location coordinate has too many entries:" . " expecting 2, got " . scalar(@{$pt})); last; } } ok(!defined($failure), 'location structure') or diag($failure); ######################### my @comps = $sym->get_components(); is(scalar(@comps), 0, 'components size'); ######################### } $scanner->recycle_image($image); my @symbols = $image->get_symbols(); is(scalar(@symbols), 0, 'recycled result size'); ######################### # FIXME more image tests zbar-0.10/perl/t/pod-coverage.t0000644000000000000000000000050211270371414013221 00000000000000# Before `make install' is performed this script should be runnable with # `make test'. After `make install' it should work as `perl pod.t' use warnings; use strict; use Test::More; eval "use Test::Pod::Coverage"; plan skip_all => "Test::Pod::Coverage required for testing pod coverage" if $@; all_pod_coverage_ok(); zbar-0.10/perl/ZBar.pm0000644000000000000000000000743011270371414011421 00000000000000#------------------------------------------------------------------------ # Copyright 2008-2009 (c) Jeff Brown # # This file is part of the ZBar Bar Code Reader. # # The ZBar Bar Code Reader is free software; you can redistribute it # and/or modify it under the terms of the GNU Lesser Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # The ZBar Bar Code Reader is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser Public License for more details. # # You should have received a copy of the GNU Lesser Public License # along with the ZBar Bar Code Reader; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA # # http://sourceforge.net/projects/zbar #------------------------------------------------------------------------ package Barcode::ZBar; use 5.006; use strict; use warnings; use Carp; require Exporter; our @ISA = qw(Exporter); our @EXPORT_OK = qw(SPACE BAR version increase_verbosity set_verbosity); our $VERSION = '0.04'; require XSLoader; XSLoader::load('Barcode::ZBar', $VERSION); package Barcode::ZBar::Error; use overload '""' => sub { return($_[0]->error_string()) }; 1; __END__ =head1 NAME Barcode::ZBar - Perl interface to the ZBar Barcode Reader =head1 SYNOPSIS setup: use Barcode::ZBar; my $reader = Barcode::ZBar::Processor->new(); $reader->init(); $reader->set_data_handler(\&my_handler); scan an image: my $image = Barcode::ZBar::Image->new(); $image->set_format('422P'); $image->set_size(114, 80); $image->set_data($raw_bits); $reader->process_image($image); scan from video: $reader->set_visible(); $reader->set_active(); $reader->user_wait(); collect results: my @symbols = $image->get_symbols(); foreach my $sym (@symbols) { print("decoded: " . $sym->get_type() . ":" . $sym->get_data()); } =head1 DESCRIPTION The ZBar Bar Code Reader is a library for scanning and decoding bar codes from various sources such as video streams, image files or raw intensity sensors. It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. These are the bindings for interacting directly with the library from Perl. =head1 REFERENCE =head2 Functions =over 4 =item version() Returns the version of the zbar library as "I.I". =item increase_verbosity() Increases global library debug by one level. =item set_verbosity(I) Sets global library debug to the indicated level. Higher numbers give more verbosity. =item parse_config(I) Parse a decoder configuration setting into a list containing the symbology constant, config constant, and value to set. See the documentation for C/C for available configuration options. =back =head2 Constants Width stream "color" constants: =over 4 =item SPACE Light area or space between bars. =item BAR Dark area or colored bar segment. =back =head1 SEE ALSO Barcode::ZBar::Processor, Barcode::ZBar::ImageScanner, Barcode::ZBar::Image, Barcode::ZBar::Symbol, Barcode::ZBar::Scanner, Barcode::ZBar::Decoder zbarimg(1), zbarcam(1) http://zbar.sf.net =head1 AUTHOR Jeff Brown, Espadix@users.sourceforge.netE =head1 COPYRIGHT AND LICENSE Copyright 2008-2009 (c) Jeff Brown Espadix@users.sourceforge.netE The ZBar Bar Code Reader is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. =cut zbar-0.10/perl/ZBar/0000777000000000000000000000000011270371535011147 500000000000000zbar-0.10/perl/ZBar/Symbol.pod0000644000000000000000000000673211270371414013040 00000000000000#------------------------------------------------------------------------ # Copyright 2008-2009 (c) Jeff Brown # # This file is part of the ZBar Bar Code Reader. # # The ZBar Bar Code Reader is free software; you can redistribute it # and/or modify it under the terms of the GNU Lesser Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # The ZBar Bar Code Reader is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser Public License for more details. # # You should have received a copy of the GNU Lesser Public License # along with the ZBar Bar Code Reader; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA # # http://sourceforge.net/projects/zbar #------------------------------------------------------------------------ =pod =head1 NAME Barcode::ZBar::Symbol - bar code scan result object =head1 SYNOPSIS my @symbols = $image->get_symbols(); foreach my $sym (@symbols) { print("decoded: " . $sym->get_type() . ":" . $sym->get_data(). "(" . $sym->get_count() . ")"); } =head1 DESCRIPTION Barcode::ZBar::Symbol objects are constant results returned for each bar code scanned from images or video. This object wraps the raw symbol data with additional information about the decode (symbology, confidence, location, etc) =head1 REFERENCE =head2 Methods =over 4 =item get_type() The type of bar code "symbology" from which the data was decoded. =item get_data() The decoded data string. Note that some symbologies can encode binary data. =item get_quality() Confidence metric. An unscaled integer value that indicates something (intentionally unspecified) about the reliability of this result relative to another. Larger values are better than smaller values, where "large" and "small" are application dependent. Expect this definition to become more specific as the metric is enhanced. =item get_count() Current cache count of the symbol. This integer value provides inter-scan reliability and redundancy information if enabled at the Barcode::ZBar::ImageScanner. =item get_components() Components of a composite result. This yields an array of physical component symbols that were combined to form a composite result. =over 2 =item * A negative value indicates that this result is still uncertain =item * A zero value indicates the first occurance of this result with high confidence =item * A positive value indicates a duplicate scan =back =back =head2 Constants Bar code type "symbology" constants: =over 4 =item NONE =item PARTIAL =item EAN13 =item EAN8 =item UPCA =item UPCE =item ISBN10 =item ISBN13 =item I25 =item CODE39 =item CODE128 =item QRCODE =item PDF417 =back =head1 SEE ALSO Barcode::ZBar, Barcode::ZBar::Image zbarimg(1), zbarcam(1) http://zbar.sf.net =head1 AUTHOR Jeff Brown, Espadix@users.sourceforge.netE =head1 COPYRIGHT AND LICENSE Copyright 2008-2009 (c) Jeff Brown Espadix@users.sourceforge.netE The ZBar Bar Code Reader is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. =cut zbar-0.10/perl/ZBar/Processor.pod0000644000000000000000000001016311270371414013543 00000000000000#------------------------------------------------------------------------ # Copyright 2008-2009 (c) Jeff Brown # # This file is part of the ZBar Bar Code Reader. # # The ZBar Bar Code Reader is free software; you can redistribute it # and/or modify it under the terms of the GNU Lesser Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # The ZBar Bar Code Reader is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser Public License for more details. # # You should have received a copy of the GNU Lesser Public License # along with the ZBar Bar Code Reader; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA # # http://sourceforge.net/projects/zbar #------------------------------------------------------------------------ =pod =head1 NAME Barcode::ZBar::Processor - self-contained bar code reader =head1 SYNOPSIS setup: use Barcode::ZBar; my $reader = Barcode::ZBar::Processor->new(); $reader->init("/dev/video1", 1); $reader->parse_config('code39.disable'); $reader->set_data_handler(\&my_handler); scan an image: $reader->process_image($image); scan from video: $reader->set_visible(); $reader->set_active(); $reader->user_wait(); =head1 DESCRIPTION A Barcode::ZBar::Processor may be used to quickly create stand-alone bar code scanning applications. It has interfaces to scan images or video and to optionally display a video/image preview to a window. This interface is not well suited for integration with an existing GUI, as the library manages the optional preview window and any user interaction. Use a Barcode::ZBar::ImageScanner or Investigate the avilable widget interfaces for GUI applications. =head1 REFERENCE =head2 Methods =over 4 =item new() Create a new bar code reader instance. =item init([I], [I]) Open a video input device and/or prepare to display output. =item set_data_handler([I], [I]) Setup a callback to process results whenever new results are available from the video stream or a static image. The specified callable will be invoked with the associated Barcode::ZBar::Processor object and I as arguments. Closure may be achieved either using standard Perl closure or by manually passing a scalar via I. =item is_visible() =item set_visible([I]) Test/set visibility of the output window. =item set_active([I]) Enable/disable video streaming and scanning for bar codes. =item get_results() Return a list of Barcode::ZBar::Symbol results from the last scanned image or video frame. =item user_wait([I]) Wait for the user to press a key/button or close the window. Bar codes will continue to be processed if video is active. =item process_one([I]) Enable video and scan until at least one barcode is found. Note that multiple results may still be returned. =item process_image([I]) Scan a Barcode::ZBar::Image for bar codes. =item parse_config(I) Apply a decoder configuration setting. See the documentation for C/C for available configuration options. =item request_size(I, I) Request a preferred size for the video image from the device. The request may be adjusted or completely ignored by the driver. Must be called before C =back =head1 SEE ALSO Barcode::ZBar, Barcode::ZBar::Image, Barcode::ZBar::ImageScanner zbarimg(1), zbarcam(1) http://zbar.sf.net =head1 AUTHOR Jeff Brown, Espadix@users.sourceforge.netE =head1 COPYRIGHT AND LICENSE Copyright 2008-2009 (c) Jeff Brown Espadix@users.sourceforge.netE The ZBar Bar Code Reader is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. =cut zbar-0.10/perl/ZBar/ImageScanner.pod0000644000000000000000000000532111270371414014120 00000000000000#------------------------------------------------------------------------ # Copyright 2008-2009 (c) Jeff Brown # # This file is part of the ZBar Bar Code Reader. # # The ZBar Bar Code Reader is free software; you can redistribute it # and/or modify it under the terms of the GNU Lesser Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # The ZBar Bar Code Reader is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser Public License for more details. # # You should have received a copy of the GNU Lesser Public License # along with the ZBar Bar Code Reader; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA # # http://sourceforge.net/projects/zbar #------------------------------------------------------------------------ =pod =head1 NAME Barcode::ZBar::ImageScanner - scan images for bar codes =head1 SYNOPSIS use Barcode::ZBar; my $scanner = Barcode::ZBar::ImageScanner->new(); $scanner->parse_config('i25.disable'); $scanner->scan_image($image); =head1 DESCRIPTION A Barcode::ZBar::ImageScanner is used to scan for bar codes in a Barcode::ZBar::Image. =head1 REFERENCE =head2 Methods =over 4 =item new() Create a new bar code image scanner instance. =item get_results() Return a list of Barcode::ZBar::Symbol results from the last scanned image. =item scan_image([I]) Scan a Barcode::ZBar::Image for bar codes. The image must be in the "Y800" format. If necessary, use C<< I<$image>->convert("Y800") >> to convert from other supported formats to Y800 before scanning. =item enable_cache([I]) Enable the inter-image result consistency cache. =item parse_config(I) Apply a decoder configuration setting. See the documentation for C/C for available configuration options. =item recycle_image([I]) Remove previously decoded results from a Barcode::ZBar::Image and recycle the associated memory. =back =head1 SEE ALSO Barcode::ZBar, Barcode::ZBar::Image, zbarimg(1), zbarcam(1) http://zbar.sf.net =head1 AUTHOR Jeff Brown, Espadix@users.sourceforge.netE =head1 COPYRIGHT AND LICENSE Copyright 2008-2009 (c) Jeff Brown Espadix@users.sourceforge.netE The ZBar Bar Code Reader is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. =cut zbar-0.10/perl/ZBar/Image.pod0000644000000000000000000000702011270371414012604 00000000000000#------------------------------------------------------------------------ # Copyright 2008-2009 (c) Jeff Brown # # This file is part of the ZBar Bar Code Reader. # # The ZBar Bar Code Reader is free software; you can redistribute it # and/or modify it under the terms of the GNU Lesser Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # The ZBar Bar Code Reader is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser Public License for more details. # # You should have received a copy of the GNU Lesser Public License # along with the ZBar Bar Code Reader; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA # # http://sourceforge.net/projects/zbar #------------------------------------------------------------------------ =pod =head1 NAME Barcode::ZBar::Image - image object to scan for bar codes =head1 SYNOPSIS use Barcode::ZBar; my $image = Barcode::ZBar::Image->new(); $image->set_format('422P'); $image->set_size(114, 80); $image->set_data($raw_bits); my @symbols = $image->get_symbols(); =head1 DESCRIPTION Barcode::ZBar::Image is used to pass images to the bar code scanner. It wraps raw image data with the meta-data required to interpret it (size, pixel format, etc) =head2 Image Formats Image data formats are represented by (relatively) standard "Four Character Codes" (fourcc), represented by four character strings in Perl. A list of supported formats is available on the project wiki. Examples: =over 2 =item * 'GREY' - single 8bpp intensity plane =item * 'BGR3' - 24bpp packed RGB component format =item * 'YUYV' - 12bpp packed luminance/chrominance (YCbCr) format =back =head1 REFERENCE =head2 Methods =over 4 =item new() Create a new Barcode::ZBar::Image object. The size, pixel format and data must be defined before the object may be used. =item get_format() =item set_format(I) Return/specify the fourcc code corresponding to the image pixel format. =item get_sequence() =item set_sequence(I) Return/specify the video frame or page number associated with the image. =item get_size() =item set_size(I, I) Return/specify the (I, I) image size tuple. =item get_data() =item set_data(I) Return/specify the raw image data as a binary string. =item get_symbols() Return a list of scanned Barcode::ZBar::Symbol results attached to this image. =item convert(I) Return a new Barcode::ZBar::Image object converted to the indicated fourcc format. Returns C if the conversion is not supported. Conversion complexity ranges from CPU intensive to trivial depending on the formats involved. Note that only a few conversions retain color information. =back =head1 SEE ALSO Barcode::ZBar, Barcode::ZBar::Image, Barcode::ZBar::Symbol zbarimg(1), zbarcam(1) http://zbar.sf.net =head1 AUTHOR Jeff Brown, Espadix@users.sourceforge.netE =head1 COPYRIGHT AND LICENSE Copyright 2008-2009 (c) Jeff Brown Espadix@users.sourceforge.netE The ZBar Bar Code Reader is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. =cut zbar-0.10/perl/COPYING.LIB0000644000000000000000000006350411270371414011671 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! zbar-0.10/perl/README0000644000000000000000000000156611270371414011111 00000000000000Barcode::ZBar Perl module ========================= The ZBar Bar Code Reader is a library for scanning and decoding bar codes from various sources such as video streams, image files or raw intensity sensors. It supports EAN, UPC, Code 128, Code 39 and Interleaved 2 of 5. These are the Perl bindings for the library. Check the ZBar project home page for the latest release, mailing lists, etc. http://zbar.sourceforge.net/ INSTALLATION To install this module type the following: perl Makefile.PL make make test make install DEPENDENCIES This module requires the ZBar Bar Code Reader, which may be obtained from: http://zbar.sourceforge.net/ COPYRIGHT AND LICENCE Licensed under the GNU Lesser General Public License, version 2.1. http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt Copyright 2008-2009 (c) Jeff Brown zbar-0.10/perl/Makefile.PL0000644000000000000000000000123611270371414012175 00000000000000use 5.006; use ExtUtils::MakeMaker; use lib qw(inc); use Devel::CheckLib; check_lib_or_exit( lib => 'zbar', header => 'zbar.h', LIBS => join(' ', map({ /^LIBS=(.*)/; $1 } grep(/^LIBS=/, @ARGV))), INC => join(' ', map({ /^INC=(.*)/; $1 } grep(/^INC=/, @ARGV))), ); WriteMakefile( NAME => 'Barcode::ZBar', VERSION_FROM => "ZBar.pm", ABSTRACT_FROM => "ZBar.pm", AUTHOR => 'Jeff Brown ', LICENSE => 'lgpl', LIBS => ['-lzbar'], META_MERGE => { build_requires => { 'Test::More' => 0, } }, ); zbar-0.10/perl/examples/0000777000000000000000000000000011270371535012127 500000000000000zbar-0.10/perl/examples/read_one.pl0000755000000000000000000000117411270371414014156 00000000000000#!/usr/bin/env perl use warnings; use strict; require Barcode::ZBar; # create a Processor my $proc = Barcode::ZBar::Processor->new(); # configure the Processor $proc->parse_config("enable"); # initialize the Processor $proc->init($ARGV[0] || '/dev/video0'); # enable the preview window $proc->set_visible(); # read at least one barcode (or until window closed) $proc->process_one(); # hide the preview window $proc->set_visible(0); # extract results foreach my $symbol ($proc->get_results()) { # do something useful with results print('decoded ' . $symbol->get_type() . ' symbol "' . $symbol->get_data() . "\"\n"); } zbar-0.10/perl/examples/processor.pl0000755000000000000000000000140411270371414014415 00000000000000#!/usr/bin/env perl use warnings; use strict; require Barcode::ZBar; # create a Processor my $proc = Barcode::ZBar::Processor->new(); # configure the Processor $proc->parse_config("enable"); # initialize the Processor $proc->init($ARGV[0] || '/dev/video0'); # setup a callback sub my_handler { my ($proc, $image, $closure) = @_; # extract results foreach my $symbol ($proc->get_results()) { # do something useful with results print('decoded ' . $symbol->get_type() . ' symbol "' . $symbol->get_data() . "\"\n"); } } $proc->set_data_handler(\&my_handler); # enable the preview window $proc->set_visible(); # initiate scanning $proc->set_active(); # keep scanning until user provides key/mouse input $proc->user_wait(); zbar-0.10/perl/examples/scan_image.pl0000755000000000000000000000151611270371414014470 00000000000000#!/usr/bin/perl use warnings; use strict; require Image::Magick; require Barcode::ZBar; $ARGV[0] || die; # create a reader my $scanner = Barcode::ZBar::ImageScanner->new(); # configure the reader $scanner->parse_config("enable"); # obtain image data my $magick = Image::Magick->new(); $magick->Read($ARGV[0]) && die; my $raw = $magick->ImageToBlob(magick => 'GRAY', depth => 8); # wrap image data my $image = Barcode::ZBar::Image->new(); $image->set_format('Y800'); $image->set_size($magick->Get(qw(columns rows))); $image->set_data($raw); # scan the image for barcodes my $n = $scanner->scan_image($image); # extract results foreach my $symbol ($image->get_symbols()) { # do something useful with results print('decoded ' . $symbol->get_type() . ' symbol "' . $symbol->get_data() . "\"\n"); } # clean up undef($image); zbar-0.10/perl/examples/paginate.pl0000755000000000000000000000456211270371414014176 00000000000000#!/usr/bin/perl #------------------------------------------------------------------------ # Copyright 2009 (c) Jeff Brown # # This file is part of the ZBar Bar Code Reader. # # The ZBar Bar Code Reader is free software; you can redistribute it # and/or modify it under the terms of the GNU Lesser Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # The ZBar Bar Code Reader is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser Public License for more details. # # You should have received a copy of the GNU Lesser Public License # along with the ZBar Bar Code Reader; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA # # http://sourceforge.net/projects/zbar #------------------------------------------------------------------------ use warnings; use strict; use Barcode::ZBar; use Image::Magick; warn("no input files specified?\n") if(!@ARGV); # running output document my $out = undef; # barcode scanner my $scanner = Barcode::ZBar::ImageScanner->new(); foreach my $file (@ARGV) { print "scanning from \"$file\"\n"; my $imseq = Image::Magick->new(); my $err = $imseq->Read($file); warn($err) if($err); foreach my $page (@$imseq) { # convert ImageMagick page to ZBar image my $zimg = Barcode::ZBar::Image->new(); $zimg->set_format('Y800'); $zimg->set_size($page->Get(qw(columns rows))); $zimg->set_data($page->Clone()->ImageToBlob(magick => 'GRAY', depth => 8)); # scan for barcodes if($scanner->scan_image($zimg)) { # write out previous document $out->write() if($out); # use first symbol found to name next image (FIXME sanitize) my $data = ($zimg->get_symbols())[0]->get_data(); my $idx = $page->Get('scene') + 1; print "splitting $data from page $idx\n"; # create new output document $out = Image::Magick->new(filename => $data); } # append this page to current output push(@$out, $page) if($out); } # write out final document $out->write() if($out); } zbar-0.10/perl/MANIFEST0000644000000000000000000000054611270371414011357 00000000000000MANIFEST README Changes COPYING.LIB Makefile.PL typemap ZBar.xs ppport.h ZBar.pm ZBar/Image.pod ZBar/ImageScanner.pod ZBar/Processor.pod ZBar/Symbol.pod t/barcode.png t/Decoder.t t/Image.t t/Processor.t t/Scanner.t t/ZBar.t t/pod.t t/pod-coverage.t inc/Devel/CheckLib.pm examples/paginate.pl examples/processor.pl examples/read_one.pl examples/scan_image.pl zbar-0.10/perl/ZBar.xs0000644000000000000000000005057611270371414011450 00000000000000//------------------------------------------------------------------------ // Copyright 2008-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include typedef zbar_symbol_t *Barcode__ZBar__Symbol; typedef zbar_image_t *Barcode__ZBar__Image; typedef zbar_processor_t *Barcode__ZBar__Processor; typedef zbar_video_t *Barcode__ZBar__Video; typedef zbar_window_t *Barcode__ZBar__Window; typedef zbar_image_scanner_t *Barcode__ZBar__ImageScanner; typedef zbar_decoder_t *Barcode__ZBar__Decoder; typedef zbar_scanner_t *Barcode__ZBar__Scanner; typedef void *Barcode__ZBar__Error; typedef unsigned long fourcc_t; typedef int timeout_t; typedef int config_error; typedef struct handler_wrapper_s { SV *instance; SV *handler; SV *closure; } handler_wrapper_t; static AV *LOOKUP_zbar_color_t = NULL; static AV *LOOKUP_zbar_symbol_type_t = NULL; static AV *LOOKUP_zbar_error_t = NULL; static AV *LOOKUP_zbar_config_t = NULL; #define CONSTANT(typ, prefix, sym, name) \ do { \ SV *c = newSViv(ZBAR_ ## prefix ## sym); \ sv_setpv(c, name); \ SvIOK_on(c); \ newCONSTSUB(stash, #sym, c); \ av_store(LOOKUP_zbar_ ## typ ## _t, \ ZBAR_ ## prefix ## sym, \ SvREFCNT_inc(c)); \ } while(0) #define LOOKUP_ENUM(typ, val) \ lookup_enum(LOOKUP_zbar_ ## typ ## _t, val) static inline SV *lookup_enum (AV *lookup, int val) { SV **tmp = av_fetch(lookup, val, 0); return((tmp) ? *tmp : sv_newmortal()); } static inline void check_error (int rc, void *obj) { if(rc < 0) { sv_setref_pv(get_sv("@", TRUE), "Barcode::ZBar::Error", obj); croak(NULL); } } #define PUSH_SYMS(x) \ do { \ const zbar_symbol_t *sym = (const zbar_symbol_t*)(x); \ for(; sym; sym = zbar_symbol_next(sym)) { \ zbar_symbol_t *s = (zbar_symbol_t*)sym; \ zbar_symbol_ref(s, 1); \ XPUSHs(sv_setref_pv(sv_newmortal(), "Barcode::ZBar::Symbol", \ (void*)sym)); \ } \ } while(0); static void image_cleanup_handler (zbar_image_t *image) { SV *data = zbar_image_get_userdata(image); if(!data) /* FIXME this is internal error */ return; /* release reference to cleanup data */ SvREFCNT_dec(data); } static inline int set_handler (handler_wrapper_t **wrapp, SV *instance, SV *handler, SV *closure) { handler_wrapper_t *wrap = *wrapp; if(!handler || !SvOK(handler)) { if(wrap) { if(wrap->instance) SvREFCNT_dec(wrap->instance); if(wrap->handler) SvREFCNT_dec(wrap->handler); if(wrap->closure) SvREFCNT_dec(wrap->closure); wrap->instance = wrap->handler = wrap->closure = NULL; } return(0); } if(!wrap) { Newxz(wrap, 1, handler_wrapper_t); wrap->instance = newSVsv(instance); wrap->closure = newSV(0); *wrapp = wrap; } if(wrap->handler) SvSetSV(wrap->handler, handler); else wrap->handler = newSVsv(handler); if(!closure || !SvOK(closure)) SvSetSV(wrap->closure, &PL_sv_undef); else SvSetSV(wrap->closure, closure); return(1); } static inline void activate_handler (handler_wrapper_t *wrap, SV *param) { dSP; if(!wrap) /* FIXME this is internal error */ return; ENTER; SAVETMPS; PUSHMARK(SP); EXTEND(SP, 2); PUSHs(sv_mortalcopy(wrap->instance)); if(param) PUSHs(param); PUSHs(sv_mortalcopy(wrap->closure)); PUTBACK; call_sv(wrap->handler, G_DISCARD); FREETMPS; LEAVE; } static void processor_handler (zbar_image_t *image, const void *userdata) { SV *img; zbar_image_ref(image, 1); img = sv_setref_pv(newSV(0), "Barcode::ZBar::Image", image); activate_handler((void*)userdata, img); SvREFCNT_dec(img); } static void decoder_handler (zbar_decoder_t *decoder) { activate_handler(zbar_decoder_get_userdata(decoder), NULL); } MODULE = Barcode::ZBar PACKAGE = Barcode::ZBar PREFIX = zbar_ PROTOTYPES: ENABLE BOOT: { HV *stash = gv_stashpv("Barcode::ZBar", TRUE); LOOKUP_zbar_color_t = newAV(); CONSTANT(color, , SPACE, "SPACE"); CONSTANT(color, , BAR, "BAR"); } SV * zbar_version() PREINIT: unsigned major; unsigned minor; CODE: zbar_version(&major, &minor); RETVAL = newSVpvf("%u.%u", major, minor); OUTPUT: RETVAL void zbar_increase_verbosity() void zbar_set_verbosity(verbosity) int verbosity SV * parse_config(config_string) const char * config_string PREINIT: zbar_symbol_type_t sym; zbar_config_t cfg; int val; PPCODE: if(zbar_parse_config(config_string, &sym, &cfg, &val)) croak("invalid configuration setting: %s", config_string); EXTEND(SP, 3); PUSHs(LOOKUP_ENUM(symbol_type, sym)); PUSHs(LOOKUP_ENUM(config, cfg)); mPUSHi(val); MODULE = Barcode::ZBar PACKAGE = Barcode::ZBar::Error PREFIX = zbar_ BOOT: { HV *stash = gv_stashpv("Barcode::ZBar::Error", TRUE); LOOKUP_zbar_error_t = newAV(); CONSTANT(error, ERR_, NOMEM, "out of memory"); CONSTANT(error, ERR_, INTERNAL, "internal library error"); CONSTANT(error, ERR_, UNSUPPORTED, "unsupported request"); CONSTANT(error, ERR_, INVALID, "invalid request"); CONSTANT(error, ERR_, SYSTEM, "system error"); CONSTANT(error, ERR_, LOCKING, "locking error"); CONSTANT(error, ERR_, BUSY, "all resources busy"); CONSTANT(error, ERR_, XDISPLAY, "X11 display error"); CONSTANT(error, ERR_, XPROTO, "X11 protocol error"); CONSTANT(error, ERR_, CLOSED, "output window is closed"); CONSTANT(error, ERR_, WINAPI, "windows system error"); } zbar_error_t get_error_code(err) Barcode::ZBar::Error err CODE: RETVAL = _zbar_get_error_code(err); OUTPUT: RETVAL const char * error_string(err) Barcode::ZBar::Error err CODE: RETVAL = _zbar_error_string(err, 1); OUTPUT: RETVAL MODULE = Barcode::ZBar PACKAGE = Barcode::ZBar::Config PREFIX = zbar_config_ BOOT: { HV *stash = gv_stashpv("Barcode::ZBar::Config", TRUE); LOOKUP_zbar_config_t = newAV(); CONSTANT(config, CFG_, ENABLE, "enable"); CONSTANT(config, CFG_, ADD_CHECK, "add-check"); CONSTANT(config, CFG_, EMIT_CHECK, "emit-check"); CONSTANT(config, CFG_, ASCII, "ascii"); CONSTANT(config, CFG_, MIN_LEN, "min-length"); CONSTANT(config, CFG_, MAX_LEN, "max-length"); CONSTANT(config, CFG_, POSITION, "position"); CONSTANT(config, CFG_, X_DENSITY, "x-density"); CONSTANT(config, CFG_, Y_DENSITY, "y-density"); } MODULE = Barcode::ZBar PACKAGE = Barcode::ZBar::Symbol PREFIX = zbar_symbol_ BOOT: { HV *stash = gv_stashpv("Barcode::ZBar::Symbol", TRUE); LOOKUP_zbar_symbol_type_t = newAV(); CONSTANT(symbol_type, , NONE, "None"); CONSTANT(symbol_type, , PARTIAL, "Partial"); CONSTANT(symbol_type, , EAN8, zbar_get_symbol_name(ZBAR_EAN8)); CONSTANT(symbol_type, , UPCE, zbar_get_symbol_name(ZBAR_UPCE)); CONSTANT(symbol_type, , ISBN10, zbar_get_symbol_name(ZBAR_ISBN10)); CONSTANT(symbol_type, , UPCA, zbar_get_symbol_name(ZBAR_UPCA)); CONSTANT(symbol_type, , EAN13, zbar_get_symbol_name(ZBAR_EAN13)); CONSTANT(symbol_type, , ISBN13, zbar_get_symbol_name(ZBAR_ISBN13)); CONSTANT(symbol_type, , I25, zbar_get_symbol_name(ZBAR_I25)); CONSTANT(symbol_type, , CODE39, zbar_get_symbol_name(ZBAR_CODE39)); CONSTANT(symbol_type, , PDF417, zbar_get_symbol_name(ZBAR_PDF417)); CONSTANT(symbol_type, , QRCODE, zbar_get_symbol_name(ZBAR_QRCODE)); CONSTANT(symbol_type, , CODE128, zbar_get_symbol_name(ZBAR_CODE128)); } void DESTROY(symbol) Barcode::ZBar::Symbol symbol CODE: zbar_symbol_ref(symbol, -1); zbar_symbol_type_t zbar_symbol_get_type(symbol) Barcode::ZBar::Symbol symbol SV * zbar_symbol_get_data(symbol) Barcode::ZBar::Symbol symbol CODE: RETVAL = newSVpvn(zbar_symbol_get_data(symbol), zbar_symbol_get_data_length(symbol)); OUTPUT: RETVAL int zbar_symbol_get_count(symbol) Barcode::ZBar::Symbol symbol int zbar_symbol_get_quality(symbol) Barcode::ZBar::Symbol symbol SV * zbar_symbol_get_loc(symbol) Barcode::ZBar::Symbol symbol PREINIT: unsigned i, size; PPCODE: size = zbar_symbol_get_loc_size(symbol); EXTEND(SP, size); for(i = 0; i < size; i++) { AV *pt = (AV*)sv_2mortal((SV*)newAV()); PUSHs(newRV((SV*)pt)); av_push(pt, newSVuv(zbar_symbol_get_loc_x(symbol, i))); av_push(pt, newSVuv(zbar_symbol_get_loc_y(symbol, i))); } SV * get_components(symbol) Barcode::ZBar::Symbol symbol PPCODE: PUSH_SYMS(zbar_symbol_first_component(symbol)); MODULE = Barcode::ZBar PACKAGE = Barcode::ZBar::Image PREFIX = zbar_image_ Barcode::ZBar::Image new(package) char * package CODE: RETVAL = zbar_image_create(); OUTPUT: RETVAL void DESTROY(image) Barcode::ZBar::Image image CODE: zbar_image_destroy(image); Barcode::ZBar::Image zbar_image_convert(image, format) Barcode::ZBar::Image image fourcc_t format Barcode::ZBar::Image zbar_image_convert_resize(image, format, width, height) Barcode::ZBar::Image image fourcc_t format unsigned width unsigned height fourcc_t zbar_image_get_format(image) Barcode::ZBar::Image image unsigned zbar_image_get_sequence(image) Barcode::ZBar::Image image void get_size(image) Barcode::ZBar::Image image PPCODE: EXTEND(SP, 2); mPUSHu(zbar_image_get_width(image)); mPUSHu(zbar_image_get_height(image)); SV * zbar_image_get_data(image) Barcode::ZBar::Image image CODE: RETVAL = newSVpvn(zbar_image_get_data(image), zbar_image_get_data_length(image)); OUTPUT: RETVAL SV * get_symbols(image) Barcode::ZBar::Image image PPCODE: PUSH_SYMS(zbar_image_first_symbol(image)); void zbar_image_set_format(image, format) Barcode::ZBar::Image image fourcc_t format void zbar_image_set_sequence(image, seq_num) Barcode::ZBar::Image image unsigned seq_num void zbar_image_set_size(image, width, height) Barcode::ZBar::Image image unsigned width unsigned height void zbar_image_set_data(image, data) Barcode::ZBar::Image image SV * data PREINIT: SV *old; CODE: if(!data || !SvOK(data)) { zbar_image_set_data(image, NULL, 0, NULL); zbar_image_set_userdata(image, NULL); } else if(SvPOK(data)) { /* FIXME is this copy of data or new ref to same data? * not sure this is correct: * need to retain a reference to image data, * but do not really want to copy it...maybe an RV? */ SV *copy = newSVsv(data); STRLEN len; void *raw = SvPV(copy, len); zbar_image_set_data(image, raw, len, image_cleanup_handler); zbar_image_set_userdata(image, copy); } else croak("image data must be binary string"); MODULE = Barcode::ZBar PACKAGE = Barcode::ZBar::Processor PREFIX = zbar_processor_ Barcode::ZBar::Processor new(package, threaded=0) char * package bool threaded CODE: RETVAL = zbar_processor_create(threaded); OUTPUT: RETVAL void DESTROY(processor) Barcode::ZBar::Processor processor CODE: zbar_processor_destroy(processor); void zbar_processor_init(processor, video_device="", enable_display=1) Barcode::ZBar::Processor processor const char * video_device bool enable_display CODE: check_error(zbar_processor_init(processor, video_device, enable_display), processor); void zbar_processor_request_size(processor, width, height) Barcode::ZBar::Processor processor unsigned width unsigned height CODE: check_error(zbar_processor_request_size(processor, width, height), processor); void zbar_processor_force_format(processor, input_format=0, output_format=0) Barcode::ZBar::Processor processor fourcc_t input_format fourcc_t output_format CODE: check_error(zbar_processor_force_format(processor, input_format, output_format), processor); void zbar_processor_set_config(processor, symbology, config, value=1) Barcode::ZBar::Processor processor zbar_symbol_type_t symbology zbar_config_t config int value config_error zbar_processor_parse_config(processor, config_string) Barcode::ZBar::Processor processor const char *config_string bool zbar_processor_is_visible(processor) Barcode::ZBar::Processor processor CODE: check_error((RETVAL = zbar_processor_is_visible(processor)), processor); OUTPUT: RETVAL void zbar_processor_set_visible(processor, visible=1) Barcode::ZBar::Processor processor bool visible CODE: check_error(zbar_processor_set_visible(processor, visible), processor); void zbar_processor_set_active(processor, active=1) Barcode::ZBar::Processor processor bool active CODE: check_error(zbar_processor_set_active(processor, active), processor); SV * get_results(processor) Barcode::ZBar::Processor processor PREINIT: const zbar_symbol_set_t *syms; PPCODE: syms = zbar_processor_get_results(processor); PUSH_SYMS(zbar_symbol_set_first_symbol(syms)); zbar_symbol_set_ref(syms, -1); int zbar_processor_user_wait(processor, timeout=-1) Barcode::ZBar::Processor processor timeout_t timeout CODE: check_error((RETVAL = zbar_processor_user_wait(processor, timeout)), processor); OUTPUT: RETVAL int process_one(processor, timeout=-1) Barcode::ZBar::Processor processor timeout_t timeout CODE: check_error((RETVAL = zbar_process_one(processor, timeout)), processor); OUTPUT: RETVAL int process_image(processor, image) Barcode::ZBar::Processor processor Barcode::ZBar::Image image CODE: check_error((RETVAL = zbar_process_image(processor, image)), processor); OUTPUT: RETVAL void zbar_processor_set_data_handler(processor, handler = 0, closure = 0) Barcode::ZBar::Processor processor SV * handler SV * closure PREINIT: handler_wrapper_t *wrap; zbar_image_data_handler_t *callback = NULL; CODE: wrap = zbar_processor_get_userdata(processor); if(set_handler(&wrap, ST(0), handler, closure)) callback = processor_handler; zbar_processor_set_data_handler(processor, callback, wrap); MODULE = Barcode::ZBar PACKAGE = Barcode::ZBar::ImageScanner PREFIX = zbar_image_scanner_ Barcode::ZBar::ImageScanner new(package) char * package CODE: RETVAL = zbar_image_scanner_create(); OUTPUT: RETVAL void DESTROY(scanner) Barcode::ZBar::ImageScanner scanner CODE: zbar_image_scanner_destroy(scanner); void zbar_image_scanner_set_config(scanner, symbology, config, value=1) Barcode::ZBar::ImageScanner scanner zbar_symbol_type_t symbology zbar_config_t config int value config_error zbar_image_scanner_parse_config(scanner, config_string) Barcode::ZBar::ImageScanner scanner const char *config_string void zbar_image_scanner_enable_cache(scanner, enable) Barcode::ZBar::ImageScanner scanner int enable void zbar_image_scanner_recycle_image(scanner, image) Barcode::ZBar::ImageScanner scanner Barcode::ZBar::Image image SV * get_results(scanner) Barcode::ZBar::ImageScanner scanner PREINIT: const zbar_symbol_set_t *syms; PPCODE: syms = zbar_image_scanner_get_results(scanner); PUSH_SYMS(zbar_symbol_set_first_symbol(syms)); int scan_image(scanner, image) Barcode::ZBar::ImageScanner scanner Barcode::ZBar::Image image CODE: RETVAL = zbar_scan_image(scanner, image); OUTPUT: RETVAL MODULE = Barcode::ZBar PACKAGE = Barcode::ZBar::Decoder PREFIX = zbar_decoder_ Barcode::ZBar::Decoder new(package) char * package CODE: RETVAL = zbar_decoder_create(); OUTPUT: RETVAL void DESTROY(decoder) Barcode::ZBar::Decoder decoder CODE: /* FIXME cleanup handler wrapper */ zbar_decoder_destroy(decoder); void zbar_decoder_set_config(decoder, symbology, config, value=1) Barcode::ZBar::Decoder decoder zbar_symbol_type_t symbology zbar_config_t config int value config_error zbar_decoder_parse_config(decoder, config_string) Barcode::ZBar::Decoder decoder const char *config_string void zbar_decoder_reset(decoder) Barcode::ZBar::Decoder decoder void zbar_decoder_new_scan(decoder) Barcode::ZBar::Decoder decoder zbar_symbol_type_t decode_width(decoder, width) Barcode::ZBar::Decoder decoder unsigned width CODE: RETVAL = zbar_decode_width(decoder, width); OUTPUT: RETVAL zbar_color_t zbar_decoder_get_color(decoder) Barcode::ZBar::Decoder decoder SV * zbar_decoder_get_data(decoder) Barcode::ZBar::Decoder decoder CODE: RETVAL = newSVpvn(zbar_decoder_get_data(decoder), zbar_decoder_get_data_length(decoder)); OUTPUT: RETVAL zbar_symbol_type_t zbar_decoder_get_type(decoder) Barcode::ZBar::Decoder decoder void zbar_decoder_set_handler(decoder, handler = 0, closure = 0) Barcode::ZBar::Decoder decoder SV * handler SV * closure PREINIT: handler_wrapper_t *wrap; CODE: wrap = zbar_decoder_get_userdata(decoder); zbar_decoder_set_handler(decoder, NULL); if(set_handler(&wrap, ST(0), handler, closure)) { zbar_decoder_set_userdata(decoder, wrap); zbar_decoder_set_handler(decoder, decoder_handler); } MODULE = Barcode::ZBar PACKAGE = Barcode::ZBar::Scanner PREFIX = zbar_scanner_ Barcode::ZBar::Scanner new(package, decoder = 0) char * package Barcode::ZBar::Decoder decoder CODE: RETVAL = zbar_scanner_create(decoder); OUTPUT: RETVAL void DESTROY(scanner) Barcode::ZBar::Scanner scanner CODE: zbar_scanner_destroy(scanner); zbar_symbol_type_t zbar_scanner_reset(scanner) Barcode::ZBar::Scanner scanner zbar_symbol_type_t zbar_scanner_new_scan(scanner) Barcode::ZBar::Scanner scanner zbar_color_t zbar_scanner_get_color(scanner) Barcode::ZBar::Scanner scanner unsigned zbar_scanner_get_width(scanner) Barcode::ZBar::Scanner scanner zbar_symbol_type_t scan_y(scanner, y) Barcode::ZBar::Scanner scanner int y CODE: RETVAL = zbar_scan_y(scanner, y); OUTPUT: RETVAL zbar-0.10/perl/ppport.h0000644000000000000000000034666011270371414011735 00000000000000#if 0 <<'SKIP'; #endif /* ---------------------------------------------------------------------- ppport.h -- Perl/Pollution/Portability Version 3.06_01 Automatically created by Devel::PPPort running under perl 5.008008 on Fri Nov 14 08:58:38 2008. Do NOT edit this file directly! -- Edit PPPort_pm.PL and the includes in parts/inc/ instead. Use 'perldoc ppport.h' to view the documentation below. ---------------------------------------------------------------------- SKIP =pod =head1 NAME ppport.h - Perl/Pollution/Portability version 3.06_01 =head1 SYNOPSIS perl ppport.h [options] [source files] Searches current directory for files if no [source files] are given --help show short help --patch=file write one patch file with changes --copy=suffix write changed copies with suffix --diff=program use diff program and options --compat-version=version provide compatibility with Perl version --cplusplus accept C++ comments --quiet don't output anything except fatal errors --nodiag don't show diagnostics --nohints don't show hints --nochanges don't suggest changes --nofilter don't filter input files --list-provided list provided API --list-unsupported list unsupported API --api-info=name show Perl API portability information =head1 COMPATIBILITY This version of F is designed to support operation with Perl installations back to 5.003, and has been tested up to 5.9.3. =head1 OPTIONS =head2 --help Display a brief usage summary. =head2 --patch=I If this option is given, a single patch file will be created if any changes are suggested. This requires a working diff program to be installed on your system. =head2 --copy=I If this option is given, a copy of each file will be saved with the given suffix that contains the suggested changes. This does not require any external programs. If neither C<--patch> or C<--copy> are given, the default is to simply print the diffs for each file. This requires either C or a C program to be installed. =head2 --diff=I Manually set the diff program and options to use. The default is to use C, when installed, and output unified context diffs. =head2 --compat-version=I Tell F to check for compatibility with the given Perl version. The default is to check for compatibility with Perl version 5.003. You can use this option to reduce the output of F if you intend to be backward compatible only up to a certain Perl version. =head2 --cplusplus Usually, F will detect C++ style comments and replace them with C style comments for portability reasons. Using this option instructs F to leave C++ comments untouched. =head2 --quiet Be quiet. Don't print anything except fatal errors. =head2 --nodiag Don't output any diagnostic messages. Only portability alerts will be printed. =head2 --nohints Don't output any hints. Hints often contain useful portability notes. =head2 --nochanges Don't suggest any changes. Only give diagnostic output and hints unless these are also deactivated. =head2 --nofilter Don't filter the list of input files. By default, files not looking like source code (i.e. not *.xs, *.c, *.cc, *.cpp or *.h) are skipped. =head2 --list-provided Lists the API elements for which compatibility is provided by F. Also lists if it must be explicitly requested, if it has dependencies, and if there are hints for it. =head2 --list-unsupported Lists the API elements that are known not to be supported by F and below which version of Perl they probably won't be available or work. =head2 --api-info=I Show portability information for API elements matching I. If I is surrounded by slashes, it is interpreted as a regular expression. =head1 DESCRIPTION In order for a Perl extension (XS) module to be as portable as possible across differing versions of Perl itself, certain steps need to be taken. =over 4 =item * Including this header is the first major one. This alone will give you access to a large part of the Perl API that hasn't been available in earlier Perl releases. Use perl ppport.h --list-provided to see which API elements are provided by ppport.h. =item * You should avoid using deprecated parts of the API. For example, using global Perl variables without the C prefix is deprecated. Also, some API functions used to have a C prefix. Using this form is also deprecated. You can safely use the supported API, as F will provide wrappers for older Perl versions. =item * If you use one of a few functions that were not present in earlier versions of Perl, and that can't be provided using a macro, you have to explicitly request support for these functions by adding one or more C<#define>s in your source code before the inclusion of F. These functions will be marked C in the list shown by C<--list-provided>. Depending on whether you module has a single or multiple files that use such functions, you want either C or global variants. For a C function, use: #define NEED_function For a global function, use: #define NEED_function_GLOBAL Note that you mustn't have more than one global request for one function in your project. Function Static Request Global Request ----------------------------------------------------------------------------------------- eval_pv() NEED_eval_pv NEED_eval_pv_GLOBAL grok_bin() NEED_grok_bin NEED_grok_bin_GLOBAL grok_hex() NEED_grok_hex NEED_grok_hex_GLOBAL grok_number() NEED_grok_number NEED_grok_number_GLOBAL grok_numeric_radix() NEED_grok_numeric_radix NEED_grok_numeric_radix_GLOBAL grok_oct() NEED_grok_oct NEED_grok_oct_GLOBAL newCONSTSUB() NEED_newCONSTSUB NEED_newCONSTSUB_GLOBAL newRV_noinc() NEED_newRV_noinc NEED_newRV_noinc_GLOBAL sv_2pv_nolen() NEED_sv_2pv_nolen NEED_sv_2pv_nolen_GLOBAL sv_2pvbyte() NEED_sv_2pvbyte NEED_sv_2pvbyte_GLOBAL sv_catpvf_mg() NEED_sv_catpvf_mg NEED_sv_catpvf_mg_GLOBAL sv_catpvf_mg_nocontext() NEED_sv_catpvf_mg_nocontext NEED_sv_catpvf_mg_nocontext_GLOBAL sv_setpvf_mg() NEED_sv_setpvf_mg NEED_sv_setpvf_mg_GLOBAL sv_setpvf_mg_nocontext() NEED_sv_setpvf_mg_nocontext NEED_sv_setpvf_mg_nocontext_GLOBAL vnewSVpvf() NEED_vnewSVpvf NEED_vnewSVpvf_GLOBAL To avoid namespace conflicts, you can change the namespace of the explicitly exported functions using the C macro. Just C<#define> the macro before including C: #define DPPP_NAMESPACE MyOwnNamespace_ #include "ppport.h" The default namespace is C. =back The good thing is that most of the above can be checked by running F on your source code. See the next section for details. =head1 EXAMPLES To verify whether F is needed for your module, whether you should make any changes to your code, and whether any special defines should be used, F can be run as a Perl script to check your source code. Simply say: perl ppport.h The result will usually be a list of patches suggesting changes that should at least be acceptable, if not necessarily the most efficient solution, or a fix for all possible problems. If you know that your XS module uses features only available in newer Perl releases, if you're aware that it uses C++ comments, and if you want all suggestions as a single patch file, you could use something like this: perl ppport.h --compat-version=5.6.0 --cplusplus --patch=test.diff If you only want your code to be scanned without any suggestions for changes, use: perl ppport.h --nochanges You can specify a different C program or options, using the C<--diff> option: perl ppport.h --diff='diff -C 10' This would output context diffs with 10 lines of context. To display portability information for the C function, use: perl ppport.h --api-info=newSVpvn Since the argument to C<--api-info> can be a regular expression, you can use perl ppport.h --api-info=/_nomg$/ to display portability information for all C<_nomg> functions or perl ppport.h --api-info=/./ to display information for all known API elements. =head1 BUGS If this version of F is causing failure during the compilation of this module, please check if newer versions of either this module or C are available on CPAN before sending a bug report. If F was generated using the latest version of C and is causing failure of this module, please file a bug report using the CPAN Request Tracker at L. Please include the following information: =over 4 =item 1. The complete output from running "perl -V" =item 2. This file. =item 3. The name and version of the module you were trying to build. =item 4. A full log of the build that failed. =item 5. Any other information that you think could be relevant. =back For the latest version of this code, please get the C module from CPAN. =head1 COPYRIGHT Version 3.x, Copyright (c) 2004-2005, Marcus Holland-Moritz. Version 2.x, Copyright (C) 2001, Paul Marquess. Version 1.x, Copyright (C) 1999, Kenneth Albanowski. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. =head1 SEE ALSO See L. =cut use strict; my %opt = ( quiet => 0, diag => 1, hints => 1, changes => 1, cplusplus => 0, filter => 1, ); my($ppport) = $0 =~ /([\w.]+)$/; my $LF = '(?:\r\n|[\r\n])'; # line feed my $HS = "[ \t]"; # horizontal whitespace eval { require Getopt::Long; Getopt::Long::GetOptions(\%opt, qw( help quiet diag! filter! hints! changes! cplusplus patch=s copy=s diff=s compat-version=s list-provided list-unsupported api-info=s )) or usage(); }; if ($@ and grep /^-/, @ARGV) { usage() if "@ARGV" =~ /^--?h(?:elp)?$/; die "Getopt::Long not found. Please don't use any options.\n"; } usage() if $opt{help}; if (exists $opt{'compat-version'}) { my($r,$v,$s) = eval { parse_version($opt{'compat-version'}) }; if ($@) { die "Invalid version number format: '$opt{'compat-version'}'\n"; } die "Only Perl 5 is supported\n" if $r != 5; die "Invalid version number: $opt{'compat-version'}\n" if $v >= 1000 || $s >= 1000; $opt{'compat-version'} = sprintf "%d.%03d%03d", $r, $v, $s; } else { $opt{'compat-version'} = 5; } # Never use C comments in this file!!!!! my $ccs = '/'.'*'; my $cce = '*'.'/'; my $rccs = quotemeta $ccs; my $rcce = quotemeta $cce; my %API = map { /^(\w+)\|([^|]*)\|([^|]*)\|(\w*)$/ ? ( $1 => { ($2 ? ( base => $2 ) : ()), ($3 ? ( todo => $3 ) : ()), (index($4, 'v') >= 0 ? ( varargs => 1 ) : ()), (index($4, 'p') >= 0 ? ( provided => 1 ) : ()), (index($4, 'n') >= 0 ? ( nothxarg => 1 ) : ()), } ) : die "invalid spec: $_" } qw( AvFILLp|5.004050||p AvFILL||| CLASS|||n CX_CURPAD_SAVE||| CX_CURPAD_SV||| CopFILEAV|5.006000||p CopFILEGV_set|5.006000||p CopFILEGV|5.006000||p CopFILESV|5.006000||p CopFILE_set|5.006000||p CopFILE|5.006000||p CopSTASHPV_set|5.006000||p CopSTASHPV|5.006000||p CopSTASH_eq|5.006000||p CopSTASH_set|5.006000||p CopSTASH|5.006000||p CopyD|5.009002||p Copy||| CvPADLIST||| CvSTASH||| CvWEAKOUTSIDE||| DEFSV|5.004050||p END_EXTERN_C|5.005000||p ENTER||| ERRSV|5.004050||p EXTEND||| EXTERN_C|5.005000||p FREETMPS||| GIMME_V||5.004000|n GIMME|||n GROK_NUMERIC_RADIX|5.007002||p G_ARRAY||| G_DISCARD||| G_EVAL||| G_NOARGS||| G_SCALAR||| G_VOID||5.004000| GetVars||| GvSV||| Gv_AMupdate||| HEf_SVKEY||5.004000| HeHASH||5.004000| HeKEY||5.004000| HeKLEN||5.004000| HePV||5.004000| HeSVKEY_force||5.004000| HeSVKEY_set||5.004000| HeSVKEY||5.004000| HeVAL||5.004000| HvNAME||| INT2PTR|5.006000||p IN_LOCALE_COMPILETIME|5.007002||p IN_LOCALE_RUNTIME|5.007002||p IN_LOCALE|5.007002||p IN_PERL_COMPILETIME|5.008001||p IS_NUMBER_GREATER_THAN_UV_MAX|5.007002||p IS_NUMBER_INFINITY|5.007002||p IS_NUMBER_IN_UV|5.007002||p IS_NUMBER_NAN|5.007003||p IS_NUMBER_NEG|5.007002||p IS_NUMBER_NOT_INT|5.007002||p IVSIZE|5.006000||p IVTYPE|5.006000||p IVdf|5.006000||p LEAVE||| LVRET||| MARK||| MY_CXT_CLONE|5.009002||p MY_CXT_INIT|5.007003||p MY_CXT|5.007003||p MoveD|5.009002||p Move||| NEWSV||| NOOP|5.005000||p NUM2PTR|5.006000||p NVTYPE|5.006000||p NVef|5.006001||p NVff|5.006001||p NVgf|5.006001||p Newc||| Newz||| New||| Nullav||| Nullch||| Nullcv||| Nullhv||| Nullsv||| ORIGMARK||| PAD_BASE_SV||| PAD_CLONE_VARS||| PAD_COMPNAME_FLAGS||| PAD_COMPNAME_GEN_set||| PAD_COMPNAME_GEN||| PAD_COMPNAME_OURSTASH||| PAD_COMPNAME_PV||| PAD_COMPNAME_TYPE||| PAD_RESTORE_LOCAL||| PAD_SAVE_LOCAL||| PAD_SAVE_SETNULLPAD||| PAD_SETSV||| PAD_SET_CUR_NOSAVE||| PAD_SET_CUR||| PAD_SVl||| PAD_SV||| PERL_BCDVERSION|5.009003||p PERL_GCC_BRACE_GROUPS_FORBIDDEN|5.008001||p PERL_INT_MAX|5.004000||p PERL_INT_MIN|5.004000||p PERL_LONG_MAX|5.004000||p PERL_LONG_MIN|5.004000||p PERL_MAGIC_arylen|5.007002||p PERL_MAGIC_backref|5.007002||p PERL_MAGIC_bm|5.007002||p PERL_MAGIC_collxfrm|5.007002||p PERL_MAGIC_dbfile|5.007002||p PERL_MAGIC_dbline|5.007002||p PERL_MAGIC_defelem|5.007002||p PERL_MAGIC_envelem|5.007002||p PERL_MAGIC_env|5.007002||p PERL_MAGIC_ext|5.007002||p PERL_MAGIC_fm|5.007002||p PERL_MAGIC_glob|5.007002||p PERL_MAGIC_isaelem|5.007002||p PERL_MAGIC_isa|5.007002||p PERL_MAGIC_mutex|5.007002||p PERL_MAGIC_nkeys|5.007002||p PERL_MAGIC_overload_elem|5.007002||p PERL_MAGIC_overload_table|5.007002||p PERL_MAGIC_overload|5.007002||p PERL_MAGIC_pos|5.007002||p PERL_MAGIC_qr|5.007002||p PERL_MAGIC_regdata|5.007002||p PERL_MAGIC_regdatum|5.007002||p PERL_MAGIC_regex_global|5.007002||p PERL_MAGIC_shared_scalar|5.007003||p PERL_MAGIC_shared|5.007003||p PERL_MAGIC_sigelem|5.007002||p PERL_MAGIC_sig|5.007002||p PERL_MAGIC_substr|5.007002||p PERL_MAGIC_sv|5.007002||p PERL_MAGIC_taint|5.007002||p PERL_MAGIC_tiedelem|5.007002||p PERL_MAGIC_tiedscalar|5.007002||p PERL_MAGIC_tied|5.007002||p PERL_MAGIC_utf8|5.008001||p PERL_MAGIC_uvar_elem|5.007003||p PERL_MAGIC_uvar|5.007002||p PERL_MAGIC_vec|5.007002||p PERL_MAGIC_vstring|5.008001||p PERL_QUAD_MAX|5.004000||p PERL_QUAD_MIN|5.004000||p PERL_REVISION|5.006000||p PERL_SCAN_ALLOW_UNDERSCORES|5.007003||p PERL_SCAN_DISALLOW_PREFIX|5.007003||p PERL_SCAN_GREATER_THAN_UV_MAX|5.007003||p PERL_SCAN_SILENT_ILLDIGIT|5.008001||p PERL_SHORT_MAX|5.004000||p PERL_SHORT_MIN|5.004000||p PERL_SUBVERSION|5.006000||p PERL_UCHAR_MAX|5.004000||p PERL_UCHAR_MIN|5.004000||p PERL_UINT_MAX|5.004000||p PERL_UINT_MIN|5.004000||p PERL_ULONG_MAX|5.004000||p PERL_ULONG_MIN|5.004000||p PERL_UNUSED_DECL|5.007002||p PERL_UQUAD_MAX|5.004000||p PERL_UQUAD_MIN|5.004000||p PERL_USHORT_MAX|5.004000||p PERL_USHORT_MIN|5.004000||p PERL_VERSION|5.006000||p PL_DBsingle|||pn PL_DBsub|||pn PL_DBtrace|||n PL_Sv|5.005000||p PL_compiling|5.004050||p PL_copline|5.005000||p PL_curcop|5.004050||p PL_curstash|5.004050||p PL_debstash|5.004050||p PL_defgv|5.004050||p PL_diehook|5.004050||p PL_dirty|5.004050||p PL_dowarn|||pn PL_errgv|5.004050||p PL_hexdigit|5.005000||p PL_hints|5.005000||p PL_last_in_gv|||n PL_modglobal||5.005000|n PL_na|5.004050||pn PL_no_modify|5.006000||p PL_ofs_sv|||n PL_perl_destruct_level|5.004050||p PL_perldb|5.004050||p PL_ppaddr|5.006000||p PL_rsfp_filters|5.004050||p PL_rsfp|5.004050||p PL_rs|||n PL_stack_base|5.004050||p PL_stack_sp|5.004050||p PL_stdingv|5.004050||p PL_sv_arenaroot|5.004050||p PL_sv_no|5.004050||pn PL_sv_undef|5.004050||pn PL_sv_yes|5.004050||pn PL_tainted|5.004050||p PL_tainting|5.004050||p POPi|||n POPl|||n POPn|||n POPpbytex||5.007001|n POPpx||5.005030|n POPp|||n POPs|||n PTR2IV|5.006000||p PTR2NV|5.006000||p PTR2UV|5.006000||p PTR2ul|5.007001||p PTRV|5.006000||p PUSHMARK||| PUSHi||| PUSHmortal|5.009002||p PUSHn||| PUSHp||| PUSHs||| PUSHu|5.004000||p PUTBACK||| PerlIO_clearerr||5.007003| PerlIO_close||5.007003| PerlIO_eof||5.007003| PerlIO_error||5.007003| PerlIO_fileno||5.007003| PerlIO_fill||5.007003| PerlIO_flush||5.007003| PerlIO_get_base||5.007003| PerlIO_get_bufsiz||5.007003| PerlIO_get_cnt||5.007003| PerlIO_get_ptr||5.007003| PerlIO_read||5.007003| PerlIO_seek||5.007003| PerlIO_set_cnt||5.007003| PerlIO_set_ptrcnt||5.007003| PerlIO_setlinebuf||5.007003| PerlIO_stderr||5.007003| PerlIO_stdin||5.007003| PerlIO_stdout||5.007003| PerlIO_tell||5.007003| PerlIO_unread||5.007003| PerlIO_write||5.007003| Poison|5.008000||p RETVAL|||n Renewc||| Renew||| SAVECLEARSV||| SAVECOMPPAD||| SAVEPADSV||| SAVETMPS||| SAVE_DEFSV|5.004050||p SPAGAIN||| SP||| START_EXTERN_C|5.005000||p START_MY_CXT|5.007003||p STMT_END|||p STMT_START|||p ST||| SVt_IV||| SVt_NV||| SVt_PVAV||| SVt_PVCV||| SVt_PVHV||| SVt_PVMG||| SVt_PV||| Safefree||| Slab_Alloc||| Slab_Free||| StructCopy||| SvCUR_set||| SvCUR||| SvEND||| SvGETMAGIC|5.004050||p SvGROW||| SvIOK_UV||5.006000| SvIOK_notUV||5.006000| SvIOK_off||| SvIOK_only_UV||5.006000| SvIOK_only||| SvIOK_on||| SvIOKp||| SvIOK||| SvIVX||| SvIV_nomg|5.009001||p SvIV_set||| SvIVx||| SvIV||| SvIsCOW_shared_hash||5.008003| SvIsCOW||5.008003| SvLEN_set||| SvLEN||| SvLOCK||5.007003| SvMAGIC_set||5.009003| SvNIOK_off||| SvNIOKp||| SvNIOK||| SvNOK_off||| SvNOK_only||| SvNOK_on||| SvNOKp||| SvNOK||| SvNVX||| SvNV_set||| SvNVx||| SvNV||| SvOK||| SvOOK||| SvPOK_off||| SvPOK_only_UTF8||5.006000| SvPOK_only||| SvPOK_on||| SvPOKp||| SvPOK||| SvPVX||| SvPV_force_nomg|5.007002||p SvPV_force||| SvPV_nolen|5.006000||p SvPV_nomg|5.007002||p SvPV_set||| SvPVbyte_force||5.009002| SvPVbyte_nolen||5.006000| SvPVbytex_force||5.006000| SvPVbytex||5.006000| SvPVbyte|5.006000||p SvPVutf8_force||5.006000| SvPVutf8_nolen||5.006000| SvPVutf8x_force||5.006000| SvPVutf8x||5.006000| SvPVutf8||5.006000| SvPVx||| SvPV||| SvREFCNT_dec||| SvREFCNT_inc||| SvREFCNT||| SvROK_off||| SvROK_on||| SvROK||| SvRV_set||5.009003| SvRV||| SvSETMAGIC||| SvSHARE||5.007003| SvSTASH_set||5.009003| SvSTASH||| SvSetMagicSV_nosteal||5.004000| SvSetMagicSV||5.004000| SvSetSV_nosteal||5.004000| SvSetSV||| SvTAINTED_off||5.004000| SvTAINTED_on||5.004000| SvTAINTED||5.004000| SvTAINT||| SvTRUE||| SvTYPE||| SvUNLOCK||5.007003| SvUOK||5.007001| SvUPGRADE||| SvUTF8_off||5.006000| SvUTF8_on||5.006000| SvUTF8||5.006000| SvUVXx|5.004000||p SvUVX|5.004000||p SvUV_nomg|5.009001||p SvUV_set||5.009003| SvUVx|5.004000||p SvUV|5.004000||p SvVOK||5.008001| THIS|||n UNDERBAR|5.009002||p UVSIZE|5.006000||p UVTYPE|5.006000||p UVXf|5.007001||p UVof|5.006000||p UVuf|5.006000||p UVxf|5.006000||p XCPT_CATCH|5.009002||p XCPT_RETHROW|5.009002||p XCPT_TRY_END|5.009002||p XCPT_TRY_START|5.009002||p XPUSHi||| XPUSHmortal|5.009002||p XPUSHn||| XPUSHp||| XPUSHs||| XPUSHu|5.004000||p XSRETURN_EMPTY||| XSRETURN_IV||| XSRETURN_NO||| XSRETURN_NV||| XSRETURN_PV||| XSRETURN_UNDEF||| XSRETURN_UV|5.008001||p XSRETURN_YES||| XSRETURN||| XST_mIV||| XST_mNO||| XST_mNV||| XST_mPV||| XST_mUNDEF||| XST_mUV|5.008001||p XST_mYES||| XS_VERSION_BOOTCHECK||| XS_VERSION||| XS||| ZeroD|5.009002||p Zero||| _aMY_CXT|5.007003||p _pMY_CXT|5.007003||p aMY_CXT_|5.007003||p aMY_CXT|5.007003||p aTHX_|5.006000||p aTHX|5.006000||p add_data||| allocmy||| amagic_call||| any_dup||| ao||| append_elem||| append_list||| apply_attrs_my||| apply_attrs_string||5.006001| apply_attrs||| apply||| asIV||| asUV||| atfork_lock||5.007003|n atfork_unlock||5.007003|n av_arylen_p||5.009003| av_clear||| av_delete||5.006000| av_exists||5.006000| av_extend||| av_fake||| av_fetch||| av_fill||| av_len||| av_make||| av_pop||| av_push||| av_reify||| av_shift||| av_store||| av_undef||| av_unshift||| ax|||n bad_type||| bind_match||| block_end||| block_gimme||5.004000| block_start||| boolSV|5.004000||p boot_core_PerlIO||| boot_core_UNIVERSAL||| boot_core_xsutils||| bytes_from_utf8||5.007001| bytes_to_utf8||5.006001| cache_re||| call_argv|5.006000||p call_atexit||5.006000| call_body||| call_list_body||| call_list||5.004000| call_method|5.006000||p call_pv|5.006000||p call_sv|5.006000||p calloc||5.007002|n cando||| cast_i32||5.006000| cast_iv||5.006000| cast_ulong||5.006000| cast_uv||5.006000| check_uni||| checkcomma||| checkposixcc||| ck_anoncode||| ck_bitop||| ck_concat||| ck_defined||| ck_delete||| ck_die||| ck_eof||| ck_eval||| ck_exec||| ck_exists||| ck_exit||| ck_ftst||| ck_fun||| ck_glob||| ck_grep||| ck_index||| ck_join||| ck_lengthconst||| ck_lfun||| ck_listiob||| ck_match||| ck_method||| ck_null||| ck_open||| ck_repeat||| ck_require||| ck_retarget||| ck_return||| ck_rfun||| ck_rvconst||| ck_sassign||| ck_select||| ck_shift||| ck_sort||| ck_spair||| ck_split||| ck_subr||| ck_substr||| ck_svconst||| ck_trunc||| ck_unpack||| cl_and||| cl_anything||| cl_init_zero||| cl_init||| cl_is_anything||| cl_or||| closest_cop||| convert||| cop_free||| cr_textfilter||| croak_nocontext|||vn croak|||v csighandler||5.007001|n custom_op_desc||5.007003| custom_op_name||5.007003| cv_ckproto||| cv_clone||| cv_const_sv||5.004000| cv_dump||| cv_undef||| cx_dump||5.005000| cx_dup||| cxinc||| dAXMARK||5.009003| dAX|5.007002||p dITEMS|5.007002||p dMARK||| dMY_CXT_SV|5.007003||p dMY_CXT|5.007003||p dNOOP|5.006000||p dORIGMARK||| dSP||| dTHR|5.004050||p dTHXa|5.006000||p dTHXoa|5.006000||p dTHX|5.006000||p dUNDERBAR|5.009002||p dXCPT|5.009002||p dXSARGS||| dXSI32||| dXSTARG|5.006000||p deb_curcv||| deb_nocontext|||vn deb_stack_all||| deb_stack_n||| debop||5.005000| debprofdump||5.005000| debprof||| debstackptrs||5.007003| debstack||5.007003| deb||5.007003|v del_he||| del_sv||| delimcpy||5.004000| depcom||| deprecate_old||| deprecate||| despatch_signals||5.007001| die_nocontext|||vn die_where||| die|||v dirp_dup||| div128||| djSP||| do_aexec5||| do_aexec||| do_aspawn||| do_binmode||5.004050| do_chomp||| do_chop||| do_close||| do_dump_pad||| do_eof||| do_exec3||| do_execfree||| do_exec||| do_gv_dump||5.006000| do_gvgv_dump||5.006000| do_hv_dump||5.006000| do_ipcctl||| do_ipcget||| do_join||| do_kv||| do_magic_dump||5.006000| do_msgrcv||| do_msgsnd||| do_oddball||| do_op_dump||5.006000| do_open9||5.006000| do_openn||5.007001| do_open||5.004000| do_pipe||| do_pmop_dump||5.006000| do_print||| do_readline||| do_seek||| do_semop||| do_shmio||| do_spawn_nowait||| do_spawn||| do_sprintf||| do_sv_dump||5.006000| do_sysseek||| do_tell||| do_trans_complex_utf8||| do_trans_complex||| do_trans_count_utf8||| do_trans_count||| do_trans_simple_utf8||| do_trans_simple||| do_trans||| do_vecget||| do_vecset||| do_vop||| docatch_body||| docatch||| doeval||| dofile||| dofindlabel||| doform||| doing_taint||5.008001|n dooneliner||| doopen_pm||| doparseform||| dopoptoeval||| dopoptolabel||| dopoptoloop||| dopoptosub_at||| dopoptosub||| dounwind||| dowantarray||| dump_all||5.006000| dump_eval||5.006000| dump_fds||| dump_form||5.006000| dump_indent||5.006000|v dump_mstats||| dump_packsubs||5.006000| dump_sub||5.006000| dump_vindent||5.006000| dumpuntil||| dup_attrlist||| emulate_eaccess||| eval_pv|5.006000||p eval_sv|5.006000||p expect_number||| fbm_compile||5.005000| fbm_instr||5.005000| fd_on_nosuid_fs||| filter_add||| filter_del||| filter_gets||| filter_read||| find_beginning||| find_byclass||| find_in_my_stash||| find_runcv||| find_rundefsvoffset||5.009002| find_script||| find_uninit_var||| fold_constants||| forbid_setid||| force_ident||| force_list||| force_next||| force_version||| force_word||| form_nocontext|||vn form||5.004000|v fp_dup||| fprintf_nocontext|||vn free_global_struct||| free_tied_hv_pool||| free_tmps||| gen_constant_list||| get_av|5.006000||p get_context||5.006000|n get_cv|5.006000||p get_db_sub||| get_debug_opts||| get_hash_seed||| get_hv|5.006000||p get_mstats||| get_no_modify||| get_num||| get_op_descs||5.005000| get_op_names||5.005000| get_opargs||| get_ppaddr||5.006000| get_sv|5.006000||p get_vtbl||5.005030| getcwd_sv||5.007002| getenv_len||| gp_dup||| gp_free||| gp_ref||| grok_bin|5.007003||p grok_hex|5.007003||p grok_number|5.007002||p grok_numeric_radix|5.007002||p grok_oct|5.007003||p group_end||| gv_AVadd||| gv_HVadd||| gv_IOadd||| gv_autoload4||5.004000| gv_check||| gv_dump||5.006000| gv_efullname3||5.004000| gv_efullname4||5.006001| gv_efullname||| gv_ename||| gv_fetchfile||| gv_fetchmeth_autoload||5.007003| gv_fetchmethod_autoload||5.004000| gv_fetchmethod||| gv_fetchmeth||| gv_fetchpvn_flags||5.009002| gv_fetchpv||| gv_fetchsv||5.009002| gv_fullname3||5.004000| gv_fullname4||5.006001| gv_fullname||| gv_handler||5.007001| gv_init_sv||| gv_init||| gv_share||| gv_stashpvn|5.006000||p gv_stashpv||| gv_stashsv||| he_dup||| hek_dup||| hfreeentries||| hsplit||| hv_assert||5.009001| hv_auxinit||| hv_clear_placeholders||5.009001| hv_clear||| hv_delayfree_ent||5.004000| hv_delete_common||| hv_delete_ent||5.004000| hv_delete||| hv_eiter_p||5.009003| hv_eiter_set||5.009003| hv_exists_ent||5.004000| hv_exists||| hv_fetch_common||| hv_fetch_ent||5.004000| hv_fetch||| hv_free_ent||5.004000| hv_iterinit||| hv_iterkeysv||5.004000| hv_iterkey||| hv_iternext_flags||5.008000| hv_iternextsv||| hv_iternext||| hv_iterval||| hv_ksplit||5.004000| hv_magic_check||| hv_magic||| hv_name_set||5.009003| hv_notallowed||| hv_placeholders_get||5.009003| hv_placeholders_p||5.009003| hv_placeholders_set||5.009003| hv_riter_p||5.009003| hv_riter_set||5.009003| hv_scalar||5.009001| hv_store_ent||5.004000| hv_store_flags||5.008000| hv_store||| hv_undef||| ibcmp_locale||5.004000| ibcmp_utf8||5.007003| ibcmp||| incl_perldb||| incline||| incpush||| ingroup||| init_argv_symbols||| init_debugger||| init_global_struct||| init_i18nl10n||5.006000| init_i18nl14n||5.006000| init_ids||| init_interp||| init_lexer||| init_main_stash||| init_perllib||| init_postdump_symbols||| init_predump_symbols||| init_stacks||5.005000| init_tm||5.007002| instr||| intro_my||| intuit_method||| intuit_more||| invert||| io_close||| isALNUM||| isALPHA||| isDIGIT||| isLOWER||| isSPACE||| isUPPER||| is_an_int||| is_gv_magical_sv||| is_gv_magical||| is_handle_constructor||| is_list_assignment||| is_lvalue_sub||5.007001| is_uni_alnum_lc||5.006000| is_uni_alnumc_lc||5.006000| is_uni_alnumc||5.006000| is_uni_alnum||5.006000| is_uni_alpha_lc||5.006000| is_uni_alpha||5.006000| is_uni_ascii_lc||5.006000| is_uni_ascii||5.006000| is_uni_cntrl_lc||5.006000| is_uni_cntrl||5.006000| is_uni_digit_lc||5.006000| is_uni_digit||5.006000| is_uni_graph_lc||5.006000| is_uni_graph||5.006000| is_uni_idfirst_lc||5.006000| is_uni_idfirst||5.006000| is_uni_lower_lc||5.006000| is_uni_lower||5.006000| is_uni_print_lc||5.006000| is_uni_print||5.006000| is_uni_punct_lc||5.006000| is_uni_punct||5.006000| is_uni_space_lc||5.006000| is_uni_space||5.006000| is_uni_upper_lc||5.006000| is_uni_upper||5.006000| is_uni_xdigit_lc||5.006000| is_uni_xdigit||5.006000| is_utf8_alnumc||5.006000| is_utf8_alnum||5.006000| is_utf8_alpha||5.006000| is_utf8_ascii||5.006000| is_utf8_char_slow||| is_utf8_char||5.006000| is_utf8_cntrl||5.006000| is_utf8_digit||5.006000| is_utf8_graph||5.006000| is_utf8_idcont||5.008000| is_utf8_idfirst||5.006000| is_utf8_lower||5.006000| is_utf8_mark||5.006000| is_utf8_print||5.006000| is_utf8_punct||5.006000| is_utf8_space||5.006000| is_utf8_string_loclen||5.009003| is_utf8_string_loc||5.008001| is_utf8_string||5.006001| is_utf8_upper||5.006000| is_utf8_xdigit||5.006000| isa_lookup||| items|||n ix|||n jmaybe||| keyword||| leave_scope||| lex_end||| lex_start||| linklist||| listkids||| list||| load_module_nocontext|||vn load_module||5.006000|v localize||| looks_like_number||| lop||| mPUSHi|5.009002||p mPUSHn|5.009002||p mPUSHp|5.009002||p mPUSHu|5.009002||p mXPUSHi|5.009002||p mXPUSHn|5.009002||p mXPUSHp|5.009002||p mXPUSHu|5.009002||p magic_clear_all_env||| magic_clearenv||| magic_clearpack||| magic_clearsig||| magic_dump||5.006000| magic_existspack||| magic_freearylen_p||| magic_freeovrld||| magic_freeregexp||| magic_getarylen||| magic_getdefelem||| magic_getglob||| magic_getnkeys||| magic_getpack||| magic_getpos||| magic_getsig||| magic_getsubstr||| magic_gettaint||| magic_getuvar||| magic_getvec||| magic_get||| magic_killbackrefs||| magic_len||| magic_methcall||| magic_methpack||| magic_nextpack||| magic_regdata_cnt||| magic_regdatum_get||| magic_regdatum_set||| magic_scalarpack||| magic_set_all_env||| magic_setamagic||| magic_setarylen||| magic_setbm||| magic_setcollxfrm||| magic_setdbline||| magic_setdefelem||| magic_setenv||| magic_setfm||| magic_setglob||| magic_setisa||| magic_setmglob||| magic_setnkeys||| magic_setpack||| magic_setpos||| magic_setregexp||| magic_setsig||| magic_setsubstr||| magic_settaint||| magic_setutf8||| magic_setuvar||| magic_setvec||| magic_set||| magic_sizepack||| magic_wipepack||| magicname||| make_trie||| malloced_size|||n malloc||5.007002|n markstack_grow||| measure_struct||| memEQ|5.004000||p memNE|5.004000||p mem_collxfrm||| mess_alloc||| mess_nocontext|||vn mess||5.006000|v method_common||| mfree||5.007002|n mg_clear||| mg_copy||| mg_dup||| mg_find||| mg_free||| mg_get||| mg_length||5.005000| mg_localize||| mg_magical||| mg_set||| mg_size||5.005000| mini_mktime||5.007002| missingterm||| mode_from_discipline||| modkids||| mod||| moreswitches||| mul128||| mulexp10|||n my_atof2||5.007002| my_atof||5.006000| my_attrs||| my_bcopy|||n my_betoh16|||n my_betoh32|||n my_betoh64|||n my_betohi|||n my_betohl|||n my_betohs|||n my_bzero|||n my_chsize||| my_exit_jump||| my_exit||| my_failure_exit||5.004000| my_fflush_all||5.006000| my_fork||5.007003|n my_htobe16|||n my_htobe32|||n my_htobe64|||n my_htobei|||n my_htobel|||n my_htobes|||n my_htole16|||n my_htole32|||n my_htole64|||n my_htolei|||n my_htolel|||n my_htoles|||n my_htonl||| my_kid||| my_letoh16|||n my_letoh32|||n my_letoh64|||n my_letohi|||n my_letohl|||n my_letohs|||n my_lstat||| my_memcmp||5.004000|n my_memset|||n my_ntohl||| my_pclose||5.004000| my_popen_list||5.007001| my_popen||5.004000| my_setenv||| my_socketpair||5.007003|n my_stat||| my_strftime||5.007002| my_swabn|||n my_swap||| my_unexec||| my||| newANONATTRSUB||5.006000| newANONHASH||| newANONLIST||| newANONSUB||| newASSIGNOP||| newATTRSUB||5.006000| newAVREF||| newAV||| newBINOP||| newCONDOP||| newCONSTSUB|5.006000||p newCVREF||| newDEFSVOP||| newFORM||| newFOROP||| newGVOP||| newGVREF||| newGVgen||| newHVREF||| newHVhv||5.005000| newHV||| newIO||| newLISTOP||| newLOGOP||| newLOOPEX||| newLOOPOP||| newMYSUB||5.006000| newNULLLIST||| newOP||| newPADOP||5.006000| newPMOP||| newPROG||| newPVOP||| newRANGE||| newRV_inc|5.004000||p newRV_noinc|5.006000||p newRV||| newSLICEOP||| newSTATEOP||| newSUB||| newSVOP||| newSVREF||| newSVhek||5.009003| newSViv||| newSVnv||| newSVpvf_nocontext|||vn newSVpvf||5.004000|v newSVpvn_share||5.007001| newSVpvn|5.006000||p newSVpv||| newSVrv||| newSVsv||| newSVuv|5.006000||p newSV||| newUNOP||| newWHILEOP||5.009003| newXSproto||5.006000| newXS||5.006000| new_collate||5.006000| new_constant||| new_ctype||5.006000| new_he||| new_logop||| new_numeric||5.006000| new_stackinfo||5.005000| new_version||5.009000| next_symbol||| nextargv||| nextchar||| ninstr||| no_bareword_allowed||| no_fh_allowed||| no_op||| not_a_number||| nothreadhook||5.008000| nuke_stacks||| num_overflow|||n oopsAV||| oopsCV||| oopsHV||| op_clear||| op_const_sv||| op_dump||5.006000| op_free||| op_null||5.007002| op_refcnt_lock||5.009002| op_refcnt_unlock||5.009002| open_script||| pMY_CXT_|5.007003||p pMY_CXT|5.007003||p pTHX_|5.006000||p pTHX|5.006000||p pack_cat||5.007003| pack_rec||| package||| packlist||5.008001| pad_add_anon||| pad_add_name||| pad_alloc||| pad_block_start||| pad_check_dup||| pad_compname_type||| pad_findlex||| pad_findmy||| pad_fixup_inner_anons||| pad_free||| pad_leavemy||| pad_new||| pad_push||| pad_reset||| pad_setsv||| pad_sv||| pad_swipe||| pad_tidy||| pad_undef||| parse_body||| parse_unicode_opts||| path_is_absolute||| peep||| pending_ident||| perl_alloc_using|||n perl_alloc|||n perl_clone_using|||n perl_clone|||n perl_construct|||n perl_destruct||5.007003|n perl_free|||n perl_parse||5.006000|n perl_run|||n pidgone||| pmflag||| pmop_dump||5.006000| pmruntime||| pmtrans||| pop_scope||| pregcomp||| pregexec||| pregfree||| prepend_elem||| printf_nocontext|||vn ptr_table_clear||| ptr_table_fetch||| ptr_table_free||| ptr_table_new||| ptr_table_split||| ptr_table_store||| push_scope||| put_byte||| pv_display||5.006000| pv_uni_display||5.007003| qerror||| re_croak2||| re_dup||| re_intuit_start||5.006000| re_intuit_string||5.006000| realloc||5.007002|n reentrant_free||| reentrant_init||| reentrant_retry|||vn reentrant_size||| refkids||| refto||| ref||| reg_node||| reganode||| regatom||| regbranch||| regclass_swash||5.007003| regclass||| regcp_set_to||| regcppop||| regcppush||| regcurly||| regdump||5.005000| regexec_flags||5.005000| reghop3||| reghopmaybe3||| reghopmaybe||| reghop||| reginclass||| reginitcolors||5.006000| reginsert||| regmatch||| regnext||5.005000| regoptail||| regpiece||| regpposixcc||| regprop||| regrepeat_hard||| regrepeat||| regtail||| regtry||| reguni||| regwhite||| reg||| repeatcpy||| report_evil_fh||| report_uninit||| require_errno||| require_pv||5.006000| rninstr||| rsignal_restore||| rsignal_save||| rsignal_state||5.004000| rsignal||5.004000| run_body||| runops_debug||5.005000| runops_standard||5.005000| rvpv_dup||| rxres_free||| rxres_restore||| rxres_save||| safesyscalloc||5.006000|n safesysfree||5.006000|n safesysmalloc||5.006000|n safesysrealloc||5.006000|n same_dirent||| save_I16||5.004000| save_I32||| save_I8||5.006000| save_aelem||5.004050| save_alloc||5.006000| save_aptr||| save_ary||| save_bool||5.008001| save_clearsv||| save_delete||| save_destructor_x||5.006000| save_destructor||5.006000| save_freeop||| save_freepv||| save_freesv||| save_generic_pvref||5.006001| save_generic_svref||5.005030| save_gp||5.004000| save_hash||| save_hek_flags||| save_helem||5.004050| save_hints||5.005000| save_hptr||| save_int||| save_item||| save_iv||5.005000| save_lines||| save_list||| save_long||| save_magic||| save_mortalizesv||5.007001| save_nogv||| save_op||| save_padsv||5.007001| save_pptr||| save_re_context||5.006000| save_scalar_at||| save_scalar||| save_set_svflags||5.009000| save_shared_pvref||5.007003| save_sptr||| save_svref||| save_threadsv||5.005000| save_vptr||5.006000| savepvn||| savepv||| savesharedpv||5.007003| savestack_grow_cnt||5.008001| savestack_grow||| savesvpv||5.009002| sawparens||| scalar_mod_type||| scalarboolean||| scalarkids||| scalarseq||| scalarvoid||| scalar||| scan_bin||5.006000| scan_commit||| scan_const||| scan_formline||| scan_heredoc||| scan_hex||| scan_ident||| scan_inputsymbol||| scan_num||5.007001| scan_oct||| scan_pat||| scan_str||| scan_subst||| scan_trans||| scan_version||5.009001| scan_vstring||5.008001| scan_word||| scope||| screaminstr||5.005000| seed||| set_context||5.006000|n set_csh||| set_numeric_local||5.006000| set_numeric_radix||5.006000| set_numeric_standard||5.006000| setdefout||| setenv_getix||| share_hek_flags||| share_hek||| si_dup||| sighandler|||n simplify_sort||| skipspace||| sortsv||5.007003| ss_dup||| stack_grow||| start_glob||| start_subparse||5.004000| stashpv_hvname_match||5.009003| stdize_locale||| strEQ||| strGE||| strGT||| strLE||| strLT||| strNE||| str_to_version||5.006000| strnEQ||| strnNE||| study_chunk||| sub_crush_depth||| sublex_done||| sublex_push||| sublex_start||| sv_2bool||| sv_2cv||| sv_2io||| sv_2iuv_non_preserve||| sv_2iv_flags||5.009001| sv_2iv||| sv_2mortal||| sv_2nv||| sv_2pv_flags||5.007002| sv_2pv_nolen|5.006000||p sv_2pvbyte_nolen||| sv_2pvbyte|5.006000||p sv_2pvutf8_nolen||5.006000| sv_2pvutf8||5.006000| sv_2pv||| sv_2uv_flags||5.009001| sv_2uv|5.004000||p sv_add_arena||| sv_add_backref||| sv_backoff||| sv_bless||| sv_cat_decode||5.008001| sv_catpv_mg|5.006000||p sv_catpvf_mg_nocontext|||pvn sv_catpvf_mg|5.006000|5.004000|pv sv_catpvf_nocontext|||vn sv_catpvf||5.004000|v sv_catpvn_flags||5.007002| sv_catpvn_mg|5.006000||p sv_catpvn_nomg|5.007002||p sv_catpvn||| sv_catpv||| sv_catsv_flags||5.007002| sv_catsv_mg|5.006000||p sv_catsv_nomg|5.007002||p sv_catsv||| sv_chop||| sv_clean_all||| sv_clean_objs||| sv_clear||| sv_cmp_locale||5.004000| sv_cmp||| sv_collxfrm||| sv_compile_2op||5.008001| sv_copypv||5.007003| sv_dec||| sv_del_backref||| sv_derived_from||5.004000| sv_dump||| sv_dup||| sv_eq||| sv_force_normal_flags||5.007001| sv_force_normal||5.006000| sv_free2||| sv_free_arenas||| sv_free||| sv_gets||5.004000| sv_grow||| sv_inc||| sv_insert||| sv_isa||| sv_isobject||| sv_iv||5.005000| sv_len_utf8||5.006000| sv_len||| sv_magicext||5.007003| sv_magic||| sv_mortalcopy||| sv_newmortal||| sv_newref||| sv_nolocking||5.007003| sv_nosharing||5.007003| sv_nounlocking||5.007003| sv_nv||5.005000| sv_peek||5.005000| sv_pos_b2u||5.006000| sv_pos_u2b||5.006000| sv_pvbyten_force||5.006000| sv_pvbyten||5.006000| sv_pvbyte||5.006000| sv_pvn_force_flags||5.007002| sv_pvn_force|||p sv_pvn_nomg|5.007003||p sv_pvn|5.006000||p sv_pvutf8n_force||5.006000| sv_pvutf8n||5.006000| sv_pvutf8||5.006000| sv_pv||5.006000| sv_recode_to_utf8||5.007003| sv_reftype||| sv_release_COW||| sv_release_IVX||| sv_replace||| sv_report_used||| sv_reset||| sv_rvweaken||5.006000| sv_setiv_mg|5.006000||p sv_setiv||| sv_setnv_mg|5.006000||p sv_setnv||| sv_setpv_mg|5.006000||p sv_setpvf_mg_nocontext|||pvn sv_setpvf_mg|5.006000|5.004000|pv sv_setpvf_nocontext|||vn sv_setpvf||5.004000|v sv_setpviv_mg||5.008001| sv_setpviv||5.008001| sv_setpvn_mg|5.006000||p sv_setpvn||| sv_setpv||| sv_setref_iv||| sv_setref_nv||| sv_setref_pvn||| sv_setref_pv||| sv_setref_uv||5.007001| sv_setsv_cow||| sv_setsv_flags||5.007002| sv_setsv_mg|5.006000||p sv_setsv_nomg|5.007002||p sv_setsv||| sv_setuv_mg|5.006000||p sv_setuv|5.006000||p sv_tainted||5.004000| sv_taint||5.004000| sv_true||5.005000| sv_unglob||| sv_uni_display||5.007003| sv_unmagic||| sv_unref_flags||5.007001| sv_unref||| sv_untaint||5.004000| sv_upgrade||| sv_usepvn_mg|5.006000||p sv_usepvn||| sv_utf8_decode||5.006000| sv_utf8_downgrade||5.006000| sv_utf8_encode||5.006000| sv_utf8_upgrade_flags||5.007002| sv_utf8_upgrade||5.007001| sv_uv|5.006000||p sv_vcatpvf_mg|5.006000|5.004000|p sv_vcatpvfn||5.004000| sv_vcatpvf|5.006000|5.004000|p sv_vsetpvf_mg|5.006000|5.004000|p sv_vsetpvfn||5.004000| sv_vsetpvf|5.006000|5.004000|p svtype||| swallow_bom||| swash_fetch||5.007002| swash_init||5.006000| sys_intern_clear||| sys_intern_dup||| sys_intern_init||| taint_env||| taint_proper||| tmps_grow||5.006000| toLOWER||| toUPPER||| to_byte_substr||| to_uni_fold||5.007003| to_uni_lower_lc||5.006000| to_uni_lower||5.007003| to_uni_title_lc||5.006000| to_uni_title||5.007003| to_uni_upper_lc||5.006000| to_uni_upper||5.007003| to_utf8_case||5.007003| to_utf8_fold||5.007003| to_utf8_lower||5.007003| to_utf8_substr||| to_utf8_title||5.007003| to_utf8_upper||5.007003| tokeq||| tokereport||| too_few_arguments||| too_many_arguments||| unlnk||| unpack_rec||| unpack_str||5.007003| unpackstring||5.008001| unshare_hek_or_pvn||| unshare_hek||| unsharepvn||5.004000| upg_version||5.009000| usage||| utf16_textfilter||| utf16_to_utf8_reversed||5.006001| utf16_to_utf8||5.006001| utf16rev_textfilter||| utf8_distance||5.006000| utf8_hop||5.006000| utf8_length||5.007001| utf8_mg_pos_init||| utf8_mg_pos||| utf8_to_bytes||5.006001| utf8_to_uvchr||5.007001| utf8_to_uvuni||5.007001| utf8n_to_uvchr||5.007001| utf8n_to_uvuni||5.007001| utilize||| uvchr_to_utf8_flags||5.007003| uvchr_to_utf8||5.007001| uvuni_to_utf8_flags||5.007003| uvuni_to_utf8||5.007001| validate_suid||| varname||| vcmp||5.009000| vcroak||5.006000| vdeb||5.007003| vdie||| vform||5.006000| visit||| vivify_defelem||| vivify_ref||| vload_module||5.006000| vmess||5.006000| vnewSVpvf|5.006000|5.004000|p vnormal||5.009002| vnumify||5.009000| vstringify||5.009000| vwarner||5.006000| vwarn||5.006000| wait4pid||| warn_nocontext|||vn warner_nocontext|||vn warner||5.006000|v warn|||v watch||| whichsig||| write_to_stderr||| yyerror||| yylex||| yyparse||| yywarn||| ); if (exists $opt{'list-unsupported'}) { my $f; for $f (sort { lc $a cmp lc $b } keys %API) { next unless $API{$f}{todo}; print "$f ", '.'x(40-length($f)), " ", format_version($API{$f}{todo}), "\n"; } exit 0; } # Scan for possible replacement candidates my(%replace, %need, %hints, %depends); my $replace = 0; my $hint = ''; while () { if ($hint) { if (m{^\s*\*\s(.*?)\s*$}) { $hints{$hint} ||= ''; # suppress warning with older perls $hints{$hint} .= "$1\n"; } else { $hint = ''; } } $hint = $1 if m{^\s*$rccs\sHint:\s+(\w+)\s*$}; $replace = $1 if m{^\s*$rccs\s+Replace:\s+(\d+)\s+$rcce\s*$}; $replace{$2} = $1 if $replace and m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+)}; $replace{$2} = $1 if m{^\s*#\s*define\s+(\w+)(?:\([^)]*\))?\s+(\w+).*$rccs\s+Replace\s+$rcce}; $replace{$1} = $2 if m{^\s*$rccs\s+Replace (\w+) with (\w+)\s+$rcce\s*$}; if (m{^\s*$rccs\s+(\w+)\s+depends\s+on\s+(\w+(\s*,\s*\w+)*)\s+$rcce\s*$}) { push @{$depends{$1}}, map { s/\s+//g; $_ } split /,/, $2; } $need{$1} = 1 if m{^#if\s+defined\(NEED_(\w+)(?:_GLOBAL)?\)}; } if (exists $opt{'api-info'}) { my $f; my $count = 0; my $match = $opt{'api-info'} =~ m!^/(.*)/$! ? $1 : "^\Q$opt{'api-info'}\E\$"; for $f (sort { lc $a cmp lc $b } keys %API) { next unless $f =~ /$match/; print "\n=== $f ===\n\n"; my $info = 0; if ($API{$f}{base} || $API{$f}{todo}) { my $base = format_version($API{$f}{base} || $API{$f}{todo}); print "Supported at least starting from perl-$base.\n"; $info++; } if ($API{$f}{provided}) { my $todo = $API{$f}{todo} ? format_version($API{$f}{todo}) : "5.003"; print "Support by $ppport provided back to perl-$todo.\n"; print "Support needs to be explicitly requested by NEED_$f.\n" if exists $need{$f}; print "Depends on: ", join(', ', @{$depends{$f}}), ".\n" if exists $depends{$f}; print "$hints{$f}" if exists $hints{$f}; $info++; } unless ($info) { print "No portability information available.\n"; } $count++; } if ($count > 0) { print "\n"; } else { print "Found no API matching '$opt{'api-info'}'.\n"; } exit 0; } if (exists $opt{'list-provided'}) { my $f; for $f (sort { lc $a cmp lc $b } keys %API) { next unless $API{$f}{provided}; my @flags; push @flags, 'explicit' if exists $need{$f}; push @flags, 'depend' if exists $depends{$f}; push @flags, 'hint' if exists $hints{$f}; my $flags = @flags ? ' ['.join(', ', @flags).']' : ''; print "$f$flags\n"; } exit 0; } my @files; my @srcext = qw( xs c h cc cpp ); my $srcext = join '|', @srcext; if (@ARGV) { my %seen; @files = grep { -f && !exists $seen{$_} } map { glob $_ } @ARGV; } else { eval { require File::Find; File::Find::find(sub { $File::Find::name =~ /\.($srcext)$/i and push @files, $File::Find::name; }, '.'); }; if ($@) { @files = map { glob "*.$_" } @srcext; } } if (!@ARGV || $opt{filter}) { my(@in, @out); my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files; for (@files) { my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/\.($srcext)$/i; push @{ $out ? \@out : \@in }, $_; } if (@ARGV && @out) { warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out); } @files = @in; } unless (@files) { die "No input files given!\n"; } my(%files, %global, %revreplace); %revreplace = reverse %replace; my $filename; my $patch_opened = 0; for $filename (@files) { unless (open IN, "<$filename") { warn "Unable to read from $filename: $!\n"; next; } info("Scanning $filename ..."); my $c = do { local $/; }; close IN; my %file = (orig => $c, changes => 0); # temporarily remove C comments from the code my @ccom; $c =~ s{ ( [^"'/]+ | (?:"[^"\\]*(?:\\.[^"\\]*)*" [^"'/]*)+ | (?:'[^'\\]*(?:\\.[^'\\]*)*' [^"'/]*)+ ) | (/ (?: \*[^*]*\*+(?:[^$ccs][^*]*\*+)* / | /[^\r\n]* )) }{ defined $2 and push @ccom, $2; defined $1 ? $1 : "$ccs$#ccom$cce"; }egsx; $file{ccom} = \@ccom; $file{code} = $c; $file{has_inc_ppport} = ($c =~ /#.*include.*\Q$ppport\E/); my $func; for $func (keys %API) { my $match = $func; $match .= "|$revreplace{$func}" if exists $revreplace{$func}; if ($c =~ /\b(?:Perl_)?($match)\b/) { $file{uses_replace}{$1}++ if exists $revreplace{$func} && $1 eq $revreplace{$func}; $file{uses_Perl}{$func}++ if $c =~ /\bPerl_$func\b/; if (exists $API{$func}{provided}) { if (!exists $API{$func}{base} || $API{$func}{base} > $opt{'compat-version'}) { $file{uses}{$func}++; my @deps = rec_depend($func); if (@deps) { $file{uses_deps}{$func} = \@deps; for (@deps) { $file{uses}{$_} = 0 unless exists $file{uses}{$_}; } } for ($func, @deps) { if (exists $need{$_}) { $file{needs}{$_} = 'static'; } } } } if (exists $API{$func}{todo} && $API{$func}{todo} > $opt{'compat-version'}) { if ($c =~ /\b$func\b/) { $file{uses_todo}{$func}++; } } } } while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) { if (exists $need{$2}) { $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++; } else { warning("Possibly wrong #define $1 in $filename"); } } for (qw(uses needs uses_todo needed_global needed_static)) { for $func (keys %{$file{$_}}) { push @{$global{$_}{$func}}, $filename; } } $files{$filename} = \%file; } # Globally resolve NEED_'s my $need; for $need (keys %{$global{needs}}) { if (@{$global{needs}{$need}} > 1) { my @targets = @{$global{needs}{$need}}; my @t = grep $files{$_}{needed_global}{$need}, @targets; @targets = @t if @t; @t = grep /\.xs$/i, @targets; @targets = @t if @t; my $target = shift @targets; $files{$target}{needs}{$need} = 'global'; for (@{$global{needs}{$need}}) { $files{$_}{needs}{$need} = 'extern' if $_ ne $target; } } } for $filename (@files) { exists $files{$filename} or next; info("=== Analyzing $filename ==="); my %file = %{$files{$filename}}; my $func; my $c = $file{code}; for $func (sort keys %{$file{uses_Perl}}) { if ($API{$func}{varargs}) { my $changes = ($c =~ s{\b(Perl_$func\s*\(\s*)(?!aTHX_?)(\)|[^\s)]*\))} { $1 . ($2 eq ')' ? 'aTHX' : 'aTHX_ ') . $2 }ge); if ($changes) { warning("Doesn't pass interpreter argument aTHX to Perl_$func"); $file{changes} += $changes; } } else { warning("Uses Perl_$func instead of $func"); $file{changes} += ($c =~ s{\bPerl_$func(\s*)\((\s*aTHX_?)?\s*} {$func$1(}g); } } for $func (sort keys %{$file{uses_replace}}) { warning("Uses $func instead of $replace{$func}"); $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g); } for $func (sort keys %{$file{uses}}) { next unless $file{uses}{$func}; # if it's only a dependency if (exists $file{uses_deps}{$func}) { diag("Uses $func, which depends on ", join(', ', @{$file{uses_deps}{$func}})); } elsif (exists $replace{$func}) { warning("Uses $func instead of $replace{$func}"); $file{changes} += ($c =~ s/\b$func\b/$replace{$func}/g); } else { diag("Uses $func"); } hint($func); } for $func (sort keys %{$file{uses_todo}}) { warning("Uses $func, which may not be portable below perl ", format_version($API{$func}{todo})); } for $func (sort keys %{$file{needed_static}}) { my $message = ''; if (not exists $file{uses}{$func}) { $message = "No need to define NEED_$func if $func is never used"; } elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') { $message = "No need to define NEED_$func when already needed globally"; } if ($message) { diag($message); $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg); } } for $func (sort keys %{$file{needed_global}}) { my $message = ''; if (not exists $global{uses}{$func}) { $message = "No need to define NEED_${func}_GLOBAL if $func is never used"; } elsif (exists $file{needs}{$func}) { if ($file{needs}{$func} eq 'extern') { $message = "No need to define NEED_${func}_GLOBAL when already needed globally"; } elsif ($file{needs}{$func} eq 'static') { $message = "No need to define NEED_${func}_GLOBAL when only used in this file"; } } if ($message) { diag($message); $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg); } } $file{needs_inc_ppport} = keys %{$file{uses}}; if ($file{needs_inc_ppport}) { my $pp = ''; for $func (sort keys %{$file{needs}}) { my $type = $file{needs}{$func}; next if $type eq 'extern'; my $suffix = $type eq 'global' ? '_GLOBAL' : ''; unless (exists $file{"needed_$type"}{$func}) { if ($type eq 'global') { diag("Files [@{$global{needs}{$func}}] need $func, adding global request"); } else { diag("File needs $func, adding static request"); } $pp .= "#define NEED_$func$suffix\n"; } } if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) { $pp = ''; $file{changes}++; } unless ($file{has_inc_ppport}) { diag("Needs to include '$ppport'"); $pp .= qq(#include "$ppport"\n) } if ($pp) { $file{changes} += ($c =~ s/^($HS*#$HS*define$HS+NEED_\w+.*?)^/$1$pp/ms) || ($c =~ s/^(?=$HS*#$HS*include.*\Q$ppport\E)/$pp/m) || ($c =~ s/^($HS*#$HS*include.*XSUB.*\s*?)^/$1$pp/m) || ($c =~ s/^/$pp/); } } else { if ($file{has_inc_ppport}) { diag("No need to include '$ppport'"); $file{changes} += ($c =~ s/^$HS*?#$HS*include.*\Q$ppport\E.*?$LF//m); } } # put back in our C comments my $ix; my $cppc = 0; my @ccom = @{$file{ccom}}; for $ix (0 .. $#ccom) { if (!$opt{cplusplus} && $ccom[$ix] =~ s!^//!!) { $cppc++; $file{changes} += $c =~ s/$rccs$ix$rcce/$ccs$ccom[$ix] $cce/; } else { $c =~ s/$rccs$ix$rcce/$ccom[$ix]/; } } if ($cppc) { my $s = $cppc != 1 ? 's' : ''; warning("Uses $cppc C++ style comment$s, which is not portable"); } if ($file{changes}) { if (exists $opt{copy}) { my $newfile = "$filename$opt{copy}"; if (-e $newfile) { error("'$newfile' already exists, refusing to write copy of '$filename'"); } else { local *F; if (open F, ">$newfile") { info("Writing copy of '$filename' with changes to '$newfile'"); print F $c; close F; } else { error("Cannot open '$newfile' for writing: $!"); } } } elsif (exists $opt{patch} || $opt{changes}) { if (exists $opt{patch}) { unless ($patch_opened) { if (open PATCH, ">$opt{patch}") { $patch_opened = 1; } else { error("Cannot open '$opt{patch}' for writing: $!"); delete $opt{patch}; $opt{changes} = 1; goto fallback; } } mydiff(\*PATCH, $filename, $c); } else { fallback: info("Suggested changes:"); mydiff(\*STDOUT, $filename, $c); } } else { my $s = $file{changes} == 1 ? '' : 's'; info("$file{changes} potentially required change$s detected"); } } else { info("Looks good"); } } close PATCH if $patch_opened; exit 0; sub mydiff { local *F = shift; my($file, $str) = @_; my $diff; if (exists $opt{diff}) { $diff = run_diff($opt{diff}, $file, $str); } if (!defined $diff and can_use('Text::Diff')) { $diff = Text::Diff::diff($file, \$str, { STYLE => 'Unified' }); $diff = <
$tmp") { print F $str; close F; if (open F, "$prog $file $tmp |") { while () { s/\Q$tmp\E/$file.patched/; $diff .= $_; } close F; unlink $tmp; return $diff; } unlink $tmp; } else { error("Cannot open '$tmp' for writing: $!"); } return undef; } sub can_use { eval "use @_;"; return $@ eq ''; } sub rec_depend { my $func = shift; my %seen; return () unless exists $depends{$func}; grep !$seen{$_}++, map { ($_, rec_depend($_)) } @{$depends{$func}}; } sub parse_version { my $ver = shift; if ($ver =~ /^(\d+)\.(\d+)\.(\d+)$/) { return ($1, $2, $3); } elsif ($ver !~ /^\d+\.[\d_]+$/) { die "cannot parse version '$ver'\n"; } $ver =~ s/_//g; $ver =~ s/$/000000/; my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/; $v = int $v; $s = int $s; if ($r < 5 || ($r == 5 && $v < 6)) { if ($s % 10) { die "cannot parse version '$ver'\n"; } } return ($r, $v, $s); } sub format_version { my $ver = shift; $ver =~ s/$/000000/; my($r,$v,$s) = $ver =~ /(\d+)\.(\d{3})(\d{3})/; $v = int $v; $s = int $s; if ($r < 5 || ($r == 5 && $v < 6)) { if ($s % 10) { die "invalid version '$ver'\n"; } $s /= 10; $ver = sprintf "%d.%03d", $r, $v; $s > 0 and $ver .= sprintf "_%02d", $s; return $ver; } return sprintf "%d.%d.%d", $r, $v, $s; } sub info { $opt{quiet} and return; print @_, "\n"; } sub diag { $opt{quiet} and return; $opt{diag} and print @_, "\n"; } sub warning { $opt{quiet} and return; print "*** ", @_, "\n"; } sub error { print "*** ERROR: ", @_, "\n"; } my %given_hints; sub hint { $opt{quiet} and return; $opt{hints} or return; my $func = shift; exists $hints{$func} or return; $given_hints{$func}++ and return; my $hint = $hints{$func}; $hint =~ s/^/ /mg; print " --- hint for $func ---\n", $hint; } sub usage { my($usage) = do { local(@ARGV,$/)=($0); <> } =~ /^=head\d$HS+SYNOPSIS\s*^(.*?)\s*^=/ms; my %M = ( 'I' => '*' ); $usage =~ s/^\s*perl\s+\S+/$^X $0/; $usage =~ s/([A-Z])<([^>]+)>/$M{$1}$2$M{$1}/g; print < # endif # if !(defined(PERL_VERSION) || (defined(SUBVERSION) && defined(PATCHLEVEL))) # include # endif # ifndef PERL_REVISION # define PERL_REVISION (5) /* Replace: 1 */ # define PERL_VERSION PATCHLEVEL # define PERL_SUBVERSION SUBVERSION /* Replace PERL_PATCHLEVEL with PERL_VERSION */ /* Replace: 0 */ # endif #endif #define PERL_BCDVERSION ((PERL_REVISION * 0x1000000L) + (PERL_VERSION * 0x1000L) + PERL_SUBVERSION) /* It is very unlikely that anyone will try to use this with Perl 6 (or greater), but who knows. */ #if PERL_REVISION != 5 # error ppport.h only works with Perl version 5 #endif /* PERL_REVISION != 5 */ #ifdef I_LIMITS # include #endif #ifndef PERL_UCHAR_MIN # define PERL_UCHAR_MIN ((unsigned char)0) #endif #ifndef PERL_UCHAR_MAX # ifdef UCHAR_MAX # define PERL_UCHAR_MAX ((unsigned char)UCHAR_MAX) # else # ifdef MAXUCHAR # define PERL_UCHAR_MAX ((unsigned char)MAXUCHAR) # else # define PERL_UCHAR_MAX ((unsigned char)~(unsigned)0) # endif # endif #endif #ifndef PERL_USHORT_MIN # define PERL_USHORT_MIN ((unsigned short)0) #endif #ifndef PERL_USHORT_MAX # ifdef USHORT_MAX # define PERL_USHORT_MAX ((unsigned short)USHORT_MAX) # else # ifdef MAXUSHORT # define PERL_USHORT_MAX ((unsigned short)MAXUSHORT) # else # ifdef USHRT_MAX # define PERL_USHORT_MAX ((unsigned short)USHRT_MAX) # else # define PERL_USHORT_MAX ((unsigned short)~(unsigned)0) # endif # endif # endif #endif #ifndef PERL_SHORT_MAX # ifdef SHORT_MAX # define PERL_SHORT_MAX ((short)SHORT_MAX) # else # ifdef MAXSHORT /* Often used in */ # define PERL_SHORT_MAX ((short)MAXSHORT) # else # ifdef SHRT_MAX # define PERL_SHORT_MAX ((short)SHRT_MAX) # else # define PERL_SHORT_MAX ((short) (PERL_USHORT_MAX >> 1)) # endif # endif # endif #endif #ifndef PERL_SHORT_MIN # ifdef SHORT_MIN # define PERL_SHORT_MIN ((short)SHORT_MIN) # else # ifdef MINSHORT # define PERL_SHORT_MIN ((short)MINSHORT) # else # ifdef SHRT_MIN # define PERL_SHORT_MIN ((short)SHRT_MIN) # else # define PERL_SHORT_MIN (-PERL_SHORT_MAX - ((3 & -1) == 3)) # endif # endif # endif #endif #ifndef PERL_UINT_MAX # ifdef UINT_MAX # define PERL_UINT_MAX ((unsigned int)UINT_MAX) # else # ifdef MAXUINT # define PERL_UINT_MAX ((unsigned int)MAXUINT) # else # define PERL_UINT_MAX (~(unsigned int)0) # endif # endif #endif #ifndef PERL_UINT_MIN # define PERL_UINT_MIN ((unsigned int)0) #endif #ifndef PERL_INT_MAX # ifdef INT_MAX # define PERL_INT_MAX ((int)INT_MAX) # else # ifdef MAXINT /* Often used in */ # define PERL_INT_MAX ((int)MAXINT) # else # define PERL_INT_MAX ((int)(PERL_UINT_MAX >> 1)) # endif # endif #endif #ifndef PERL_INT_MIN # ifdef INT_MIN # define PERL_INT_MIN ((int)INT_MIN) # else # ifdef MININT # define PERL_INT_MIN ((int)MININT) # else # define PERL_INT_MIN (-PERL_INT_MAX - ((3 & -1) == 3)) # endif # endif #endif #ifndef PERL_ULONG_MAX # ifdef ULONG_MAX # define PERL_ULONG_MAX ((unsigned long)ULONG_MAX) # else # ifdef MAXULONG # define PERL_ULONG_MAX ((unsigned long)MAXULONG) # else # define PERL_ULONG_MAX (~(unsigned long)0) # endif # endif #endif #ifndef PERL_ULONG_MIN # define PERL_ULONG_MIN ((unsigned long)0L) #endif #ifndef PERL_LONG_MAX # ifdef LONG_MAX # define PERL_LONG_MAX ((long)LONG_MAX) # else # ifdef MAXLONG # define PERL_LONG_MAX ((long)MAXLONG) # else # define PERL_LONG_MAX ((long) (PERL_ULONG_MAX >> 1)) # endif # endif #endif #ifndef PERL_LONG_MIN # ifdef LONG_MIN # define PERL_LONG_MIN ((long)LONG_MIN) # else # ifdef MINLONG # define PERL_LONG_MIN ((long)MINLONG) # else # define PERL_LONG_MIN (-PERL_LONG_MAX - ((3 & -1) == 3)) # endif # endif #endif #if defined(HAS_QUAD) && (defined(convex) || defined(uts)) # ifndef PERL_UQUAD_MAX # ifdef ULONGLONG_MAX # define PERL_UQUAD_MAX ((unsigned long long)ULONGLONG_MAX) # else # ifdef MAXULONGLONG # define PERL_UQUAD_MAX ((unsigned long long)MAXULONGLONG) # else # define PERL_UQUAD_MAX (~(unsigned long long)0) # endif # endif # endif # ifndef PERL_UQUAD_MIN # define PERL_UQUAD_MIN ((unsigned long long)0L) # endif # ifndef PERL_QUAD_MAX # ifdef LONGLONG_MAX # define PERL_QUAD_MAX ((long long)LONGLONG_MAX) # else # ifdef MAXLONGLONG # define PERL_QUAD_MAX ((long long)MAXLONGLONG) # else # define PERL_QUAD_MAX ((long long) (PERL_UQUAD_MAX >> 1)) # endif # endif # endif # ifndef PERL_QUAD_MIN # ifdef LONGLONG_MIN # define PERL_QUAD_MIN ((long long)LONGLONG_MIN) # else # ifdef MINLONGLONG # define PERL_QUAD_MIN ((long long)MINLONGLONG) # else # define PERL_QUAD_MIN (-PERL_QUAD_MAX - ((3 & -1) == 3)) # endif # endif # endif #endif /* This is based on code from 5.003 perl.h */ #ifdef HAS_QUAD # ifdef cray #ifndef IVTYPE # define IVTYPE int #endif #ifndef IV_MIN # define IV_MIN PERL_INT_MIN #endif #ifndef IV_MAX # define IV_MAX PERL_INT_MAX #endif #ifndef UV_MIN # define UV_MIN PERL_UINT_MIN #endif #ifndef UV_MAX # define UV_MAX PERL_UINT_MAX #endif # ifdef INTSIZE #ifndef IVSIZE # define IVSIZE INTSIZE #endif # endif # else # if defined(convex) || defined(uts) #ifndef IVTYPE # define IVTYPE long long #endif #ifndef IV_MIN # define IV_MIN PERL_QUAD_MIN #endif #ifndef IV_MAX # define IV_MAX PERL_QUAD_MAX #endif #ifndef UV_MIN # define UV_MIN PERL_UQUAD_MIN #endif #ifndef UV_MAX # define UV_MAX PERL_UQUAD_MAX #endif # ifdef LONGLONGSIZE #ifndef IVSIZE # define IVSIZE LONGLONGSIZE #endif # endif # else #ifndef IVTYPE # define IVTYPE long #endif #ifndef IV_MIN # define IV_MIN PERL_LONG_MIN #endif #ifndef IV_MAX # define IV_MAX PERL_LONG_MAX #endif #ifndef UV_MIN # define UV_MIN PERL_ULONG_MIN #endif #ifndef UV_MAX # define UV_MAX PERL_ULONG_MAX #endif # ifdef LONGSIZE #ifndef IVSIZE # define IVSIZE LONGSIZE #endif # endif # endif # endif #ifndef IVSIZE # define IVSIZE 8 #endif #ifndef PERL_QUAD_MIN # define PERL_QUAD_MIN IV_MIN #endif #ifndef PERL_QUAD_MAX # define PERL_QUAD_MAX IV_MAX #endif #ifndef PERL_UQUAD_MIN # define PERL_UQUAD_MIN UV_MIN #endif #ifndef PERL_UQUAD_MAX # define PERL_UQUAD_MAX UV_MAX #endif #else #ifndef IVTYPE # define IVTYPE long #endif #ifndef IV_MIN # define IV_MIN PERL_LONG_MIN #endif #ifndef IV_MAX # define IV_MAX PERL_LONG_MAX #endif #ifndef UV_MIN # define UV_MIN PERL_ULONG_MIN #endif #ifndef UV_MAX # define UV_MAX PERL_ULONG_MAX #endif #endif #ifndef IVSIZE # ifdef LONGSIZE # define IVSIZE LONGSIZE # else # define IVSIZE 4 /* A bold guess, but the best we can make. */ # endif #endif #ifndef UVTYPE # define UVTYPE unsigned IVTYPE #endif #ifndef UVSIZE # define UVSIZE IVSIZE #endif #ifndef sv_setuv # define sv_setuv(sv, uv) \ STMT_START { \ UV TeMpUv = uv; \ if (TeMpUv <= IV_MAX) \ sv_setiv(sv, TeMpUv); \ else \ sv_setnv(sv, (double)TeMpUv); \ } STMT_END #endif #ifndef newSVuv # define newSVuv(uv) ((uv) <= IV_MAX ? newSViv((IV)uv) : newSVnv((NV)uv)) #endif #ifndef sv_2uv # define sv_2uv(sv) ((PL_Sv = (sv)), (UV) (SvNOK(PL_Sv) ? SvNV(PL_Sv) : sv_2nv(PL_Sv))) #endif #ifndef SvUVX # define SvUVX(sv) ((UV)SvIVX(sv)) #endif #ifndef SvUVXx # define SvUVXx(sv) SvUVX(sv) #endif #ifndef SvUV # define SvUV(sv) (SvIOK(sv) ? SvUVX(sv) : sv_2uv(sv)) #endif #ifndef SvUVx # define SvUVx(sv) ((PL_Sv = (sv)), SvUV(PL_Sv)) #endif /* Hint: sv_uv * Always use the SvUVx() macro instead of sv_uv(). */ #ifndef sv_uv # define sv_uv(sv) SvUVx(sv) #endif #ifndef XST_mUV # define XST_mUV(i,v) (ST(i) = sv_2mortal(newSVuv(v)) ) #endif #ifndef XSRETURN_UV # define XSRETURN_UV(v) STMT_START { XST_mUV(0,v); XSRETURN(1); } STMT_END #endif #ifndef PUSHu # define PUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); PUSHTARG; } STMT_END #endif #ifndef XPUSHu # define XPUSHu(u) STMT_START { sv_setuv(TARG, (UV)(u)); XPUSHTARG; } STMT_END #endif #if (PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION <= 5)) /* Replace: 1 */ # define PL_DBsingle DBsingle # define PL_DBsub DBsub # define PL_Sv Sv # define PL_compiling compiling # define PL_copline copline # define PL_curcop curcop # define PL_curstash curstash # define PL_debstash debstash # define PL_defgv defgv # define PL_diehook diehook # define PL_dirty dirty # define PL_dowarn dowarn # define PL_errgv errgv # define PL_hexdigit hexdigit # define PL_hints hints # define PL_na na # define PL_no_modify no_modify # define PL_perl_destruct_level perl_destruct_level # define PL_perldb perldb # define PL_ppaddr ppaddr # define PL_rsfp_filters rsfp_filters # define PL_rsfp rsfp # define PL_stack_base stack_base # define PL_stack_sp stack_sp # define PL_stdingv stdingv # define PL_sv_arenaroot sv_arenaroot # define PL_sv_no sv_no # define PL_sv_undef sv_undef # define PL_sv_yes sv_yes # define PL_tainted tainted # define PL_tainting tainting /* Replace: 0 */ #endif #ifndef PERL_UNUSED_DECL # ifdef HASATTRIBUTE # if (defined(__GNUC__) && defined(__cplusplus)) || defined(__INTEL_COMPILER) # define PERL_UNUSED_DECL # else # define PERL_UNUSED_DECL __attribute__((unused)) # endif # else # define PERL_UNUSED_DECL # endif #endif #ifndef NOOP # define NOOP (void)0 #endif #ifndef dNOOP # define dNOOP extern int Perl___notused PERL_UNUSED_DECL #endif #ifndef NVTYPE # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) # define NVTYPE long double # else # define NVTYPE double # endif typedef NVTYPE NV; #endif #ifndef INT2PTR # if (IVSIZE == PTRSIZE) && (UVSIZE == PTRSIZE) # define PTRV UV # define INT2PTR(any,d) (any)(d) # else # if PTRSIZE == LONGSIZE # define PTRV unsigned long # else # define PTRV unsigned # endif # define INT2PTR(any,d) (any)(PTRV)(d) # endif # define NUM2PTR(any,d) (any)(PTRV)(d) # define PTR2IV(p) INT2PTR(IV,p) # define PTR2UV(p) INT2PTR(UV,p) # define PTR2NV(p) NUM2PTR(NV,p) # if PTRSIZE == LONGSIZE # define PTR2ul(p) (unsigned long)(p) # else # define PTR2ul(p) INT2PTR(unsigned long,p) # endif #endif /* !INT2PTR */ #undef START_EXTERN_C #undef END_EXTERN_C #undef EXTERN_C #ifdef __cplusplus # define START_EXTERN_C extern "C" { # define END_EXTERN_C } # define EXTERN_C extern "C" #else # define START_EXTERN_C # define END_EXTERN_C # define EXTERN_C extern #endif #ifndef PERL_GCC_BRACE_GROUPS_FORBIDDEN # if defined(__STRICT_ANSI__) && defined(PERL_GCC_PEDANTIC) # define PERL_GCC_BRACE_GROUPS_FORBIDDEN # endif #endif #undef STMT_START #undef STMT_END #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN) && !defined(__cplusplus) # define STMT_START (void)( /* gcc supports ``({ STATEMENTS; })'' */ # define STMT_END ) #else # if defined(VOIDFLAGS) && (VOIDFLAGS) && (defined(sun) || defined(__sun__)) && !defined(__GNUC__) # define STMT_START if (1) # define STMT_END else (void)0 # else # define STMT_START do # define STMT_END while (0) # endif #endif #ifndef boolSV # define boolSV(b) ((b) ? &PL_sv_yes : &PL_sv_no) #endif /* DEFSV appears first in 5.004_56 */ #ifndef DEFSV # define DEFSV GvSV(PL_defgv) #endif #ifndef SAVE_DEFSV # define SAVE_DEFSV SAVESPTR(GvSV(PL_defgv)) #endif /* Older perls (<=5.003) lack AvFILLp */ #ifndef AvFILLp # define AvFILLp AvFILL #endif #ifndef ERRSV # define ERRSV get_sv("@",FALSE) #endif #ifndef newSVpvn # define newSVpvn(data,len) ((data) \ ? ((len) ? newSVpv((data), (len)) : newSVpv("", 0)) \ : newSV(0)) #endif /* Hint: gv_stashpvn * This function's backport doesn't support the length parameter, but * rather ignores it. Portability can only be ensured if the length * parameter is used for speed reasons, but the length can always be * correctly computed from the string argument. */ #ifndef gv_stashpvn # define gv_stashpvn(str,len,create) gv_stashpv(str,create) #endif /* Replace: 1 */ #ifndef get_cv # define get_cv perl_get_cv #endif #ifndef get_sv # define get_sv perl_get_sv #endif #ifndef get_av # define get_av perl_get_av #endif #ifndef get_hv # define get_hv perl_get_hv #endif /* Replace: 0 */ #ifdef HAS_MEMCMP #ifndef memNE # define memNE(s1,s2,l) (memcmp(s1,s2,l)) #endif #ifndef memEQ # define memEQ(s1,s2,l) (!memcmp(s1,s2,l)) #endif #else #ifndef memNE # define memNE(s1,s2,l) (bcmp(s1,s2,l)) #endif #ifndef memEQ # define memEQ(s1,s2,l) (!bcmp(s1,s2,l)) #endif #endif #ifndef MoveD # define MoveD(s,d,n,t) memmove((char*)(d),(char*)(s), (n) * sizeof(t)) #endif #ifndef CopyD # define CopyD(s,d,n,t) memcpy((char*)(d),(char*)(s), (n) * sizeof(t)) #endif #ifdef HAS_MEMSET #ifndef ZeroD # define ZeroD(d,n,t) memzero((char*)(d), (n) * sizeof(t)) #endif #else #ifndef ZeroD # define ZeroD(d,n,t) ((void)memzero((char*)(d), (n) * sizeof(t)),d) #endif #endif #ifndef Poison # define Poison(d,n,t) (void)memset((char*)(d), 0xAB, (n) * sizeof(t)) #endif #ifndef dUNDERBAR # define dUNDERBAR dNOOP #endif #ifndef UNDERBAR # define UNDERBAR DEFSV #endif #ifndef dAX # define dAX I32 ax = MARK - PL_stack_base + 1 #endif #ifndef dITEMS # define dITEMS I32 items = SP - MARK #endif #ifndef dXSTARG # define dXSTARG SV * targ = sv_newmortal() #endif #ifndef dTHR # define dTHR dNOOP #endif #ifndef dTHX # define dTHX dNOOP #endif #ifndef dTHXa # define dTHXa(x) dNOOP #endif #ifndef pTHX # define pTHX void #endif #ifndef pTHX_ # define pTHX_ #endif #ifndef aTHX # define aTHX #endif #ifndef aTHX_ # define aTHX_ #endif #ifndef dTHXoa # define dTHXoa(x) dTHXa(x) #endif #ifndef PUSHmortal # define PUSHmortal PUSHs(sv_newmortal()) #endif #ifndef mPUSHp # define mPUSHp(p,l) sv_setpvn_mg(PUSHmortal, (p), (l)) #endif #ifndef mPUSHn # define mPUSHn(n) sv_setnv_mg(PUSHmortal, (NV)(n)) #endif #ifndef mPUSHi # define mPUSHi(i) sv_setiv_mg(PUSHmortal, (IV)(i)) #endif #ifndef mPUSHu # define mPUSHu(u) sv_setuv_mg(PUSHmortal, (UV)(u)) #endif #ifndef XPUSHmortal # define XPUSHmortal XPUSHs(sv_newmortal()) #endif #ifndef mXPUSHp # define mXPUSHp(p,l) STMT_START { EXTEND(sp,1); sv_setpvn_mg(PUSHmortal, (p), (l)); } STMT_END #endif #ifndef mXPUSHn # define mXPUSHn(n) STMT_START { EXTEND(sp,1); sv_setnv_mg(PUSHmortal, (NV)(n)); } STMT_END #endif #ifndef mXPUSHi # define mXPUSHi(i) STMT_START { EXTEND(sp,1); sv_setiv_mg(PUSHmortal, (IV)(i)); } STMT_END #endif #ifndef mXPUSHu # define mXPUSHu(u) STMT_START { EXTEND(sp,1); sv_setuv_mg(PUSHmortal, (UV)(u)); } STMT_END #endif /* Replace: 1 */ #ifndef call_sv # define call_sv perl_call_sv #endif #ifndef call_pv # define call_pv perl_call_pv #endif #ifndef call_argv # define call_argv perl_call_argv #endif #ifndef call_method # define call_method perl_call_method #endif #ifndef eval_sv # define eval_sv perl_eval_sv #endif /* Replace: 0 */ /* Replace perl_eval_pv with eval_pv */ /* eval_pv depends on eval_sv */ #ifndef eval_pv #if defined(NEED_eval_pv) static SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error); static #else extern SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error); #endif #ifdef eval_pv # undef eval_pv #endif #define eval_pv(a,b) DPPP_(my_eval_pv)(aTHX_ a,b) #define Perl_eval_pv DPPP_(my_eval_pv) #if defined(NEED_eval_pv) || defined(NEED_eval_pv_GLOBAL) SV* DPPP_(my_eval_pv)(char *p, I32 croak_on_error) { dSP; SV* sv = newSVpv(p, 0); PUSHMARK(sp); eval_sv(sv, G_SCALAR); SvREFCNT_dec(sv); SPAGAIN; sv = POPs; PUTBACK; if (croak_on_error && SvTRUE(GvSV(errgv))) croak(SvPVx(GvSV(errgv), na)); return sv; } #endif #endif #ifndef newRV_inc # define newRV_inc(sv) newRV(sv) /* Replace */ #endif #ifndef newRV_noinc #if defined(NEED_newRV_noinc) static SV * DPPP_(my_newRV_noinc)(SV *sv); static #else extern SV * DPPP_(my_newRV_noinc)(SV *sv); #endif #ifdef newRV_noinc # undef newRV_noinc #endif #define newRV_noinc(a) DPPP_(my_newRV_noinc)(aTHX_ a) #define Perl_newRV_noinc DPPP_(my_newRV_noinc) #if defined(NEED_newRV_noinc) || defined(NEED_newRV_noinc_GLOBAL) SV * DPPP_(my_newRV_noinc)(SV *sv) { SV *rv = (SV *)newRV(sv); SvREFCNT_dec(sv); return rv; } #endif #endif /* Hint: newCONSTSUB * Returns a CV* as of perl-5.7.1. This return value is not supported * by Devel::PPPort. */ /* newCONSTSUB from IO.xs is in the core starting with 5.004_63 */ #if ((PERL_VERSION < 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION < 63))) && ((PERL_VERSION != 4) || (PERL_SUBVERSION != 5)) #if defined(NEED_newCONSTSUB) static void DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv); static #else extern void DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv); #endif #ifdef newCONSTSUB # undef newCONSTSUB #endif #define newCONSTSUB(a,b,c) DPPP_(my_newCONSTSUB)(aTHX_ a,b,c) #define Perl_newCONSTSUB DPPP_(my_newCONSTSUB) #if defined(NEED_newCONSTSUB) || defined(NEED_newCONSTSUB_GLOBAL) void DPPP_(my_newCONSTSUB)(HV *stash, char *name, SV *sv) { U32 oldhints = PL_hints; HV *old_cop_stash = PL_curcop->cop_stash; HV *old_curstash = PL_curstash; line_t oldline = PL_curcop->cop_line; PL_curcop->cop_line = PL_copline; PL_hints &= ~HINT_BLOCK_SCOPE; if (stash) PL_curstash = PL_curcop->cop_stash = stash; newSUB( #if ((PERL_VERSION < 3) || ((PERL_VERSION == 3) && (PERL_SUBVERSION < 22))) start_subparse(), #elif ((PERL_VERSION == 3) && (PERL_SUBVERSION == 22)) start_subparse(0), #else /* 5.003_23 onwards */ start_subparse(FALSE, 0), #endif newSVOP(OP_CONST, 0, newSVpv(name,0)), newSVOP(OP_CONST, 0, &PL_sv_no), /* SvPV(&PL_sv_no) == "" -- GMB */ newSTATEOP(0, Nullch, newSVOP(OP_CONST, 0, sv)) ); PL_hints = oldhints; PL_curcop->cop_stash = old_cop_stash; PL_curstash = old_curstash; PL_curcop->cop_line = oldline; } #endif #endif /* * Boilerplate macros for initializing and accessing interpreter-local * data from C. All statics in extensions should be reworked to use * this, if you want to make the extension thread-safe. See ext/re/re.xs * for an example of the use of these macros. * * Code that uses these macros is responsible for the following: * 1. #define MY_CXT_KEY to a unique string, e.g. "DynaLoader_guts" * 2. Declare a typedef named my_cxt_t that is a structure that contains * all the data that needs to be interpreter-local. * 3. Use the START_MY_CXT macro after the declaration of my_cxt_t. * 4. Use the MY_CXT_INIT macro such that it is called exactly once * (typically put in the BOOT: section). * 5. Use the members of the my_cxt_t structure everywhere as * MY_CXT.member. * 6. Use the dMY_CXT macro (a declaration) in all the functions that * access MY_CXT. */ #if defined(MULTIPLICITY) || defined(PERL_OBJECT) || \ defined(PERL_CAPI) || defined(PERL_IMPLICIT_CONTEXT) #ifndef START_MY_CXT /* This must appear in all extensions that define a my_cxt_t structure, * right after the definition (i.e. at file scope). The non-threads * case below uses it to declare the data as static. */ #define START_MY_CXT #if (PERL_VERSION < 4 || (PERL_VERSION == 4 && PERL_SUBVERSION < 68 )) /* Fetches the SV that keeps the per-interpreter data. */ #define dMY_CXT_SV \ SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE) #else /* >= perl5.004_68 */ #define dMY_CXT_SV \ SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY, \ sizeof(MY_CXT_KEY)-1, TRUE) #endif /* < perl5.004_68 */ /* This declaration should be used within all functions that use the * interpreter-local data. */ #define dMY_CXT \ dMY_CXT_SV; \ my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv)) /* Creates and zeroes the per-interpreter data. * (We allocate my_cxtp in a Perl SV so that it will be released when * the interpreter goes away.) */ #define MY_CXT_INIT \ dMY_CXT_SV; \ /* newSV() allocates one more than needed */ \ my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ Zero(my_cxtp, 1, my_cxt_t); \ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) /* This macro must be used to access members of the my_cxt_t structure. * e.g. MYCXT.some_data */ #define MY_CXT (*my_cxtp) /* Judicious use of these macros can reduce the number of times dMY_CXT * is used. Use is similar to pTHX, aTHX etc. */ #define pMY_CXT my_cxt_t *my_cxtp #define pMY_CXT_ pMY_CXT, #define _pMY_CXT ,pMY_CXT #define aMY_CXT my_cxtp #define aMY_CXT_ aMY_CXT, #define _aMY_CXT ,aMY_CXT #endif /* START_MY_CXT */ #ifndef MY_CXT_CLONE /* Clones the per-interpreter data. */ #define MY_CXT_CLONE \ dMY_CXT_SV; \ my_cxt_t *my_cxtp = (my_cxt_t*)SvPVX(newSV(sizeof(my_cxt_t)-1));\ Copy(INT2PTR(my_cxt_t*, SvUV(my_cxt_sv)), my_cxtp, 1, my_cxt_t);\ sv_setuv(my_cxt_sv, PTR2UV(my_cxtp)) #endif #else /* single interpreter */ #ifndef START_MY_CXT #define START_MY_CXT static my_cxt_t my_cxt; #define dMY_CXT_SV dNOOP #define dMY_CXT dNOOP #define MY_CXT_INIT NOOP #define MY_CXT my_cxt #define pMY_CXT void #define pMY_CXT_ #define _pMY_CXT #define aMY_CXT #define aMY_CXT_ #define _aMY_CXT #endif /* START_MY_CXT */ #ifndef MY_CXT_CLONE #define MY_CXT_CLONE NOOP #endif #endif #ifndef IVdf # if IVSIZE == LONGSIZE # define IVdf "ld" # define UVuf "lu" # define UVof "lo" # define UVxf "lx" # define UVXf "lX" # else # if IVSIZE == INTSIZE # define IVdf "d" # define UVuf "u" # define UVof "o" # define UVxf "x" # define UVXf "X" # endif # endif #endif #ifndef NVef # if defined(USE_LONG_DOUBLE) && defined(HAS_LONG_DOUBLE) && \ defined(PERL_PRIfldbl) /* Not very likely, but let's try anyway. */ # define NVef PERL_PRIeldbl # define NVff PERL_PRIfldbl # define NVgf PERL_PRIgldbl # else # define NVef "e" # define NVff "f" # define NVgf "g" # endif #endif #ifndef SvPV_nolen #if defined(NEED_sv_2pv_nolen) static char * DPPP_(my_sv_2pv_nolen)(pTHX_ register SV *sv); static #else extern char * DPPP_(my_sv_2pv_nolen)(pTHX_ register SV *sv); #endif #ifdef sv_2pv_nolen # undef sv_2pv_nolen #endif #define sv_2pv_nolen(a) DPPP_(my_sv_2pv_nolen)(aTHX_ a) #define Perl_sv_2pv_nolen DPPP_(my_sv_2pv_nolen) #if defined(NEED_sv_2pv_nolen) || defined(NEED_sv_2pv_nolen_GLOBAL) char * DPPP_(my_sv_2pv_nolen)(pTHX_ register SV *sv) { STRLEN n_a; return sv_2pv(sv, &n_a); } #endif /* Hint: sv_2pv_nolen * Use the SvPV_nolen() macro instead of sv_2pv_nolen(). */ /* SvPV_nolen depends on sv_2pv_nolen */ #define SvPV_nolen(sv) \ ((SvFLAGS(sv) & (SVf_POK)) == SVf_POK \ ? SvPVX(sv) : sv_2pv_nolen(sv)) #endif #ifdef SvPVbyte /* Hint: SvPVbyte * Does not work in perl-5.6.1, ppport.h implements a version * borrowed from perl-5.7.3. */ #if ((PERL_VERSION < 7) || ((PERL_VERSION == 7) && (PERL_SUBVERSION < 0))) #if defined(NEED_sv_2pvbyte) static char * DPPP_(my_sv_2pvbyte)(pTHX_ register SV *sv, STRLEN *lp); static #else extern char * DPPP_(my_sv_2pvbyte)(pTHX_ register SV *sv, STRLEN *lp); #endif #ifdef sv_2pvbyte # undef sv_2pvbyte #endif #define sv_2pvbyte(a,b) DPPP_(my_sv_2pvbyte)(aTHX_ a,b) #define Perl_sv_2pvbyte DPPP_(my_sv_2pvbyte) #if defined(NEED_sv_2pvbyte) || defined(NEED_sv_2pvbyte_GLOBAL) char * DPPP_(my_sv_2pvbyte)(pTHX_ register SV *sv, STRLEN *lp) { sv_utf8_downgrade(sv,0); return SvPV(sv,*lp); } #endif /* Hint: sv_2pvbyte * Use the SvPVbyte() macro instead of sv_2pvbyte(). */ #undef SvPVbyte /* SvPVbyte depends on sv_2pvbyte */ #define SvPVbyte(sv, lp) \ ((SvFLAGS(sv) & (SVf_POK|SVf_UTF8)) == (SVf_POK) \ ? ((lp = SvCUR(sv)), SvPVX(sv)) : sv_2pvbyte(sv, &lp)) #endif #else # define SvPVbyte SvPV # define sv_2pvbyte sv_2pv #endif /* sv_2pvbyte_nolen depends on sv_2pv_nolen */ #ifndef sv_2pvbyte_nolen # define sv_2pvbyte_nolen sv_2pv_nolen #endif /* Hint: sv_pvn * Always use the SvPV() macro instead of sv_pvn(). */ #ifndef sv_pvn # define sv_pvn(sv, len) SvPV(sv, len) #endif /* Hint: sv_pvn_force * Always use the SvPV_force() macro instead of sv_pvn_force(). */ #ifndef sv_pvn_force # define sv_pvn_force(sv, len) SvPV_force(sv, len) #endif #if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(vnewSVpvf) #if defined(NEED_vnewSVpvf) static SV * DPPP_(my_vnewSVpvf)(pTHX_ const char * pat, va_list * args); static #else extern SV * DPPP_(my_vnewSVpvf)(pTHX_ const char * pat, va_list * args); #endif #ifdef vnewSVpvf # undef vnewSVpvf #endif #define vnewSVpvf(a,b) DPPP_(my_vnewSVpvf)(aTHX_ a,b) #define Perl_vnewSVpvf DPPP_(my_vnewSVpvf) #if defined(NEED_vnewSVpvf) || defined(NEED_vnewSVpvf_GLOBAL) SV * DPPP_(my_vnewSVpvf)(pTHX_ const char *pat, va_list *args) { register SV *sv = newSV(0); sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); return sv; } #endif #endif /* sv_vcatpvf depends on sv_vcatpvfn */ #if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_vcatpvf) # define sv_vcatpvf(sv, pat, args) sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)) #endif /* sv_vsetpvf depends on sv_vsetpvfn */ #if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_vsetpvf) # define sv_vsetpvf(sv, pat, args) sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)) #endif /* sv_catpvf_mg depends on sv_vcatpvfn, sv_catpvf_mg_nocontext */ #if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_catpvf_mg) #if defined(NEED_sv_catpvf_mg) static void DPPP_(my_sv_catpvf_mg)(pTHX_ SV * sv, const char * pat, ...); static #else extern void DPPP_(my_sv_catpvf_mg)(pTHX_ SV * sv, const char * pat, ...); #endif #define Perl_sv_catpvf_mg DPPP_(my_sv_catpvf_mg) #if defined(NEED_sv_catpvf_mg) || defined(NEED_sv_catpvf_mg_GLOBAL) void DPPP_(my_sv_catpvf_mg)(pTHX_ SV *sv, const char *pat, ...) { va_list args; va_start(args, pat); sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); SvSETMAGIC(sv); va_end(args); } #endif #endif /* sv_catpvf_mg_nocontext depends on sv_vcatpvfn */ #ifdef PERL_IMPLICIT_CONTEXT #if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_catpvf_mg_nocontext) #if defined(NEED_sv_catpvf_mg_nocontext) static void DPPP_(my_sv_catpvf_mg_nocontext)(SV * sv, const char * pat, ...); static #else extern void DPPP_(my_sv_catpvf_mg_nocontext)(SV * sv, const char * pat, ...); #endif #define sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext) #define Perl_sv_catpvf_mg_nocontext DPPP_(my_sv_catpvf_mg_nocontext) #if defined(NEED_sv_catpvf_mg_nocontext) || defined(NEED_sv_catpvf_mg_nocontext_GLOBAL) void DPPP_(my_sv_catpvf_mg_nocontext)(SV *sv, const char *pat, ...) { dTHX; va_list args; va_start(args, pat); sv_vcatpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); SvSETMAGIC(sv); va_end(args); } #endif #endif #endif #ifndef sv_catpvf_mg # ifdef PERL_IMPLICIT_CONTEXT # define sv_catpvf_mg Perl_sv_catpvf_mg_nocontext # else # define sv_catpvf_mg Perl_sv_catpvf_mg # endif #endif /* sv_vcatpvf_mg depends on sv_vcatpvfn */ #if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_vcatpvf_mg) # define sv_vcatpvf_mg(sv, pat, args) \ STMT_START { \ sv_vcatpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \ SvSETMAGIC(sv); \ } STMT_END #endif /* sv_setpvf_mg depends on sv_vsetpvfn, sv_setpvf_mg_nocontext */ #if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_setpvf_mg) #if defined(NEED_sv_setpvf_mg) static void DPPP_(my_sv_setpvf_mg)(pTHX_ SV * sv, const char * pat, ...); static #else extern void DPPP_(my_sv_setpvf_mg)(pTHX_ SV * sv, const char * pat, ...); #endif #define Perl_sv_setpvf_mg DPPP_(my_sv_setpvf_mg) #if defined(NEED_sv_setpvf_mg) || defined(NEED_sv_setpvf_mg_GLOBAL) void DPPP_(my_sv_setpvf_mg)(pTHX_ SV *sv, const char *pat, ...) { va_list args; va_start(args, pat); sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); SvSETMAGIC(sv); va_end(args); } #endif #endif /* sv_setpvf_mg_nocontext depends on sv_vsetpvfn */ #ifdef PERL_IMPLICIT_CONTEXT #if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_setpvf_mg_nocontext) #if defined(NEED_sv_setpvf_mg_nocontext) static void DPPP_(my_sv_setpvf_mg_nocontext)(SV * sv, const char * pat, ...); static #else extern void DPPP_(my_sv_setpvf_mg_nocontext)(SV * sv, const char * pat, ...); #endif #define sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext) #define Perl_sv_setpvf_mg_nocontext DPPP_(my_sv_setpvf_mg_nocontext) #if defined(NEED_sv_setpvf_mg_nocontext) || defined(NEED_sv_setpvf_mg_nocontext_GLOBAL) void DPPP_(my_sv_setpvf_mg_nocontext)(SV *sv, const char *pat, ...) { dTHX; va_list args; va_start(args, pat); sv_vsetpvfn(sv, pat, strlen(pat), &args, Null(SV**), 0, Null(bool*)); SvSETMAGIC(sv); va_end(args); } #endif #endif #endif #ifndef sv_setpvf_mg # ifdef PERL_IMPLICIT_CONTEXT # define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext # else # define sv_setpvf_mg Perl_sv_setpvf_mg # endif #endif /* sv_vsetpvf_mg depends on sv_vsetpvfn */ #if ((PERL_VERSION > 4) || ((PERL_VERSION == 4) && (PERL_SUBVERSION >= 0))) && !defined(sv_vsetpvf_mg) # define sv_vsetpvf_mg(sv, pat, args) \ STMT_START { \ sv_vsetpvfn(sv, pat, strlen(pat), args, Null(SV**), 0, Null(bool*)); \ SvSETMAGIC(sv); \ } STMT_END #endif #ifndef SvGETMAGIC # define SvGETMAGIC(x) STMT_START { if (SvGMAGICAL(x)) mg_get(x); } STMT_END #endif #ifndef PERL_MAGIC_sv # define PERL_MAGIC_sv '\0' #endif #ifndef PERL_MAGIC_overload # define PERL_MAGIC_overload 'A' #endif #ifndef PERL_MAGIC_overload_elem # define PERL_MAGIC_overload_elem 'a' #endif #ifndef PERL_MAGIC_overload_table # define PERL_MAGIC_overload_table 'c' #endif #ifndef PERL_MAGIC_bm # define PERL_MAGIC_bm 'B' #endif #ifndef PERL_MAGIC_regdata # define PERL_MAGIC_regdata 'D' #endif #ifndef PERL_MAGIC_regdatum # define PERL_MAGIC_regdatum 'd' #endif #ifndef PERL_MAGIC_env # define PERL_MAGIC_env 'E' #endif #ifndef PERL_MAGIC_envelem # define PERL_MAGIC_envelem 'e' #endif #ifndef PERL_MAGIC_fm # define PERL_MAGIC_fm 'f' #endif #ifndef PERL_MAGIC_regex_global # define PERL_MAGIC_regex_global 'g' #endif #ifndef PERL_MAGIC_isa # define PERL_MAGIC_isa 'I' #endif #ifndef PERL_MAGIC_isaelem # define PERL_MAGIC_isaelem 'i' #endif #ifndef PERL_MAGIC_nkeys # define PERL_MAGIC_nkeys 'k' #endif #ifndef PERL_MAGIC_dbfile # define PERL_MAGIC_dbfile 'L' #endif #ifndef PERL_MAGIC_dbline # define PERL_MAGIC_dbline 'l' #endif #ifndef PERL_MAGIC_mutex # define PERL_MAGIC_mutex 'm' #endif #ifndef PERL_MAGIC_shared # define PERL_MAGIC_shared 'N' #endif #ifndef PERL_MAGIC_shared_scalar # define PERL_MAGIC_shared_scalar 'n' #endif #ifndef PERL_MAGIC_collxfrm # define PERL_MAGIC_collxfrm 'o' #endif #ifndef PERL_MAGIC_tied # define PERL_MAGIC_tied 'P' #endif #ifndef PERL_MAGIC_tiedelem # define PERL_MAGIC_tiedelem 'p' #endif #ifndef PERL_MAGIC_tiedscalar # define PERL_MAGIC_tiedscalar 'q' #endif #ifndef PERL_MAGIC_qr # define PERL_MAGIC_qr 'r' #endif #ifndef PERL_MAGIC_sig # define PERL_MAGIC_sig 'S' #endif #ifndef PERL_MAGIC_sigelem # define PERL_MAGIC_sigelem 's' #endif #ifndef PERL_MAGIC_taint # define PERL_MAGIC_taint 't' #endif #ifndef PERL_MAGIC_uvar # define PERL_MAGIC_uvar 'U' #endif #ifndef PERL_MAGIC_uvar_elem # define PERL_MAGIC_uvar_elem 'u' #endif #ifndef PERL_MAGIC_vstring # define PERL_MAGIC_vstring 'V' #endif #ifndef PERL_MAGIC_vec # define PERL_MAGIC_vec 'v' #endif #ifndef PERL_MAGIC_utf8 # define PERL_MAGIC_utf8 'w' #endif #ifndef PERL_MAGIC_substr # define PERL_MAGIC_substr 'x' #endif #ifndef PERL_MAGIC_defelem # define PERL_MAGIC_defelem 'y' #endif #ifndef PERL_MAGIC_glob # define PERL_MAGIC_glob '*' #endif #ifndef PERL_MAGIC_arylen # define PERL_MAGIC_arylen '#' #endif #ifndef PERL_MAGIC_pos # define PERL_MAGIC_pos '.' #endif #ifndef PERL_MAGIC_backref # define PERL_MAGIC_backref '<' #endif #ifndef PERL_MAGIC_ext # define PERL_MAGIC_ext '~' #endif /* That's the best we can do... */ #ifndef SvPV_force_nomg # define SvPV_force_nomg SvPV_force #endif #ifndef SvPV_nomg # define SvPV_nomg SvPV #endif #ifndef sv_catpvn_nomg # define sv_catpvn_nomg sv_catpvn #endif #ifndef sv_catsv_nomg # define sv_catsv_nomg sv_catsv #endif #ifndef sv_setsv_nomg # define sv_setsv_nomg sv_setsv #endif #ifndef sv_pvn_nomg # define sv_pvn_nomg sv_pvn #endif #ifndef SvIV_nomg # define SvIV_nomg SvIV #endif #ifndef SvUV_nomg # define SvUV_nomg SvUV #endif #ifndef sv_catpv_mg # define sv_catpv_mg(sv, ptr) \ STMT_START { \ SV *TeMpSv = sv; \ sv_catpv(TeMpSv,ptr); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_catpvn_mg # define sv_catpvn_mg(sv, ptr, len) \ STMT_START { \ SV *TeMpSv = sv; \ sv_catpvn(TeMpSv,ptr,len); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_catsv_mg # define sv_catsv_mg(dsv, ssv) \ STMT_START { \ SV *TeMpSv = dsv; \ sv_catsv(TeMpSv,ssv); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setiv_mg # define sv_setiv_mg(sv, i) \ STMT_START { \ SV *TeMpSv = sv; \ sv_setiv(TeMpSv,i); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setnv_mg # define sv_setnv_mg(sv, num) \ STMT_START { \ SV *TeMpSv = sv; \ sv_setnv(TeMpSv,num); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setpv_mg # define sv_setpv_mg(sv, ptr) \ STMT_START { \ SV *TeMpSv = sv; \ sv_setpv(TeMpSv,ptr); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setpvn_mg # define sv_setpvn_mg(sv, ptr, len) \ STMT_START { \ SV *TeMpSv = sv; \ sv_setpvn(TeMpSv,ptr,len); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setsv_mg # define sv_setsv_mg(dsv, ssv) \ STMT_START { \ SV *TeMpSv = dsv; \ sv_setsv(TeMpSv,ssv); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_setuv_mg # define sv_setuv_mg(sv, i) \ STMT_START { \ SV *TeMpSv = sv; \ sv_setuv(TeMpSv,i); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifndef sv_usepvn_mg # define sv_usepvn_mg(sv, ptr, len) \ STMT_START { \ SV *TeMpSv = sv; \ sv_usepvn(TeMpSv,ptr,len); \ SvSETMAGIC(TeMpSv); \ } STMT_END #endif #ifdef USE_ITHREADS #ifndef CopFILE # define CopFILE(c) ((c)->cop_file) #endif #ifndef CopFILEGV # define CopFILEGV(c) (CopFILE(c) ? gv_fetchfile(CopFILE(c)) : Nullgv) #endif #ifndef CopFILE_set # define CopFILE_set(c,pv) ((c)->cop_file = savepv(pv)) #endif #ifndef CopFILESV # define CopFILESV(c) (CopFILE(c) ? GvSV(gv_fetchfile(CopFILE(c))) : Nullsv) #endif #ifndef CopFILEAV # define CopFILEAV(c) (CopFILE(c) ? GvAV(gv_fetchfile(CopFILE(c))) : Nullav) #endif #ifndef CopSTASHPV # define CopSTASHPV(c) ((c)->cop_stashpv) #endif #ifndef CopSTASHPV_set # define CopSTASHPV_set(c,pv) ((c)->cop_stashpv = ((pv) ? savepv(pv) : Nullch)) #endif #ifndef CopSTASH # define CopSTASH(c) (CopSTASHPV(c) ? gv_stashpv(CopSTASHPV(c),GV_ADD) : Nullhv) #endif #ifndef CopSTASH_set # define CopSTASH_set(c,hv) CopSTASHPV_set(c, (hv) ? HvNAME(hv) : Nullch) #endif #ifndef CopSTASH_eq # define CopSTASH_eq(c,hv) ((hv) && (CopSTASHPV(c) == HvNAME(hv) \ || (CopSTASHPV(c) && HvNAME(hv) \ && strEQ(CopSTASHPV(c), HvNAME(hv))))) #endif #else #ifndef CopFILEGV # define CopFILEGV(c) ((c)->cop_filegv) #endif #ifndef CopFILEGV_set # define CopFILEGV_set(c,gv) ((c)->cop_filegv = (GV*)SvREFCNT_inc(gv)) #endif #ifndef CopFILE_set # define CopFILE_set(c,pv) CopFILEGV_set((c), gv_fetchfile(pv)) #endif #ifndef CopFILESV # define CopFILESV(c) (CopFILEGV(c) ? GvSV(CopFILEGV(c)) : Nullsv) #endif #ifndef CopFILEAV # define CopFILEAV(c) (CopFILEGV(c) ? GvAV(CopFILEGV(c)) : Nullav) #endif #ifndef CopFILE # define CopFILE(c) (CopFILESV(c) ? SvPVX(CopFILESV(c)) : Nullch) #endif #ifndef CopSTASH # define CopSTASH(c) ((c)->cop_stash) #endif #ifndef CopSTASH_set # define CopSTASH_set(c,hv) ((c)->cop_stash = (hv)) #endif #ifndef CopSTASHPV # define CopSTASHPV(c) (CopSTASH(c) ? HvNAME(CopSTASH(c)) : Nullch) #endif #ifndef CopSTASHPV_set # define CopSTASHPV_set(c,pv) CopSTASH_set((c), gv_stashpv(pv,GV_ADD)) #endif #ifndef CopSTASH_eq # define CopSTASH_eq(c,hv) (CopSTASH(c) == (hv)) #endif #endif /* USE_ITHREADS */ #ifndef IN_PERL_COMPILETIME # define IN_PERL_COMPILETIME (PL_curcop == &PL_compiling) #endif #ifndef IN_LOCALE_RUNTIME # define IN_LOCALE_RUNTIME (PL_curcop->op_private & HINT_LOCALE) #endif #ifndef IN_LOCALE_COMPILETIME # define IN_LOCALE_COMPILETIME (PL_hints & HINT_LOCALE) #endif #ifndef IN_LOCALE # define IN_LOCALE (IN_PERL_COMPILETIME ? IN_LOCALE_COMPILETIME : IN_LOCALE_RUNTIME) #endif #ifndef IS_NUMBER_IN_UV # define IS_NUMBER_IN_UV 0x01 #endif #ifndef IS_NUMBER_GREATER_THAN_UV_MAX # define IS_NUMBER_GREATER_THAN_UV_MAX 0x02 #endif #ifndef IS_NUMBER_NOT_INT # define IS_NUMBER_NOT_INT 0x04 #endif #ifndef IS_NUMBER_NEG # define IS_NUMBER_NEG 0x08 #endif #ifndef IS_NUMBER_INFINITY # define IS_NUMBER_INFINITY 0x10 #endif #ifndef IS_NUMBER_NAN # define IS_NUMBER_NAN 0x20 #endif /* GROK_NUMERIC_RADIX depends on grok_numeric_radix */ #ifndef GROK_NUMERIC_RADIX # define GROK_NUMERIC_RADIX(sp, send) grok_numeric_radix(sp, send) #endif #ifndef PERL_SCAN_GREATER_THAN_UV_MAX # define PERL_SCAN_GREATER_THAN_UV_MAX 0x02 #endif #ifndef PERL_SCAN_SILENT_ILLDIGIT # define PERL_SCAN_SILENT_ILLDIGIT 0x04 #endif #ifndef PERL_SCAN_ALLOW_UNDERSCORES # define PERL_SCAN_ALLOW_UNDERSCORES 0x01 #endif #ifndef PERL_SCAN_DISALLOW_PREFIX # define PERL_SCAN_DISALLOW_PREFIX 0x02 #endif #ifndef grok_numeric_radix #if defined(NEED_grok_numeric_radix) static bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send); static #else extern bool DPPP_(my_grok_numeric_radix)(pTHX_ const char ** sp, const char * send); #endif #ifdef grok_numeric_radix # undef grok_numeric_radix #endif #define grok_numeric_radix(a,b) DPPP_(my_grok_numeric_radix)(aTHX_ a,b) #define Perl_grok_numeric_radix DPPP_(my_grok_numeric_radix) #if defined(NEED_grok_numeric_radix) || defined(NEED_grok_numeric_radix_GLOBAL) bool DPPP_(my_grok_numeric_radix)(pTHX_ const char **sp, const char *send) { #ifdef USE_LOCALE_NUMERIC #ifdef PL_numeric_radix_sv if (PL_numeric_radix_sv && IN_LOCALE) { STRLEN len; char* radix = SvPV(PL_numeric_radix_sv, len); if (*sp + len <= send && memEQ(*sp, radix, len)) { *sp += len; return TRUE; } } #else /* older perls don't have PL_numeric_radix_sv so the radix * must manually be requested from locale.h */ #include dTHR; /* needed for older threaded perls */ struct lconv *lc = localeconv(); char *radix = lc->decimal_point; if (radix && IN_LOCALE) { STRLEN len = strlen(radix); if (*sp + len <= send && memEQ(*sp, radix, len)) { *sp += len; return TRUE; } } #endif /* PERL_VERSION */ #endif /* USE_LOCALE_NUMERIC */ /* always try "." if numeric radix didn't match because * we may have data from different locales mixed */ if (*sp < send && **sp == '.') { ++*sp; return TRUE; } return FALSE; } #endif #endif /* grok_number depends on grok_numeric_radix */ #ifndef grok_number #if defined(NEED_grok_number) static int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep); static #else extern int DPPP_(my_grok_number)(pTHX_ const char * pv, STRLEN len, UV * valuep); #endif #ifdef grok_number # undef grok_number #endif #define grok_number(a,b,c) DPPP_(my_grok_number)(aTHX_ a,b,c) #define Perl_grok_number DPPP_(my_grok_number) #if defined(NEED_grok_number) || defined(NEED_grok_number_GLOBAL) int DPPP_(my_grok_number)(pTHX_ const char *pv, STRLEN len, UV *valuep) { const char *s = pv; const char *send = pv + len; const UV max_div_10 = UV_MAX / 10; const char max_mod_10 = UV_MAX % 10; int numtype = 0; int sawinf = 0; int sawnan = 0; while (s < send && isSPACE(*s)) s++; if (s == send) { return 0; } else if (*s == '-') { s++; numtype = IS_NUMBER_NEG; } else if (*s == '+') s++; if (s == send) return 0; /* next must be digit or the radix separator or beginning of infinity */ if (isDIGIT(*s)) { /* UVs are at least 32 bits, so the first 9 decimal digits cannot overflow. */ UV value = *s - '0'; /* This construction seems to be more optimiser friendly. (without it gcc does the isDIGIT test and the *s - '0' separately) With it gcc on arm is managing 6 instructions (6 cycles) per digit. In theory the optimiser could deduce how far to unroll the loop before checking for overflow. */ if (++s < send) { int digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { digit = *s - '0'; if (digit >= 0 && digit <= 9) { value = value * 10 + digit; if (++s < send) { /* Now got 9 digits, so need to check each time for overflow. */ digit = *s - '0'; while (digit >= 0 && digit <= 9 && (value < max_div_10 || (value == max_div_10 && digit <= max_mod_10))) { value = value * 10 + digit; if (++s < send) digit = *s - '0'; else break; } if (digit >= 0 && digit <= 9 && (s < send)) { /* value overflowed. skip the remaining digits, don't worry about setting *valuep. */ do { s++; } while (s < send && isDIGIT(*s)); numtype |= IS_NUMBER_GREATER_THAN_UV_MAX; goto skip_value; } } } } } } } } } } } } } } } } } } numtype |= IS_NUMBER_IN_UV; if (valuep) *valuep = value; skip_value: if (GROK_NUMERIC_RADIX(&s, send)) { numtype |= IS_NUMBER_NOT_INT; while (s < send && isDIGIT(*s)) /* optional digits after the radix */ s++; } } else if (GROK_NUMERIC_RADIX(&s, send)) { numtype |= IS_NUMBER_NOT_INT | IS_NUMBER_IN_UV; /* valuep assigned below */ /* no digits before the radix means we need digits after it */ if (s < send && isDIGIT(*s)) { do { s++; } while (s < send && isDIGIT(*s)); if (valuep) { /* integer approximation is valid - it's 0. */ *valuep = 0; } } else return 0; } else if (*s == 'I' || *s == 'i') { s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; s++; if (s == send || (*s != 'F' && *s != 'f')) return 0; s++; if (s < send && (*s == 'I' || *s == 'i')) { s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; s++; if (s == send || (*s != 'I' && *s != 'i')) return 0; s++; if (s == send || (*s != 'T' && *s != 't')) return 0; s++; if (s == send || (*s != 'Y' && *s != 'y')) return 0; s++; } sawinf = 1; } else if (*s == 'N' || *s == 'n') { /* XXX TODO: There are signaling NaNs and quiet NaNs. */ s++; if (s == send || (*s != 'A' && *s != 'a')) return 0; s++; if (s == send || (*s != 'N' && *s != 'n')) return 0; s++; sawnan = 1; } else return 0; if (sawinf) { numtype &= IS_NUMBER_NEG; /* Keep track of sign */ numtype |= IS_NUMBER_INFINITY | IS_NUMBER_NOT_INT; } else if (sawnan) { numtype &= IS_NUMBER_NEG; /* Keep track of sign */ numtype |= IS_NUMBER_NAN | IS_NUMBER_NOT_INT; } else if (s < send) { /* we can have an optional exponent part */ if (*s == 'e' || *s == 'E') { /* The only flag we keep is sign. Blow away any "it's UV" */ numtype &= IS_NUMBER_NEG; numtype |= IS_NUMBER_NOT_INT; s++; if (s < send && (*s == '-' || *s == '+')) s++; if (s < send && isDIGIT(*s)) { do { s++; } while (s < send && isDIGIT(*s)); } else return 0; } } while (s < send && isSPACE(*s)) s++; if (s >= send) return numtype; if (len == 10 && memEQ(pv, "0 but true", 10)) { if (valuep) *valuep = 0; return IS_NUMBER_IN_UV; } return 0; } #endif #endif /* * The grok_* routines have been modified to use warn() instead of * Perl_warner(). Also, 'hexdigit' was the former name of PL_hexdigit, * which is why the stack variable has been renamed to 'xdigit'. */ #ifndef grok_bin #if defined(NEED_grok_bin) static UV DPPP_(my_grok_bin)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); static #else extern UV DPPP_(my_grok_bin)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); #endif #ifdef grok_bin # undef grok_bin #endif #define grok_bin(a,b,c,d) DPPP_(my_grok_bin)(aTHX_ a,b,c,d) #define Perl_grok_bin DPPP_(my_grok_bin) #if defined(NEED_grok_bin) || defined(NEED_grok_bin_GLOBAL) UV DPPP_(my_grok_bin)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; UV value = 0; NV value_nv = 0; const UV max_div_2 = UV_MAX / 2; bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; bool overflowed = FALSE; if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) { /* strip off leading b or 0b. for compatibility silently suffer "b" and "0b" as valid binary numbers. */ if (len >= 1) { if (s[0] == 'b') { s++; len--; } else if (len >= 2 && s[0] == '0' && s[1] == 'b') { s+=2; len-=2; } } } for (; len-- && *s; s++) { char bit = *s; if (bit == '0' || bit == '1') { /* Write it in this wonky order with a goto to attempt to get the compiler to make the common case integer-only loop pretty tight. With gcc seems to be much straighter code than old scan_bin. */ redo: if (!overflowed) { if (value <= max_div_2) { value = (value << 1) | (bit - '0'); continue; } /* Bah. We're just overflowed. */ warn("Integer overflow in binary number"); overflowed = TRUE; value_nv = (NV) value; } value_nv *= 2.0; /* If an NV has not enough bits in its mantissa to * represent a UV this summing of small low-order numbers * is a waste of time (because the NV cannot preserve * the low-order bits anyway): we could just remember when * did we overflow and in the end just multiply value_nv by the * right amount. */ value_nv += (NV)(bit - '0'); continue; } if (bit == '_' && len && allow_underscores && (bit = s[1]) && (bit == '0' || bit == '1')) { --len; ++s; goto redo; } if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) warn("Illegal binary digit '%c' ignored", *s); break; } if ( ( overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 || (!overflowed && value > 0xffffffff ) #endif ) { warn("Binary number > 0b11111111111111111111111111111111 non-portable"); } *len_p = s - start; if (!overflowed) { *flags = 0; return value; } *flags = PERL_SCAN_GREATER_THAN_UV_MAX; if (result) *result = value_nv; return UV_MAX; } #endif #endif #ifndef grok_hex #if defined(NEED_grok_hex) static UV DPPP_(my_grok_hex)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); static #else extern UV DPPP_(my_grok_hex)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); #endif #ifdef grok_hex # undef grok_hex #endif #define grok_hex(a,b,c,d) DPPP_(my_grok_hex)(aTHX_ a,b,c,d) #define Perl_grok_hex DPPP_(my_grok_hex) #if defined(NEED_grok_hex) || defined(NEED_grok_hex_GLOBAL) UV DPPP_(my_grok_hex)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; UV value = 0; NV value_nv = 0; const UV max_div_16 = UV_MAX / 16; bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; bool overflowed = FALSE; const char *xdigit; if (!(*flags & PERL_SCAN_DISALLOW_PREFIX)) { /* strip off leading x or 0x. for compatibility silently suffer "x" and "0x" as valid hex numbers. */ if (len >= 1) { if (s[0] == 'x') { s++; len--; } else if (len >= 2 && s[0] == '0' && s[1] == 'x') { s+=2; len-=2; } } } for (; len-- && *s; s++) { xdigit = strchr((char *) PL_hexdigit, *s); if (xdigit) { /* Write it in this wonky order with a goto to attempt to get the compiler to make the common case integer-only loop pretty tight. With gcc seems to be much straighter code than old scan_hex. */ redo: if (!overflowed) { if (value <= max_div_16) { value = (value << 4) | ((xdigit - PL_hexdigit) & 15); continue; } warn("Integer overflow in hexadecimal number"); overflowed = TRUE; value_nv = (NV) value; } value_nv *= 16.0; /* If an NV has not enough bits in its mantissa to * represent a UV this summing of small low-order numbers * is a waste of time (because the NV cannot preserve * the low-order bits anyway): we could just remember when * did we overflow and in the end just multiply value_nv by the * right amount of 16-tuples. */ value_nv += (NV)((xdigit - PL_hexdigit) & 15); continue; } if (*s == '_' && len && allow_underscores && s[1] && (xdigit = strchr((char *) PL_hexdigit, s[1]))) { --len; ++s; goto redo; } if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) warn("Illegal hexadecimal digit '%c' ignored", *s); break; } if ( ( overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 || (!overflowed && value > 0xffffffff ) #endif ) { warn("Hexadecimal number > 0xffffffff non-portable"); } *len_p = s - start; if (!overflowed) { *flags = 0; return value; } *flags = PERL_SCAN_GREATER_THAN_UV_MAX; if (result) *result = value_nv; return UV_MAX; } #endif #endif #ifndef grok_oct #if defined(NEED_grok_oct) static UV DPPP_(my_grok_oct)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); static #else extern UV DPPP_(my_grok_oct)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result); #endif #ifdef grok_oct # undef grok_oct #endif #define grok_oct(a,b,c,d) DPPP_(my_grok_oct)(aTHX_ a,b,c,d) #define Perl_grok_oct DPPP_(my_grok_oct) #if defined(NEED_grok_oct) || defined(NEED_grok_oct_GLOBAL) UV DPPP_(my_grok_oct)(pTHX_ char *start, STRLEN *len_p, I32 *flags, NV *result) { const char *s = start; STRLEN len = *len_p; UV value = 0; NV value_nv = 0; const UV max_div_8 = UV_MAX / 8; bool allow_underscores = *flags & PERL_SCAN_ALLOW_UNDERSCORES; bool overflowed = FALSE; for (; len-- && *s; s++) { /* gcc 2.95 optimiser not smart enough to figure that this subtraction out front allows slicker code. */ int digit = *s - '0'; if (digit >= 0 && digit <= 7) { /* Write it in this wonky order with a goto to attempt to get the compiler to make the common case integer-only loop pretty tight. */ redo: if (!overflowed) { if (value <= max_div_8) { value = (value << 3) | digit; continue; } /* Bah. We're just overflowed. */ warn("Integer overflow in octal number"); overflowed = TRUE; value_nv = (NV) value; } value_nv *= 8.0; /* If an NV has not enough bits in its mantissa to * represent a UV this summing of small low-order numbers * is a waste of time (because the NV cannot preserve * the low-order bits anyway): we could just remember when * did we overflow and in the end just multiply value_nv by the * right amount of 8-tuples. */ value_nv += (NV)digit; continue; } if (digit == ('_' - '0') && len && allow_underscores && (digit = s[1] - '0') && (digit >= 0 && digit <= 7)) { --len; ++s; goto redo; } /* Allow \octal to work the DWIM way (that is, stop scanning * as soon as non-octal characters are seen, complain only iff * someone seems to want to use the digits eight and nine). */ if (digit == 8 || digit == 9) { if (!(*flags & PERL_SCAN_SILENT_ILLDIGIT)) warn("Illegal octal digit '%c' ignored", *s); } break; } if ( ( overflowed && value_nv > 4294967295.0) #if UVSIZE > 4 || (!overflowed && value > 0xffffffff ) #endif ) { warn("Octal number > 037777777777 non-portable"); } *len_p = s - start; if (!overflowed) { *flags = 0; return value; } *flags = PERL_SCAN_GREATER_THAN_UV_MAX; if (result) *result = value_nv; return UV_MAX; } #endif #endif #ifdef NO_XSLOCKS # ifdef dJMPENV # define dXCPT dJMPENV; int rEtV = 0 # define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0) # define XCPT_TRY_END JMPENV_POP; # define XCPT_CATCH if (rEtV != 0) # define XCPT_RETHROW JMPENV_JUMP(rEtV) # else # define dXCPT Sigjmp_buf oldTOP; int rEtV = 0 # define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0) # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf); # define XCPT_CATCH if (rEtV != 0) # define XCPT_RETHROW Siglongjmp(top_env, rEtV) # endif #endif #endif /* _P_P_PORTABILITY_H_ */ /* End of File ppport.h */ zbar-0.10/perl/Changes0000644000000000000000000000046311270371414011517 00000000000000Revision history for Perl extension Barcode::ZBar. 0.02 2009-04-16 spadix * project name change: package becomes Barcode::ZBar 0.01 2009-02-28 spadix * add Barcode:: namespace prefix * add a few new/missing APIs * add most documentation * first draft: Processor, Scanner and Decoder basic function zbar-0.10/qt/0000777000000000000000000000000011270371535007773 500000000000000zbar-0.10/qt/QZBarThread.h0000644000000000000000000000762611270371414012176 00000000000000//------------------------------------------------------------------------ // Copyright 2008-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #ifndef _QZBARTHREAD_H_ #define _QZBARTHREAD_H_ #include #include #include #include #include #include #include #define DEFAULT_WIDTH 640 #define DEFAULT_HEIGHT 480 namespace zbar { class QZBarThread : public QThread, public Image::Handler { Q_OBJECT public: enum EventType { VideoDevice = QEvent::User, VideoEnabled, ScanImage, Exit = QEvent::MaxUser }; class VideoDeviceEvent : public QEvent { public: VideoDeviceEvent (const QString &device) : QEvent((QEvent::Type)VideoDevice), device(device) { } const QString device; }; class VideoEnabledEvent : public QEvent { public: VideoEnabledEvent (bool enabled) : QEvent((QEvent::Type)VideoEnabled), enabled(enabled) { } bool enabled; }; class ScanImageEvent : public QEvent { public: ScanImageEvent (const QImage &image) : QEvent((QEvent::Type)ScanImage), image(image) { } const QImage image; }; QMutex mutex; QWaitCondition newEvent; // message queue for events passed from main gui thread to processor. // (NB could(/should?) be QAbstractEventDispatcher except it doesn't // work as documented!? ): // protected by mutex QList queue; // shared state: // written by processor thread just after opening video or // scanning an image, read by main gui thread during size_request. // protected by mutex bool _videoOpened; unsigned reqWidth, reqHeight; // window is also shared: owned by main gui thread. // processor thread only calls draw(), clear() and negotiate_format(). // protected by its own internal lock Window window; QZBarThread(); void pushEvent (QEvent *e) { QMutexLocker locker(&mutex); queue.append(e); newEvent.wakeOne(); } Q_SIGNALS: void videoOpened(bool opened); void update(); void decoded(int type, const QString &data); void decodedText(const QString &data); protected: void run(); void openVideo(const QString &device); void enableVideo(bool enable); void processImage(Image &image); void clear () { window.clear(); if(image) { delete image; image = NULL; } } virtual void image_callback(Image &image); virtual bool event(QEvent *e); virtual void videoDeviceEvent(VideoDeviceEvent *event); virtual void videoEnabledEvent(VideoEnabledEvent *event); virtual void scanImageEvent(ScanImageEvent *event); private: Video *video; ImageScanner scanner; QZBarImage *image; bool running; bool videoRunning; bool videoEnabled; }; }; #endif zbar-0.10/qt/QZBarThread.cpp0000644000000000000000000001361111270371414012520 00000000000000//------------------------------------------------------------------------ // Copyright 2008-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #include #include "QZBarThread.h" using namespace zbar; static const QString textFormat("%1%2:%3"); QZBarThread::QZBarThread () : _videoOpened(false), reqWidth(DEFAULT_WIDTH), reqHeight(DEFAULT_HEIGHT), video(NULL), image(NULL), running(true), videoRunning(false), videoEnabled(false) { scanner.set_handler(*this); } void QZBarThread::image_callback (Image &image) { for(Image::SymbolIterator sym = image.symbol_begin(); sym != image.symbol_end(); ++sym) if(!sym->get_count()) { QString data = QString::fromStdString(sym->get_data()); emit decoded(sym->get_type(), data); emit decodedText(textFormat.arg( QString::fromStdString(sym->get_type_name()), QString::fromStdString(sym->get_addon_name()), data)); } } void QZBarThread::processImage (Image &image) { { scanner.recycle_image(image); Image tmp = image.convert(*(long*)"Y800"); scanner.scan(tmp); image.set_symbols(tmp.get_symbols()); } window.draw(image); if(this->image && this->image != &image) { delete this->image; this->image = NULL; } emit update(); } void QZBarThread::enableVideo (bool enable) { if(!video) { videoRunning = videoEnabled = false; return; } try { scanner.enable_cache(enable); video->enable(enable); videoRunning = enable; } catch(std::exception &e) { std::cerr << "ERROR: " << e.what() << std::endl; } if(!enable) { // release video image and revert to logo clear(); emit update(); } } void QZBarThread::openVideo (const QString &device) { if(videoRunning) enableVideo(false); { QMutexLocker locker(&mutex); videoEnabled = _videoOpened = false; reqWidth = DEFAULT_WIDTH; reqHeight = DEFAULT_HEIGHT; } // ensure old video doesn't have image ref // (FIXME handle video destroyed w/images outstanding) clear(); emit update(); if(video) { delete video; video = NULL; emit videoOpened(false); } if(device.isEmpty()) return; try { std::string devstr = device.toStdString(); video = new Video(devstr); negotiate_format(*video, window); { QMutexLocker locker(&mutex); videoEnabled = _videoOpened = true; reqWidth = video->get_width(); reqHeight = video->get_height(); } emit videoOpened(true); } catch(std::exception &e) { std::cerr << "ERROR: " << e.what() << std::endl; emit videoOpened(false); } } void QZBarThread::videoDeviceEvent (VideoDeviceEvent *e) { openVideo(e->device); } void QZBarThread::videoEnabledEvent (VideoEnabledEvent *e) { if(videoRunning && !e->enabled) enableVideo(false); videoEnabled = e->enabled; } void QZBarThread::scanImageEvent (ScanImageEvent *e) { if(videoRunning) enableVideo(false); try { image = new QZBarImage(e->image); processImage(*image); } catch(std::exception &e) { std::cerr << "ERROR: " << e.what() << std::endl; clear(); } } bool QZBarThread::event (QEvent *e) { switch(e->type()) { case VideoDevice: videoDeviceEvent((VideoDeviceEvent*)e); break; case VideoEnabled: videoEnabledEvent((VideoEnabledEvent*)e); break; case ScanImage: scanImageEvent((ScanImageEvent*)e); break; case Exit: if(videoRunning) enableVideo(false); running = false; break; default: return(false); } return(true); } void QZBarThread::run () { QEvent *e = NULL; while(running) { if(!videoEnabled) { QMutexLocker locker(&mutex); while(queue.isEmpty()) newEvent.wait(&mutex); e = queue.takeFirst(); } else { // release reference to any previous QImage clear(); enableVideo(true); while(videoRunning && !e) { try { Image image = video->next_image(); processImage(image); } catch(std::exception &e) { std::cerr << "ERROR: " << e.what() << std::endl; enableVideo(false); openVideo(""); } QMutexLocker locker(&mutex); if(!queue.isEmpty()) e = queue.takeFirst(); } if(videoRunning) enableVideo(false); } if(e) { event(e); delete e; e = NULL; } } clear(); openVideo(""); } zbar-0.10/qt/Makefile.am.inc0000644000000000000000000000116511270371414012512 00000000000000lib_LTLIBRARIES += qt/libzbarqt.la qt_libzbarqt_la_CPPFLAGS = -Iqt $(QT_CFLAGS) $(AM_CPPFLAGS) qt_libzbarqt_la_LDFLAGS = -version-info $(ZQT_LIB_VERSION) $(AM_LDFLAGS) qt_libzbarqt_la_LIBADD = $(QT_LIBS) zbar/libzbar.la $(AM_LIBADD) qt_libzbarqt_la_SOURCES = qt/QZBar.cpp qt/QZBarThread.h qt/QZBarThread.cpp nodist_qt_libzbarqt_la_SOURCES = qt/moc_QZBar.cpp qt/moc_QZBarThread.cpp BUILT_SOURCES += $(nodist_qt_libzbarqt_la_SOURCES) DISTCLEANFILES += $(nodist_qt_libzbarqt_la_SOURCES) qt/moc_%.cpp: qt/%.h $(MOC) $(qt_libzbarqt_la_CPPFLAGS) $< -o $@ qt/moc_%.cpp: include/zbar/%.h $(MOC) $(qt_libzbarqt_la_CPPFLAGS) $< -o $@ zbar-0.10/qt/QZBar.cpp0000644000000000000000000001441111270371414011367 00000000000000//------------------------------------------------------------------------ // Copyright 2008-2009 (c) Jeff Brown // // This file is part of the ZBar Bar Code Reader. // // The ZBar Bar Code Reader is free software; you can redistribute it // and/or modify it under the terms of the GNU Lesser Public License as // published by the Free Software Foundation; either version 2.1 of // the License, or (at your option) any later version. // // The ZBar Bar Code Reader is distributed in the hope that it will be // useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU Lesser Public License for more details. // // You should have received a copy of the GNU Lesser Public License // along with the ZBar Bar Code Reader; if not, write to the Free // Software Foundation, Inc., 51 Franklin St, Fifth Floor, // Boston, MA 02110-1301 USA // // http://sourceforge.net/projects/zbar //------------------------------------------------------------------------ #include #include #include #include #include "QZBarThread.h" using namespace zbar; QZBar::QZBar (QWidget *parent) : QWidget(parent), thread(NULL), _videoDevice(), _videoEnabled(false), _attached(false) { setAttribute(Qt::WA_OpaquePaintEvent); setAttribute(Qt::WA_PaintOnScreen); #if QT_VERSION >= 0x040400 setAttribute(Qt::WA_NativeWindow); setAttribute(Qt::WA_DontCreateNativeAncestors); #endif QSizePolicy sizing(QSizePolicy::Preferred, QSizePolicy::Preferred); sizing.setHeightForWidth(true); setSizePolicy(sizing); thread = new QZBarThread; if(testAttribute(Qt::WA_WState_Created)) { thread->window.attach(x11Info().display(), winId()); _attached = 1; } connect(thread, SIGNAL(videoOpened(bool)), this, SIGNAL(videoOpened(bool))); connect(this, SIGNAL(videoOpened(bool)), this, SLOT(sizeChange())); connect(thread, SIGNAL(update()), this, SLOT(update())); connect(thread, SIGNAL(decoded(int, const QString&)), this, SIGNAL(decoded(int, const QString&))); connect(thread, SIGNAL(decodedText(const QString&)), this, SIGNAL(decodedText(const QString&))); thread->start(); } QZBar::~QZBar () { if(thread) { thread->pushEvent(new QEvent((QEvent::Type)QZBarThread::Exit)); thread->wait(); delete thread; thread = NULL; } } QPaintEngine *QZBar::paintEngine () const { return(NULL); } QString QZBar::videoDevice () const { return(_videoDevice); } void QZBar::setVideoDevice (const QString& videoDevice) { if(!thread) return; if(_videoDevice != videoDevice) { _videoDevice = videoDevice; _videoEnabled = _attached && !videoDevice.isEmpty(); if(_attached) thread->pushEvent(new QZBarThread::VideoDeviceEvent(videoDevice)); } } bool QZBar::isVideoEnabled () const { return(_videoEnabled); } void QZBar::setVideoEnabled (bool videoEnabled) { if(!thread) return; if(_videoEnabled != videoEnabled) { _videoEnabled = videoEnabled; thread->pushEvent(new QZBarThread::VideoEnabledEvent(videoEnabled)); } } bool QZBar::isVideoOpened () const { if(!thread) return(false); QMutexLocker locker(&thread->mutex); return(thread->_videoOpened); } void QZBar::scanImage (const QImage &image) { if(!thread) return; thread->pushEvent(new QZBarThread::ScanImageEvent(image)); } void QZBar::dragEnterEvent (QDragEnterEvent *event) { if(event->mimeData()->hasImage() || event->mimeData()->hasUrls()) event->acceptProposedAction(); } void QZBar::dropEvent (QDropEvent *event) { if(event->mimeData()->hasImage()) { QImage image = qvariant_cast(event->mimeData()->imageData()); scanImage(image); event->setDropAction(Qt::CopyAction); event->accept(); } else { // FIXME TBD load URIs and queue for processing #if 0 std::cerr << "drop: " << event->mimeData()->formats().join(", ").toStdString() << std::endl; QList urls = event->mimeData()->urls(); for(int i = 0; i < urls.size(); ++i) std::cerr << "[" << i << "] " << urls.at(i).toString().toStdString() << std::endl; #endif } } QSize QZBar::sizeHint () const { if(!thread) return(QSize(640, 480)); QMutexLocker locker(&thread->mutex); return(QSize(thread->reqWidth, thread->reqHeight)); } int QZBar::heightForWidth (int width) const { if(thread) { QMutexLocker locker(&thread->mutex); int base_width = thread->reqWidth; int base_height = thread->reqHeight; if(base_width > 0 && base_height > 0) return(base_height * width / base_width); } return(width * 3 / 4); } void QZBar::paintEvent (QPaintEvent *event) { try { if(thread) thread->window.redraw(); } catch(Exception) { // sometimes Qt attempts to paint the widget before it's parented(?) // just ignore this (can't throw from event anyway) } } void QZBar::resizeEvent (QResizeEvent *event) { QSize size = event->size(); try { if(thread) thread->window.resize(size.rwidth(), size.rheight()); } catch(Exception) { /* ignore */ } } void QZBar::changeEvent(QEvent *event) { try { QMutexLocker locker(&thread->mutex); if(event->type() == QEvent::ParentChange) thread->window.attach(x11Info().display(), winId()); } catch(Exception) { /* ignore (FIXME do something w/error) */ } } void QZBar::attach () { if(_attached) return; try { thread->window.attach(x11Info().display(), winId()); _attached = 1; _videoEnabled = !_videoDevice.isEmpty(); if(_videoEnabled) thread->pushEvent(new QZBarThread::VideoDeviceEvent(_videoDevice)); } catch(Exception) { /* ignore (FIXME do something w/error) */ } } void QZBar::showEvent (QShowEvent *event) { if(thread && !_attached) attach(); } void QZBar::sizeChange () { update(); updateGeometry(); } zbar-0.10/python/0000777000000000000000000000000011270371535010670 500000000000000zbar-0.10/python/decoder.c0000644000000000000000000002060011270371414012347 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" static char decoder_doc[] = PyDoc_STR( "low level decode of measured bar/space widths.\n" "\n" "FIXME."); static zbarDecoder* decoder_new (PyTypeObject *type, PyObject *args, PyObject *kwds) { static char *kwlist[] = { NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist)) return(NULL); zbarDecoder *self = (zbarDecoder*)type->tp_alloc(type, 0); if(!self) return(NULL); self->zdcode = zbar_decoder_create(); zbar_decoder_set_userdata(self->zdcode, self); if(!self->zdcode) { Py_DECREF(self); return(NULL); } return(self); } static int decoder_traverse (zbarDecoder *self, visitproc visit, void *arg) { Py_VISIT(self->handler); Py_VISIT(self->args); return(0); } static int decoder_clear (zbarDecoder *self) { zbar_decoder_set_handler(self->zdcode, NULL); zbar_decoder_set_userdata(self->zdcode, NULL); Py_CLEAR(self->handler); Py_CLEAR(self->args); return(0); } static void decoder_dealloc (zbarDecoder *self) { decoder_clear(self); zbar_decoder_destroy(self->zdcode); ((PyObject*)self)->ob_type->tp_free((PyObject*)self); } static zbarEnumItem* decoder_get_color (zbarDecoder *self, void *closure) { zbar_color_t zcol = zbar_decoder_get_color(self->zdcode); assert(zcol == ZBAR_BAR || zcol == ZBAR_SPACE); zbarEnumItem *color = color_enum[zcol]; Py_INCREF((PyObject*)color); return(color); } static zbarEnumItem* decoder_get_type (zbarDecoder *self, void *closure) { zbar_symbol_type_t sym = zbar_decoder_get_type(self->zdcode); if(sym == ZBAR_NONE) { /* hardcode most common case */ Py_INCREF((PyObject*)symbol_NONE); return(symbol_NONE); } return(zbarSymbol_LookupEnum(sym)); } static PyObject* decoder_get_data (zbarDecoder *self, void *closure) { return(PyString_FromStringAndSize(zbar_decoder_get_data(self->zdcode), zbar_decoder_get_data_length(self->zdcode))); } static PyGetSetDef decoder_getset[] = { { "color", (getter)decoder_get_color, }, { "type", (getter)decoder_get_type, }, { "data", (getter)decoder_get_data, }, { NULL, }, }; static PyObject* decoder_set_config (zbarDecoder *self, PyObject *args, PyObject *kwds) { zbar_symbol_type_t sym = ZBAR_NONE; zbar_config_t cfg = ZBAR_CFG_ENABLE; int val = 1; static char *kwlist[] = { "symbology", "config", "value", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|iii", kwlist, &sym, &cfg, &val)) return(NULL); if(zbar_decoder_set_config(self->zdcode, sym, cfg, val)) { PyErr_SetString(PyExc_ValueError, "invalid configuration setting"); return(NULL); } Py_RETURN_NONE; } static PyObject* decoder_parse_config (zbarDecoder *self, PyObject *args, PyObject *kwds) { const char *cfg = NULL; static char *kwlist[] = { "config", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &cfg)) return(NULL); if(zbar_decoder_parse_config(self->zdcode, cfg)) { PyErr_Format(PyExc_ValueError, "invalid configuration setting: %s", cfg); return(NULL); } Py_RETURN_NONE; } static PyObject* decoder_reset (zbarDecoder *self, PyObject *args, PyObject *kwds) { static char *kwlist[] = { NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist)) return(NULL); zbar_decoder_reset(self->zdcode); Py_RETURN_NONE; } static PyObject* decoder_new_scan (zbarDecoder *self, PyObject *args, PyObject *kwds) { static char *kwlist[] = { NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist)) return(NULL); zbar_decoder_new_scan(self->zdcode); Py_RETURN_NONE; } void decode_handler (zbar_decoder_t *zdcode) { assert(zdcode); zbarDecoder *self = zbar_decoder_get_userdata(zdcode); assert(self); assert(self->zdcode == zdcode); assert(self->handler); assert(self->args); PyObject *junk = PyObject_Call(self->handler, self->args, NULL); Py_XDECREF(junk); } static PyObject* decoder_set_handler (zbarDecoder *self, PyObject *args, PyObject *kwds) { PyObject *handler = Py_None; PyObject *closure = Py_None; static char *kwlist[] = { "handler", "closure", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist, &handler, &closure)) return(NULL); if(handler != Py_None && !PyCallable_Check(handler)) { PyErr_Format(PyExc_ValueError, "handler %.50s is not callable", handler->ob_type->tp_name); return(NULL); } Py_CLEAR(self->handler); Py_CLEAR(self->args); if(handler != Py_None) { self->args = PyTuple_New(2); if(!self->args) return(NULL); Py_INCREF(self); Py_INCREF(closure); PyTuple_SET_ITEM(self->args, 0, (PyObject*)self); PyTuple_SET_ITEM(self->args, 1, closure); Py_INCREF(handler); self->handler = handler; zbar_decoder_set_handler(self->zdcode, decode_handler); } else { self->handler = self->args = NULL; zbar_decoder_set_handler(self->zdcode, NULL); } Py_RETURN_NONE; } static zbarEnumItem* decoder_decode_width (zbarDecoder *self, PyObject *args, PyObject *kwds) { unsigned int width = 0; static char *kwlist[] = { "width", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "I", kwlist, &width)) return(NULL); zbar_symbol_type_t sym = zbar_decode_width(self->zdcode, width); if(PyErr_Occurred()) /* propagate errors during callback */ return(NULL); if(sym == ZBAR_NONE) { /* hardcode most common case */ Py_INCREF((PyObject*)symbol_NONE); return(symbol_NONE); } return(zbarSymbol_LookupEnum(sym)); } static PyMethodDef decoder_methods[] = { { "set_config", (PyCFunction)decoder_set_config, METH_VARARGS | METH_KEYWORDS, }, { "parse_config", (PyCFunction)decoder_parse_config, METH_VARARGS | METH_KEYWORDS, }, { "reset", (PyCFunction)decoder_reset, METH_VARARGS | METH_KEYWORDS, }, { "new_scan", (PyCFunction)decoder_new_scan, METH_VARARGS | METH_KEYWORDS, }, { "set_handler", (PyCFunction)decoder_set_handler, METH_VARARGS | METH_KEYWORDS, }, { "decode_width", (PyCFunction)decoder_decode_width, METH_VARARGS | METH_KEYWORDS, }, { NULL, }, }; PyTypeObject zbarDecoder_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.Decoder", .tp_doc = decoder_doc, .tp_basicsize = sizeof(zbarDecoder), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, .tp_new = (newfunc)decoder_new, .tp_traverse = (traverseproc)decoder_traverse, .tp_clear = (inquiry)decoder_clear, .tp_dealloc = (destructor)decoder_dealloc, .tp_getset = decoder_getset, .tp_methods = decoder_methods, }; zbar-0.10/python/imagescanner.c0000644000000000000000000001356211270371414013407 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" static char imagescanner_doc[] = PyDoc_STR( "scan images for barcodes.\n" "\n" "attaches symbols to image for each decoded result."); static zbarImageScanner* imagescanner_new (PyTypeObject *type, PyObject *args, PyObject *kwds) { static char *kwlist[] = { NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist)) return(NULL); zbarImageScanner *self = (zbarImageScanner*)type->tp_alloc(type, 0); if(!self) return(NULL); self->zscn = zbar_image_scanner_create(); if(!self->zscn) { Py_DECREF(self); return(NULL); } return(self); } static void imagescanner_dealloc (zbarImageScanner *self) { zbar_image_scanner_destroy(self->zscn); ((PyObject*)self)->ob_type->tp_free((PyObject*)self); } static zbarSymbolSet* imagescanner_get_results (zbarImageScanner *self, void *closure) { const zbar_symbol_set_t *zsyms = zbar_image_scanner_get_results(self->zscn); return(zbarSymbolSet_FromSymbolSet(zsyms)); } static PyGetSetDef imagescanner_getset[] = { { "results", (getter)imagescanner_get_results, }, }; static PyObject* imagescanner_set_config (zbarImageScanner *self, PyObject *args, PyObject *kwds) { zbar_symbol_type_t sym = ZBAR_NONE; zbar_config_t cfg = ZBAR_CFG_ENABLE; int val = 1; static char *kwlist[] = { "symbology", "config", "value", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|iii", kwlist, &sym, &cfg, &val)) return(NULL); if(zbar_image_scanner_set_config(self->zscn, sym, cfg, val)) { PyErr_SetString(PyExc_ValueError, "invalid configuration setting"); return(NULL); } Py_RETURN_NONE; } static PyObject* imagescanner_parse_config (zbarImageScanner *self, PyObject *args, PyObject *kwds) { const char *cfg = NULL; static char *kwlist[] = { "config", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &cfg)) return(NULL); if(zbar_image_scanner_parse_config(self->zscn, cfg)) { PyErr_Format(PyExc_ValueError, "invalid configuration setting: %s", cfg); return(NULL); } Py_RETURN_NONE; } static PyObject* imagescanner_enable_cache (zbarImageScanner *self, PyObject *args, PyObject *kwds) { unsigned char enable = 1; static char *kwlist[] = { "enable", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|O&", kwlist, object_to_bool, &enable)) return(NULL); zbar_image_scanner_enable_cache(self->zscn, enable); Py_RETURN_NONE; } static PyObject* imagescanner_recycle (zbarImageScanner *self, PyObject *args, PyObject *kwds) { zbarImage *img = NULL; static char *kwlist[] = { "image", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O!", kwlist, &zbarImage_Type, &img)) return(NULL); zbar_image_scanner_recycle_image(self->zscn, img->zimg); Py_RETURN_NONE; } static PyObject* imagescanner_scan (zbarImageScanner *self, PyObject *args, PyObject *kwds) { zbarImage *img = NULL; static char *kwlist[] = { "image", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O!", kwlist, &zbarImage_Type, &img)) return(NULL); if(zbarImage_validate(img)) return(NULL); int n = zbar_scan_image(self->zscn, img->zimg); if(n < 0) { PyErr_Format(PyExc_ValueError, "unsupported image format"); return(NULL); } return(PyInt_FromLong(n)); } static PyMethodDef imagescanner_methods[] = { { "set_config", (PyCFunction)imagescanner_set_config, METH_VARARGS | METH_KEYWORDS, }, { "parse_config", (PyCFunction)imagescanner_parse_config, METH_VARARGS | METH_KEYWORDS, }, { "enable_cache", (PyCFunction)imagescanner_enable_cache, METH_VARARGS | METH_KEYWORDS, }, { "recycle", (PyCFunction)imagescanner_recycle, METH_VARARGS | METH_KEYWORDS, }, { "scan", (PyCFunction)imagescanner_scan, METH_VARARGS | METH_KEYWORDS, }, { NULL, }, }; PyTypeObject zbarImageScanner_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.ImageScanner", .tp_doc = imagescanner_doc, .tp_basicsize = sizeof(zbarImageScanner), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = (newfunc)imagescanner_new, .tp_dealloc = (destructor)imagescanner_dealloc, .tp_getset = imagescanner_getset, .tp_methods = imagescanner_methods, }; zbar-0.10/python/symbolset.c0000644000000000000000000000524411270371414012772 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" static char symbolset_doc[] = PyDoc_STR( "symbol result container.\n" "\n" "collection of symbols."); static int symbolset_clear (zbarSymbolSet *self) { if(self->zsyms) { zbar_symbol_set_t *zsyms = (zbar_symbol_set_t*)self->zsyms; self->zsyms = NULL; zbar_symbol_set_ref(zsyms, -1); } return(0); } static void symbolset_dealloc (zbarSymbolSet *self) { symbolset_clear(self); ((PyObject*)self)->ob_type->tp_free((PyObject*)self); } static zbarSymbolIter* symbolset_iter (zbarSymbolSet *self) { return(zbarSymbolIter_FromSymbolSet(self)); } Py_ssize_t symbolset_length (zbarSymbolSet *self) { if(self->zsyms) return(zbar_symbol_set_get_size(self->zsyms)); return(0); } static PySequenceMethods symbolset_as_sequence = { .sq_length = (lenfunc)symbolset_length, }; PyTypeObject zbarSymbolSet_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.SymbolSet", .tp_doc = symbolset_doc, .tp_basicsize = sizeof(zbarSymbolSet), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_dealloc = (destructor)symbolset_dealloc, .tp_iter = (getiterfunc)symbolset_iter, .tp_as_sequence = &symbolset_as_sequence, }; zbarSymbolSet* zbarSymbolSet_FromSymbolSet(const zbar_symbol_set_t *zsyms) { zbarSymbolSet *self = PyObject_New(zbarSymbolSet, &zbarSymbolSet_Type); if(!self) return(NULL); if(zsyms) { zbar_symbol_set_t *ncsyms = (zbar_symbol_set_t*)zsyms; zbar_symbol_set_ref(ncsyms, 1); } self->zsyms = zsyms; return(self); } zbar-0.10/python/image.c0000644000000000000000000002731111270371414012032 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" #ifdef HAVE_INTTYPES_H # include #endif static char image_doc[] = PyDoc_STR( "image object.\n" "\n" "stores image data samples along with associated format and size metadata."); static zbarImage* image_new (PyTypeObject *type, PyObject *args, PyObject *kwds) { zbarImage *self = (zbarImage*)type->tp_alloc(type, 0); if(!self) return(NULL); self->zimg = zbar_image_create(); if(!self->zimg) { Py_DECREF(self); return(NULL); } zbar_image_set_userdata(self->zimg, self); return(self); } static int image_traverse (zbarImage *self, visitproc visit, void *arg) { Py_VISIT(self->data); return(0); } static int image_clear (zbarImage *self) { zbar_image_t *zimg = self->zimg; self->zimg = NULL; if(zimg) { assert(zbar_image_get_userdata(zimg) == self); if(self->data) { /* attach data directly to zbar image */ zbar_image_set_userdata(zimg, self->data); self->data = NULL; } else zbar_image_set_userdata(zimg, NULL); zbar_image_destroy(zimg); } return(0); } static void image_dealloc (zbarImage *self) { image_clear(self); ((PyObject*)self)->ob_type->tp_free((PyObject*)self); } static zbarSymbolSet* image_get_symbols (zbarImage *self, void *closure) { const zbar_symbol_set_t *zsyms = zbar_image_get_symbols(self->zimg); return(zbarSymbolSet_FromSymbolSet(zsyms)); } static int image_set_symbols (zbarImage *self, PyObject *value, void *closure) { const zbar_symbol_set_t *zsyms; if(!value || value == Py_None) zsyms = NULL; else if(zbarSymbolSet_Check(value)) zsyms = ((zbarSymbolSet*)value)->zsyms; else { PyErr_Format(PyExc_TypeError, "must set image symbols to a zbar.SymbolSet, not '%.50s'", value->ob_type->tp_name); return(-1); } zbar_image_set_symbols(self->zimg, zsyms); return(0); } static zbarSymbolIter* image_iter (zbarImage *self) { zbarSymbolSet *syms = image_get_symbols(self, NULL); if(!syms) return(NULL); return(zbarSymbolIter_FromSymbolSet(syms)); } static PyObject* image_get_format (zbarImage *self, void *closure) { unsigned long format = zbar_image_get_format(self->zimg); return(PyString_FromStringAndSize((char*)&format, 4)); } static int image_set_format (zbarImage *self, PyObject *value, void *closure) { if(!value) { PyErr_SetString(PyExc_TypeError, "cannot delete format attribute"); return(-1); } char *format; Py_ssize_t len; if(PyString_AsStringAndSize(value, &format, &len) || !format || len != 4) { PyErr_Format(PyExc_ValueError, "format '%.50s' is not a valid four character code", format); return(-1); } zbar_image_set_format(self->zimg,*((unsigned long*)format)); return(0); } static PyObject* image_get_size (zbarImage *self, void *closure) { unsigned int width = zbar_image_get_width(self->zimg); unsigned int height = zbar_image_get_height(self->zimg); return(PyTuple_Pack(2, PyInt_FromLong(width), PyInt_FromLong(height))); } static int image_set_size (zbarImage *self, PyObject *value, void *closure) { if(!value) { PyErr_SetString(PyExc_TypeError, "cannot delete size attribute"); return(-1); } int rc = -1; PyObject *wobj = NULL, *hobj = NULL; if(!PySequence_Check(value) || PySequence_Size(value) != 2) goto error; wobj = PySequence_GetItem(value, 0); hobj = PySequence_GetItem(value, 1); if(!wobj || !hobj) goto error; int width = PyInt_AsSsize_t(wobj); if(width == -1 && PyErr_Occurred()) goto error; int height = PyInt_AsSsize_t(hobj); if(height == -1 && PyErr_Occurred()) goto error; zbar_image_set_size(self->zimg, width, height); rc = 0; error: Py_XDECREF(wobj); Py_XDECREF(hobj); if(rc) PyErr_SetString(PyExc_ValueError, "size must be a sequence of two ints"); return(rc); } static PyObject* image_get_int (zbarImage *self, void *closure) { unsigned int val = -1; switch((intptr_t)closure) { case 0: val = zbar_image_get_width(self->zimg); break; case 1: val = zbar_image_get_height(self->zimg); break; case 2: val = zbar_image_get_sequence(self->zimg); break; default: assert(0); } return(PyInt_FromLong(val)); } static int image_set_int (zbarImage *self, PyObject *value, void *closure) { unsigned int tmp, val = PyInt_AsSsize_t(value); if(val == -1 && PyErr_Occurred()) { PyErr_SetString(PyExc_TypeError, "expecting an integer"); return(-1); } switch((intptr_t)closure) { case 0: tmp = zbar_image_get_height(self->zimg); zbar_image_set_size(self->zimg, val, tmp); break; case 1: tmp = zbar_image_get_width(self->zimg); zbar_image_set_size(self->zimg, tmp, val); break; case 2: zbar_image_set_sequence(self->zimg, val); default: assert(0); } return(0); } static PyObject* image_get_data (zbarImage *self, void *closure) { assert(zbar_image_get_userdata(self->zimg) == self); if(self->data) { Py_INCREF(self->data); return(self->data); } const char *data = zbar_image_get_data(self->zimg); unsigned long datalen = zbar_image_get_data_length(self->zimg); if(!data || !datalen) { Py_INCREF(Py_None); return(Py_None); } self->data = PyBuffer_FromMemory((void*)data, datalen); Py_INCREF(self->data); return(self->data); } void image_cleanup (zbar_image_t *zimg) { PyObject *data = zbar_image_get_userdata(zimg); zbar_image_set_userdata(zimg, NULL); if(!data) return; /* FIXME internal error */ if(PyObject_TypeCheck(data, &zbarImage_Type)) { zbarImage *self = (zbarImage*)data; assert(self->zimg == zimg); Py_CLEAR(self->data); } else Py_DECREF(data); } static int image_set_data (zbarImage *self, PyObject *value, void *closure) { if(!value) { zbar_image_free_data(self->zimg); return(0); } char *data; Py_ssize_t datalen; if(PyString_AsStringAndSize(value, &data, &datalen)) return(-1); Py_INCREF(value); zbar_image_set_data(self->zimg, data, datalen, image_cleanup); assert(!self->data); self->data = value; zbar_image_set_userdata(self->zimg, self); return(0); } static PyGetSetDef image_getset[] = { { "format", (getter)image_get_format, (setter)image_set_format, }, { "size", (getter)image_get_size, (setter)image_set_size, }, { "width", (getter)image_get_int, (setter)image_set_int, NULL, (void*)0 }, { "height", (getter)image_get_int, (setter)image_set_int, NULL, (void*)1 }, { "sequence", (getter)image_get_int, (setter)image_set_int, NULL, (void*)2 }, { "data", (getter)image_get_data, (setter)image_set_data, }, { "symbols", (getter)image_get_symbols,(setter)image_set_symbols, }, { NULL, }, }; static int image_init (zbarImage *self, PyObject *args, PyObject *kwds) { int width = -1, height = -1; PyObject *format = NULL, *data = NULL; static char *kwlist[] = { "width", "height", "format", "data", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|iiOO", kwlist, &width, &height, &format, &data)) return(-1); if(width > 0 && height > 0) zbar_image_set_size(self->zimg, width, height); if(format && image_set_format(self, format, NULL)) return(-1); if(data && image_set_data(self, data, NULL)) return(-1); return(0); } static zbarImage* image_convert (zbarImage *self, PyObject *args, PyObject *kwds) { const char *format = NULL; int width = -1, height = -1; static char *kwlist[] = { "format", "width", "height", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "s|ii", kwlist, &format, &width, &height)) return(NULL); assert(format); if(strlen(format) != 4) { PyErr_Format(PyExc_ValueError, "format '%.50s' is not a valid four character code", format); return(NULL); } zbarImage *img = PyObject_GC_New(zbarImage, &zbarImage_Type); if(!img) return(NULL); img->data = NULL; if(width > 0 && height > 0) img->zimg = zbar_image_convert_resize(self->zimg, *((unsigned long*)format), width, height); else img->zimg = zbar_image_convert(self->zimg, *((unsigned long*)format)); if(!img->zimg) { /* FIXME propagate exception */ Py_DECREF(img); return(NULL); } zbar_image_set_userdata(img->zimg, img); return(img); } static PyMethodDef image_methods[] = { { "convert", (PyCFunction)image_convert, METH_VARARGS | METH_KEYWORDS, }, { NULL, }, }; PyTypeObject zbarImage_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.Image", .tp_doc = image_doc, .tp_basicsize = sizeof(zbarImage), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, .tp_new = (newfunc)image_new, .tp_init = (initproc)image_init, .tp_traverse = (traverseproc)image_traverse, .tp_clear = (inquiry)image_clear, .tp_dealloc = (destructor)image_dealloc, .tp_getset = image_getset, .tp_methods = image_methods, .tp_iter = (getiterfunc)image_iter, }; zbarImage* zbarImage_FromImage (zbar_image_t *zimg) { zbarImage *self = PyObject_GC_New(zbarImage, &zbarImage_Type); if(!self) return(NULL); zbar_image_ref(zimg, 1); zbar_image_set_userdata(zimg, self); self->zimg = zimg; self->data = NULL; return(self); } int zbarImage_validate (zbarImage *img) { if(!zbar_image_get_width(img->zimg) || !zbar_image_get_height(img->zimg) || !zbar_image_get_data(img->zimg) || !zbar_image_get_data_length(img->zimg)) { PyErr_Format(PyExc_ValueError, "image size and data must be defined"); return(-1); } return(0); } zbar-0.10/python/test/0000777000000000000000000000000011270371535011647 500000000000000zbar-0.10/python/test/test_zbar.py0000755000000000000000000003223511270371414014136 00000000000000#!/usr/bin/python import sys, os, re import unittest as ut import zbar # FIXME this needs to be conditional # would be even better to auto-select PIL or ImageMagick (or...) import Image data = None size = (0, 0) def load_image(): image = Image.open(os.path.join(sys.path[0], "barcode.png")).convert('L') return(image.tostring(), image.size) # FIXME this could be integrated w/fixture creation (data, size) = load_image() encoded_widths = \ '9 111 212241113121211311141132 11111 311213121312121332111132 111 9' VIDEO_DEVICE = None if 'VIDEO_DEVICE' in os.environ: VIDEO_DEVICE = os.environ['VIDEO_DEVICE'] is_identifier = re.compile(r'^[A-Z][A-Z_0-9]*$') class TestZBarFunctions(ut.TestCase): def test_version(self): ver = zbar.version() self.assert_(isinstance(ver, tuple)) self.assertEqual(len(ver), 2) for v in ver: self.assert_(isinstance(v, int)) def test_verbosity(self): zbar.increase_verbosity() zbar.set_verbosity(16) def test_exceptions(self): self.assert_(isinstance(zbar.Exception, type)) for err in (zbar.InternalError, zbar.UnsupportedError, zbar.InvalidRequestError, zbar.SystemError, zbar.LockingError, zbar.BusyError, zbar.X11DisplayError, zbar.X11ProtocolError, zbar.WindowClosed, zbar.WinAPIError): self.assert_(issubclass(err, zbar.Exception)) def test_configs(self): for cfg in (zbar.Config.ENABLE, zbar.Config.ADD_CHECK, zbar.Config.EMIT_CHECK, zbar.Config.ASCII, zbar.Config.MIN_LEN, zbar.Config.MAX_LEN, zbar.Config.POSITION, zbar.Config.X_DENSITY, zbar.Config.Y_DENSITY): self.assert_(isinstance(cfg, zbar.EnumItem)) self.assert_(int(cfg) >= 0) self.assert_(is_identifier.match(str(cfg))) def test_symbologies(self): for sym in (zbar.Symbol.NONE, zbar.Symbol.PARTIAL, zbar.Symbol.EAN8, zbar.Symbol.UPCE, zbar.Symbol.ISBN10, zbar.Symbol.UPCA, zbar.Symbol.EAN13, zbar.Symbol.ISBN13, zbar.Symbol.I25, zbar.Symbol.CODE39, zbar.Symbol.PDF417, zbar.Symbol.QRCODE, zbar.Symbol.CODE128): self.assert_(isinstance(sym, zbar.EnumItem)) self.assert_(int(sym) >= 0) self.assert_(is_identifier.match(str(sym))) class TestScanner(ut.TestCase): def setUp(self): self.scn = zbar.Scanner() def tearDown(self): del(self.scn) def test_type(self): self.assert_(isinstance(self.scn, zbar.Scanner)) self.assert_(callable(self.scn.reset)) self.assert_(callable(self.scn.new_scan)) self.assert_(callable(self.scn.scan_y)) def set_color(color): self.scn.color = color self.assertRaises(AttributeError, set_color, zbar.BAR) def set_width(width): self.scn.width = width self.assertRaises(AttributeError, set_width, 1) # FIXME more scanner tests class TestDecoder(ut.TestCase): def setUp(self): self.dcode = zbar.Decoder() def tearDown(self): del(self.dcode) def test_type(self): self.assert_(isinstance(self.dcode, zbar.Decoder)) self.assert_(callable(self.dcode.set_config)) self.assert_(callable(self.dcode.parse_config)) self.assert_(callable(self.dcode.reset)) self.assert_(callable(self.dcode.new_scan)) self.assert_(callable(self.dcode.set_handler)) self.assert_(callable(self.dcode.decode_width)) def set_type(typ): self.dcode.type = typ self.assertRaises(AttributeError, set_type, zbar.Symbol.CODE128) def set_color(color): self.dcode.color = color self.assertRaises(AttributeError, set_color, zbar.BAR) def set_data(data): self.dcode.data = data self.assertRaises(AttributeError, set_data, 'yomama') def test_width(self): sym = self.dcode.decode_width(5) self.assert_(sym is zbar.Symbol.NONE) self.assert_(not sym) self.assertEqual(str(sym), 'NONE') typ = self.dcode.type self.assert_(sym is typ) def test_reset(self): self.assert_(self.dcode.color is zbar.SPACE) sym = self.dcode.decode_width(1) self.assert_(self.dcode.color is zbar.BAR) self.dcode.reset() self.assert_(self.dcode.color is zbar.SPACE) def test_decode(self): inline_sym = [ -1 ] def handler(dcode, closure): self.assert_(dcode is self.dcode) if dcode.type > zbar.Symbol.PARTIAL: inline_sym[0] = dcode.type closure[0] += 1 explicit_closure = [ 0 ] self.dcode.set_handler(handler, explicit_closure) self.dcode.set_config(zbar.Symbol.QRCODE, zbar.Config.ENABLE, 0) for (i, width) in enumerate(encoded_widths): if width == ' ': continue sym = self.dcode.decode_width(int(width)) if i < len(encoded_widths) - 1: self.assert_(sym is zbar.Symbol.NONE or sym is zbar.Symbol.PARTIAL) else: self.assert_(sym is zbar.Symbol.EAN13) self.assertEqual(self.dcode.data, '6268964977804') self.assert_(self.dcode.color is zbar.BAR) self.assert_(sym is zbar.Symbol.EAN13) self.assert_(inline_sym[0] is zbar.Symbol.EAN13) self.assertEqual(explicit_closure, [ 2 ]) # FIXME test exception during callback class TestImage(ut.TestCase): def setUp(self): self.image = zbar.Image(123, 456, 'Y800') def tearDown(self): del(self.image) def test_type(self): self.assert_(isinstance(self.image, zbar.Image)) self.assert_(callable(self.image.convert)) def test_new(self): self.assertEqual(self.image.format, 'Y800') self.assertEqual(self.image.size, (123, 456)) image = zbar.Image() self.assert_(isinstance(image, zbar.Image)) self.assertEqual(image.format, '\0\0\0\0') self.assertEqual(image.size, (0, 0)) def test_format(self): def set_format(fmt): self.image.format = fmt self.assertRaises(ValueError, set_format, 10) self.assertEqual(self.image.format, 'Y800') self.image.format = 'gOOb' self.assertEqual(self.image.format, 'gOOb') self.assertRaises(ValueError, set_format, 'yomama') self.assertEqual(self.image.format, 'gOOb') self.assertRaises(ValueError, set_format, 'JPG') self.assertEqual(self.image.format, 'gOOb') def test_size(self): def set_size(sz): self.image.size = sz self.assertRaises(ValueError, set_size, (1,)) self.assertRaises(ValueError, set_size, 1) self.image.size = (12, 6) self.assertRaises(ValueError, set_size, (1, 2, 3)) self.assertEqual(self.image.size, (12, 6)) self.assertRaises(ValueError, set_size, "foo") self.assertEqual(self.image.size, (12, 6)) self.assertEqual(self.image.width, 12) self.assertEqual(self.image.height, 6) self.image.width = 81 self.assertEqual(self.image.size, (81, 6)) self.image.height = 64 self.assertEqual(self.image.size, (81, 64)) self.assertEqual(self.image.width, 81) self.assertEqual(self.image.height, 64) class TestImageScanner(ut.TestCase): def setUp(self): self.scn = zbar.ImageScanner() def tearDown(self): del(self.scn) def test_type(self): self.assert_(isinstance(self.scn, zbar.ImageScanner)) self.assert_(callable(self.scn.set_config)) self.assert_(callable(self.scn.parse_config)) self.assert_(callable(self.scn.enable_cache)) self.assert_(callable(self.scn.scan)) def test_set_config(self): self.scn.set_config() self.assertRaises(ValueError, self.scn.set_config, -1) self.assertRaises(TypeError, self.scn.set_config, "yomama") self.scn.set_config() def test_parse_config(self): self.scn.parse_config("disable") self.assertRaises(ValueError, self.scn.set_config, -1) self.scn.set_config() class TestImageScan(ut.TestCase): def setUp(self): self.scn = zbar.ImageScanner() self.image = zbar.Image(size[0], size[1], 'Y800', data) def tearDown(self): del(self.image) del(self.scn) def test_scan(self): n = self.scn.scan(self.image) self.assertEqual(n, 1) syms = self.image.symbols self.assert_(isinstance(syms, zbar.SymbolSet)) self.assertEqual(len(syms), 1) i = iter(self.image) j = iter(syms) self.assert_(isinstance(i, zbar.SymbolIter)) self.assert_(isinstance(j, zbar.SymbolIter)) symi = i.next() symj = j.next() self.assertRaises(StopIteration, i.next) self.assertRaises(StopIteration, j.next) # this is the only way to obtain a Symbol, # so test Symbol here for sym in (symi, symj): self.assert_(isinstance(sym, zbar.Symbol)) self.assert_(sym.type is zbar.Symbol.EAN13) self.assert_(sym.type is sym.EAN13) self.assertEqual(str(sym.type), 'EAN13') self.assert_(sym.quality > 0) self.assertEqual(sym.count, 0) # FIXME put a nice QR S-A in here comps = sym.components self.assert_(isinstance(comps, zbar.SymbolSet)) self.assertEqual(len(comps), 0) self.assert_(not comps) self.assert_(tuple(comps) is ()) data = sym.data self.assertEqual(data, '9876543210128') loc = sym.location self.assert_(len(loc) >= 4) # FIXME self.assert_(isinstance(loc, tuple)) for pt in loc: self.assert_(isinstance(pt, tuple)) self.assertEqual(len(pt), 2) # FIXME test values (API currently in flux) self.assert_(data is sym.data) self.assert_(loc is sym.location) def set_symbols(syms): self.image.symbols = syms self.assertRaises(TypeError, set_symbols, ()) self.scn.recycle(self.image) self.assertEqual(len(self.image.symbols), 0) def test_scan_again(self): self.test_scan() class TestProcessor(ut.TestCase): def setUp(self): self.proc = zbar.Processor() def tearDown(self): del(self.proc) def test_type(self): self.assert_(isinstance(self.proc, zbar.Processor)) self.assert_(callable(self.proc.init)) self.assert_(callable(self.proc.set_config)) self.assert_(callable(self.proc.parse_config)) self.assert_(callable(self.proc.set_data_handler)) self.assert_(callable(self.proc.user_wait)) self.assert_(callable(self.proc.process_one)) self.assert_(callable(self.proc.process_image)) def test_set_config(self): self.proc.set_config() self.assertRaises(ValueError, self.proc.set_config, -1) self.assertRaises(TypeError, self.proc.set_config, "yomama") self.proc.set_config() def test_parse_config(self): self.proc.parse_config("disable") self.assertRaises(ValueError, self.proc.set_config, -1) self.proc.set_config() def test_processing(self): self.proc.init(VIDEO_DEVICE) self.assert_(self.proc.visible is False) self.proc.visible = 1 self.assert_(self.proc.visible is True) self.assertEqual(self.proc.user_wait(1.1), 0) self.image = zbar.Image(size[0], size[1], 'Y800', data) count = [ 0 ] def data_handler(proc, image, closure): self.assert_(proc is self.proc) self.assert_(image is self.image) self.assertEqual(count[0], 0) count[0] += 1 symiter = iter(image) self.assert_(isinstance(symiter, zbar.SymbolIter)) symbols = tuple(image) self.assertEqual(len(symbols), 1) for symbol in symbols: self.assert_(isinstance(symbol, zbar.Symbol)) self.assert_(symbol.type is zbar.Symbol.EAN13) self.assertEqual(symbol.data, '9876543210128') self.assert_(symbol.quality > 0) closure[0] += 1 explicit_closure = [ 0 ] self.proc.set_data_handler(data_handler, explicit_closure) rc = self.proc.process_image(self.image) self.assertEqual(rc, 0) self.assertEqual(len(self.image.symbols), 1) del(self.image.symbols) self.assertEqual(len(self.image.symbols), 0) self.assertEqual(self.proc.user_wait(.9), 0) self.assertEqual(explicit_closure, [ 1 ]) self.proc.set_data_handler() if __name__ == '__main__': ut.main() zbar-0.10/python/test/barcode.png0000644000000000000000000000223611270371414013667 00000000000000‰PNG  IHDRrPo°éËgAMA± üasRGB®Îé cHRMz&€„ú€èu0ê`:˜pœºQ<bKGDª#2 pHYs=ƒ=ƒ‡è vpAgrPéƒL—äIDATxÚí•!hcA†£N–ƒªÂAd¡âÅgj 5º#&q¥*DÄDÄ”¸ÀQê*Ž˜@D]*ª …ˆºˆx"®„º˜¹gg÷í¾¼^¡Ç'fBÞ¾·»3;ßÌìn‰ ä„6ò/ËÓ´¶Ÿ‚6?3s:'^?ûÊÛvó³6^qw,ìËû•ù–I©²B/ò/ÉÓ´¶Ÿ‚6?3s:¯Ÿ}åm»ùY¯¸;öåýÊ|SH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TH…TÈÿ2ÑL~2ùËI!dòo3C&™|0“IróqÈ”–ø2Ï%÷§2žú™æmÅÿe4¶Ôë»/–”õRo9lãÝØJÆÂõÒÈŸßB¦4 kzÝ´òD}ñè=uñëá7Ãך†Ð[óœúÌØÒÛ¸âç–n¡=/ “{hÞ`ž“‘´kØŠu#3oûVÖ72ÁûôMÛäšèœZTõK…“0Ú¡SüÌB]†9¤1FËtA <Ö€j ïH‰´è+µi?ÀŒ³õ*5åûZô¶X£á­›@ï X Úú‚À˜@VàM‚ÕÞ…˜‘sÄewr& yüÄþŒ¸à¯\,M^ÔÉN8H“‹6¬C¶€Iø²ÖÛT½)s{ÌyCãH íy0áñ¢%?ælàß"ƒìÃ8E®„Ž,g³x'pÓ(Ÿ¯!˘¾*=æ`‹Å&ÁfŸ`4ËdRí9òfóå‰+ï“ÉÒ3lÖÜL†H‰±\C&k¨¼ß„½†ú›Z›O(™Ÿ¨ô”[|œØrMX÷5Á»‘o07a­9WÁ=9g×.Ù¹A8ªtUi„¸æ Ä'¡Ù¶u>Õü>$zD¥¬¸Šª˜Wõûx×ö£Rcdä¥3,8i뀑#ÉÆ™ÄíT Kqôgdô®•ÄM[ ûô–¤Öhç¸D™´AùíRæœ}æÍ°F[$K$Çìß•±™""ÖÌCÁÔS:Ãûr'u$$M ú.'c&íáTâ$\ÚkÅg1ƒŒ÷dùOÜ^ÛãÒ,¶>„å‘Ü%s¨”‘ÅÌÉJÃìÉš¤ÿPúWÐ2…Yæ…ªÈp3ç9g;|þU‚lçë¤Â!éåô¶°kN×Câ[È ¶G‹xXïX~y%»' Ú((4s“Ù=ð ý+a#]Iôƒ™—ž vwôÌ=9îɾž\ôä4ŸâmBïÉ/¥7«ˆ‚ì>IEND®B`‚zbar-0.10/python/zbarmodule.h0000644000000000000000000000776311270371414013132 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include #ifndef _ZBARMODULE_H_ #define _ZBARMODULE_H_ typedef struct { PyBaseExceptionObject base; PyObject *obj; } zbarException; extern PyTypeObject zbarException_Type; extern PyObject *zbar_exc[ZBAR_ERR_NUM]; extern PyObject *zbarErr_Set(PyObject *self); typedef struct { PyIntObject val; /* integer value is super type */ PyObject *name; /* associated string name */ } zbarEnumItem; extern PyTypeObject zbarEnumItem_Type; extern zbarEnumItem *zbarEnumItem_New(PyObject *byname, PyObject *byvalue, int val, const char *name); typedef struct { PyObject_HEAD PyObject *byname, *byvalue; /* zbarEnumItem content dictionaries */ } zbarEnum; extern PyTypeObject zbarEnum_Type; extern zbarEnum *zbarEnum_New(void); extern int zbarEnum_Add(zbarEnum *self, int val, const char *name); typedef struct { PyObject_HEAD zbar_image_t *zimg; PyObject *data; } zbarImage; extern PyTypeObject zbarImage_Type; extern zbarImage *zbarImage_FromImage(zbar_image_t *zimg); extern int zbarImage_validate(zbarImage *image); typedef struct { PyObject_HEAD const zbar_symbol_set_t *zsyms; } zbarSymbolSet; extern PyTypeObject zbarSymbolSet_Type; extern zbarSymbolSet* zbarSymbolSet_FromSymbolSet(const zbar_symbol_set_t *zsyms); #define zbarSymbolSet_Check(obj) PyObject_TypeCheck(obj, &zbarSymbolSet_Type) typedef struct { PyObject_HEAD const zbar_symbol_t *zsym; PyObject *data; PyObject *loc; } zbarSymbol; extern PyTypeObject zbarSymbol_Type; extern zbarSymbol *zbarSymbol_FromSymbol(const zbar_symbol_t *zsym); extern zbarEnumItem *zbarSymbol_LookupEnum(zbar_symbol_type_t type); typedef struct { PyObject_HEAD const zbar_symbol_t *zsym; zbarSymbolSet *syms; } zbarSymbolIter; extern PyTypeObject zbarSymbolIter_Type; extern zbarSymbolIter *zbarSymbolIter_FromSymbolSet(zbarSymbolSet *syms); typedef struct { PyObject_HEAD zbar_processor_t *zproc; PyObject *handler; PyObject *closure; } zbarProcessor; extern PyTypeObject zbarProcessor_Type; #define zbarProcessor_Check(obj) PyObject_TypeCheck(obj, &zbarProcessor_Type) typedef struct { PyObject_HEAD zbar_image_scanner_t *zscn; } zbarImageScanner; extern PyTypeObject zbarImageScanner_Type; typedef struct { PyObject_HEAD zbar_decoder_t *zdcode; PyObject *handler; PyObject *args; } zbarDecoder; extern PyTypeObject zbarDecoder_Type; typedef struct { PyObject_HEAD zbar_scanner_t *zscn; zbarDecoder *decoder; } zbarScanner; extern PyTypeObject zbarScanner_Type; extern zbarEnumItem *color_enum[2]; extern zbarEnum *config_enum; extern PyObject *symbol_enum; extern zbarEnumItem *symbol_NONE; int object_to_bool(PyObject *obj, int *val); #endif zbar-0.10/python/exception.c0000644000000000000000000001021511270371414012741 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" static inline PyObject* exc_get_message (zbarException *self, void *closure) { PyBaseExceptionObject *super = (PyBaseExceptionObject*)self; if(!PyString_Size(super->message)) { Py_CLEAR(super->message); if(!self->obj || !zbarProcessor_Check(self->obj)) super->message = PyString_FromString("unknown zbar error"); else { const void *zobj = ((zbarProcessor*)self->obj)->zproc; super->message = PyString_FromString(_zbar_error_string(zobj, 1)); } } Py_INCREF(super->message); return(super->message); } static int exc_init (zbarException *self, PyObject *args, PyObject *kwds) { if(!_PyArg_NoKeywords(self->base.ob_type->tp_name, kwds)) return(-1); PyBaseExceptionObject *super = (PyBaseExceptionObject*)self; Py_CLEAR(super->args); Py_INCREF(args); super->args = args; if(PyTuple_GET_SIZE(args) == 1) { Py_CLEAR(self->obj); self->obj = PyTuple_GET_ITEM(args, 0); Py_INCREF(self->obj); } return(0); } static int exc_traverse (zbarException *self, visitproc visit, void *arg) { Py_VISIT(self->obj); PyTypeObject *base = (PyTypeObject*)PyExc_Exception; return(base->tp_traverse((PyObject*)self, visit, arg)); } static int exc_clear (zbarException *self) { Py_CLEAR(self->obj); ((PyTypeObject*)PyExc_Exception)->tp_clear((PyObject*)self); return(0); } static void exc_dealloc (zbarException *self) { exc_clear(self); ((PyTypeObject*)PyExc_Exception)->tp_dealloc((PyObject*)self); } static PyObject* exc_str (zbarException *self) { return(exc_get_message(self, NULL)); } static int exc_set_message (zbarException *self, PyObject *value, void *closure) { PyBaseExceptionObject *super = (PyBaseExceptionObject*)self; Py_CLEAR(super->message); if(!value) value = PyString_FromString(""); else Py_INCREF(value); super->message = value; return(0); } static PyGetSetDef exc_getset[] = { { "message", (getter)exc_get_message, (setter)exc_set_message, }, { NULL, }, }; PyTypeObject zbarException_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.Exception", .tp_basicsize = sizeof(zbarException), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, .tp_init = (initproc)exc_init, .tp_traverse = (traverseproc)exc_traverse, .tp_clear = (inquiry)exc_clear, .tp_dealloc = (destructor)exc_dealloc, .tp_str = (reprfunc)exc_str, .tp_getset = exc_getset, }; PyObject* zbarErr_Set (PyObject *self) { const void *zobj = ((zbarProcessor*)self)->zproc; zbar_error_t err = _zbar_get_error_code(zobj); if(err == ZBAR_ERR_NOMEM) PyErr_NoMemory(); else if(err < ZBAR_ERR_NUM) { PyObject *type = zbar_exc[err]; assert(type); PyErr_SetObject(type, self); } else PyErr_SetObject(zbar_exc[0], self); return(NULL); } zbar-0.10/python/symbol.c0000644000000000000000000001233311270371414012253 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" static char symbol_doc[] = PyDoc_STR( "symbol result object.\n" "\n" "data and associated information about a successful decode."); static int symbol_traverse (zbarSymbol *self, visitproc visit, void *arg) { return(0); } static int symbol_clear (zbarSymbol *self) { if(self->zsym) { zbar_symbol_t *zsym = (zbar_symbol_t*)self->zsym; self->zsym = NULL; zbar_symbol_ref(zsym, -1); } Py_CLEAR(self->data); Py_CLEAR(self->loc); return(0); } static void symbol_dealloc (zbarSymbol *self) { symbol_clear(self); ((PyObject*)self)->ob_type->tp_free((PyObject*)self); } static zbarSymbolSet* symbol_get_components (zbarSymbol *self, void *closure) { const zbar_symbol_set_t *zsyms = zbar_symbol_get_components(self->zsym); return(zbarSymbolSet_FromSymbolSet(zsyms)); } static zbarSymbolIter* symbol_iter (zbarSymbol *self) { zbarSymbolSet *syms = symbol_get_components(self, NULL); zbarSymbolIter *iter = zbarSymbolIter_FromSymbolSet(syms); Py_XDECREF(syms); return(iter); } static zbarEnumItem* symbol_get_type (zbarSymbol *self, void *closure) { return(zbarSymbol_LookupEnum(zbar_symbol_get_type(self->zsym))); } static PyObject* symbol_get_long (zbarSymbol *self, void *closure) { int val; if(!closure) val = zbar_symbol_get_quality(self->zsym); else val = zbar_symbol_get_count(self->zsym); return(PyInt_FromLong(val)); } static PyObject* symbol_get_data (zbarSymbol *self, void *closure) { if(!self->data) { /* FIXME this could be a buffer now */ self->data = PyString_FromStringAndSize(zbar_symbol_get_data(self->zsym), zbar_symbol_get_data_length(self->zsym)); if(!self->data) return(NULL); } Py_INCREF(self->data); return(self->data); } static PyObject* symbol_get_location (zbarSymbol *self, void *closure) { if(!self->loc) { /* build tuple of 2-tuples representing location polygon */ unsigned int n = zbar_symbol_get_loc_size(self->zsym); self->loc = PyTuple_New(n); unsigned int i; for(i = 0; i < n; i++) { PyObject *x, *y; x = PyInt_FromLong(zbar_symbol_get_loc_x(self->zsym, i)); y = PyInt_FromLong(zbar_symbol_get_loc_y(self->zsym, i)); PyTuple_SET_ITEM(self->loc, i, PyTuple_Pack(2, x, y)); } } Py_INCREF(self->loc); return(self->loc); } static PyGetSetDef symbol_getset[] = { { "type", (getter)symbol_get_type, }, { "quality", (getter)symbol_get_long, NULL, NULL, (void*)0 }, { "count", (getter)symbol_get_long, NULL, NULL, (void*)1 }, { "data", (getter)symbol_get_data, }, { "location", (getter)symbol_get_location, }, { "components", (getter)symbol_get_components, }, { NULL, }, }; PyTypeObject zbarSymbol_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.Symbol", .tp_doc = symbol_doc, .tp_basicsize = sizeof(zbarSymbol), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, .tp_traverse = (traverseproc)symbol_traverse, .tp_clear = (inquiry)symbol_clear, .tp_dealloc = (destructor)symbol_dealloc, .tp_iter = (getiterfunc)symbol_iter, .tp_getset = symbol_getset, }; zbarSymbol* zbarSymbol_FromSymbol (const zbar_symbol_t *zsym) { /* FIXME symbol object recycle cache */ zbarSymbol *self = PyObject_GC_New(zbarSymbol, &zbarSymbol_Type); if(!self) return(NULL); assert(zsym); zbar_symbol_t *zs = (zbar_symbol_t*)zsym; zbar_symbol_ref(zs, 1); self->zsym = zsym; self->data = NULL; self->loc = NULL; return(self); } zbarEnumItem* zbarSymbol_LookupEnum (zbar_symbol_type_t type) { PyObject *key = PyInt_FromLong(type); zbarEnumItem *e = (zbarEnumItem*)PyDict_GetItem(symbol_enum, key); if(!e) return((zbarEnumItem*)key); Py_INCREF((PyObject*)e); Py_DECREF(key); return(e); } zbar-0.10/python/symboliter.c0000644000000000000000000000635411270371414013145 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" static char symboliter_doc[] = PyDoc_STR( "symbol iterator.\n" "\n" "iterates over decode results attached to an image."); static int symboliter_traverse (zbarSymbolIter *self, visitproc visit, void *arg) { Py_VISIT(self->syms); return(0); } static int symboliter_clear (zbarSymbolIter *self) { if(self->zsym) { zbar_symbol_t *zsym = (zbar_symbol_t*)self->zsym; self->zsym = NULL; zbar_symbol_ref(zsym, -1); } Py_CLEAR(self->syms); return(0); } static void symboliter_dealloc (zbarSymbolIter *self) { symboliter_clear(self); ((PyObject*)self)->ob_type->tp_free((PyObject*)self); } static zbarSymbolIter* symboliter_iter (zbarSymbolIter *self) { Py_INCREF(self); return(self); } static zbarSymbol* symboliter_iternext (zbarSymbolIter *self) { if(self->zsym) { zbar_symbol_t *zsym = (zbar_symbol_t*)self->zsym; zbar_symbol_ref(zsym, -1); self->zsym = zbar_symbol_next(self->zsym); } else if(self->syms->zsyms) self->zsym = zbar_symbol_set_first_symbol(self->syms->zsyms); else self->zsym = NULL; zbar_symbol_t *zsym = (zbar_symbol_t*)self->zsym; if(!zsym) return(NULL); zbar_symbol_ref(zsym, 1); return(zbarSymbol_FromSymbol(self->zsym)); } PyTypeObject zbarSymbolIter_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.SymbolIter", .tp_doc = symboliter_doc, .tp_basicsize = sizeof(zbarSymbolIter), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, .tp_traverse = (traverseproc)symboliter_traverse, .tp_clear = (inquiry)symboliter_clear, .tp_dealloc = (destructor)symboliter_dealloc, .tp_iter = (getiterfunc)symboliter_iter, .tp_iternext = (iternextfunc)symboliter_iternext, }; zbarSymbolIter* zbarSymbolIter_FromSymbolSet (zbarSymbolSet *syms) { zbarSymbolIter *self; self = PyObject_GC_New(zbarSymbolIter, &zbarSymbolIter_Type); if(!self) return(NULL); Py_INCREF(syms); self->syms = syms; self->zsym = NULL; return(self); } zbar-0.10/python/processor.c0000644000000000000000000002515111270371414012767 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" #ifdef HAVE_INTTYPES_H # include #endif static char processor_doc[] = PyDoc_STR( "low level decode of measured bar/space widths.\n" "\n" "FIXME."); static zbarProcessor* processor_new (PyTypeObject *type, PyObject *args, PyObject *kwds) { static char *kwlist[] = { NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist)) return(NULL); zbarProcessor *self = (zbarProcessor*)type->tp_alloc(type, 0); if(!self) return(NULL); self->zproc = zbar_processor_create(0/*FIXME*/); zbar_processor_set_userdata(self->zproc, self); if(!self->zproc) { Py_DECREF(self); return(NULL); } return(self); } static int processor_traverse (zbarProcessor *self, visitproc visit, void *arg) { Py_VISIT(self->handler); Py_VISIT(self->closure); return(0); } static int processor_clear (zbarProcessor *self) { zbar_processor_set_data_handler(self->zproc, NULL, NULL); zbar_processor_set_userdata(self->zproc, NULL); Py_CLEAR(self->handler); Py_CLEAR(self->closure); return(0); } static void processor_dealloc (zbarProcessor *self) { processor_clear(self); zbar_processor_destroy(self->zproc); ((PyObject*)self)->ob_type->tp_free((PyObject*)self); } static PyObject* processor_get_bool (zbarProcessor *self, void *closure) { int val; switch((intptr_t)closure) { case 0: val = zbar_processor_is_visible(self->zproc); break; default: assert(0); return(NULL); } if(val < 0) return(zbarErr_Set((PyObject*)self)); return(PyBool_FromLong(val)); } static int processor_set_bool (zbarProcessor *self, PyObject *value, void *closure) { if(!value) { PyErr_SetString(PyExc_TypeError, "cannot delete attribute"); return(-1); } int rc, val = PyObject_IsTrue(value); if(val < 0) return(-1); switch((intptr_t)closure) { case 0: rc = zbar_processor_set_visible(self->zproc, val); break; case 1: rc = zbar_processor_set_active(self->zproc, val); break; default: assert(0); return(-1); } if(rc < 0) { zbarErr_Set((PyObject*)self); return(-1); } return(0); } static zbarSymbolSet* processor_get_results (zbarProcessor *self, void *closure) { const zbar_symbol_set_t *zsyms = zbar_processor_get_results(self->zproc); return(zbarSymbolSet_FromSymbolSet(zsyms)); } static PyGetSetDef processor_getset[] = { { "visible", (getter)processor_get_bool, (setter)processor_set_bool, NULL, (void*)0 }, { "active", NULL, (setter)processor_set_bool, NULL, (void*)1 }, { "results", (getter)processor_get_results, }, { NULL, }, }; static PyObject* processor_set_config (zbarProcessor *self, PyObject *args, PyObject *kwds) { zbar_symbol_type_t sym = ZBAR_NONE; zbar_config_t cfg = ZBAR_CFG_ENABLE; int val = 1; static char *kwlist[] = { "symbology", "config", "value", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|iii", kwlist, &sym, &cfg, &val)) return(NULL); if(zbar_processor_set_config(self->zproc, sym, cfg, val)) { PyErr_SetString(PyExc_ValueError, "invalid configuration setting"); return(NULL); } Py_RETURN_NONE; } static PyObject* processor_init_ (zbarProcessor *self, PyObject *args, PyObject *kwds) { const char *dev = ""; int disp = 1; static char *kwlist[] = { "video_device", "enable_display", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|zO&", kwlist, &dev, object_to_bool, &disp)) return(NULL); if(zbar_processor_init(self->zproc, dev, disp)) return(zbarErr_Set((PyObject*)self)); Py_RETURN_NONE; } static PyObject* processor_parse_config (zbarProcessor *self, PyObject *args, PyObject *kwds) { const char *cfg = NULL; static char *kwlist[] = { "config", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "s", kwlist, &cfg)) return(NULL); if(zbar_processor_parse_config(self->zproc, cfg)) { PyErr_Format(PyExc_ValueError, "invalid configuration setting: %s", cfg); return(NULL); } Py_RETURN_NONE; } static int object_to_timeout (PyObject *obj, int *val) { int tmp; if(PyFloat_Check(obj)) tmp = PyFloat_AS_DOUBLE(obj) * 1000; else tmp = PyInt_AsLong(obj) * 1000; if(tmp < 0 && PyErr_Occurred()) return(0); *val = tmp; return(1); } static PyObject* processor_user_wait (zbarProcessor *self, PyObject *args, PyObject *kwds) { int timeout = -1; static char *kwlist[] = { "timeout", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|O&", kwlist, object_to_timeout, &timeout)) return(NULL); int rc = zbar_processor_user_wait(self->zproc, timeout); if(rc < 0) return(zbarErr_Set((PyObject*)self)); return(PyInt_FromLong(rc)); } static PyObject* processor_process_one (zbarProcessor *self, PyObject *args, PyObject *kwds) { int timeout = -1; static char *kwlist[] = { "timeout", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|O&", kwlist, object_to_timeout, &timeout)) return(NULL); int rc = zbar_process_one(self->zproc, timeout); if(rc < 0) return(zbarErr_Set((PyObject*)self)); return(PyInt_FromLong(rc)); } static PyObject* processor_process_image (zbarProcessor *self, PyObject *args, PyObject *kwds) { zbarImage *img = NULL; static char *kwlist[] = { "image", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "O!", kwlist, &zbarImage_Type, &img)) return(NULL); if(zbarImage_validate(img)) return(NULL); int n = zbar_process_image(self->zproc, img->zimg); if(n < 0) return(zbarErr_Set((PyObject*)self)); return(PyInt_FromLong(n)); } void process_handler (zbar_image_t *zimg, const void *userdata) { zbarProcessor *self = (zbarProcessor*)userdata; assert(self); assert(self->handler); assert(self->closure); zbarImage *img = zbar_image_get_userdata(zimg); if(!img || img->zimg != zimg) { img = zbarImage_FromImage(zimg); if(!img) { PyErr_NoMemory(); return; } } else Py_INCREF(img); PyObject *args = PyTuple_New(3); Py_INCREF(self); Py_INCREF(self->closure); PyTuple_SET_ITEM(args, 0, (PyObject*)self); PyTuple_SET_ITEM(args, 1, (PyObject*)img); PyTuple_SET_ITEM(args, 2, self->closure); PyObject *junk = PyObject_Call(self->handler, args, NULL); Py_XDECREF(junk); Py_DECREF(args); } static PyObject* processor_set_data_handler (zbarProcessor *self, PyObject *args, PyObject *kwds) { PyObject *handler = Py_None; PyObject *closure = Py_None; static char *kwlist[] = { "handler", "closure", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|OO", kwlist, &handler, &closure)) return(NULL); if(handler != Py_None && !PyCallable_Check(handler)) { PyErr_Format(PyExc_ValueError, "handler %.50s is not callable", handler->ob_type->tp_name); return(NULL); } Py_CLEAR(self->handler); Py_CLEAR(self->closure); if(handler != Py_None) { Py_INCREF(handler); self->handler = handler; Py_INCREF(closure); self->closure = closure; zbar_processor_set_data_handler(self->zproc, process_handler, self); } else { self->handler = self->closure = NULL; zbar_processor_set_data_handler(self->zproc, NULL, self); } Py_RETURN_NONE; } static PyMethodDef processor_methods[] = { { "init", (PyCFunction)processor_init_, METH_VARARGS | METH_KEYWORDS, }, { "set_config", (PyCFunction)processor_set_config, METH_VARARGS | METH_KEYWORDS, }, { "parse_config", (PyCFunction)processor_parse_config, METH_VARARGS | METH_KEYWORDS, }, { "user_wait", (PyCFunction)processor_user_wait, METH_VARARGS | METH_KEYWORDS, }, { "process_one", (PyCFunction)processor_process_one, METH_VARARGS | METH_KEYWORDS, }, { "process_image", (PyCFunction)processor_process_image, METH_VARARGS | METH_KEYWORDS, }, { "set_data_handler", (PyCFunction)processor_set_data_handler, METH_VARARGS | METH_KEYWORDS, }, { NULL, }, }; PyTypeObject zbarProcessor_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.Processor", .tp_doc = processor_doc, .tp_basicsize = sizeof(zbarProcessor), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, .tp_new = (newfunc)processor_new, .tp_traverse = (traverseproc)processor_traverse, .tp_clear = (inquiry)processor_clear, .tp_dealloc = (destructor)processor_dealloc, .tp_getset = processor_getset, .tp_methods = processor_methods, }; zbar-0.10/python/Makefile.am.inc0000644000000000000000000000112611270371414013404 00000000000000pyexec_LTLIBRARIES += python/zbar.la python_zbar_la_CPPFLAGS = $(PYTHON_CFLAGS) $(AM_CPPFLAGS) python_zbar_la_LDFLAGS = -shared -module -avoid-version -export-dynamic \ -export-symbols-regex initzbar python_zbar_la_LIBADD = $(PYTHON_LIBS) zbar/libzbar.la $(AM_LIBADD) python_zbar_la_SOURCES = python/zbarmodule.c python/zbarmodule.h \ python/enum.c python/exception.c python/symbol.c python/symbolset.c \ python/symboliter.c python/image.c \ python/processor.c python/imagescanner.c python/decoder.c python/scanner.c EXTRA_DIST += python/test/barcode.png python/test/test_zbar.py zbar-0.10/python/scanner.c0000644000000000000000000001222011270371414012372 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" static char scanner_doc[] = PyDoc_STR( "low level intensity sample stream scanner. identifies \"bar\" edges" "and measures width between them.\n" "\n" "FIXME."); static zbarScanner* scanner_new (PyTypeObject *type, PyObject *args, PyObject *kwds) { zbarDecoder *decoder = NULL; static char *kwlist[] = { "decoder", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "|O!", kwlist, &decoder, zbarDecoder_Type)) return(NULL); zbarScanner *self = (zbarScanner*)type->tp_alloc(type, 0); if(!self) return(NULL); zbar_decoder_t *zdcode = NULL; if(decoder) { Py_INCREF(decoder); self->decoder = decoder; zdcode = decoder->zdcode; } self->zscn = zbar_scanner_create(zdcode); if(!self->zscn) { Py_DECREF(self); return(NULL); } return(self); } static int scanner_traverse (zbarScanner *self, visitproc visit, void *arg) { Py_VISIT(self->decoder); return(0); } static int scanner_clear (zbarScanner *self) { Py_CLEAR(self->decoder); return(0); } static void scanner_dealloc (zbarScanner *self) { scanner_clear(self); zbar_scanner_destroy(self->zscn); ((PyObject*)self)->ob_type->tp_free((PyObject*)self); } static PyObject* scanner_get_width (zbarScanner *self, void *closure) { unsigned int width = zbar_scanner_get_width(self->zscn); return(PyInt_FromLong(width)); } static zbarEnumItem* scanner_get_color (zbarScanner *self, void *closure) { zbar_color_t zcol = zbar_scanner_get_color(self->zscn); assert(zcol == ZBAR_BAR || zcol == ZBAR_SPACE); zbarEnumItem *color = color_enum[zcol]; Py_INCREF((PyObject*)color); return(color); } static PyGetSetDef scanner_getset[] = { { "color", (getter)scanner_get_color, }, { "width", (getter)scanner_get_width, }, { NULL, }, }; static PyObject* scanner_reset (zbarScanner *self, PyObject *args, PyObject *kwds) { static char *kwlist[] = { NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist)) return(NULL); zbar_scanner_reset(self->zscn); Py_RETURN_NONE; } static PyObject* scanner_new_scan (zbarScanner *self, PyObject *args, PyObject *kwds) { static char *kwlist[] = { NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "", kwlist)) return(NULL); zbar_scanner_new_scan(self->zscn); Py_RETURN_NONE; } static zbarEnumItem* scanner_scan_y (zbarScanner *self, PyObject *args, PyObject *kwds) { /* FIXME should accept sequence of values */ int y = 0; static char *kwlist[] = { "y", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "i", kwlist, &y)) return(NULL); zbar_symbol_type_t sym = zbar_scan_y(self->zscn, y); if(PyErr_Occurred()) /* propagate errors during callback */ return(NULL); if(sym == ZBAR_NONE) { /* hardcode most common case */ Py_INCREF((PyObject*)symbol_NONE); return(symbol_NONE); } return(zbarSymbol_LookupEnum(sym)); } static PyMethodDef scanner_methods[] = { { "reset", (PyCFunction)scanner_reset, METH_VARARGS | METH_KEYWORDS, }, { "new_scan", (PyCFunction)scanner_new_scan, METH_VARARGS | METH_KEYWORDS, }, { "scan_y", (PyCFunction)scanner_scan_y, METH_VARARGS | METH_KEYWORDS, }, { NULL, }, }; PyTypeObject zbarScanner_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.Scanner", .tp_doc = scanner_doc, .tp_basicsize = sizeof(zbarScanner), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, .tp_new = (newfunc)scanner_new, .tp_traverse = (traverseproc)scanner_traverse, .tp_clear = (inquiry)scanner_clear, .tp_dealloc = (destructor)scanner_dealloc, .tp_getset = scanner_getset, .tp_methods = scanner_methods, }; zbar-0.10/python/enum.c0000644000000000000000000001222311270371414011710 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" static char enumitem_doc[] = PyDoc_STR( "simple enumeration item.\n" "\n" "associates an int value with a name for printing."); static zbarEnumItem* enumitem_new (PyTypeObject *type, PyObject *args, PyObject *kwds) { int val = 0; PyObject *name = NULL; static char *kwlist[] = { "value", "name", NULL }; if(!PyArg_ParseTupleAndKeywords(args, kwds, "iS", kwlist, &val, &name)) return(NULL); zbarEnumItem *self = (zbarEnumItem*)type->tp_alloc(type, 0); if(!self) return(NULL); self->val.ob_ival = val; self->name = name; return(self); } static void enumitem_dealloc (zbarEnumItem *self) { Py_CLEAR(self->name); ((PyObject*)self)->ob_type->tp_free((PyObject*)self); } static PyObject* enumitem_str (zbarEnumItem *self) { Py_INCREF(self->name); return(self->name); } static int enumitem_print (zbarEnumItem *self, FILE *fp, int flags) { return(self->name->ob_type->tp_print(self->name, fp, flags)); } static PyObject* enumitem_repr (zbarEnumItem *self) { PyObject *name = PyObject_Repr(self->name); if(!name) return(NULL); char *namestr = PyString_AsString(name); PyObject *repr = PyString_FromFormat("%s(%ld, %s)", ((PyObject*)self)->ob_type->tp_name, self->val.ob_ival, namestr); Py_DECREF(name); return((PyObject*)repr); } PyTypeObject zbarEnumItem_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.EnumItem", .tp_doc = enumitem_doc, .tp_basicsize = sizeof(zbarEnumItem), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE, .tp_new = (newfunc)enumitem_new, .tp_dealloc = (destructor)enumitem_dealloc, .tp_str = (reprfunc)enumitem_str, .tp_print = (printfunc)enumitem_print, .tp_repr = (reprfunc)enumitem_repr, }; zbarEnumItem* zbarEnumItem_New (PyObject *byname, PyObject *byvalue, int val, const char *name) { zbarEnumItem *self = PyObject_New(zbarEnumItem, &zbarEnumItem_Type); if(!self) return(NULL); self->val.ob_ival = val; self->name = PyString_FromString(name); if(!self->name || (byname && PyDict_SetItem(byname, self->name, (PyObject*)self)) || (byvalue && PyDict_SetItem(byvalue, (PyObject*)self, (PyObject*)self))) { Py_DECREF((PyObject*)self); return(NULL); } return(self); } static char enum_doc[] = PyDoc_STR( "enumeration container for EnumItems.\n" "\n" "exposes items as read-only attributes"); /* FIXME add iteration */ static int enum_traverse (zbarEnum *self, visitproc visit, void *arg) { Py_VISIT(self->byname); Py_VISIT(self->byvalue); return(0); } static int enum_clear (zbarEnum *self) { Py_CLEAR(self->byname); Py_CLEAR(self->byvalue); return(0); } static void enum_dealloc (zbarEnum *self) { enum_clear(self); ((PyObject*)self)->ob_type->tp_free((PyObject*)self); } PyTypeObject zbarEnum_Type = { PyObject_HEAD_INIT(NULL) .tp_name = "zbar.Enum", .tp_doc = enum_doc, .tp_basicsize = sizeof(zbarEnum), .tp_flags = Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, .tp_dictoffset = offsetof(zbarEnum, byname), .tp_traverse = (traverseproc)enum_traverse, .tp_clear = (inquiry)enum_clear, .tp_dealloc = (destructor)enum_dealloc, }; zbarEnum* zbarEnum_New () { zbarEnum *self = PyObject_GC_New(zbarEnum, &zbarEnum_Type); if(!self) return(NULL); self->byname = PyDict_New(); self->byvalue = PyDict_New(); if(!self->byname || !self->byvalue) { Py_DECREF(self); return(NULL); } return(self); } int zbarEnum_Add (zbarEnum *self, int val, const char *name) { zbarEnumItem *item; item = zbarEnumItem_New(self->byname, self->byvalue, val, name); if(!item) return(-1); return(0); } zbar-0.10/python/zbarmodule.c0000644000000000000000000001524311270371414013115 00000000000000/*------------------------------------------------------------------------ * Copyright 2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include "zbarmodule.h" static char *exc_names[] = { "zbar.Exception", NULL, "zbar.InternalError", "zbar.UnsupportedError", "zbar.InvalidRequestError", "zbar.SystemError", "zbar.LockingError", "zbar.BusyError", "zbar.X11DisplayError", "zbar.X11ProtocolError", "zbar.WindowClosed", "zbar.WinAPIError", }; int object_to_bool (PyObject *obj, int *val) { int tmp = PyObject_IsTrue(obj); if(tmp < 0) return(0); *val = tmp; return(1); } PyObject *zbar_exc[ZBAR_ERR_NUM]; zbarEnumItem *color_enum[2]; zbarEnum *config_enum; PyObject *symbol_enum; zbarEnumItem *symbol_NONE; static PyObject* version (PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args, "")) return(NULL); unsigned int major, minor; zbar_version(&major, &minor); return(Py_BuildValue("II", major, minor)); } static PyObject* set_verbosity (PyObject *self, PyObject *args) { int verbosity; if(!PyArg_ParseTuple(args, "i", &verbosity)) return(NULL); zbar_set_verbosity(verbosity); Py_INCREF(Py_None); return(Py_None); } static PyObject* increase_verbosity (PyObject *self, PyObject *args) { if(!PyArg_ParseTuple(args, "")) return(NULL); zbar_increase_verbosity(); Py_INCREF(Py_None); return(Py_None); } static PyMethodDef zbar_functions[] = { { "version", version, METH_VARARGS, NULL }, { "set_verbosity", set_verbosity, METH_VARARGS, NULL }, { "increase_verbosity", increase_verbosity, METH_VARARGS, NULL }, { NULL, }, }; PyMODINIT_FUNC initzbar (void) { /* initialize constant containers */ config_enum = zbarEnum_New(); symbol_enum = PyDict_New(); if(!config_enum || !symbol_enum) return; /* initialize types */ zbarEnumItem_Type.tp_base = &PyInt_Type; zbarException_Type.tp_base = (PyTypeObject*)PyExc_Exception; if(PyType_Ready(&zbarException_Type) < 0 || PyType_Ready(&zbarEnumItem_Type) < 0 || PyType_Ready(&zbarEnum_Type) < 0 || PyType_Ready(&zbarImage_Type) < 0 || PyType_Ready(&zbarSymbol_Type) < 0 || PyType_Ready(&zbarSymbolSet_Type) < 0 || PyType_Ready(&zbarSymbolIter_Type) < 0 || PyType_Ready(&zbarProcessor_Type) < 0 || PyType_Ready(&zbarImageScanner_Type) < 0 || PyType_Ready(&zbarDecoder_Type) < 0 || PyType_Ready(&zbarScanner_Type) < 0) return; zbar_exc[0] = (PyObject*)&zbarException_Type; zbar_exc[ZBAR_ERR_NOMEM] = NULL; zbar_error_t ei; for(ei = ZBAR_ERR_INTERNAL; ei < ZBAR_ERR_NUM; ei++) { zbar_exc[ei] = PyErr_NewException(exc_names[ei], zbar_exc[0], NULL); if(!zbar_exc[ei]) return; } /* internally created/read-only type overrides */ zbarEnum_Type.tp_new = NULL; zbarEnum_Type.tp_setattr = NULL; zbarEnum_Type.tp_setattro = NULL; /* initialize module */ PyObject *mod = Py_InitModule("zbar", zbar_functions); if(!mod) return; /* add types to module */ PyModule_AddObject(mod, "EnumItem", (PyObject*)&zbarEnumItem_Type); PyModule_AddObject(mod, "Image", (PyObject*)&zbarImage_Type); PyModule_AddObject(mod, "Config", (PyObject*)config_enum); PyModule_AddObject(mod, "Symbol", (PyObject*)&zbarSymbol_Type); PyModule_AddObject(mod, "SymbolSet", (PyObject*)&zbarSymbolSet_Type); PyModule_AddObject(mod, "SymbolIter", (PyObject*)&zbarSymbolIter_Type); PyModule_AddObject(mod, "Processor", (PyObject*)&zbarProcessor_Type); PyModule_AddObject(mod, "ImageScanner", (PyObject*)&zbarImageScanner_Type); PyModule_AddObject(mod, "Decoder", (PyObject*)&zbarDecoder_Type); PyModule_AddObject(mod, "Scanner", (PyObject*)&zbarScanner_Type); for(ei = 0; ei < ZBAR_ERR_NUM; ei++) if(zbar_exc[ei]) PyModule_AddObject(mod, exc_names[ei] + 5, zbar_exc[ei]); /* add constants */ PyObject *dict = PyModule_GetDict(mod); color_enum[ZBAR_SPACE] = zbarEnumItem_New(dict, NULL, ZBAR_SPACE, "SPACE"); color_enum[ZBAR_BAR] = zbarEnumItem_New(dict, NULL, ZBAR_BAR, "BAR"); zbarEnum_Add(config_enum, ZBAR_CFG_ENABLE, "ENABLE"); zbarEnum_Add(config_enum, ZBAR_CFG_ADD_CHECK, "ADD_CHECK"); zbarEnum_Add(config_enum, ZBAR_CFG_EMIT_CHECK, "EMIT_CHECK"); zbarEnum_Add(config_enum, ZBAR_CFG_ASCII, "ASCII"); zbarEnum_Add(config_enum, ZBAR_CFG_MIN_LEN, "MIN_LEN"); zbarEnum_Add(config_enum, ZBAR_CFG_MAX_LEN, "MAX_LEN"); zbarEnum_Add(config_enum, ZBAR_CFG_X_DENSITY, "POSITION"); zbarEnum_Add(config_enum, ZBAR_CFG_X_DENSITY, "X_DENSITY"); zbarEnum_Add(config_enum, ZBAR_CFG_Y_DENSITY, "Y_DENSITY"); PyObject *tp_dict = zbarSymbol_Type.tp_dict; symbol_NONE = zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_NONE, "NONE"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_PARTIAL, "PARTIAL"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_EAN8, "EAN8"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_UPCE, "UPCE"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_ISBN10, "ISBN10"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_UPCA, "UPCA"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_EAN13, "EAN13"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_ISBN13, "ISBN13"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_I25, "I25"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_CODE39, "CODE39"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_PDF417, "PDF417"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_QRCODE, "QRCODE"); zbarEnumItem_New(tp_dict, symbol_enum, ZBAR_CODE128, "CODE128"); } zbar-0.10/LICENSE0000644000000000000000000006350211270371414010272 00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! zbar-0.10/zbar.nsi0000644000000000000000000002314111270371414010731 00000000000000#------------------------------------------------------------------------ # Copyright 2009 (c) Jeff Brown # # This file is part of the ZBar Bar Code Reader. # # The ZBar Bar Code Reader is free software; you can redistribute it # and/or modify it under the terms of the GNU Lesser Public License as # published by the Free Software Foundation; either version 2.1 of # the License, or (at your option) any later version. # # The ZBar Bar Code Reader is distributed in the hope that it will be # useful, but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU Lesser Public License for more details. # # You should have received a copy of the GNU Lesser Public License # along with the ZBar Bar Code Reader; if not, write to the Free # Software Foundation, Inc., 51 Franklin St, Fifth Floor, # Boston, MA 02110-1301 USA # # http://sourceforge.net/projects/zbar #------------------------------------------------------------------------ !ifndef VERSION !define VERSION "test" !endif !ifndef PREFIX !define PREFIX "\usr\mingw32\usr" !endif !define ZBAR_KEY "Software\ZBar" !define UNINSTALL_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\ZBar" OutFile zbar-${VERSION}-setup.exe SetCompressor /SOLID bzip2 InstType "Typical" InstType "Full" InstallDir $PROGRAMFILES\ZBar InstallDirRegKey HKLM ${ZBAR_KEY} "InstallDir" !define SMPROG_ZBAR "$SMPROGRAMS\ZBar Bar Code Reader" Icon ${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico UninstallIcon ${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico # do we need admin to install uninstall info? #RequestExecutionLevel admin !include "MUI2.nsh" !include "Memento.nsh" Name "ZBar" Caption "ZBar ${VERSION} Setup" !define MEMENTO_REGISTRY_ROOT HKLM !define MEMENTO_REGISTRY_KEY ${UNINSTALL_KEY} !define MUI_ABORTWARNING !define MUI_FINISHPAGE_NOAUTOCLOSE !define MUI_UNFINISHPAGE_NOAUTOCLOSE !define MUI_ICON ${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico !define MUI_UNICON ${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico !define MUI_WELCOMEFINISHPAGE_BITMAP ${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp !define MUI_UNWELCOMEFINISHPAGE_BITMAP ${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp !define MUI_HEADERIMAGE !define MUI_HEADERIMAGE_BITMAP ${NSISDIR}\Contrib\Graphics\Header\orange.bmp !define MUI_HEADERIMAGE_UNBITMAP ${NSISDIR}\Contrib\Graphics\Header\orange-uninstall.bmp !define MUI_WELCOMEPAGE_TITLE "Welcome to the ZBar ${VERSION} Setup Wizard" !define MUI_WELCOMEPAGE_TEXT \ "This wizard will guide you through the installation of the \ ZBar Bar Code Reader version ${VERSION}." !insertmacro MUI_PAGE_WELCOME !insertmacro MUI_PAGE_LICENSE "share\doc\zbar\LICENSE" !define MUI_COMPONENTSPAGE_SMALLDESC !define MUI_COMPONENTSPAGE_CHECKBITMAP ${NSISDIR}\Contrib\Graphics\Checks\simple-round2.bmp !insertmacro MUI_PAGE_COMPONENTS !insertmacro MUI_PAGE_DIRECTORY !insertmacro MUI_PAGE_INSTFILES Function ShowREADME Exec '"notepad.exe" "$INSTDIR\README.windows"' FunctionEnd !define MUI_FINISHPAGE_NOREBOOTSUPPORT !define MUI_FINISHPAGE_SHOWREADME !define MUI_FINISHPAGE_SHOWREADME_FUNCTION ShowREADME !define MUI_FINISHPAGE_LINK \ "Visit the ZBar website for the latest news, FAQs and support" !define MUI_FINISHPAGE_LINK_LOCATION "http://zbar.sourceforge.net/" !insertmacro MUI_PAGE_FINISH !insertmacro MUI_UNPAGE_CONFIRM !insertmacro MUI_UNPAGE_INSTFILES !insertmacro MUI_LANGUAGE "English" Section "ZBar Core Files (required)" SecCore DetailPrint "Installing ZBar Program and Library..." SectionIn 1 2 RO SetOutPath $INSTDIR File share\doc\zbar\README.windows File share\doc\zbar\NEWS File share\doc\zbar\TODO File share\doc\zbar\COPYING File share\doc\zbar\LICENSE # emit a batch file to add the install directory to the path FileOpen $0 zbarvars.bat w FileWrite $0 "@rem Add the ZBar installation directory to the path$\n" FileWrite $0 "@rem so programs may be run from the command prompt$\n" FileWrite $0 "@set PATH=%PATH%;$INSTDIR\bin$\n" FileWrite $0 "@cd /D $INSTDIR$\n" FileWrite $0 "@echo For basic command instructions type:$\n" FileWrite $0 "@echo zbarcam --help$\n" FileWrite $0 "@echo zbarimg --help$\n" FileWrite $0 "@echo Try running:$\n" FileWrite $0 "@echo zbarimg -d examples\barcode.png$\n" FileClose $0 SetOutPath $INSTDIR\bin File bin\libzbar-0.dll File bin\zbarimg.exe File bin\zbarcam.exe # dependencies File ${PREFIX}\bin\zlib1.dll File ${PREFIX}\bin\libjpeg-7.dll File ${PREFIX}\bin\libpng12-0.dll File ${PREFIX}\bin\libtiff-3.dll File ${PREFIX}\bin\libxml2-2.dll File ${PREFIX}\bin\libiconv-2.dll File ${PREFIX}\bin\libMagickCore-2.dll File ${PREFIX}\bin\libMagickWand-2.dll FileOpen $0 zbarcam.bat w FileWrite $0 "@set PATH=%PATH%;$INSTDIR\bin$\n" FileWrite $0 "@echo This is the zbarcam output window.$\n" FileWrite $0 "@echo Hold a bar code in front of the camera (make sure it's in focus!)$\n" FileWrite $0 "@echo and decoded results will appear below.$\n" FileWrite $0 "@echo.$\n" FileWrite $0 "@echo Initializing camera, please wait...$\n" FileWrite $0 "@echo.$\n" FileWrite $0 "@zbarcam.exe --prescale=640x480$\n" FileWrite $0 "@if errorlevel 1 pause$\n" FileClose $0 SetOutPath $INSTDIR\doc File share\doc\zbar\html\* SetOutPath $INSTDIR\examples File share\zbar\barcode.png SectionEnd #SectionGroup "Start Menu and Desktop Shortcuts" SecShortcuts Section "Start Menu Shortcuts" SecShortcutsStartMenu DetailPrint "Creating Start Menu Shortcuts..." SectionIn 1 2 SetOutPath "${SMPROG_ZBAR}" #CreateShortCut "${SMPROG_ZBAR}\ZBar.lnk" "$INSTDIR\ZBar.exe" CreateDirectory "${SMPROG_ZBAR}" CreateShortCut "zbarcam.lnk" "$\"$INSTDIR\bin\zbarcam.bat$\"" "" \ "$INSTDIR\bin\zbarcam.exe" ExpandEnvStrings $0 '%comspec%' CreateShortCut "ZBar Command Prompt.lnk" \ $0 "/k $\"$\"$INSTDIR\zbarvars.bat$\"$\"" $0 CreateShortCut "Command Reference.lnk" \ "$\"$INSTDIR\doc\ref.html$\"" SectionEnd # Section "Desktop Shortcut" SecShortcutsDesktop # DetailPrint "Creating Desktop Shortcut..." # SectionIn 1 2 # SetOutPath $INSTDIR # #CreateShortCut "$DESKTOP\ZBar.lnk" "$INSTDIR\ZBar.exe" # SectionEnd #SectionGroupEnd Section "Development Headers and Libraries" SecDevel DetailPrint "Installing ZBar Development Files..." SectionIn 2 SetOutPath $INSTDIR\include File include\zbar.h SetOutPath $INSTDIR\include\zbar File include\zbar\Video.h File include\zbar\Exception.h File include\zbar\Symbol.h File include\zbar\Image.h File include\zbar\ImageScanner.h File include\zbar\Window.h File include\zbar\Processor.h File include\zbar\Decoder.h File include\zbar\Scanner.h SetOutPath $INSTDIR\lib File lib\libzbar-0.def File lib\libzbar-0.lib SetOutPath $INSTDIR\examples File share\zbar\scan_image.cpp File share\zbar\scan_image.vcproj SectionEnd Section -post DetailPrint "Creating Registry Keys..." SetOutPath $INSTDIR WriteRegStr HKLM ${ZBAR_KEY} "InstallDir" $INSTDIR # register uninstaller WriteRegStr HKLM ${UNINSTALL_KEY} "UninstallString" \ "$\"$INSTDIR\uninstall.exe$\"" WriteRegStr HKLM ${UNINSTALL_KEY} "QuietUninstallString" \ "$\"$INSTDIR\uninstall.exe$\" /S" WriteRegStr HKLM ${UNINSTALL_KEY} "InstallLocation" "$\"$INSTDIR$\"" WriteRegStr HKLM ${UNINSTALL_KEY} "DisplayName" "ZBar Bar Code Reader" WriteRegStr HKLM ${UNINSTALL_KEY} "DisplayIcon" "$INSTDIR\bin\zbarimg.exe,0" WriteRegStr HKLM ${UNINSTALL_KEY} "DisplayVersion" "${VERSION}" WriteRegStr HKLM ${UNINSTALL_KEY} "URLInfoAbout" "http://zbar.sf.net/" WriteRegStr HKLM ${UNINSTALL_KEY} "HelpLink" "http://zbar.sf.net/" WriteRegDWORD HKLM ${UNINSTALL_KEY} "NoModify" "1" WriteRegDWORD HKLM ${UNINSTALL_KEY} "NoRepair" "1" DetailPrint "Generating Uninstaller..." WriteUninstaller $INSTDIR\uninstall.exe SectionEnd Section Uninstall DetailPrint "Uninstalling ZBar Bar Code Reader.." DetailPrint "Deleting Files..." Delete $INSTDIR\examples\barcode.png Delete $INSTDIR\examples\scan_image.cpp Delete $INSTDIR\examples\scan_image.vcproj RMDir $INSTDIR\examples RMDir /r $INSTDIR\include RMDir /r $INSTDIR\doc RMDir /r $INSTDIR\lib RMDir /r $INSTDIR\bin Delete $INSTDIR\README.windows Delete $INSTDIR\NEWS Delete $INSTDIR\TODO Delete $INSTDIR\COPYING Delete $INSTDIR\LICENSE Delete $INSTDIR\zbarvars.bat Delete $INSTDIR\uninstall.exe RMDir $INSTDIR DetailPrint "Removing Shortcuts..." RMDir /r "${SMPROG_ZBAR}" DetailPrint "Deleting Registry Keys..." DeleteRegKey HKLM ${ZBAR_KEY} DeleteRegKey HKLM ${UNINSTALL_KEY} SectionEnd !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN !insertmacro MUI_DESCRIPTION_TEXT ${SecCore} \ "The core files required to use the bar code reader" # !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcuts} \ # "Adds icons to your start menu and/or your desktop for easy access" !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcutsStartMenu} \ "Adds shortcuts to your start menu" # !insertmacro MUI_DESCRIPTION_TEXT ${SecShortcutsDesktop} \ # "Adds an icon on your desktop" !insertmacro MUI_DESCRIPTION_TEXT ${SecDevel} \ "Optional files used to develop other applications using ZBar" !insertmacro MUI_FUNCTION_DESCRIPTION_END zbar-0.10/gtk/0000777000000000000000000000000011270371535010134 500000000000000zbar-0.10/gtk/zbargtkprivate.h0000644000000000000000000000637611270371414013270 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #ifndef __ZBAR_GTK_PRIVATE_H__ #define __ZBAR_GTK_PRIVATE_H__ #include #include #include #include G_BEGIN_DECLS #define ZBAR_TYPE_GTK_PRIVATE (zbar_gtk_private_get_type()) #define ZBAR_GTK_PRIVATE(obj) \ (G_TYPE_CHECK_INSTANCE_CAST((obj), ZBAR_TYPE_GTK_PRIVATE, ZBarGtkPrivate)) #define ZBAR_GTK_PRIVATE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_CAST((klass), ZBAR_TYPE_GTK_PRIVATE, ZBarGtkPrivateClass)) #define ZBAR_IS_GTK_PRIVATE(obj) \ (G_TYPE_CHECK_INSTANCE_TYPE((obj), ZBAR_TYPE_GTK_PRIVATE)) #define ZBAR_IS_GTK_PRIVATE_CLASS(klass) \ (G_TYPE_CHECK_CLASS_TYPE((klass), ZBAR_TYPE_GTK_PRIVATE)) #define ZBAR_GTK_PRIVATE_GET_CLASS(obj) \ (G_TYPE_INSTANCE_GET_CLASS((obj), ZBAR_TYPE_GTK_PRIVATE, ZBarGtkPrivateClass)) /* zbar widget processor thread shared/private data */ typedef struct _ZBarGtkPrivate { GObject object; /* these are all owned by the main gui thread */ GThread *thread; const char *video_device; gboolean video_enabled; /* messages are queued from the gui thread to the processor thread. * each message is a GValue containing one of: * - G_TYPE_INT: state change * 1 = video enable * 0 = video disable * -1 = terminate processor thread * - G_TYPE_STRING: a named video device to open ("" to close) * - GDK_TYPE_PIXBUF: an image to scan */ GAsyncQueue *queue; /* current processor state is shared: * written by processor thread just after opening video or * scanning an image, read by main gui thread during size_request. * protected by main gui lock */ unsigned req_width, req_height; gboolean video_opened; /* window is shared: owned by main gui thread. * processor thread only calls draw() and negotiate_format(). * protected by main gui lock (and internal lock) */ zbar_window_t *window; /* video and scanner are owned by the processor thread */ zbar_video_t *video; zbar_image_scanner_t *scanner; } ZBarGtkPrivate; typedef struct _ZBarGtkPrivateClass { GObjectClass parent_class; } ZBarGtkPrivateClass; static GType zbar_gtk_private_get_type(void) G_GNUC_CONST; G_END_DECLS #endif zbar-0.10/gtk/zbargtk.c0000644000000000000000000005774411270371414011675 00000000000000/*------------------------------------------------------------------------ * Copyright 2008-2009 (c) Jeff Brown * * This file is part of the ZBar Bar Code Reader. * * The ZBar Bar Code Reader is free software; you can redistribute it * and/or modify it under the terms of the GNU Lesser Public License as * published by the Free Software Foundation; either version 2.1 of * the License, or (at your option) any later version. * * The ZBar Bar Code Reader is distributed in the hope that it will be * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with the ZBar Bar Code Reader; if not, write to the Free * Software Foundation, Inc., 51 Franklin St, Fifth Floor, * Boston, MA 02110-1301 USA * * http://sourceforge.net/projects/zbar *------------------------------------------------------------------------*/ #include #include #include #include "zbargtkprivate.h" #include "zbarmarshal.h" #ifndef G_PARAM_STATIC_STRINGS # define G_PARAM_STATIC_STRINGS (G_PARAM_STATIC_NAME | G_PARAM_STATIC_NICK | G_PARAM_STATIC_BLURB) #endif #define DEFAULT_WIDTH 640 #define DEFAULT_HEIGHT 480 /* adapted from v4l2 spec */ #define fourcc(a, b, c, d) \ ((long)(a) | ((long)(b) << 8) | \ ((long)(c) << 16) | ((long)(d) << 24)) enum { DECODED, DECODED_TEXT, LAST_SIGNAL }; enum { PROP_0, PROP_VIDEO_DEVICE, PROP_VIDEO_ENABLED, PROP_VIDEO_OPENED, }; static guint zbar_gtk_signals[LAST_SIGNAL] = { 0 }; static gpointer zbar_gtk_parent_class = NULL; /* FIXME what todo w/errors? OOM? */ /* FIXME signal failure notifications to main gui thread */ void zbar_gtk_release_pixbuf (zbar_image_t *img) { GdkPixbuf *pixbuf = zbar_image_get_userdata(img); g_assert(GDK_IS_PIXBUF(pixbuf)); /* remove reference */ zbar_image_set_userdata(img, NULL); /* release reference to associated pixbuf and it's data */ g_object_unref(pixbuf); } gboolean zbar_gtk_image_from_pixbuf (zbar_image_t *zimg, GdkPixbuf *pixbuf) { /* apparently should always be packed RGB? */ GdkColorspace colorspace = gdk_pixbuf_get_colorspace(pixbuf); if(colorspace != GDK_COLORSPACE_RGB) { g_warning("non-RGB color space not supported: %d\n", colorspace); return(FALSE); } int nchannels = gdk_pixbuf_get_n_channels(pixbuf); int bps = gdk_pixbuf_get_bits_per_sample(pixbuf); long type = 0; /* these are all guesses... */ if(nchannels == 3 && bps == 8) type = fourcc('R','G','B','3'); else if(nchannels == 4 && bps == 8) type = fourcc('B','G','R','4'); /* FIXME alpha flipped?! */ else if(nchannels == 1 && bps == 8) type = fourcc('Y','8','0','0'); else if(nchannels == 3 && bps == 5) type = fourcc('R','G','B','R'); else if(nchannels == 3 && bps == 4) type = fourcc('R','4','4','4'); /* FIXME maybe? */ else { g_warning("unsupported combination: nchannels=%d bps=%d\n", nchannels, bps); return(FALSE); } zbar_image_set_format(zimg, type); /* FIXME we don't deal w/bpl... * this will cause problems w/unpadded pixbufs :| */ unsigned pitch = gdk_pixbuf_get_rowstride(pixbuf); unsigned width = pitch / ((nchannels * bps) / 8); if((width * nchannels * 8 / bps) != pitch) { g_warning("unsupported: width=%d nchannels=%d bps=%d rowstride=%d\n", width, nchannels, bps, pitch); return(FALSE); } unsigned height = gdk_pixbuf_get_height(pixbuf); /* FIXME this isn't correct either */ unsigned long datalen = width * height * nchannels; zbar_image_set_size(zimg, width, height); /* when the zbar image is released, the pixbuf will be * automatically be released */ zbar_image_set_userdata(zimg, pixbuf); zbar_image_set_data(zimg, gdk_pixbuf_get_pixels(pixbuf), datalen, zbar_gtk_release_pixbuf); #ifdef DEBUG_ZBARGTK g_message("colorspace=%d nchannels=%d bps=%d type=%.4s(%08lx)\n" "\tpitch=%d width=%d height=%d datalen=0x%lx\n", colorspace, nchannels, bps, (char*)&type, type, pitch, width, height, datalen); #endif return(TRUE); } static inline gboolean zbar_gtk_video_open (ZBarGtk *self, const char *video_device) { ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); gboolean video_opened = FALSE; gdk_threads_enter(); zbar->req_width = DEFAULT_WIDTH; zbar->req_height = DEFAULT_HEIGHT; gtk_widget_queue_resize(GTK_WIDGET(self)); zbar->video_opened = FALSE; if(zbar->thread) g_object_notify(G_OBJECT(self), "video-opened"); if(zbar->window) { /* ensure old video doesn't have image ref * (FIXME handle video destroyed w/images outstanding) */ zbar_window_draw(zbar->window, NULL); gtk_widget_queue_draw(GTK_WIDGET(self)); } gdk_threads_leave(); if(zbar->video) { zbar_video_destroy(zbar->video); zbar->video = NULL; } if(video_device && video_device[0] && zbar->thread) { /* create video * FIXME video should support re-open */ zbar->video = zbar_video_create(); g_assert(zbar->video); if(zbar_video_open(zbar->video, video_device)) { zbar_video_error_spew(zbar->video, 0); zbar_video_destroy(zbar->video); zbar->video = NULL; /* FIXME error propagation */ return(FALSE); } /* negotiation accesses the window format list, * so we hold the lock for this part */ gdk_threads_enter(); video_opened = !zbar_negotiate_format(zbar->video, zbar->window); if(video_opened) { zbar->req_width = zbar_video_get_width(zbar->video); zbar->req_height = zbar_video_get_height(zbar->video); } gtk_widget_queue_resize(GTK_WIDGET(self)); zbar->video_opened = video_opened; if(zbar->thread) g_object_notify(G_OBJECT(self), "video-opened"); gdk_threads_leave(); } return(video_opened); } static inline int zbar_gtk_process_image (ZBarGtk *self, zbar_image_t *image) { ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); if(!image) return(-1); zbar_image_t *tmp = zbar_image_convert(image, fourcc('Y','8','0','0')); if(!tmp) return(-1); zbar_image_scanner_recycle_image(zbar->scanner, image); int rc = zbar_scan_image(zbar->scanner, tmp); zbar_image_set_symbols(image, zbar_image_get_symbols(tmp)); zbar_image_destroy(tmp); if(rc < 0) return(rc); gdk_threads_enter(); if(rc && zbar->thread) { /* update decode results */ const zbar_symbol_t *sym; for(sym = zbar_image_first_symbol(image); sym; sym = zbar_symbol_next(sym)) if(!zbar_symbol_get_count(sym)) { zbar_symbol_type_t type = zbar_symbol_get_type(sym); const char *data = zbar_symbol_get_data(sym); g_signal_emit(self, zbar_gtk_signals[DECODED], 0, type, data); /* FIXME skip this when unconnected? */ gchar *text = g_strconcat(zbar_get_symbol_name(type), zbar_get_addon_name(type), ":", data, NULL); g_signal_emit(self, zbar_gtk_signals[DECODED_TEXT], 0, text); g_free(text); } } if(zbar->window) { rc = zbar_window_draw(zbar->window, image); gtk_widget_queue_draw(GTK_WIDGET(self)); } else rc = -1; gdk_threads_leave(); return(rc); } static void *zbar_gtk_processing_thread (void *arg) { ZBarGtk *self = ZBAR_GTK(arg); if(!self->_private) return(NULL); ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); g_object_ref(zbar); g_assert(zbar->queue); g_async_queue_ref(zbar->queue); zbar->scanner = zbar_image_scanner_create(); g_assert(zbar->scanner); /* thread side enabled state */ gboolean video_enabled = FALSE; GValue *msg = NULL; while(TRUE) { if(!msg) msg = g_async_queue_pop(zbar->queue); g_assert(G_IS_VALUE(msg)); GType type = G_VALUE_TYPE(msg); if(type == G_TYPE_INT) { /* video state change */ int state = g_value_get_int(msg); if(state < 0) { /* terminate processing thread */ g_value_unset(msg); g_free(msg); msg = NULL; break; } g_assert(state >= 0 && state <= 1); video_enabled = (state != 0); } else if(type == G_TYPE_STRING) { /* open new video device */ const char *video_device = g_value_get_string(msg); video_enabled = zbar_gtk_video_open(self, video_device); } else if(type == GDK_TYPE_PIXBUF) { /* scan provided image and broadcast results */ zbar_image_t *image = zbar_image_create(); GdkPixbuf *pixbuf = GDK_PIXBUF(g_value_dup_object(msg)); if(zbar_gtk_image_from_pixbuf(image, pixbuf)) zbar_gtk_process_image(self, image); else g_object_unref(pixbuf); zbar_image_destroy(image); } else { gchar *dbg = g_strdup_value_contents(msg); g_warning("unknown message type (%x) passed to thread: %s\n", (unsigned)type, dbg); g_free(dbg); } g_value_unset(msg); g_free(msg); msg = NULL; if(video_enabled) { /* release reference to any previous pixbuf */ zbar_window_draw(zbar->window, NULL); if(zbar_video_enable(zbar->video, 1)) { zbar_video_error_spew(zbar->video, 0); video_enabled = FALSE; continue; } zbar_image_scanner_enable_cache(zbar->scanner, 1); while(video_enabled && !(msg = g_async_queue_try_pop(zbar->queue))) { zbar_image_t *image = zbar_video_next_image(zbar->video); if(zbar_gtk_process_image(self, image) < 0) video_enabled = FALSE; if(image) zbar_image_destroy(image); } zbar_image_scanner_enable_cache(zbar->scanner, 0); if(zbar_video_enable(zbar->video, 0)) { zbar_video_error_spew(zbar->video, 0); video_enabled = FALSE; } /* release video image and revert to logo */ if(zbar->window) { zbar_window_draw(zbar->window, NULL); gtk_widget_queue_draw(GTK_WIDGET(self)); } if(!video_enabled) /* must have been an error while streaming */ zbar_gtk_video_open(self, NULL); } } if(zbar->window) zbar_window_draw(zbar->window, NULL); g_object_unref(zbar); return(NULL); } static void zbar_gtk_realize (GtkWidget *widget) { ZBarGtk *self = ZBAR_GTK(widget); if(!self->_private) return; ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); GTK_WIDGET_UNSET_FLAGS(widget, GTK_DOUBLE_BUFFERED); GTK_WIDGET_SET_FLAGS(widget, GTK_REALIZED); GdkWindowAttr attributes; attributes.x = widget->allocation.x; attributes.y = widget->allocation.y; attributes.width = widget->allocation.width; attributes.height = widget->allocation.height; attributes.wclass = GDK_INPUT_OUTPUT; attributes.window_type = GDK_WINDOW_CHILD; attributes.event_mask = (gtk_widget_get_events(widget) | GDK_EXPOSURE_MASK); widget->window = gdk_window_new(gtk_widget_get_parent_window(widget), &attributes, GDK_WA_X | GDK_WA_Y); gdk_window_set_user_data(widget->window, widget); gdk_window_set_back_pixmap(widget->window, NULL, TRUE); /* attach zbar_window to underlying X window */ if(zbar_window_attach(zbar->window, gdk_x11_drawable_get_xdisplay(widget->window), gdk_x11_drawable_get_xid(widget->window))) zbar_window_error_spew(zbar->window, 0); } static inline GValue *zbar_gtk_new_value (GType type) { return(g_value_init(g_malloc0(sizeof(GValue)), type)); } static void zbar_gtk_unrealize (GtkWidget *widget) { if(GTK_WIDGET_MAPPED(widget)) gtk_widget_unmap(widget); ZBarGtk *self = ZBAR_GTK(widget); if(!self->_private) return; ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); if(zbar->video_enabled) { zbar->video_enabled = FALSE; GValue *msg = zbar_gtk_new_value(G_TYPE_INT); g_value_set_int(msg, 0); g_async_queue_push(zbar->queue, msg); } zbar_window_attach(zbar->window, NULL, 0); GTK_WIDGET_UNSET_FLAGS(widget, GTK_REALIZED); gdk_window_set_user_data(widget->window, NULL); gdk_window_destroy(widget->window); widget->window = NULL; } static void zbar_gtk_size_request (GtkWidget *widget, GtkRequisition *requisition) { ZBarGtk *self = ZBAR_GTK(widget); if(!self->_private) return; ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); /* use native video size (max) if available, * arbitrary defaults otherwise. * video attributes maintained under main gui thread lock */ requisition->width = zbar->req_width; requisition->height = zbar->req_height; } static void zbar_gtk_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { ZBarGtk *self = ZBAR_GTK(widget); if(!self->_private) return; ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); (*GTK_WIDGET_CLASS(zbar_gtk_parent_class)->size_allocate) (widget, allocation); if(zbar->window) zbar_window_resize(zbar->window, allocation->width, allocation->height); } static gboolean zbar_gtk_expose (GtkWidget *widget, GdkEventExpose *event) { ZBarGtk *self = ZBAR_GTK(widget); if(!self->_private) return(FALSE); ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); if(GTK_WIDGET_VISIBLE(widget) && GTK_WIDGET_MAPPED(widget) && zbar_window_redraw(zbar->window)) return(TRUE); return(FALSE); } void zbar_gtk_scan_image (ZBarGtk *self, GdkPixbuf *img) { if(!self->_private) return; ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); g_object_ref(G_OBJECT(img)); /* queue for scanning by the processor thread */ GValue *msg = zbar_gtk_new_value(GDK_TYPE_PIXBUF); /* this grabs a new reference to the image, * eventually released by the processor thread */ g_value_set_object(msg, img); g_async_queue_push(zbar->queue, msg); } const char *zbar_gtk_get_video_device (ZBarGtk *self) { if(!self->_private) return(NULL); ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); if(zbar->video_device) return(zbar->video_device); else return(""); } void zbar_gtk_set_video_device (ZBarGtk *self, const char *video_device) { if(!self->_private) return; ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); g_free((void*)zbar->video_device); zbar->video_device = g_strdup(video_device); zbar->video_enabled = video_device && video_device[0]; /* push another copy to processor thread */ GValue *msg = zbar_gtk_new_value(G_TYPE_STRING); if(video_device) g_value_set_string(msg, video_device); else g_value_set_static_string(msg, ""); g_async_queue_push(zbar->queue, msg); g_object_freeze_notify(G_OBJECT(self)); g_object_notify(G_OBJECT(self), "video-device"); g_object_notify(G_OBJECT(self), "video-enabled"); g_object_thaw_notify(G_OBJECT(self)); } gboolean zbar_gtk_get_video_enabled (ZBarGtk *self) { if(!self->_private) return(FALSE); ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); return(zbar->video_enabled); } void zbar_gtk_set_video_enabled (ZBarGtk *self, gboolean video_enabled) { if(!self->_private) return; ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); video_enabled = (video_enabled != FALSE); if(zbar->video_enabled != video_enabled) { zbar->video_enabled = video_enabled; /* push state change to processor thread */ GValue *msg = zbar_gtk_new_value(G_TYPE_INT); g_value_set_int(msg, zbar->video_enabled); g_async_queue_push(zbar->queue, msg); g_object_notify(G_OBJECT(self), "video-enabled"); } } gboolean zbar_gtk_get_video_opened (ZBarGtk *self) { if(!self->_private) return(FALSE); ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); return(zbar->video_opened); } static void zbar_gtk_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) { ZBarGtk *self = ZBAR_GTK(object); switch(prop_id) { case PROP_VIDEO_DEVICE: zbar_gtk_set_video_device(self, g_value_get_string(value)); break; case PROP_VIDEO_ENABLED: zbar_gtk_set_video_enabled(self, g_value_get_boolean(value)); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); } } static void zbar_gtk_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) { ZBarGtk *self = ZBAR_GTK(object); if(!self->_private) return; ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); switch(prop_id) { case PROP_VIDEO_DEVICE: if(zbar->video_device) g_value_set_string(value, zbar->video_device); else g_value_set_static_string(value, ""); break; case PROP_VIDEO_ENABLED: g_value_set_boolean(value, zbar->video_enabled); break; case PROP_VIDEO_OPENED: g_value_set_boolean(value, zbar->video_opened); default: G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec); } } static void zbar_gtk_init (ZBarGtk *self) { ZBarGtkPrivate *zbar = g_object_new(ZBAR_TYPE_GTK_PRIVATE, NULL); self->_private = (void*)zbar; zbar->window = zbar_window_create(); g_assert(zbar->window); zbar->req_width = DEFAULT_WIDTH; zbar->req_height = DEFAULT_HEIGHT; /* spawn a thread to handle decoding and video */ zbar->queue = g_async_queue_new(); zbar->thread = g_thread_create(zbar_gtk_processing_thread, self, FALSE, NULL); g_assert(zbar->thread); } static void zbar_gtk_dispose (GObject *object) { ZBarGtk *self = ZBAR_GTK(object); if(!self->_private) return; ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(self->_private); self->_private = NULL; g_free((void*)zbar->video_device); zbar->video_device = NULL; /* signal processor thread to exit */ GValue *msg = zbar_gtk_new_value(G_TYPE_INT); g_value_set_int(msg, -1); g_async_queue_push(zbar->queue, msg); zbar->thread = NULL; /* there are no external references which might call other APIs */ g_async_queue_unref(zbar->queue); g_object_unref(G_OBJECT(zbar)); } static void zbar_gtk_private_finalize (GObject *object) { ZBarGtkPrivate *zbar = ZBAR_GTK_PRIVATE(object); if(zbar->window) { zbar_window_destroy(zbar->window); zbar->window = NULL; } if(zbar->scanner) { zbar_image_scanner_destroy(zbar->scanner); zbar->scanner = NULL; } if(zbar->video) { zbar_video_destroy(zbar->video); zbar->video = NULL; } g_async_queue_unref(zbar->queue); zbar->queue = NULL; } static void zbar_gtk_class_init (ZBarGtkClass *klass) { zbar_gtk_parent_class = g_type_class_peek_parent(klass); GObjectClass *object_class = G_OBJECT_CLASS(klass); object_class->dispose = zbar_gtk_dispose; object_class->set_property = zbar_gtk_set_property; object_class->get_property = zbar_gtk_get_property; GtkWidgetClass *widget_class = (GtkWidgetClass*)klass; widget_class->realize = zbar_gtk_realize; widget_class->unrealize = zbar_gtk_unrealize; widget_class->size_request = zbar_gtk_size_request; widget_class->size_allocate = zbar_gtk_size_allocate; widget_class->expose_event = zbar_gtk_expose; widget_class->unmap = NULL; zbar_gtk_signals[DECODED] = g_signal_new("decoded", G_TYPE_FROM_CLASS(object_class), G_SIGNAL_RUN_CLEANUP, G_STRUCT_OFFSET(ZBarGtkClass, decoded), NULL, NULL, zbar_marshal_VOID__INT_STRING, G_TYPE_NONE, 2, G_TYPE_INT, G_TYPE_STRING); zbar_gtk_signals[DECODED_TEXT] = g_signal_new("decoded-text", G_TYPE_FROM_CLASS(object_class), G_SIGNAL_RUN_CLEANUP, G_STRUCT_OFFSET(ZBarGtkClass, decoded_text), NULL, NULL, g_cclosure_marshal_VOID__STRING, G_TYPE_NONE, 1, G_TYPE_STRING); GParamSpec *p = g_param_spec_string("video-device", "Video device", "the platform specific name of the video device", NULL, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property(object_class, PROP_VIDEO_DEVICE, p); p = g_param_spec_boolean("video-enabled", "Video enabled", "controls streaming from the video device", FALSE, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS); g_object_class_install_property(object_class, PROP_VIDEO_ENABLED, p); p = g_param_spec_boolean("video-opened", "Video opened", "current opened state of the video device", FALSE, G_PARAM_READABLE | G_PARAM_STATIC_STRINGS); g_object_class_install_property(object_class, PROP_VIDEO_OPENED, p); } GType zbar_gtk_get_type (void) { static GType type = 0; if(!type) { static const GTypeInfo info = { sizeof(ZBarGtkClass), NULL, /* base_init */ NULL, /* base_finalize */ (GClassInitFunc)zbar_gtk_class_init, NULL, /* class_finalize */ NULL, /* class_data */ sizeof(ZBarGtk), 0, (GInstanceInitFunc)zbar_gtk_init, }; type = g_type_register_static(GTK_TYPE_WIDGET, "ZBarGtk", &info, 0); } return(type); } static void zbar_gtk_private_class_init (ZBarGtkPrivateClass *klass) { GObjectClass *object_class = G_OBJECT_CLASS(klass); object_class->finalize = zbar_gtk_private_finalize; } static GType zbar_gtk_private_get_type (void) { static GType type = 0; if(!type) { static const GTypeInfo info = { sizeof(ZBarGtkPrivateClass), NULL, NULL, (GClassInitFunc)zbar_gtk_private_class_init, NULL, NULL, sizeof(ZBarGtkPrivate), }; type = g_type_register_static(G_TYPE_OBJECT, "ZBarGtkPrivate", &info, 0); } return(type); } GtkWidget *zbar_gtk_new (void) { return(GTK_WIDGET(g_object_new(ZBAR_TYPE_GTK, NULL))); } zbar-0.10/gtk/zbarmarshal.list0000644000000000000000000000002011270371414013237 00000000000000VOID:INT,STRING zbar-0.10/gtk/Makefile.am.inc0000644000000000000000000000137011270371414012651 00000000000000lib_LTLIBRARIES += gtk/libzbargtk.la gtk_libzbargtk_la_CPPFLAGS = -Igtk $(GTK_CFLAGS) $(AM_CPPFLAGS) gtk_libzbargtk_la_LDFLAGS = -version-info $(ZGTK_LIB_VERSION) \ -export-symbols-regex "^zbar_gtk_.*" $(AM_LDFLAGS) gtk_libzbargtk_la_LIBADD = $(GTK_LIBS) zbar/libzbar.la $(AM_LIBADD) dist_gtk_libzbargtk_la_SOURCES = gtk/zbargtk.c gtk/zbargtkprivate.h nodist_gtk_libzbargtk_la_SOURCES = gtk/zbarmarshal.c gtk/zbarmarshal.h BUILT_SOURCES += gtk/zbarmarshal.c gtk/zbarmarshal.h CLEANFILES += gtk/zbarmarshal.c gtk/zbarmarshal.h EXTRA_DIST += gtk/zbarmarshal.list %.h: %.list $(GLIB_GENMARSHAL) --g-fatal-warnings --prefix=zbar_marshal \ --header $^ > $@ %.c: %.list $(GLIB_GENMARSHAL) --g-fatal-warnings --prefix=zbar_marshal \ --body $^ > $@ zbar-0.10/HACKING0000644000000000000000000000201611270371414010245 00000000000000when hacking at ZBar, PLEASE send patches against the latest Mercurial! if you haven't already, grab the ZBar Mercurial repository by running: hg clone http://zbar.hg.sourceforge.net:8000/hgroot/zbar cd zbar autoreconf --install this will generate configure and all that other foo you usually get with a release. you will need to have recent versions of some basic "developer tools" installed in order for this to work, particularly GNU autotools. these versions of autotools are known to work (newer versions should also be fine): GNU autoconf 2.61 GNU automake 1.10.1 GNU libtool 2.2.6 when you're done hacking and want to make your patch, run: hg diff --git > hacked.patch and go post this file in the patches section off the project page: http://sourceforge.net/tracker/?group_id=189236&atid=928517 finally, some interesting reading if you want to increase your chances of patch acceptance: http://www.faqs.org/docs/artu/ch19s02.html http://www.catb.org/~esr/faqs/smart-questions.html