./1.5.1/ 0000755 0001751 0001751 00000000000 13075613637 011206 5 ustar lmeier lmeier ./1.5.1/scripts/ 0000755 0001751 0001751 00000000000 13075613451 012667 5 ustar lmeier lmeier ./1.5.1/scripts/example.script 0000755 0001751 0001751 00000002166 13075613451 015560 0 ustar lmeier lmeier #!/bin/bash
#
# $Id: example.script 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
logger -t "scanbd: $0" "Begin of $SCANBD_ACTION for device $SCANBD_DEVICE"
SANE_CONFIG_DIR=/etc/scanbd scanimage -d "$SCANBD_DEVICE" 2>&1 > /tmp/scanner.test
logger -t "scanbd: $0" "End of $SCANBD_ACTION for device $SCANBD_DEVICE"
./1.5.1/scripts/scanadf.script 0000755 0001751 0001751 00000002322 13075613451 015516 0 ustar lmeier lmeier #!/bin/bash
#
# $Id: scanadf.script 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
logger -t "scanbd: $0" "Begin of $SCANBD_ACTION for device $SCANBD_DEVICE"
scanner=$(echo "$SCANBD_DEVICE" | cut -d ':' -f 1)
SANE_CONFIG_DIR=/etc/scanbd scanadf -d "$SCANBD_DEVICE" -o "/tmp/${scanner}_${SCANBD_FUNCTION_MODE}_${SCANBD_FUNCTION}" 2>&1
logger -t "scanbd: $0" "End of $SCANBD_ACTION for device $SCANBD_DEVICE"
./1.5.1/scripts/Makefile.in 0000644 0001751 0001751 00000037057 13075613451 014750 0 ustar lmeier lmeier # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 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@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
subdir = scripts
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
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 = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(scanbdconfdir)"
SCRIPTS = $(scanbdconf_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFUSE_CFLAGS = @CONFUSE_CFLAGS@
CONFUSE_LIBS = @CONFUSE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
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@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
FGREP = @FGREP@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_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@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
OS_CPPFLAGS = @OS_CPPFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SANED_PATH = @SANED_PATH@
SANE_CFLAGS = @SANE_CFLAGS@
SANE_CONFIG = @SANE_CONFIG@
SANE_LIBS = @SANE_LIBS@
SCANBD_CFG_DIR = @SCANBD_CFG_DIR@
SCANBD_GROUP = @SCANBD_GROUP@
SCANBD_USER = @SCANBD_USER@
SCANBUTTOND_LIB_DIR = @SCANBUTTOND_LIB_DIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
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@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
scanbdconfdir = @SCANBD_CFG_DIR@/
scanbdconf_SCRIPTS = \
example.script \
scanadf.script \
test.script
EXTRA_DIST = \
example.script \
scanadf.script \
test.script
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign scripts/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign scripts/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-scanbdconfSCRIPTS: $(scanbdconf_SCRIPTS)
@$(NORMAL_INSTALL)
@list='$(scanbdconf_SCRIPTS)'; test -n "$(scanbdconfdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(scanbdconfdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(scanbdconfdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(scanbdconfdir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(scanbdconfdir)$$dir" || exit $$?; \
} \
; done
uninstall-scanbdconfSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(scanbdconf_SCRIPTS)'; test -n "$(scanbdconfdir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
dir='$(DESTDIR)$(scanbdconfdir)'; $(am__uninstall_files_from_dir)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(SCRIPTS)
installdirs:
for dir in "$(DESTDIR)$(scanbdconfdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: 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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-scanbdconfSCRIPTS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-scanbdconfSCRIPTS
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-scanbdconfSCRIPTS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-scanbdconfSCRIPTS
.PRECIOUS: Makefile
# 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:
./1.5.1/scripts/test.script 0000755 0001751 0001751 00000002252 13075613451 015100 0 ustar lmeier lmeier #!/bin/bash
#
# $Id: test.script 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# look in scanbd.conf for environment variables
logger -t "scanbd: $0" "Begin of $SCANBD_ACTION for device $SCANBD_DEVICE"
# printout all env-variables
/usr/bin/printenv > `mktemp -t scanbd.script.env.XXXXXXXXXX`
logger -t "scanbd: $0" "End of $SCANBD_ACTION for device $SCANBD_DEVICE"
./1.5.1/scripts/Makefile.am 0000644 0001751 0001751 00000000254 13075613451 014724 0 ustar lmeier lmeier scanbdconfdir = @SCANBD_CFG_DIR@/
scanbdconf_SCRIPTS = \
example.script \
scanadf.script \
test.script
EXTRA_DIST = \
example.script \
scanadf.script \
test.script
./1.5.1/scripts/copy.script 0000755 0001751 0001751 00000002263 13075613451 015075 0 ustar lmeier lmeier #!/bin/bash
#
# $Id: copy.script 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# look in scanbd.conf for environment variables
logger -t "scanbd: $0" "Begin of $SCANBD_ACTION for device $SCANBD_DEVICE"
SANE_CONFIG_DIR=/etc/scanbd /usr/bin/scanimage --mode Lineart --resolution 300 | /usr/bin/lpr -PHP
logger -t "scanbd: $0" "End of $SCANBD_ACTION for device $SCANBD_DEVICE"
./1.5.1/Makefile.include.in 0000644 0001751 0001751 00000012575 13075613451 014701 0 ustar lmeier lmeier #
# $Id: Makefile.include.in 175 2013-08-12 08:07:22Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2012 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# Makefile.conf is generated from Makefile.conf.in by makefile from automake.
# This will set package name and version
#
# DO NOT EDIT THIS FILE
# local changes shall be made in Makefile.conf
# Values set there will override the defaults here
#
#
# TODO: add systemd config here
# TODO: add udev config here
# TODO: add hald config here
#
# Include Makefile.conf for local settings
# ===============================================
#
my_name := $(lastword $(MAKEFILE_LIST))
echo := $(shell echo $(my_name))
my_path := $(shell dirname $(my_name))
-include $(my_path)/Makefile.conf
#
# Set package name and version
# ============================
#
PACKAGE = @PACKAGENAME@
PACKAGE_VERSION = @PACKAGEVERSION@
OSTYPE := $(shell uname)
PKGCFG := $(shell which pkg-config)
#
# Dbus dependencies
# =================
#
ifneq ($(findstring pkg-config, $(PKGCFG)),)
DBUS_INCLUDE := $(shell pkg-config dbus-1 --cflags)
else
DBUS_INCLUDE=
endif
#
# Set default prefix
# ===================
#
ifndef PREFIX
PREFIX := /usr/local
endif
#
# Set own directories
# ==================
#
## ifndef DESTDIR
## SCANBD_CFG_DIR = $(PREFIX)/etc/scanbd
## else
## PREFIX = $(DESTDIR)/usr
## SCANBD_CFG_DIR = $(DESTDIR)/etc/scanbd
## endif
## SCANBUTTOND_LIB_DIR=$(SCANBD_CFG_DIR)/scanbuttond/backends
##
## BIN_DIR = $(PREFIX)/bin
ifndef BIN_DIR
BIN_DIR := $(PREFIX)/sbin
endif
ifndef SCANBD_CFG_DIR
SCANBD_CFG_DIR := $(PREFIX)/etc/scanbd
endif
ifndef SCANBUTTOND_LIB_DIR
SCANBUTTOND_LIB_DIR := $(PREFIX)/lib/scanbuttond
endif
#
# Saned path
# ==========
#
ifndef SANED_PATH
SANED_PATH := $(shell PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/libexec:/usr/local/bin:/usr/local//sbin:/usr/local/libexec which saned)
endif
#
# OS dependent settings
# ======================
#
ifndef DBUS_PREFIX
ifeq ($(OSTYPE),FreeBSD)
DBUS_PREFIX := /usr/local
else
ifndef DESTDIR
DBUS_PREFIX :=
else
DBUS_PREFIX := $(DESTDIR)
endif # DESTDIR
endif # OSTYPE
endif # DBUS_PREFIX
ifndef USE_LIBUDEV
ifndef USE_HAL
ifeq ($(OSTYPE),Linux)
USE_LIBUDEV := yes
else
USE_LIBUDEV :=
endif
ifndef USE_LIBUDEV
USE_HAL := yes
endif
endif # USE_HAL
endif # USE_UDEV
#
# Use sane or scanbuttond?
# ========================
#
ifndef USE_SCANBUTTOND
USE_SANE := yes
endif
#
# Disable debugging code?
# =======================
#
ifdef NDEBUG
CPPFLAGS += -DNDEBUG
endif
#
# CPP and LD flags
# =================
#
ifeq ($(OSTYPE),Linux)
CPPFLAGS += -I/usr/include/dbus-1.0 -I/usr/lib/dbus-1.0/include $(DBUS_INCLUDE) -DHAVE_LINUX_LIMITS_H -I../scanbuttond/include
endif
ifeq ($(OSTYPE),FreeBSD)
CPPFLAGS += -I/usr/local/include -I/usr/local/include/dbus-1.0 -I/usr/local/include/dbus-1.0/include $(DBUS_INCLUDE) -I../scanbuttond/include
LDLIBS += -L/usr/local/lib
endif
ifeq ($(OSTYPE),NetBSD)
CPPFLAGS += -I/usr/pkg/include -I/usr/pkg/include/dbus-1.0 -I/usr/pkg/lib/dbus-1.0/include $(DBUS_INCLUDE) -I../scanbuttond/include
LDLIBS += -lconfuse -lpthread -ldbus-1
endif
ifeq ($(OSTYPE),OpenBSD)
USE_HAL=
CPPFLAGS += -I/usr/local/include -I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include $(DBUS_INCLUDE) -I../scanbuttond/include
LDLIBS += -L/usr/local/lib
endif
ifdef USE_SANE
CPPFLAGS += -DUSE_SANE -UUSE_SCANBUTTOND
LDLIBS += -lsane
else # USE_SANE
CPPFLAGS += -UUSE_SANE -DUSE_SCANBUTTOND -I./scanbuttond/include
LDFLAGS += -rdynamic
LDLIBS += -lusb
ifeq ($(OSTYPE),Linux)
LDLIBS += -ldl
endif
endif # USE_SANE
ifdef USE_HAL
CPPFLAGS += -DUSE_HAL
LDLIBS += -lhal
endif # USE_HAL
ifdef USE_LIBUDEV
CPPFLAGS += -DUSE_LIBUDEV
LDLIBS += -ludev
endif # USE_LIBUDEV
#
# Define common options
# ======================
#
CFLAGS += -Wall -Wextra -std=c99 -g
LDLIBS += -lconfuse -lpthread -ldbus-1
CPPFLAGS += -DSCANBD_CFG_DIR=\"$(SCANBD_CFG_DIR)\" -DSCANBUTTOND_LIB_DIR=\"$(SCANBUTTOND_LIB_DIR)\" \
-DSANED_PATH=\"$(SANED_PATH)\"
#
# SCANBD_USER
# ===========
#
ifndef SCANBD_USER
ifdef USE_LIBUDEV
SCANBD_USER := saned
else
ifeq ($(OSTYPE),OpenBSD)
SCANBD_USER := root
endif
ifeq ($(OSTYPE),FreeBSD)
SCANBD_USER := root
endif
ifeq ($(OSTYPE),NetBSD)
SCANBD_USER := root
endif
ifeq ($(OSTYPE),Linux)
SCANBD_USER := saned
endif
endif # USE_LIBUDEV
endif # SCANBD_USER
#
# SCANBD_GROUP
# ============
#
ifndef SCANBD_GROUP
ifdef USE_LIBUDEV
SCANBD_GROUP := saned
else
ifeq ($(OSTYPE),OpenBSD)
SCANBD_GROUP := lp
endif # OpenBSD
ifeq ($(OSTYPE),FreeBSD)
SCANBD_GROUP := lp
endif
ifeq ($(OSTYPE),NetBSD)
SCANBD_GROUP := lp
endif
ifeq ($(OSTYPE),Linux)
ifeq ($(shell grep scanner: /etc/passwd), "scanner:")
SCANBD_GROUP := scanner
else
SCANBD_GROUP := lp
endif
endif
endif # USE_LIBUDEV
endif # SCANBD_GROUP
./1.5.1/integration/ 0000755 0001751 0001751 00000000000 13075613565 013531 5 ustar lmeier lmeier ./1.5.1/integration/scanbd_dbus.conf 0000644 0001751 0001751 00000001152 13075613451 016640 0 ustar lmeier lmeier
./1.5.1/integration/Makefile.in 0000644 0001751 0001751 00000036306 13075613451 015600 0 ustar lmeier lmeier # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 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@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
subdir = integration
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
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 = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(systemdsystemunitdir)"
DATA = $(systemdsystemunit_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in README
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFUSE_CFLAGS = @CONFUSE_CFLAGS@
CONFUSE_LIBS = @CONFUSE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
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@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
FGREP = @FGREP@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_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@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
OS_CPPFLAGS = @OS_CPPFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SANED_PATH = @SANED_PATH@
SANE_CFLAGS = @SANE_CFLAGS@
SANE_CONFIG = @SANE_CONFIG@
SANE_LIBS = @SANE_LIBS@
SCANBD_CFG_DIR = @SCANBD_CFG_DIR@
SCANBD_GROUP = @SCANBD_GROUP@
SCANBD_USER = @SCANBD_USER@
SCANBUTTOND_LIB_DIR = @SCANBUTTOND_LIB_DIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
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@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
99-saned.rules \
FreeBSD.rc \
saned.fdi \
scanbd_dbus.conf \
scanbd.debian \
scanbdservice.conf \
systemd/de.kmux.scanbd.server.service \
systemd/README.systemd
@HAVE_SYSTEMD_TRUE@systemdsystemunit_DATA = \
@HAVE_SYSTEMD_TRUE@ systemd/scanbd.service \
@HAVE_SYSTEMD_TRUE@ systemd/scanbm@.service \
@HAVE_SYSTEMD_TRUE@ systemd/scanbm.socket
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign integration/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign integration/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-systemdsystemunitDATA: $(systemdsystemunit_DATA)
@$(NORMAL_INSTALL)
@list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(systemdsystemunitdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(systemdsystemunitdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(systemdsystemunitdir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(systemdsystemunitdir)" || exit $$?; \
done
uninstall-systemdsystemunitDATA:
@$(NORMAL_UNINSTALL)
@list='$(systemdsystemunit_DATA)'; test -n "$(systemdsystemunitdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(systemdsystemunitdir)'; $(am__uninstall_files_from_dir)
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(DATA)
installdirs:
for dir in "$(DESTDIR)$(systemdsystemunitdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: 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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-systemdsystemunitDATA
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-systemdsystemunitDATA
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip install-systemdsystemunitDATA installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-systemdsystemunitDATA
.PRECIOUS: Makefile
# 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:
./1.5.1/integration/saned.fdi 0000644 0001751 0001751 00000000505 13075613451 015301 0 ustar lmeier lmeier
saned
./1.5.1/integration/check_usb_autosuspend.sh 0000755 0001751 0001751 00000002150 13075613451 020440 0 ustar lmeier lmeier #!/bin/bash
# $Id: check_usb_autosuspend.sh 199 2014-12-11 20:52:17Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2014 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# check to see if autosuspend is "off", that is power is "on"
for d in /sys/bus/usb/devices/*; do
if [ -e "$d/power/control" -a -e "$d/product" ]; then
cat "$d/product"
cat "$d/power/control"
fi
done
./1.5.1/integration/scanbdservice.conf 0000644 0001751 0001751 00000002504 13075613565 017214 0 ustar lmeier lmeier # scanbd - scanner button daemon
# $Id: scanbdservice.conf 241 2017-04-19 07:53:25Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
description "Scanner button daemon Service"
start on (filesystem and started dbus)
stop on stopping dbus
respawn
# let this env-var point to the place where the real sane configs are
# strip down the /etc/sane/dll.conf to the net-backend
env SANE_CONFIG_DIR=/usr/local/etc/scanbd
pre-start script
rm -f /var/run/scanbd.pid
end script
exec /usr/local/bin/scanbd -f -c /usr/local/etc/scanbd/scanbd.conf
./1.5.1/integration/Makefile.am 0000644 0001751 0001751 00000000467 13075613451 015566 0 ustar lmeier lmeier EXTRA_DIST = \
99-saned.rules \
FreeBSD.rc \
saned.fdi \
scanbd_dbus.conf \
scanbd.debian \
scanbdservice.conf \
systemd/de.kmux.scanbd.server.service \
systemd/README.systemd
if HAVE_SYSTEMD
systemdsystemunit_DATA = \
systemd/scanbd.service \
systemd/scanbm@.service \
systemd/scanbm.socket
endif
./1.5.1/integration/99-saned.rules 0000644 0001751 0001751 00000001774 13075613451 016141 0 ustar lmeier lmeier # $Id: 99-saned.rules 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# change group to saned for sane devices
# needed for saned to get scanner access
ENV{libsane_matched}=="yes", GROUP="saned"
./1.5.1/integration/scanbd.debian 0000755 0001751 0001751 00000011253 13075613451 016126 0 ustar lmeier lmeier #! /bin/sh
#
# $Id: scanbd.debian 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
### BEGIN INIT INFO
# Provides: scanbd
# Required-Start: $local_fs $remote_fs
# Required-Stop: $local_fs $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Scanner button events daemon
# Description: scanbd associates actions to scanner buttons
### END INIT INFO
# Do NOT "set -e"
# PATH should only include /usr/* if it runs after the mountnfs.sh script
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="SANE scanner button daemon"
NAME=scanbd
DAEMON=/usr/local/bin/$NAME
DAEMON_ARGS="-c /usr/local/etc/scanbd/scanbd.conf"
PIDFILE=/var/run/$NAME.pid
SCRIPTNAME=/etc/init.d/$NAME
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
export SANE_CONFIG_DIR=/usr/local/etc/scanbd
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
|| return 1
start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- \
$DAEMON_ARGS \
|| return 2
}
#
# Function that stops the daemon/service
#
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME
RETVAL="$?"
[ "$RETVAL" = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
#
# Function that sends a SIGHUP to the daemon/service
#
do_reload() {
#
# If the daemon can reload its configuration without
# restarting (for example, when it is sent a SIGHUP),
# then implement that here.
#
start-stop-daemon --stop --signal 1 --quiet --pidfile $PIDFILE --name $NAME
return 0
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
stop)
[ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"
do_stop
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
#reload|force-reload)
#
# If do_reload() is not implemented then leave this commented out
# and leave 'force-reload' as an alias for 'restart'.
#
#log_daemon_msg "Reloading $DESC" "$NAME"
#do_reload
#log_end_msg $?
#;;
restart|force-reload)
#
# If the "reload" option is implemented then remove the
# 'force-reload' alias
#
log_daemon_msg "Restarting $DESC" "$NAME"
do_stop
case "$?" in
0|1)
do_start
case "$?" in
0) log_end_msg 0 ;;
1) log_end_msg 1 ;; # Old process is still running
*) log_end_msg 1 ;; # Failed to start
esac
;;
*)
# Failed to stop
log_end_msg 1
;;
esac
;;
status)
status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*)
echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload|status}" >&2
exit 3
;;
esac
:
./1.5.1/integration/systemd/ 0000755 0001751 0001751 00000000000 13075613451 015213 5 ustar lmeier lmeier ./1.5.1/integration/systemd/scanbm@.service.sane-git 0000644 0001751 0001751 00000002127 13075613451 021650 0 ustar lmeier lmeier # $Id: FreeBSD.rc 154 2013-01-06 07:24:56Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
[Unit]
Description=Scanner Service
Requires=scanbm.socket
[Service]
ExecStart=/usr/sbin/scanbm
User=saned
Group=saned
StandardInput=null
StandardOutput=syslog
StandardError=syslog
Environment=SANE_CONFIG_DIR=/etc/scanbd
./1.5.1/integration/systemd/scanbm.socket 0000644 0001751 0001751 00000002006 13075613451 017666 0 ustar lmeier lmeier # $Id: scanbm.socket 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
[Unit]
Description=scanbd/saned incoming socket
[Socket]
ListenStream=6566
Accept=yes
MaxConnections=1
[Install]
WantedBy=sockets.target
./1.5.1/integration/systemd/scanbd.service 0000644 0001751 0001751 00000002344 13075613451 020032 0 ustar lmeier lmeier # $Id: scanbd.service 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
[Unit]
Description=Scanner button polling Service
[Service]
Type=simple
ExecStart=/usr/sbin/scanbd -f -c /etc/scanbd/scanbd.conf
#ExecReload=?
Environment=SANE_CONFIG_DIR=/etc/scanbd
StandardInput=null
StandardOutput=syslog
StandardError=syslog
#NotifyAccess=?
[Install]
WantedBy=multi-user.target
Also=scanbm.socket
Alias=dbus-de.kmux.scanbd.server.service
./1.5.1/integration/systemd/de.kmux.scanbd.server.service 0000644 0001751 0001751 00000002200 13075613451 022700 0 ustar lmeier lmeier # $Id: de.kmux.scanbd.server.service 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
[D-BUS Service]
Name=de.kmux.scanbd.server
SystemdService=dbus-de.kmux.scanbd.server.service
# This service should not be bus activated if systemd isn't running,
# so that activation won't conflict with the init script startup.
Exec=/bin/false
./1.5.1/integration/systemd/README.systemd 0000644 0001751 0001751 00000003753 13075613451 017572 0 ustar lmeier lmeier Files
=====
This directory includes the file required specifically for systemd integration.
This is a work in progress and may change as development progresses.
The following unit files should be installed in /lib/systemd/system or
/etc/systemd/system:
scanbd.service
scanbm@.service
scanbm.socket
The file scanbm@.service.sane-git is a replacement for scanbm@.service for the
case where you use the git version of sane. That has a patch that adds full
systemd support to saned. That will allow you to add SANE_DEBUG_
environment variables and use the system log or systemd-journalctl to watch
the debugging outputs. If you want to use it, it needs to be copied to
/lib/systemd/system/scanbm@.service. Systemd socket activation also requires
the patch in scanbd added after release of version 1.3
The following files goes into the dbus services directory
/usr/share/dbus-1/system-services:
de.kmux.scanbd.server.service
Now enable the units:
systemctl enable scanbd.service
systemctl enable scanbm.socket
and start them:
systemctl start scanbd.service
systemctl start scanbm.socket
Background
==========
Systemd setup
-------------
scanbd.service starts scanbd in polling mode to monitor the scanner for
button-presses. It also defines the dbus service that we use to avoid double
activation. The Environment directive allows for specification of the initial
environment. The sample contains the setting of SANE_CONFIG_DIR to point to
my scanbd configuration directory in /etc
Scanbd.socket defines the port for saned.
Scanbm@.service defines the settings for scanbd in manager mode. It gets
activated when an application wants to scan and opens the saned port.
Dbus setup for systemd
----------------------
de.kmux.scanbd.server.service tells dbus that it does not need to start a
process when a message for scanbd is received on the message bus, but that
that responsibility is delegated to systemd.
Please note that the scanbd_dbus.conf still needs to be installed in
/etc/dbus-1/system.d
./1.5.1/integration/systemd/scanbm@.service 0000644 0001751 0001751 00000002112 13075613451 020134 0 ustar lmeier lmeier # $Id: FreeBSD.rc 154 2013-01-06 07:24:56Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
[Unit]
Description=Scanner Service
Requires=scanbm.socket
[Service]
ExecStart=/usr/sbin/scanbm -c /etc/scanbd/scanbd.conf
User=daemon
Group=scanner
StandardInput=socket
Environment=SANE_CONFIG_DIR=/etc/scanbd
./1.5.1/integration/FreeBSD.rc 0000755 0001751 0001751 00000002565 13075613451 015276 0 ustar lmeier lmeier #!/bin/sh
# $Id: FreeBSD.rc 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# scanbd - scanner button daemon
# Install this file as /usr/local/etc/rc.d/scanbd
#
# PROVIDE: scanbd
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf[.local] to enable scanbd:
# scanbd_enable="YES"
. /etc/rc.subr
name=scanbd
rcvar=scanbd_enable
load_rc_config scanbd
: ${scanbd_enable:="NO"}
command="/usr/local/sbin/scanbd"
start_precmd=scanbd_prestart
scanbd_prestart()
{
export SANE_CONFIG_DIR=/usr/local/etc/scanbd
}
command_args=""
run_rc_command "$1"
./1.5.1/integration/sane-port 0000644 0001751 0001751 00000000450 13075613451 015355 0 ustar lmeier lmeier service sane-port
{
port = 6566
socket_type = stream
wait = no
user = saned
group = scanner
server = /usr/local/bin/scanbm
server_args = scanbm -c /usr/local/etc/scanbd/scanbd.conf
disable = no
}
./1.5.1/integration/98-snapscan.rules 0000644 0001751 0001751 00000002140 13075613451 016640 0 ustar lmeier lmeier # $Id: 98-snapscan.rules 199 2014-12-11 20:52:17Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2014 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# turn off usb suspend for EPSON 1670
ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="04b8", ATTRS{idProduct}=="011f", TEST=="power/control", ATTR{power/control}="on", RUN="/usr/bin/logger turn off usb suspend for %p"
./1.5.1/integration/README 0000644 0001751 0001751 00000003270 13075613451 014405 0 ustar lmeier lmeier $Id: README 218 2016-02-19 18:48:21Z wimalopaan $
scanbd - KMUX scanner button daemon
Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
---------------
This directory contains a number of files that help with the integration
of scanbd in your operating system.
99-saned.rules: Change group of dev
FreeBSD.rc The FreeBSD startup script. Shall be installed
as /usr/local/etc/rc.d/scanbd. Read the file for
information on how to enable startup
saned.fdi HAL configuration file
scanbd_dbus.conf Required for dbus. Shall be instaled in
(/usr/local/)/etc/dbus-1/system.d
Check the userid (saned) and change as appropriate
for your system (it shall match the userid in
scanbd.conf)
scanbd.debian Startup script for debian based systems
scanbdservice.conf Startup start-stop script for scanbd
systemd/ contains the files required for systemd startup
sane-port for systems using xinetd instead of inetd (e.g. openSuse),
put this file into /etc/xinted.d
./1.5.1/contrib/ 0000755 0001751 0001751 00000000000 13075613451 012640 5 ustar lmeier lmeier ./1.5.1/contrib/PKGBUILD 0000644 0001751 0001751 00000001314 13075613451 013763 0 ustar lmeier lmeier # $Id: PKGBUILD 154 2013-01-06 07:24:56Z wimalopaan $
# Maintainer: Tobias Powalowski
# Contributor: arjan
pkgname=libusb-compat
srcname=libusb
pkgver=0.1.12
pkgrel=1
pkgdesc="Library to enable user space application programs to communicate with USB devices"
arch=('i686' 'x86_64')
depends=('sh')
url="http://libusb.sourceforge.net/"
license=('LGPL')
source=(ftp://ftp.slackware.at/slackware-11.0/source/l/libusb/libusb-0.1.12.tar.gz)
options=('!libtool')
md5sums=('caf182cbc7565dac0fd72155919672e6')
build() {
cd ${srcdir}/${srcname}-${pkgver}
./configure --prefix=/usr
make
}
package() {
cd ${srcdir}/${srcname}-${pkgver}
make DESTDIR=${pkgdir} install
}
./1.5.1/contrib/Makefile.in 0000644 0001751 0001751 00000037033 13075613451 014713 0 ustar lmeier lmeier # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 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@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
subdir = contrib
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
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 = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(scanbdconfdir)"
SCRIPTS = $(scanbdconf_SCRIPTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFUSE_CFLAGS = @CONFUSE_CFLAGS@
CONFUSE_LIBS = @CONFUSE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
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@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
FGREP = @FGREP@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_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@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
OS_CPPFLAGS = @OS_CPPFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SANED_PATH = @SANED_PATH@
SANE_CFLAGS = @SANE_CFLAGS@
SANE_CONFIG = @SANE_CONFIG@
SANE_LIBS = @SANE_LIBS@
SCANBD_CFG_DIR = @SCANBD_CFG_DIR@
SCANBD_GROUP = @SCANBD_GROUP@
SCANBD_USER = @SCANBD_USER@
SCANBUTTOND_LIB_DIR = @SCANBUTTOND_LIB_DIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
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@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
scanbdconfdir = @SCANBD_CFG_DIR@/
scanbdconf_SCRIPTS = \
action.script \
insert.script
EXTRA_DIST = \
PKGBUILD \
action.script \
insert.script
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign contrib/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign contrib/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-scanbdconfSCRIPTS: $(scanbdconf_SCRIPTS)
@$(NORMAL_INSTALL)
@list='$(scanbdconf_SCRIPTS)'; test -n "$(scanbdconfdir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(scanbdconfdir)'"; \
$(MKDIR_P) "$(DESTDIR)$(scanbdconfdir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n' \
-e 'h;s|.*|.|' \
-e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) { files[d] = files[d] " " $$1; \
if (++n[d] == $(am__install_max)) { \
print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
else { print "f", d "/" $$4, $$1 } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(scanbdconfdir)$$dir'"; \
$(INSTALL_SCRIPT) $$files "$(DESTDIR)$(scanbdconfdir)$$dir" || exit $$?; \
} \
; done
uninstall-scanbdconfSCRIPTS:
@$(NORMAL_UNINSTALL)
@list='$(scanbdconf_SCRIPTS)'; test -n "$(scanbdconfdir)" || exit 0; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 's,.*/,,;$(transform)'`; \
dir='$(DESTDIR)$(scanbdconfdir)'; $(am__uninstall_files_from_dir)
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(SCRIPTS)
installdirs:
for dir in "$(DESTDIR)$(scanbdconfdir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: 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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-scanbdconfSCRIPTS
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am: uninstall-scanbdconfSCRIPTS
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-scanbdconfSCRIPTS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-generic \
mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
uninstall-am uninstall-scanbdconfSCRIPTS
.PRECIOUS: Makefile
# 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:
./1.5.1/contrib/actions.script 0000644 0001751 0001751 00000011721 13075613451 015530 0 ustar lmeier lmeier #!/bin/bash
#
# Scanbd actions script v1.0 for EPSON Perfection V200 Photo (4 buttons)
#
# Copyright (C) 2012 - The Home Server Handbook - thehomeserverhandbook.com
#
# 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, see .
#
# *************************
#
# Usage:
#
# Press [Start] button to scan a document and save it as a JPEG image.
# In Pdf mode, pressing the [Start] button scans the next page.
#
# Press [Copy] button to scan and print a single page document.
#
# Press [Email] button to scan a document and save it as a JPEG attachment
# to an .eml file. To edit the email, import / drag'n drop it in the drafts
# folder of your preferred eml compatible email client.
# In Pdf mode, pressing the [Email] button saves the scan(s) as a single
# PDF attachment to an .eml file.
#
# Press [Pdf] button to enter Pdf mode and scan the first page of a
# document. Then, each press on the [Start] button scans the next page.
# Finally, press again the [Pdf] button to save the scan(s) as a PDF file
# and exit the Pdf mode.
TMPDIR="/mnt/data/tmp/"
SCANDIR="/mnt/data/Public/Scans/" # modify according to your own setup
FILENAME="scan-`date +%F_%H%M%S`"
PAGEBASE="page-"
TIMEOUT="2" # in minutes, specify auto escape delay for the Pdf mode
PRINTER="Lexmark_E260d" # modify according to your own setup
EMAIL="someone@example.org" # email address of receiver
USER="user" # useful when saving scans in NFS shared directory
GROUP="group" # useful when saving scans in NFS shared directory
export MAGICK_TMPDIR="${TMPDIR}" # Override default cache of convert command. Needed for systems with very small /tmp (e.g. ramdisk).
case "$SCANBD_ACTION" in
scan)
STARTANEW=`find ${TMPDIR} -mindepth 1 -maxdepth 1 -name "${PAGEBASE}*.tif" -mmin -${TIMEOUT} 2> /dev/null | wc -l`
if [ "0${STARTANEW}" -eq 0 ]; then
scanimage -d "$SCANBD_DEVICE" \
--icc-profile=/usr/share/color/icc/sRGB.icm --format=tiff \
--mode=Color --depth=8 --resolution=300 \
> "${TMPDIR}${FILENAME}.tif"
convert -rotate 180 "${TMPDIR}${FILENAME}.tif" "${SCANDIR}${FILENAME}.jpg"
chown "${USER}:${GROUP}" "${SCANDIR}${FILENAME}.jpg"
rm "${TMPDIR}${FILENAME}.tif"
else
NEXTPAGE=`expr 1 + \`ls -1 "${TMPDIR}${PAGEBASE}"*.tif | wc -l\``
scanimage -d "$SCANBD_DEVICE" \
--icc-profile=/usr/share/color/icc/sRGB.icm --format=tiff \
--mode=Color --depth=8 --resolution=150 \
> "${TMPDIR}${PAGEBASE}`printf %.5d ${NEXTPAGE}`.tif"
fi
;;
copy)
scanimage -d "$SCANBD_DEVICE" --format=tiff --mode=Gray --depth=8 \
--resolution=300 \
| convert - -density 300 ps:- \
| lp -d "${PRINTER}"
;;
email)
STARTANEW=`find "${TMPDIR}" -mindepth 1 -maxdepth 1 -name "${PAGEBASE}*.tif" -mmin -${TIMEOUT} 2> /dev/null | wc -l`
if [ "0${STARTANEW}" -eq 0 ]; then
scanimage -d "$SCANBD_DEVICE" \
--icc-profile=/usr/share/color/icc/sRGB.icm --format=tiff \
--mode=Color --depth=8 --resolution=150 \
> "${TMPDIR}${FILENAME}.tif"
convert -rotate 180 "${TMPDIR}${FILENAME}.tif" "${TMPDIR}${FILENAME}.jpg"
touch "${TMPDIR}${FILENAME}.txt"
mpack -s "Scanned document ${FILENAME}" -d "${TMPDIR}${FILENAME}.txt" \
-o "${TMPDIR}${FILENAME}.eml" "${TMPDIR}${FILENAME}.jpg"
cat "${TMPDIR}${FILENAME}.eml" | sendmail -v "${EMAIL}"
rm "${TMPDIR}${FILENAME}.tif" "${TMPDIR}${FILENAME}.eml" "${TMPDIR}${FILENAME}.jpg" "${TMPDIR}${FILENAME}.txt"
else
convert -rotate 180 -units PixelsPerInch -density 150 -compress jpeg \
"${TMPDIR}${PAGEBASE}"*.tif "${TMPDIR}${FILENAME}.pdf"
touch "${TMPDIR}${FILENAME}.txt"
mpack -s "Scanned document ${FILENAME}" -d "${TMPDIR}${FILENAME}.txt" \
-o "${TMPDIR}${FILENAME}.eml" "${TMPDIR}${FILENAME}.pdf"
cat "${TMPDIR}${FILENAME}.eml" | sendmail -v "${EMAIL}"
rm "${TMPDIR}${PAGEBASE}"*.tif "${TMPDIR}${FILENAME}.eml" "${TMPDIR}${FILENAME}.pdf" "${TMPDIR}${FILENAME}.txt"
fi
;;
file)
STARTANEW=`find "${TMPDIR}" -mindepth 1 -maxdepth 1 -name "${PAGEBASE}*.tif" -mmin -${TIMEOUT} 2> /dev/null | wc -l`
if [ "0${STARTANEW}" -eq 0 ]; then
rm "${TMPDIR}${PAGEBASE}"*.tif &> /dev/null
scanimage -d "$SCANBD_DEVICE" \
--icc-profile=/usr/share/color/icc/sRGB.icm --format=tiff \
--mode=Color --depth=8 --resolution=150 \
> "${TMPDIR}${PAGEBASE}00001.tif"
else
convert -rotate 180 -units PixelsPerInch -density 150 -compress jpeg \
"${TMPDIR}${PAGEBASE}"*.tif "${SCANDIR}${FILENAME}.pdf"
chown "${USER}:${GROUP}" "${SCANDIR}${FILENAME}.pdf"
rm "${TMPDIR}${PAGEBASE}"*.tif
fi
;;
esac
exit 0
./1.5.1/contrib/action.script 0000644 0001751 0001751 00000003360 13075613451 015345 0 ustar lmeier lmeier #!/bin/bash
# Author: Rastislav David
scan_dir=/var/spool/scan
datetime=`date +%F_%H%M%S`
filename="scan-$datetime"
send_to=email@address.com
case "$SCANBD_ACTION" in
pdf)
logger -t "scanbd: $0" "$SCANBD_ACTION - scanning and converting to ps"
scanimage -d "$SCANBD_DEVICE" --mode Color --resolution 150 --depth 16 |
convert -density 150 - "$scan_dir/$filename.ps"
logger -t "scanbd: $0" "$SCANBD_ACTION - converting ps to pdf"
ps2pdf -sPAPERSIZE=a4 "$scan_dir/$filename.ps" "$scan_dir/$filename.pdf"
rm "$scan_dir/$filename.ps"
;;
scan)
scanimage -d "$SCANBD_DEVICE" --resolution 150 --mode Color --depth 16 --format=tiff > "$scan_dir/$filename.tiff"
;;
copy)
logger -t "scanbd: $0" "$SCANBD_ACTION - scanning"
scanimage -d "$SCANBD_DEVICE" --resolution 300 --depth 16--format=tiff > "$scan_dir/$filename.tiff"
# | convert -density 300 - $scan_dir/$filename.ps
logger -t "scanbd: $0" "$SCANBD_ACTION - printing"
lp "$scan_dir/$filename.tiff"
rm "$scan_dir/$filename.tiff"
;;
email)
logger -t "scanbd: $0" "$SCANBD_ACTION - scanning and converting to ps"
scanimage -d "$SCANBD_DEVICE" --mode Color --resolution 150 --depth 16 |
convert -density 150 - "$scan_dir/$filename.ps"
logger -t "scanbd: $0" "$SCANBD_ACTION - converting ps to pdf"
ps2pdf -sPAPERSIZE=a4 "$scan_dir/$filename.ps" "$scan_dir/$filename.pdf"
logger -t "scanbd: $0" "$SCANBD_ACTION - sending pdf"
(cat <" -s "Document $filename" "$send_to"
rm "$scan_dir/$filename.ps"
rm "$scan_dir/$filename.pdf"
;;
*)
logger -t "scanbd: $0" "Unhandled action request."
;;
esac
exit 0
./1.5.1/contrib/Makefile.am 0000644 0001751 0001751 00000000230 13075613451 014667 0 ustar lmeier lmeier scanbdconfdir = @SCANBD_CFG_DIR@/
scanbdconf_SCRIPTS = \
action.script \
insert.script
EXTRA_DIST = \
PKGBUILD \
action.script \
insert.script
./1.5.1/contrib/insert.script 0000644 0001751 0001751 00000001665 13075613451 015402 0 ustar lmeier lmeier #! /bin/bash
# Example device insertion script.
# It can be necessary to load firmware into the device when it is first
# inserted. For example, scanbuttond backend does not know how to load
# scanner firmware.
# A simple command "scanimage -L" invokes saned and it loads the appropriate
# firmware if necessary.
# This script receives environmental variables:
# SCANBD_DEVICE - device name (fixed string "dbus device" for dbus notification)
# SCANBD_ACTION - "insert" or "remove", so one script can be used.
# To use, add this line to "global" section of scanbd.conf:
# device_insert_script = "insert.script"
# Author: Ilya I
logger="/usr/bin/logger"
#$logger -t "scanbd: $0" "SCANBD_DEVICE=$SCANBD_DEVICE SCANBD_ACTION=$SCANBD_ACTION"
"$logger" -t "scanbd: $0" "Loading firmware for $SCANBD_DEVICE"
/usr/bin/scanimage -L 2>&1 | "$logger" -t "scanbd: $0"
"$logger" -t "scanbd: $0" "Done loading firmware for $SCANBD_DEVICE"
./1.5.1/Makefile.in 0000644 0001751 0001751 00000063671 13075613451 013262 0 ustar lmeier lmeier # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 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@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(am__DIST_COMMON)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
configure.lineno config.status.lineno
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
DATA = $(noinst_DATA)
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
cscope distdir dist dist-all distcheck
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
CSCOPE = cscope
DIST_SUBDIRS = src/scanbd conf integration scripts contrib doc \
src/scanbuttond
am__DIST_COMMON = $(srcdir)/Makefile.in AUTHORS compile config.guess \
config.sub depcomp install-sh ltmain.sh missing
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
if test -d "$(distdir)"; then \
find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
&& rm -rf "$(distdir)" \
|| { sleep 5 && rm -rf "$(distdir)"; }; \
else :; fi
am__post_remove_distdir = $(am__remove_distdir)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
| sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFUSE_CFLAGS = @CONFUSE_CFLAGS@
CONFUSE_LIBS = @CONFUSE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
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@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
FGREP = @FGREP@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_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@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
OS_CPPFLAGS = @OS_CPPFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SANED_PATH = @SANED_PATH@
SANE_CFLAGS = @SANE_CFLAGS@
SANE_CONFIG = @SANE_CONFIG@
SANE_LIBS = @SANE_LIBS@
SCANBD_CFG_DIR = @SCANBD_CFG_DIR@
SCANBD_GROUP = @SCANBD_GROUP@
SCANBD_USER = @SCANBD_USER@
SCANBUTTOND_LIB_DIR = @SCANBUTTOND_LIB_DIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
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@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
ACLOCAL_AMFLAGS = -I m4
@USE_SCANBUTTOND_FALSE@SUBDIRS = src/scanbd conf integration scripts \
@USE_SCANBUTTOND_FALSE@ contrib doc
@USE_SCANBUTTOND_TRUE@SUBDIRS = src/scanbuttond src/scanbd conf conf \
@USE_SCANBUTTOND_TRUE@ integration scripts contrib doc
DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
EXTRA_DIST = \
Makefile.simple \
Makefile.conf.in \
Makefile.conf \
Makefile.include.in \
Makefile.include
noinst_DATA = \
Makefile.conf \
Makefile.include
all: all-recursive
.SUFFIXES:
am--refresh: Makefile
@:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
&& exit 0; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign 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: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
distclean-libtool:
-rm -f libtool config.lt
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscope: cscope.files
test ! -s cscope.files \
|| $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
clean-cscope:
-rm -f cscope.files
cscope.files: clean-cscope cscopelist
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
-rm -f cscope.out cscope.in.out cscope.po.out cscope.files
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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
-test -n "$(am__skip_mode_fix)" \
|| find "$(distdir)" -type d ! -perm -755 \
-exec chmod u+rwx,go+rx {} \; -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) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
$(am__post_remove_distdir)
dist-bzip2: distdir
tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
$(am__post_remove_distdir)
dist-lzip: distdir
tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
$(am__post_remove_distdir)
dist-xz: distdir
tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
$(am__post_remove_distdir)
dist-tarZ: distdir
@echo WARNING: "Support for distribution archives compressed with" \
"legacy program 'compress' is deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
$(am__post_remove_distdir)
dist-shar: distdir
@echo WARNING: "Support for shar distribution archives is" \
"deprecated." >&2
@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
$(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
$(am__post_remove_distdir)
dist dist-all:
$(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
$(am__post_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*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
*.tar.lz*) \
lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
*.shar.gz*) \
eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
*.zip*) \
unzip $(distdir).zip ;;\
esac
chmod -R a-w $(distdir)
chmod u+w $(distdir)
mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
&& dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build/sub \
&& ../../configure \
$(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
--srcdir=../.. --prefix="$$dc_install_base" \
&& $(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 \
&& cd "$$am__cwd" \
|| exit 1
$(am__post_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:
@test -n '$(distuninstallcheck_dir)' || { \
echo 'ERROR: trying to run $@ with an empty' \
'$$(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
$(am__cd) '$(distuninstallcheck_dir)' || { \
echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
exit 1; \
}; \
test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { 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
check-am: all-am
check: check-recursive
all-am: Makefile $(DATA)
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-libtool \
distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \
am--refresh check check-am clean clean-cscope clean-generic \
clean-libtool cscope cscopelist-am ctags ctags-am dist \
dist-all dist-bzip2 dist-gzip dist-lzip dist-shar dist-tarZ \
dist-xz dist-zip distcheck distclean distclean-generic \
distclean-libtool distclean-tags distcleancheck distdir \
distuninstallcheck dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
Makefile.conf: Makefile.conf.in configure
echo "Generating $@...";
sed -e 's|@PACKAGEVERSION@|$(PACKAGE_VERSION)|g' \
-e 's|@PACKAGENAME@|$(PACKAGE)|g' $@.in >$@
Makefile.include: Makefile.include.in configure
echo "Generating $@...";
sed -e 's|@PACKAGEVERSION@|$(PACKAGE_VERSION)|g' \
-e 's|@PACKAGENAME@|$(PACKAGE)|g' $@.in >$@
# 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:
./1.5.1/depcomp 0000755 0001751 0001751 00000056016 13075613451 012565 0 ustar lmeier lmeier #! /bin/sh
# depcomp - compile a program generating dependencies as side-effects
scriptversion=2013-05-30.07; # UTC
# Copyright (C) 1999-2013 Free Software Foundation, Inc.
# 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, see .
# 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 Alexandre Oliva .
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 outputting dependencies.
libtool Whether libtool is used (yes/no).
Report bugs to .
EOF
exit $?
;;
-v | --v*)
echo "depcomp $scriptversion"
exit $?
;;
esac
# Get the directory component of the given path, and save it in the
# global variables '$dir'. Note that this directory component will
# be either empty or ending with a '/' character. This is deliberate.
set_dir_from ()
{
case $1 in
*/*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;;
*) dir=;;
esac
}
# Get the suffix-stripped basename of the given path, and save it the
# global variable '$base'.
set_base_from ()
{
base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'`
}
# If no dependency file was actually created by the compiler invocation,
# we still have to create a dummy depfile, to avoid errors with the
# Makefile "include basename.Plo" scheme.
make_dummy_depfile ()
{
echo "#dummy" > "$depfile"
}
# Factor out some common post-processing of the generated depfile.
# Requires the auxiliary global variable '$tmpdepfile' to be set.
aix_post_process_depfile ()
{
# If the compiler actually managed to produce a dependency file,
# post-process it.
if test -f "$tmpdepfile"; then
# Each line is of the form 'foo.o: dependency.h'.
# Do two passes, one to just change these to
# $object: dependency.h
# and one to simply output
# dependency.h:
# which is needed to avoid the deleted-header problem.
{ sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile"
sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile"
} > "$depfile"
rm -f "$tmpdepfile"
else
make_dummy_depfile
fi
}
# A tabulation character.
tab=' '
# A newline character.
nl='
'
# Character ranges might be problematic outside the C locale.
# These definitions help.
upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ
lower=abcdefghijklmnopqrstuvwxyz
digits=0123456789
alpha=${upper}${lower}
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"
# Avoid interferences from the environment.
gccflag= dashmflag=
# 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
cygpath_u="cygpath -u -f -"
if test "$depmode" = msvcmsys; then
# This is just like msvisualcpp but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvisualcpp
fi
if test "$depmode" = msvc7msys; then
# This is just like msvc7 but w/o cygpath translation.
# Just convert the backslash-escaped backslashes to single forward
# slashes to satisfy depend.m4
cygpath_u='sed s,\\\\,/,g'
depmode=msvc7
fi
if test "$depmode" = xlc; then
# IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information.
gccflag=-qmakedep=gcc,-MF
depmode=gcc
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 -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
mv "$tmpdepfile" "$depfile"
;;
gcc)
## Note that this doesn't just cater to obsosete pre-3.x GCC compilers.
## but also to in-use compilers like IMB xlc/xlC and the HP C compiler.
## (see the conditional assignment to $gccflag above).
## 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). Also, it might not be
## supported by the other compilers which use the 'gcc' depmode.
## - 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 -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# 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.
## 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. hp depmode also adds that space, but also prefixes the VPATH
## to the object. Take care to not repeat it in the output.
## Some versions of the HPUX 10.20 sed can't process this invocation
## correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -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 -ne 0; then
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 ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
| tr "$nl" ' ' >> "$depfile"
echo >> "$depfile"
# The second pass generates a dummy entry for each header file.
tr ' ' "$nl" < "$tmpdepfile" \
| sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
>> "$depfile"
else
make_dummy_depfile
fi
rm -f "$tmpdepfile"
;;
xlc)
# 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
;;
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.
set_dir_from "$object"
set_base_from "$object"
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 -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
aix_post_process_depfile
;;
tcc)
# tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26
# FIXME: That version still under development at the moment of writing.
# Make that this statement remains true also for stable, released
# versions.
# It will wrap lines (doesn't matter whether long or short) with a
# trailing '\', as in:
#
# foo.o : \
# foo.c \
# foo.h \
#
# It will put a trailing '\' even on the last line, and will use leading
# spaces rather than leading tabs (at least since its commit 0394caf7
# "Emit spaces for -MD").
"$@" -MD -MF "$tmpdepfile"
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
# Each non-empty line is of the form 'foo.o : \' or ' dep.h \'.
# We have to change lines of the first kind to '$object: \'.
sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile"
# And for each line of the second kind, we have to emit a 'dep.h:'
# dummy dependency, to avoid the deleted-header problem.
sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile"
rm -f "$tmpdepfile"
;;
## The order of this option in the case statement is important, since the
## shell code in configure will try each of these formats in the order
## listed in this file. A plain '-MD' option would be understood by many
## compilers, so we must ensure this comes after the gcc and icc options.
pgcc)
# Portland's C compiler understands '-MD'.
# Will always output deps to 'file.d' where file is the root name of the
# source file under compilation, even if file resides in a subdirectory.
# The object file name does not affect the name of the '.d' file.
# pgcc 10.2 will output
# foo.o: sub/foo.c sub/foo.h
# and will wrap long lines using '\' :
# foo.o: sub/foo.c ... \
# sub/foo.h ... \
# ...
set_dir_from "$object"
# Use the source, not the object, to determine the base name, since
# that's sadly what pgcc will do too.
set_base_from "$source"
tmpdepfile=$base.d
# For projects that build the same source file twice into different object
# files, the pgcc approach of using the *source* file root name can cause
# problems in parallel builds. Use a locking strategy to avoid stomping on
# the same $tmpdepfile.
lockdir=$base.d-lock
trap "
echo '$0: caught signal, cleaning up...' >&2
rmdir '$lockdir'
exit 1
" 1 2 13 15
numtries=100
i=$numtries
while test $i -gt 0; do
# mkdir is a portable test-and-set.
if mkdir "$lockdir" 2>/dev/null; then
# This process acquired the lock.
"$@" -MD
stat=$?
# Release the lock.
rmdir "$lockdir"
break
else
# If the lock is being held by a different process, wait
# until the winning process is done or we timeout.
while test -d "$lockdir" && test $i -gt 0; do
sleep 1
i=`expr $i - 1`
done
fi
i=`expr $i - 1`
done
trap - 1 2 13 15
if test $i -le 0; then
echo "$0: failed to acquire lock after $numtries attempts" >&2
echo "$0: check lockdir '$lockdir'" >&2
exit 1
fi
if test $stat -ne 0; then
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.
set_dir_from "$object"
set_base_from "$object"
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 -ne 0; then
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,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
# Add 'dependent.h:' lines.
sed -ne '2,${
s/^ *//
s/ \\*$//
s/$/:/
p
}' "$tmpdepfile" >> "$depfile"
else
make_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.
set_dir_from "$object"
set_base_from "$object"
if test "$libtool" = yes; then
# Libtool 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$base.o.d # libtool 1.5
tmpdepfile2=$dir.libs/$base.o.d # Likewise.
tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504
"$@" -Wc,-MD
else
tmpdepfile1=$dir$base.d
tmpdepfile2=$dir$base.d
tmpdepfile3=$dir$base.d
"$@" -MD
fi
stat=$?
if test $stat -ne 0; then
rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
exit $stat
fi
for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
do
test -f "$tmpdepfile" && break
done
# Same post-processing that is required for AIX mode.
aix_post_process_depfile
;;
msvc7)
if test "$libtool" = yes; then
showIncludes=-Wc,-showIncludes
else
showIncludes=-showIncludes
fi
"$@" $showIncludes > "$tmpdepfile"
stat=$?
grep -v '^Note: including file: ' "$tmpdepfile"
if test $stat -ne 0; then
rm -f "$tmpdepfile"
exit $stat
fi
rm -f "$depfile"
echo "$object : \\" > "$depfile"
# The first sed program below extracts the file names and escapes
# backslashes for cygpath. The second sed program outputs the file
# name when reading, but also accumulates all include files in the
# hold buffer in order to output them again at the end. This only
# works with sed implementations that can handle large buffers.
sed < "$tmpdepfile" -n '
/^Note: including file: *\(.*\)/ {
s//\1/
s/\\/\\\\/g
p
}' | $cygpath_u | sort -u | sed -n '
s/ /\\ /g
s/\(.*\)/'"$tab"'\1 \\/p
s/.\(.*\) \\/\1:/
H
$ {
s/.*/'"$tab"'/
G
p
}' >> "$depfile"
echo >> "$depfile" # make sure the fragment doesn't end with a backslash
rm -f "$tmpdepfile"
;;
msvc7msys)
# 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
;;
#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 "X$1" != 'X--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|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
rm -f "$depfile"
cat < "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process this sed invocation
# correctly. Breaking it into two sed invocations is a workaround.
tr ' ' "$nl" < "$tmpdepfile" \
| 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 "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
# X makedepend
shift
cleared=no eat=no
for arg
do
case $cleared in
no)
set ""; shift
cleared=yes ;;
esac
if test $eat = yes; then
eat=no
continue
fi
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.
-arch)
eat=yes ;;
-*|$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"
# makedepend may prepend the VPATH from the source file name to the object.
# No need to regex-escape $object, excess matching of '.' is harmless.
sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile"
# Some versions of the HPUX 10.20 sed can't process the last invocation
# correctly. Breaking it into two sed invocations is a workaround.
sed '1,2d' "$tmpdepfile" \
| tr ' ' "$nl" \
| 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 "X$1" != 'X--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.
"$@" || exit $?
# Remove the call to Libtool.
if test "$libtool" = yes; then
while test "X$1" != 'X--mode=compile'; do
shift
done
shift
fi
IFS=" "
for arg
do
case "$arg" in
-o)
shift
;;
$object)
shift
;;
"-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
set fnord "$@"
shift
shift
;;
*)
set fnord "$@" "$arg"
shift
shift
;;
esac
done
"$@" -E 2>/dev/null |
sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
rm -f "$depfile"
echo "$object : \\" > "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile"
echo "$tab" >> "$depfile"
sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
rm -f "$tmpdepfile"
;;
msvcmsys)
# 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
;;
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-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
./1.5.1/compile 0000755 0001751 0001751 00000016245 13075613451 012566 0 ustar lmeier lmeier #! /bin/sh
# Wrapper for compilers which do not understand '-c -o'.
scriptversion=2012-10-14.11; # UTC
# Copyright (C) 1999-2013 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, see .
# 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
# .
nl='
'
# We need space, tab and new line, in precisely that order. Quoting is
# there to prevent tools from complaining about whitespace usage.
IFS=" "" $nl"
file_conv=
# func_file_conv build_file lazy
# Convert a $build file to $host form and store it in $file
# Currently only supports Windows hosts. If the determined conversion
# type is listed in (the comma separated) LAZY, no conversion will
# take place.
func_file_conv ()
{
file=$1
case $file in
/ | /[!/]*) # absolute file, and not a UNC file
if test -z "$file_conv"; then
# lazily determine how to convert abs files
case `uname -s` in
MINGW*)
file_conv=mingw
;;
CYGWIN*)
file_conv=cygwin
;;
*)
file_conv=wine
;;
esac
fi
case $file_conv/,$2, in
*,$file_conv,*)
;;
mingw/*)
file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'`
;;
cygwin/*)
file=`cygpath -m "$file" || echo "$file"`
;;
wine/*)
file=`winepath -w "$file" || echo "$file"`
;;
esac
;;
esac
}
# func_cl_dashL linkdir
# Make cl look for libraries in LINKDIR
func_cl_dashL ()
{
func_file_conv "$1"
if test -z "$lib_path"; then
lib_path=$file
else
lib_path="$lib_path;$file"
fi
linker_opts="$linker_opts -LIBPATH:$file"
}
# func_cl_dashl library
# Do a library search-path lookup for cl
func_cl_dashl ()
{
lib=$1
found=no
save_IFS=$IFS
IFS=';'
for dir in $lib_path $LIB
do
IFS=$save_IFS
if $shared && test -f "$dir/$lib.dll.lib"; then
found=yes
lib=$dir/$lib.dll.lib
break
fi
if test -f "$dir/$lib.lib"; then
found=yes
lib=$dir/$lib.lib
break
fi
if test -f "$dir/lib$lib.a"; then
found=yes
lib=$dir/lib$lib.a
break
fi
done
IFS=$save_IFS
if test "$found" != yes; then
lib=$lib.lib
fi
}
# func_cl_wrapper cl arg...
# Adjust compile command to suit cl
func_cl_wrapper ()
{
# Assume a capable shell
lib_path=
shared=:
linker_opts=
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'.
eat=1
case $2 in
*.o | *.[oO][bB][jJ])
func_file_conv "$2"
set x "$@" -Fo"$file"
shift
;;
*)
func_file_conv "$2"
set x "$@" -Fe"$file"
shift
;;
esac
;;
-I)
eat=1
func_file_conv "$2" mingw
set x "$@" -I"$file"
shift
;;
-I*)
func_file_conv "${1#-I}" mingw
set x "$@" -I"$file"
shift
;;
-l)
eat=1
func_cl_dashl "$2"
set x "$@" "$lib"
shift
;;
-l*)
func_cl_dashl "${1#-l}"
set x "$@" "$lib"
shift
;;
-L)
eat=1
func_cl_dashL "$2"
;;
-L*)
func_cl_dashL "${1#-L}"
;;
-static)
shared=false
;;
-Wl,*)
arg=${1#-Wl,}
save_ifs="$IFS"; IFS=','
for flag in $arg; do
IFS="$save_ifs"
linker_opts="$linker_opts $flag"
done
IFS="$save_ifs"
;;
-Xlinker)
eat=1
linker_opts="$linker_opts $2"
;;
-*)
set x "$@" "$1"
shift
;;
*.cc | *.CC | *.cxx | *.CXX | *.[cC]++)
func_file_conv "$1"
set x "$@" -Tp"$file"
shift
;;
*.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO])
func_file_conv "$1" mingw
set x "$@" "$file"
shift
;;
*)
set x "$@" "$1"
shift
;;
esac
fi
shift
done
if test -n "$linker_opts"; then
linker_opts="-link$linker_opts"
fi
exec "$@" $linker_opts
exit 1
}
eat=
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 $?
;;
cl | *[/\\]cl | cl.exe | *[/\\]cl.exe )
func_cl_wrapper "$@" # Doesn't return...
;;
esac
ofile=
cfile=
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 's|^.*[\\/]||; s|^[a-zA-Z]:||; 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
test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
elif test -f "${cofile}bj"; then
test "${cofile}bj" = "$ofile" || 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-time-zone: "UTC"
# time-stamp-end: "; # UTC"
# End:
./1.5.1/AUTHORS 0000644 0001751 0001751 00000000674 13075613451 012257 0 ustar lmeier lmeier The original code is by
Wilhelm Meier (wilhelm.meier@fh-kl.de)
Enhancements, patches and comments by
* Louis Lagendijk (louis@fazant.net)
* Martin Dengler (martin@martindengler.com)
* Alexander Tomisch (alex@tomisch.de)
* Rüdiger Meier (sweet_f_a@gmx.de)
* Rastislav David (rasto@ynet.sk)
* Sander Devrieze (s.devrieze@gmail.com)
* Ilya V. Ivanchenko (iva2k@yahoo.com)
* Rolf Leggewie (foss@rolf.leggewie.biz)
Thanks to all contributors!
./1.5.1/src/ 0000755 0001751 0001751 00000000000 13075613451 011767 5 ustar lmeier lmeier ./1.5.1/src/scanbd/ 0000755 0001751 0001751 00000000000 13075613565 013227 5 ustar lmeier lmeier ./1.5.1/src/scanbd/config.h 0000644 0001751 0001751 00000002043 13075613565 014644 0 ustar lmeier lmeier /*
* $Id: config.h 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef CONFIG_H
#define CONFIG_H
void cfg_do_parse(const char *config_file_name);
char *make_script_path_abs(const char *script);
#endif
./1.5.1/src/scanbd/udev.h 0000644 0001751 0001751 00000002360 13075613565 014344 0 ustar lmeier lmeier /*
* $Id: udev.h 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef UDEV_H
#define UDEV_H
#include "scanbd.h"
#ifdef USE_LIBUDEV
# include
# define UDEV_ADD_ACTION "add"
# define UDEV_REMOVE_ACTION "remove"
# define UDEV_DEVICE_TYPE "usb_device"
# define UDEV_SLEEP_IF_NO_DEVICE 1000
extern void udev_start_udev_thread(void);
extern void udev_stop_udev_thread(void);
#endif
#endif // UDEV_H
./1.5.1/src/scanbd/scanbd.c 0000644 0001751 0001751 00000054411 13075613565 014632 0 ustar lmeier lmeier /*
* $Id: scanbd.c 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "scanbd.h"
#ifdef USE_SCANBUTTOND
# include "scanbuttond_loader.h"
# include "scanbuttond_wrapper.h"
backend_t* backend = NULL;
#endif
#include
cfg_t* cfg = NULL;
// the actual values of the command-line options
struct scanbdOptions scanbd_options = {
/* managerMode */ false,
/* foreground */ false,
/* signal */ false,
/* config_file_name */ SCANBD_CONF
};
// the options for getopt_long()
static struct option options[] = {
{"manager", 0, NULL, 'm'},
{"signal", 0, NULL, 's'},
{"debug", 2, NULL, 'd'},
{"foreground", 0, NULL, 'f'},
{"config", 1, NULL, 'c'},
{"trigger", 1, NULL, 't'},
{"action", 1, NULL, 'a'},
{ 0, 0, NULL, 0}
};
void sig_hup_handler(int signal) {
slog(SLOG_DEBUG, "sig_hup_handler called");
if (signal == SIGALRM) {
slog(SLOG_INFO, "reconfiguration due to SIGALARM, device was busy?");
}
// stop all threads
#ifdef USE_SANE
stop_sane_threads();
#else
stop_scbtn_threads();
#endif
slog(SLOG_DEBUG, "sane_exit");
#ifdef USE_SANE
sane_exit();
#else
scbtn_shutdown();
#endif
#ifdef SANE_REINIT_TIMEOUT
sleep(SANE_REINIT_TIMEOUT); // TODO: don't know if this is
// really neccessary
#endif
slog(SLOG_DEBUG, "reread the config");
cfg_do_parse(scanbd_options.config_file_name);
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
debug = cfg_getbool(cfg_sec_global, C_DEBUG);
debug_level = cfg_getint(cfg_sec_global, C_DEBUG_LEVEL);
slog(SLOG_DEBUG, "sane_init");
#ifdef USE_SANE
sane_init(NULL, NULL);
#else
if (scanbtnd_init() < 0) {
slog(SLOG_INFO, "Could not initialize scanbuttond modules!\n");
exit(EXIT_FAILURE);
}
assert(backend);
#endif
#ifdef USE_SANE
get_sane_devices();
#else
get_scbtn_devices();
#endif
// start all threads
#ifdef USE_SANE
start_sane_threads();
#else
start_scbtn_threads();
#endif
}
void sig_usr1_handler(int signal) {
slog(SLOG_DEBUG, "sig_usr1_handler called");
(void)signal;
// stop all threads
#ifdef USE_SANE
stop_sane_threads();
#else
stop_scbtn_threads();
#endif
}
void sig_usr2_handler(int signal) {
slog(SLOG_DEBUG, "sig_usr2_handler called");
(void)signal;
// start all threads
#ifdef USE_SANE
start_sane_threads();
#else
start_scbtn_threads();
#endif
}
void sig_term_handler(int signal) {
slog(SLOG_DEBUG, "sig_term/int_handler called with signal %d", signal);
if (scanbd_options.managerMode) {
// managerMode
slog(SLOG_INFO, "managerMode: do nothing");
}
else {
// not in manager-mode
// stop all threads
#ifdef USE_SANE
stop_sane_threads();
#else
stop_scbtn_threads();
#endif
dbus_stop_dbus_thread();
#ifdef USE_LIBUDEV
udev_stop_udev_thread();
#endif
// get the name of the pidfile
const char* pidfile = NULL;
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
pidfile = cfg_getstr(cfg_sec_global, C_PIDFILE);
assert(pidfile);
if (!scanbd_options.foreground) {
// reclaim the old uid (root) to unlink the pidfile
// mostly neccessary if the pidfile lives in /var/run
if (seteuid((uid_t)0) < 0) {
slog(SLOG_WARN, "Can't acquire uid root to unlink pidfile %s : %s",
pidfile, strerror(errno));
slog(SLOG_DEBUG, "euid: %d, egid: %d",
geteuid(), getegid());
// not an hard error, since sometimes this isn't neccessary
}
if (unlink(pidfile) < 0) {
slog(SLOG_ERROR, "Can't unlink pidfile: %s", strerror(errno));
slog(SLOG_DEBUG, "euid: %d, egid: %d",
geteuid(), getegid());
exit(EXIT_FAILURE);
}
}
}
slog(SLOG_INFO, "exiting scanbd");
exit(EXIT_SUCCESS);
}
bool isNumber(const char* string) {
if (!string) {
return false;
}
while(*string) {
if (!isdigit((int)*string)) {
return false;
}
++string;
}
return true;
}
int main(int argc, char** argv) {
// init the logging feature
slog_init(argv[0]);
#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
#ifdef USE_SANE
sane_init_mutex();
#endif
#ifdef USE_SCANBUTTOND
scbtn_init_mutex();
#endif
#endif
// install all the signalhandlers early
// SIGHUP rereads the config as usual
struct sigaction sa;
memset(&sa, 0, sizeof(struct sigaction));
sa.sa_handler = sig_hup_handler;
sigemptyset(&sa.sa_mask);
// prevent interleaving with stop/start_sane_threads
sigaddset(&sa.sa_mask, SIGUSR1);
sigaddset(&sa.sa_mask, SIGUSR2);
if (sigaction(SIGHUP, &sa, NULL) < 0) {
slog(SLOG_ERROR, "Can't install signalhandler for SIGHUP: %s", strerror(errno));
exit(EXIT_FAILURE);
}
#ifdef USE_SCANBUTTOND
// install the SIGHUP handler also for SIGALARM
// SIGALARM is used if there is a open failure of the
// scanbuutond backends, possible cause is a device scanning from other
// processes like cupsd
if (sigaction(SIGALRM, &sa, NULL) < 0) {
slog(SLOG_ERROR, "Can't install signalhandler for SIGALARM: %s", strerror(errno));
exit(EXIT_FAILURE);
}
#endif
// SIGUSR1 is used to stop all polling threads
memset(&sa, 0, sizeof(struct sigaction));
sa.sa_handler = sig_usr1_handler;
sigemptyset(&sa.sa_mask);
// prevent interleaving the stop_sane_threads with start_sane_threads
sigaddset(&sa.sa_mask, SIGUSR2);
sigaddset(&sa.sa_mask, SIGHUP);
if (sigaction(SIGUSR1, &sa, NULL) < 0) {
slog(SLOG_ERROR, "Can't install signalhandler for SIGUSR1: %s", strerror(errno));
exit(EXIT_FAILURE);
}
// SIGUSR2 is used to restart all polling threads
memset(&sa, 0, sizeof(struct sigaction));
sa.sa_handler = sig_usr2_handler;
sigemptyset(&sa.sa_mask);
// prevent interleaving the start_sane_threads with stop_sane_threads
sigaddset(&sa.sa_mask, SIGUSR1);
sigaddset(&sa.sa_mask, SIGHUP);
if (sigaction(SIGUSR2, &sa, NULL) < 0) {
slog(SLOG_ERROR, "Can't install signalhandler for SIGUSR2: %s", strerror(errno));
exit(EXIT_FAILURE);
}
// SIGTERM and SIGINT terminates the process gracefully
memset(&sa, 0, sizeof(struct sigaction));
sa.sa_handler = sig_term_handler;
sigemptyset(&sa.sa_mask);
if (sigaction(SIGTERM, &sa, NULL) < 0) {
slog(SLOG_ERROR, "Can't install signalhandler for SIGTERM: %s", strerror(errno));
exit(EXIT_FAILURE);
}
if (sigaction(SIGINT, &sa, NULL) < 0) {
slog(SLOG_ERROR, "Can't install signalhandler for SIGINT: %s", strerror(errno));
exit(EXIT_FAILURE);
}
int trigger_device = -1;
int trigger_action = -1;
// read the options of the commandline
while(true) {
int option_index = 0;
int c = 0;
if ((c = getopt_long(argc, argv, "mc:d::ft:a:", options, &option_index)) < 0) {
break;
}
switch(c) {
case 'm':
slog(SLOG_INFO, "manager-mode");
scanbd_options.managerMode = true;
break;
case 's':
slog(SLOG_INFO, "signal-mode");
scanbd_options.signal = true;
break;
case 'd':
slog(SLOG_INFO, "debug on");
debug = true;
if (optarg) {
if (isNumber(optarg)) {
debug_level = atoi(optarg);
}
else {
slog(SLOG_WARN, "use numerical argument for option -d");
}
}
break;
case 'f':
slog(SLOG_INFO, "foreground");
scanbd_options.foreground = true;
break;
case 'c':
slog(SLOG_INFO, "config-file: %s", optarg);
scanbd_options.config_file_name = strdup(optarg);
break;
case 't':
slog(SLOG_INFO, "trigger for device number: %d", atoi(optarg));
if (isNumber(optarg)) {
trigger_device = atoi(optarg);
scanbd_options.foreground = true;
}
else {
slog(SLOG_WARN, "use numerical argument for option -t");
}
break;
case 'a':
slog(SLOG_INFO, "trigger action number: %d", atoi(optarg));
if (isNumber(optarg)) {
trigger_action = atoi(optarg);
scanbd_options.foreground = true;
}
else {
slog(SLOG_WARN, "use numerical argument for option -a");
}
break;
default:
break;
}
}
// read & parse scanbd.conf
cfg_do_parse(scanbd_options.config_file_name);
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
debug |= cfg_getbool(cfg_sec_global, C_DEBUG);
if (debug_level == 0 ) {
// not set from command-line
debug_level = cfg_getint(cfg_sec_global, C_DEBUG_LEVEL);
}
// We do this here as debugging is only completely initialized here
char prog_path[PATH_MAX] = "";
strncpy(prog_path, argv[0], PATH_MAX);
char *my_name = basename(prog_path);
if ( strncmp(my_name, NAME_MANAGER_MODE, PATH_MAX) == 0 ) {
slog(SLOG_INFO, "We are called as %s - setting manager-mode", NAME_MANAGER_MODE);
scanbd_options.managerMode = true;
}
if (debug) {
slog(SLOG_INFO, "debug on: level: %d", debug_level);
}
else {
slog(SLOG_INFO, "debug off");
}
// manager-mode in signal-mode
// stops all polling threads in a running scanbd by sending
// SIGUSR1
// then starts saned
// afterwards restarts all polling threads in a running scanbd by
// sending SIGUSR2
// manager-mode in dbus-mode
// stops all polling threads in a running scanbd by calling
// a dbus message of the running scanbd
// then starts saned
// afterwards restarts all polling threads in a running scanbd by
// another dbus message
// this is usefull for using scanbd in manager-mode from inetd
// starting saned indirectly
// in inetd.conf:
//
if (scanbd_options.managerMode) {
slog(SLOG_DEBUG, "Entering manager mode");
if ((trigger_device >= 0) && (trigger_action >= 0)) {
slog(SLOG_DEBUG, "Entering trigger mode");
dbus_call_trigger(trigger_device, trigger_action);
exit(EXIT_SUCCESS);
}
pid_t scanbd_pid = -1;
// get the name of the saned executable
const char* saned = NULL;
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
saned = cfg_getstr(cfg_sec_global, C_SANED);
assert(saned);
if (scanbd_options.signal) {
slog(SLOG_DEBUG, "manager mode: signal");
// get the path of the pid-file of the running scanbd
const char* scanbd_pid_file = NULL;
scanbd_pid_file = cfg_getstr(cfg_sec_global, C_PIDFILE);
assert(scanbd_pid_file);
// get the pid of the running scanbd out of the pidfile
FILE* pidfile;
if ((pidfile = fopen(scanbd_pid_file, "r")) == NULL) {
slog(SLOG_WARN, "Can't open pidfile %s", scanbd_pid_file);
}
else {
char pida[NAME_MAX];
if (fgets(pida, NAME_MAX, pidfile) == NULL) {
slog(SLOG_WARN, "Can't read pid from pidfile %s", scanbd_pid_file);
}
if (fclose(pidfile) < 0) {
slog(SLOG_WARN, "Can't close pidfile %s", scanbd_pid_file);
}
scanbd_pid = atoi(pida);
slog(SLOG_DEBUG, "found scanbd with pid %d", scanbd_pid);
// set scanbd to sleep mode
slog(SLOG_DEBUG, "sending SIGUSR1", scanbd_pid);
if (kill(scanbd_pid, SIGUSR1) < 0) {
slog(SLOG_WARN, "Can't send signal SIGUSR1 to pid %d: %s",
scanbd_pid, strerror(errno));
slog(SLOG_DEBUG, "uid=%d, euid=%d", getuid(), geteuid());
//exit(EXIT_FAILURE);
}
}
// sleep some time to give the other scanbd to close all the
// usb-connections
sleep(1);
} // signal-mode
else {
slog(SLOG_DEBUG, "dbus signal saned-start");
dbus_send_signal(SCANBD_DBUS_SIGNAL_SANED_BEGIN, NULL);
slog(SLOG_DEBUG, "manager mode: dbus");
slog(SLOG_DEBUG, "calling dbus method: %s", SCANBD_DBUS_METHOD_ACQUIRE);
dbus_call_method(SCANBD_DBUS_METHOD_ACQUIRE, NULL);
}
// start the real saned
slog(SLOG_DEBUG, "forking subprocess for saned");
pid_t spid = -1;
if ((spid = fork()) < 0) {
slog(SLOG_ERROR, "fork for saned subprocess failed: %s", strerror(errno));
exit(EXIT_FAILURE);
}
else if (spid > 0) { // parent
// wait for the saned process to finish
int status = 0;
slog(SLOG_DEBUG, "waiting for saned");
if (waitpid(spid, &status, 0) < 0) {
slog(SLOG_ERROR, "waiting for saned failed: %s", strerror(errno));
exit(EXIT_FAILURE);
}
if (WIFEXITED(status)) {
slog(SLOG_INFO, "saned exited with status: %d", WEXITSTATUS(status));
}
if (WIFSIGNALED(status)) {
slog(SLOG_INFO, "saned exited due to signal: %d", WTERMSIG(status));
}
// saned finished and now
// reactivate scandb
if (scanbd_options.signal) {
// sleep some time to give the other scanbd to close all the
// usb-connections
sleep(1);
if (scanbd_pid > 0) {
slog(SLOG_DEBUG, "sending SIGUSR2");
if (kill(scanbd_pid, SIGUSR2) < 0) {
slog(SLOG_INFO, "Can't send signal SIGUSR1 to pid %d: %s",
scanbd_pid, strerror(errno));
}
}
} // signal-mode
else {
slog(SLOG_DEBUG, "calling dbus method: %s", SCANBD_DBUS_METHOD_RELEASE);
dbus_call_method(SCANBD_DBUS_METHOD_RELEASE, NULL);
slog(SLOG_DEBUG, "dbus signal saned-end");
dbus_send_signal(SCANBD_DBUS_SIGNAL_SANED_END, NULL);
}
}
else { // child
// Ensure that saned gets the systemd fd's
// We do not call sd_listen_fds() as that sets FD_CLOEXEC on the fd's
char listen_fds[64] = "";
if (getenv("LISTEN_PID") != NULL) {
snprintf(listen_fds, 64, "LISTEN_PID=%ld", (long) getpid());
putenv(listen_fds);
slog(SLOG_DEBUG, "Systemd detected: Updating LISTEN_PID env. variable");
}
size_t numberOfEnvs = cfg_size(cfg_sec_global, "saned_env");
for(size_t i = 0; i < numberOfEnvs; i += 1) {
const char* e = cfg_getnstr(cfg_sec_global, "saned_env", i);
assert(e);
if (putenv((char*)e) < 0) { // const-cast should not be neccessary
slog(SLOG_WARN, "Can't set environment %s: %s", e, strerror(errno));
}
else {
slog(SLOG_DEBUG, "Setting environment: %s", e);
}
}
if (setsid() < 0) {
slog(SLOG_WARN, "setsid: %s", strerror(errno));
}
if (execl(saned, "saned", (char*)NULL) < 0) {
slog(SLOG_ERROR, "exec of saned failed: %s", strerror(errno));
exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS); // not reached
}
exit(EXIT_SUCCESS);
}
else { // not in manager mode
// daemonize,
if (!scanbd_options.foreground) {
slog(SLOG_DEBUG, "daemonize");
daemonize();
}
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
// drop the privilegies
const char* euser = NULL;
euser = cfg_getstr(cfg_sec_global, C_USER);
assert(euser);
const char* egroup = NULL;
egroup = cfg_getstr(cfg_sec_global, C_GROUP);
assert(egroup);
slog(SLOG_INFO, "dropping privs to uid %s", euser);
struct passwd* pwd = NULL;
if ((pwd = getpwnam(euser)) == NULL) {
if (errno != 0) {
slog(SLOG_ERROR, "No user %s: %s", euser, strerror(errno));
}
else {
slog(SLOG_ERROR, "No user %s", euser);
}
exit(EXIT_FAILURE);
}
assert(pwd);
slog(SLOG_INFO, "dropping privs to gid %s", egroup);
struct group* grp = NULL;
if ((grp = getgrnam(egroup)) == NULL) {
if (errno != 0) {
slog(SLOG_ERROR, "No group %s: %s", egroup, strerror(errno));
}
else {
slog(SLOG_ERROR, "No group %s", egroup);
}
exit(EXIT_FAILURE);
}
assert(grp);
// write pid file
const char* pidfile = NULL;
pidfile = cfg_getstr(cfg_sec_global, C_PIDFILE);
assert(pidfile);
if (!scanbd_options.foreground) {
// don't try to write pid-file if forgrounded
int pid_fd = -1;
if ((pid_fd = open(pidfile, O_RDWR | O_CREAT | O_EXCL,
S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) < 0) {
slog(SLOG_ERROR, "Can't create pidfile %s : %s", pidfile, strerror(errno));
exit(EXIT_FAILURE);
}
else {
if (ftruncate(pid_fd, 0) < 0) {
slog(SLOG_ERROR, "Can't clear pidfile: %s", strerror(errno));
exit(EXIT_FAILURE);
}
char buf[LINE_MAX];
snprintf(buf, LINE_MAX - 1, "%d\n", getpid());
if (write(pid_fd, buf, strlen(buf)) < 0) {
slog(SLOG_ERROR, "Can't write pidfile: %s", strerror(errno));
exit(EXIT_FAILURE);
}
if (close(pid_fd)) {
slog(SLOG_ERROR, "Can't close pidfile: %s", strerror(errno));
exit(EXIT_FAILURE);
}
if (chown(pidfile, pwd->pw_uid, grp->gr_gid) < 0) {
slog(SLOG_ERROR, "Can't chown pidfile: %s", strerror(errno));
exit(EXIT_FAILURE);
}
}
}
// drop the privileges
// first change our effective gid
if (grp != NULL) {
int i = 0;
while(grp->gr_mem[i] != 0) {
if (i == 0) {
slog(SLOG_INFO, "group %s has member: ", grp->gr_name);
}
slog(SLOG_INFO, "%s", grp->gr_mem[i]);
++i;
}
slog(SLOG_DEBUG, "drop privileges to gid: %d", grp->gr_gid);
if (setegid(grp->gr_gid) < 0) {
slog(SLOG_WARN, "Can't set the effective gid to %d", grp->gr_gid);
}
else {
slog(SLOG_INFO, "Running as effective gid %d", grp->gr_gid);
}
}
// then change our effective uid
if (pwd != NULL) {
slog(SLOG_DEBUG, "drop privileges to uid: %d", pwd->pw_uid);
if (seteuid(pwd->pw_uid) < 0) {
setgroups(0, NULL);
slog(SLOG_WARN, "Can't set the effective uid to %d", pwd->pw_uid);
}
else {
slog(SLOG_INFO, "Running as effective uid %d", pwd->pw_uid);
}
}
// Init DBus well known interface
// must be possible with the user from config file
dbus_init();
#ifdef USE_SANE
if (getenv("SANE_CONFIG_DIR") != NULL) {
slog(SLOG_DEBUG, "SANE_CONFIG_DIR=%s", getenv("SANE_CONFIG_DIR"));
}
else {
slog(SLOG_WARN, "SANE_CONFIG_DIR not set");
}
// Init SANE
SANE_Int sane_version = 0;
sane_init(&sane_version, 0);
slog(SLOG_INFO, "sane version %d.%d",
SANE_VERSION_MAJOR(sane_version),
SANE_VERSION_MINOR(sane_version));
#else
if (scanbtnd_init() < 0) {
slog(SLOG_INFO, "Could not initialize scanbuttond modules!\n");
exit(EXIT_FAILURE);
}
assert(backend);
#endif
// get all devices locally connected to the system
#ifdef USE_SANE
get_sane_devices();
#else
get_scbtn_devices();
#endif
// start the polling threads
#ifdef USE_SANE
start_sane_threads();
#else
start_scbtn_threads();
#endif
// start dbus thread
dbus_start_dbus_thread();
#ifdef USE_LIBUDEV
udev_start_udev_thread();
#endif
// well, sit here and wait ...
// this thread executes the signal handlers
while(true) {
if (pause() < 0) {
slog(SLOG_DEBUG, "pause: %s", strerror(errno));
}
}
}
exit(EXIT_SUCCESS); // never reached
}
./1.5.1/src/scanbd/config.c 0000644 0001751 0001751 00000014640 13075613565 014645 0 ustar lmeier lmeier /*
* $Id: config.c 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "scanbd.h"
#include
// parsing the config-file via libconfuse
void cfg_do_parse(const char *config_file_name) {
slog(SLOG_INFO, "reading config file %s", config_file_name);
cfg_opt_t cfg_numtrigger[] = {
CFG_INT(C_FROM_VALUE, C_FROM_VALUE_DEF_INT, CFGF_NONE),
CFG_INT(C_TO_VALUE, C_TO_VALUE_DEF_INT, CFGF_NONE),
CFG_END()
};
cfg_opt_t cfg_strtrigger[] = {
CFG_STR(C_FROM_VALUE, C_FROM_VALUE_DEF_STR, CFGF_NONE),
CFG_STR(C_TO_VALUE, C_TO_VALUE_DEF_STR, CFGF_NONE),
CFG_END()
};
cfg_opt_t cfg_action[] = {
CFG_STR(C_FILTER, C_ACTION_DEF, CFGF_NONE),
CFG_SEC(C_NUMERICAL_TRIGGER, cfg_numtrigger, CFGF_NONE),
CFG_SEC(C_STRING_TRIGGER, cfg_strtrigger, CFGF_NONE),
CFG_STR(C_DESC, C_DESC_DEF, CFGF_NONE),
CFG_STR(C_SCRIPT, C_SCRIPT_DEF, CFGF_NONE),
CFG_END()
};
cfg_opt_t cfg_function[] = {
CFG_STR(C_FILTER, C_FUNCTION_DEF, CFGF_NONE),
CFG_STR(C_DESC, C_DESC_DEF, CFGF_NONE),
CFG_STR(C_ENV, C_ENV_FUNCTION_DEF, CFGF_NONE),
CFG_END()
};
cfg_opt_t cfg_environment[] = {
CFG_STR(C_ENV_DEVICE, C_ENV_DEVICE_DEF, CFGF_NONE),
CFG_STR(C_ENV_ACTION, C_ENV_ACTION_DEF, CFGF_NONE),
CFG_END()
};
cfg_opt_t cfg_global[] = {
CFG_BOOL(C_DEBUG, C_DEBUG_DEF, CFGF_NONE),
CFG_BOOL(C_MULTIPLE_ACTIONS, C_MULTIPLE_ACTIONS_DEF, CFGF_NONE),
CFG_INT(C_DEBUG_LEVEL, C_DEBUG_LEVEL_DEF, CFGF_NONE),
CFG_STR(C_USER, C_USER_DEF, CFGF_NONE),
CFG_STR(C_GROUP, C_GROUP_DEF, CFGF_NONE),
CFG_STR(C_SANED, C_SANED_DEF, CFGF_NONE),
CFG_STR_LIST(C_SANED_OPTS, C_SANED_OPTS_DEF, CFGF_NONE),
CFG_STR_LIST(C_SANED_ENVS, C_SANED_ENVS_DEF, CFGF_NONE),
CFG_STR(C_SCRIPTDIR, C_SCRIPTDIR_DEF, CFGF_NONE),
CFG_STR(C_DEVICE_INSERT_SCRIPT, C_DEVICE_INSERT_SCRIPT_DEF, CFGF_NONE),
CFG_STR(C_DEVICE_REMOVE_SCRIPT, C_DEVICE_REMOVE_SCRIPT_DEF, CFGF_NONE),
CFG_STR(C_SCANBUTTONS_BACKENDS_DIR, C_SCANBUTTONS_BACKENDS_DIR_DEF, CFGF_NONE),
CFG_INT(C_TIMEOUT, C_TIMEOUT_DEF, CFGF_NONE),
CFG_STR(C_PIDFILE, C_PIDFILE_DEF, CFGF_NONE),
CFG_SEC(C_ENVIRONMENT, cfg_environment, CFGF_NONE),
CFG_SEC(C_FUNCTION, cfg_function, CFGF_MULTI | CFGF_TITLE),
CFG_SEC(C_ACTION, cfg_action, CFGF_MULTI | CFGF_TITLE),
CFG_END()
};
cfg_opt_t cfg_device[] = {
CFG_STR(C_FILTER, "^fujitsu.*", CFGF_NONE),
CFG_STR(C_DESC, C_DESC_DEF, CFGF_NONE),
CFG_SEC(C_FUNCTION, cfg_function, CFGF_MULTI | CFGF_TITLE),
CFG_SEC(C_ACTION, cfg_action, CFGF_MULTI | CFGF_TITLE),
CFG_END()
};
cfg_opt_t cfg_options[] = {
CFG_SEC(C_GLOBAL, cfg_global, CFGF_NONE),
CFG_SEC(C_DEVICE, cfg_device, CFGF_MULTI | CFGF_TITLE),
CFG_FUNC(C_INCLUDE, cfg_include),
CFG_END()
};
if (cfg) {
cfg_free(cfg);
cfg = NULL;
}
char wd[PATH_MAX] = {};
char config_file[PATH_MAX] = {};
char* scanbd_conf_dir = NULL;
// get current directory
if (getcwd(wd, PATH_MAX) == NULL) {
slog(SLOG_ERROR, "can't get working directory");
exit(EXIT_FAILURE);
}
// cd into directory where scanbd.conf lives
strncpy(config_file, config_file_name, PATH_MAX);
scanbd_conf_dir = dirname(config_file);
assert(scanbd_conf_dir);
if (chdir(scanbd_conf_dir) != 0) {
slog(SLOG_ERROR, "can't access the directory for: %s", config_file_name);
exit(EXIT_FAILURE);
}
cfg = cfg_init(cfg_options, CFGF_NONE);
int ret = 0;
if ((ret = cfg_parse(cfg, config_file_name)) != CFG_SUCCESS) {
if (CFG_FILE_ERROR == ret) {
slog(SLOG_ERROR, "can't open config file: %s", config_file_name);
exit(EXIT_FAILURE);
}
else {
slog(SLOG_ERROR, "parse error in config file");
exit(EXIT_FAILURE);
}
exit(EXIT_FAILURE); // not reached
}
// cd back to original
if (chdir(wd) < 0) {
slog(SLOG_ERROR, "can't cd back to: %s", wd);
exit(EXIT_FAILURE);
}
}
char *make_script_path_abs(const char *script) {
char* script_abs = malloc(PATH_MAX);
assert(script_abs);
strncpy(script_abs, SCANBD_NULL_STRING, PATH_MAX);
assert(script);
if ((script[0] == '/') || (strcmp(script, SCANBD_NULL_STRING) == 0)) {
// Script has already an absolute path or is an empty string
strncpy(script_abs, script, PATH_MAX);
slog(SLOG_DEBUG, "using absolute script path: %s", script_abs);
} else {
// script has a relative path, determine the directory
// get the scriptdir from the global config
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
const char* scriptdir = cfg_getstr(cfg_sec_global, C_SCRIPTDIR);
if(!scriptdir || (strlen(scriptdir) == 0)) {
// scriptdir is not set, script is relative to SCANBD_CFG_DIR
snprintf(script_abs, PATH_MAX, "%s/%s", SCANBD_CFG_DIR, script);
} else if (scriptdir[0] == '/') {
// scriptdir is an absolute path
snprintf(script_abs, PATH_MAX, "%s/%s", scriptdir, script);
} else {
// scriptdir is relative to config directory
snprintf(script_abs, PATH_MAX, "%s/%s/%s", SCANBD_CFG_DIR, scriptdir, script);
}
slog(SLOG_DEBUG, "using relative script path: %s, expanded to: %s", script, script_abs);
}
return script_abs;
}
./1.5.1/src/scanbd/udev.c 0000644 0001751 0001751 00000013160 13075613565 014337 0 ustar lmeier lmeier /*
* $Id: udev.c 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef USE_LIBUDEV
//#define USE_LIBUDEV
#endif
#include "udev.h"
#ifdef USE_LIBUDEV
static pthread_t udev_tid = 0;
static struct udev* udev = NULL;
static struct udev_monitor* mon = NULL;
static int udev_init() {
slog(SLOG_DEBUG, "udev init");
udev = udev_new();
if (!udev) {
slog(SLOG_DEBUG, "can't create udev");
return -1;
}
slog(SLOG_DEBUG, "get udev monitor");
mon = udev_monitor_new_from_netlink(udev, "udev");
if (!mon) {
slog(SLOG_DEBUG, "Can't contact udev");
return -1;
}
if (udev_monitor_enable_receiving(mon) < 0) {
slog(SLOG_DEBUG, "Can't enable udev receiving");
return -1;
}
// check to see if the udev file-descriptor is blocking. This is necessary
// for a blocking udev_monitor_receive_device() later on!
// The behaviour of libudev changed in this resprect some times ago. And changed
// again back... So be explicit here!
int fd = -1;
if ((fd = udev_monitor_get_fd(mon)) < 0) {
slog(SLOG_DEBUG, "Can't get monitor fd");
return -1;
}
int flags = fcntl(fd, F_GETFL, 0);
if (flags < 0) {
slog(SLOG_DEBUG, "Can't get flags of udev fd: %s", strerror(errno));
return -1;
}
if (flags & O_NONBLOCK) {
slog(SLOG_INFO, "udev fd is non-blocking, now setting to blocking mode");
flags &= ~O_NONBLOCK;
if (fcntl(fd, F_SETFL, flags) < 0) {
slog(SLOG_DEBUG, "Can't set udev fd to blocking mode: %s", strerror(errno));
return -1;
}
}
return 0;
}
static int udev_close() {
if (mon) {
slog(SLOG_DEBUG, "close udev monitor");
udev_monitor_unref(mon);
}
mon = NULL;
if (udev) {
slog(SLOG_DEBUG, "close udev");
udev_unref(udev);
}
udev = NULL;
return 0;
}
static void udev_thread_cleanup(void* arg) {
slog(SLOG_DEBUG, "cleanup device handler");
struct udev_device* device = *((struct udev_device**)arg);
if (device) {
slog(SLOG_DEBUG, "cleanup device");
udev_device_unref(device);
}
}
static void* udev_thread(void* arg)
{
slog(SLOG_DEBUG, "udev thread started");
(void)arg;
// we only expect the main thread to handle signals
sigset_t mask;
sigfillset(&mask);
pthread_sigmask(SIG_BLOCK, &mask, NULL);
while(true) {
assert(mon);
struct udev_device* device = 0;
pthread_cleanup_push(udev_thread_cleanup, &device);
device = udev_monitor_receive_device(mon);
pthread_testcancel();
if (!device) {
slog(SLOG_WARN, "no device from udev, sleeping 1000ms");
usleep(1000 * UDEV_SLEEP_IF_NO_DEVICE);
}
else {
assert(device);
slog(SLOG_INFO, "new devive");
const char* s = 0;
s = udev_device_get_devtype(device);
if (s) {
slog(SLOG_INFO, "udev device type: %s", s);
if (strcmp(s, UDEV_DEVICE_TYPE) == 0) {
s = udev_device_get_action(device);
if (s) {
slog(SLOG_INFO, "udev device action: %s", s);
if (strcmp(s, UDEV_ADD_ACTION) == 0) {
dbus_signal_device_added();
}
if (strcmp(s, UDEV_REMOVE_ACTION) == 0) {
dbus_signal_device_removed();
}
}
}
}
udev_device_unref(device);
device = 0;
}
pthread_cleanup_pop(0);
}
pthread_exit(NULL);
}
void udev_start_udev_thread(void)
{
if (udev_init() < 0) {
slog(SLOG_ERROR, "Can't init udev");
return;
}
slog(SLOG_DEBUG, "start udev thread");
if (udev_tid != 0) {
slog(SLOG_DEBUG, "udev thread already running");
return;
}
if (pthread_create(&udev_tid, NULL, udev_thread, NULL) < 0){
slog(SLOG_ERROR, "Can't create udev thread: %s", strerror(errno));
return;
}
}
void udev_stop_udev_thread(void) {
slog(SLOG_DEBUG, "stop udev thread");
if (udev_tid == 0) {
slog(SLOG_DEBUG, "no udev thread to stop");
return;
}
if (pthread_cancel(udev_tid) < 0) {
if (errno == ESRCH) {
slog(SLOG_WARN, "udev thread was already cancelled");
}
else {
slog(SLOG_WARN, "unknown error from pthread_cancel: %s", strerror(errno));
}
}
slog(SLOG_DEBUG, "join udev thread");
if (pthread_join(udev_tid, NULL) < 0) {
slog(SLOG_ERROR, "pthread_join: %s", strerror(errno));
}
udev_tid = 0;
if (udev_close() < 0) {
slog(SLOG_ERROR, "Can't close udev");
}
}
#endif
./1.5.1/src/scanbd/slog.h 0000644 0001751 0001751 00000002267 13075613565 014353 0 ustar lmeier lmeier /*
* $Id: slog.h 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SLOG_H
#define SLOG_H
#include "common.h"
#define SLOG_ERROR 1
#define SLOG_WARN 2
#define SLOG_INFO 3
#define SLOG_DEBUG 4
extern bool debug;
extern unsigned int debug_level;
void slog(unsigned int level, const char *format, ...);
void slog_init(const char *string);
#endif
./1.5.1/src/scanbd/Makefile.in 0000644 0001751 0001751 00000057416 13075613451 015303 0 ustar lmeier lmeier # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 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@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
sbin_PROGRAMS = scanbd$(EXEEXT)
@USE_SANE_TRUE@am__append_1 = \
@USE_SANE_TRUE@ sane.c
@USE_SANE_TRUE@am__append_2 = \
@USE_SANE_TRUE@ $(SANE_CFLAGS)
@USE_SANE_TRUE@am__append_3 = \
@USE_SANE_TRUE@ $(SANE_LIBS)
@USE_SCANBUTTOND_TRUE@noinst_PROGRAMS = testscanbuttond$(EXEEXT)
@USE_SCANBUTTOND_TRUE@am__append_4 = \
@USE_SCANBUTTOND_TRUE@ -I ../scanbuttond/include
@USE_SCANBUTTOND_TRUE@am__append_5 = \
@USE_SCANBUTTOND_TRUE@ ../scanbuttond/interface/libusbi.o
@USE_SCANBUTTOND_TRUE@am__append_6 = \
@USE_SCANBUTTOND_TRUE@ scanbuttond_wrapper.c \
@USE_SCANBUTTOND_TRUE@ scanbuttond_loader.c \
@USE_SCANBUTTOND_TRUE@ scanbuttond_wrapper.h \
@USE_SCANBUTTOND_TRUE@ scanbuttond_loader.h
subdir = src/scanbd
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(sbindir)"
PROGRAMS = $(noinst_PROGRAMS) $(sbin_PROGRAMS)
am__scanbd_SOURCES_DIST = scanbd.c common.h config.c config.h \
daemonize.c dbus.c udev.c udev.h slog.c slog.h scanbd_dbus.h \
scanbd.h sane.c scanbuttond_wrapper.c scanbuttond_loader.c \
scanbuttond_wrapper.h scanbuttond_loader.h
@USE_SANE_TRUE@am__objects_1 = sane.$(OBJEXT)
@USE_SCANBUTTOND_TRUE@am__objects_2 = scanbuttond_wrapper.$(OBJEXT) \
@USE_SCANBUTTOND_TRUE@ scanbuttond_loader.$(OBJEXT)
am_scanbd_OBJECTS = scanbd.$(OBJEXT) config.$(OBJEXT) \
daemonize.$(OBJEXT) dbus.$(OBJEXT) udev.$(OBJEXT) \
slog.$(OBJEXT) $(am__objects_1) $(am__objects_2)
scanbd_OBJECTS = $(am_scanbd_OBJECTS)
scanbd_LDADD = $(LDADD)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
am__testscanbuttond_SOURCES_DIST = testscanbuttond.c config.c slog.c \
scanbuttond_loader.c scanbuttond_wrapper.c dbus.c
@USE_SCANBUTTOND_TRUE@am_testscanbuttond_OBJECTS = \
@USE_SCANBUTTOND_TRUE@ testscanbuttond.$(OBJEXT) \
@USE_SCANBUTTOND_TRUE@ config.$(OBJEXT) slog.$(OBJEXT) \
@USE_SCANBUTTOND_TRUE@ scanbuttond_loader.$(OBJEXT) \
@USE_SCANBUTTOND_TRUE@ scanbuttond_wrapper.$(OBJEXT) \
@USE_SCANBUTTOND_TRUE@ dbus.$(OBJEXT)
testscanbuttond_OBJECTS = $(am_testscanbuttond_OBJECTS)
testscanbuttond_LDADD = $(LDADD)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(scanbd_SOURCES) $(testscanbuttond_SOURCES)
DIST_SOURCES = $(am__scanbd_SOURCES_DIST) \
$(am__testscanbuttond_SOURCES_DIST)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFUSE_CFLAGS = @CONFUSE_CFLAGS@
CONFUSE_LIBS = @CONFUSE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
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@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
FGREP = @FGREP@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_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@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
OS_CPPFLAGS = @OS_CPPFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SANED_PATH = @SANED_PATH@
SANE_CFLAGS = @SANE_CFLAGS@
SANE_CONFIG = @SANE_CONFIG@
SANE_LIBS = @SANE_LIBS@
SCANBD_CFG_DIR = @SCANBD_CFG_DIR@
SCANBD_GROUP = @SCANBD_GROUP@
SCANBD_USER = @SCANBD_USER@
SCANBUTTOND_LIB_DIR = @SCANBUTTOND_LIB_DIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
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@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
scanbd_SOURCES = scanbd.c common.h config.c config.h daemonize.c \
dbus.c udev.c udev.h slog.c slog.h scanbd_dbus.h scanbd.h \
$(am__append_1) $(am__append_6)
EXTRA_DIST = \
Makefile.simple
AM_CFLAGS = $(OS_CFLAGS) $(PTHREAD_CFLAGS) $(OS_CPPFLAGS) \
$(EXTRA_CFLAGS) $(CONFUSE_CFLAGS) $(UDEV_CFLAGS) \
$(DBUS_CFLAGS) $(HAL_CFLAGS) \
-DSCANBUTTOND_LIB_DIR=\"@SCANBUTTOND_LIB_DIR@\" \
-DSCANBD_CFG_DIR=\"@SCANBD_CFG_DIR@\" \
-DSANED_PATH=\"@SANED_PATH@\" $(am__append_2) $(am__append_4)
AM_LDFLAGS = $(OS_LIBS) $(PTHREAD_LIBS) $(CONFUSE_LIBS) $(UDEV_LIBS) \
$(DBUS_LIBS) $(HAL_LIBS) $(LIBUSB_LIBS) -rdynamic \
$(am__append_3) $(am__append_5)
@USE_SCANBUTTOND_TRUE@testscanbuttond_SOURCES = \
@USE_SCANBUTTOND_TRUE@ testscanbuttond.c \
@USE_SCANBUTTOND_TRUE@ config.c \
@USE_SCANBUTTOND_TRUE@ slog.c \
@USE_SCANBUTTOND_TRUE@ scanbuttond_loader.c \
@USE_SCANBUTTOND_TRUE@ scanbuttond_wrapper.c \
@USE_SCANBUTTOND_TRUE@ dbus.c
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/scanbd/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/scanbd/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstPROGRAMS:
@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
install-sbinPROGRAMS: $(sbin_PROGRAMS)
@$(NORMAL_INSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
$(MKDIR_P) "$(DESTDIR)$(sbindir)" || exit 1; \
fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
while read p p1; do if test -f $$p \
|| test -f $$p1 \
; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
sed -e 'p;s,.*/,,;n;h' \
-e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
{ d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
if ($$2 == $$4) files[d] = files[d] " " $$1; \
else { print "f", $$3 "/" $$4, $$1; } } \
END { for (d in files) print "f", d, files[d] }' | \
while read type dir files; do \
if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
test -z "$$files" || { \
echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
$(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
} \
; done
uninstall-sbinPROGRAMS:
@$(NORMAL_UNINSTALL)
@list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
-e 's/$$/$(EXEEXT)/' \
`; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(sbindir)" && rm -f $$files
clean-sbinPROGRAMS:
@list='$(sbin_PROGRAMS)'; test -n "$$list" || exit 0; \
echo " rm -f" $$list; \
rm -f $$list || exit $$?; \
test -n "$(EXEEXT)" || exit 0; \
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
scanbd$(EXEEXT): $(scanbd_OBJECTS) $(scanbd_DEPENDENCIES) $(EXTRA_scanbd_DEPENDENCIES)
@rm -f scanbd$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(scanbd_OBJECTS) $(scanbd_LDADD) $(LIBS)
testscanbuttond$(EXEEXT): $(testscanbuttond_OBJECTS) $(testscanbuttond_DEPENDENCIES) $(EXTRA_testscanbuttond_DEPENDENCIES)
@rm -f testscanbuttond$(EXEEXT)
$(AM_V_CCLD)$(LINK) $(testscanbuttond_OBJECTS) $(testscanbuttond_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/config.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/daemonize.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbus.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/sane.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanbd.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanbuttond_loader.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanbuttond_wrapper.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slog.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/testscanbuttond.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/udev.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(PROGRAMS)
installdirs:
for dir in "$(DESTDIR)$(sbindir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: 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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
clean-sbinPROGRAMS mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am: install-sbinPROGRAMS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(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-sbinPROGRAMS
@$(NORMAL_INSTALL)
$(MAKE) $(AM_MAKEFLAGS) uninstall-hook
.MAKE: install-am install-exec-am install-strip uninstall-am
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstPROGRAMS clean-sbinPROGRAMS \
cscopelist-am ctags ctags-am distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-exec-hook install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-sbinPROGRAMS install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-hook \
uninstall-sbinPROGRAMS
.PRECIOUS: Makefile
install-exec-hook:
cd $(DESTDIR)$(sbindir) && \
rm -f scanbm$(EXEEXT) && \
$(LN_S) scanbd$(EXEEXT) scanbm$(EXEEXT)
uninstall-hook:
cd $(DESTDIR)$(sbindir) && \
rm -f scanbm$(EXEEXT)
# 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:
./1.5.1/src/scanbd/scanbuttond_wrapper.h 0000644 0001751 0001751 00000002717 13075613565 017473 0 ustar lmeier lmeier /*
* $Id: scanbuttond_wrapper.h 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SCANBUTTOND_WRAPPER_H
#define SCANBUTTOND_WRAPPER_H
#include "common.h"
#ifndef USE_SANE
#include "scanbuttond_loader.h"
extern backend_t* backend; // in scanbd.c
#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
void scbtn_init_mutex();
#endif
void get_scbtn_devices(void);
const char* scanbtnd_button_name(const backend_t* backend, unsigned int button);
void start_scbtn_threads(void);
void stop_scbtn_threads(void);
void scbtn_trigger_action(int number_of_dev, int action);
void scbtn_shutdown(void);
#endif
#endif // SCANBUTTOND_WRAPPER_H
./1.5.1/src/scanbd/scanbuttond_loader.c 0000644 0001751 0001751 00000012230 13075613565 017243 0 ustar lmeier lmeier /*
* $Id: scanbuttond_loader.c 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "scanbd.h"
#include "scanbuttond_loader.h"
#include "scanbuttond_wrapper.h"
#include
// this file is basicly the same as loader.c from the scanbuttond-project,
// but modified to meet the needs of scanbd
static char lib_dir[PATH_MAX] = SCANBD_NULL_STRING;
int scanbtnd_init() {
char *backends_dir = NULL;
char backends_dir_abs[PATH_MAX] = SCANBD_NULL_STRING;
backends_dir = cfg_getstr(cfg_getsec(cfg, C_GLOBAL), C_SCANBUTTONS_BACKENDS_DIR);
if ( backends_dir && (backends_dir[0] != '/')) {
// Relative path, expand
snprintf(backends_dir_abs, PATH_MAX, "%s/%s", SCANBD_CFG_DIR, backends_dir);
backends_dir = backends_dir_abs;
}
if (backends_dir) {
strncpy(lib_dir, backends_dir, PATH_MAX );
}
if (scanbtnd_loader_init() != 0) {
slog(SLOG_INFO, "Could not initialize module loader!\n");
return -1;
}
backend = scanbtnd_load_backend("meta");
if (!backend) {
slog(SLOG_INFO, "Unable to load backend library\n");
scanbtnd_loader_exit();
return -1;
}
if (backend->scanbtnd_init() != 0) {
slog(SLOG_ERROR, "Error initializing backend. Terminating.");
return -1;
}
return 0;
}
void scanbtnd_set_libdir(const char* dir){
strncpy(lib_dir, dir, PATH_MAX);
}
char *scanbtnd_get_lib_dir(void) {
return lib_dir;
}
int scanbtnd_loader_init(){
return 0;
}
void scanbtnd_loader_exit(void){
return;
}
backend_t* scanbtnd_load_backend(const char* filename){
const char* error;
void* dll_handle;
char dll_path[PATH_MAX];
strncpy(dll_path, lib_dir, PATH_MAX);
strncat(dll_path, "/", PATH_MAX - strlen(dll_path));
strncat(dll_path, filename, PATH_MAX - strlen(dll_path));
strncat(dll_path, ".so", PATH_MAX - strlen(dll_path));
slog(SLOG_INFO, "Loading %s", dll_path);
if (!(dll_handle = dlopen(dll_path, RTLD_NOW|RTLD_LOCAL))) {
slog(SLOG_ERROR, "Can't load %s: %s", dll_path, dlerror());
return NULL;
}
dlerror(); // Clear any existing error
backend_t* backend = (backend_t*)malloc(sizeof(backend_t));
assert(backend);
backend->handle = (void*)dll_handle;
backend->scanbtnd_get_backend_name = dlsym(dll_handle, "scanbtnd_get_backend_name");
if ((error = dlerror()) != NULL) {
slog(SLOG_ERROR, "Can't find symbol: %s", error);
goto cleanup;
}
backend->scanbtnd_init = dlsym(dll_handle, "scanbtnd_init");
if ((error = dlerror()) != NULL) {
slog(SLOG_ERROR, "Can't find symbol: %s", error);
goto cleanup;
}
backend->scanbtnd_rescan = dlsym(dll_handle, "scanbtnd_rescan");
if ((error = dlerror()) != NULL) {
slog(SLOG_ERROR, "Can't find symbol: %s", error);
goto cleanup;
}
backend->scanbtnd_get_supported_devices = dlsym(dll_handle, "scanbtnd_get_supported_devices");
if ((error = dlerror()) != NULL) {
slog(SLOG_ERROR, "Can't find symbol: %s", error);
goto cleanup;
}
backend->scanbtnd_open = dlsym(dll_handle, "scanbtnd_open");
if ((error = dlerror()) != NULL) {
slog(SLOG_ERROR, "Can't find symbol: %s", error);
goto cleanup;
}
backend->scanbtnd_close = dlsym(dll_handle, "scanbtnd_close");
if ((error = dlerror()) != NULL) {
slog(SLOG_ERROR, "Can't find symbol: %s", error);
goto cleanup;
}
backend->scanbtnd_get_button = dlsym(dll_handle, "scanbtnd_get_button");
if ((error = dlerror()) != NULL) {
slog(SLOG_ERROR, "Can't find symbol: %s", error);
goto cleanup;
}
backend->scanbtnd_get_sane_device_descriptor = dlsym(dll_handle, "scanbtnd_get_sane_device_descriptor");
if ((error = dlerror()) != NULL) {
slog(SLOG_ERROR, "Can't find symbol: %s", error);
goto cleanup;
}
backend->scanbtnd_exit = dlsym(dll_handle, "scanbtnd_exit");
if ((error = dlerror()) != NULL) {
slog(SLOG_ERROR, "Can't find symbol: %s", error);
goto cleanup;
}
return backend;
cleanup:
assert(dll_handle);
dlclose(dll_handle);
free(backend);
return NULL;
}
void scanbtnd_unload_backend(backend_t* backend){
if (backend->handle != NULL) {
dlclose(backend->handle);
backend->handle = NULL;
free(backend);
}
}
./1.5.1/src/scanbd/testscanbuttond.c 0000644 0001751 0001751 00000012107 13075613565 016620 0 ustar lmeier lmeier /*
* $Id: testscanbuttond.c 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "scanbd.h"
#ifdef USE_SCANBUTTOND
#include "scanbuttond_loader.h"
#include "scanbuttond_wrapper.h"
#endif
#define DEF_POLL_DELAY 333000L
#define MIN_POLL_DELAY 1000L
#define DEF_RETRY_DELAY 2000000L
#define MIN_RETRY_DELAY 10000L
#define BUF_SIZE 256
cfg_t* cfg = NULL;
static char* connection_names[NUM_CONNECTIONS] =
{ "none", "libusb" };
backend_t* backend;
static long poll_delay;
static long retry_delay;
static int killed = 0;
char* scanbtnd_get_connection_name(int connection)
{
return connection_names[connection];
}
// Ensures a graceful exit on SIGHUP/SIGTERM/SIGINT/SIGSEGV
void sighandler(int i)
{
killed = 1;
slog(SLOG_INFO, "received signal %d", i);
scbtn_shutdown();
exit(i == SIGTERM ? EXIT_SUCCESS : EXIT_FAILURE);
}
void list_devices(scanner_t* devices)
{
scanner_t* dev = devices;
while (dev != NULL) {
slog(SLOG_INFO, "found scanner: vendor=\"%s\", product=\"%s\", connection=\"%s\", sane_name=\"%s\"",
dev->vendor, dev->product, scanbtnd_get_connection_name(dev->connection),
backend->scanbtnd_get_sane_device_descriptor(dev));
dev = dev->next;
}
}
int main()
{
int button;
int result;
scanner_t* scanners;
scanner_t* scanner;
slog_init("test");
debug = true;
debug_level = 7;
scanbtnd_set_libdir("../scanbuttond/backends");
if (scanbtnd_loader_init() != 0) {
slog(SLOG_INFO, "Could not initialize module loader!\n");
exit(EXIT_FAILURE);
}
backend = scanbtnd_load_backend("meta");
if (!backend) {
slog(SLOG_INFO, "Unable to load backend library\n");
scanbtnd_loader_exit();
exit(EXIT_FAILURE);
}
if (backend->scanbtnd_init() != 0) {
slog(SLOG_ERROR, "Error initializing backend. Terminating.");
exit(EXIT_FAILURE);
}
scanners = backend->scanbtnd_get_supported_devices();
if (scanners == NULL) {
slog(SLOG_WARN, "no known scanner found yet, " \
"waiting for device to be attached");
}
list_devices(scanners);
signal(SIGTERM, &sighandler);
signal(SIGHUP, &sighandler);
signal(SIGINT, &sighandler);
signal(SIGSEGV, &sighandler);
signal(SIGCHLD, SIG_IGN);
slog(SLOG_INFO, "scanbuttond started");
// main loop
while (killed == 0) {
if (scanners == NULL) {
slog(SLOG_DEBUG, "rescanning devices...");
backend->scanbtnd_rescan();
scanners = backend->scanbtnd_get_supported_devices();
if (scanners == NULL) {
slog(SLOG_DEBUG, "no supported devices found. rescanning in a few seconds...");
usleep(retry_delay);
continue;
}
scanners = backend->scanbtnd_get_supported_devices();
continue;
}
scanner = scanners;
while (scanner != NULL) {
result = backend->scanbtnd_open(scanner);
if (result != 0) {
slog(SLOG_WARN, "scanbtnd_open failed, error code: %d", result);
if (result == -ENODEV) {
// device has been disconnected, force re-scan
slog(SLOG_INFO, "scanbtnd_open returned -ENODEV, device rescan will be performed");
scanners = NULL;
usleep(retry_delay);
break;
}
usleep(retry_delay);
break;
}
slog(SLOG_INFO, "get");
button = backend->scanbtnd_get_button(scanner);
slog(SLOG_INFO, "value: %d", button);
backend->scanbtnd_close(scanner);
if ((button > 0) && (button != scanner->lastbutton)) {
slog(SLOG_INFO, "button %d has been pressed.", button);
scanner->lastbutton = button;
}
if ((button == 0) && (scanner->lastbutton > 0)) {
slog(SLOG_INFO, "button %d has been released.", scanner->lastbutton);
scanner->lastbutton = button;
}
scanner = scanner->next;
}
usleep(poll_delay);
}
slog(SLOG_WARN, "exited main loop!?!");
scbtn_shutdown();
exit(EXIT_SUCCESS);
}
./1.5.1/src/scanbd/scanbd.h 0000644 0001751 0001751 00000010620 13075613565 014631 0 ustar lmeier lmeier /*
* $Id: scanbd.h 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SCANBD_H
#define SCANBD_H
#ifndef USE_SANE
# ifndef USE_SCANBUTTOND
# define USE_SCANBUTTOND
# endif
#endif
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include "common.h"
#include
#include
#ifdef USE_SANE
# include
#else
# include
#endif
#include "config.h"
#include "slog.h"
#include "scanbd_dbus.h"
#include "udev.h"
// #define SANE_REINIT // do a sane_exit()/sane_init() sequence if new devices are found
#define SANE_REINIT_TIMEOUT 3 // TODO: don't know if this is really neccessary
#define SCANBUTTOND_ALARM_TIMEOUT 5 // reconfigure after this amount of seconds if
// device was busy
#define C_FROM_VALUE "from-value"
#define C_FROM_VALUE_DEF_INT 0
#define C_FROM_VALUE_DEF_STR ""
#define C_TO_VALUE "to-value"
#define C_TO_VALUE_DEF_INT 1
#define C_TO_VALUE_DEF_STR ".+"
#define C_FILTER "filter"
#define C_ACTION_DEF "^scan.*"
#define C_FUNCTION_DEF "^function.*"
#define C_NUMERICAL_TRIGGER "numerical-trigger"
#define C_STRING_TRIGGER "string-trigger"
#define C_DESC "desc"
#define C_DESC_DEF "The description goes here"
#define C_SCRIPT "script"
#define C_SCRIPT_DEF ""
#define C_ENV "env"
#define C_ENV_FUNCTION "SCANBD_FUNCTION"
#define C_ENV_FUNCTION_DEF "SCANBD_FUNCTION"
#define C_ENV_DEVICE "device"
#define C_ENV_DEVICE_DEF "SCANBD_DEVIVCE"
#define C_ENV_ACTION "action"
#define C_ENV_ACTION_DEF "SCANBD_ACTION"
#define C_DEBUG "debug"
#define C_DEBUG_DEF false
#define C_MULTIPLE_ACTIONS "multiple_actions"
#define C_MULTIPLE_ACTIONS_DEF true
#define C_DEBUG_LEVEL "debug-level"
#define C_DEBUG_LEVEL_DEF 1
#define C_USER "user"
#define C_USER_DEF "saned"
#define C_GROUP "group"
#define C_GROUP_DEF "scanner"
#define C_SANED "saned"
#ifdef SANED_PATH
#define C_SANED_DEF SANED_PATH
#else
#error SANED_PATH is not set!
#endif
#define C_SANED_OPTS "saned_opt"
#define C_SANED_OPTS_DEF "{}"
#define C_SCRIPTDIR "scriptdir"
#define C_SCRIPTDIR_DEF ""
#define C_DEVICE_INSERT_SCRIPT "device_insert_script"
#define C_DEVICE_INSERT_SCRIPT_DEF ""
#define C_DEVICE_REMOVE_SCRIPT "device_remove_script"
#define C_DEVICE_REMOVE_SCRIPT_DEF ""
#define C_SCANBUTTONS_BACKENDS_DIR "scanbuttond_backends_dir"
#ifdef SCANBUTTOND_LIB_DIR
#define C_SCANBUTTONS_BACKENDS_DIR_DEF SCANBUTTOND_LIB_DIR
#else
#error SCANBUTTOND_LIB_DIR is not set!
#endif
#define C_SANED_ENVS "saned_env"
#define C_SANED_ENVS_DEF "{}"
#define C_TIMEOUT "timeout"
#define C_TIMEOUT_DEF 500
// TODO: move definition of scanbd.pid to configuration in Makefiles
//
#define C_PIDFILE "pidfile"
#define C_PIDFILE_DEF "/var/run/scanbd.pid"
#define C_ENVIRONMENT "environment"
#define C_FUNCTION "function"
#define C_ACTION "action"
#define C_GLOBAL "global"
#define C_DEVICE "device"
#define C_INCLUDE "include"
#define SCANBD_NULL_STRING "(null)"
#ifdef SCANBD_CFG_DIR
#define SCANBD_CONF SCANBD_CFG_DIR "/scanbd.conf"
#else
#error SCANBD_CFG_DIR is not set!
#endif
#define NAME_POLLING_MODE "scanbd"
#define NAME_MANAGER_MODE "scanbm"
struct scanbdOptions {
bool managerMode;
bool foreground;
bool signal;
const char* config_file_name;
};
// command-line options
extern struct scanbdOptions scanbd_options;
// config from the config-file
extern cfg_t* cfg;
// functions
#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
extern void sane_init_mutex();
#endif
extern void get_sane_devices(void);
extern void sane_trigger_action(int, int);
extern void stop_sane_threads(void);
extern void start_sane_threads(void);
extern void daemonize(void);
#endif
./1.5.1/src/scanbd/common.h 0000644 0001751 0001751 00000006207 13075613565 014675 0 ustar lmeier lmeier /*
* $Id: common.h 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef COMMON_H
#define COMMON_H
// we require POSIX 200809 compatibility
#define _POSIX_C_SOURCE 200809L
#ifndef _XOPEN_SOURCE
# define _XOPEN_SOURCE 700
#endif
#ifdef __FreeBSD__
// otherwise usleep() isn't declared
# define __BSD_VISIBLE 1
#endif
#ifdef __OpenBSD__
# ifndef _POSIX_THREADS
# define _POSIX_THREADS 1
# endif
#endif
#if defined(__STDC__) && (__STDC_VERSION__ >= 199901L)
# include
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#if defined(_POSIX_THREADS) && ((_POSIX_THREADS - 0) >= 0)
# include
#else
# warning "No pthreads support"
#endif
#if (_POSIX_MAPPED_FILES - 0) >= 0 || (_POSIX_SHARED_MEMORY_OBJECTS - 0) >= 0 || \
(_POSIX_MEMLOCK - 0) >= 0 || (_POSIX_MEMORY_PROTECTION - 0) >= 0 || \
(_POSIX_TYPED_MEMORY_OBJECTS - 0) >= 0 || (_POSIX_SYNCHRONIZED_IO - 0) >= 0 || \
(_POSIX_ADVISORY_INFO - 0) >= 0
# include
#endif
#if (_POSIX_MAPPED_FILES - 0) >= 0 || (_POSIX_SHARED_MEMORY_OBJECTS - 0) >= 0 || \
(_POSIX_TYPED_MEMORY_OBJECTS - 0) >= 0
# define _MC3 /* see POSIX Standard margin notes */
#endif
#if defined(_POSIX_MESSAGE_PASSING) && ((_POSIX_MESSAGE_PASSING - 0) >= 0)
# include
#endif
#ifdef _XOPEN_UNIX
# include
# ifdef HAVE_UTMPX_H
# include
# else
# ifdef HAVE_UTMP_H
# include
# endif /* HAVE_UTMP_H */
# endif /* HAVE_UTMPX_H */
# include
# include
# include
# include
# include
# include
# include
# ifndef CYGWIN
# include
# endif
#endif
#if __cplusplus > 199711L || __GXX_EXPERIMENTAL_CXX0X__
# define CXX11
#endif
#define PIPE_READ 0
#define PIPE_WRITE 1
#ifndef TRUE
# define TRUE 1
#endif
#ifndef FALSE
# define FALSE 0
#endif
#endif
./1.5.1/src/scanbd/Makefile.am 0000644 0001751 0001751 00000003034 13075613451 015255 0 ustar lmeier lmeier ## Process this file with automake to produce Makefile.in
## AUTOMAKE_OPTIONS = foreign
sbin_PROGRAMS = scanbd
scanbd_SOURCES = \
scanbd.c \
common.h \
config.c \
config.h \
daemonize.c \
dbus.c \
udev.c \
udev.h \
slog.c \
slog.h \
scanbd_dbus.h \
scanbd.h
EXTRA_DIST = \
Makefile.simple
AM_CFLAGS = \
$(OS_CFLAGS) \
$(PTHREAD_CFLAGS) \
$(OS_CPPFLAGS) \
$(EXTRA_CFLAGS) \
$(CONFUSE_CFLAGS) \
$(UDEV_CFLAGS) \
$(DBUS_CFLAGS) \
$(HAL_CFLAGS) \
-DSCANBUTTOND_LIB_DIR=\"@SCANBUTTOND_LIB_DIR@\" \
-DSCANBD_CFG_DIR=\"@SCANBD_CFG_DIR@\" \
-DSANED_PATH=\"@SANED_PATH@\"
AM_LDFLAGS = \
$(OS_LIBS) \
$(PTHREAD_LIBS) \
$(CONFUSE_LIBS)\
$(UDEV_LIBS) \
$(DBUS_LIBS) \
$(HAL_LIBS) \
$(LIBUSB_LIBS) \
-rdynamic
install-exec-hook:
cd $(DESTDIR)$(sbindir) && \
rm -f scanbm$(EXEEXT) && \
$(LN_S) scanbd$(EXEEXT) scanbm$(EXEEXT)
uninstall-hook:
cd $(DESTDIR)$(sbindir) && \
rm -f scanbm$(EXEEXT)
if USE_SANE
scanbd_SOURCES += \
sane.c
AM_CFLAGS += \
$(SANE_CFLAGS)
AM_LDFLAGS += \
$(SANE_LIBS)
endif
if USE_SCANBUTTOND
# testscanbuttond does not work when we compile with autofoo: libtool
# onl;y generates the .so files at install time
noinst_PROGRAMS = testscanbuttond
AM_CFLAGS += \
-I ../scanbuttond/include
AM_LDFLAGS += \
../scanbuttond/interface/libusbi.o
scanbd_SOURCES += \
scanbuttond_wrapper.c \
scanbuttond_loader.c \
scanbuttond_wrapper.h \
scanbuttond_loader.h
testscanbuttond_SOURCES = \
testscanbuttond.c \
config.c \
slog.c \
scanbuttond_loader.c \
scanbuttond_wrapper.c \
dbus.c
endif
./1.5.1/src/scanbd/Makefile.simple 0000644 0001751 0001751 00000003520 13075613451 016151 0 ustar lmeier lmeier #
# $Id: Makefile.simple 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
include ../../Makefile.include
.PHONY: all
ifdef USE_SANE
all: scanbd
scanbd: scanbd.o config.o slog.o sane.o daemonize.o dbus.o udev.o
else # USE_SANE
all: scanbd test
testonly: test
test: testscanbuttond
scanbd: scanbd.o slog.o config.o daemonize.o dbus.o scanbuttond_wrapper.o scanbuttond_loader.o udev.o
$(LINK.c) $^ ../scanbuttond/interface/libusbi.o $(LDLIBS) -o $@
testscanbuttond: testscanbuttond.o scanbuttond_loader.o config.o slog.o scanbuttond_wrapper.o dbus.o
$(LINK.c) $^ ../scanbuttond/interface/libusbi.o $(LDLIBS) -o $@
endif # USE_SANE
scanbuttond_wrapper.o: scanbuttond_wrapper.c scanbuttond_wrapper.h
scanbuttond_loader.o: scanbuttond_loader.c scanbuttond_loader.h
scanbd.o: scanbd.c scanbd.h common.h slog.h scanbd_dbus.h
dbus.o: dbus.c scanbd.h common.h slog.h scanbd_dbus.h
slog.o: slog.c common.h
daemonize.o: daemonize.c common.h
sane.o: sane.c scanbd.h common.h
udev.o: udev.c udev.h scanbd.h
clean:
$(RM) -f scanbd test *.o *~
./1.5.1/src/scanbd/slog.c 0000644 0001751 0001751 00000003271 13075613565 014342 0 ustar lmeier lmeier /*
* $Id: slog.c 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "common.h"
#include "slog.h"
bool debug = false;
unsigned int debug_level = 0;
static char lpre[LINE_MAX] = "";
static int isInitialized = 0;
void slog_init(const char *string) {
strncpy(lpre, string, LINE_MAX);
isInitialized = 1;
}
void
slog(unsigned int level, const char *format, ...) {
va_list ap;
char buffer[LINE_MAX] = "";
if (isInitialized == 0) {
slog_init("");
isInitialized = 1;
}
if (!(level <= debug_level))
return;
va_start(ap, format);
vsnprintf(buffer, LINE_MAX, format, ap);
va_end(ap);
if (debug) {
printf("%s: %s\n", lpre, buffer);
syslog(LOG_DAEMON | LOG_DEBUG, "%s: %s\n", lpre, buffer);
}
else {
syslog(LOG_DAEMON | LOG_DEBUG, "%s: %s\n", lpre, buffer);
}
}
./1.5.1/src/scanbd/scanbd_dbus.h 0000644 0001751 0001751 00000004775 13075613565 015664 0 ustar lmeier lmeier /*
* $Id: scanbd_dbus.h 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SCANBD_DBUS_H
#define SCANBD_DBUS_H
#ifndef _GNU_SOURCE
# define _GNU_SOURCE
#endif
#include "common.h"
#include "slog.h"
#include
#ifdef USE_HAL
# include
#endif
// dbus interface
#define SCANBD_DBUS_ADDRESS "de.kmux.scanbd.server"
#define SCANBD_DBUS_OBJECTPATH "/de/kmux/scanbd/server"
#define SCANBD_DBUS_INTERFACE "de.kmux.scanbd.server"
// dbus methods handled by scandb
#define SCANBD_DBUS_METHOD_ACQUIRE "aquire"
#define SCANBD_DBUS_METHOD_RELEASE "release"
#define SCANBD_DBUS_METHOD_TRIGGER "trigger"
// dbus signals send out
#define SCANBD_DBUS_SIGNAL_TRIGGER "trigger"
#define SCANBD_DBUS_SIGNAL_SANED_BEGIN "saned_begin"
#define SCANBD_DBUS_SIGNAL_SANED_END "saned_end"
#define SCANBD_DBUS_SIGNAL_SCAN_BEGIN "scan_begin"
#define SCANBD_DBUS_SIGNAL_SCAN_END "scan_end"
// dbus signals we receive
#define DBUS_HAL_INTERFACE "org.freedesktop.Hal.Manager"
#define DBUS_HAL_SIGNAL_DEV_ADDED "DeviceAdded"
#define DBUS_HAL_SIGNAL_DEV_REMOVED "DeviceRemoved"
#define HAL_SCANNER_CAPABILITY "scanner"
extern void dbus_send_signal(const char*, const char*);
extern void dbus_send_signal_argv(const char*, char**);
extern void dbus_send_signal_argv_async(const char*, char**);
extern bool dbus_init(void);
extern void dbus_send(void);
extern void dbus_call_method(const char*, const char*);
extern void dbus_call_trigger(unsigned int, unsigned int);
extern void dbus_start_dbus_thread(void);
extern void dbus_stop_dbus_thread(void);
extern void dbus_signal_device_removed(void);
extern void dbus_signal_device_added(void);
#endif
./1.5.1/src/scanbd/sane.c 0000644 0001751 0001751 00000162435 13075613565 014334 0 ustar lmeier lmeier /*
* $Id: sane.c 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "scanbd.h"
#include "scanbd_dbus.h"
#define CANCEL_TEST
// all programm-global sane functions use this mutex to avoid races
#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
// this is non-portable
static pthread_mutex_t sane_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
#else
static pthread_mutex_t sane_mutex;
#endif
static pthread_cond_t sane_cv = PTHREAD_COND_INITIALIZER;
// the following locking strategie must be obeyed:
// 1) lock the sane_mutex
// 2) lock the device specific mutex
// in this order to avoid deadlocks
// holding more than these two locks is not intended
#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
void sane_init_mutex()
{
slog(SLOG_INFO, "sane_init_mutex");
pthread_mutexattr_t mutexattr;
if (pthread_mutexattr_init(&mutexattr) < 0) {
slog(SLOG_ERROR, "Can't initialize mutex attr");
exit(EXIT_FAILURE);
}
if (pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE) < 0) {
slog(SLOG_ERROR, "Can't set mutex attr");
exit(EXIT_FAILURE);
}
if (pthread_mutex_init(&sane_mutex, &mutexattr) < 0) {
slog(SLOG_ERROR, "Can't init mutex");
exit(EXIT_FAILURE);
}
}
#endif
struct sane_opt_value {
unsigned long num_value; // before-value or after-value or actual-value (BOOL|INT|FIXED)
struct { // (STRING)
char* str; // actual-value
regex_t* reg; // before-regex or after-regex
} str_value;
};
typedef struct sane_opt_value sane_opt_value_t;
struct sane_dev_option {
int number; // the option-number of the device-option
sane_opt_value_t from_value; // the before-value of the option
sane_opt_value_t to_value; // the after-value of the option (to
// fire the trigger)
sane_opt_value_t value; // the option value (from the last
// polling cycle)
const char* script; // the found (matched) script to be called if
// the option-valued changes
const char* action_name; // the name of this action as
// specified in the config file
};
typedef struct sane_dev_option sane_dev_option_t;
struct sane_dev_function {
int number; // the option-number of the
// device-option
const char* env; // the name of the environment-var to
// pass to option value in
};
typedef struct sane_dev_function sane_dev_function_t;
// each polling thread is represented by struct sane_thread
// there is no locking, since this is "thread private data"
struct sane_thread {
pthread_t tid; // the thread-id of the polling
// thread
pthread_mutex_t mutex; // mutex for this data-structure
pthread_cond_t cv; // cv for this data-structure
bool triggered; // a rule for this device has fired (triggered == true)
int triggered_option; // the action number which triggered
const SANE_Device* dev; // the device
int num_of_options; // the number of all options for
// this device
SANE_Handle h; // the handle of the opened device
sane_dev_option_t *opts; // the list of matched actions
// for this device
int num_of_options_with_scripts; // the number of elements in the
// above list
sane_dev_function_t *functions; // the list of matched functions
// for this device
int num_of_options_with_functions;// the number of elements in the
// above list
};
typedef struct sane_thread sane_thread_t;
// the list of all polling threads
static sane_thread_t* sane_poll_threads = NULL;
// the list of all devices locally connected to our system
static const SANE_Device** sane_device_list = NULL;
// the number of devices = the number of polling threads
static int num_devices = 0;
void get_sane_devices(void) {
// detect all the scanners we have
slog(SLOG_INFO, "Scanning for local-only devices" );
if (pthread_mutex_lock(&sane_mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
return;
}
SANE_Status sane_status = SANE_STATUS_INVAL;
sane_device_list = NULL;
num_devices = 0;
if ((sane_status = sane_get_devices(&sane_device_list, SANE_TRUE)) != SANE_STATUS_GOOD) {
slog(SLOG_WARN, "Can't get the sane device list");
}
const SANE_Device** dev = sane_device_list;
if (dev == NULL) {
slog(SLOG_DEBUG, "device list null");
goto cleanup;
}
while(*dev != NULL) {
slog(SLOG_DEBUG, "found device: %s %s %s %s",
(*dev)->name, (*dev)->vendor, (*dev)->model, (*dev)->type);
num_devices += 1;
dev++;
}
if (pthread_cond_broadcast(&sane_cv)) {
slog(SLOG_ERROR, "pthread_cond_broadcast: %s", strerror(errno));
}
cleanup:
if (pthread_mutex_unlock(&sane_mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
return;
}
}
// simple hash function for C-strings
static unsigned long hash(const char *str) {
unsigned long hash = 5381;
int c;
while ((c = *str++)) {
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
}
return hash;
}
static void sane_option_value_init(sane_opt_value_t* v) {
v->num_value = 0;
v->str_value.str = NULL;
v->str_value.reg = NULL;
}
static void sane_option_value_free(sane_opt_value_t* v) {
if (v->str_value.str != NULL) {
free((void*)v->str_value.str);
v->str_value.str = NULL;
}
if (v->str_value.reg != NULL) {
regfree(v->str_value.reg);
free(v->str_value.reg);
v->str_value.reg = NULL;
}
}
static sane_opt_value_t get_sane_option_value(SANE_Handle* h, int index) {
slog(SLOG_DEBUG, "get_sane_option_value");
// get the value of option with index of the device (opened) with
// handle h
// if option can't be found or other catastrophy happens, the
// value 0 gets returned
#if ((__STDC_VERSION__ - 0) < 201112L) || ((__GNUC__ - 0) < 5)
sane_opt_value_t res;
#else
sane_opt_value_t res = {};
#endif
sane_option_value_init(&res);
const SANE_Option_Descriptor* odesc = NULL;
if ((odesc = sane_get_option_descriptor(h, index)) == NULL) {
return res;
}
if ((odesc->type == SANE_TYPE_BOOL) || (odesc->type == SANE_TYPE_INT) ||
(odesc->type == SANE_TYPE_FIXED) || (odesc->type == SANE_TYPE_BUTTON)) {
unsigned long int value = 0;
if ((unsigned int)odesc->size <= sizeof(long int)) {
//if we can store it in an long int
SANE_Status status = SANE_STATUS_INVAL;
if ((status = sane_control_option(h, index, SANE_ACTION_GET_VALUE,
&value, NULL)) != SANE_STATUS_GOOD) {
slog(SLOG_WARN, "Can't read value of %s: %s",
odesc->name, sane_strstatus(status));
return res;
}
res.num_value = value;
return res;
}
else {
// shouldn't happen
slog(SLOG_WARN, "Value of %s, sane-type %d too big", odesc->name, odesc->type);
return res;
}
}
else if (odesc->type == SANE_TYPE_STRING) {
res.str_value.str = calloc(odesc->size + 1, sizeof(char));
assert(res.str_value.str != NULL);
SANE_Status status = SANE_STATUS_INVAL;
if ((status = sane_control_option(h, index, SANE_ACTION_GET_VALUE,
res.str_value.str, NULL)) != SANE_STATUS_GOOD) {
slog(SLOG_WARN, "Can't read value of %s: %s", odesc->name, sane_strstatus(status));
return res;
}
res.str_value.str[odesc->size] = '\0';
size_t slen = strlen(res.str_value.str);
res.num_value = hash(res.str_value.str);
slog(SLOG_INFO, "Value of %s as string (len %d, hash %d): %s",
odesc->name, slen, res.num_value, res.str_value.str);
return res;
}
else {
slog(SLOG_WARN, "Can't read option %s of type %d", odesc->name, odesc->type);
}
return res;
}
// cleanup handler for sane_poll
static void sane_thread_cleanup_mutex(void* arg) {
assert(arg != NULL);
slog(SLOG_DEBUG, "sane_thread_cleanup_mutex");
pthread_mutex_t* mutex = (pthread_mutex_t*)arg;
if (pthread_mutex_unlock(mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
}
}
// cleanup handler for sane_poll
static void sane_thread_cleanup_value(void* arg) {
assert(arg != NULL);
slog(SLOG_DEBUG, "sane_thread_cleanup_value");
sane_opt_value_t* v = (sane_opt_value_t*)arg;
sane_option_value_free(v);
}
// this function can only be used in the critical region of *st
static void sane_find_matching_functions(sane_thread_t* st, cfg_t* sec) {
// TODO: use of recursive mutex???
slog(SLOG_DEBUG, "sane_find_matching_functions");
const char* title = cfg_title(sec);
if (title == NULL) {
title = SCANBD_NULL_STRING;
}
int functions = cfg_size(sec, C_FUNCTION);
if (functions <= 0) {
slog(SLOG_INFO, "no matching functions in section %s", title);
return;
}
slog(SLOG_INFO, "found %d functions in section %s", functions, title);
// iterate over all global functions
for(int i = 0; i < functions; i += 1) {
// get the function from the config file
cfg_t* function_i = cfg_getnsec(sec, C_FUNCTION, i);
assert(function_i != NULL);
// get the filter-regex from the config-file
const char* opt_regex = cfg_getstr(function_i, C_FILTER);
assert(opt_regex != NULL);
const char* title = cfg_title(function_i);
if (title == NULL) {
title = "(none)";
}
// compile the filter-regex
slog(SLOG_DEBUG, "checking function %s with filter: %s",
title, opt_regex);
regex_t creg;
int ret = regcomp(&creg, opt_regex, REG_EXTENDED | REG_NOSUB);
if (ret < 0) {
char err_text[1024];
regerror(ret, &creg, err_text, 1024);
slog(SLOG_WARN, "Can't compile regex: %s : %s", opt_regex, err_text);
continue;
}
// look for matching option-names
for(int opt = 1; opt < st->num_of_options; opt += 1) {
const SANE_Option_Descriptor* odesc = NULL;
if ((odesc = sane_get_option_descriptor(st->h, opt)) == NULL) {
// no valid option-descriptor available
// skip it
slog(SLOG_INFO, "option[%d] has no valid descriptor", opt);
continue;
}
assert(odesc);
if (!SANE_OPTION_IS_ACTIVE(odesc->cap)) {
slog(SLOG_INFO, "option[%d] is not active", opt);
continue;
}
// option is active
// only use active (user controllable) options
if (odesc->name == NULL) {
// we need a valid option-name
slog(SLOG_INFO, "option[%d] has no name", opt);
continue;
}
assert(odesc->name);
if (!((odesc->type == SANE_TYPE_BOOL) || (odesc->type == SANE_TYPE_INT) ||
(odesc->type == SANE_TYPE_FIXED)|| (odesc->type == SANE_TYPE_STRING) ||
(odesc->type == SANE_TYPE_BUTTON))) {
slog(SLOG_WARN, "option[%d] %s for device %s not of "
"type BOOL|INT|FIXED|STRING|BUTTON. Skipping",
opt, odesc->name, st->dev->name);
continue;
}
slog(SLOG_INFO, "found active option[%d] %s (type: %d) for device %s",
opt, odesc->name, odesc->type, st->dev->name);
// regex compare with the filter
if (regexec(&creg, odesc->name, 0, NULL, 0) != 0) {
// no match
continue;
}
// match
// now get the script
const char* env = cfg_getstr(function_i, C_ENV);
assert(env != NULL);
slog(SLOG_INFO, "installing function %s for %s, option[%d]: %s as env: %s",
title, st->dev->name, opt, odesc->name, env);
// looking for option already present in the
// array
int n = 0;
for(n = 0; n < st->num_of_options_with_functions; n += 1) {
if (st->functions[n].number == opt) {
slog(SLOG_WARN, "function %s overrides function of option[%d]",
title, n);
// break out with n == index_of_found_option
break;
}
}
// 0 <= n < st->num_of_options_with_scripts:
// we found it
// n == st->num_of_options_with_scripts:
// not found => new
st->functions[n].number = opt;
st->functions[n].env = env;
if (n == st->num_of_options_with_functions) {
// not found in the list
// we have a new option to be polled
st->num_of_options_with_functions += 1;
}
} // foreach option
// this compiled regex isn't used anymore
regfree(&creg);
} // foreach action
}
// this function can only be used in the critical region of *st
static void sane_find_matching_options(sane_thread_t* st, cfg_t* sec) {
slog(SLOG_DEBUG, "sane_find_matching_options");
const char* title = cfg_title(sec);
if (title == NULL) {
title = SCANBD_NULL_STRING;
}
// TODO: use of recursive mutex???
int actions = cfg_size(sec, C_ACTION);
if (actions <= 0) {
slog(SLOG_INFO, "no matching actions in section %s", title);
return;
}
slog(SLOG_INFO, "found %d actions in section %s", actions, title);
// iterate over all global actions
for(int i = 0; i < actions; i += 1) {
// get the action from the config file
cfg_t* action_i = cfg_getnsec(sec, C_ACTION, i);
assert(action_i != NULL);
// get the filter-regex from the config-file
const char* opt_regex = cfg_getstr(action_i, C_FILTER);
assert(opt_regex != NULL);
const char* title = cfg_title(action_i);
if (title == NULL) {
title = "(none)";
}
// compile the filter-regex
slog(SLOG_DEBUG, "checking action %s with filter: %s",
title, opt_regex);
regex_t creg;
int ret = regcomp(&creg, opt_regex, REG_EXTENDED | REG_NOSUB);
if (ret < 0) {
char err_text[1024];
regerror(ret, &creg, err_text, 1024);
slog(SLOG_WARN, "Can't compile regex: %s : %s", opt_regex, err_text);
continue;
}
// look for matching option-names
for(int opt = 1; opt < st->num_of_options; opt += 1) {
const SANE_Option_Descriptor* odesc = NULL;
if ((odesc = sane_get_option_descriptor(st->h, opt)) == NULL) {
// no valid option-descriptor available
// skip it
continue;
}
assert(odesc);
if (!SANE_OPTION_IS_ACTIVE(odesc->cap)) {
continue;
}
// option is active
// only use active (user controllable) options
if (odesc->name == NULL) {
// we need a valid option-name
continue;
}
assert(odesc->name);
if (!((odesc->type == SANE_TYPE_BOOL) || (odesc->type == SANE_TYPE_INT) ||
(odesc->type == SANE_TYPE_FIXED)|| (odesc->type == SANE_TYPE_STRING) ||
(odesc->type == SANE_TYPE_BUTTON))) {
slog(SLOG_WARN, "option[%d] %s for device %s not of "
"type BOOL|INT|FIXED|STRING|BUTTON. Skipping",
opt, odesc->name, st->dev->name);
continue;
}
slog(SLOG_INFO, "found active option[%d] %s (type: %d) for device %s",
opt, odesc->name, odesc->type, st->dev->name);
// regex compare with the filter
if (regexec(&creg, odesc->name, 0, NULL, 0) != 0) {
// no match
continue;
}
// match
// now get the script from the action
const char* script = cfg_getstr(action_i, C_SCRIPT);
if (!script || (strlen(script) == 0)) {
script = SCANBD_NULL_STRING;
}
assert(script != NULL);
slog(SLOG_INFO, "installing action %s (%d) for %s, option[%d]: %s as: %s",
title, st->num_of_options_with_scripts, st->dev->name, opt, odesc->name, script);
// get pointer to global section of config
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
bool multiple_actions = cfg_getbool(cfg_sec_global, C_MULTIPLE_ACTIONS);
slog(SLOG_INFO, "multiple actions allowed");
// looking for option already present in the
// array
int n = 0;
for(n = 0; n < st->num_of_options_with_scripts; n += 1) {
if (st->opts[n].number == opt) {
if (!multiple_actions) {
slog(SLOG_WARN, "action %s overrides script %s of option[%d] with %s",
title, st->opts[n].script, opt, script);
// break out with n == index_of_found_option
break;
}
else {
if (n < st->num_of_options) {
n = st->num_of_options_with_scripts;
slog(SLOG_INFO, "adding additional action %s (%d) for option[%d] with %s",
title, n, opt, script);
break;
}
else {
slog(SLOG_INFO, "can't add additional action %s for option[%d] with %s",
title, opt, script);
break;
}
}
}
}
// 0 <= n < st->num_of_options_with_scripts:
// we found it (override now)
// n == st->num_of_options_with_scripts:
// not found => new
if (n == st->num_of_options) {
continue; // no space left in array
}
st->opts[n].number = opt;
st->opts[n].action_name = title;
st->opts[n].script = script;
sane_option_value_free(&st->opts[n].from_value);
sane_option_value_free(&st->opts[n].to_value);
sane_option_value_free(&st->opts[n].value);
if ((odesc->type == SANE_TYPE_BOOL) || (odesc->type == SANE_TYPE_INT) ||
(odesc->type == SANE_TYPE_FIXED) || (odesc->type == SANE_TYPE_BUTTON)) {
// numerical option
cfg_t* num_trigger = cfg_getsec(action_i, C_NUMERICAL_TRIGGER);
assert(num_trigger);
st->opts[n].from_value.num_value = cfg_getint(num_trigger,
C_FROM_VALUE);
st->opts[n].to_value.num_value = cfg_getint(num_trigger, C_TO_VALUE);
st->opts[n].value = get_sane_option_value(st->h, opt);
slog(SLOG_INFO, "Initial value of option %s is %d", odesc->name,
st->opts[n].value);
} // type BOOL | INT || FIXED
else if (odesc->type == SANE_TYPE_STRING) {
bool valid = true;
// string option
cfg_t* str_trigger = cfg_getsec(action_i, C_STRING_TRIGGER);
assert(str_trigger);
st->opts[n].from_value.str_value.str =
strdup(cfg_getstr(str_trigger,
C_FROM_VALUE));
st->opts[n].from_value.str_value.reg = malloc(sizeof(regex_t));
int ret = 0;
ret = regcomp(st->opts[n].from_value.str_value.reg,
st->opts[n].from_value.str_value.str,
REG_EXTENDED | REG_NOSUB);
if (ret < 0) {
char err_text[1024];
regerror(ret, &creg, err_text, 1024);
slog(SLOG_WARN, "Can't compile regex: %s : %s",
st->opts[n].from_value.str_value.str, err_text);
valid = false;;
}
st->opts[n].to_value.str_value.str =
strdup(cfg_getstr(str_trigger,
C_TO_VALUE));
st->opts[n].to_value.str_value.reg = malloc(sizeof(regex_t));
ret = regcomp(st->opts[n].to_value.str_value.reg,
st->opts[n].to_value.str_value.str,
REG_EXTENDED | REG_NOSUB);
if (ret < 0) {
char err_text[1024];
regerror(ret, &creg, err_text, 1024);
slog(SLOG_WARN, "Can't compile regex: %s : %s",
st->opts[n].to_value.str_value.str, err_text);
valid = false;;
}
st->opts[n].value = get_sane_option_value(st->h, opt);
if (!valid) {
sane_option_value_free(&st->opts[n].from_value);
sane_option_value_free(&st->opts[n].to_value);
sane_option_value_free(&st->opts[n].value);
continue;
}
} // type STRING
else {
assert(false); // should not happen
}
if (n == st->num_of_options_with_scripts) {
// not found in the list
// we have a new option to be polled
st->num_of_options_with_scripts += 1;
}
} // foreach option
// this compiled regex isn't used anymore
regfree(&creg);
} // foreach action
}
// thread start funktion
// TODO: refactor, this is awfull long!
static void* sane_poll(void* arg) {
#ifdef CANCEL_TEST
if (pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL) < 0) {
slog(SLOG_ERROR, "pthread_setcancelstate: %s", strerror(errno));
}
#endif
sane_thread_t* st = (sane_thread_t*)arg;
assert(st != NULL);
slog(SLOG_DEBUG, "sane_poll");
// we only expect the main thread to handle signals
sigset_t mask;
sigfillset(&mask);
pthread_sigmask(SIG_BLOCK, &mask, NULL);
// static int si = 0; // don't know why this was a static variable -> nonsense in the case of multiple sane_poll threads
int si = 0;
// this thread uses the device and the san_thread_t datastructure
// lock it
pthread_cleanup_push(sane_thread_cleanup_mutex, ((void*)&st->mutex));
if (pthread_mutex_lock(&st->mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
pthread_exit(NULL);
}
// open the device this thread should poll
SANE_Status status = SANE_STATUS_INVAL;
if ((status = sane_open(st->dev->name, &st->h)) != SANE_STATUS_GOOD) {
slog(SLOG_ERROR, "Can't open device %s: %s", st->dev->name, sane_strstatus(status));
slog(SLOG_WARN, "abandon polling of %s", st->dev->name);
pthread_exit(NULL);
}
// figure out the number of options this device has
// option 0 (zero) is guaranteed to exist with the total number of
// options of that device (including option 0)
st->num_of_options = 0;
if ((status = sane_control_option(st->h, 0, SANE_ACTION_GET_VALUE,
&st->num_of_options, 0)) != SANE_STATUS_GOOD) {
slog(SLOG_ERROR, "Can't get the number of scanner options");
pthread_exit(NULL);
}
if (st->num_of_options == 0) {
// no options -> nothing to poll
slog(SLOG_INFO, "No options for device %s", st->dev->name);
pthread_exit(NULL);
}
slog(SLOG_INFO, "found %d options for device %s", st->num_of_options, st->dev->name);
// allocate an array of options for the matching actions
//
// only one script is possible per option, later matching
// actions overwrite previous ones
// initialize the list of matching options
if (st->opts != NULL) {
slog(SLOG_ERROR, "possible memory leak: %s, %d", __FILE__, __LINE__);
}
st->opts = NULL;
st->opts = (sane_dev_option_t*) calloc(st->num_of_options,
sizeof(sane_dev_option_t));
assert(st->opts != NULL);
for(int i = 0; i < st->num_of_options; i += 1) {
sane_option_value_init(&st->opts[i].from_value);
sane_option_value_init(&st->opts[i].to_value);
sane_option_value_init(&st->opts[i].value);
}
// the number of valid entries in the above list
st->num_of_options_with_scripts = 0;
// initialize the list of matching functions
if (st->functions != NULL) {
slog(SLOG_ERROR, "possible memory leak: %s, %d", __FILE__, __LINE__);
}
st->functions = NULL;
st->functions = (sane_dev_function_t*) calloc(st->num_of_options,
sizeof(sane_dev_function_t));
assert(st->functions != NULL);
for(int i = 0; i < st->num_of_options; i += 1) {
st->functions[i].number = 0;
st->functions[i].env = NULL;
}
// the number of valid entries in the above list
st->num_of_options_with_functions = 0;
// find out the functions and actions
// get the global sconfig section
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
// find the global actions
sane_find_matching_options(st, cfg_sec_global);
// find the global functions
sane_find_matching_functions(st, cfg_sec_global);
// find (if any) device specifc sections
// these override global definitions, if any
int local_sections = cfg_size(cfg, C_DEVICE);
slog(SLOG_DEBUG, "found %d local device sections", local_sections);
for(int loc = 0; loc < local_sections; loc += 1) {
cfg_t* loc_i = cfg_getnsec(cfg, C_DEVICE, loc);
assert(loc_i != NULL);
// get the filter-regex from the config-file
const char* loc_regex = cfg_getstr(loc_i, C_FILTER);
assert(loc_regex != NULL);
const char* title = cfg_title(loc_i);
if (title == NULL) {
title = "(none)";
}
// compile the filter-regex
slog(SLOG_INFO, "checking device section %s with filter: %s",
title, loc_regex);
regex_t creg;
int ret = regcomp(&creg, loc_regex, REG_EXTENDED | REG_NOSUB);
if (ret < 0) {
char err_text[1024];
regerror(ret, &creg, err_text, 1024);
slog(SLOG_WARN, "Can't compile regex: %s : %s", loc_regex, err_text);
continue;
}
// compare the regex against the device name
if (regexec(&creg, st->dev->name, 0, NULL, 0) == 0) {
// match
int loc_actions = cfg_size(loc_i, C_ACTION);
slog(SLOG_INFO, "found %d local action for device %s [%s]",
loc_actions, st->dev->name, title);
// get the local actions for this device
sane_find_matching_options(st, loc_i);
// get the local functions for this device
sane_find_matching_functions(st, loc_i);
}
regfree(&creg);
} // foreach local section
int timeout = cfg_getint(cfg_sec_global, C_TIMEOUT);
if (timeout <= 0) {
timeout = C_TIMEOUT_DEF;
}
slog(SLOG_DEBUG, "timeout: %d ms", timeout);
slog(SLOG_DEBUG, "Start the polling for device %s", st->dev->name);
while(true) {
slog(SLOG_DEBUG, "polling thread for %s, before cancellation point", st->dev->name);
#ifdef CANCEL_TEST
if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) < 0) {
slog(SLOG_ERROR, "pthread_setcancelstate: %s", strerror(errno));
}
#endif
// special cancellation point
pthread_testcancel();
#ifdef CANCEL_TEST
if (pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL) < 0) {
slog(SLOG_ERROR, "pthread_setcancelstate: %s", strerror(errno));
}
#endif
slog(SLOG_DEBUG, "polling thread for %s, after cancellation point", st->dev->name);
slog(SLOG_DEBUG, "polling device %s", st->dev->name);
for(si = 0; si < st->num_of_options_with_scripts; si += 1) {
const SANE_Option_Descriptor* odesc = NULL;
odesc = sane_get_option_descriptor(st->h, st->opts[si].number);
assert(odesc);
if (st->opts[si].script != NULL) {
if (strlen(st->opts[si].script) <= 0) {
slog(SLOG_WARN, "No valid script for option %s for device %s",
odesc->name, st->dev->name);
continue;
}
}
else {
slog(SLOG_WARN, "No script for option %s for device %s",
odesc->name, st->dev->name);
continue;
}
assert(st->opts[si].script != NULL);
assert(strlen(st->opts[si].script) > 0);
sane_opt_value_t value;
sane_option_value_init(&value);
// push the cleanup-handler to free the value storage
pthread_cleanup_push(sane_thread_cleanup_value, &value);
// get the actual value
// but don't query an option twice or more (see config multiple_actions)
// because this may reset the values and no other value changes can be
// detected
int o = 0;
bool gotAlready = false;
for(o = 0; o < si; o += 1) {
if (st->opts[o].number == st->opts[si].number) {
gotAlready = true;
break;
}
}
if (!gotAlready) {
// first query of option with this number
value = get_sane_option_value(st->h, st->opts[si].number);
}
else {
// additional query, so copy the value
slog(SLOG_INFO, "got the value already -> copy");
// found: copy the value
slog(SLOG_DEBUG, "copy the value of option %d", st->opts[o].number);
value.num_value = st->opts[o].value.num_value;
if (st->opts[o].value.str_value.str != NULL) {
value.str_value.str = strdup(st->opts[o].value.str_value.str);
assert(value.str_value.str != NULL);
}
}
slog(SLOG_INFO, "checking option %s number %d (%d) for device %s: value: %d",
odesc->name, st->opts[si].number, si,
st->dev->name, value);
if ((odesc->type == SANE_TYPE_BOOL) || (odesc->type == SANE_TYPE_INT) ||
(odesc->type == SANE_TYPE_FIXED) || (odesc->type == SANE_TYPE_BUTTON)) {
if ((st->opts[si].from_value.num_value == st->opts[si].value.num_value) &&
(st->opts[si].to_value.num_value == value.num_value)) {
slog(SLOG_DEBUG, "value trigger: numerical");
st->triggered = true;
st->triggered_option = si;
// we need to trigger all waiting threads
if (pthread_cond_broadcast(&st->cv) < 0) {
slog(SLOG_ERROR, "pthread_cond_broadcats: this shouln't happen");
}
}
}
else if (odesc->type == SANE_TYPE_STRING) {
if ((regexec(st->opts[si].from_value.str_value.reg,
st->opts[si].value.str_value.str, 0, NULL, 0) == 0) &&
(regexec(st->opts[si].to_value.str_value.reg,
value.str_value.str, 0, NULL, 0) == 0)) {
slog(SLOG_DEBUG, "value trigger: string");
st->triggered = true;
st->triggered_option = si;
// we need to trigger all waiting threads
if (pthread_cond_broadcast(&st->cv) < 0) {
slog(SLOG_ERROR, "pthread_cond_broadcats: this shouln't happen");
}
}
}
else {
assert(false);
}
// free the previous allocated value
sane_option_value_free(&st->opts[si].value);
// pass the responsibility to free the value to the main
// thread, if this thread gets canceled
if (pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL) < 0) {
slog(SLOG_ERROR, "pthread_setcancelstate: %s", strerror(errno));
}
st->opts[si].value = value;
pthread_cleanup_pop(0);
if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) < 0) {
slog(SLOG_ERROR, "pthread_setcancelstate: %s", strerror(errno));
}
// was there a value change?
if (st->triggered && (st->triggered_option >= 0)) {
assert(st->triggered_option >= 0); // index into the opts-array
assert(st->triggered_option < st->num_of_options_with_scripts);
slog(SLOG_ERROR, "trigger action for %s for device %s with script %s",
odesc->name, st->dev->name, st->opts[st->triggered_option].script);
// prepare the environment for the script to be called
// number of env-vars =
// number of found function-options
// plus the values in the environment-section (2):
// device, action
// plus those 4:
// PATH, PWD, USER, HOME
// plus the sentinel
cfg_t* global_envs = cfg_getsec(cfg_sec_global, C_ENVIRONMENT);
int number_of_envs = st->num_of_options_with_functions + 4 + 2 + 1;
char** env = calloc(number_of_envs, sizeof(char*));
for(int e = 0; e < number_of_envs; e += 1) {
env[e] = calloc(NAME_MAX + 1, sizeof(char));
}
int e = 0;
for(e = 0; e < st->num_of_options_with_functions; e += 1) {
const SANE_Option_Descriptor* fdesc = NULL;
fdesc = sane_get_option_descriptor(st->h,
st->functions[e].number);
assert(fdesc);
// check if the function-option is the same
// as a action-option. If so, use the
// action-option value instead of re-get the same
// option value, because it is (may be) reset
// after the query by the backend
sane_opt_value_t v;
sane_option_value_init(&v);
int o = 0;
for(o = 0; o < st->num_of_options_with_scripts; o += 1) {
if (st->opts[o].number == st->functions[e].number) {
break;
}
}
if (o == st->num_of_options_with_scripts) {
// not found: query the value
v = get_sane_option_value(st->h, st->functions[e].number);
}
else {
slog(SLOG_DEBUG, "don't re-get the value");
}
if ((fdesc->type == SANE_TYPE_BOOL) || (fdesc->type == SANE_TYPE_INT) ||
(fdesc->type == SANE_TYPE_FIXED) || (odesc->type == SANE_TYPE_BUTTON)) {
snprintf(env[e], NAME_MAX, "%s=%lu", st->functions[e].env,
v.num_value);
slog(SLOG_DEBUG, "setting env: %s", env[e]);
}
else if (fdesc->type == SANE_TYPE_STRING) {
snprintf(env[e], NAME_MAX, "%s=%s", st->functions[e].env,
v.str_value.str);
slog(SLOG_DEBUG, "setting env: %s", env[e]);
}
else {
assert(false);
}
sane_option_value_free(&v);
}
const char* ev = "PATH";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
snprintf(env[e], NAME_MAX, "%s=%s", ev, "/usr/sbin:/usr/bin:/sbin:/bin");
slog(SLOG_DEBUG, "No PATH, setting env: %s", env[e]);
e += 1;
}
ev = "PWD";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
char buf[PATH_MAX];
char* ptr = getcwd(buf, PATH_MAX - 1);
if (!ptr) {
slog(SLOG_ERROR, "can't get pwd");
}
else {
assert(ptr);
snprintf(env[e], NAME_MAX, "%s=%s", ev, ptr);
slog(SLOG_DEBUG, "No PWD, setting env: %s", env[e]);
e += 1;
}
}
ev = "USER";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
struct passwd* pwd = NULL;
pwd = getpwuid(geteuid());
assert(pwd);
snprintf(env[e], NAME_MAX, "%s=%s", ev, pwd->pw_name);
slog(SLOG_DEBUG, "No USER, setting env: %s", env[e]);
e += 1;
}
ev = "HOME";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
struct passwd* pwd = 0;
pwd = getpwuid(geteuid());
assert(pwd);
snprintf(env[e], NAME_MAX, "%s=%s", ev, pwd->pw_dir);
slog(SLOG_DEBUG, "No HOME, setting env: %s", env[e]);
e += 1;
}
ev = cfg_getstr(global_envs, C_DEVICE);
if (ev != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, st->dev->name);
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
ev = cfg_getstr(global_envs, C_ACTION);
if (ev != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev,
st->opts[st->triggered_option].action_name);
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
env[e] = NULL;
assert(e == number_of_envs-1);
// sendout an dbus-signal with all the values as
// arguments
dbus_send_signal(SCANBD_DBUS_SIGNAL_SCAN_BEGIN, st->dev->name);
//dbus_send_signal_argv_async(SCANBD_DBUS_SIGNAL_TRIGGER, env);
dbus_send_signal_argv(SCANBD_DBUS_SIGNAL_TRIGGER, env);
// the action-script will use the device,
// so we have to release the device
sane_close(st->h);
st->h = NULL;
assert(st->triggered_option >= 0);
assert(st->opts[st->triggered_option].script);
assert(strlen(st->opts[st->triggered_option].script) > 0);
// need to copy the values because we leave the
// critical section
// While doing so, convert the script to an absolute path
// int triggered_option = st->triggered_option;
char *script_abs =
make_script_path_abs(st->opts[st->triggered_option].script);
assert(script_abs);
// leave the critical section
if (pthread_mutex_unlock(&st->mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
pthread_exit(NULL);
}
if (strcmp(script_abs, SCANBD_NULL_STRING) != 0) {
assert(timeout > 0);
usleep(timeout * 1000); //ms
pid_t cpid;
if ((cpid = fork()) < 0) {
slog(SLOG_ERROR, "Can't fork: %s", strerror(errno));
}
else if (cpid > 0) { // parent
slog(SLOG_INFO, "waiting for child: %s", script_abs);
int status;
if (waitpid(cpid, &status, 0) < 0) {
slog(SLOG_ERROR, "waitpid: %s", strerror(errno));
}
if (WIFEXITED(status)) {
slog(SLOG_INFO, "child %s exited with status: %d",
script_abs, WEXITSTATUS(status));
}
if (WIFSIGNALED(status)) {
slog(SLOG_INFO, "child %s signaled with signal: %d",
script_abs, WTERMSIG(status));
}
}
else { // child
uid_t euid = geteuid();
uid_t egid = getegid();
if (seteuid(0) < 0) {
slog(SLOG_DEBUG, "Can't seteuid root: %s", strerror(errno));
exit(EXIT_FAILURE);
}
if (setegid(0) < 0) {
slog(SLOG_DEBUG, "Can't setegid root: %s", strerror(errno));
exit(EXIT_FAILURE);
}
slog(SLOG_DEBUG, "setgid to gid=%d", egid);
if (setgid(egid) < 0) {
slog(SLOG_DEBUG, "Can't setgid for gid=%d: %s", egid, strerror(errno));
exit(EXIT_FAILURE);
}
slog(SLOG_DEBUG, "setuid to uid=%d", euid);
if (setuid(euid) < 0) {
slog(SLOG_DEBUG, "Can't setuid for uid=%d : %s", euid, strerror(errno));
exit(EXIT_FAILURE);
}
slog(SLOG_DEBUG, "exec for %s", script_abs);
if (access(script_abs, F_OK | X_OK) < 0) {
slog(SLOG_ERROR, "access: %s", strerror(errno));
}
struct stat stat_buf;
if (stat(script_abs, &stat_buf) < 0) {
slog(SLOG_ERROR, "stat: %s", strerror(errno));
}
else {
slog(SLOG_DEBUG, "octal mode for %s: %lo", script_abs, stat_buf.st_mode);
slog(SLOG_DEBUG, "file uid: %ld, file gid: %ld", stat_buf.st_uid, stat_buf.st_gid);
}
if (execle(script_abs, script_abs, NULL, env) < 0) {
slog(SLOG_ERROR, "execlp: %s", strerror(errno));
}
exit(EXIT_FAILURE); // not reached
}
} // script_abs == SCANBD_NULL_STRING
assert(script_abs != NULL);
free(script_abs);
// free (last element is the sentinel!)
assert(env != NULL);
for(int e = 0; e < number_of_envs - 1; e += 1) {
assert(env[e] != NULL);
free(env[e]);
}
free(env);
// enter the critical section
if (pthread_mutex_lock(&st->mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
pthread_exit(NULL);
}
st->triggered = false;
st->triggered_option = -1; // invalid
// we need to trigger all waiting threads
if (pthread_cond_broadcast(&st->cv) < 0) {
slog(SLOG_ERROR, "pthread_cond_broadcats: this shouln't happen");
}
// leave the critical section
if (pthread_mutex_unlock(&st->mutex) < 0) {
// if we can't release the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
pthread_exit(NULL);
}
// sleep the timeout to settle devices, necessary?
usleep(timeout * 1000); //ms
// send out the debus signal
dbus_send_signal(SCANBD_DBUS_SIGNAL_SCAN_END, st->dev->name);
// enter the critical section
if (pthread_mutex_lock(&st->mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
pthread_exit(NULL);
}
slog(SLOG_DEBUG, "reopen device %s", st->dev->name);
if ((status = sane_open(st->dev->name, &st->h)) != SANE_STATUS_GOOD) {
slog(SLOG_ERROR, "Can't open device %s, %s",
st->dev->name, sane_strstatus(status));
if (status == SANE_STATUS_ACCESS_DENIED) {
slog(SLOG_WARN, "abandon polling of %s", st->dev->name);
pthread_exit(NULL);
}
}
} // if triggered
} // foreach option
// release the mutex
// because pthread_cleanup_pop is a macro we can't use it here
// pthread_cleanup_pop(1);
if (pthread_mutex_unlock(&st->mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
pthread_exit(NULL);
}
// sleep the polling timeout
usleep(timeout * 1000); //ms
// regain the mutex
// because pthread_cleanup_push is a macro we can't use it here
// pthread_cleanup_push(sane_thread_cleanup_mutex, ((void*)&st->mutex));
if (pthread_mutex_lock(&st->mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
pthread_exit(NULL);
}
}
pthread_cleanup_pop(1); // release the mutex
pthread_exit(NULL);
}
// helper to trigger a specified action from another thread
// (e.g. dbus) via an action number
void sane_trigger_action(int number_of_dev, int action) {
assert(number_of_dev >= 0);
assert(action >= 0);
slog(SLOG_DEBUG, "sane_trigger_action device=%d, action=%d", number_of_dev, action);
if (pthread_mutex_lock(&sane_mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
return;
}
if (num_devices <= 0) {
slog(SLOG_WARN, "No devices at all");
goto cleanup_sane;
}
if (number_of_dev >= num_devices) {
slog(SLOG_WARN, "No such device number %d", number_of_dev);
goto cleanup_sane;
}
while(sane_poll_threads == NULL) {
// no devices actually polling
slog(SLOG_WARN, "No polling at the moment, waiting ...");
if (pthread_cond_wait(&sane_cv, &sane_mutex) < 0) {
slog(SLOG_ERROR, "pthread_cond_wait: ", strerror(errno));
goto cleanup_sane;
}
}
assert(sane_poll_threads != NULL);
sane_thread_t* st = &sane_poll_threads[number_of_dev];
assert(st != NULL);
// this thread uses the device and the sane_thread_t datastructure
// lock it
if (pthread_mutex_lock(&st->mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
goto cleanup_sane;
}
if (action >= st->num_of_options_with_scripts) {
slog(SLOG_WARN, "No such action %d for device number %d", action, number_of_dev);
goto cleanup_dev;
}
while(st->triggered == true) {
slog(SLOG_DEBUG, "sane_trigger_action: an action is active, waiting ...");
if (pthread_cond_wait(&st->cv, &st->mutex) < 0) {
slog(SLOG_ERROR, "pthread_cond_wait: %s", strerror(errno));
goto cleanup_dev;
}
}
slog(SLOG_DEBUG, "sane_trigger_action: an action is active, waiting ...");
st->triggered = true;
st->triggered_option = action;
// we need to trigger all waiting threads
if (pthread_cond_broadcast(&st->cv) < 0) {
slog(SLOG_ERROR, "pthread_cond_broadcats: this shouln't happen");
}
cleanup_dev:
if (pthread_mutex_unlock(&st->mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
}
cleanup_sane:
if (pthread_mutex_unlock(&sane_mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
}
return;
}
void start_sane_threads(void) {
slog(SLOG_DEBUG, "start_sane_threads");
if (pthread_mutex_lock(&sane_mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
return;
}
if (sane_poll_threads != NULL) {
// if there are active threads kill them
stop_sane_threads();
}
// allocate the thread list
assert(sane_poll_threads == NULL);
if (num_devices == 0) {
slog(SLOG_ERROR, "no devices, not starting any polling thread");
goto cleanup;
}
sane_poll_threads = (sane_thread_t*) calloc(num_devices, sizeof(sane_thread_t));
if (sane_poll_threads == NULL) {
slog(SLOG_ERROR, "Can't allocate memory for polling threads");
goto cleanup;
}
// starting for each device a seperate thread
for(int i = 0; i < num_devices; i += 1) {
slog(SLOG_DEBUG, "Starting poll thread for %s", sane_device_list[i]->name);
sane_poll_threads[i].tid = 0;
sane_poll_threads[i].dev = sane_device_list[i];
sane_poll_threads[i].h = 0;
sane_poll_threads[i].opts = NULL;
sane_poll_threads[i].functions = NULL;
sane_poll_threads[i].num_of_options = 0;
sane_poll_threads[i].triggered = false;
sane_poll_threads[i].triggered_option = -1;
sane_poll_threads[i].num_of_options_with_scripts = 0;
sane_poll_threads[i].num_of_options_with_functions = 0;
if (pthread_mutex_init(&sane_poll_threads[i].mutex, NULL) < 0) {
slog(SLOG_ERROR, "pthread_mutex_init: should not happen");
}
if (pthread_cond_init(&sane_poll_threads[i].cv, NULL) < 0) {
slog(SLOG_ERROR, "pthread_cond_init: should not happen");
}
if (pthread_create(&sane_poll_threads[i].tid, NULL, sane_poll,
(void*)&sane_poll_threads[i]) < 0) {
slog(SLOG_ERROR, "Can't start sane_poll_thread: %s", strerror(errno));
exit(EXIT_FAILURE);
}
slog(SLOG_DEBUG, "Thread started for device %s", sane_device_list[i]->name);
}
if (pthread_cond_broadcast(&sane_cv)) {
slog(SLOG_ERROR, "pthread_cond_broadcast: %s", strerror(errno));
}
cleanup:
if (pthread_mutex_unlock(&sane_mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
return;
}
}
// stops all sane polling threads
void stop_sane_threads(void) {
slog(SLOG_DEBUG, "stop_sane_threads");
if (pthread_mutex_lock(&sane_mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
return;
}
if (sane_poll_threads == NULL) {
// we don't have any active threads
slog(SLOG_DEBUG, "stop_sane_threads: nothing to stop");
goto cleanup;
}
// sending cancel request to all threads
for(int i = 0; i < num_devices; i += 1) {
if (pthread_mutex_lock(&sane_poll_threads[i].mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
}
while(sane_poll_threads[i].triggered == true) {
slog(SLOG_DEBUG, "stop_sane_threads: an action is active, waiting ...");
if (pthread_cond_wait(&sane_poll_threads[i].cv,
&sane_poll_threads[i].mutex) < 0) {
slog(SLOG_ERROR, "pthread_cond_wait: %s", strerror(errno));
}
}
if (pthread_mutex_unlock(&sane_poll_threads[i].mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
}
slog(SLOG_DEBUG, "stopping poll thread for device %s", (*(sane_device_list + i))->name);
if (pthread_cancel(sane_poll_threads[i].tid) < 0) {
if (errno == ESRCH) {
slog(SLOG_ERROR, "poll thread for device %s was already cancelled");
}
else {
slog(SLOG_ERROR, "unknown error from pthread_cancel: %s", strerror(errno));
}
}
}
// waiting for all threads to vanish
for(int i = 0; i < num_devices; i += 1) {
slog(SLOG_DEBUG, "waiting for poll thread for device %s",
(*(sane_device_list + i))->name);
// joining all threads to prevent memory leaks
if (pthread_join(sane_poll_threads[i].tid, NULL) < 0) {
slog(SLOG_ERROR, "pthread_join: %s", strerror(errno));
}
sane_poll_threads[i].tid = 0;
// close the associated device of the thread
slog(SLOG_DEBUG, "closing device %s", sane_poll_threads[i].dev->name);
if (sane_poll_threads[i].h != NULL) {
sane_close(sane_poll_threads[i].h);
sane_poll_threads[i].h = NULL;
}
if (sane_poll_threads[i].opts) {
slog(SLOG_DEBUG, "freeing opt resources for device %s thread",
sane_poll_threads[i].dev->name);
// free the matching options list of that device / threads
for (int k = 0; k < sane_poll_threads[i].num_of_options; k += 1) {
sane_option_value_free(&sane_poll_threads[i].opts[k].from_value);
sane_option_value_free(&sane_poll_threads[i].opts[k].to_value);
sane_option_value_free(&sane_poll_threads[i].opts[k].value);
}
free(sane_poll_threads[i].opts);
sane_poll_threads[i].opts = NULL;
}
if (sane_poll_threads[i].functions) {
slog(SLOG_DEBUG, "freeing function resources for device %s thread",
sane_poll_threads[i].dev->name);
free(sane_poll_threads[i].functions);
sane_poll_threads[i].functions = NULL;
}
if (pthread_cond_destroy(&sane_poll_threads[i].cv) < 0) {
slog(SLOG_ERROR, "pthread_cond_destroy: %s", strerror(errno));
}
if (pthread_mutex_destroy(&sane_poll_threads[i].mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_destroy: %s", strerror(errno));
}
}
// free the thread list
free(sane_poll_threads);
sane_poll_threads = NULL;
// no threads active anymore
if (pthread_cond_broadcast(&sane_cv)) {
slog(SLOG_ERROR, "pthread_cond_broadcast: %s", strerror(errno));
}
cleanup:
if (pthread_mutex_unlock(&sane_mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
return;
}
}
./1.5.1/src/scanbd/scanbuttond_loader.h 0000644 0001751 0001751 00000003405 13075613565 017254 0 ustar lmeier lmeier /*
* $Id: scanbuttond_loader.h 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef SCANBUTTOND_LOADER_H
#define SCANBUTTOND_LOADER_H
struct backend;
typedef struct backend backend_t;
struct backend {
char* (*scanbtnd_get_backend_name)(void);
int (*scanbtnd_init)(void);
int (*scanbtnd_rescan)(void);
scanner_t* (*scanbtnd_get_supported_devices)(void);
int (*scanbtnd_open)(scanner_t* scanner);
int (*scanbtnd_close)(scanner_t* scanner);
int (*scanbtnd_get_button)(scanner_t* scanner);
char* (*scanbtnd_get_sane_device_descriptor)(scanner_t* scanner);
int (*scanbtnd_exit)(void);
void* handle; // handle for dlopen/dlsym/dlclose
backend_t* next;
};
int scanbtnd_init();
int scanbtnd_loader_init(void);
void scanbtnd_loader_exit(void);
backend_t* scanbtnd_load_backend(const char* filename);
void scanbtnd_unload_backend(backend_t* backend);
void scanbtnd_set_libdir(const char* dir);
#endif
./1.5.1/src/scanbd/dbus.c 0000644 0001751 0001751 00000067575 13075613565 014354 0 ustar lmeier lmeier /*
* $Id: dbus.c 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "scanbd.h"
#include "scanbd_dbus.h"
#include "scanbuttond_wrapper.h"
static DBusConnection* conn = NULL;
static pthread_t dbus_tid = 0;
#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
// this is non-portable
static pthread_mutex_t dbus_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
#else
static pthread_mutex_t dbus_mutex;
#endif
void dbus_send_signal_argv(const char* signal_name, char** argv) {
// TODO: we need a better dbus mainloop integrations, so that we
// can wakeup the main thread to sendout the messages we generate here
DBusMessage* signal = NULL;
if (conn == NULL) {
if (!dbus_init()) {
return;
}
}
assert(conn);
if (!conn) {
slog(SLOG_DEBUG, "No dbus connection");
return;
}
assert(signal_name != NULL);
if ((signal = dbus_message_new_signal(SCANBD_DBUS_OBJECTPATH,
SCANBD_DBUS_INTERFACE,
signal_name)) == NULL) {
slog(SLOG_ERROR, "Can't create signal");
return;
}
if (argv != NULL) {
#if ((__STDC_VERSION__ - 0) < 201112L) || ((__GNUC__ - 0) < 5)
DBusMessageIter args;
DBusMessageIter sub;
#else
DBusMessageIter args = {};
DBusMessageIter sub = {};
#endif
dbus_message_iter_init_append(signal, &args);
if (dbus_message_iter_open_container(&args, DBUS_TYPE_ARRAY,
DBUS_TYPE_STRING_AS_STRING,
&sub) != TRUE) {
slog(SLOG_ERROR, "Can't initialize dbus container");
}
while(*argv != NULL) {
slog(SLOG_DEBUG, "append string %s to signal %s", *argv, signal_name);
if (dbus_message_iter_append_basic(&sub, DBUS_TYPE_STRING, argv) != TRUE) {
slog(SLOG_ERROR, "Can't append signal argument");
}
argv++;
}
if (dbus_message_iter_close_container(&args, &sub) != TRUE) {
slog(SLOG_ERROR, "Can't close dbus container");
}
}
slog(SLOG_DEBUG, "now sending signal %s", signal_name);
dbus_uint32_t serial = 0;
if (dbus_connection_send(conn, signal, &serial) != TRUE) {
slog(SLOG_ERROR, "Can't send signal");
}
slog(SLOG_DEBUG, "now flushing the dbus");
// TODO: with the standard-main loop this would block without
// using a timeout
dbus_connection_flush(conn);
slog(SLOG_DEBUG, "unref the signal");
dbus_message_unref(signal);
}
void dbus_send_signal(const char* signal_name, const char* arg) {
DBusMessage* signal = NULL;
if (conn == NULL) {
if (!dbus_init()) {
return;
}
}
assert(conn);
if (!conn) {
slog(SLOG_DEBUG, "No dbus connection");
return;
}
assert(signal_name != NULL);
if ((signal = dbus_message_new_signal(SCANBD_DBUS_OBJECTPATH,
SCANBD_DBUS_INTERFACE,
signal_name)) == NULL) {
slog(SLOG_ERROR, "Can't create signal");
return;
}
if (arg != NULL) {
#if ((__STDC_VERSION__ - 0) < 201112L) || ((__GNUC__ - 0) < 5)
DBusMessageIter args;
#else
DBusMessageIter args = {};
#endif
dbus_message_iter_init_append(signal, &args);
slog(SLOG_DEBUG, "append string %s to signal %s", arg, signal_name);
if (dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, &arg) != TRUE) {
slog(SLOG_ERROR, "Can't append signal argument");
}
}
dbus_uint32_t serial = 0;
slog(SLOG_DEBUG, "now sending signal %s", signal_name);
if (dbus_connection_send(conn, signal, &serial) != TRUE) {
slog(SLOG_ERROR, "Can't send signal");
}
dbus_connection_flush(conn);
dbus_message_unref(signal);
}
static void hook_device_ex(const char *param, const char *action_name, const char *dev_name) {
slog(SLOG_DEBUG, "hook_device_ex");
assert(dev_name);
assert(param);
assert(action_name);
slog(SLOG_DEBUG, "hook_device_ex: parameter: %s", param);
slog(SLOG_DEBUG, "hook_device_ex: action: %s", action_name);
slog(SLOG_DEBUG, "hook_device_ex: device: %s", dev_name);
cfg_t* cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
const char* script = cfg_getstr(cfg_sec_global, param);
if (!script || (strlen(script) == 0)) {
slog(SLOG_INFO, "No hook script for inserting device: %s", dev_name);
//script = SCANBD_NULL_STRING;
return; // No hook script, nothing for us to do here.
}
slog(SLOG_INFO, "Using hook script %s for inserting device: %s", script, dev_name);
cfg_t* global_envs = cfg_getsec(cfg_sec_global, C_ENVIRONMENT);
// number of env-vars =
// the values in the environment-section (2):
// device, action
// plus those 4:
// PATH, PWD, USER, HOME
// plus the sentinel
const int number_of_envs = 4 + 2 + 1;
char** env = calloc(number_of_envs, sizeof(char*));
for(int e = 0; e < number_of_envs; e += 1) {
env[e] = calloc(NAME_MAX + 1, sizeof(char));
}
int e = 0;
const char* ev = "PATH";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
snprintf(env[e], NAME_MAX, "%s=%s", ev, "/usr/sbin:/usr/bin:/sbin:/bin");
slog(SLOG_DEBUG, "No PATH, setting env: %s", env[e]);
e += 1;
}
ev = "PWD";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
char buf[PATH_MAX];
char* ptr = getcwd(buf, PATH_MAX - 1);
if (!ptr) {
slog(SLOG_ERROR, "can't get pwd");
}
else {
assert(ptr);
snprintf(env[e], NAME_MAX, "%s=%s", ev, ptr);
slog(SLOG_DEBUG, "No PWD, setting env: %s", env[e]);
e += 1;
}
}
ev = "USER";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
struct passwd* pwd = NULL;
pwd = getpwuid(geteuid());
assert(pwd);
snprintf(env[e], NAME_MAX, "%s=%s", ev, pwd->pw_name);
slog(SLOG_DEBUG, "No USER, setting env: %s", env[e]);
e += 1;
}
ev = "HOME";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
struct passwd* pwd = 0;
pwd = getpwuid(geteuid());
assert(pwd);
snprintf(env[e], NAME_MAX, "%s=%s", ev, pwd->pw_dir);
slog(SLOG_DEBUG, "No HOME, setting env: %s", env[e]);
e += 1;
}
ev = cfg_getstr(global_envs, C_DEVICE);
if (ev != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, dev_name);
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
ev = cfg_getstr(global_envs, C_ACTION);
if (ev != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, action_name);
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
env[e] = NULL;
assert(e == number_of_envs-1);
char *script_abs = make_script_path_abs(script);
assert(script_abs);
slog(SLOG_DEBUG, "Hook script path: %s for inserting device: %s", script_abs, dev_name);
if (strcmp(script_abs, SCANBD_NULL_STRING) != 0) {
pid_t cpid = -1;
if ((cpid = fork()) < 0) {
slog(SLOG_ERROR, "Can't fork: %s", strerror(errno));
}
else if (cpid > 0) { // parent
slog(SLOG_INFO, "waiting for child: %s", script_abs);
int status;
if (waitpid(cpid, &status, 0) < 0) {
slog(SLOG_ERROR, "waitpid: %s", strerror(errno));
}
if (WIFEXITED(status)) {
slog(SLOG_INFO, "child %s exited with status: %d",
script_abs, WEXITSTATUS(status));
}
if (WIFSIGNALED(status)) {
slog(SLOG_INFO, "child %s signaled with signal: %d",
script_abs, WTERMSIG(status));
}
}
else { // child
slog(SLOG_DEBUG, "exec for %s", script_abs);
if (execle(script_abs, script_abs, NULL, env) < 0) {
slog(SLOG_ERROR, "execlp: %s", strerror(errno));
}
exit(EXIT_FAILURE); // not reached
}
} // script_abs == SCANBD_NULL_STRING
assert(script_abs != NULL);
free(script_abs);
}
static void hook_device_insert(const char *dev_name) {
slog(SLOG_DEBUG, "hook_device_insert");
hook_device_ex(C_DEVICE_INSERT_SCRIPT, "insert", dev_name);
}
static void hook_device_remove(const char *dev_name) {
hook_device_ex(C_DEVICE_REMOVE_SCRIPT, "remove", dev_name);
}
#ifdef USE_HAL
static void hal_device_added(LibHalContext* ctx, const char *udi) {
(void)ctx;
slog(SLOG_DEBUG, "New Device: %s", udi);
DBusError dbus_error;
dbus_error_init(&dbus_error);
if (libhal_device_query_capability(ctx, udi,
HAL_SCANNER_CAPABILITY, &dbus_error) == TRUE) {
// found new scanner
slog(SLOG_INFO, "New Scanner: %s", udi);
#ifdef USE_SANE
stop_sane_threads();
#else
stop_scbtn_threads();
#endif
#ifdef USE_SANE
# ifdef SANE_REINIT
slog(SLOG_DEBUG, "sane_exit");
sane_exit();
# endif
#else
scbtn_shutdown();
#endif
#ifdef SANE_REINIT_TIMEOUT
sleep(SANE_REINIT_TIMEOUT); // TODO: don't know if this is
// really neccessary
#endif
hook_device_insert(udi);
slog(SLOG_DEBUG, "sane_init");
#ifdef USE_SANE
# ifdef SANE_REINIT
sane_init(NULL, NULL);
# endif
get_sane_devices();
start_sane_threads();
#else
if (scanbtnd_init() < 0) {
slog(SLOG_INFO, "Could not initialize scanbuttond modules!\n");
exit(EXIT_FAILURE);
}
assert(backend);
get_scbtn_devices();
start_scbtn_threads();
#endif
}
}
#endif
#ifdef USE_HAL
static void hal_device_removed(LibHalContext* ctx, const char *udi) {
(void)ctx;
slog(SLOG_DEBUG, "Removed Device: %s", udi);
DBusError dbus_error;
dbus_error_init(&dbus_error);
// if the device is removed, the device informations isn't
// available anymore, so we unconditionally stop/start the sane threads
if (libhal_device_query_capability(ctx, udi,
HAL_SCANNER_CAPABILITY, &dbus_error) == TRUE) {
slog(SLOG_INFO, "Removed Scanner: %s", udi);
}
#ifdef USE_SANE
stop_sane_threads();
#else
stop_scbtn_threads();
#endif
#ifdef USE_SANE
# ifdef SANE_REINIT
slog(SLOG_DEBUG, "sane_exit");
sane_exit();
# endif
#else
scbtn_shutdown();
#endif
#ifdef SANE_REINIT_TIMEOUT
sleep(SANE_REINIT_TIMEOUT);// TODO: don't know if this is really neccessary
#endif
hook_device_remove(udi);
slog(SLOG_DEBUG, "sane_init");
#ifdef USE_SANE
# ifdef SANE_REINIT
sane_init(NULL, NULL);
# endif
get_sane_devices();
start_sane_threads();
#else
if (scanbtnd_init() < 0) {
slog(SLOG_INFO, "Could not initialize scanbuttond modules!\n");
exit(EXIT_FAILURE);
}
assert(backend);
get_scbtn_devices();
start_scbtn_threads();
#endif
}
#endif
// this function is used from dbus_thread and udev_thread
void dbus_signal_device_added(void) {
if (pthread_mutex_lock(&dbus_mutex)) {
slog(SLOG_ERROR, "Can't lock mutex");
}
#ifndef USE_HAL
slog(SLOG_DEBUG, "dbus_signal_device_added");
// look for new scanner
#ifdef USE_SANE
stop_sane_threads();
#else
stop_scbtn_threads();
#endif // USE_SANE
#ifdef USE_SANE
# ifdef SANE_REINIT
slog(SLOG_DEBUG, "sane_exit");
sane_exit();
# endif
#else
scbtn_shutdown();
#endif // USE_SANE
#ifdef SANE_REINIT_TIMEOUT
sleep(SANE_REINIT_TIMEOUT); // TODO: don't know if this is
// really neccessary
#endif
hook_device_insert("dbus device");
#ifdef USE_SANE
# ifdef SANE_REINIT
slog(SLOG_DEBUG, "sane_init");
sane_init(NULL, NULL);
# endif
slog(SLOG_DEBUG, "get new devices");
get_sane_devices();
start_sane_threads();
#else
if (scanbtnd_init() < 0) {
slog(SLOG_INFO, "Could not initialize scanbuttond modules!\n");
exit(EXIT_FAILURE);
}
assert(backend);
get_scbtn_devices();
start_scbtn_threads();
#endif // USE_SANE
#endif // USE_HAL
if (pthread_mutex_unlock(&dbus_mutex)) {
slog(SLOG_ERROR, "Can't unlock mutex");
}
}
void dbus_signal_device_removed(void) {
if (pthread_mutex_lock(&dbus_mutex)) {
slog(SLOG_ERROR, "Can't lock mutex");
}
#ifndef USE_HAL
slog(SLOG_DEBUG, "dbus_signal_device_removed");
// look for removed scanner
#ifdef USE_SANE
stop_sane_threads();
#else
stop_scbtn_threads();
#endif
#ifdef USE_SANE
# ifdef SANE_REINIT
slog(SLOG_DEBUG, "sane_exit");
sane_exit();
# endif
#else
scbtn_shutdown();
#endif
#ifdef SANE_REINIT_TIMEOUT
sleep(SANE_REINIT_TIMEOUT); // TODO: don't know if this is
// really neccessary
#endif
hook_device_remove("dbus device");
#ifdef USE_SANE
# ifdef SANE_REINIT
slog(SLOG_DEBUG, "sane_init");
sane_init(NULL, NULL);
# endif
slog(SLOG_DEBUG, "get new devices");
get_sane_devices();
start_sane_threads();
#else
if (scanbtnd_init() < 0) {
slog(SLOG_INFO, "Could not initialize scanbuttond modules!\n");
exit(EXIT_FAILURE);
}
assert(backend);
#endif
#endif
if (pthread_mutex_unlock(&dbus_mutex)) {
slog(SLOG_ERROR, "Can't unlock mutex");
}
}
// is called when saned exited
static void dbus_method_release(void) {
slog(SLOG_DEBUG, "dbus_method_release");
// start all threads
#ifdef USE_SANE
start_sane_threads();
#else
start_scbtn_threads();
#endif
}
// is called before saned started
static void dbus_method_acquire(void) {
slog(SLOG_DEBUG, "dbus_method_acquire");
// stop all threads
#ifdef USE_SANE
stop_sane_threads();
#else
stop_scbtn_threads();
#endif
}
struct sane_trigger_arg {
void (*f)(void*);
int device;
int action;
};
typedef struct sane_trigger_arg sane_trigger_arg_t;
void* dbus_call_sane_trigger_action_thread(void* arg) {
sane_trigger_arg_t* a = (sane_trigger_arg_t*) arg;
assert(a != NULL);
#ifdef USE_SANE
sane_trigger_action(a->device, a->action);
#else
scbtn_trigger_action(a->device, a->action);
#endif
return NULL;
}
void sane_trigger_action_async(int device, int action) {
sane_trigger_arg_t* arg = calloc(1, sizeof(sane_trigger_arg_t));
assert(arg != NULL);
arg->device = device;
arg->action = action;
pthread_t tid;
if (pthread_create(&tid, NULL, dbus_call_sane_trigger_action_thread, arg) < 0) {
slog(SLOG_WARN, "pthread_create: %s", strerror(errno));
}
}
static void dbus_method_trigger(DBusMessage *message) {
#if ((__STDC_VERSION__ - 0) < 201112L) || ((__GNUC__ - 0) < 5)
DBusMessageIter args;
#else
DBusMessageIter args = {};
#endif
dbus_uint32_t device = -1;
dbus_uint32_t action = -1;
if (!dbus_message_iter_init(message, &args)) {
slog(SLOG_WARN, "trigger has no arguments");
return;
}
if (dbus_message_iter_get_arg_type(&args) == DBUS_TYPE_UINT32) {
dbus_message_iter_get_basic(&args, &device);
slog(SLOG_INFO, "trigger device %d", device);
}
else {
slog(SLOG_WARN, "trigger has wrong argument type");
return;
}
if (!dbus_message_iter_next(&args)) {
slog(SLOG_WARN, "trigger has too few arguments");
return;
}
if (dbus_message_iter_get_arg_type(&args) == DBUS_TYPE_UINT32) {
dbus_message_iter_get_basic(&args, &action);
slog(SLOG_INFO, "trigger action %d", action);
}
else {
slog(SLOG_WARN, "trigger has wrong argument type");
return;
}
sane_trigger_action_async(device, action);
}
static void unregister_func(DBusConnection* connection, void* user_data) {
(void)connection;
(void)user_data;
slog(SLOG_DEBUG, "unregister_func_called");
}
static DBusHandlerResult message_func(DBusConnection *connection, DBusMessage *message,
void *user_data) {
(void)connection;
(void)user_data;
slog(SLOG_DEBUG, "message_func");
DBusMessage* reply = NULL;
if (dbus_message_is_method_call(message,
SCANBD_DBUS_INTERFACE,
SCANBD_DBUS_METHOD_ACQUIRE)) {
dbus_method_acquire();
}
else if (dbus_message_is_method_call(message,
SCANBD_DBUS_INTERFACE,
SCANBD_DBUS_METHOD_RELEASE)) {
dbus_method_release();
}
else if (dbus_message_is_method_call(message,
SCANBD_DBUS_INTERFACE,
SCANBD_DBUS_METHOD_TRIGGER)) {
dbus_method_trigger(message);
}
else if (dbus_message_is_signal(message,
DBUS_HAL_INTERFACE,
DBUS_HAL_SIGNAL_DEV_ADDED)) {
dbus_signal_device_added();
}
else if (dbus_message_is_signal(message,
DBUS_HAL_INTERFACE,
DBUS_HAL_SIGNAL_DEV_REMOVED)) {
dbus_signal_device_removed();
}
/* If the message was handled, send back the reply */
if (reply != NULL) {
dbus_connection_send(conn, reply, NULL);
dbus_message_unref(reply);
}
return reply ? DBUS_HANDLER_RESULT_HANDLED : DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
}
static DBusObjectPathVTable dbus_vtable = {
unregister_func,
message_func,
NULL,
NULL,
NULL,
NULL
};
void dbus_thread_cleanup(void* arg) {
assert(arg);
slog(SLOG_DEBUG, "dbus_thread_cleanup");
(void)arg;
}
static void* dbus_thread(void* arg) {
(void)arg;
// we only expect the main thread to handle signals
sigset_t mask;
sigfillset(&mask);
pthread_sigmask(SIG_BLOCK, &mask, NULL);
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
int timeout = cfg_getint(cfg_sec_global, C_TIMEOUT);
if (timeout <= 0) {
timeout = C_TIMEOUT_DEF;
}
slog(SLOG_DEBUG, "timeout: %d ms", timeout);
while(dbus_connection_read_write_dispatch(conn, timeout)) {
slog(SLOG_DEBUG, "Iteration on dbus call");
usleep(timeout * 1000);
}
return NULL;
}
bool dbus_init(void) {
slog(SLOG_DEBUG, "dbus_init");
#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
slog(SLOG_INFO, "dbus init mutex");
pthread_mutexattr_t mutexattr;
if (pthread_mutexattr_init(&mutexattr) < 0) {
slog(SLOG_ERROR, "Can't initialize mutex attr");
exit(EXIT_FAILURE);
}
if (pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE) < 0) {
slog(SLOG_ERROR, "Can't set mutex attr");
exit(EXIT_FAILURE);
}
if (pthread_mutex_init(&dbus_mutex, &mutexattr) < 0) {
slog(SLOG_ERROR, "Can't init mutex");
exit(EXIT_FAILURE);
}
#endif
if (!dbus_threads_init_default()) {
slog(SLOG_ERROR, "DBus thread initialization failure");
}
DBusError dbus_error;
dbus_error_init(&dbus_error);
if (conn == NULL) {
conn = dbus_bus_get(DBUS_BUS_SYSTEM, &dbus_error);
if (dbus_error_is_set(&dbus_error)) {
conn = NULL;
slog(SLOG_ERROR, "DBus connection error: %s", dbus_error.message);
dbus_error_free(&dbus_error);
return false;
}
}
else {
slog(SLOG_WARN, "dbus connection already established");
}
if (!conn) {
slog(SLOG_DEBUG, "No dbus connection");
return false;
}
assert(conn);
#ifdef USE_HAL
LibHalContext *hal_ctx = NULL;
hal_ctx = (LibHalContext*)libhal_ctx_new();
if (!hal_ctx) {
slog(SLOG_WARN, "Failed to create HAL context!");
return false;
}
libhal_ctx_set_dbus_connection(hal_ctx, conn);
libhal_ctx_set_device_added(hal_ctx, hal_device_added);
libhal_ctx_set_device_removed(hal_ctx, hal_device_removed);
if (!libhal_ctx_init(hal_ctx, &dbus_error)) {
slog(SLOG_WARN, "Couldn't initialise HAL!");
return false;
}
#else
char match[PATH_MAX] = {};
snprintf(match, PATH_MAX, "type='signal',interface='%s'", DBUS_HAL_INTERFACE);
slog(SLOG_ERROR, "dbus match %s", match);
dbus_bus_add_match(conn, match, &dbus_error);
if (dbus_error_is_set(&dbus_error)) {
slog(SLOG_ERROR, "DBus match error: %s", dbus_error.message);
dbus_error_free(&dbus_error);
return false;
}
dbus_connection_flush(conn);
if (dbus_error_is_set(&dbus_error)) {
slog(SLOG_ERROR, "DBus match error: %s", dbus_error.message);
dbus_error_free(&dbus_error);
return false;
}
#endif
return true;
}
void dbus_start_dbus_thread(void) {
slog(SLOG_DEBUG, "start dbus thread");
if (conn == NULL) {
if (!dbus_init()) {
return;
}
}
assert(conn);
if (!conn) {
slog(SLOG_DEBUG, "No dbus connection");
return;
}
DBusError dbus_error;
dbus_error_init(&dbus_error);
if (dbus_connection_register_object_path(conn, SCANBD_DBUS_OBJECTPATH,
&dbus_vtable, NULL) == FALSE) {
slog(SLOG_ERROR, "Can't register object path: %s", SCANBD_DBUS_OBJECTPATH);
return;
}
dbus_error_init(&dbus_error);
int ret = dbus_bus_request_name(conn, SCANBD_DBUS_ADDRESS,
0, &dbus_error);
if (DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER != ret) {
slog(SLOG_WARN, "Not Primary Owner (%d)", ret);
if (dbus_error_is_set(&dbus_error)) {
slog(SLOG_WARN, "Name Error (%s)", dbus_error.message);
dbus_error_free(&dbus_error);
return;
}
}
if (dbus_tid != 0) {
slog(SLOG_DEBUG, "dbus thread already running");
dbus_stop_dbus_thread();
}
if (pthread_create(&dbus_tid, NULL, dbus_thread, NULL) < 0){
slog(SLOG_ERROR, "Can't create dbus thread: %s", strerror(errno));
return;
}
return;
}
void dbus_stop_dbus_thread(void) {
slog(SLOG_DEBUG, "stop dbus thread");
if (dbus_tid == 0) {
return;
}
if (pthread_cancel(dbus_tid) < 0) {
if (errno == ESRCH) {
slog(SLOG_WARN, "dbus thread was already cancelled");
}
else {
slog(SLOG_WARN, "unknown error from pthread_cancel: %s", strerror(errno));
}
}
slog(SLOG_DEBUG, "join dbus thread");
if (pthread_join(dbus_tid, NULL) < 0) {
slog(SLOG_ERROR, "pthread_join: %s", strerror(errno));
}
dbus_tid = 0;
}
void dbus_call_method(const char* method, const char* value) {
slog(SLOG_DEBUG, "dbus_call_method");
if (conn == NULL) {
if (!dbus_init()) {
return;
}
}
assert(conn);
if (!conn) {
slog(SLOG_DEBUG, "No dbus connection");
return;
}
DBusMessage* msg = NULL;
if ((msg = dbus_message_new_method_call(SCANBD_DBUS_ADDRESS,
SCANBD_DBUS_OBJECTPATH,
SCANBD_DBUS_INTERFACE,
method)) == NULL) {
slog(SLOG_ERROR, "Can't compose message");
return;
}
assert(msg);
if (value != NULL) {
#if ((__STDC_VERSION__ - 0) < 201112L) || ((__GNUC__ - 0) < 5)
DBusMessageIter args;
#else
DBusMessageIter args = {};
#endif
dbus_message_iter_init_append(msg, &args);
if (dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING, value) != TRUE) {
slog(SLOG_ERROR, "Can't compose message");
return;
}
}
DBusPendingCall* pending = NULL;
// send message and get a handle for a reply
if (!dbus_connection_send_with_reply (conn, msg, &pending, -1)) {
slog(SLOG_WARN, "Can't send message");
return;
}
if (NULL == pending) {
slog(SLOG_ERROR, "Disconnected from bus");
return;
}
dbus_connection_flush(conn);
assert(msg);
dbus_message_unref(msg);
slog(SLOG_DEBUG, "waiting for reply");
assert(pending);
dbus_pending_call_block(pending);
// get the reply message
DBusMessage* reply = NULL;
if ((reply = dbus_pending_call_steal_reply(pending)) == NULL) {
slog(SLOG_DEBUG, "Reply Null\n");
return;
}
dbus_pending_call_unref(pending);
#if ((__STDC_VERSION__ - 0) < 201112L) || ((__GNUC__ - 0) < 5)
DBusMessageIter args;
#else
DBusMessageIter args = {};
#endif
if (!dbus_message_iter_init(reply, &args)) {
slog(SLOG_INFO, "Reply has no arguments");
}
return;
}
void dbus_call_trigger(unsigned int device, unsigned int action) {
slog(SLOG_DEBUG, "dbus_call_trigger for dev %d, action %d", device, action);
if (conn == NULL) {
if (!dbus_init()) {
return;
}
}
assert(conn);
if (!conn) {
slog(SLOG_DEBUG, "No dbus connection");
return;
}
DBusMessage* msg = NULL;
if ((msg = dbus_message_new_method_call(SCANBD_DBUS_ADDRESS,
SCANBD_DBUS_OBJECTPATH,
SCANBD_DBUS_INTERFACE,
SCANBD_DBUS_METHOD_TRIGGER)) == NULL) {
slog(SLOG_ERROR, "Can't compose message");
return;
}
assert(msg);
dbus_uint32_t dev = device;
dbus_uint32_t act = action;
#if ((__STDC_VERSION__ - 0) < 201112L) || ((__GNUC__ - 0) < 5)
DBusMessageIter args;
#else
DBusMessageIter args = {};
#endif
dbus_message_iter_init_append(msg, &args);
if (dbus_message_iter_append_basic(&args, DBUS_TYPE_UINT32, &dev) != TRUE) {
slog(SLOG_ERROR, "Can't compose message");
return;
}
if (dbus_message_iter_append_basic(&args, DBUS_TYPE_UINT32, &act) != TRUE) {
slog(SLOG_ERROR, "Can't compose message");
return;
}
DBusPendingCall* pending = NULL;
// send message and get a handle for a reply
if (!dbus_connection_send_with_reply (conn, msg, &pending, -1)) {
slog(SLOG_WARN, "Can't send message");
return;
}
if (NULL == pending) {
slog(SLOG_ERROR, "Disconnected from bus");
return;
}
dbus_connection_flush(conn);
assert(msg);
dbus_message_unref(msg);
slog(SLOG_DEBUG, "waiting for reply");
assert(pending);
dbus_pending_call_block(pending);
// get the reply message
DBusMessage* reply = NULL;
if ((reply = dbus_pending_call_steal_reply(pending)) == NULL) {
slog(SLOG_DEBUG, "Reply Null\n");
return;
}
dbus_pending_call_unref(pending);
if (!dbus_message_iter_init(reply, &args)) {
slog(SLOG_INFO, "Reply has no arguments");
}
return;
}
./1.5.1/src/scanbd/scanbuttond_wrapper.c 0000644 0001751 0001751 00000125706 13075613565 017472 0 ustar lmeier lmeier /*
* $Id: scanbuttond_wrapper.c 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "scanbd.h"
#include
#include "scanbuttond_loader.h"
#include "scanbuttond_wrapper.h"
#define CANCEL_TEST
// all programm-global scbtn functions use this mutex to avoid races
#ifdef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
// this is non-portable
pthread_mutex_t scbtn_mutex = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP;
#else
pthread_mutex_t scbtn_mutex;
#endif
pthread_cond_t scbtn_cv = PTHREAD_COND_INITIALIZER;
// the following locking strategie must be obeyed:
// 1) lock the scbtn_mutex
// 2) lock the device specific mutex
// in this order to avoid deadlocks
// holding more than these two locks is not intended
#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
void scbtn_init_mutex()
{
slog(SLOG_INFO, "scbtn_init_mutex");
pthread_mutexattr_t mutexattr;
if (pthread_mutexattr_init(&mutexattr) < 0) {
slog(SLOG_ERROR, "Can't initialize mutex attr");
exit(EXIT_FAILURE);
}
if (pthread_mutexattr_settype(&mutexattr, PTHREAD_MUTEX_RECURSIVE) < 0) {
slog(SLOG_ERROR, "Can't set mutex attr");
exit(EXIT_FAILURE);
}
if (pthread_mutex_init(&scbtn_mutex, &mutexattr) < 0) {
slog(SLOG_ERROR, "Can't init mutex");
exit(EXIT_FAILURE);
}
}
#endif
struct scbtn_opt_value {
unsigned long num_value; // before-value or after-value or actual-value (BOOL|INT|FIXED)
};
typedef struct scbtn_opt_value scbtn_opt_value_t;
struct scbtn_dev_option {
int number; // the option-number of the device-option
scbtn_opt_value_t from_value; // the before-value of the option
scbtn_opt_value_t to_value; // the after-value of the option (to
// fire the trigger)
scbtn_opt_value_t value; // the option value (from the last
// // polling cycle)
const char* script; // the found (matched) script to be called if
// the option-valued changes
const char* action_name; // the name of this action as
// specified in the config file
};
typedef struct scbtn_dev_option scbtn_dev_option_t;
struct scbtn_dev_function {
int number; // the option-number of the
// // device-option
const char* env; // the name of the environment-var to
// pass to option value in
};
typedef struct scbtn_dev_function scbtn_dev_function_t;
// each polling thread is represented by struct scbtn_thread
// there is no locking, since this is "thread private data"
struct scbtn_thread {
pthread_t tid; // the thread-id of the polling
// thread
pthread_mutex_t mutex; // mutex for this data-structure
pthread_cond_t cv; // cv for this data-structure
bool triggered; // a rule for this device has fired (triggered == true)
int triggered_option; // the action number which triggered
const scanner_t* dev; // the device
int num_of_options; // the number of all options for
// this device
scbtn_dev_option_t *opts; // the list of matched actions
// for this device
int num_of_options_with_scripts; // the number of elements in the
// above list
scbtn_dev_function_t *functions; // the list of matched functions
// for this device
int num_of_options_with_functions;// the number of elements in the
// above list
};
typedef struct scbtn_thread scbtn_thread_t;
// the list of all polling threads
static scbtn_thread_t* scbtn_poll_threads = NULL;
// the list of all devices locally connected to our system
static const scanner_t* scbtn_device_list = NULL;
// the number of devices = the number of polling threads
static int num_devices = 0;
void get_scbtn_devices(void) {
// detect all the scanners we have
slog(SLOG_INFO, "Scanning for local-only devices" );
if (pthread_mutex_lock(&scbtn_mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
return;
}
scbtn_device_list = NULL;
num_devices = 0;
if ((scbtn_device_list = backend->scanbtnd_get_supported_devices()) == NULL) {
slog(SLOG_WARN, "Can't get the scbtn device list");
}
const scanner_t* dev = scbtn_device_list;
if (dev == NULL) {
slog(SLOG_DEBUG, "device list null");
goto cleanup;
}
while(dev != NULL) {
slog(SLOG_DEBUG, "found device: %s %s %s",
dev->product, dev->vendor, dev->sane_device);
num_devices += 1;
dev = dev->next;
}
if (pthread_cond_broadcast(&scbtn_cv)) {
slog(SLOG_ERROR, "pthread_cond_broadcast: %s", strerror(errno));
}
cleanup:
if (pthread_mutex_unlock(&scbtn_mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
return;
}
}
// cleanup handler for sane_poll
static void scbtn_thread_cleanup_mutex(void* arg) {
assert(arg != NULL);
slog(SLOG_DEBUG, "scbtn_thread_cleanup_mutex");
pthread_mutex_t* mutex = (pthread_mutex_t*)arg;
if (pthread_mutex_unlock(mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
}
}
// cleanup handler for sane_poll
static void scbtn_thread_cleanup_value(void* arg) {
assert(arg != NULL);
slog(SLOG_DEBUG, "sane_thread_cleanup_value");
// sane_opt_value_t* v = (sane_opt_value_t*)arg;
// sane_option_value_free(v);
}
// this function can only be used in the critical region of *st
static void scbtn_find_matching_options(scbtn_thread_t* st, cfg_t* sec) {
slog(SLOG_DEBUG, "sane_find_matching_options");
const char* title = cfg_title(sec);
if (title == NULL) {
title = SCANBD_NULL_STRING;
}
// TODO: use of recursive mutex???
int actions = cfg_size(sec, C_ACTION);
if (actions <= 0) {
slog(SLOG_INFO, "no matching actions in section %s", title);
return;
}
slog(SLOG_INFO, "found %d actions in section %s", actions, title);
// iterate over all global actions
for(int i = 0; i < actions; i += 1) {
// get the action from the config file
cfg_t* action_i = cfg_getnsec(sec, C_ACTION, i);
assert(action_i != NULL);
// get the filter-regex from the config-file
const char* opt_regex = cfg_getstr(action_i, C_FILTER);
assert(opt_regex != NULL);
const char* title = cfg_title(action_i);
if (title == NULL) {
title = "(none)";
}
// compile the filter-regex
slog(SLOG_DEBUG, "checking action %s with filter: %s",
title, opt_regex);
regex_t creg;
int ret = regcomp(&creg, opt_regex, REG_EXTENDED | REG_NOSUB);
if (ret < 0) {
char err_text[1024];
regerror(ret, &creg, err_text, 1024);
slog(SLOG_WARN, "Can't compile regex: %s : %s", opt_regex, err_text);
continue;
}
// look for matching option-names
for(int opt = 0; opt < st->num_of_options; opt += 1) {
const char* name = scanbtnd_button_name(st->dev->meta_info, opt + 1);
assert(name);
slog(SLOG_INFO, "found active option[%d] %s for device %s",
opt, name, st->dev->product);
// regex compare with the filter
if (regexec(&creg, name, 0, NULL, 0) != 0) {
// no match
continue;
}
// match
// now get the script
const char* script = cfg_getstr(action_i, C_SCRIPT);
if (!script || (strlen(script) == 0)) {
script = SCANBD_NULL_STRING;
}
assert(script != NULL);
slog(SLOG_INFO, "installing action %s (%d) for %s, option[%d]: %s as: %s",
title, st->num_of_options_with_scripts, st->dev->product, opt, name, script);
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
bool multiple_actions = cfg_getbool(cfg_sec_global, C_MULTIPLE_ACTIONS);
slog(SLOG_INFO, "multiple actions allowed");
// looking for option already present in the
// array
int n = 0;
for(n = 0; n < st->num_of_options_with_scripts; n += 1) {
if (st->opts[n].number == opt + 1) {
if (!multiple_actions) {
slog(SLOG_WARN, "action %s overrides script %s of option[%d] with %s",
title, st->opts[n].script, opt, script);
// break out with n == index_of_found_option
break;
}
else {
if (n < st->num_of_options) {
n = st->num_of_options_with_scripts;
slog(SLOG_INFO, "adding additional action %s (%d) for option[%d] with %s",
title, n, opt, script);
break;
}
else {
slog(SLOG_INFO, "can't add additional action %s for option[%d] with %s",
title, opt, script);
break;
}
}
}
}
// 0 <= n < st->num_of_options_with_scripts:
// we found it
// n == st->num_of_options_with_scripts:
// not found => new
st->opts[n].number = opt + 1;
st->opts[n].action_name = title;
st->opts[n].script = script;
st->opts[n].from_value.num_value = 0;
st->opts[n].to_value.num_value = 0;
st->opts[n].value.num_value = 0;
cfg_t* num_trigger = cfg_getsec(action_i, C_NUMERICAL_TRIGGER);
assert(num_trigger);
st->opts[n].from_value.num_value = cfg_getint(num_trigger,
C_FROM_VALUE);
st->opts[n].to_value.num_value = cfg_getint(num_trigger, C_TO_VALUE);
st->opts[n].value.num_value = 0;
if (n == st->num_of_options_with_scripts) {
// not found in the list
// we have a new option to be polled
st->num_of_options_with_scripts += 1;
}
} // foreach option
// this compiled regex isn't used anymore
regfree(&creg);
} // foreach action
}
void scbtn_find_matching_functions(scbtn_thread_t* st, cfg_t* sec) {
// TODO: use of recursive mutex???
slog(SLOG_DEBUG, "sane_find_matching_functions");
const char* title = cfg_title(sec);
if (title == NULL) {
title = SCANBD_NULL_STRING;
}
int functions = cfg_size(sec, C_FUNCTION);
if (functions <= 0) {
slog(SLOG_INFO, "no matching functions in section %s", title);
return;
}
slog(SLOG_INFO, "scanbuttond backends can't use function definitions");
st->num_of_options_with_functions = 0;
}
void* scbtn_poll(void* arg) {
#ifdef CANCEL_TEST
if (pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL) < 0) {
slog(SLOG_ERROR, "pthread_setcancelstate: %s", strerror(errno));
}
#endif
scbtn_thread_t* st = (scbtn_thread_t*)arg;
assert(st != NULL);
slog(SLOG_DEBUG, "scbtn_poll");
// we only expect the main thread to handle signals
sigset_t mask;
sigfillset(&mask);
pthread_sigmask(SIG_BLOCK, &mask, NULL);
static int si = 0;
// this thread uses the device and the san_thread_t datastructure
// lock it
pthread_cleanup_push(scbtn_thread_cleanup_mutex, ((void*)&st->mutex));
if (pthread_mutex_lock(&st->mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
pthread_exit(NULL);
}
int ores = backend->scanbtnd_open((scanner_t*)st->dev);
if (ores != 0) {
slog(SLOG_WARN, "scanbtnd_open failed, error code: %s", strerror(ores));
slog(SLOG_WARN, "abandon polling of %s", st->dev->product);
if (ores == -ENODEV) {
slog(SLOG_WARN, "scanbtnd_open failed, no device -> canceling thread");
}
if (alarm(SCANBUTTOND_ALARM_TIMEOUT) > 0) {
slog(SLOG_WARN, "alarm error, there was a pending alarm");
}
pthread_exit(NULL);
}
// figure out the number of options this device has
// option 0 (zero) is guaranteed to exist with the total number of
// options of that device (including option 0)
st->num_of_options = st->dev->num_buttons;
if (st->num_of_options == 0) {
// no options -> nothing to poll
slog(SLOG_INFO, "No options for device %s", st->dev->product);
pthread_exit(NULL);
}
slog(SLOG_INFO, "found %d options for device %s", st->num_of_options, st->dev->product);
// allocate an array of options for the matching actions
//
// only one script is possible per option, later matching
// actions overwrite previous ones
// initialize the list of matching options
if (st->opts != NULL) {
slog(SLOG_ERROR, "possible memory leak: %s, %d", __FILE__, __LINE__);
}
st->opts = NULL;
st->opts = (scbtn_dev_option_t*) calloc(st->num_of_options,
sizeof(scbtn_dev_option_t));
assert(st->opts != NULL);
for(int i = 0; i < st->num_of_options; i += 1) {
st->opts[i].from_value.num_value = 0;
st->opts[i].to_value.num_value = 0;
st->opts[i].value.num_value = 0;
}
// the number of valid entries in the above list
st->num_of_options_with_scripts = 0;
// initialize the list of matching functions
if (st->functions != NULL) {
slog(SLOG_ERROR, "possible memory leak: %s, %d", __FILE__, __LINE__);
}
st->functions = NULL;
st->functions = (scbtn_dev_function_t*) calloc(st->num_of_options,
sizeof(scbtn_dev_function_t));
assert(st->functions != NULL);
for(int i = 0; i < st->num_of_options; i += 1) {
st->functions[i].number = 0;
st->functions[i].env = NULL;
}
// the number of valid entries in the above list
st->num_of_options_with_functions = 0;
// find out the functions and actions
// get the global sconfig section
cfg_t* cfg_sec_global = NULL;
cfg_sec_global = cfg_getsec(cfg, C_GLOBAL);
assert(cfg_sec_global);
// find the global actions
scbtn_find_matching_options(st, cfg_sec_global);
// find the global functions
scbtn_find_matching_functions(st, cfg_sec_global);
// find (if any) device specifc sections
// these override global definitions, if any
int local_sections = cfg_size(cfg, C_DEVICE);
slog(SLOG_DEBUG, "found %d local device sections", local_sections);
for(int loc = 0; loc < local_sections; loc += 1) {
cfg_t* loc_i = cfg_getnsec(cfg, C_DEVICE, loc);
assert(loc_i != NULL);
// get the filter-regex from the config-file
const char* loc_regex = cfg_getstr(loc_i, C_FILTER);
assert(loc_regex != NULL);
const char* title = cfg_title(loc_i);
if (title == NULL) {
title = "(none)";
}
// compile the filter-regex
slog(SLOG_INFO, "checking device section %s with filter: %s",
title, loc_regex);
regex_t creg;
int ret = regcomp(&creg, loc_regex, REG_EXTENDED | REG_NOSUB);
if (ret < 0) {
char err_text[1024];
regerror(ret, &creg, err_text, 1024);
slog(SLOG_WARN, "Can't compile regex: %s : %s", loc_regex, err_text);
continue;
}
// compare the regex against the device name
if (regexec(&creg, st->dev->product, 0, NULL, 0) == 0) {
// match
int loc_actions = cfg_size(loc_i, C_ACTION);
slog(SLOG_INFO, "found %d local action for device %s [%s]",
loc_actions, st->dev->product, title);
// get the local actions for this device
scbtn_find_matching_options(st, loc_i);
// get the local functions for this device
scbtn_find_matching_functions(st, loc_i);
}
regfree(&creg);
} // foreach local section
int timeout = cfg_getint(cfg_sec_global, C_TIMEOUT);
if (timeout <= 0) {
timeout = C_TIMEOUT_DEF;
}
slog(SLOG_DEBUG, "timeout: %d ms", timeout);
slog(SLOG_DEBUG, "Start the polling for device %s", st->dev->product);
while(true) {
slog(SLOG_DEBUG, "polling thread for %s, before cancellation point", st->dev->product);
#ifdef CANCEL_TEST
if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) < 0) {
slog(SLOG_ERROR, "pthread_setcancelstate: %s", strerror(errno));
}
#endif
// special cancellation point
pthread_testcancel();
#ifdef CANCEL_TEST
if (pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL) < 0) {
slog(SLOG_ERROR, "pthread_setcancelstate: %s", strerror(errno));
}
#endif
slog(SLOG_DEBUG, "polling thread for %s, after cancellation point", st->dev->product);
slog(SLOG_DEBUG, "polling device %s", st->dev->product);
int button = backend->scanbtnd_get_button((scanner_t*)st->dev);
if (button) {
slog(SLOG_INFO, "################ button %d pressed ################", button);
} else {
slog(SLOG_INFO, "button %d", button);
}
for(si = 0; si < st->num_of_options_with_scripts; si += 1) {
// const scbtn_Option_Descriptor* odesc = NULL;
// assert((odesc = scbtn_get_option_descriptor(st->h, st->opts[i].number)) != NULL);
const backend_t* b = st->dev->meta_info;
slog(SLOG_INFO, "option: %d", st->opts[si].number);
const char* name = scanbtnd_button_name(b, st->opts[si].number);
assert(name);
if (st->opts[si].script != NULL) {
if (strlen(st->opts[si].script) <= 0) {
slog(SLOG_WARN, "No valid script for option %s for device %s",
name, st->dev->product);
continue;
}
}
else {
slog(SLOG_WARN, "No script for option %s for device %s",
name, st->dev->product);
continue;
}
assert(st->opts[si].script != NULL);
assert(strlen(st->opts[si].script) > 0);
// scbtn_opt_value_t value;
// scbtn_option_value_init(&value);
// push the cleanup-handle to free the value storage
pthread_cleanup_push(scbtn_thread_cleanup_value, NULL);
slog(SLOG_INFO, "checking option %s number %d (%d) for device %s",
name, st->opts[si].number, si,
st->dev->product);
unsigned long value = 0;
if ((button > 0) && (button == st->opts[si].number)) {
value = 1;
slog(SLOG_INFO, "button %d has been pressed.", button);
if ((st->opts[si].from_value.num_value == st->opts[si].value.num_value) &&
(st->opts[si].to_value.num_value == value)) {
slog(SLOG_DEBUG, "value trigger: numerical");
st->triggered = true;
st->triggered_option = si;
// we need to trigger all waiting threads
if (pthread_cond_broadcast(&st->cv) < 0) {
slog(SLOG_ERROR, "pthread_cond_broadcats: this shouln't happen");
}
}
}
// pass the responsibility to free the value to the main
// thread, if this thread gets canceled
if (pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL) < 0) {
slog(SLOG_ERROR, "pthread_setcancelstate: %s", strerror(errno));
}
st->opts[si].value.num_value = value;
pthread_cleanup_pop(0);
if (pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL) < 0) {
slog(SLOG_ERROR, "pthread_setcancelstate: %s", strerror(errno));
}
// was there a value change?
if (st->triggered && (st->triggered_option >= 0)) {
assert(st->triggered_option >= 0); // index into the opts-array
assert(st->triggered_option < st->num_of_options_with_scripts);
slog(SLOG_ERROR, "trigger action for device %s with script %s",
st->dev->product, st->opts[st->triggered_option].script);
// prepare the environment for the script to be called
// number of env-vars =
// number of found function-options
// plus the values in the environment-section (2):
// device, action
// plus those 4:
// PATH, PWD, USER, HOME
// plus the sentinel
cfg_t* global_envs = cfg_getsec(cfg_sec_global, C_ENVIRONMENT);
assert(st->num_of_options_with_functions == 0);
int number_of_envs = st->num_of_options_with_functions + 4 + 2 + 1;
char** env = calloc(number_of_envs, sizeof(char*));
for(int e = 0; e < number_of_envs; e += 1) {
env[e] = calloc(NAME_MAX + 1, sizeof(char));
}
int e = 0;
const char* ev = "PATH";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
snprintf(env[e], NAME_MAX, "%s=%s", ev, "/usr/sbin:/usr/bin:/sbin:/bin");
slog(SLOG_DEBUG, "No PATH, setting env: %s", env[e]);
e += 1;
}
ev = "PWD";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
char buf[PATH_MAX];
char* ptr = getcwd(buf, PATH_MAX - 1);
if (!ptr) {
slog(SLOG_ERROR, "can't get pwd");
}
else {
assert(ptr);
snprintf(env[e], NAME_MAX, "%s=%s", ev, ptr);
slog(SLOG_DEBUG, "No PWD, setting env: %s", env[e]);
e += 1;
}
}
ev = "USER";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
struct passwd* pwd = NULL;
pwd = getpwuid(geteuid());
assert(pwd);
snprintf(env[e], NAME_MAX, "%s=%s", ev, pwd->pw_name);
slog(SLOG_DEBUG, "No USER, setting env: %s", env[e]);
e += 1;
}
ev = "HOME";
if (getenv(ev) != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, getenv(ev));
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
else {
struct passwd* pwd = 0;
pwd = getpwuid(geteuid());
assert(pwd);
snprintf(env[e], NAME_MAX, "%s=%s", ev, pwd->pw_dir);
slog(SLOG_DEBUG, "No HOME, setting env: %s", env[e]);
e += 1;
}
ev = cfg_getstr(global_envs, C_DEVICE);
if (ev != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev, st->dev->sane_device);
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
ev = cfg_getstr(global_envs, C_ACTION);
if (ev != NULL) {
snprintf(env[e], NAME_MAX, "%s=%s", ev,
st->opts[st->triggered_option].action_name);
slog(SLOG_DEBUG, "setting env: %s", env[e]);
e += 1;
}
env[e] = NULL;
assert(e == number_of_envs-1);
// sendout an dbus-signal with all the values as
// arguments
dbus_send_signal(SCANBD_DBUS_SIGNAL_SCAN_BEGIN, st->dev->product);
//dbus_send_signal_argv_async(SCANBD_DBUS_SIGNAL_TRIGGER, env);
dbus_send_signal_argv(SCANBD_DBUS_SIGNAL_TRIGGER, env);
// the action-script will use the device,
// so we have to release the device
// scbtn_close(st->h);
// st->h = NULL;
if (backend->scanbtnd_close((scanner_t*)st->dev) < 0) {
slog(SLOG_ERROR, "unable to close scanner backend");
}
assert(st->triggered_option >= 0);
assert(st->opts[st->triggered_option].script);
assert(strlen(st->opts[st->triggered_option].script) > 0);
// need to copy the values because we leave the
// critical section
// int triggered_option = st->triggered_option;
char* script_abs = make_script_path_abs(st->opts[st->triggered_option].script);
assert(script_abs);
// leave the critical section
if (pthread_mutex_unlock(&st->mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
pthread_exit(NULL);
}
if (strcmp(script_abs, SCANBD_NULL_STRING) != 0) {
assert(timeout > 0);
usleep(timeout * 1000); //ms
pid_t cpid;
if ((cpid = fork()) < 0) {
slog(SLOG_ERROR, "Can't fork: %s", strerror(errno));
}
else if (cpid > 0) { // parent
slog(SLOG_INFO, "waiting for child: %s", script_abs);
int status;
if (waitpid(cpid, &status, 0) < 0) {
slog(SLOG_ERROR, "waitpid: %s", strerror(errno));
}
if (WIFEXITED(status)) {
slog(SLOG_INFO, "child %s exited with status: %d",
script_abs, WEXITSTATUS(status));
}
if (WIFSIGNALED(status)) {
slog(SLOG_INFO, "child %s signaled with signal: %d",
script_abs, WTERMSIG(status));
}
}
else { // child
slog(SLOG_DEBUG, "exec for %s", script_abs);
if (execle(script_abs, script_abs, NULL, env) < 0) {
slog(SLOG_ERROR, "execlp: %s", strerror(errno));
}
exit(EXIT_FAILURE); // not reached
}
} // script_abs == SCANBD_NULL_STRING
assert(script_abs != NULL);
free(script_abs);
script_abs = NULL;
// free (last element is the sentinel!)
assert(env != NULL);
for(int e = 0; e < number_of_envs - 1; e += 1) {
assert(env[e] != NULL);
free(env[e]);
}
free(env);
// enter the critical section
if (pthread_mutex_lock(&st->mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
pthread_exit(NULL);
}
st->triggered = false;
st->triggered_option = -1; // invalid
// we need to trigger all waiting threads
if (pthread_cond_broadcast(&st->cv) < 0) {
slog(SLOG_ERROR, "pthread_cond_broadcats: this shouln't happen");
}
// leave the critical section
if (pthread_mutex_unlock(&st->mutex) < 0) {
// if we can't release the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
pthread_exit(NULL);
}
// sleep the timeout to settle devices, necessary?
usleep(timeout * 1000); //ms
// send out the debus signal
dbus_send_signal(SCANBD_DBUS_SIGNAL_SCAN_END, st->dev->product);
// enter the critical section
if (pthread_mutex_lock(&st->mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
pthread_exit(NULL);
}
slog(SLOG_DEBUG, "reopen device %s", st->dev->product);
int ores = backend->scanbtnd_open((scanner_t*)st->dev);
if (ores != 0) {
slog(SLOG_WARN, "scanbtnd_open failed, error code: %d", ores);
slog(SLOG_WARN, "abandon polling of %s", st->dev->product);
if (ores == -ENODEV) {
slog(SLOG_WARN, "scanbtnd_open failed, no device -> canceling thread");
}
if (alarm(SCANBUTTOND_ALARM_TIMEOUT) > 0) {
slog(SLOG_WARN, "alarm error, there was a pending alarm");
}
pthread_exit(NULL);
}
} // if triggered
} // foreach option
// release the mutex
// because pthread_cleanup_pop is a macro we can't use it here
// pthread_cleanup_pop(1);
if (pthread_mutex_unlock(&st->mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
pthread_exit(NULL);
}
// sleep the polling timeout
usleep(timeout * 1000); //ms
// regain the mutex
// because pthread_cleanup_push is a macro we can't use it here
// pthread_cleanup_push(scbtn_thread_cleanup_mutex, ((void*)&st->mutex));
if (pthread_mutex_lock(&st->mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
pthread_exit(NULL);
}
}
pthread_cleanup_pop(1); // release the mutex
pthread_exit(NULL);
}
void start_scbtn_threads() {
slog(SLOG_DEBUG, "start_scbtn_threads");
if (pthread_mutex_lock(&scbtn_mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
return;
}
if (scbtn_poll_threads != NULL) {
// if there are active threads kill them
stop_scbtn_threads();
}
// allocate the thread list
assert(scbtn_poll_threads == NULL);
scbtn_poll_threads = (scbtn_thread_t*) calloc(num_devices, sizeof(scbtn_thread_t));
if (scbtn_poll_threads == NULL) {
slog(SLOG_ERROR, "Can't allocate memory for polling threads");
goto cleanup;
}
// starting for each device a seperate thread
slog(SLOG_DEBUG, "start the threads (%d)", num_devices);
const scanner_t* dev = scbtn_device_list;
for(int i = 0; i < num_devices && dev != NULL; i += 1, dev = dev->next) {
slog(SLOG_DEBUG, "Starting poll thread for %s", dev->product);
scbtn_poll_threads[i].tid = 0;
scbtn_poll_threads[i].dev = dev;
scbtn_poll_threads[i].opts = NULL;
scbtn_poll_threads[i].functions = NULL;
scbtn_poll_threads[i].num_of_options = 0;
scbtn_poll_threads[i].triggered = false;
scbtn_poll_threads[i].triggered_option = -1;
scbtn_poll_threads[i].num_of_options_with_scripts = 0;
scbtn_poll_threads[i].num_of_options_with_functions = 0;
if (pthread_mutex_init(&scbtn_poll_threads[i].mutex, NULL) < 0) {
slog(SLOG_ERROR, "pthread_mutex_init: should not happen");
}
if (pthread_cond_init(&scbtn_poll_threads[i].cv, NULL) < 0) {
slog(SLOG_ERROR, "pthread_cond_init: should not happen");
}
if (pthread_create(&scbtn_poll_threads[i].tid, NULL, scbtn_poll,
(void*)&scbtn_poll_threads[i]) < 0) {
slog(SLOG_ERROR, "Can't start scbtn_poll_thread: %s", strerror(errno));
exit(EXIT_FAILURE);
}
slog(SLOG_DEBUG, "Thread started for device %s", dev->product);
}
if (pthread_cond_broadcast(&scbtn_cv)) {
slog(SLOG_ERROR, "pthread_cond_broadcast: %s", strerror(errno));
}
cleanup:
if (pthread_mutex_unlock(&scbtn_mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
return;
}
}
void stop_scbtn_threads() {
slog(SLOG_DEBUG, "stop_scbtn_threads");
if (pthread_mutex_lock(&scbtn_mutex) < 0) {
// if we can't get the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
return;
}
if (scbtn_poll_threads == NULL) {
// we don't have any active threads
slog(SLOG_DEBUG, "stop_scbtn_threads: nothing to stop");
goto cleanup;
}
// sending cancel request to all threads
const scanner_t* dev = scbtn_device_list;
for(int i = 0; i < num_devices && dev != NULL; i += 1, dev = dev->next) {
if (pthread_mutex_lock(&scbtn_poll_threads[i].mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
}
while(scbtn_poll_threads[i].triggered == true) {
slog(SLOG_DEBUG, "stop_scbtn_threads: an action is active, waiting ...");
if (pthread_cond_wait(&scbtn_poll_threads[i].cv,
&scbtn_poll_threads[i].mutex) < 0) {
slog(SLOG_ERROR, "pthread_cond_wait: %s", strerror(errno));
}
}
if (pthread_mutex_unlock(&scbtn_poll_threads[i].mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
}
slog(SLOG_DEBUG, "stopping poll thread for device %s", dev->product);
if (pthread_cancel(scbtn_poll_threads[i].tid) < 0) {
if (errno == ESRCH) {
slog(SLOG_ERROR, "poll thread for device %s was already cancelled");
}
else {
slog(SLOG_ERROR, "unknown error from pthread_cancel: %s", strerror(errno));
}
}
slog(SLOG_INFO, "cancelled thread for device %s", dev->product);
}
// waiting for all threads to vanish
slog(SLOG_INFO, "waiting ...");
dev = scbtn_device_list;
for(int i = 0; i < num_devices && dev != NULL; i += 1, dev = dev->next) {
slog(SLOG_DEBUG, "waiting for poll thread for device %s",
dev->product);
// joining all threads to prevent memory leaks
if (pthread_join(scbtn_poll_threads[i].tid, NULL) < 0) {
slog(SLOG_ERROR, "pthread_join: %s", strerror(errno));
}
scbtn_poll_threads[i].tid = 0;
// close the associated device of the thread
slog(SLOG_DEBUG, "closing device %s", scbtn_poll_threads[i].dev->product);
assert(scbtn_poll_threads[i].dev);
backend->scanbtnd_close((scanner_t*)scbtn_poll_threads[i].dev);
if (scbtn_poll_threads[i].opts) {
slog(SLOG_DEBUG, "freeing opt resources for device %s thread",
scbtn_poll_threads[i].dev->product);
// free the matching options list of that device / threads
// for (int k = 0; k < scbtn_poll_threads[i].num_of_options; k += 1) {
// scbtn_option_value_free(&scbtn_poll_threads[i].opts[k].from_value);
// scbtn_option_value_free(&scbtn_poll_threads[i].opts[k].to_value);
// scbtn_option_value_free(&scbtn_poll_threads[i].opts[k].value);
// }
free(scbtn_poll_threads[i].opts);
scbtn_poll_threads[i].opts = NULL;
}
if (scbtn_poll_threads[i].functions) {
slog(SLOG_DEBUG, "freeing function resources for device %s thread",
scbtn_poll_threads[i].dev->product);
free(scbtn_poll_threads[i].functions);
scbtn_poll_threads[i].functions = NULL;
}
if (pthread_cond_destroy(&scbtn_poll_threads[i].cv) < 0) {
slog(SLOG_ERROR, "pthread_cond_destroy: %s", strerror(errno));
}
if (pthread_mutex_destroy(&scbtn_poll_threads[i].mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_destroy: %s", strerror(errno));
}
}
// free the thread list
free(scbtn_poll_threads);
scbtn_poll_threads = NULL;
// no threads active anymore
if (pthread_cond_broadcast(&scbtn_cv)) {
slog(SLOG_ERROR, "pthread_cond_broadcast: %s", strerror(errno));
}
cleanup:
if (pthread_mutex_unlock(&scbtn_mutex) < 0) {
// if we can't unlock the mutex, something is heavily wrong!
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
return;
}
}
void scbtn_trigger_action(int number_of_dev, int action) {
assert(number_of_dev >= 0);
assert(action >= 0);
slog(SLOG_DEBUG, "sane_trigger_action device=%d, action=%d", number_of_dev, action);
if (pthread_mutex_lock(&scbtn_mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
return;
}
if (num_devices <= 0) {
slog(SLOG_WARN, "No devices at all");
goto cleanup_scbtn;
}
if (number_of_dev >= num_devices) {
slog(SLOG_WARN, "No such device number %d", number_of_dev);
goto cleanup_scbtn;
}
while(scbtn_poll_threads== NULL) {
// no devices actually polling
slog(SLOG_WARN, "No polling at the moment, waiting ...");
if (pthread_cond_wait(&scbtn_cv, &scbtn_mutex) < 0) {
slog(SLOG_ERROR, "pthread_cond_wait: ", strerror(errno));
goto cleanup_scbtn;
}
}
assert(scbtn_poll_threads != NULL);
scbtn_thread_t* st = &scbtn_poll_threads[number_of_dev];
assert(st != NULL);
// this thread uses the device and the sane_thread_t datastructure
// lock it
if (pthread_mutex_lock(&st->mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_lock: %s", strerror(errno));
goto cleanup_scbtn;
}
if (action >= st->num_of_options_with_scripts) {
slog(SLOG_WARN, "No such action %d for device number %d", action, number_of_dev);
goto cleanup_dev;
}
while(st->triggered == true) {
slog(SLOG_DEBUG, "sane_trigger_action: an action is active, waiting ...");
if (pthread_cond_wait(&st->cv, &st->mutex) < 0) {
slog(SLOG_ERROR, "pthread_cond_wait: %s", strerror(errno));
goto cleanup_dev;
}
}
slog(SLOG_DEBUG, "sane_trigger_action: an action is active, waiting ...");
st->triggered = true;
st->triggered_option = action;
// we need to trigger all waiting threads
if (pthread_cond_broadcast(&st->cv) < 0) {
slog(SLOG_ERROR, "pthread_cond_broadcats: this shouln't happen");
}
cleanup_dev:
if (pthread_mutex_unlock(&st->mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
}
cleanup_scbtn:
if (pthread_mutex_unlock(&scbtn_mutex) < 0) {
slog(SLOG_ERROR, "pthread_mutex_unlock: %s", strerror(errno));
}
return;
}
void scbtn_shutdown(void)
{
slog(SLOG_INFO, "shutting down...");
backend->scanbtnd_exit();
scanbtnd_unload_backend(backend);
scanbtnd_loader_exit();
slog(SLOG_INFO, "shutdown complete");
closelog();
}
const char* scanbtnd_button_name(const backend_t* backend, unsigned int button) {
slog(SLOG_INFO, "scanbtnd_button_name (%d)", button);
assert(backend);
const char* backend_name = backend->scanbtnd_get_backend_name();
assert(backend_name);
slog(SLOG_INFO, "scanbtnd_button_name, backend: %s", backend_name);
if (strncmp("Genesys", backend_name, 7) == 0) {
switch(button) {
case 0:
return "zero";
break;
case 1:
return "copy";
break;
case 2:
return "scan";
break;
case 3:
return "pdf";
break;
case 4:
return "email";
break;
case 5:
return "stop";
break;
default:
return "default";
break;
}
}
else {
switch(button) {
case 0:
return "zero";
break;
case 1:
return "scan";
break;
case 2:
return "copy";
break;
case 3:
return "email";
break;
case 4:
return "pdf";
break;
case 5:
return "stop";
break;
default:
return "default";
break;
}
}
return NULL;
}
./1.5.1/src/scanbd/daemonize.c 0000644 0001751 0001751 00000004224 13075613565 015350 0 ustar lmeier lmeier /*
* $Id: daemonize.c 241 2017-04-19 07:53:25Z wimalopaan $
*
* scanbd - KMUX scanner button daemon
*
* Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include "common.h"
#include "slog.h"
void daemonize(void) {
pid_t pid = -1;
if ((pid = fork()) < 0) {
slog(SLOG_ERROR, "fork: %s", strerror(errno));
exit(EXIT_FAILURE);
}
else if (pid > 0) { // Parent
exit(EXIT_SUCCESS);
}
// Child
if (setsid() < 0) {
slog(SLOG_ERROR, "setsid: %s", strerror(errno));
exit(EXIT_FAILURE);
}
if ((pid = fork()) < 0) {
slog(SLOG_ERROR, "fork: %s", strerror(errno));
exit(EXIT_FAILURE);
}
else if (pid > 0) { // Parent
exit(EXIT_SUCCESS);
}
// Child-Child
int ofd = -1;
if ((ofd = open("/dev/null", O_RDWR)) < 0) {
slog(SLOG_ERROR, "open /dev/null: %s", strerror(errno));
exit(EXIT_FAILURE);
}
if (dup2(ofd, STDIN_FILENO) < 0) {
slog(SLOG_ERROR, "dup2: %s", strerror(errno));
exit(EXIT_FAILURE);
}
if (dup2(ofd, STDOUT_FILENO) < 0) {
slog(SLOG_ERROR, "dup2: %s", strerror(errno));
exit(EXIT_FAILURE);
}
if (dup2(ofd, STDERR_FILENO) < 0) {
slog(SLOG_ERROR, "dup2: %s", strerror(errno));
exit(EXIT_FAILURE);
}
if (chdir("/") < 0) {
slog(SLOG_ERROR, "chdir: %s", strerror(errno));
exit(EXIT_FAILURE);
}
}
./1.5.1/src/test/ 0000755 0001751 0001751 00000000000 13075614132 012743 5 ustar lmeier lmeier ./1.5.1/src/test/test02.c 0000644 0001751 0001751 00000003342 13075613451 014235 0 ustar lmeier lmeier /*
* ++C - C++ introduction
* Copyright (C) 2013, 2014, 2015, 2016, 2017 Wilhelm Meier
*
* 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 3 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, see .
*/
#include
#include
#include
#include
#include
int main () {
SANE_Int sane_version = 0;
if (sane_init(&sane_version, 0) != SANE_STATUS_GOOD) {
printf("Can't init sane\n");
exit(EXIT_FAILURE);
}
printf("sane version %d.%d\n", SANE_VERSION_MAJOR(sane_version), SANE_VERSION_MINOR(sane_version));
int count = 0;
while (++count < 10) {
printf("Iterate\n");
const SANE_Device** device_list = NULL;
if (sane_get_devices(&device_list, SANE_TRUE) == SANE_STATUS_GOOD) {
const SANE_Device** dev = device_list;
while (*dev) {
printf("dev name: %s\n", (*dev)->name);
dev++;
}
} else {
printf("Can't get dev list\n");
exit(EXIT_FAILURE);
}
sleep(1);
}
printf("before sane_exit\n");
sane_exit();
printf("after sane_exit\n");
exit(EXIT_SUCCESS);
} ./1.5.1/src/test/Makefile 0000644 0001751 0001751 00000001763 13075613565 014423 0 ustar lmeier lmeier #
# $Id: Makefile 241 2017-04-19 07:53:25Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2017 Wilhelm Meier (wilhelm.wm.meier@googlemail.com)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
include ../../Makefile.include
.PHONY: all
all: test01 test02
test01: test01.o
clean:
$(RM) -f test01 *.o *~
./1.5.1/src/test/test01.c 0000644 0001751 0001751 00000003305 13075613451 014233 0 ustar lmeier lmeier /*
* ++C - C++ introduction
* Copyright (C) 2013, 2014, 2015, 2016, 2017 Wilhelm Meier
*
* 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 3 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, see .
*/
#include
#include
#include
#include
#include
int main () {
while (true) {
SANE_Int sane_version = 0;
if (sane_init(&sane_version, 0) != SANE_STATUS_GOOD) {
printf("Can't init sane\n");
exit(EXIT_FAILURE);
}
printf("sane version %d.%d\n", SANE_VERSION_MAJOR(sane_version), SANE_VERSION_MINOR(sane_version));
const SANE_Device** device_list = NULL;
if (sane_get_devices(&device_list, SANE_TRUE) == SANE_STATUS_GOOD) {
const SANE_Device** dev = device_list;
while (*dev) {
printf("dev name: %s\n", (*dev)->name);
dev++;
}
} else {
printf("Can't get dev list\n");
exit(EXIT_FAILURE);
}
sleep (1);
printf("before sane_exit\n");
sane_exit();
printf("after sane_exit\n");
sleep (1);
}
exit(EXIT_SUCCESS);
} ./1.5.1/src/scanbuttond/ 0000755 0001751 0001751 00000000000 13075613451 014313 5 ustar lmeier lmeier ./1.5.1/src/scanbuttond/include/ 0000755 0001751 0001751 00000000000 13075613451 015736 5 ustar lmeier lmeier ./1.5.1/src/scanbuttond/include/Makefile.in 0000644 0001751 0001751 00000031206 13075613451 020005 0 ustar lmeier lmeier # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 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@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
subdir = src/scanbuttond/include
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFUSE_CFLAGS = @CONFUSE_CFLAGS@
CONFUSE_LIBS = @CONFUSE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
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@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
FGREP = @FGREP@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_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@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
OS_CPPFLAGS = @OS_CPPFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SANED_PATH = @SANED_PATH@
SANE_CFLAGS = @SANE_CFLAGS@
SANE_CONFIG = @SANE_CONFIG@
SANE_LIBS = @SANE_LIBS@
SCANBD_CFG_DIR = @SCANBD_CFG_DIR@
SCANBD_GROUP = @SCANBD_GROUP@
SCANBD_USER = @SCANBD_USER@
SCANBUTTOND_LIB_DIR = @SCANBUTTOND_LIB_DIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
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@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
EXTRA_DIST = \
scanbuttond/backend.h \
scanbuttond/common.h \
scanbuttond/libusbi.h \
scanbuttond/loader.h \
scanbuttond/scanbuttond.h
all: all-am
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/scanbuttond/include/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/scanbuttond/include/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
tags TAGS:
ctags CTAGS:
cscope cscopelist:
distdir: $(DISTFILES)
@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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile
installdirs:
install: 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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f Makefile
distclean-am: clean-am distclean-generic
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-am
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-am
pdf-am:
ps: ps-am
ps-am:
uninstall-am:
.MAKE: install-am install-strip
.PHONY: all all-am check check-am clean clean-generic clean-libtool \
cscopelist-am ctags-am distclean distclean-generic \
distclean-libtool distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
maintainer-clean maintainer-clean-generic mostlyclean \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# 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:
./1.5.1/src/scanbuttond/include/scanbuttond/ 0000755 0001751 0001751 00000000000 13075613451 020262 5 ustar lmeier lmeier ./1.5.1/src/scanbuttond/include/scanbuttond/libusbi.h 0000644 0001751 0001751 00000004551 13075613451 022071 0 ustar lmeier lmeier // libusbi.h: libusb wrapper
// This file is part of scanbuttond.
// Copyleft )c( 2004-2006 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __LIBUSBI_H_INCLUDED
#define __LIBUSBI_H_INCLUDED
#include
#ifdef HAVE_LINUX_LIMITS_H
#include
#endif
#include
#include
struct libusb_device;
typedef struct libusb_device libusb_device_t;
struct libusb_device {
int vendorID;
int productID;
char* location; // bus number + ":" + device number
struct usb_device* device;
struct usb_dev_handle* handle; // automatically set by libusb_open(...)
int interface;
int out_endpoint;
int in_endpoint;
libusb_device_t* next;
};
struct libusb_handle;
typedef struct libusb_handle libusb_handle_t;
struct libusb_handle {
libusb_device_t* devices;
// rescanning info, timestamps???
};
libusb_handle_t* libusb_init(void);
// GLOBAL number of changed devices (does not require a handle!)
int libusb_get_changed_device_count(void);
void libusb_rescan(libusb_handle_t* handle);
libusb_device_t* libusb_get_devices(libusb_handle_t* handle);
// returns 0 on success, -EBUSY if the scanner is currently in use,
// or -ENODEV if the scanner does no longer exist
int libusb_open(libusb_device_t* device);
int libusb_close(libusb_device_t* device);
int libusb_read(libusb_device_t* device, void* buffer, int bytecount);
int libusb_write(libusb_device_t* device, void* buffer, int bytecount);
// flush bulk read queue
void libusb_flush(libusb_device_t* device);
int libusb_control_msg(libusb_device_t* device, int requesttype,
int request, int value, int index, void* bytes, int size);
void libusb_exit(libusb_handle_t* handle);
#endif
./1.5.1/src/scanbuttond/include/scanbuttond/scanbuttond.h 0000644 0001751 0001751 00000003175 13075613451 022765 0 ustar lmeier lmeier // scanbuttond.h: fundamental data types, constants, ...
// This file is part of scanbuttond.
// Copyleft )c( 2004-2005 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef SCANBUTTOND_H_INCLUDED
#define SCANBUTTOND_H_INCLUDED
/**
* \file scanbuttond.h
* \brief Fundamental data types, macros, functions, ...
*
* This header defines some fundamental things which are used
* throughout the whole project.
*/
// connection types
#define NUM_CONNECTIONS 2
#define CONNECTION_NONE 0
#define CONNECTION_LIBUSB 1
struct scanner;
typedef struct scanner scanner_t;
struct scanner {
const char* vendor;
const char* product;
int connection;
void* internal_dev_ptr;
char* sane_device;
void* meta_info;
int lastbutton;
int is_open;
int num_buttons;
scanner_t* next;
};
char* scanbtnd_get_connection_name(int connection);
#ifndef MIN
#define MIN(a,b) (((a)<(b))?(a):(b))
#endif
#ifndef MAX
#define MAX(a,b) (((a)>(b))?(a):(b))
#endif
#endif
./1.5.1/src/scanbuttond/include/scanbuttond/common.h 0000644 0001751 0001751 00000001735 13075613451 021731 0 ustar lmeier lmeier // common.h: useful stuff
// This file is part of scanbuttond.
// Copyleft )c( 2006 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __COMMON_H_INCLUDED
#define __COMMON_H_INCLUDED
#define STRINGIFY1(x) #x
#define STRINGIFY(x) STRINGIFY1(x)
#endif
./1.5.1/src/scanbuttond/include/scanbuttond/backend.h 0000644 0001751 0001751 00000010263 13075613451 022024 0 ustar lmeier lmeier // backend.h: specification of the mandatory backend functions
// This file is part of scanbuttond.
// Copyleft )c( 2004-2005 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __BACKEND_H_INCLUDED
#define __BACKEND_H_INCLUDED
#include "scanbuttond/scanbuttond.h"
/**
* \file backend.h
* \brief Backend function specification.
*
* This file specifies which functions a scanbuttond backend has to
* provide and how it is supposed to interact with with the rest
* of the system.
*/
/**
* Gets the name of this backend.
* \return the backend name
*/
const char* scanbtnd_get_backend_name(void);
/**
* Initializes the backend.
* This function makes the backend ready to operate and searches for supported
* devices (see scanbtnd_get_supported_devices()).
* \return 0 if successful, <0 otherwise
*/
int scanbtnd_init(void);
/**
* Refreshes the list of supported devices.
* After this function has been called, scanbtnd_get_supported_devices()
* should only return devices which are currently present on this system.
* \return 0 if successful, <0 otherwise
*/
int scanbtnd_rescan(void);
/**
* Returns a list of devices which are currently driven by this backend.
* The devices are stored in a single-linked list.
* Note that the device list does not automagically refresh after pluggin in or
* unplugging a device. You have to explicitly call scanbtnd_rescan() to do
* that.
* \return a linked list of supported scanner devices
*/
const scanner_t* scanbtnd_get_supported_devices(void);
/**
* Opens the given scanner device.
* This function must be called before using scanbtnd_get_button().
* After calling this function, it is usually not possible for another process
* to access the scanner until scanbtnd_close() is called.
* \param scanner the scanner device to be opened
* \return 0 if successful, <0 otherwise
* \retval -ENODEV if the device is no longer present (or the device list has to
* be refreshed). In this case, call scanbtnd_rescan() and try again.
* \retval -EBUSY if the device is currently used by another process.
* \retval -EINVAL if the device is already open
* \retval -ENOSYS if there is no connection method to communicate with the device
*/
int scanbtnd_open(scanner_t* scanner);
/**
* Closes the given scanner device.
* This function must be called when you've finished querying the scanner button
* status using scanbtnd_get_button().
* After calling this function, other processes may access the device again.
* \param scanner the scanner device to be closed
* \return 0 if successful, <0 otherwise
* \retval -EINVAL if the device is already closed
* \retval -ENOSYS if there is no connection method to communicate with the device
*/
int scanbtnd_close(scanner_t* scanner);
/**
* Queries the scanner's button status.
* \param scanner the scanner device
* \return the number of the currently pressed button, 0 if no button is currently
* pressed, or <0 if there was an error.
* \retval -EINVAL if the scanner device has not been opened before
*/
int scanbtnd_get_button(scanner_t* scanner);
/**
* Gets the SANE device name of this scanner.
* The returned string should look like "epson:libusb:003:017".
* \param scanner the scanner device
* \return the SANE device name, or NULL if the SANE device name cannot be determined.
*/
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner);
/**
* Shuts down this backend.
* Cleans up some internal data structures and frees some memory.
* \return 0 if successful, <0 otherwise
*/
int scanbtnd_exit(void);
#endif
./1.5.1/src/scanbuttond/include/scanbuttond/loader.h 0000644 0001751 0001751 00000003470 13075613451 021705 0 ustar lmeier lmeier // loader.h: dynamic backend library loader
// This file is part of scanbuttond.
// Copyleft )c( 2005-2006 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __LOADER_H_INCLUDED
#define __LOADER_H_INCLUDED
#include "scanbuttond/scanbuttond.h"
#ifndef MODULE_PATH_ENV
# define MODULE_PATH_ENV "SCANBUTTOND_MODULE_PATH"
#endif
struct backend;
typedef struct backend backend_t;
struct backend {
char* (*scanbtnd_get_backend_name)(void);
int (*scanbtnd_init)(void);
int (*scanbtnd_rescan)(void);
scanner_t* (*scanbtnd_get_supported_devices)(void);
int (*scanbtnd_open)(scanner_t* scanner);
int (*scanbtnd_close)(scanner_t* scanner);
int (*scanbtnd_get_button)(scanner_t* scanner);
char* (*scanbtnd_get_sane_device_descriptor)(scanner_t* scanner);
int (*scanbtnd_exit)(void);
void* handle; // handle for dlopen/dlsym/dlclose
backend_t* next;
};
int scanbtnd_loader_init();
void scanbtnd_loader_exit(void);
backend_t* scanbtnd_load_backend(const char* filename);
void scanbtnd_unload_backend(backend_t* backend);
// Callback to get library dir
#define HAVE_SCANBTND_GET_LIB_DIR 1
char *scanbtnd_get_lib_dir(void);
#endif
./1.5.1/src/scanbuttond/include/Makefile.am 0000644 0001751 0001751 00000000220 13075613451 017764 0 ustar lmeier lmeier EXTRA_DIST = \
scanbuttond/backend.h \
scanbuttond/common.h \
scanbuttond/libusbi.h \
scanbuttond/loader.h \
scanbuttond/scanbuttond.h
./1.5.1/src/scanbuttond/Makefile.in 0000644 0001751 0001751 00000045420 13075613451 016365 0 ustar lmeier lmeier # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 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@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
subdir = src/scanbuttond
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
SOURCES =
DIST_SOURCES =
RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \
ctags-recursive dvi-recursive html-recursive info-recursive \
install-data-recursive install-dvi-recursive \
install-exec-recursive install-html-recursive \
install-info-recursive install-pdf-recursive \
install-ps-recursive install-recursive installcheck-recursive \
installdirs-recursive pdf-recursive ps-recursive \
tags-recursive uninstall-recursive
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
distclean-recursive maintainer-clean-recursive
am__recursive_targets = \
$(RECURSIVE_TARGETS) \
$(RECURSIVE_CLEAN_TARGETS) \
$(am__extra_recursive_targets)
AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \
distdir
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
DIST_SUBDIRS = $(SUBDIRS)
am__DIST_COMMON = $(srcdir)/Makefile.in
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
am__relativize = \
dir0=`pwd`; \
sed_first='s,^\([^/]*\)/.*$$,\1,'; \
sed_rest='s,^[^/]*/*,,'; \
sed_last='s,^.*/\([^/]*\)$$,\1,'; \
sed_butlast='s,/*[^/]*$$,,'; \
while test -n "$$dir1"; do \
first=`echo "$$dir1" | sed -e "$$sed_first"`; \
if test "$$first" != "."; then \
if test "$$first" = ".."; then \
dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
else \
first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
if test "$$first2" = "$$first"; then \
dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
else \
dir2="../$$dir2"; \
fi; \
dir0="$$dir0"/"$$first"; \
fi; \
fi; \
dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
done; \
reldir="$$dir2"
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFUSE_CFLAGS = @CONFUSE_CFLAGS@
CONFUSE_LIBS = @CONFUSE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
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@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
FGREP = @FGREP@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_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@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
OS_CPPFLAGS = @OS_CPPFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SANED_PATH = @SANED_PATH@
SANE_CFLAGS = @SANE_CFLAGS@
SANE_CONFIG = @SANE_CONFIG@
SANE_LIBS = @SANE_LIBS@
SCANBD_CFG_DIR = @SCANBD_CFG_DIR@
SCANBD_GROUP = @SCANBD_GROUP@
SCANBD_USER = @SCANBD_USER@
SCANBUTTOND_LIB_DIR = @SCANBUTTOND_LIB_DIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
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@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
SUBDIRS = interface include backends
EXTRA_DIST = \
Makefile.simple
all: all-recursive
.SUFFIXES:
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/scanbuttond/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/scanbuttond/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
# This directory's subdirectories are mostly independent; you can cd
# into them and run 'make' without going through this Makefile.
# To change the values of 'make' variables: instead of editing Makefiles,
# (1) if the variable is set in 'config.status', edit 'config.status'
# (which will cause the Makefiles to be regenerated when you run 'make');
# (2) otherwise, pass the desired values on the 'make' command line.
$(am__recursive_targets):
@fail=; \
if $(am__make_keepgoing); then \
failcom='fail=yes'; \
else \
failcom='exit 1'; \
fi; \
dot_seen=no; \
target=`echo $@ | sed s/-recursive//`; \
case "$@" in \
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
*) list='$(SUBDIRS)' ;; \
esac; \
for subdir in $$list; do \
echo "Making $$target in $$subdir"; \
if test "$$subdir" = "."; then \
dot_seen=yes; \
local_target="$$target-am"; \
else \
local_target="$$target"; \
fi; \
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|| eval $$failcom; \
done; \
if test "$$dot_seen" = "no"; then \
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
fi; test -z "$$fail"
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-recursive
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
include_option=--etags-include; \
empty_fix=.; \
else \
include_option=--include; \
empty_fix=; \
fi; \
list='$(SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
test ! -f $$subdir/TAGS || \
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
fi; \
done; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-recursive
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-recursive
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
if test "$$subdir" = .; then :; else \
$(am__make_dryrun) \
|| test -d "$(distdir)/$$subdir" \
|| $(MKDIR_P) "$(distdir)/$$subdir" \
|| exit 1; \
dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
$(am__relativize); \
new_distdir=$$reldir; \
dir1=$$subdir; dir2="$(top_distdir)"; \
$(am__relativize); \
new_top_distdir=$$reldir; \
echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
($(am__cd) $$subdir && \
$(MAKE) $(AM_MAKEFLAGS) \
top_distdir="$$new_top_distdir" \
distdir="$$new_distdir" \
am__remove_distdir=: \
am__skip_length_check=: \
am__skip_mode_fix=: \
distdir) \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-recursive
all-am: Makefile
installdirs: installdirs-recursive
installdirs-am:
install: install-recursive
install-exec: install-exec-recursive
install-data: install-data-recursive
uninstall: uninstall-recursive
install-am: all-am
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
installcheck: installcheck-recursive
install-strip:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-recursive
clean-am: clean-generic clean-libtool mostlyclean-am
distclean: distclean-recursive
-rm -f Makefile
distclean-am: clean-am distclean-generic distclean-tags
dvi: dvi-recursive
dvi-am:
html: html-recursive
html-am:
info: info-recursive
info-am:
install-data-am:
install-dvi: install-dvi-recursive
install-dvi-am:
install-exec-am:
install-html: install-html-recursive
install-html-am:
install-info: install-info-recursive
install-info-am:
install-man:
install-pdf: install-pdf-recursive
install-pdf-am:
install-ps: install-ps-recursive
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-recursive
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
mostlyclean: mostlyclean-recursive
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
pdf: pdf-recursive
pdf-am:
ps: ps-recursive
ps-am:
uninstall-am:
.MAKE: $(am__recursive_targets) install-am install-strip
.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
check-am clean clean-generic clean-libtool cscopelist-am ctags \
ctags-am distclean distclean-generic distclean-libtool \
distclean-tags distdir dvi dvi-am html html-am info info-am \
install install-am install-data install-data-am install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
install-pdf install-pdf-am install-ps install-ps-am \
install-strip installcheck installcheck-am installdirs \
installdirs-am maintainer-clean maintainer-clean-generic \
mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
ps ps-am tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# 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:
./1.5.1/src/scanbuttond/Makefile.am 0000644 0001751 0001751 00000000106 13075613451 016344 0 ustar lmeier lmeier SUBDIRS = interface include backends
EXTRA_DIST = \
Makefile.simple
./1.5.1/src/scanbuttond/Makefile.simple 0000644 0001751 0001751 00000002231 13075613451 017241 0 ustar lmeier lmeier #
# $Id: Makefile.simple 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
.PHONY: backends interface clean
all: backends interface
backends:
$(MAKE) -f Makefile.simple -C backends all
interface:
$(MAKE) -f Makefile.simple -C interface all
clean:
$(MAKE) -f Makefile.simple -C backends clean
$(MAKE) -f Makefile.simple -C interface clean
$(RM) *~
./1.5.1/src/scanbuttond/backends/ 0000755 0001751 0001751 00000000000 13075613451 016065 5 ustar lmeier lmeier ./1.5.1/src/scanbuttond/backends/genesys.c 0000644 0001751 0001751 00000017654 13075613451 017723 0 ustar lmeier lmeier // genesys.c: Genesys device backend
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Hans Verkuil
// Copyleft )c( 2005-2006 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "genesys.h"
static const char* backend_name = "Genesys USB";
#define NUM_SUPPORTED_USB_DEVICES 3
static const int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x04a9, 0x221c, 15 }, // CanoScan LiDE 60 (15 includes combined buttons - only 4 real buttons)
{ 0x04a9, 0x2213, 15 }, // CanoScan LiDE 35 (15 includes combined buttons - only 4 real buttons)
{ 0x04a9, 0x1905, 15 }, // CanoScan LiDE 200 (15 includes combined buttons - only 4 real buttons)
};
static const char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Canon", "CanoScan LiDE 60" },
{ "Canon", "CanoScan LiDE 35" },
{ "Canon", "CanoScan LiDE 200" }
};
static libusb_handle_t* libusb_handle;
static scanner_t* genesys_scanners = NULL;
// Button Map for CanonScan LiDE 60
// button 1 = 0x08 copy
// button 2 = 0x01 scan
// button 3 = 0x02 pdf
// button 4 = 0x04 mail
// all others are combinations of the above (if pressed together)
static const char button_map_lide60[256] = { 0, 2, 3, 5,
4, 6, 7, 8,
1, 9, 10, 11,
12, 13, 14, 15};
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int genesys_match_libusb_scanner(libusb_device_t* device)
{
int index = -1;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void genesys_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "genesys:libusb:";
int index = genesys_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = genesys_scanners;
genesys_scanners = scanner;
}
void genesys_detach_scanners(void)
{
scanner_t* next = NULL;
while (genesys_scanners != NULL) {
next = genesys_scanners->next;
free(genesys_scanners->sane_device);
free(genesys_scanners);
genesys_scanners = next;
}
}
void genesys_scan_devices(libusb_device_t* devices)
{
int index = -1;
libusb_device_t* device = devices;
while (device != NULL) {
index = genesys_match_libusb_scanner(device);
if (index >= 0)
genesys_attach_libusb_scanner(device);
device = device->next;
}
}
int genesys_init_libusb(void)
{
libusb_device_t* devices = NULL;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
genesys_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
genesys_scanners = NULL;
syslog(LOG_INFO, "genesys-backend: init");
return genesys_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t* devices = NULL;
genesys_detach_scanners();
genesys_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
genesys_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return genesys_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int scanbtnd_get_button(scanner_t* scanner)
{
unsigned char bytes[2] = {};
int num_bytes = -1;
// current_button_map should be select according to the current scanner
// there is no space left inside scanner_t to store some additional data (for example a pointer)
// currently we only support one type of scanner and so this one can be hardcoded
const char *current_button_map = button_map_lide60;
if (!scanner->is_open)
return -EINVAL;
// every time we want to read the key currently pressed we need to send
// some specific data to the scanner first
// 40 0c 83 00 00 00 01 00 -> 0x6d
bytes[0] = 0x6d;
bytes[1] = 0x00; // not really needed, but just to be sure ;-)
num_bytes = libusb_control_msg((libusb_device_t*)scanner->internal_dev_ptr,
0x40, 0x0c, 0x0083, 0x0000, (void *)bytes, 0x0001);
if (num_bytes != 1) {
syslog(LOG_WARNING, "genesys-backend: communication error: "
"read length:%d (expected:%d)", num_bytes, 1);
return 0;
}
// now we can ask for the current state
// only the currently pressed keys are reported, if some key was pressed _and_ release between
// the last an the current query it is not reported here, depending on the query frequence
// the key needs to be holded for some time to be recognised
// c0 0c 84 00 00 00 01 00
// returns 1f xored with the keys pressed
// - this mean any key that is pressed gets it bit removed from 0x1f
// - if multiple keys are pressed at the same time multiple bits will be removed
num_bytes = libusb_control_msg((libusb_device_t*)scanner->internal_dev_ptr,
0xc0, 0x0c, 0x0084, 0x0000, (void *)bytes, 0x0001);
if (num_bytes != 1) {
syslog(LOG_WARNING, "genesys-backend: communication error: "
"could not read status register");
return 0;
}
// xor with mask and use only lower 4 bit
// lookup button in button map and return
return current_button_map[(bytes[0] ^ 0x1f) & 0x0f];
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "genesys-backend: exit");
genesys_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/snapscan.h 0000644 0001751 0001751 00000001757 13075613451 020056 0 ustar lmeier lmeier // snapscan.h: Snapscan device backend
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Bernhard Stiftner
// Thanks to J. Javier Maestro for sniffing the button codes ;-)
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __SNAPSCAN_H_INCLUDED
#define __SNAPSCAN_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/plustek_umax.c 0000644 0001751 0001751 00000015666 13075613451 020770 0 ustar lmeier lmeier // plustek_umax.c: Plustek device backend for UMAX models
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Hans Verkuil
// Copyleft )c( 2005-2006 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "plustek_umax.h"
static char* backend_name = "Plustek USB for UMAX";
#define NUM_SUPPORTED_USB_DEVICES 1
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x1606, 0x0060, 4 } // UMAX Astra 3400 (3450?)
};
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "UMAX", "Astra 3400/3450" }
};
static libusb_handle_t* libusb_handle;
static scanner_t* plustek_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int plustek_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void plustek_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "plustek:libusb:";
int index = plustek_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = plustek_scanners;
plustek_scanners = scanner;
}
void plustek_detach_scanners(void)
{
scanner_t* next;
while (plustek_scanners != NULL) {
next = plustek_scanners->next;
free(plustek_scanners->sane_device);
free(plustek_scanners);
plustek_scanners = next;
}
}
void plustek_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = plustek_match_libusb_scanner(device);
if (index >= 0)
plustek_attach_libusb_scanner(device);
device = device->next;
}
}
int plustek_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
plustek_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
plustek_scanners = NULL;
syslog(LOG_INFO, "plustek-umax-backend: init");
return plustek_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t* devices;
plustek_detach_scanners();
plustek_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
plustek_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return plustek_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int plustek_read(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_read((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
int plustek_write(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_write((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
void plustek_flush(scanner_t* scanner)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
libusb_flush((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
}
int scanbtnd_get_button(scanner_t* scanner)
{
unsigned char bytes[4];
int num_bytes;
int button = 0;
bytes[0] = 1;
bytes[1] = 2;
bytes[2] = 0;
bytes[3] = 1;
if (!scanner->is_open)
return -EINVAL;
num_bytes = plustek_write(scanner, (void*)bytes, 4);
if (num_bytes != 4) {
syslog(LOG_WARNING, "plustek_umax-backend: communication error: "
"write length:%d (expected:%d)", num_bytes, 4);
plustek_flush(scanner);
return 0;
}
num_bytes = plustek_read(scanner, (void*)bytes, 1);
if (num_bytes != 1) {
syslog(LOG_WARNING, "plustek_umax-backend: communication error: "
"read length:%d (expected:%d)", num_bytes, 1);
plustek_flush(scanner);
return 0;
}
switch (scanner->num_buttons) {
case 1: // not tested
if ((bytes[0] & 0x04) != 0) button = 1;
break;
case 2: // not tested
if ((bytes[0] & 0x08) != 0) button = 1;
if ((bytes[0] & 0x04) != 0) button = 2;
break;
case 3: // not tested
if ((bytes[0] & 0x10) != 0) button = 1;
if ((bytes[0] & 0x08) != 0) button = 2;
if ((bytes[0] & 0x04) != 0) button = 3;
break;
case 4: // only tested on UMAX Astra 3400
if ((bytes[0] & 0x04) != 0) button = 1;
if ((bytes[0] & 0x08) != 0) button = 2;
if ((bytes[0] & 0x40) != 0) button = 3;
if ((bytes[0] & 0x20) != 0) button = 4;
break;
}
return button;
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "plustek-umax-backend: exit");
plustek_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/epson_vphoto.h 0000644 0001751 0001751 00000001737 13075613451 020771 0 ustar lmeier lmeier // epson_vphoto.h: Epson ESC/V device backend
// This file is part of scanbuttond.
// Copyleft )c( 2011 by Philipp Klaus, based on code from Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __EPSON_VPHOTO_H_INCLUDED
#define __EPSON_VPHOTO_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/plustek.c 0000644 0001751 0001751 00000022142 13075613451 017721 0 ustar lmeier lmeier // plustek.c: Plustek device backend
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Hans Verkuil
// Copyleft )c( 2005-2007 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "plustek.h"
static char* backend_name = "Plustek USB";
#define NUM_SUPPORTED_USB_DEVICES 9
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x04a9, 0x2207, 1 }, // CanoScan N1220U
{ 0x04a9, 0x2208, 1 }, // CanoScan CanoScan D660U
{ 0x04a9, 0x2206, 1 }, // CanoScan N650U
{ 0x04a9, 0x220d, 3 }, // CanoScan LiDE 20
{ 0x04a9, 0x2220, 3 }, // CanoScan LiDE 25
{ 0x04a9, 0x220e, 3 }, // CanoScan LiDE 30
{ 0x04b8, 0x011d, 4 }, // Epson Perfection 1260
{ 0x03f0, 0x0605, 2 }, // HP ScanJet 2200c (maybe only 1 button?)
{ 0x0458, 0x2007, 5 } // Genius (KYE) ColorPage-HR6 V2 (5 buttons)
};
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Canon", "CanoScan N1220U" },
{ "Canon", "CanoScan D660U" },
{ "Canon", "CanoScan N650U" },
{ "Canon", "CanoScan LiDE 20" },
{ "Canon", "CanoScan LiDE 25" },
{ "Canon", "CanoScan LiDE 30" },
{ "Epson", "Perfection 1260" },
{ "Hewlett-Packard", "ScanJet 2200c" },
{ "Genius (KYE)", "ColorPage-HR6 V2" }
};
static libusb_handle_t* libusb_handle;
static scanner_t* plustek_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int plustek_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void plustek_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "plustek:libusb:";
int index = plustek_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = plustek_scanners;
plustek_scanners = scanner;
}
void plustek_detach_scanners(void)
{
scanner_t* next;
while (plustek_scanners != NULL) {
next = plustek_scanners->next;
free(plustek_scanners->sane_device);
free(plustek_scanners);
plustek_scanners = next;
}
}
void plustek_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = plustek_match_libusb_scanner(device);
if (index >= 0)
plustek_attach_libusb_scanner(device);
device = device->next;
}
}
int plustek_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
plustek_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
plustek_scanners = NULL;
syslog(LOG_INFO, "plustek-backend: init");
return plustek_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t* devices;
plustek_detach_scanners();
plustek_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
plustek_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return plustek_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int plustek_read(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_read((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
int plustek_write(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_write((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
void plustek_flush(scanner_t* scanner)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
libusb_flush((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
}
int scanbtnd_get_button(scanner_t* scanner)
{
/*
Note 1: I strongly suspect that the command 0x01 0x69 0x00 0x01 will return
a button bitmask. For my Canon N1220U it returns 0x04, which happens to
be the bit I have to test against to see if the scanner button was pressed.
However, this has to be tested on other scanners to see if this is true.
UPDATE by BS: The LIDE 20 also returns 0x04, but it has three buttons!
So this guess is probably wrong. (Thanks to Christian Bucher for this info)
Note 2: This works on my Canon N1220U. Whether this is Canon specific or
if it works for all 'plustek usb' type scanners is something I don't know.
Note 3: You must have run sane-find-scanner once. Sane apparently initializes
something on the scanner allowing this to work. Otherwise all you get is 0x00.
Note 4: by /cbx
On my CanoScan LIDE20, the default value is $62 and the bits for the
buttons are as follows:
Scan: $72 ==> 0x10
Copy: $6a ==> 0x08
Mail: $66 ==> 0x04
*/
unsigned char bytes[4];
int num_bytes;
int button = 0;
bytes[0] = 1;
bytes[1] = 2;
bytes[2] = 0;
bytes[3] = 1;
if (!scanner->is_open)
return -EINVAL;
num_bytes = plustek_write(scanner, (void*)bytes, 4);
if (num_bytes != 4) {
syslog(LOG_WARNING, "plustek-backend: communication error: "
"write length:%d (expected:%d)", num_bytes, 4);
plustek_flush(scanner);
return 0;
}
num_bytes = plustek_read(scanner, (void*)bytes, 1);
if (num_bytes != 1) {
syslog(LOG_WARNING, "plustek-backend: communication error: "
"read length:%d (expected:%d)", num_bytes, 1);
plustek_flush(scanner);
return 0;
}
// by BS: This is my first attempt to get rid of the
// hardcoded button bitmask. Note that I do not own any device
// supported by this backend, so this code is based on guessing.
// Tested on the LIDE 20, should work for 1-button devices, too.
switch (scanner->num_buttons) {
case 1:
if ((bytes[0] & 0x04) != 0) button = 1;
break;
case 2:
if ((bytes[0] & 0x08) != 0) button = 1;
if ((bytes[0] & 0x04) != 0) button = 2;
break;
case 3:
if ((bytes[0] & 0x10) != 0) button = 1;
if ((bytes[0] & 0x08) != 0) button = 2;
if ((bytes[0] & 0x04) != 0) button = 3;
break;
case 4: // only tested for the Epson Perfection 1260...
// seems to be a bit odd compared to the other cases...
if ((bytes[0] & 0x08) != 0) button = 1;
if ((bytes[0] & 0x10) != 0) button = 2;
if ((bytes[0] & 0x20) != 0) button = 3;
if ((bytes[0] & 0x40) != 0) button = 4;
break;
case 5: // only tested for the Genius ColorPage-HR6 V2...
// seems to be really different compared to the other cases...
if ((bytes[0] & 0x04) == 0x04) button = 1;
if ((bytes[0] & 0x08) == 0x08) button = 2;
if ((bytes[0] & 0x10) == 0x10) button = 3;
if ((bytes[0] & 0x0c) == 0x0c) button = 4;
if ((bytes[0] & 0x18) == 0x18) button = 5;
break;
}
return button;
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "plustek-backend: exit");
plustek_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/hp5590.c 0000644 0001751 0001751 00000046373 13075613451 017200 0 ustar lmeier lmeier /* hp5590.c: HP4570/5550/5590/7650 backend
* This file is part of scanbuttond.
* Copyleft )c( 2008 by Ilia Sotnikov
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#include
#include
#include
#include
#include
#include
#include
#include /* For htons() */
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "hp5590.h"
static char* backend_name = "HP5590 USB";
#define NUM_SUPPORTED_USB_DEVICES 4
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] =
{
/* vendor, product, num_buttons */
{ 0x03f0, 0x1305, 5 }, /* HP Scanjet 4570 */
{ 0x03f0, 0x1305, 5 }, /* HP Scanjet 5550 */
{ 0x03f0, 0x1705, 5 }, /* HP Scanjet 5590 */
{ 0x03f0, 0x1805, 5 }, /* HP Scanjet 7650 */
};
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] =
{
{ "Hewlett-Packard", "ScanJet 4570" },
{ "Hewlett-Packard", "ScanJet 5550" },
{ "Hewlett-Packard", "Scanjet 5590" },
{ "Hewlett-Packard", "Scanjet 7650" },
};
static libusb_handle_t* libusb_handle;
static scanner_t* hp5590_scanners = NULL;
/* returns -1 if the scanner is unsupported, or the index of the
* corresponding vendor-product pair in the supported_usb_devices array.
*/
static int
hp5590_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++)
{
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID)
break;
}
if (index >= NUM_SUPPORTED_USB_DEVICES)
return -1;
return index;
}
static void
hp5590_attach_libusb_scanner (libusb_device_t* device)
{
const char* descriptor_prefix = "hp5590:libusb:";
int index;
index = hp5590_match_libusb_scanner(device);
/* Unsupported */
if (index < 0)
return;
scanner_t* scanner = (scanner_t*) malloc (sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*) device;
scanner->lastbutton = 0;
scanner->sane_device = (char*) malloc (strlen (device->location) +
strlen (descriptor_prefix) + 1);
strcpy (scanner->sane_device, descriptor_prefix);
strcat (scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = hp5590_scanners;
hp5590_scanners = scanner;
}
static void
hp5590_detach_scanners (void)
{
scanner_t* next;
while (hp5590_scanners != NULL)
{
next = hp5590_scanners->next;
free (hp5590_scanners->sane_device);
free (hp5590_scanners);
hp5590_scanners = next;
}
}
static void
hp5590_scan_devices (libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL)
{
index = hp5590_match_libusb_scanner (device);
if (index >= 0)
hp5590_attach_libusb_scanner (device);
device = device->next;
}
}
static int
hp5590_init_libusb (void)
{
libusb_device_t* devices;
libusb_handle = libusb_init ();
devices = libusb_get_devices (libusb_handle);
hp5590_scan_devices (devices);
return 0;
}
static void
hp5590_flush (scanner_t* scanner)
{
switch (scanner->connection)
{
case CONNECTION_LIBUSB:
libusb_flush ((libusb_device_t*) scanner->internal_dev_ptr);
break;
}
}
const char*
scanbtnd_get_backend_name (void)
{
return backend_name;
}
int
scanbtnd_init (void)
{
hp5590_scanners = NULL;
syslog (LOG_INFO, "hp5590-backend: init");
return hp5590_init_libusb ();
}
int
scanbtnd_rescan (void)
{
libusb_device_t* devices;
hp5590_detach_scanners ();
hp5590_scanners = NULL;
libusb_rescan (libusb_handle);
devices = libusb_get_devices (libusb_handle);
hp5590_scan_devices (devices);
return 0;
}
const scanner_t*
scanbtnd_get_supported_devices (void)
{
return hp5590_scanners;
}
int
scanbtnd_open (scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection)
{
case CONNECTION_LIBUSB:
/* if devices have been added/removed, return -ENODEV to
* make scanbuttond update its device list
*/
if (libusb_get_changed_device_count () != 0)
return -ENODEV;
result = libusb_open ((libusb_device_t*) scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int
scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection)
{
case CONNECTION_LIBUSB:
result = libusb_close ((libusb_device_t*) scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
/* Taken from sane-backends/include/sane/sanei_usb.h */
#define USB_DIR_OUT 0x00
#define USB_DIR_IN 0x80
/* Taken from sane-backends/backends/hp5590_cmds.c */
/* Button flags */
#define BUTTON_FLAG_EMAIL 1 << 15
#define BUTTON_FLAG_COPY 1 << 14
#define BUTTON_FLAG_DOWN 1 << 13
#define BUTTON_FLAG_MODE 1 << 12
#define BUTTON_FLAG_UP 1 << 11
#define BUTTON_FLAG_FILE 1 << 9
#define BUTTON_FLAG_POWER 1 << 5
#define BUTTON_FLAG_SCAN 1 << 2
#define BUTTON_FLAG_COLLECT 1 << 1
#define BUTTON_FLAG_CANCEL 1 << 0
#define CMD_BUTTON_STATUS 0x0020
/* Taken from sane-backends/backends/hp5590_low.c */
/* Flags for hp5590_cmd() */
#define CMD_IN 1 << 0 /* Indicates IN direction, otherwise - OUT */
#define CMD_VERIFY 1 << 1 /* Requests last command verification */
/* Core flags for hp5590_cmd() - they indicate so called CORE commands */
#define CORE_NONE 0 /* No CORE operation */
#define CORE_DATA 1 << 0 /* Operate on CORE data */
/* CORE status flag - ready or not */
#define CORE_FLAG_NOT_READY 1 << 1
/* Structure describing control URB */
struct usb_in_usb_ctrl_setup
{
u_int8_t bRequestType;
u_int8_t bRequest;
u_int16_t wValue;
u_int16_t wIndex;
u_int16_t wLength;
} __attribute__ ((packed));
static int
hp5590_get_ack (scanner_t *scanner)
{
u_int8_t status;
int ret;
/* Check if USB-in-USB operation was accepted */
ret = libusb_control_msg ((libusb_device_t *) scanner->internal_dev_ptr,
USB_DIR_IN | USB_TYPE_VENDOR,
0x0c, 0x8e, 0x20,
&status, sizeof (status));
if (ret <= 0)
{
syslog (LOG_ERR, "hp5590-backend: USB-in-USB: error getting acknowledge");
return -1;
}
/* Check if we received correct acknowledgement */
if (status != 0x01)
{
syslog (LOG_ERR, "hp5590-backend: USB-in-USB: not accepted (status %u)", status);
return -1;
}
return 0;
}
static int
hp5590_control_msg (scanner_t *scanner,
int requesttype, int request,
int value, int index, unsigned char *bytes,
int size, int core_flags)
{
struct usb_in_usb_ctrl_setup ctrl;
int ret;
unsigned int len;
unsigned char *ptr;
u_int8_t ack;
u_int8_t response;
/* IN (read) operation will be performed */
if (requesttype & USB_DIR_IN)
{
/* Prepare USB-in-USB control message */
memset (&ctrl, 0, sizeof (ctrl));
ctrl.bRequestType = 0xc0;
ctrl.bRequest = request;
ctrl.wValue = htons (value);
ctrl.wIndex = htons (index);
ctrl.wLength = size;
/* Send USB-in-USB control message */
ret = libusb_control_msg ((libusb_device_t *) scanner->internal_dev_ptr,
USB_DIR_OUT | USB_TYPE_VENDOR,
0x04, 0x8f, 0x00,
(unsigned char *) &ctrl, sizeof (ctrl));
if (ret <= 0)
{
syslog (LOG_ERR, "hp5590-backend: USB-in-USB: error sending control message");
return -1;
}
ret = hp5590_get_ack (scanner);
if (ret != 0)
return ret;
len = size;
ptr = bytes;
/* Data is read in 8 byte portions */
while (len)
{
unsigned int next_packet_size;
next_packet_size = 8;
if (len < 8)
next_packet_size = len;
/* Read USB-in-USB data */
ret = libusb_control_msg ((libusb_device_t *) scanner->internal_dev_ptr,
USB_DIR_IN | USB_TYPE_VENDOR,
core_flags & CORE_DATA ? 0x0c : 0x04,
0x90, 0x00,
ptr, next_packet_size);
if (ret <= 0)
{
syslog (LOG_ERR, "hp5590-backend: USB-in-USB: error reading data");
return -1;
}
ptr += next_packet_size;
len -= next_packet_size;
}
/* Confirm data reception */
ack = 0;
ret = libusb_control_msg ((libusb_device_t *) scanner->internal_dev_ptr,
USB_DIR_OUT | USB_TYPE_VENDOR,
0x0c, 0x8f, 0x00,
&ack, sizeof (ack));
if (ret <= 0)
{
syslog (LOG_ERR, "hp5590-backend: USB-in-USB: error confirming data reception");
return -1;
}
ret = hp5590_get_ack (scanner);
if (ret != 0)
return ret;
}
/* OUT (write) operation will be performed */
if (!(requesttype & USB_DIR_IN))
{
/* Prepare USB-in-USB control message */
memset (&ctrl, 0, sizeof (ctrl));
ctrl.bRequestType = 0x40;
ctrl.bRequest = request;
ctrl.wValue = htons (value);
ctrl.wIndex = htons (index);
ctrl.wLength = size;
/* Send USB-in-USB control message */
ret = libusb_control_msg ((libusb_device_t *) scanner->internal_dev_ptr,
USB_DIR_OUT | USB_TYPE_VENDOR,
0x04, 0x8f, 0x00,
(unsigned char *) &ctrl, sizeof (ctrl));
if (ret <= 0)
{
syslog (LOG_ERR, "hp5590-backend: USB-in-USB: error sending control message");
return -1;
}
ret = hp5590_get_ack (scanner);
if (ret != 0)
return ret;
len = size;
ptr = bytes;
/* Data is sent in 8 byte portions */
while (len)
{
unsigned int next_packet_size;
next_packet_size = 8;
if (len < 8)
next_packet_size = len;
/* Send USB-in-USB data */
ret = libusb_control_msg ((libusb_device_t *) scanner->internal_dev_ptr,
USB_DIR_OUT | USB_TYPE_VENDOR,
core_flags & CORE_DATA ? 0x04 : 0x0c,
0x8f, 0x00, ptr, next_packet_size);
if (ret <= 0)
{
syslog (LOG_ERR, "hp5590-backend: USB-in-USB: error sending data");
return -1;
}
/* CORE data is acknowledged packet by packet */
if (core_flags & CORE_DATA)
{
ret = hp5590_get_ack (scanner);
if (ret != 0)
return ret;
}
ptr += next_packet_size;
len -= next_packet_size;
}
/* Normal (non-CORE) data is acknowledged after its full transmission */
if (!(core_flags & CORE_DATA))
{
ret = hp5590_get_ack (scanner);
if (ret != 0)
return ret;
}
/* Getting response after data transmission */
ret = libusb_control_msg ((libusb_device_t *) scanner->internal_dev_ptr,
USB_DIR_IN | USB_TYPE_VENDOR,
0x0c, 0x90, 0x00,
&response, sizeof (response));
if (ret <= 0)
{
syslog (LOG_ERR, "hp5590-backend: USB-in-USB: error getting response");
return -1;
}
/* Necessary response after normal (non-CORE) data is 0x00 */
if (response != 0x00)
{
syslog (LOG_ERR, "hp5590-backend: USB-in-USB: invalid response received "
"(needed 0x00, got %04x)", response);
return -1;
}
}
return 0;
}
static int
hp5590_verify_last_cmd (scanner_t *scanner, unsigned int cmd)
{
u_int16_t verify_cmd;
unsigned int last_cmd;
unsigned int core_status;
int ret;
/* Read last command along with CORE status */
ret = hp5590_control_msg (scanner,
USB_DIR_IN,
0x04, 0xc5, 0x00,
(unsigned char *) &verify_cmd,
sizeof (verify_cmd), CORE_NONE);
if (ret != 0)
return ret;
/* Last command - minor byte */
last_cmd = verify_cmd & 0xff;
/* CORE status - major byte */
core_status = (verify_cmd & 0xff00) >> 8;
/* Verify last command */
if ((cmd & 0x00ff) != last_cmd)
{
syslog (LOG_ERR, "hp5590-backend: USB-in-USB: command verification failed: "
"expected 0x%04x, got 0x%04x", cmd, last_cmd);
return -1;
}
/* Return value depends on CORE status */
return core_status & CORE_FLAG_NOT_READY ? -1 : 0;
}
static int
hp5590_cmd (scanner_t *scanner, unsigned int flags,
unsigned int cmd, unsigned char *data, unsigned int size,
unsigned int core_flags)
{
int ret;
ret = hp5590_control_msg (scanner,
flags & CMD_IN ? USB_DIR_IN : USB_DIR_OUT,
0x04, cmd, 0x00, data, size, core_flags);
if (ret != 0)
return ret;
ret = 0;
/* Verify last command if requested */
if (flags & CMD_VERIFY)
ret = hp5590_verify_last_cmd (scanner, cmd);
return ret;
}
int
scanbtnd_get_button(scanner_t* scanner)
{
int button = 0;
u_int16_t button_status;
int ret;
if (!scanner->is_open)
return -EINVAL;
ret = hp5590_cmd (scanner, CMD_IN | CMD_VERIFY,
CMD_BUTTON_STATUS,
(unsigned char *) &button_status,
sizeof (button_status), CORE_NONE);
if (ret != 0) {
hp5590_flush (scanner);
return 0;
}
/* Network order */
button_status = ntohs (button_status);
if (button_status & BUTTON_FLAG_SCAN)
button = 1;
if (button_status & BUTTON_FLAG_COLLECT)
button = 2;
if (button_status & BUTTON_FLAG_FILE)
button = 3;
if (button_status & BUTTON_FLAG_EMAIL)
button = 4;
if (button_status & BUTTON_FLAG_COPY)
button = 5;
return button;
}
const char*
scanbtnd_get_sane_device_descriptor (scanner_t* scanner)
{
return scanner->sane_device;
}
int
scanbtnd_exit (void)
{
syslog (LOG_INFO, "hp5590-backend: exit");
hp5590_detach_scanners ();
libusb_exit (libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/Makefile.in 0000644 0001751 0001751 00000067166 13075613451 020152 0 ustar lmeier lmeier # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 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@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
subdir = src/scanbuttond/backends
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
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 = f=`echo $$p | sed -e 's|^.*/||'`;
am__install_max = 40
am__nobase_strip_setup = \
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
am__nobase_strip = \
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
am__nobase_list = $(am__nobase_strip_setup); \
for p in $$list; do echo "$$p $$p"; done | \
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
if (++n[$$2] == $(am__install_max)) \
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
END { for (dir in files) print dir, files[dir] }'
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
am__uninstall_files_from_dir = { \
test -z "$$files" \
|| { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
|| { echo " ( cd '$$dir' && rm -f" $$files ")"; \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(backenddir)" "$(DESTDIR)$(backenddir)"
LTLIBRARIES = $(backend_LTLIBRARIES)
artec_eplus48u_la_LIBADD =
am_artec_eplus48u_la_OBJECTS = artec_eplus48u.lo
artec_eplus48u_la_OBJECTS = $(am_artec_eplus48u_la_OBJECTS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
epson_la_LIBADD =
am_epson_la_OBJECTS = epson.lo
epson_la_OBJECTS = $(am_epson_la_OBJECTS)
epson_vphoto_la_LIBADD =
am_epson_vphoto_la_OBJECTS = epson_vphoto.lo
epson_vphoto_la_OBJECTS = $(am_epson_vphoto_la_OBJECTS)
genesys_la_LIBADD =
am_genesys_la_OBJECTS = genesys.lo
genesys_la_OBJECTS = $(am_genesys_la_OBJECTS)
gt68xx_la_LIBADD =
am_gt68xx_la_OBJECTS = gt68xx.lo
gt68xx_la_OBJECTS = $(am_gt68xx_la_OBJECTS)
hp3500_la_LIBADD =
am_hp3500_la_OBJECTS = hp3500.lo
hp3500_la_OBJECTS = $(am_hp3500_la_OBJECTS)
hp3900_la_LIBADD =
am_hp3900_la_OBJECTS = hp3900.lo
hp3900_la_OBJECTS = $(am_hp3900_la_OBJECTS)
hp5590_la_LIBADD =
am_hp5590_la_OBJECTS = hp5590.lo
hp5590_la_OBJECTS = $(am_hp5590_la_OBJECTS)
meta_la_LIBADD =
am_meta_la_OBJECTS = meta.lo
meta_la_OBJECTS = $(am_meta_la_OBJECTS)
mustek_la_LIBADD =
am_mustek_la_OBJECTS = mustek.lo
mustek_la_OBJECTS = $(am_mustek_la_OBJECTS)
niash_la_LIBADD =
am_niash_la_OBJECTS = niash.lo
niash_la_OBJECTS = $(am_niash_la_OBJECTS)
plustek_la_LIBADD =
am_plustek_la_OBJECTS = plustek.lo
plustek_la_OBJECTS = $(am_plustek_la_OBJECTS)
plustek_umax_la_LIBADD =
am_plustek_umax_la_OBJECTS = plustek_umax.lo
plustek_umax_la_OBJECTS = $(am_plustek_umax_la_OBJECTS)
snapscan_la_LIBADD =
am_snapscan_la_OBJECTS = snapscan.lo
snapscan_la_OBJECTS = $(am_snapscan_la_OBJECTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(artec_eplus48u_la_SOURCES) $(epson_la_SOURCES) \
$(epson_vphoto_la_SOURCES) $(genesys_la_SOURCES) \
$(gt68xx_la_SOURCES) $(hp3500_la_SOURCES) $(hp3900_la_SOURCES) \
$(hp5590_la_SOURCES) $(meta_la_SOURCES) $(mustek_la_SOURCES) \
$(niash_la_SOURCES) $(plustek_la_SOURCES) \
$(plustek_umax_la_SOURCES) $(snapscan_la_SOURCES)
DIST_SOURCES = $(artec_eplus48u_la_SOURCES) $(epson_la_SOURCES) \
$(epson_vphoto_la_SOURCES) $(genesys_la_SOURCES) \
$(gt68xx_la_SOURCES) $(hp3500_la_SOURCES) $(hp3900_la_SOURCES) \
$(hp5590_la_SOURCES) $(meta_la_SOURCES) $(mustek_la_SOURCES) \
$(niash_la_SOURCES) $(plustek_la_SOURCES) \
$(plustek_umax_la_SOURCES) $(snapscan_la_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
DATA = $(backend_DATA)
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFUSE_CFLAGS = @CONFUSE_CFLAGS@
CONFUSE_LIBS = @CONFUSE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
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@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
FGREP = @FGREP@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_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@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
OS_CPPFLAGS = @OS_CPPFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SANED_PATH = @SANED_PATH@
SANE_CFLAGS = @SANE_CFLAGS@
SANE_CONFIG = @SANE_CONFIG@
SANE_LIBS = @SANE_LIBS@
SCANBD_CFG_DIR = @SCANBD_CFG_DIR@
SCANBD_GROUP = @SCANBD_GROUP@
SCANBD_USER = @SCANBD_USER@
SCANBUTTOND_LIB_DIR = @SCANBUTTOND_LIB_DIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
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@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
backenddir = @SCANBUTTOND_LIB_DIR@
backend_DATA = meta.conf
backend_LTLIBRARIES = \
mustek.la \
plustek.la \
plustek_umax.la \
snapscan.la \
hp3500.la \
meta.la \
niash.la \
artec_eplus48u.la \
epson.la \
genesys.la \
gt68xx.la \
hp3900.la \
hp5590.la \
epson_vphoto.la
AM_CFLAGS = \
$(OS_CFLAGS) \
$(OS_CPPFLAGS) \
$(EXTRA_CFLAGS) \
$(LIBUSB_CFLAGS) \
-I../include \
-Dsyslog=slog \
-DLOG_INFO=SLOG_INFO \
-DLOG_WARNING=SLOG_WARN \
-DSCANBUTTOND_LIB_DIR=@SCANBUTTOND_LIB_DIR@/
AM_LDFLAGS = \
$(LIBUSB_LDFLAGS) \
-shared \
-avoid-version \
-module
mustek_la_SOURCES = mustek.c mustek.h
plustek_la_SOURCES = plustek.c plustek.h
plustek_umax_la_SOURCES = plustek_umax.c plustek_umax.h
snapscan_la_SOURCES = snapscan.c snapscan.h
hp3500_la_SOURCES = hp3500.c hp3500.h
meta_la_SOURCES = meta.c meta.h
niash_la_SOURCES = niash.c niash.h
artec_eplus48u_la_SOURCES = artec_eplus48u.c artec_eplus48u.h
epson_la_SOURCES = epson.c epson.h
genesys_la_SOURCES = genesys.c genesys.h
gt68xx_la_SOURCES = gt68xx.c gt68xx.h
hp3900_la_SOURCES = hp3900.c hp3900.h
hp5590_la_SOURCES = hp5590.c hp5590.h
epson_vphoto_la_SOURCES = epson_vphoto.c epson_vphoto.h
EXTRA_DIST = \
Makefile.simple \
meta.conf
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/scanbuttond/backends/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/scanbuttond/backends/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
install-backendLTLIBRARIES: $(backend_LTLIBRARIES)
@$(NORMAL_INSTALL)
@list='$(backend_LTLIBRARIES)'; test -n "$(backenddir)" || list=; \
list2=; for p in $$list; do \
if test -f $$p; then \
list2="$$list2 $$p"; \
else :; fi; \
done; \
test -z "$$list2" || { \
echo " $(MKDIR_P) '$(DESTDIR)$(backenddir)'"; \
$(MKDIR_P) "$(DESTDIR)$(backenddir)" || exit 1; \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(backenddir)'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(backenddir)"; \
}
uninstall-backendLTLIBRARIES:
@$(NORMAL_UNINSTALL)
@list='$(backend_LTLIBRARIES)'; test -n "$(backenddir)" || list=; \
for p in $$list; do \
$(am__strip_dir) \
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(backenddir)/$$f'"; \
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(backenddir)/$$f"; \
done
clean-backendLTLIBRARIES:
-test -z "$(backend_LTLIBRARIES)" || rm -f $(backend_LTLIBRARIES)
@list='$(backend_LTLIBRARIES)'; \
locs=`for p in $$list; do echo $$p; done | \
sed 's|^[^/]*$$|.|; s|/[^/]*$$||; s|$$|/so_locations|' | \
sort -u`; \
test -z "$$locs" || { \
echo rm -f $${locs}; \
rm -f $${locs}; \
}
artec_eplus48u.la: $(artec_eplus48u_la_OBJECTS) $(artec_eplus48u_la_DEPENDENCIES) $(EXTRA_artec_eplus48u_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(artec_eplus48u_la_OBJECTS) $(artec_eplus48u_la_LIBADD) $(LIBS)
epson.la: $(epson_la_OBJECTS) $(epson_la_DEPENDENCIES) $(EXTRA_epson_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(epson_la_OBJECTS) $(epson_la_LIBADD) $(LIBS)
epson_vphoto.la: $(epson_vphoto_la_OBJECTS) $(epson_vphoto_la_DEPENDENCIES) $(EXTRA_epson_vphoto_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(epson_vphoto_la_OBJECTS) $(epson_vphoto_la_LIBADD) $(LIBS)
genesys.la: $(genesys_la_OBJECTS) $(genesys_la_DEPENDENCIES) $(EXTRA_genesys_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(genesys_la_OBJECTS) $(genesys_la_LIBADD) $(LIBS)
gt68xx.la: $(gt68xx_la_OBJECTS) $(gt68xx_la_DEPENDENCIES) $(EXTRA_gt68xx_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(gt68xx_la_OBJECTS) $(gt68xx_la_LIBADD) $(LIBS)
hp3500.la: $(hp3500_la_OBJECTS) $(hp3500_la_DEPENDENCIES) $(EXTRA_hp3500_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(hp3500_la_OBJECTS) $(hp3500_la_LIBADD) $(LIBS)
hp3900.la: $(hp3900_la_OBJECTS) $(hp3900_la_DEPENDENCIES) $(EXTRA_hp3900_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(hp3900_la_OBJECTS) $(hp3900_la_LIBADD) $(LIBS)
hp5590.la: $(hp5590_la_OBJECTS) $(hp5590_la_DEPENDENCIES) $(EXTRA_hp5590_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(hp5590_la_OBJECTS) $(hp5590_la_LIBADD) $(LIBS)
meta.la: $(meta_la_OBJECTS) $(meta_la_DEPENDENCIES) $(EXTRA_meta_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(meta_la_OBJECTS) $(meta_la_LIBADD) $(LIBS)
mustek.la: $(mustek_la_OBJECTS) $(mustek_la_DEPENDENCIES) $(EXTRA_mustek_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(mustek_la_OBJECTS) $(mustek_la_LIBADD) $(LIBS)
niash.la: $(niash_la_OBJECTS) $(niash_la_DEPENDENCIES) $(EXTRA_niash_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(niash_la_OBJECTS) $(niash_la_LIBADD) $(LIBS)
plustek.la: $(plustek_la_OBJECTS) $(plustek_la_DEPENDENCIES) $(EXTRA_plustek_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(plustek_la_OBJECTS) $(plustek_la_LIBADD) $(LIBS)
plustek_umax.la: $(plustek_umax_la_OBJECTS) $(plustek_umax_la_DEPENDENCIES) $(EXTRA_plustek_umax_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(plustek_umax_la_OBJECTS) $(plustek_umax_la_LIBADD) $(LIBS)
snapscan.la: $(snapscan_la_OBJECTS) $(snapscan_la_DEPENDENCIES) $(EXTRA_snapscan_la_DEPENDENCIES)
$(AM_V_CCLD)$(LINK) -rpath $(backenddir) $(snapscan_la_OBJECTS) $(snapscan_la_LIBADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/artec_eplus48u.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epson.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/epson_vphoto.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/genesys.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gt68xx.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hp3500.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hp3900.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/hp5590.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/meta.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/mustek.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/niash.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plustek.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/plustek_umax.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/snapscan.Plo@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
install-backendDATA: $(backend_DATA)
@$(NORMAL_INSTALL)
@list='$(backend_DATA)'; test -n "$(backenddir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(backenddir)'"; \
$(MKDIR_P) "$(DESTDIR)$(backenddir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(backenddir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(backenddir)" || exit $$?; \
done
uninstall-backendDATA:
@$(NORMAL_UNINSTALL)
@list='$(backend_DATA)'; test -n "$(backenddir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(backenddir)'; $(am__uninstall_files_from_dir)
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA)
installdirs:
for dir in "$(DESTDIR)$(backenddir)" "$(DESTDIR)$(backenddir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: 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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-backendLTLIBRARIES clean-generic clean-libtool \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am: install-backendDATA install-backendLTLIBRARIES
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(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-backendDATA uninstall-backendLTLIBRARIES
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \
clean-backendLTLIBRARIES clean-generic clean-libtool \
cscopelist-am ctags ctags-am distclean distclean-compile \
distclean-generic distclean-libtool distclean-tags distdir dvi \
dvi-am html html-am info info-am install install-am \
install-backendDATA install-backendLTLIBRARIES install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am uninstall-backendDATA \
uninstall-backendLTLIBRARIES
.PRECIOUS: Makefile
# 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:
./1.5.1/src/scanbuttond/backends/artec_eplus48u.h 0000644 0001751 0001751 00000001721 13075613451 021106 0 ustar lmeier lmeier // artec_eplus48u.h : scanbuttond backend for mustek/gt68xx devices
// This file is part of scanbuttond.
// Copyleft )c( 2006 by Joel Fuster
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __ARTEC_EPLUS48U_H_INCLUDED
#define __ARTEC_EPLUS48U_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/mustek.c 0000644 0001751 0001751 00000014624 13075613451 017550 0 ustar lmeier lmeier // mustek.c : scanbuttond backend for mustek/gt68xx devices
// This file is part of scanbuttond.
// Copyleft )c( 2006 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "mustek.h"
static char* backend_name = "Mustek USB";
#define NUM_SUPPORTED_USB_DEVICES 1
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x055f, 0x0409, 5 } // Mustek BearPaw 2448TA
};
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Mustek", "BearPaw 2448TA"}
};
static libusb_handle_t* libusb_handle;
static scanner_t* mustek_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int mustek_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void mustek_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "mustek:libusb:";
int index = mustek_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = mustek_scanners;
mustek_scanners = scanner;
}
void mustek_detach_scanners(void)
{
scanner_t* next;
while (mustek_scanners != NULL) {
next = mustek_scanners->next;
free(mustek_scanners->sane_device);
free(mustek_scanners);
mustek_scanners = next;
}
}
void mustek_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = mustek_match_libusb_scanner(device);
if (index >= 0)
mustek_attach_libusb_scanner(device);
device = device->next;
}
}
int mustek_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
mustek_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
mustek_scanners = NULL;
syslog(LOG_INFO, "mustek-backend: init");
return mustek_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t *devices;
mustek_detach_scanners();
mustek_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
mustek_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return mustek_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int mustek_read(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_read((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
int mustek_write(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_write((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
void mustek_flush(scanner_t* scanner)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
libusb_flush((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
}
int scanbtnd_get_button(scanner_t* scanner)
{
unsigned char bytes[8];
int num_bytes;
bytes[0] = 0x74; // check function key
if (!scanner->is_open)
return -EINVAL;
num_bytes = mustek_write(scanner, (void*)bytes, 1);
if (num_bytes != 1) {
syslog(LOG_WARNING, "mustek-backend: communication error: "
"write length:%d (expected:%d)", num_bytes, 1);
mustek_flush(scanner);
return 0;
}
num_bytes = mustek_read(scanner, (void*)bytes, 8);
if (num_bytes != 8) {
syslog(LOG_WARNING, "mustek-backend: communication error: "
"read length:%d (expected:%d)", num_bytes, 8);
mustek_flush(scanner);
return 0;
}
switch (bytes[2]) {
case 0x10: // scan button
return 1;
case 0x14: // copy
return 2;
case 0x12: // fax
return 3;
case 0x18: // email
return 4;
case 0x11: // panel
return 5;
}
return 0;
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "mustek-backend: exit");
mustek_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/meta.conf 0000644 0001751 0001751 00000000052 13075613451 017657 0 ustar lmeier lmeier hp3500
snapscan
niash
epson_vphoto
genesys ./1.5.1/src/scanbuttond/backends/epson.c 0000644 0001751 0001751 00000017543 13075613451 017367 0 ustar lmeier lmeier // epson.c: Epson ESC/I device backend
// This file is part of scanbuttond.
// Copyleft )c( 2004-2006 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
// Thanks to:
// - James Gilliland (Epson CX3200 support)
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "epson.h"
#define ESC 0x1B /* ASCII value for ESC */
static char* backend_name = "Epson USB";
#define NUM_SUPPORTED_USB_DEVICES 16
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x04B8, 0x0107, 1 }, // Epson Expression 1600
{ 0x04B8, 0x010E, 1 }, // Epson Expression 1680
{ 0x04B8, 0x012C, 1 }, // Epson Perfection V700
{ 0x04B8, 0x0103, 1 }, // Epson Perfection 610
{ 0x04B8, 0x0101, 3 }, // Epson Perfection 636U
{ 0x04B8, 0x010C, 3 }, // Epson Perfection 640
{ 0x04B8, 0x0104, 1 }, // Epson Perfection 1200U
{ 0x04B8, 0x010B, 3 }, // Epson Perfection 1240
{ 0x04B8, 0x010A, 1 }, // Epson Perfection 1640
{ 0x04B8, 0x0110, 4 }, // Epson Perfection 1650
{ 0x04B8, 0x011E, 4 }, // Epson Perfection 1660
{ 0x04B8, 0x011B, 4 }, // Epson Perfection 2400
{ 0x04B8, 0x0112, 1 }, // Epson Perfection 2450
{ 0x04B8, 0x011C, 1 }, // Epson Perfection 3200
{ 0x04B8, 0x0802, 1 }, // Epson CX3200 (note: is the button number
// really correct?)
{ 0x04B8, 0x0106, 1 } // Epson Stylus Scan 2500
};
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Epson", "Expression 1600"},
{ "Epson", "Expression 1680"},
{ "Epson", "Perfection V700"},
{ "Epson", "Perfection 610"},
{ "Epson", "Perfection 636U"},
{ "Epson", "Perfection 640"},
{ "Epson", "Perfection 1200U"},
{ "Epson", "Perfection 1240"},
{ "Epson", "Perfection 1640"},
{ "Epson", "Perfection 1650"},
{ "Epson", "Perfection 1660"},
{ "Epson", "Perfection 2400"},
{ "Epson", "Perfection 2450"},
{ "Epson", "Perfection 3200"},
{ "Epson", "Stylus CX3200"},
{ "Epson", "Stylus Scan 2500"}
};
static libusb_handle_t* libusb_handle;
static scanner_t* epson_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int epson_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void epson_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "epson:libusb:";
int index = epson_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = epson_scanners;
epson_scanners = scanner;
}
void epson_detach_scanners(void)
{
scanner_t* next;
while (epson_scanners != NULL) {
next = epson_scanners->next;
free(epson_scanners->sane_device);
free(epson_scanners);
epson_scanners = next;
}
}
void epson_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = epson_match_libusb_scanner(device);
if (index >= 0)
epson_attach_libusb_scanner(device);
device = device->next;
}
}
int epson_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
epson_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
epson_scanners = NULL;
syslog(LOG_INFO, "epson-backend: init");
return epson_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t *devices;
epson_detach_scanners();
epson_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
epson_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return epson_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int epson_read(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_read((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
int epson_write(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_write((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
void epson_flush(scanner_t* scanner)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
libusb_flush((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
}
int scanbtnd_get_button(scanner_t* scanner)
{
#define BUFFER_SIZE 16
unsigned char bytes[BUFFER_SIZE];
int rcv_len;
int num_bytes;
bytes[0] = ESC;
bytes[1] = '!';
bytes[2] = '\0';
if (!scanner->is_open)
return -EINVAL;
num_bytes = epson_write(scanner, (void*)bytes, 2);
if (num_bytes != 2) {
syslog(LOG_WARNING, "epson-backend: communication error: "
"write length:%d (expected:%d)", num_bytes, 2);
epson_flush(scanner);
return 0;
}
num_bytes = epson_read(scanner, (void*)bytes, 4);
if (num_bytes != 4) {
syslog(LOG_WARNING, "epson-backend: communication error: "
"read length:%d (expected:%d)", num_bytes, 4);
epson_flush(scanner);
return 0;
}
rcv_len = bytes[3] << 8 | bytes[2];
num_bytes = epson_read(scanner, (void*)bytes, MAX(rcv_len, BUFFER_SIZE));
if (num_bytes != rcv_len) {
syslog(LOG_WARNING, "epson-backend: communication error: "
"read length:%d (expected:%d)", num_bytes, MAX(rcv_len, BUFFER_SIZE));
epson_flush(scanner);
return 0;
}
return bytes[0];
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "epson-backend: exit");
epson_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/plustek_umax.h 0000644 0001751 0001751 00000001756 13075613451 020770 0 ustar lmeier lmeier // plustek_umax.h: Plustek device backend for UMAX models
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Hans Verkuil
// Copyleft )c( 2005 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __PLUSTEK_UMAX_H_INCLUDED
#define __PLUSTEK_UMAX_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/snapscan.c 0000644 0001751 0001751 00000017137 13075613451 020050 0 ustar lmeier lmeier // snapscan.c: Snapscan device backend
// This file is part of scanbuttond.
// Copyleft )c( 2005-2006 by Bernhard Stiftner
// Thanks to J. Javier Maestro for sniffing the button codes ;-)
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "snapscan.h"
static char* backend_name = "Snapscan USB";
#define NUM_SUPPORTED_USB_DEVICES 4
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
{ 0x04b8, 0x0121, 4 }, // Epson Perfection 2480
{ 0x04b8, 0x011f, 4 }, // Epson Perfection 1670
{ 0x04b8, 0x0122, 4 }, // Epson Perfection 3490
{ 0x04b8, 0x0120, 4 } // Epson Perfection 1270
};
// TODO: check if this backend really works on the Epson 2580 too...
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Epson", "Perfection 2480 / 2580" },
{ "Epson", "Perfection 1670" },
{ "Epson", "Perfection 3490 / 3590" },
{ "Epson", "Perfection 1270" }
};
static libusb_handle_t* libusb_handle;
static scanner_t* snapscan_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int snapscan_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void snapscan_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "snapscan:libusb:";
int index = snapscan_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = snapscan_scanners;
snapscan_scanners = scanner;
}
void snapscan_detach_scanners(void)
{
scanner_t* next;
while (snapscan_scanners != NULL) {
next = snapscan_scanners->next;
free(snapscan_scanners->sane_device);
free(snapscan_scanners);
snapscan_scanners = next;
}
}
void snapscan_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = snapscan_match_libusb_scanner(device);
if (index >= 0)
snapscan_attach_libusb_scanner(device);
device = device->next;
}
}
int snapscan_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
snapscan_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
snapscan_scanners = NULL;
syslog(LOG_INFO, "snapscan-backend: init");
return snapscan_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t* devices;
snapscan_detach_scanners();
snapscan_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
snapscan_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return snapscan_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int snapscan_read(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_read((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
int snapscan_write(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_write((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
void snapscan_flush(scanner_t* scanner)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
libusb_flush((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
}
int scanbtnd_get_button(scanner_t* scanner)
{
unsigned char bytes[20];
int num_bytes;
int button = 0;
bytes[0] = 0x03;
bytes[1] = 0x00;
bytes[2] = 0x00;
bytes[3] = 0x00;
bytes[4] = 0x14;
bytes[5] = 0x00;
if (!scanner->is_open)
return -EINVAL;
num_bytes = snapscan_write(scanner, (void*)bytes, 6);
if (num_bytes != 6) {
syslog(LOG_WARNING, "snapscan-backend: communication error: "
"write length:%d (expected:%d)", num_bytes, 6);
snapscan_flush(scanner);
return 0;
}
num_bytes = snapscan_read(scanner, (void*)bytes, 8);
if (num_bytes != 8 || bytes[0] != 0xF9) {
syslog(LOG_WARNING, "snapscan-backend: communication error: "
"read length:%d (expected:%d), "
"byte[0]:%x (expected:%x)",
num_bytes, 8, bytes[0], 0xF9);
snapscan_flush(scanner);
return 0;
}
num_bytes = snapscan_read(scanner, (void*)bytes, 20);
if (num_bytes != 20 || bytes[0] != 0xF0) {
syslog(LOG_WARNING, "snapscan-backend: communication error: "
"read length:%d (expected:%d), "
"byte[0]:%x (expected:%x)",
num_bytes, 20, bytes[0], 0xF0);
snapscan_flush(scanner);
return 0;
}
if (bytes[2] == 0x06) {
switch (bytes[18] & 0xF0) {
case 0x10: button = 1; break;
case 0x20: button = 2; break;
case 0x40: button = 3; break;
case 0x80: button = 4; break;
default: button = 0; break;
}
}
num_bytes = snapscan_read(scanner, (void*)bytes, 8);
if (num_bytes != 8 || bytes[0] != 0xFB) {
syslog(LOG_WARNING, "snapscan-backend: communication error: "
"read length:%d (expected:%d), "
"byte[0]:%x (expected:%x)",
num_bytes, 8, bytes[0], 0xFB);
snapscan_flush(scanner);
return 0;
}
return button;
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "snapscan-backend: exit");
snapscan_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/epson.h 0000644 0001751 0001751 00000001655 13075613451 017371 0 ustar lmeier lmeier // epson.h: Epson ESC/I device backend
// This file is part of scanbuttond.
// Copyleft )c( 2004-2005 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __EPSON_H_INCLUDED
#define __EPSON_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/hp3900.h 0000644 0001751 0001751 00000001715 13075613451 017165 0 ustar lmeier lmeier // hp3900.h: RTS8822 chipset based devices backend
// This file is part of scanbuttond.
// Copyleft )c( 2006 by Jonathan Bravo Lopez
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __HP3900_H_INCLUDED
#define __HP3900_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/hp3500.h 0000644 0001751 0001751 00000001664 13075613451 017164 0 ustar lmeier lmeier // hp3500.h: RTS8801C2 chipset based devices backend
// This file is part of scanbuttond.
// Copyleft )c( 2008 by Jan Michaelis
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __HP3500_H_INCLUDED
#define __HP3500_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/Makefile.am 0000644 0001751 0001751 00000002302 13075613451 020116 0 ustar lmeier lmeier backenddir = @SCANBUTTOND_LIB_DIR@
backend_DATA = meta.conf
backend_LTLIBRARIES = \
mustek.la \
plustek.la \
plustek_umax.la \
snapscan.la \
hp3500.la \
meta.la \
niash.la \
artec_eplus48u.la \
epson.la \
genesys.la \
gt68xx.la \
hp3900.la \
hp5590.la \
epson_vphoto.la
AM_CFLAGS = \
$(OS_CFLAGS) \
$(OS_CPPFLAGS) \
$(EXTRA_CFLAGS) \
$(LIBUSB_CFLAGS) \
-I../include \
-Dsyslog=slog \
-DLOG_INFO=SLOG_INFO \
-DLOG_WARNING=SLOG_WARN \
-DSCANBUTTOND_LIB_DIR=@SCANBUTTOND_LIB_DIR@/
AM_LDFLAGS = \
$(LIBUSB_LDFLAGS) \
-shared \
-avoid-version \
-module
mustek_la_SOURCES = mustek.c mustek.h
plustek_la_SOURCES = plustek.c plustek.h
plustek_umax_la_SOURCES = plustek_umax.c plustek_umax.h
snapscan_la_SOURCES = snapscan.c snapscan.h
hp3500_la_SOURCES = hp3500.c hp3500.h
meta_la_SOURCES = meta.c meta.h
niash_la_SOURCES = niash.c niash.h
artec_eplus48u_la_SOURCES = artec_eplus48u.c artec_eplus48u.h
epson_la_SOURCES = epson.c epson.h
genesys_la_SOURCES = genesys.c genesys.h
gt68xx_la_SOURCES = gt68xx.c gt68xx.h
hp3900_la_SOURCES = hp3900.c hp3900.h
hp5590_la_SOURCES = hp5590.c hp5590.h
epson_vphoto_la_SOURCES = epson_vphoto.c epson_vphoto.h
EXTRA_DIST = \
Makefile.simple \
meta.conf
./1.5.1/src/scanbuttond/backends/gt68xx.c 0000644 0001751 0001751 00000014703 13075613451 017406 0 ustar lmeier lmeier // gt68xx.c: gt68xx device backend
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Hans Verkuil
// Copyleft )c( 2005-2006 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
// essentialy most of these files are just copies of each other apart of the
// device name. the only real changes are in the parsing routines.
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "gt68xx.h"
static char* backend_name = "gt68xx USB";
#define NUM_SUPPORTED_USB_DEVICES 1
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x0458, 0x2014, 5 }
};
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Genius", "Colorpage Vivid4" }
};
libusb_handle_t* libusb_handle;
scanner_t* gt68xx_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int gt68xx_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void gt68xx_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "gt68xx:libusb:";
int index = gt68xx_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = gt68xx_scanners;
gt68xx_scanners = scanner;
}
void gt68xx_detach_scanners(void)
{
scanner_t* next;
while (gt68xx_scanners != NULL) {
next = gt68xx_scanners->next;
free(gt68xx_scanners->sane_device);
free(gt68xx_scanners);
gt68xx_scanners = next;
}
}
void gt68xx_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = gt68xx_match_libusb_scanner(device);
if (index >= 0)
gt68xx_attach_libusb_scanner(device);
device = device->next;
}
}
int gt68xx_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
gt68xx_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
gt68xx_scanners = NULL;
syslog(LOG_INFO, "gt68xx-backend: init");
return gt68xx_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t* devices;
gt68xx_detach_scanners();
gt68xx_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
gt68xx_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return gt68xx_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int gt68xx_read(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_control_msg((libusb_device_t*)scanner->internal_dev_ptr,
0xc0, 0x04, 0x2011, 0x3f00, buffer, bytecount);
break;
}
return -1;
}
int gt68xx_write(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_control_msg((libusb_device_t*)scanner->internal_dev_ptr,
0x40, 0x04, 0x2010, 0x3f40, buffer, bytecount);
break;
}
return -1;
}
void gt68xx_flush(scanner_t* scanner)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
libusb_flush((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
}
int scanbtnd_get_button(scanner_t* scanner)
{
unsigned char bytes[255] = {};
int num_bytes;
int button = 0;
bytes[0] = 0x29;
bytes[1] = 0x01;
bytes[2] = 0xa8;
bytes[3] = 0x61;
bytes[0x38] = 0x2e;
if (!scanner->is_open)
return -EINVAL;
if (gt68xx_write(scanner, (void*)bytes, 0x40) < 0)
return 0;
if ((num_bytes = gt68xx_read(scanner, (void*)bytes, 0x40)) < 0)
return 0;
if (bytes[0] != 0x00 || bytes[1] != 0x29)
return 0;
if (bytes[2] & 0x02)
button = 1; // scan
if (bytes[2] & 0x01)
button = 2; // copy
if (bytes[2] & 0x04)
button = 3; // ocr
if (bytes[2] & 0x08)
button = 4; // mail
if (bytes[2] & 0x10)
button = 5; // fax
return button;
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "gt68xx-backend: exit");
gt68xx_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/gt68xx.h 0000644 0001751 0001751 00000001713 13075613451 017410 0 ustar lmeier lmeier // gt68xx.h: gt68xx device backend
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Hans Verkuil
// Copyleft )c( 2005 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __GT68XX_H_INCLUDED
#define __GT68XX_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/Makefile.simple 0000644 0001751 0001751 00000002672 13075613451 021024 0 ustar lmeier lmeier #
# $Id: Makefile.simple 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
include ../../../Makefile.include
CPPFLAGS += -Dsyslog=slog -DLOG_INFO=SLOG_INFO -DLOG_WARNING=SLOG_WARN -I../include
%.so: %.c
$(CC) $(CFLAGS) $(CPPFLAGS) -fPIC -shared -o $@ $<
all: mustek.so plustek.so plustek_umax.so snapscan.so hp3500.so meta.so niash.so artec_eplus48u.so epson.so genesys.so gt68xx.so hp3900.so hp5590.so epson_vphoto.so
mustek.so: mustek.c mustek.h
snapscan.so: snapscan.c snapscan.h
hp3500.so: hp3500.c hp3500.h
meta.so: meta.c meta.h
niash.so: niash.c niash.h
epson_vphoto.so: epson_vphoto.c epson_vphoto.h
clean:
$(RM) *.o *~ *.so
./1.5.1/src/scanbuttond/backends/plustek.h 0000644 0001751 0001751 00000001717 13075613451 017733 0 ustar lmeier lmeier // plustek.h: Plustek device backend
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Hans Verkuil
// Copyleft )c( 2005 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __PLUSTEK_H_INCLUDED
#define __PLUSTEK_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/meta.c 0000644 0001751 0001751 00000016100 13075613451 017155 0 ustar lmeier lmeier // meta.c: meta backend ("dynamic backend loader")
// This file is part of scanbuttond.
// Copyleft )c( 2005-2006 by Bernhard Stiftner
//
// 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., 675 Mass Ave, Cambridge, MA 02139, USA.
#include
#include
#include
#include
#include
#include
#include
#include "scanbuttond/common.h"
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "meta.h"
#define MAX_CONFIG_LINE 255
#define MAX_SCANNERS_PER_BACKEND 16
#define CONFIG_FILE "meta.conf"
static char* backend_name = "Dynamic Module Loader";
static char config_file[PATH_MAX] = "(null)";
static libusb_handle_t* libusb_handle;
static scanner_t* meta_scanners = NULL;
static backend_t* meta_backends = NULL;
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
void meta_attach_scanner(scanner_t* scanner, backend_t* backend)
{
scanner_t* dev = (scanner_t*)malloc(sizeof(scanner_t));
dev->vendor = scanner->vendor;
dev->product = scanner->product;
dev->connection = scanner->connection;
dev->internal_dev_ptr = scanner->internal_dev_ptr;
dev->sane_device = scanner->sane_device;
dev->meta_info = (void*)backend;
dev->lastbutton = scanner->lastbutton;
dev->num_buttons = scanner->num_buttons;
dev->is_open = scanner->is_open;
dev->next = meta_scanners;
meta_scanners = dev;
syslog(LOG_INFO, "meta-backend: attached scanner \"%s %s\"",
scanner->vendor, scanner->product);
}
static char *get_config_file(void)
{
#ifdef HAVE_SCANBTND_GET_LIB_DIR
snprintf(config_file, PATH_MAX, "%s/%s", scanbtnd_get_lib_dir(), CONFIG_FILE);
#else
snprintf(config_file, PATH_MAX, "%s/%s", SCANBUTTOND_LIB_DIR, CONFIG_FILE);
#endif
return config_file;
}
void meta_attach_scanners(scanner_t* devices, backend_t* backend)
{
scanner_t* dev = devices;
int count = 0;
while (dev != NULL) {
if (count >= MAX_SCANNERS_PER_BACKEND) {
syslog(LOG_WARNING, "meta-backend: refusing to attach scanner \"%s %s\": Too many scanners!",
dev->vendor, dev->product);
return;
}
meta_attach_scanner(dev, backend);
dev = dev->next;
count++;
}
}
void meta_detach_scanner(scanner_t* scanner, scanner_t* prev_scanner)
{
syslog(LOG_INFO, "meta-backend: detaching scanner: \"%s %s\"",
scanner->vendor, scanner->product);
if (prev_scanner != NULL)
prev_scanner->next = scanner->next;
else if (scanner == meta_scanners)
meta_scanners = scanner->next;
else
syslog(LOG_WARNING, "meta-backend: detach scanner: invalid arguments!");
free(scanner);
}
void meta_detach_scanners(void)
{
while (meta_scanners != NULL) {
meta_detach_scanner(meta_scanners, NULL);
}
}
int meta_attach_backend(backend_t* backend)
{
// don't load another meta backend
if (strcmp(backend->scanbtnd_get_backend_name(), scanbtnd_get_backend_name())==0) {
syslog(LOG_WARNING, "meta-backend: refusing to load another meta backend!");
return -1;
}
syslog(LOG_INFO, "meta-backend: attaching backend: %s",
backend->scanbtnd_get_backend_name());
backend->next = meta_backends;
meta_backends = backend;
backend->scanbtnd_init();
return 0;
}
void meta_detach_backend(backend_t* backend, backend_t* prev_backend)
{
if (prev_backend != NULL)
prev_backend->next = backend->next;
else if (backend == meta_backends)
meta_backends = backend->next;
else
syslog(LOG_WARNING, "meta-backend: detach backend: invalid arguments!");
backend->scanbtnd_exit();
scanbtnd_unload_backend(backend);
}
void meta_detach_backends(void)
{
while (meta_backends != NULL) {
meta_detach_backend(meta_backends, NULL);
}
}
backend_t* meta_lookup_backend(scanner_t* scanner)
{
return (backend_t*)scanner->meta_info;
}
void meta_strip_newline(char* str)
{
int len = strlen(str);
if (len == 0) return;
if (str[len-1] != '\n') return;
str[len-1] = 0;
}
int scanbtnd_init(void)
{
int error;
meta_scanners = NULL;
meta_backends = NULL;
syslog(LOG_INFO, "meta-backend: init");
error = scanbtnd_loader_init();
if (error != 0) {
syslog(LOG_ERR, "meta-backend: could not init module loader!");
return error;
}
libusb_handle = libusb_init();
if (!libusb_handle) {
syslog(LOG_ERR, "meta-backend: could not init libusb!");
scanbtnd_loader_exit();
return 1;
}
// read config file
char lib[MAX_CONFIG_LINE];
backend_t* backend;
FILE* f = fopen(get_config_file(), "r");
if (f == NULL) {
syslog(LOG_ERR, "meta-backend: config file \"%s\" not found.",
get_config_file());
return -1;
}
while (fgets(lib, MAX_CONFIG_LINE, f)) {
meta_strip_newline(lib);
if (strlen(lib)==0) continue;
/*
char* libpath = (char*)malloc(strlen(lib) + strlen(lib_dir) + 2);
strcpy(libpath, lib_dir);
strcat(libpath, "/");
strcat(libpath, lib);
backend = load_backend(libpath);
free(libpath);
*/
backend = scanbtnd_load_backend(lib);
if (backend == NULL) {
syslog(LOG_ERR, "meta-backend: could not load '%s'", lib);
} else if (meta_attach_backend(backend)==0) {
meta_attach_scanners(
backend->scanbtnd_get_supported_devices(),
backend);
}
}
fclose(f);
return 0;
}
int scanbtnd_rescan(void)
{
backend_t* backend;
meta_detach_scanners();
meta_scanners = NULL;
backend = meta_backends;
while (backend != NULL) {
backend->scanbtnd_rescan();
meta_attach_scanners(backend->scanbtnd_get_supported_devices(),
backend);
backend = backend->next;
}
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return meta_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0) {
return -ENODEV;
}
backend_t* backend = meta_lookup_backend(scanner);
if (backend == NULL) return -1;
return backend->scanbtnd_open(scanner);
}
int scanbtnd_close(scanner_t* scanner)
{
backend_t* backend = meta_lookup_backend(scanner);
if (backend == NULL) return -1;
return backend->scanbtnd_close(scanner);
}
int scanbtnd_get_button(scanner_t* scanner)
{
backend_t* backend = meta_lookup_backend(scanner);
if (backend == NULL) return 0;
return backend->scanbtnd_get_button(scanner);
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
backend_t* backend = meta_lookup_backend(scanner);
if (backend == NULL) return NULL;
return backend->scanbtnd_get_sane_device_descriptor(scanner);
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "meta-backend: exit");
meta_detach_scanners();
meta_detach_backends();
libusb_exit(libusb_handle);
scanbtnd_loader_exit();
return 0;
}
./1.5.1/src/scanbuttond/backends/meta.h 0000644 0001751 0001751 00000001722 13075613451 017166 0 ustar lmeier lmeier // meta.h: meta backend ("dynamic backend loader")
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __META_H_INCLUDED
#define __META_H_INCLUDED
#include "scanbuttond/backend.h"
#include "scanbuttond/loader.h"
#endif
./1.5.1/src/scanbuttond/backends/genesys.h 0000644 0001751 0001751 00000001717 13075613451 017721 0 ustar lmeier lmeier // plustek.h: Plustek device backend
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Hans Verkuil
// Copyleft )c( 2005 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __GENESYS_H_INCLUDED
#define __GENESYS_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/hp3500.c 0000644 0001751 0001751 00000017436 13075613451 017163 0 ustar lmeier lmeier // hp3500.c: RTS8801C2 chipset based devices backend
// This file is part of scanbuttond.
// Copyleft )c( 2008 by Jan Michaelis
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "hp3500.h"
static char* backend_name = "HP3500 USB";
#define NUM_SUPPORTED_USB_DEVICES 1
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x03f0, 0x2205, 3 } // HP ScanJet 3500C
//{ 0x03f0, 0x2005, 4 } // HP ScanJet 3530C
//{ 0x03f0, 0x2005, 4 } // HP ScanJet 3570C
};
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Hewlett-Packard", "ScanJet 3500C" }
//{ "Hewlett-Packard", "ScanJet 3530C" }
//{ "Hewlett-Packard", "Scanjet 3570C" }
};
/*
Notes for HP ScanJet 3530C and 3570C:
Since i've no information about the button status register on these devices,
i cannot implement them now, but i think that their structure of the status
register is mostly the same. Its address is 0xD0 too and there is just one
button more, which i'm expecting at bit 5. If you got one of this devices,
feel free to add some lines of code to finally support them.
*/
libusb_handle_t* libusb_handle;
scanner_t* hp3500_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int hp3500_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void hp3500_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "hp3500:libusb:";
int index = hp3500_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = hp3500_scanners;
hp3500_scanners = scanner;
}
void hp3500_detach_scanners(void)
{
scanner_t* next;
while (hp3500_scanners != NULL) {
next = hp3500_scanners->next;
free(hp3500_scanners->sane_device);
free(hp3500_scanners);
hp3500_scanners = next;
}
}
void hp3500_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = hp3500_match_libusb_scanner(device);
if (index >= 0)
hp3500_attach_libusb_scanner(device);
device = device->next;
}
}
int hp3500_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
hp3500_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
hp3500_scanners = NULL;
syslog(LOG_INFO, "hp3500-backend: init");
return hp3500_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t* devices;
hp3500_detach_scanners();
hp3500_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
hp3500_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return hp3500_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int hp3500_read(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_read((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
int hp3500_write(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_write((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
void hp3500_flush(scanner_t* scanner)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
libusb_flush((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
}
int scanbtnd_get_button(scanner_t* scanner)
{
#define BUFFER_SIZE 4
unsigned char bytes[BUFFER_SIZE];
int num_bytes;
bytes[0] = 0x80; //Command: "Read one or more registers"
bytes[1] = 0xD0; //The Register containing button status
bytes[2] = 0x00; //Count HH
bytes[3] = 0x01; //Count LL
/*
Very detailled informations about the "RTS8801C2" chip can be found at:
http://projects.troy.rollo.name/rt-scanners/chip.html
*/
if (!scanner->is_open)
return -EINVAL;
num_bytes = hp3500_write(scanner, (void*)bytes, 4);
if (num_bytes != 4) {
syslog(LOG_WARNING, "hp3500-backend: communication error: "
"write length:%d (expected:%d)", num_bytes, 4);
hp3500_flush(scanner);
return 0;
}
num_bytes = hp3500_read(scanner, (void*)bytes, 1);
if (num_bytes != 1) {
syslog(LOG_WARNING, "hp3500-backend: communication error: "
"read length:%d (expected:%d)", num_bytes, 1);
hp3500_flush(scanner);
return 0;
}
/*
If none button is pressed, register 0xD0 contains 0xFF.
One button is pressed when its bit is 0 in that register.
Current button state register 0xD0
Bit Bit value Button
0 0x01 Clear if transparency adapter (TA) is present
2 0x04 Copy
3 0x08 Scan
4 0x10 Mail
I decided to implement the following behaviour:
You can only press one button at one time (even if it would be possible to press more simultaneously).
If more than one button is pressed, this case its treated as if no button is pressed at all.
*/
bytes[0] = bytes[0] & 0x1C; //Ignore other bits that are not 2,3,4
if(bytes[0] == 0x18) //Copy pressed
return 1;
else if(bytes[0] == 0x14) //Scan pressed
return 2;
else if(bytes[0] == 0x0C) //Mail pressed
return 3;
return 0;
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "hp3500-backend: exit");
hp3500_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/artec_eplus48u.c 0000644 0001751 0001751 00000014632 13075613451 021106 0 ustar lmeier lmeier // artec_eplus48u.c : scanbuttond backend for Artec E+48U scanners
// This file is part of scanbuttond.
// Copyleft )c( 2006 by Joel Fuster
//
// Built primarily from "niash" scanbuttond backend.
// Scanner button interface details from SANE backend "artec_eplus48u"
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "artec_eplus48u.h"
static char* backend_name = "Artec E+48U USB";
#define NUM_SUPPORTED_USB_DEVICES 1
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x05d8, 0x4003, 4 } // Artec E+48u
};
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Artec", "E+48U"}
};
static libusb_handle_t* libusb_handle;
static scanner_t* artec_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int artec_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void artec_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "artec_eplus48u:libusb:";
int index = artec_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = artec_scanners;
artec_scanners = scanner;
}
void artec_detach_scanners(void)
{
scanner_t* next;
while (artec_scanners != NULL) {
next = artec_scanners->next;
free(artec_scanners->sane_device);
free(artec_scanners);
artec_scanners = next;
}
}
void artec_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = artec_match_libusb_scanner(device);
if (index >= 0)
artec_attach_libusb_scanner(device);
device = device->next;
}
}
int artec_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
artec_scan_devices(devices);
return 0;
}
int artec_control_msg(scanner_t* scanner, int requesttype, int request,
int value, int index, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_control_msg((libusb_device_t*)scanner->internal_dev_ptr,
requesttype, request, value, index, buffer,
bytecount);
break;
}
return -1;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
artec_scanners = NULL;
syslog(LOG_INFO, "artec_eplus48u-backend: init");
return artec_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t *devices;
artec_detach_scanners();
artec_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
artec_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return artec_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int scanbtnd_get_button(scanner_t* scanner)
{
unsigned char bytes[64];
int num_bytes;
const unsigned char request_packet[64] = {
0x74, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x74, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x74, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x74, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x74, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x74, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x74, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x74, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
};
if (!scanner->is_open)
return -EINVAL;
// Send request
num_bytes = artec_control_msg(scanner,
0x40, 0x01, 0x2012, 0x3f40, (void *)request_packet, 64);
if (num_bytes < 0) return 0;
// Get response
num_bytes = artec_control_msg(scanner,
0xc0, 0x01, 0x2013, 0x3f00, (void *)bytes, 64);
if (num_bytes < 0) return 0;
switch (bytes[2]) {
case 0x08: // scan
return 1;
case 0x02: // copy
return 2;
case 0x04: // ocr
return 3;
case 0x01: // email
return 4;
}
return 0;
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "artec_eplus48u-backend: exit");
artec_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/niash.c 0000644 0001751 0001751 00000016467 13075613451 017351 0 ustar lmeier lmeier // niash.c: Niash device backend
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Bernhard Stiftner
// Copyleft )c( 2005 by Dirk Wriedt
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "niash.h"
static char* backend_name = "Niash USB";
#define NUM_SUPPORTED_USB_DEVICES 5
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x06bd, 0x0100, 4 }, // Agfa Snapscan Touch
{ 0x03f0, 0x0205, 2 }, // HP Scanjet 3300c
{ 0x03f0, 0x0405, 3 }, // HP Scanjet 3400c
{ 0x03f0, 0x0305, 3 }, // HP Scanjet 4300c
{ 0x047b, 0x1002, 3 }, // HP Scanjet 4300c
};
// TODO: check if this backend really works on the Epson 2580 too...
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Agfa", "Snapscan Touch" },
{ "Hewlett-Packard", "Scanjet 3300c" },
{ "Hewlett-Packard", "Scanjet 3400c" },
{ "Hewlett-Packard", "Scanjet 4300c" },
{ "Hewlett-Packard", "Scanjet 4300c" }
};
static libusb_handle_t* libusb_handle;
static scanner_t* niash_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int niash_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
// TODO: check if the descriptor matches the SANE device name!
void niash_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "niash:libusb:";
int index = niash_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = niash_scanners;
niash_scanners = scanner;
}
void niash_detach_scanners(void)
{
scanner_t* next;
while (niash_scanners != NULL) {
next = niash_scanners->next;
free(niash_scanners->sane_device);
free(niash_scanners);
niash_scanners = next;
}
}
void niash_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = niash_match_libusb_scanner(device);
if (index >= 0)
niash_attach_libusb_scanner(device);
device = device->next;
}
}
int niash_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
niash_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
niash_scanners = NULL;
syslog(LOG_INFO, "niash-backend: init");
return niash_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t* devices;
niash_detach_scanners();
niash_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
niash_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return niash_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int niash_control_msg(scanner_t* scanner, int requesttype, int request,
int value, int index, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_control_msg((libusb_device_t*)scanner->internal_dev_ptr,
requesttype, request, value, index, buffer,
bytecount);
break;
}
return -1;
}
int scanbtnd_get_button(scanner_t* scanner)
{
unsigned char bytes[255];
int value[255];
int requesttype[255];
int num_bytes;
int button;
int i;
if (!scanner->is_open)
return -EINVAL;
/*
The button status seems to be held in Register 0x2e of the
scanner's USB - IEEE1284 bridge
I checked the usb sniffer logs against hp3300c_xfer.h (hp3300 sane backend)
and learned that the requests being submitted by the windows driver for
my Agfa Snapscan Touch seem to follow this schema:
request value data datasize
0x40 SPP_CONTROL (0x87) 0x14 1
0x40 EPP_ADDR (0x83) 0x2e 1
0x40 SPP_CONTROL (0x87) 0x34 1
0xc0 EPP_DATA_READ (0x84) returned 1
0x40 SPP_CONTROL (0x87) 0x14 1
The register can be read by setting the address with an EPP_ADDR call,
then issuing an EPP_DATA_READ call.
I don't know what the last request is for.
*/
requesttype[0]=0x40; bytes[0] = 0x14; value[0]=0x87; /* SPP_CONTROL */
requesttype[1]=0x40; bytes[1] = 0x2e; value[1]=0x83; /* EPP_ADDR */
requesttype[2]=0x40; bytes[2] = 0x34; value[2]=0x87; /* SPP_CONTROL */
requesttype[3]=0xc0; bytes[3] = 0xff; value[3]=0x84; /* EPP_DATA_READ */
requesttype[4]=0x40; bytes[4] = 0x14; value[4]=0x87; /* SPP_CONTROL */
for(i=0;i<5;i++) {
num_bytes=niash_control_msg(scanner, requesttype[i], 0x0c, value[i], 0, (void*)&bytes + i, 0x01);
if (num_bytes < 0 ) return 0;
}
switch (bytes[3]) {
case 0x02: button = 1; break;
case 0x04: button = 2; break;
case 0x08: button = 3; break;
case 0x10: button = 4; break;
default: button = 0; break;
};
return button;
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "niash-backend: exit");
niash_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/hp3900.c 0000644 0001751 0001751 00000015517 13075613451 017165 0 ustar lmeier lmeier // hp3900.c: RTS8822 & RTS8823 chipset based devices backend
// This file is part of scanbuttond.
// Copyleft )c( 2007 by Jonathan Bravo Lopez
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "hp3900.h"
static char* backend_name = "HP3900 USB";
#define NUM_SUPPORTED_USB_DEVICES 9
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x03f0, 0x2605, 3 }, // HP Scanjet 3800
{ 0x03f0, 0x2305, 4 }, // HP Scanjet 3970
{ 0x03f0, 0x2405, 4 }, // HP Scanjet 4070
{ 0x03f0, 0x4105, 4 }, // HP Scanjet 4370
{ 0x03f0, 0x2805, 3 }, // HP Scanjet G2710
{ 0x03f0, 0x4205, 4 }, // HP Scanjet G3010
{ 0x03f0, 0x4305, 4 }, // HP Scanjet G3110
{ 0x06dc, 0x0020, 4 }, // Umax Astra 4900/4950
{ 0x04a5, 0x2211, 3 } // BenQ 5550T
};
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Hewlett-Packard", "ScanJet 3800" },
{ "Hewlett-Packard", "ScanJet 3970" },
{ "Hewlett-Packard", "Scanjet 4070 Photosmart" },
{ "Hewlett-Packard", "Scanjet 4370" },
{ "Hewlett-Packard", "ScanJet G2710" },
{ "Hewlett-Packard", "Scanjet G3010" },
{ "Hewlett-Packard", "Scanjet G3110" },
{ "UMAX", "Astra 4900/4950" },
{ "BenQ", "5550T" }
};
libusb_handle_t* libusb_handle;
scanner_t* hp3900_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int hp3900_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void hp3900_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "hp3900:libusb:";
int index = hp3900_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = hp3900_scanners;
hp3900_scanners = scanner;
}
void hp3900_detach_scanners(void)
{
scanner_t* next;
while (hp3900_scanners != NULL) {
next = hp3900_scanners->next;
free(hp3900_scanners->sane_device);
free(hp3900_scanners);
hp3900_scanners = next;
}
}
void hp3900_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = hp3900_match_libusb_scanner(device);
if (index >= 0)
hp3900_attach_libusb_scanner(device);
device = device->next;
}
}
int hp3900_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
hp3900_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
hp3900_scanners = NULL;
syslog(LOG_INFO, "hp3900-backend: init");
return hp3900_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t* devices;
hp3900_detach_scanners();
hp3900_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
hp3900_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return hp3900_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int hp3900_read(scanner_t* scanner, void* buffer)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_control_msg((libusb_device_t*)scanner->internal_dev_ptr,
0xc0, 0x04, 0xe968, 0x0100, (void *)buffer, 0x0002);
break;
}
return -1;
}
void hp3900_flush(scanner_t* scanner)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
libusb_flush((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
}
int scanbtnd_get_button(scanner_t* scanner)
{
unsigned char bytes[2] = {};
int num_bytes = 0;
int button = 0;
int c = 0;
int mask = 0;
if (!scanner->is_open)
return -EINVAL;
/* Lets read RTS8822 register 0xe968 */
num_bytes = hp3900_read(scanner, bytes);
if (num_bytes != 2) {
syslog(LOG_WARNING, "hp3900-backend: communication error: "
"read length:%d (expected:%d)", num_bytes, 2);
hp3900_flush(scanner);
return 0;
}
/* If none button is pressed, register 0xe968 contains 0x3F.
RTS8822 seems to support 6 buttons and more than one button can be pressed
at the same time. One button is pressed when its bit is 0 in that register. */
mask = 1;
for (c = 0; c < scanner->num_buttons; c++) {
if ((bytes[0] & mask) == 0) {
button = c + 1;
break;
}
mask = mask << 1;
}
return button;
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "hp3900-backend: exit");
hp3900_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/hp5590.h 0000644 0001751 0001751 00000001701 13075613451 017167 0 ustar lmeier lmeier /* hp5590.c: HP4570/5550/5590/7650 backend
* This file is part of scanbuttond.
* Copyleft )c( 2008 by Ilia Sotnikov
*
* 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef __HP5590_H_INCLUDED
#define __HP5590_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/epson_vphoto.c 0000644 0001751 0001751 00000015153 13075613451 020761 0 ustar lmeier lmeier // epson_vphoto.c: Epson ESC/V device backend
// This file is part of scanbuttond.
// Copyleft )c( 2011 by Philipp Klaus, based on code from Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//
#include
#include
#include
#include
#include
#include
#include "scanbuttond/scanbuttond.h"
#include "scanbuttond/libusbi.h"
#include "epson_vphoto.h"
#define ESC 0x1B /* ASCII value for ESC */
static char* backend_name = "Epson VX00 Photo USB";
#define NUM_SUPPORTED_USB_DEVICES 3
static int supported_usb_devices[NUM_SUPPORTED_USB_DEVICES][3] = {
// vendor, product, num_buttons
{ 0x04B8, 0x012E, 4 }, // Epson Perfection V200
{ 0x04B8, 0x0119, 4 }, // Epson Perfection 4490
{ 0x04B8, 0x0133, 5 } // Epson GT-1500, buttons: 1=scan, 2=copy, 3=email, 4=pdf, 5=stop
};
static char* usb_device_descriptions[NUM_SUPPORTED_USB_DEVICES][2] = {
{ "Epson", "Perfection V200"},
{ "Epson", "Perfection 4490"},
{ "Epson", "GT-1500"}
};
static libusb_handle_t* libusb_handle;
static scanner_t* epsonvp_scanners = NULL;
// returns -1 if the scanner is unsupported, or the index of the
// corresponding vendor-product pair in the supported_usb_devices array.
int epsonvp_match_libusb_scanner(libusb_device_t* device)
{
int index;
for (index = 0; index < NUM_SUPPORTED_USB_DEVICES; index++) {
if (supported_usb_devices[index][0] == device->vendorID &&
supported_usb_devices[index][1] == device->productID) {
break;
}
}
if (index >= NUM_SUPPORTED_USB_DEVICES) return -1;
return index;
}
void epsonvp_attach_libusb_scanner(libusb_device_t* device)
{
const char* descriptor_prefix = "epkowa:interpreter:";
int index = epsonvp_match_libusb_scanner(device);
if (index < 0) return; // unsupported
scanner_t* scanner = (scanner_t*)malloc(sizeof(scanner_t));
scanner->vendor = usb_device_descriptions[index][0];
scanner->product = usb_device_descriptions[index][1];
scanner->connection = CONNECTION_LIBUSB;
scanner->internal_dev_ptr = (void*)device;
scanner->lastbutton = 0;
scanner->sane_device = (char*)malloc(strlen(device->location) +
strlen(descriptor_prefix) + 1);
strcpy(scanner->sane_device, descriptor_prefix);
strcat(scanner->sane_device, device->location);
scanner->num_buttons = supported_usb_devices[index][2];
scanner->is_open = 0;
scanner->next = epsonvp_scanners;
epsonvp_scanners = scanner;
}
void epsonvp_detach_scanners(void)
{
scanner_t* next;
while (epsonvp_scanners != NULL) {
next = epsonvp_scanners->next;
free(epsonvp_scanners->sane_device);
free(epsonvp_scanners);
epsonvp_scanners = next;
}
}
void epsonvp_scan_devices(libusb_device_t* devices)
{
int index;
libusb_device_t* device = devices;
while (device != NULL) {
index = epsonvp_match_libusb_scanner(device);
if (index >= 0)
epsonvp_attach_libusb_scanner(device);
device = device->next;
}
}
int epsonvp_init_libusb(void)
{
libusb_device_t* devices;
libusb_handle = libusb_init();
devices = libusb_get_devices(libusb_handle);
epsonvp_scan_devices(devices);
return 0;
}
const char* scanbtnd_get_backend_name(void)
{
return backend_name;
}
int scanbtnd_init(void)
{
epsonvp_scanners = NULL;
syslog(LOG_INFO, "epson-vphoto-backend: init");
return epsonvp_init_libusb();
}
int scanbtnd_rescan(void)
{
libusb_device_t *devices;
epsonvp_detach_scanners();
epsonvp_scanners = NULL;
libusb_rescan(libusb_handle);
devices = libusb_get_devices(libusb_handle);
epsonvp_scan_devices(devices);
return 0;
}
const scanner_t* scanbtnd_get_supported_devices(void)
{
return epsonvp_scanners;
}
int scanbtnd_open(scanner_t* scanner)
{
int result = -ENOSYS;
if (scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
// if devices have been added/removed, return -ENODEV to
// make scanbuttond update its device list
if (libusb_get_changed_device_count() != 0)
return -ENODEV;
result = libusb_open((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 1;
return result;
}
int scanbtnd_close(scanner_t* scanner)
{
int result = -ENOSYS;
if (!scanner->is_open)
return -EINVAL;
switch (scanner->connection) {
case CONNECTION_LIBUSB:
result = libusb_close((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
if (result == 0)
scanner->is_open = 0;
return result;
}
int epsonvp_read(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_read((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
int epsonvp_write(scanner_t* scanner, void* buffer, int bytecount)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
return libusb_write((libusb_device_t*)scanner->internal_dev_ptr,
buffer, bytecount);
break;
}
return -1;
}
void epsonvp_flush(scanner_t* scanner)
{
switch (scanner->connection) {
case CONNECTION_LIBUSB:
libusb_flush((libusb_device_t*)scanner->internal_dev_ptr);
break;
}
}
int scanbtnd_get_button(scanner_t* scanner)
{
#define BUFFER_SIZE 16
unsigned char bytes[BUFFER_SIZE];
//int rcv_len;
int num_bytes;
if (!scanner->is_open)
return -EINVAL;
bytes[0] = 0x1E;
bytes[1] = 0x85;
bytes[2] = '\0';
num_bytes = epsonvp_write(scanner, (void*)bytes, 2);
if (num_bytes != 2) {
syslog(LOG_WARNING, "epson-vphoto-backend: communication error: "
"write length:%d (expected:%d)", num_bytes, 2);
epsonvp_flush(scanner);
return 0;
}
num_bytes = epsonvp_read(scanner, (void*)bytes, 1);
if (num_bytes != 1) {
syslog(LOG_WARNING, "epson-vphoto-backend: communication error: "
"read length:%d (expected:%d)", num_bytes, 1);
epsonvp_flush(scanner);
return 0;
}
return bytes[0];
}
const char* scanbtnd_get_sane_device_descriptor(scanner_t* scanner)
{
return scanner->sane_device;
}
int scanbtnd_exit(void)
{
syslog(LOG_INFO, "epson-vphoto-backend: exit");
epsonvp_detach_scanners();
libusb_exit(libusb_handle);
return 0;
}
./1.5.1/src/scanbuttond/backends/mustek.h 0000644 0001751 0001751 00000001677 13075613451 017561 0 ustar lmeier lmeier // mustek.h : scanbuttond backend for mustek/gt68xx devices
// This file is part of scanbuttond.
// Copyleft )c( 2006 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __MUSTEK_H_INCLUDED
#define __MUSTEK_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/backends/niash.h 0000644 0001751 0001751 00000001753 13075613451 017346 0 ustar lmeier lmeier // niash.h: Niash device backend
// This file is part of scanbuttond.
// This file is part of scanbuttond.
// Copyleft )c( 2005 by Bernhard Stiftner
// Copyleft )c( 2005 by Dirk Wriedt
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#ifndef __NIASH_H_INCLUDED
#define __NIASH_H_INCLUDED
#include "scanbuttond/backend.h"
#endif
./1.5.1/src/scanbuttond/interface/ 0000755 0001751 0001751 00000000000 13075613451 016253 5 ustar lmeier lmeier ./1.5.1/src/scanbuttond/interface/Makefile.in 0000644 0001751 0001751 00000043756 13075613451 020337 0 ustar lmeier lmeier # Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
# Copyright (C) 1994-2014 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@
am__is_gnu_make = { \
if test -z '$(MAKELEVEL)'; then \
false; \
elif test -n '$(MAKE_HOST)'; then \
true; \
elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
true; \
else \
false; \
fi; \
}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
*) echo "am__make_running_with_option: internal error: invalid" \
"target option '$${target_option-}' specified" >&2; \
exit 1;; \
esac; \
has_opt=no; \
sane_makeflags=$$MAKEFLAGS; \
if $(am__is_gnu_make); then \
sane_makeflags=$$MFLAGS; \
else \
case $$MAKEFLAGS in \
*\\[\ \ ]*) \
bs=\\; \
sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
| sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
esac; \
fi; \
skip_next=no; \
strip_trailopt () \
{ \
flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
}; \
for flg in $$sane_makeflags; do \
test $$skip_next = yes && { skip_next=no; continue; }; \
case $$flg in \
*=*|--*) continue;; \
-*I) strip_trailopt 'I'; skip_next=yes;; \
-*I?*) strip_trailopt 'I';; \
-*O) strip_trailopt 'O'; skip_next=yes;; \
-*O?*) strip_trailopt 'O';; \
-*l) strip_trailopt 'l'; skip_next=yes;; \
-*l?*) strip_trailopt 'l';; \
-[dEDm]) skip_next=yes;; \
-[JT]) skip_next=yes;; \
esac; \
case $$flg in \
*$$target_option*) has_opt=yes; break;; \
esac; \
done; \
test $$has_opt = yes
am__make_dryrun = (target_option=n; $(am__make_running_with_option))
am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
pkglibexecdir = $(libexecdir)/@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@
subdir = src/scanbuttond/interface
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_CLEAN_FILES =
CONFIG_CLEAN_VPATH_FILES =
LIBRARIES = $(noinst_LIBRARIES)
ARFLAGS = cru
AM_V_AR = $(am__v_AR_@AM_V@)
am__v_AR_ = $(am__v_AR_@AM_DEFAULT_V@)
am__v_AR_0 = @echo " AR " $@;
am__v_AR_1 =
libusbi_a_AR = $(AR) $(ARFLAGS)
libusbi_a_LIBADD =
am_libusbi_a_OBJECTS = libusbi.$(OBJEXT)
libusbi_a_OBJECTS = $(am_libusbi_a_OBJECTS)
AM_V_P = $(am__v_P_@AM_V@)
am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
am__v_P_0 = false
am__v_P_1 = :
AM_V_GEN = $(am__v_GEN_@AM_V@)
am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
am__v_GEN_0 = @echo " GEN " $@;
am__v_GEN_1 =
AM_V_at = $(am__v_at_@AM_V@)
am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
am__v_at_0 = @
am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
AM_V_lt = $(am__v_lt_@AM_V@)
am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
am__v_lt_0 = --silent
am__v_lt_1 =
LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
$(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
$(AM_CFLAGS) $(CFLAGS)
AM_V_CC = $(am__v_CC_@AM_V@)
am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
am__v_CC_0 = @echo " CC " $@;
am__v_CC_1 =
CCLD = $(CC)
LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(AM_LDFLAGS) $(LDFLAGS) -o $@
AM_V_CCLD = $(am__v_CCLD_@AM_V@)
am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
am__v_CCLD_0 = @echo " CCLD " $@;
am__v_CCLD_1 =
SOURCES = $(libusbi_a_SOURCES)
DIST_SOURCES = $(libusbi_a_SOURCES)
am__can_run_installinfo = \
case $$AM_UPDATE_INFO_DIR in \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
# Read a list of newline-separated strings from the standard input,
# and print each of them once, without duplicates. Input order is
# *not* preserved.
am__uniquify_input = $(AWK) '\
BEGIN { nonempty = 0; } \
{ items[$$0] = 1; nonempty = 1; } \
END { if (nonempty) { for (i in items) print i; }; } \
'
# Make sure the list of sources is unique. This is necessary because,
# e.g., the same source file might be shared among _SOURCES variables
# for different programs/libraries.
am__define_uniq_tagged_files = \
list='$(am__tagged_files)'; \
unique=`for i in $$list; do \
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
AWK = @AWK@
CC = @CC@
CCDEPMODE = @CCDEPMODE@
CFLAGS = @CFLAGS@
CONFUSE_CFLAGS = @CONFUSE_CFLAGS@
CONFUSE_LIBS = @CONFUSE_LIBS@
CPP = @CPP@
CPPFLAGS = @CPPFLAGS@
CXX = @CXX@
CXXCPP = @CXXCPP@
CXXDEPMODE = @CXXDEPMODE@
CXXFLAGS = @CXXFLAGS@
CYGPATH_W = @CYGPATH_W@
DBUS_CFLAGS = @DBUS_CFLAGS@
DBUS_LIBS = @DBUS_LIBS@
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@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
FGREP = @FGREP@
GREP = @GREP@
HAL_CFLAGS = @HAL_CFLAGS@
HAL_LIBS = @HAL_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@
LIBOBJS = @LIBOBJS@
LIBS = @LIBS@
LIBTOOL = @LIBTOOL@
LIBUSB_CFLAGS = @LIBUSB_CFLAGS@
LIBUSB_LIBS = @LIBUSB_LIBS@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
OBJDUMP = @OBJDUMP@
OBJEXT = @OBJEXT@
OS_CFLAGS = @OS_CFLAGS@
OS_CPPFLAGS = @OS_CPPFLAGS@
OTOOL = @OTOOL@
OTOOL64 = @OTOOL64@
PACKAGE = @PACKAGE@
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
PACKAGE_NAME = @PACKAGE_NAME@
PACKAGE_STRING = @PACKAGE_STRING@
PACKAGE_TARNAME = @PACKAGE_TARNAME@
PACKAGE_URL = @PACKAGE_URL@
PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
RANLIB = @RANLIB@
SANED_PATH = @SANED_PATH@
SANE_CFLAGS = @SANE_CFLAGS@
SANE_CONFIG = @SANE_CONFIG@
SANE_LIBS = @SANE_LIBS@
SCANBD_CFG_DIR = @SCANBD_CFG_DIR@
SCANBD_GROUP = @SCANBD_GROUP@
SCANBD_USER = @SCANBD_USER@
SCANBUTTOND_LIB_DIR = @SCANBUTTOND_LIB_DIR@
SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
STRIP = @STRIP@
UDEV_CFLAGS = @UDEV_CFLAGS@
UDEV_LIBS = @UDEV_LIBS@
VERSION = @VERSION@
abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
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@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
sysconfdir = @sysconfdir@
systemdsystemunitdir = @systemdsystemunitdir@
target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
noinst_LIBRARIES = libusbi.a
libusbi_a_SOURCES = libusbi.c
AM_CFLAGS = \
$(OS_CFLAGS) \
$(OS_CPPFLAGS) \
$(LIBUSB_CFLAGS) \
$(EXTRA_CFLAGS) \
-Dsyslog=slog \
-DLOG_INFO=SLOG_INFO \
-DLOG_WARNING=SLOG_WARN \
-I../include
EXTRA_DIST = \
Makefile.simple
all: all-am
.SUFFIXES:
.SUFFIXES: .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
&& { if test -f $@; then exit 0; else break; fi; }; \
exit 1;; \
esac; \
done; \
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/scanbuttond/interface/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --foreign src/scanbuttond/interface/Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
*) \
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
$(am__aclocal_m4_deps):
clean-noinstLIBRARIES:
-test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
libusbi.a: $(libusbi_a_OBJECTS) $(libusbi_a_DEPENDENCIES) $(EXTRA_libusbi_a_DEPENDENCIES)
$(AM_V_at)-rm -f libusbi.a
$(AM_V_AR)$(libusbi_a_AR) libusbi.a $(libusbi_a_OBJECTS) $(libusbi_a_LIBADD)
$(AM_V_at)$(RANLIB) libusbi.a
mostlyclean-compile:
-rm -f *.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libusbi.Po@am__quote@
.c.o:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
@am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
mostlyclean-libtool:
-rm -f *.lo
clean-libtool:
-rm -rf .libs _libs
ID: $(am__tagged_files)
$(am__define_uniq_tagged_files); mkid -fID $$unique
tags: tags-am
TAGS: tags
tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
$(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
if test $$# -gt 0; then \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
"$$@" $$unique; \
else \
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
$$unique; \
fi; \
fi
ctags: ctags-am
CTAGS: ctags
ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
$(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
cscopelist: cscopelist-am
cscopelist-am: $(am__tagged_files)
list='$(am__tagged_files)'; \
case "$(srcdir)" in \
[\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
*) sdir=$(subdir)/$(srcdir) ;; \
esac; \
for i in $$list; do \
if test -f "$$i"; then \
echo "$(subdir)/$$i"; \
else \
echo "$$sdir/$$i"; \
fi; \
done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
distdir: $(DISTFILES)
@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 "$(distdir)/$$file"; then \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
fi; \
cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
else \
test -f "$(distdir)/$$file" \
|| cp -p $$d/$$file "$(distdir)/$$file" \
|| exit 1; \
fi; \
done
check-am: all-am
check: check-am
all-am: Makefile $(LIBRARIES)
installdirs:
install: 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:
if test -z '$(STRIP)'; then \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
install; \
else \
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
"INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
fi
mostlyclean-generic:
clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@echo "it deletes files that may require special tools to rebuild."
clean: clean-am
clean-am: clean-generic clean-libtool clean-noinstLIBRARIES \
mostlyclean-am
distclean: distclean-am
-rm -rf ./$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-tags
dvi: dvi-am
dvi-am:
html: html-am
html-am:
info: info-am
info-am:
install-data-am:
install-dvi: install-dvi-am
install-dvi-am:
install-exec-am:
install-html: install-html-am
install-html-am:
install-info: install-info-am
install-info-am:
install-man:
install-pdf: install-pdf-am
install-pdf-am:
install-ps: install-ps-am
install-ps-am:
installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -rf ./$(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:
.MAKE: install-am install-strip
.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
clean-libtool clean-noinstLIBRARIES cscopelist-am ctags \
ctags-am distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-dvi install-dvi-am install-exec \
install-exec-am install-html install-html-am install-info \
install-info-am install-man install-pdf install-pdf-am \
install-ps install-ps-am install-strip installcheck \
installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags tags-am uninstall uninstall-am
.PRECIOUS: Makefile
# 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:
./1.5.1/src/scanbuttond/interface/libusbi.c 0000644 0001751 0001751 00000021735 13075613451 020060 0 ustar lmeier lmeier // libusbi.h: libusb wrapper
// This file is part of scanbuttond.
// Copyleft )c( 2004-2006 by Bernhard Stiftner
//
// 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include
#include
#include
#include
#include
#include
#ifdef HAVE_LINUX_LIMITS_H
#include
#endif
#include
#include
#include "scanbuttond/libusbi.h"
#define TIMEOUT 10 * 1000 /* 10 seconds */
int invocation_count = 0;
libusb_handle_t* libusb_init(void)
{
libusb_handle_t* handle;
invocation_count++;
if (invocation_count == 1) {
syslog(LOG_INFO, "libusbi: initializing...");
usb_init();
}
handle = (libusb_handle_t*)malloc(sizeof(libusb_handle_t));
handle->devices = NULL;
libusb_rescan(handle);
return handle;
}
static int libusb_search_interface(struct usb_device* device)
{
int found = 0;
int interface;
for (interface = 0; interface < device->config[0].bNumInterfaces && !found; interface++) {
switch (device->descriptor.bDeviceClass) {
case USB_CLASS_VENDOR_SPEC:
found = 1;
break;
case USB_CLASS_PER_INTERFACE:
switch (device->config[0].interface[interface].altsetting[0].bInterfaceClass) {
case USB_CLASS_VENDOR_SPEC:
case USB_CLASS_PER_INTERFACE:
case 16: /* data? */
found = 1;
break;
}
break;
}
}
interface--;
if (!found) return -1;
return interface;
}
static int libusb_search_in_endpoint(struct usb_device* device)
{
int usb_in_ep = 0;
int usb_out_ep = 0;
struct usb_interface_descriptor *interface;
interface = &device->config[0].interface->altsetting[0];
int num;
for (num = 0; num < interface->bNumEndpoints; num++) {
struct usb_endpoint_descriptor *endpoint;
int address, direction, transfer_type;
endpoint = &interface->endpoint[num];
address = endpoint->bEndpointAddress & USB_ENDPOINT_ADDRESS_MASK;
(void) address;
direction = endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK;
transfer_type = endpoint->bmAttributes & USB_ENDPOINT_TYPE_MASK;
if (transfer_type == USB_ENDPOINT_TYPE_BULK) {
if (direction) { /* in */
if (!usb_in_ep)
usb_in_ep = endpoint->bEndpointAddress;
} else { /* out */
if (!usb_out_ep)
usb_out_ep = endpoint->bEndpointAddress;
}
}
}
return usb_in_ep;
}
static int libusb_search_out_endpoint(struct usb_device* device)
{
int usb_in_ep = 0;
int usb_out_ep = 0;
struct usb_interface_descriptor *interface;
interface = &device->config[0].interface->altsetting[0];
int num;
for (num = 0; num < interface->bNumEndpoints; num++) {
struct usb_endpoint_descriptor *endpoint;
int address, direction, transfer_type;
endpoint = &interface->endpoint[num];
address = endpoint->bEndpointAddress & USB_ENDPOINT_ADDRESS_MASK;
(void) address;
direction = endpoint->bEndpointAddress & USB_ENDPOINT_DIR_MASK;
transfer_type = endpoint->bmAttributes & USB_ENDPOINT_TYPE_MASK;
if (transfer_type == USB_ENDPOINT_TYPE_BULK) {
if (direction) { /* in */
if (!usb_in_ep)
usb_in_ep = endpoint->bEndpointAddress;
} else { /* out */
if (!usb_out_ep)
usb_out_ep = endpoint->bEndpointAddress;
}
}
}
return usb_out_ep;
}
static void libusb_attach_device(struct usb_device* device, libusb_handle_t* handle)
{
libusb_device_t* libusb_device = (libusb_device_t*)malloc(sizeof(libusb_device_t));
libusb_device->vendorID = device->descriptor.idVendor;
libusb_device->productID = device->descriptor.idProduct;
// the location string consists of bus number, followed by a colon (":"), and the device number
libusb_device->location = (char*)malloc(strlen(device->bus->dirname) + strlen(device->filename) + 2);
strcpy(libusb_device->location, device->bus->dirname);
strcat(libusb_device->location, ":");
strcat(libusb_device->location, device->filename);
libusb_device->device = device;
libusb_device->handle = NULL;
libusb_device->interface = libusb_search_interface(device);
if (libusb_device->interface < 0) {
free(libusb_device->location);
free(libusb_device);
return;
}
libusb_device->out_endpoint = libusb_search_out_endpoint(device);
if (libusb_device->out_endpoint < 0) {
free(libusb_device->location);
free(libusb_device);
return;
}
libusb_device->in_endpoint = libusb_search_in_endpoint(device);
if (libusb_device->in_endpoint < 0) {
free(libusb_device->location);
free(libusb_device);
return;
}
libusb_device->next = handle->devices;
handle->devices = libusb_device;
}
static void libusb_detach_devices(libusb_handle_t* handle)
{
libusb_device_t* next;
while (handle->devices != NULL) {
next = handle->devices->next;
free(handle->devices->location);
free(handle->devices);
handle->devices = next;
}
}
void libusb_rescan(libusb_handle_t* handle)
{
struct usb_bus *bus;
struct usb_device *device;
libusb_detach_devices(handle);
usb_find_busses();
usb_find_devices();
handle->devices = NULL;
bus = usb_busses;
while (bus != NULL) {
device = bus->devices;
while (device != NULL) {
libusb_attach_device(device, handle);
device = device->next;
}
bus = bus->next;
}
}
int libusb_get_changed_device_count(void)
{
usb_find_busses();
return usb_find_devices();
}
libusb_device_t* libusb_get_devices(libusb_handle_t* handle)
{
return handle->devices;
}
int libusb_open(libusb_device_t* device)
{
int result;
if (!device || !device->device)
return -ENODEV;
device->handle = usb_open(device->device);
if (device->handle == NULL) {
syslog(LOG_ERR, "libusbi: could not open device %s", device->location);
return -ENODEV;
}
// Calling usb_set_configuration should not be necessary.
// It is even considered harmful, since it may disturb other processes
// which are currently communicating with the scanner!
//
// usb_set_configuration(device->handle,
// usb_device(device->handle)->config[0].bConfigurationValue);
result = usb_claim_interface(device->handle, device->interface);
switch (result) {
case 0:
return 0;
case -ENOMEM:
syslog(LOG_ERR, "libusbi: could not claim interface for device %s. (ENOMEM)",
device->location);
usb_close(device->handle);
return -ENODEV;
case -EBUSY:
syslog(LOG_ERR, "libusbi: could not claim interface for device %s. (EBUSY)",
device->location);
usb_close(device->handle);
return -EBUSY;
default:
syslog(LOG_ERR, "libusbi: could not claim interface for device %s. (code=%d)",
device->location, result);
usb_close(device->handle);
return -ENODEV;
}
}
int libusb_close(libusb_device_t* device)
{
int result;
result = usb_release_interface(device->handle, device->interface);
if (result < 0) {
syslog(LOG_ERR, "libusbi: could not release interface, error code=%d, device=%s",
result, device->location);
return result;
}
result = usb_close(device->handle);
if (result < 0) {
syslog(LOG_ERR, "libusbi: could not close usb device, error code=%d, device=%s",
result, device->location);
return result;
}
return 0;
}
int libusb_read(libusb_device_t* device, void* buffer, int bytecount)
{
int num_bytes = usb_bulk_read(device->handle, device->in_endpoint,
buffer, bytecount, TIMEOUT);
if (num_bytes<0) {
usb_clear_halt(device->handle, device->in_endpoint);
return 0;
}
return num_bytes;
}
int libusb_write(libusb_device_t* device, void* buffer, int bytecount)
{
int num_bytes = usb_bulk_write(device->handle, device->out_endpoint,
buffer, bytecount, TIMEOUT);
if (num_bytes<0) {
usb_clear_halt(device->handle, device->in_endpoint);
return 0;
}
return num_bytes;
}
void libusb_flush(libusb_device_t* device)
{
char buffer[16];
while (usb_bulk_read(device->handle, device->in_endpoint, buffer, 16, 500) > 0) {};
}
int libusb_control_msg(libusb_device_t* device, int requesttype, int request,
int value, int index, void* bytes, int size)
{
int num_bytes = usb_control_msg(device->handle, requesttype, request, value,
index, bytes, size, TIMEOUT);
if (num_bytes<0) {
// Doesn't seem to be needed... (bs, Jun 07 2005)
// usb_clear_halt(device->handle, device->in_endpoint);
return 0;
}
return num_bytes;
}
void libusb_exit(libusb_handle_t* handle)
{
invocation_count--;
if (invocation_count < 0) {
syslog(LOG_WARNING, "libusbi: libusb_exit called more often than libusb_init!!!");
}
libusb_detach_devices(handle);
free(handle);
if (invocation_count == 0) {
syslog(LOG_INFO, "libusbi: shutting down...");
}
}
./1.5.1/src/scanbuttond/interface/Makefile.am 0000644 0001751 0001751 00000000406 13075613451 020307 0 ustar lmeier lmeier noinst_LIBRARIES = libusbi.a
libusbi_a_SOURCES = libusbi.c
AM_CFLAGS = \
$(OS_CFLAGS) \
$(OS_CPPFLAGS) \
$(LIBUSB_CFLAGS) \
$(EXTRA_CFLAGS) \
-Dsyslog=slog \
-DLOG_INFO=SLOG_INFO \
-DLOG_WARNING=SLOG_WARN \
-I../include
EXTRA_DIST = \
Makefile.simple
./1.5.1/src/scanbuttond/interface/Makefile.simple 0000644 0001751 0001751 00000002131 13075613451 021200 0 ustar lmeier lmeier #
# $Id: Makefile.simple 218 2016-02-19 18:48:21Z wimalopaan $
#
# scanbd - KMUX scanner button daemon
#
# Copyright (C) 2008 - 2016 Wilhelm Meier (wilhelm.meier@fh-kl.de)
#
# 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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
include ../../../Makefile.include
CFLAGS += -Wall -Wextra -std=c99 -g
CPPFLAGS += -I../include -Dsyslog=slog -DLOG_INFO=SLOG_INFO -DLOG_WARNING=SLOG_WARN
all: libusbi.o
libusbi.o: libusbi.c
clean:
$(RM) *.o *~
./1.5.1/config.sub 0000755 0001751 0001751 00000105301 13075613451 013163 0 ustar lmeier lmeier #! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2013 Free Software Foundation, Inc.
timestamp='2013-04-24'
# 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 3 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, see .
#
# 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 Exception is an additional permission under section 7
# of the GNU General Public License, version 3 ("GPLv3").
# Please send patches with a ChangeLog entry to config-patches@gnu.org.
#
# 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.
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
# 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 1992-2013 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-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | 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/'`
;;
android-linux)
os=-linux-android
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
;;
*)
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 | -microblaze*)
os=
basic_machine=$1
;;
-bluegene*)
os=-cnk
;;
-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*178)
os=-lynxos178
;;
-lynx*5)
os=-lynxos5
;;
-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 \
| aarch64 | aarch64_be \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| am33_2.0 \
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| be32 | be64 \
| bfin \
| c4x | clipper \
| d10v | d30v | dlx | dsp16xx \
| epiphany \
| fido | fr30 | frv \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
| i370 | i860 | i960 | ia64 \
| ip2k | iq2000 \
| le32 | le64 \
| lm32 \
| m32c | m32r | m32rle | m68000 | m68k | m88k \
| maxq | mb | microblaze | microblazeel | 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 \
| mipsr5900 | mipsr5900el \
| mipstx39 | mipstx39el \
| mn10200 | mn10300 \
| moxie \
| mt \
| msp430 \
| nds32 | nds32le | nds32be \
| nios | nios2 | nios2eb | nios2el \
| ns16k | ns32k \
| open8 \
| or1k | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pyramid \
| rl78 | rx \
| 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 \
| tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
basic_machine=$basic_machine-unknown
;;
c54x)
basic_machine=tic54x-unknown
;;
c55x)
basic_machine=tic55x-unknown
;;
c6x)
basic_machine=tic6x-unknown
;;
m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
;;
ms1)
basic_machine=mt-unknown
;;
strongarm | thumb | xscale)
basic_machine=arm-unknown
;;
xgate)
basic_machine=$basic_machine-unknown
os=-none
;;
xscaleeb)
basic_machine=armeb-unknown
;;
xscaleel)
basic_machine=armel-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-* \
| aarch64-* | aarch64_be-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
| 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-* \
| hexagon-* \
| i*86-* | i860-* | i960-* | ia64-* \
| ip2k-* | iq2000-* \
| le32-* | le64-* \
| lm32-* \
| m32c-* | m32r-* | m32rle-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
| microblaze-* | microblazeel-* \
| 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-* \
| mipsr5900-* | mipsr5900el-* \
| mipstx39-* | mipstx39el-* \
| mmix-* \
| mt-* \
| msp430-* \
| nds32-* | nds32le-* | nds32be-* \
| nios-* | nios2-* | nios2eb-* | nios2el-* \
| none-* | np1-* | ns16k-* | ns32k-* \
| open8-* \
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pyramid-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| 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-* | sv1-* | sx?-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
| tron-* \
| ubicom32-* \
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| 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
;;
bluegene*)
basic_machine=powerpc-ibm
os=-cnk
;;
c54x-*)
basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c55x-*)
basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
c6x-*)
basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
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 | 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*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
;;
microblaze*)
basic_machine=microblaze-xilinx
;;
mingw64)
basic_machine=x86_64-pc
os=-mingw64
;;
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
;;
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-/'`
;;
msys)
basic_machine=i386-pc
os=-msys
;;
mvs)
basic_machine=i370-ibm
os=-mvs
;;
nacl)
basic_machine=le32-unknown
os=-nacl
;;
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
;;
neo-tandem)
basic_machine=neo-tandem
;;
nse-tandem)
basic_machine=nse-tandem
;;
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 | ppcbe) basic_machine=powerpc-unknown
;;
ppc-* | ppcbe-*)
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 | rdos64)
basic_machine=x86_64-pc
os=-rdos
;;
rdos32)
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
;;
strongarm-* | thumb-*)
basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
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
;;
tile*)
basic_machine=$basic_machine-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
;;
xscale-* | xscalee[bl]-*)
basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'`
;;
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.
-auroraux)
os=-auroraux
;;
-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* | -cnk* | -sunos | -sunos[34]*\
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -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* \
| -bitrig* | -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* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -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* | -es*)
# 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
;;
-zvmoe)
os=-zvmoe
;;
-dicos*)
os=-dicos
;;
-nacl*)
;;
-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
;;
hexagon-*)
os=-elf
;;
tic54x-*)
os=-coff
;;
tic55x-*)
os=-coff
;;
tic6x-*)
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
;;
m68*-cisco)
os=-aout
;;
mep-*)
os=-elf
;;
mips*-cisco)
os=-elf
;;
mips*-*)
os=-elf
;;
or1k-*)
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
;;
-cnk*|-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:
./1.5.1/configure 0000755 0001751 0001751 00002334425 13075613451 013124 0 ustar lmeier lmeier #! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for scanbd 1.92.
#
# Report bugs to .
#
#
# Copyright (C) 1992-1996, 1998-2012 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
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
# Prefer a ksh shell builtin over an external printf program on Solaris,
# but without wasting forks for bash or zsh.
if test -z "$BASH_VERSION$ZSH_VERSION" \
&& (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
as_echo='print -r --'
as_echo_n='print -rn --'
elif (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
# 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.
as_myself=
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
fi
# Unset variables that we do not need and which cause bugs (e.g. in
# pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1"
# suppresses any "Segmentation fault" message there. '((' could
# trigger a bug in pdksh 5.2.14.
for as_var in BASH_ENV ENV MAIL MAILPATH
do eval test x\${$as_var+set} = xset \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
PS1='$ '
PS2='> '
PS4='+ '
# NLS nuisances.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# CDPATH.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
# Use a proper internal environment variable to ensure we don't fall
# into an infinite loop, continuously re-executing ourselves.
if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then
_as_can_reexec=no; export _as_can_reexec;
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
as_fn_exit 255
fi
# We don't want this to propagate to other subprocesses.
{ _as_can_reexec=; unset _as_can_reexec;}
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="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_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
else
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
PATH=/empty FPATH=/empty; export PATH FPATH
test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
|| test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
if (eval "$as_required") 2>/dev/null; then :
as_have_required=yes
else
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
else
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir/$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
CONFIG_SHELL=$as_shell as_have_required=yes
if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
break 2
fi
fi
done;;
esac
as_found=false
done
$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
{ $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi; }
IFS=$as_save_IFS
if test "x$CONFIG_SHELL" != x; then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
if test x$as_have_required = xno; then :
$as_echo "$0: This script requires a shell more modern than all"
$as_echo "$0: the shells that I found on your system."
if test x${ZSH_VERSION+set} = xset ; then
$as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
$as_echo "$0: be upgraded to zsh 4.3.4 or later."
else
$as_echo "$0: Please tell bug-autoconf@gnu.org and
$0: wilhelm.meier@fh-kl.de about your system, including any
$0: error possibly output before this message. Then install
$0: a modern shell, or manually run the script under such a
$0: shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
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_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
$as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
$as_echo "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
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
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
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'`
# 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_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# 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; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# 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
}
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
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 -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
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='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# 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'"
SHELL=${CONFIG_SHELL-/bin/sh}
test -n "$DJDIR" || exec 7<&0 &1
# Name of the host.
# hostname on some systems (SVR3.2, old GNU/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=
# Identity of this package.
PACKAGE_NAME='scanbd'
PACKAGE_TARNAME='scanbd'
PACKAGE_VERSION='1.92'
PACKAGE_STRING='scanbd 1.92'
PACKAGE_BUGREPORT='wilhelm.meier@fh-kl.de'
PACKAGE_URL=''
ac_unique_file="src/scanbd/scanbd.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='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
EXTRA_CFLAGS
OS_CPPFLAGS
OS_CFLAGS
USE_SCANBUTTOND_FALSE
USE_SCANBUTTOND_TRUE
USE_SANE_FALSE
USE_SANE_TRUE
SCANBD_GROUP
SCANBD_USER
SANE_CONFIG
SANE_LIBS
SANE_CFLAGS
LIBUSB_LIBS
LIBUSB_CFLAGS
HAVE_SYSTEMD_FALSE
HAVE_SYSTEMD_TRUE
systemdsystemunitdir
SCANBUTTOND_LIB_DIR
SCANBD_CFG_DIR
UDEV_LIBS
UDEV_CFLAGS
HAL_LIBS
HAL_CFLAGS
DBUS_LIBS
DBUS_CFLAGS
CONFUSE_LIBS
CONFUSE_CFLAGS
PKG_CONFIG_LIBDIR
PKG_CONFIG_PATH
PKG_CONFIG
LIBOBJS
SANED_PATH
CXXCPP
am__fastdepCXX_FALSE
am__fastdepCXX_TRUE
CXXDEPMODE
ac_ct_CXX
CXXFLAGS
CXX
CPP
OTOOL64
OTOOL
LIPO
NMEDIT
DSYMUTIL
MANIFEST_TOOL
RANLIB
ac_ct_AR
AR
DLLTOOL
OBJDUMP
LN_S
NM
ac_ct_DUMPBIN
DUMPBIN
LD
FGREP
EGREP
GREP
SED
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
am__nodep
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
MAINT
MAINTAINER_MODE_FALSE
MAINTAINER_MODE_TRUE
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
AM_V
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_URL
PACKAGE_BUGREPORT
PACKAGE_STRING
PACKAGE_VERSION
PACKAGE_TARNAME
PACKAGE_NAME
PATH_SEPARATOR
SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_silent_rules
enable_maintainer_mode
enable_static
enable_shared
with_pic
enable_fast_install
enable_dependency_tracking
with_gnu_ld
with_sysroot
enable_libtool_lock
enable_hal
enable_udev
with_scanbdconfdir
with_scanbuttondlibdir
enable_Werror
enable_debug
with_systemdsystemunitdir
enable_scanbuttond
with_user
with_group
'
ac_precious_vars='build_alias
host_alias
target_alias
CC
CFLAGS
LDFLAGS
LIBS
CPPFLAGS
CPP
CXX
CXXFLAGS
CCC
CXXCPP
PKG_CONFIG
PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
CONFUSE_CFLAGS
CONFUSE_LIBS
DBUS_CFLAGS
DBUS_LIBS
HAL_CFLAGS
HAL_LIBS
UDEV_CFLAGS
UDEV_LIBS
LIBUSB_CFLAGS
LIBUSB_LIBS
SANE_CFLAGS
SANE_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= ;;
*) 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_fn_error $? "invalid feature name: $ac_useropt"
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_fn_error $? "invalid feature name: $ac_useropt"
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_fn_error $? "invalid package name: $ac_useropt"
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_fn_error $? "invalid package name: $ac_useropt"
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_fn_error $? "unrecognized option: \`$ac_option'
Try \`$0 --help' for more information"
;;
*=*)
ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
case $ac_envvar in #(
'' | [0-9]* | *[!_$as_cr_alnum]* )
as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
esac
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_fn_error $? "missing argument to $ac_option"
fi
if test -n "$ac_unrecognized_opts"; then
case $enable_option_checking in
no) ;;
fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
*) $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_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
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
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_fn_error $? "working directory cannot be determined"
test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
as_fn_error $? "pwd does not report name of working directory"
# 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_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
fi
ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
ac_abs_confdir=`(
cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
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 scanbd 1.92 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/scanbd]
--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
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 scanbd 1.92:";;
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-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
--enable-maintainer-mode
enable make rules and dependencies not useful (and
sometimes confusing) to the casual installer
--enable-static[=PKGS] build static libraries [default=no]
--enable-shared[=PKGS] build shared libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--enable-dependency-tracking
do not reject slow dependency extractors
--disable-dependency-tracking
speeds up one-time build
--disable-libtool-lock avoid locking (might break parallel builds)
--enable-hal force to use hal
--enable-udev force to use udev
--disable-Werror don't use gcc's -Werror option when building
--disable-debug disable debugging code (NDEBUG)
--enable-scanbuttond Use scanbuttond instead of Sane
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
--with-sysroot=DIR Search for dependent libraries within DIR
(or the compiler's sysroot if not specified).
--with-scanbdconfdir=DIR
scanbd configuration directory (PREFIX/etc/scanbd)
--with-scanbuttondlibdir=DIR
scanbuttond backend configuration directory
(LIBDIR/scanbd/scanbuttond/backends)
--with-systemdsystemunitdir=DIR
Directory for systemd service files
--with-user=USER userid to run as (guess)
--with-group=GROUP Groupid to run as (guess)
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 (Objective) C/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
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path
CONFUSE_CFLAGS
C compiler flags for CONFUSE, overriding pkg-config
CONFUSE_LIBS
linker flags for CONFUSE, overriding pkg-config
DBUS_CFLAGS C compiler flags for DBUS, overriding pkg-config
DBUS_LIBS linker flags for DBUS, overriding pkg-config
HAL_CFLAGS C compiler flags for HAL, overriding pkg-config
HAL_LIBS linker flags for HAL, overriding pkg-config
UDEV_CFLAGS C compiler flags for UDEV, overriding pkg-config
UDEV_LIBS linker flags for UDEV, overriding pkg-config
LIBUSB_CFLAGS
C compiler flags for LIBUSB, overriding pkg-config
LIBUSB_LIBS linker flags for LIBUSB, overriding pkg-config
SANE_CFLAGS C compiler flags for SANE, overriding pkg-config
SANE_LIBS linker flags for SANE, 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
scanbd configure 1.92
generated by GNU Autoconf 2.69
Copyright (C) 2012 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
## ------------------------ ##
## Autoconf initialization. ##
## ------------------------ ##
# ac_fn_c_try_compile LINENO
# --------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_compile
# ac_fn_c_try_link LINENO
# -----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_link
# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists and can be compiled using the include files in
# INCLUDES, setting the cache variable VAR accordingly.
ac_fn_c_check_header_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_compile
# ac_fn_c_try_cpp LINENO
# ----------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
ac_fn_c_try_cpp ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } > conftest.i && {
test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
test ! -s conftest.err
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_cpp
# ac_fn_c_try_run LINENO
# ----------------------
# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
# that executables *can* be run.
ac_fn_c_try_run ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && { 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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then :
ac_retval=0
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
ac_retval=$ac_status
fi
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_c_try_run
# ac_fn_c_check_func LINENO FUNC VAR
# ----------------------------------
# Tests whether FUNC exists, setting the cache variable VAR accordingly
ac_fn_c_check_func ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
/* Define $2 to an innocuous variant, in case declares $2.
For example, HP-UX 11i declares gettimeofday. */
#define $2 innocuous_$2
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $2 (); below.
Prefer to if __STDC__ is defined, since
exists even on freestanding compilers. */
#ifdef __STDC__
# include
#else
# include
#endif
#undef $2
/* 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 $2 ();
/* 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_$2 || defined __stub___$2
choke me
#endif
int
main ()
{
return $2 ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
eval "$3=yes"
else
eval "$3=no"
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_func
# ac_fn_cxx_try_compile LINENO
# ----------------------------
# Try to compile conftest.$ac_ext, and return whether this succeeded.
ac_fn_cxx_try_compile ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_compile
# ac_fn_cxx_try_cpp LINENO
# ------------------------
# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
ac_fn_cxx_try_cpp ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } > conftest.i && {
test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
test ! -s conftest.err
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_cpp
# ac_fn_cxx_try_link LINENO
# -------------------------
# Try to link conftest.$ac_ext, and return whether this succeeded.
ac_fn_cxx_try_link ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
grep -v '^ *+' conftest.err >conftest.er1
cat conftest.er1 >&5
mv -f conftest.er1 conftest.err
fi
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext && {
test "$cross_compiling" = yes ||
test -x conftest$ac_exeext
}; then :
ac_retval=0
else
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_retval=1
fi
# Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
# created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
# interfere with the next link command; also delete a directory that is
# left behind by Apple's compiler. We do this before executing the actions.
rm -rf conftest.dSYM conftest_ipa8_conftest.oo
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
as_fn_set_status $ac_retval
} # ac_fn_cxx_try_link
# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
# -------------------------------------------------------
# Tests whether HEADER exists, giving a warning if it cannot be compiled using
# the include files in INCLUDES and setting the cache variable VAR
# accordingly.
ac_fn_c_check_header_mongrel ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
if eval \${$3+:} false; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
else
# Is the header compilable?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
$as_echo_n "checking $2 usability... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
#include <$2>
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_header_compiler=yes
else
ac_header_compiler=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
$as_echo "$ac_header_compiler" >&6; }
# Is the header present?
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
$as_echo_n "checking $2 presence... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <$2>
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
ac_header_preproc=yes
else
ac_header_preproc=no
fi
rm -f conftest.err conftest.i conftest.$ac_ext
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
;;
no:yes:* )
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5
$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5
$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;}
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
( $as_echo "## ------------------------------------- ##
## Report this to wilhelm.meier@fh-kl.de ##
## ------------------------------------- ##"
) | sed "s/^/$as_me: WARNING: /" >&2
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=\$ac_header_compiler"
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
fi
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_header_mongrel
# ac_fn_c_check_type LINENO TYPE VAR INCLUDES
# -------------------------------------------
# Tests whether TYPE exists after having included INCLUDES, setting cache
# variable VAR accordingly.
ac_fn_c_check_type ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
$as_echo_n "checking for $2... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
if (sizeof ($2))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$4
int
main ()
{
if (sizeof (($2)))
return 0;
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
eval "$3=yes"
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
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_check_type
# ac_fn_c_find_uintX_t LINENO BITS VAR
# ------------------------------------
# Finds an unsigned integer type with width BITS, setting cache variable VAR
# accordingly.
ac_fn_c_find_uintX_t ()
{
as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5
$as_echo_n "checking for uint$2_t... " >&6; }
if eval \${$3+:} false; then :
$as_echo_n "(cached) " >&6
else
eval "$3=no"
# Order is important - never check a type that is potentially smaller
# than half of the expected target width.
for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \
'unsigned long long int' 'unsigned short int' 'unsigned char'; do
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
$ac_includes_default
int
main ()
{
static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)];
test_array [0] = 0;
return test_array [0];
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
case $ac_type in #(
uint$2_t) :
eval "$3=yes" ;; #(
*) :
eval "$3=\$ac_type" ;;
esac
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
if eval test \"x\$"$3"\" = x"no"; then :
else
break
fi
done
fi
eval ac_res=\$$3
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
$as_echo "$ac_res" >&6; }
eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
} # ac_fn_c_find_uintX_t
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 scanbd $as_me 1.92, which was
generated by GNU Autoconf 2.69. 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) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
2)
as_fn_append 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
as_fn_append ac_configure_args " '$ac_arg'"
;;
esac
done
done
{ ac_configure_args0=; unset ac_configure_args0;}
{ ac_configure_args1=; unset 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
$as_echo "## ---------------- ##
## Cache variables. ##
## ---------------- ##"
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:${as_lineno-$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= ;; #(
*) { eval $ac_var=; 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
$as_echo "## ----------------- ##
## Output variables. ##
## ----------------- ##"
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
$as_echo "## ------------------- ##
## File substitutions. ##
## ------------------- ##"
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
$as_echo "## ----------- ##
## confdefs.h. ##
## ----------- ##"
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'; as_fn_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
$as_echo "/* confdefs.h */" > 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
cat >>confdefs.h <<_ACEOF
#define PACKAGE_URL "$PACKAGE_URL"
_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
# We do not want a PATH search for config.site.
case $CONFIG_SITE in #((
-*) ac_site_file1=./$CONFIG_SITE;;
*/*) ac_site_file1=$CONFIG_SITE;;
*) ac_site_file1=./$CONFIG_SITE;;
esac
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 /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
{ $as_echo "$as_me:${as_lineno-$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" \
|| { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "failed to load site script $ac_site_file
See \`config.log' for more details" "$LINENO" 5; }
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. DJGPP emulates it as a regular file.
if test /dev/null != "$cache_file" && test -f "$cache_file"; then
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5
$as_echo "$as_me: former value: \`$ac_old_val'" >&2;}
{ $as_echo "$as_me:${as_lineno-$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.
*) as_fn_append ac_configure_args " '$ac_arg'" ;;
esac
fi
done
if $ac_cache_corrupted; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
{ $as_echo "$as_me:${as_lineno-$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_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
fi
## -------------------- ##
## Main body of script. ##
## -------------------- ##
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
# allow check that we are really in the source directory
# Do not enforce GNU file conventions like ChangeLog README etc.
am__api_version='1.15'
ac_aux_dir=
for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; 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_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5
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.
# 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:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
$as_echo_n "checking for a BSD-compatible install... " >&6; }
if test -z "$INSTALL"; then
if ${ac_cv_path_install+:} false; 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 as_fn_executable_p "$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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[\\\"\#\$\&\'\`$am_lf]*)
as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
esac
# 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 (
am_has_slept=no
for am_try in 1 2; do
echo "timestamp, slept: $am_has_slept" > conftest.file
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
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_fn_error $? "ls -t appears to fail. Make sure there is not a broken
alias in your environment" "$LINENO" 5
fi
if test "$2" = conftest.file || test $am_try -eq 2; then
break
fi
# Just in case.
sleep 1
am_has_slept=yes
done
test "$2" = conftest.file
)
then
# Ok.
:
else
as_fn_error $? "newly created file is older than distributed files!
Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
# If we didn't sleep, we still need to ensure time stamps of config.status and
# generated files are strictly newer.
am_sleep_pid=
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
( sleep 1 ) &
am_sleep_pid=$!
fi
rm -f conftest.file
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`
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --is-lightweight"; then
am_missing_run="$MISSING "
else
am_missing_run=
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
# 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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_STRIP+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $STRIP" >&5
$as_echo "$STRIP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_STRIP+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
$as_echo "$ac_ct_STRIP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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"
{ $as_echo "$as_me:${as_lineno-$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 ${ac_cv_path_mkdir+:} false; 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
as_fn_executable_p "$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
test -d ./--version && rmdir ./--version
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.
MKDIR_P="$ac_install_sh -d"
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_AWK+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AWK="$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $AWK" >&5
$as_echo "$AWK" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$AWK" && break
done
{ $as_echo "$as_me:${as_lineno-$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 eval \${ac_cv_prog_make_${ac_make}_set+:} false; 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:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
SET_MAKE=
else
{ $as_echo "$as_me:${as_lineno-$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
# Check whether --enable-silent-rules was given.
if test "${enable_silent_rules+set}" = set; then :
enableval=$enable_silent_rules;
fi
case $enable_silent_rules in # (((
yes) AM_DEFAULT_VERBOSITY=0;;
no) AM_DEFAULT_VERBOSITY=1;;
*) AM_DEFAULT_VERBOSITY=1;;
esac
am_make=${MAKE-make}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
if ${am_cv_make_support_nested_variables+:} false; then :
$as_echo_n "(cached) " >&6
else
if $as_echo 'TRUE=$(BAR$(V))
BAR0=false
BAR1=true
V=1
am__doit:
@$(TRUE)
.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
am_cv_make_support_nested_variables=yes
else
am_cv_make_support_nested_variables=no
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
$as_echo "$am_cv_make_support_nested_variables" >&6; }
if test $am_cv_make_support_nested_variables = yes; then
AM_V='$(V)'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
else
AM_V=$AM_DEFAULT_VERBOSITY
AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
fi
AM_BACKSLASH='\'
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_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
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='scanbd'
VERSION='1.92'
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"}
# For better backward compatibility. To be removed once Automake 1.9.x
# dies out for good. For more background, see:
#
#
mkdir_p='$(MKDIR_P)'
# We need awk for the "check" target (and possibly the TAP driver). The
# system "awk" is bad on some platforms.
# Always define AMTAR for backward compatibility. Yes, it's still used
# in the wild :-( We should find a proper way to deprecate it ...
AMTAR='$${TAR-tar}'
# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar pax cpio none'
am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
# POSIX will say in a future version that running "rm -f" with no argument
# is OK; and we want to be able to make that assumption in our Makefile
# recipes. So use an aggressive probe to check that the usage we want is
# actually supported "in the wild" to an acceptable degree.
# See automake bug#10828.
# To make any issue more visible, cause the running configure to be aborted
# by default if the 'rm' program in use doesn't match our expectations; the
# user can still override this though.
if rm -f && rm -fr && rm -rf; then : OK; else
cat >&2 <<'END'
Oops!
Your 'rm' program seems unable to run without file operands specified
on the command line, even when the '-f' option is present. This is contrary
to the behaviour of most rm programs out there, and not conforming with
the upcoming POSIX standard:
Please tell bug-automake@gnu.org about your system, including the value
of your $PATH and any error possibly output before this message. This
can help us improve future automake versions.
END
if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
echo 'Configuration will proceed anyway, since you have set the' >&2
echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
echo >&2
else
cat >&2 <<'END'
Aborting the configuration process, to ensure you take notice of the issue.
You can download and install GNU coreutils to get an 'rm' implementation
that behaves properly: .
If you want to complete the configuration process using your problematic
'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
to "yes", and re-run configure.
END
as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
fi
fi
# Do not automatically rebuild autoconf stuff
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
# Check whether --enable-maintainer-mode was given.
if test "${enable_maintainer_mode+set}" = set; then :
enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
else
USE_MAINTAINER_MODE=no
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
$as_echo "$USE_MAINTAINER_MODE" >&6; }
if test $USE_MAINTAINER_MODE = yes; then
MAINTAINER_MODE_TRUE=
MAINTAINER_MODE_FALSE='#'
else
MAINTAINER_MODE_TRUE='#'
MAINTAINER_MODE_FALSE=
fi
MAINT=$MAINTAINER_MODE_TRUE
# Initialize libtool support
case `pwd` in
*\ * | *\ *)
{ $as_echo "$as_me:${as_lineno-$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.4.2'
macro_revision='1.3337'
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_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
$as_echo_n "checking build system type... " >&6; }
if ${ac_cv_build+:} false; 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_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
$as_echo "$ac_cv_build" >&6; }
case $ac_cv_build in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
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:${as_lineno-$LINENO}: checking host system type" >&5
$as_echo_n "checking host system type... " >&6; }
if ${ac_cv_host+:} false; 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_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
$as_echo "$ac_cv_host" >&6; }
case $ac_cv_host in
*-*-*) ;;
*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
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
# Backslashify 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'
ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
$as_echo_n "checking how to print strings... " >&6; }
# Test print first, because it will be a builtin if present.
if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
ECHO='print -r --'
elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
ECHO='printf %s\n'
else
# Use this function as a fallback that always works.
func_fallback_echo ()
{
eval 'cat <<_LTECHO_EOF
$1
_LTECHO_EOF'
}
ECHO='func_fallback_echo'
fi
# func_echo_all arg...
# Invoke $ECHO with all args, space-separated.
func_echo_all ()
{
$ECHO ""
}
case "$ECHO" in
printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
$as_echo "printf" >&6; } ;;
print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
$as_echo "print -r" >&6; } ;;
*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
$as_echo "cat" >&6; } ;;
esac
DEPDIR="${am__leading_dot}deps"
ac_config_commands="$ac_config_commands depfiles"
am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
{ $as_echo "$as_me:${as_lineno-$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
# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$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='\'
am__nodep='_no'
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
$as_echo_n "checking whether the C compiler works... " >&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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link_default") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; 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
if test -z "$ac_file"; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
$as_echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error 77 "C compiler cannot create executables
See \`config.log' for more details" "$LINENO" 5; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
$as_echo_n "checking for C compiler default output file name... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
$as_echo "$ac_file" >&6; }
ac_exeext=$ac_cv_exeext
rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; 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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of executables: cannot compile and link
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest conftest$ac_cv_exeext
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
$as_echo "$ac_cv_exeext" >&6; }
rm -f conftest.$ac_ext
EXEEXT=$ac_cv_exeext
ac_exeext=$EXEEXT
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
int
main ()
{
FILE *f = fopen ("conftest.out", "w");
return ferror (f) || fclose (f) != 0;
;
return 0;
}
_ACEOF
ac_clean_files="$ac_clean_files conftest.out"
# Check that the compiler produces executables we can run. If not, either
# the compiler is broken, or we cross compile.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
$as_echo_n "checking whether we are cross compiling... " >&6; }
if test "$cross_compiling" != yes; then
{ { 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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_link") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if { ac_try='./conftest$ac_cv_exeext'
{ { case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_try") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; }; then
cross_compiling=no
else
if test "$cross_compiling" = maybe; then
cross_compiling=yes
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run C compiled programs.
If you meant to cross compile, use \`--host'.
See \`config.log' for more details" "$LINENO" 5; }
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
$as_echo "$cross_compiling" >&6; }
rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
ac_clean_files=$ac_clean_files_save
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
$as_echo_n "checking for suffix of object files... " >&6; }
if ${ac_cv_objext+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compile") 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; 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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot compute suffix of object files: cannot compile
See \`config.log' for more details" "$LINENO" 5; }
fi
rm -f conftest.$ac_cv_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
$as_echo "$ac_cv_objext" >&6; }
OBJEXT=$ac_cv_objext
ac_objext=$OBJEXT
{ $as_echo "$as_me:${as_lineno-$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 ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
struct stat;
/* 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"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c89=$ac_arg
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:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
xno)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :
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_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:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
if ${am_cv_prog_cc_c_o+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
# Make sure it works both with $CC and with simple cc.
# Following AC_PROG_CC_C_O, we do the test twice because some
# compilers refuse to overwrite an existing .o file with -o,
# though they will create one.
am_cv_prog_cc_c_o=yes
for am_i in 1 2; do
if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } \
&& test -f conftest2.$ac_objext; then
: OK
else
am_cv_prog_cc_c_o=no
break
fi
done
rm -f core conftest*
unset am_i
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
$as_echo "$am_cv_prog_cc_c_o" >&6; }
if test "$am_cv_prog_cc_c_o" != 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=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:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CC_dependencies_compiler_type+:} false; 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".
rm -rf conftest.dir
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
am__universal=false
case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac
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 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# 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. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
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
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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:${as_lineno-$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:${as_lineno-$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 ${ac_cv_path_SED+:} false; 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
{ ac_script=; unset 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"
as_fn_executable_p "$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
as_fn_arith $ac_count + 1 && ac_count=$as_val
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_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
fi
else
ac_cv_path_SED=$SED
fi
fi
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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 ${ac_cv_path_GREP+:} false; 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"
as_fn_executable_p "$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
as_fn_arith $ac_count + 1 && ac_count=$as_val
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_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_GREP=$GREP
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
$as_echo "$ac_cv_path_GREP" >&6; }
GREP="$ac_cv_path_GREP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
$as_echo_n "checking for egrep... " >&6; }
if ${ac_cv_path_EGREP+:} false; 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"
as_fn_executable_p "$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
as_fn_arith $ac_count + 1 && ac_count=$as_val
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_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_EGREP=$EGREP
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
$as_echo "$ac_cv_path_EGREP" >&6; }
EGREP="$ac_cv_path_EGREP"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
$as_echo_n "checking for fgrep... " >&6; }
if ${ac_cv_path_FGREP+:} false; 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"
as_fn_executable_p "$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
as_fn_arith $ac_count + 1 && ac_count=$as_val
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_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
fi
else
ac_cv_path_FGREP=$FGREP
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for GNU ld" >&5
$as_echo_n "checking for GNU ld... " >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
$as_echo_n "checking for non-GNU ld... " >&6; }
fi
if ${lt_cv_path_LD+:} false; 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:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
if ${lt_cv_prog_gnu_ld+:} false; 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:${as_lineno-$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 ${lt_cv_path_NM+:} false; 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:${as_lineno-$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 "$DUMPBIN"; then :
# Let the user override the test.
else
if test -n "$ac_tool_prefix"; then
for ac_prog in dumpbin "link -dump"
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_DUMPBIN+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
$as_echo "$DUMPBIN" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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 "link -dump"
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
$as_echo "$ac_ct_DUMPBIN" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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
case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
*COFF*)
DUMPBIN="$DUMPBIN -symbols"
;;
*)
DUMPBIN=:
;;
esac
fi
if test "$DUMPBIN" != ":"; then
NM="$DUMPBIN"
fi
fi
test -z "$NM" && NM=nm
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
$as_echo_n "checking the name lister ($NM) interface... " >&6; }
if ${lt_cv_nm_interface+:} false; 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:$LINENO: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
(eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
(eval echo "\"\$as_me:$LINENO: 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:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
$as_echo "$lt_cv_nm_interface" >&6; }
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
$as_echo_n "checking the maximum length of command line arguments... " >&6; }
if ${lt_cv_sys_max_cmd_len+:} false; 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;
;;
mint*)
# On MiNT this can take a long time and run out of memory.
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
;;
os2*)
# The test takes a long time on OS/2.
lt_cv_sys_max_cmd_len=8192
;;
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"`env echo "$teststring$teststring" 2>/dev/null` \
= "X$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:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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%"$_lt_dummy"}, \
= c,a/b,b/c, \
&& eval 'test $(( 1 + 1 )) -eq 2 \
&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
&& xsi_shell=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
$as_echo "$xsi_shell" >&6; }
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
if ${lt_cv_to_host_file_cmd+:} false; then :
$as_echo_n "(cached) " >&6
else
case $host in
*-*-mingw* )
case $build in
*-*-mingw* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
;;
*-*-cygwin* )
lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
;;
* ) # otherwise, assume *nix
lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
;;
esac
;;
*-*-cygwin* )
case $build in
*-*-mingw* ) # actually msys
lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
;;
*-*-cygwin* )
lt_cv_to_host_file_cmd=func_convert_file_noop
;;
* ) # otherwise, assume *nix
lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
;;
esac
;;
* ) # unhandled hosts (and "normal" native builds)
lt_cv_to_host_file_cmd=func_convert_file_noop
;;
esac
fi
to_host_file_cmd=$lt_cv_to_host_file_cmd
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
$as_echo "$lt_cv_to_host_file_cmd" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
if ${lt_cv_to_tool_file_cmd+:} false; then :
$as_echo_n "(cached) " >&6
else
#assume ordinary cross tools, or native build.
lt_cv_to_tool_file_cmd=func_convert_file_noop
case $host in
*-*-mingw* )
case $build in
*-*-mingw* ) # actually msys
lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
;;
esac
;;
esac
fi
to_tool_file_cmd=$lt_cv_to_tool_file_cmd
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
$as_echo_n "checking for $LD option to reload object files... " >&6; }
if ${lt_cv_ld_reload_flag+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_ld_reload_flag='-r'
fi
{ $as_echo "$as_me:${as_lineno-$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
cygwin* | mingw* | pw32* | cegcc*)
if test "$GCC" != yes; then
reload_cmds=false
fi
;;
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_OBJDUMP+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
$as_echo "$OBJDUMP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OBJDUMP="objdump"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
$as_echo "$ac_ct_OBJDUMP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
$as_echo_n "checking how to recognize dependent libraries... " >&6; }
if ${lt_cv_deplibs_check_method+:} false; 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.
# func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
if ( test "$lt_cv_nm_interface" = "BSD nm" && 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
# Keep this pattern in sync with the one in func_win32_libid.
lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
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
;;
haiku*)
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])(-bit)?( [LM]SB)? 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 glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-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:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
$as_echo "$lt_cv_deplibs_check_method" >&6; }
file_magic_glob=
want_nocaseglob=no
if test "$build" = "$host"; then
case $host_os in
mingw* | pw32*)
if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
want_nocaseglob=yes
else
file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
fi
;;
esac
fi
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}dlltool", so it can be a program name with args.
set dummy ${ac_tool_prefix}dlltool; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_DLLTOOL+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
$as_echo "$DLLTOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DLLTOOL="dlltool"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
$as_echo "$ac_ct_DLLTOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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
test -z "$DLLTOOL" && DLLTOOL=dlltool
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_sharedlib_from_linklib_cmd='unknown'
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
# two different shell functions defined in ltmain.sh
# decide which to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
*--identify-strict*)
lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
;;
*)
lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
;;
esac
;;
*)
# fallback: assume linklib IS sharedlib
lt_cv_sharedlib_from_linklib_cmd="$ECHO"
;;
esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
if test -n "$ac_tool_prefix"; then
for ac_prog in ar
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_AR+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $AR" >&5
$as_echo "$AR" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$AR" && break
done
fi
if test -z "$AR"; then
ac_ct_AR=$AR
for ac_prog in ar
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_AR+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_AR="$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
$as_echo "$ac_ct_AR" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -n "$ac_ct_AR" && break
done
if test "x$ac_ct_AR" = x; then
AR="false"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$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
fi
: ${AR=ar}
: ${AR_FLAGS=cru}
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
$as_echo_n "checking for archiver @FILE support... " >&6; }
if ${lt_cv_ar_at_file+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_ar_at_file=no
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
echo conftest.$ac_objext > conftest.lst
lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
(eval $lt_ar_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if test "$ac_status" -eq 0; then
# Ensure the archiver fails upon bogus file names.
rm -f conftest.$ac_objext libconftest.a
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
(eval $lt_ar_try) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
if test "$ac_status" -ne 0; then
lt_cv_ar_at_file=@
fi
fi
rm -f conftest.* libconftest.a
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
$as_echo "$lt_cv_ar_at_file" >&6; }
if test "x$lt_cv_ar_at_file" = xno; then
archiver_list_spec=
else
archiver_list_spec=$lt_cv_ar_at_file
fi
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_STRIP+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_STRIP="${ac_tool_prefix}strip"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $STRIP" >&5
$as_echo "$STRIP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_STRIP+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_STRIP="strip"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
$as_echo "$ac_ct_STRIP" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_RANLIB+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $RANLIB" >&5
$as_echo "$RANLIB" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_RANLIB+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_RANLIB="ranlib"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
$as_echo "$ac_ct_RANLIB" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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 \$tool_oldlib"
;;
*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
;;
esac
old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
darwin*)
lock_old_archive_extraction=yes ;;
*)
lock_old_archive_extraction=no ;;
esac
# 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:${as_lineno-$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 ${lt_cv_sys_global_symbol_pipe+:} false; 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};"\
" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
" /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
lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
# 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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
# Now try to grab the symbols.
nlist=conftest.nm
if { { eval echo "\"\$as_me\":${as_lineno-$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:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && 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
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
/* DATA imports from DLLs on WIN32 con't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs. */
# define LT_DLSYM_CONST
#elif defined(__osf__)
/* This system does not cope well with relocations in const data. */
# define LT_DLSYM_CONST
#else
# define LT_DLSYM_CONST const
#endif
#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. */
LT_DLSYM_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_globsym_save_LIBS=$LIBS
lt_globsym_save_CFLAGS=$CFLAGS
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
LIBS=$lt_globsym_save_LIBS
CFLAGS=$lt_globsym_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:${as_lineno-$LINENO}: result: failed" >&5
$as_echo "failed" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
$as_echo "ok" >&6; }
fi
# Response file support.
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
nm_file_list_spec='@'
elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
nm_file_list_spec='@'
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
$as_echo_n "checking for sysroot... " >&6; }
# Check whether --with-sysroot was given.
if test "${with_sysroot+set}" = set; then :
withval=$with_sysroot;
else
with_sysroot=no
fi
lt_sysroot=
case ${with_sysroot} in #(
yes)
if test "$GCC" = yes; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
;; #(
/*)
lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
;; #(
no|'')
;; #(
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
$as_echo "${with_sysroot}" >&6; }
as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
$as_echo "${lt_sysroot:-no}" >&6; }
# 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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; 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 '$LINENO' "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; 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\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; 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:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
if ${lt_cv_cc_needs_belf+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
lt_cv_cc_needs_belf=yes
else
lt_cv_cc_needs_belf=no
fi
rm -f core conftest.err conftest.$ac_objext \
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:${as_lineno-$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
;;
*-*solaris*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
yes*)
case $host in
i?86-*-solaris*)
LD="${LD-ld} -m elf_x86_64"
;;
sparc*-*-solaris*)
LD="${LD-ld} -m elf64_sparc"
;;
esac
# GNU ld 2.21 introduced _sol2 emulations. Use them if available.
if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
LD="${LD-ld}_sol2"
fi
;;
*)
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"
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
set dummy ${ac_tool_prefix}mt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$MANIFEST_TOOL"; then
ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
if test -n "$MANIFEST_TOOL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
$as_echo "$MANIFEST_TOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
fi
if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
# Extract the first word of "mt", so it can be a program name with args.
set dummy mt; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
$as_echo_n "(cached) " >&6
else
if test -n "$ac_ct_MANIFEST_TOOL"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
fi
fi
ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
if test -n "$ac_ct_MANIFEST_TOOL"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "x$ac_ct_MANIFEST_TOOL" = x; then
MANIFEST_TOOL=":"
else
case $cross_compiling:$ac_tool_warned in
yes:)
{ $as_echo "$as_me:${as_lineno-$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
MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
fi
else
MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
fi
test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
if ${lt_cv_path_mainfest_tool+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_path_mainfest_tool=no
echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
$MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
cat conftest.err >&5
if $GREP 'Manifest Tool' conftest.out > /dev/null; then
lt_cv_path_mainfest_tool=yes
fi
rm -f conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
$as_echo "$lt_cv_path_mainfest_tool" >&6; }
if test "x$lt_cv_path_mainfest_tool" != xyes; then
MANIFEST_TOOL=:
fi
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_DSYMUTIL+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
$as_echo "$DSYMUTIL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
$as_echo "$ac_ct_DSYMUTIL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_NMEDIT+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $NMEDIT" >&5
$as_echo "$NMEDIT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_NMEDIT+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_NMEDIT="nmedit"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
$as_echo "$ac_ct_NMEDIT" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_LIPO+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $LIPO" >&5
$as_echo "$LIPO" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_LIPO+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_LIPO="lipo"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
$as_echo "$ac_ct_LIPO" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_OTOOL+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $OTOOL" >&5
$as_echo "$OTOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_OTOOL+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL="otool"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
$as_echo "$ac_ct_OTOOL" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_OTOOL64+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $OTOOL64" >&5
$as_echo "$OTOOL64" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_OTOOL64+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_OTOOL64="otool64"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
$as_echo "$ac_ct_OTOOL64" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
$as_echo_n "checking for -single_module linker flag... " >&6; }
if ${lt_cv_apple_cc_single_mod+:} false; 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 there is a non-empty error log, and "single_module"
# appears in it, assume the flag caused a linker warning
if test -s conftest.err && $GREP single_module conftest.err; then
cat conftest.err >&5
# Otherwise, if the output was created with a 0 exit code from
# the compiler, it worked.
elif test -f libconftest.dylib && test $_lt_result -eq 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:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
if ${lt_cv_ld_exported_symbols_list+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
lt_cv_ld_exported_symbols_list=yes
else
lt_cv_ld_exported_symbols_list=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS="$save_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
$as_echo_n "checking for -force_load linker flag... " >&6; }
if ${lt_cv_ld_force_load+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_ld_force_load=no
cat > conftest.c << _LT_EOF
int forced_loaded() { return 2;}
_LT_EOF
echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
$LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
echo "$AR cru libconftest.a conftest.o" >&5
$AR cru libconftest.a conftest.o 2>&5
echo "$RANLIB libconftest.a" >&5
$RANLIB libconftest.a 2>&5
cat > conftest.c << _LT_EOF
int main() { return 0;}
_LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
_lt_result=$?
if test -s conftest.err && $GREP force_load conftest.err; then
cat conftest.err >&5
elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&5
fi
rm -f conftest.err libconftest.a conftest conftest.c
rm -rf conftest.dSYM
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
$as_echo "$lt_cv_ld_force_load" >&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" != ":" && test "$lt_cv_ld_force_load" = "no"; 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:${as_lineno-$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 ${ac_cv_prog_CPP+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i 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:${as_lineno-$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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_c_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
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:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
$as_echo_n "checking for ANSI C header files... " >&6; }
if ${ac_cv_header_stdc+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
#include
#include
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_header_stdc=yes
else
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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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
if ac_fn_c_try_run "$LINENO"; then :
else
ac_cv_header_stdc=no
fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
conftest.$ac_objext conftest.beam conftest.$ac_ext
fi
fi
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
$as_echo "$ac_cv_header_stdc" >&6; }
if test $ac_cv_header_stdc = yes; then
$as_echo "#define STDC_HEADERS 1" >>confdefs.h
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`
ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
"
if eval test \"x\$"$as_ac_Header"\" = 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 :
ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
"
if test "x$ac_cv_header_dlfcn_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_DLFCN_H 1
_ACEOF
fi
done
# Set options
# 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=no
fi
enable_dlopen=no
enable_win32_dll=no
# 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 --with-pic was given.
if test "${with_pic+set}" = set; then :
withval=$with_pic; lt_p=${PACKAGE-default}
case $withval in
yes|no) pic_mode=$withval ;;
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
for lt_pkg in $withval; do
IFS="$lt_save_ifs"
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
IFS="$lt_save_ifs"
;;
esac
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:${as_lineno-$LINENO}: checking for objdir" >&5
$as_echo_n "checking for objdir... " >&6; }
if ${lt_cv_objdir+:} false; 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:${as_lineno-$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
# 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 "$cc_temp" | $SED "s%.*/%%; 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:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
if ${lt_cv_path_MAGIC_CMD+:} false; 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:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for file" >&5
$as_echo_n "checking for file... " >&6; }
if ${lt_cv_path_MAGIC_CMD+:} false; 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:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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
case $cc_basename in
nvcc*)
lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
*)
lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
if ${lt_cv_prog_compiler_rtti_exceptions+:} false; 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:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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:${as_lineno-$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=
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'
;;
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
lt_prog_compiler_static=
;;
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
case $cc_basename in
nvcc*) # Cuda Compiler Driver 2.2
lt_prog_compiler_wl='-Xlinker '
if test -n "$lt_prog_compiler_pic"; then
lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
fi
;;
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 | kopensolaris*-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'
;;
nagfor*)
# NAG Fortran compiler
lt_prog_compiler_wl='-Wl,-Wl,,'
lt_prog_compiler_pic='-PIC'
lt_prog_compiler_static='-Bstatic'
;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# 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* | bgxl* | bgf* | mpixl*)
# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-qpic'
lt_prog_compiler_static='-qstaticlink'
;;
*)
case `$CC -V 2>&1 | sed 5q` in
*Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
# 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=''
;;
*Sun\ F* | *Sun*Fortran*)
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl='-Qoption ld '
;;
*Sun\ C*)
# Sun C 5.9
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl='-Wl,'
;;
*Intel*\ [CF]*Compiler*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fPIC'
lt_prog_compiler_static='-static'
;;
*Portland\ Group*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-fpic'
lt_prog_compiler_static='-Bstatic'
;;
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* | sunf77* | sunf90* | sunf95*)
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:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
if ${lt_cv_prog_compiler_pic+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
$as_echo "$lt_cv_prog_compiler_pic" >&6; }
lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic"; then
{ $as_echo "$as_me:${as_lineno-$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 ${lt_cv_prog_compiler_pic_works+:} false; 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:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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:${as_lineno-$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:${as_lineno-$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 ${lt_cv_prog_compiler_static_works+:} false; 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 "$_lt_linker_boilerplate" | $SED '/^$/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:${as_lineno-$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:${as_lineno-$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 ${lt_cv_prog_compiler_c_o+:} false; 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:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
{ $as_echo "$as_me:${as_lineno-$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 ${lt_cv_prog_compiler_c_o+:} false; 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:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $hard_links" >&5
$as_echo "$hard_links" >&6; }
if test "$hard_links" = no; then
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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_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
# On some targets, GNU ld is compatible enough with the native linker
# that we're better off using the native interface for both.
lt_use_gnu_ld_interface=no
if test "$with_gnu_ld" = yes; then
case $host_os in
aix*)
# The AIX port of GNU ld has always aspired to compatibility
# with the native linker. However, as the warning in the GNU ld
# block says, versions before 2.19.5* couldn't really create working
# shared libraries, regardless of the interface used.
case `$LD -v 2>&1` in
*\ \(GNU\ Binutils\)\ 2.19.5*) ;;
*\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
*\ \(GNU\ Binutils\)\ [3-9]*) ;;
*)
lt_use_gnu_ld_interface=yes
;;
esac
;;
*)
lt_use_gnu_ld_interface=yes
;;
esac
fi
if test "$lt_use_gnu_ld_interface" = 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
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [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.19, 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 install binutils
*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
*** You will then need to restart the configuration process.
_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'
export_dynamic_flag_spec='${wl}--export-all-symbols'
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/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
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
;;
haiku*)
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
link_all_deplibs=yes
;;
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 | kopensolaris*-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=' $pic_flag'
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; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)
# 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; func_echo_all \"$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]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
nvcc*) # Cuda Compiler Driver 2.2
whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
compiler_needs_object=yes
;;
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; func_echo_all \"$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* | bgf* | bgxlf* | mpixlf*)
# 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='${wl}-rpath ${wl}$libdir'
archive_cmds='$LD -shared $libobjs $deplibs $linker_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 $linker_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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $pic_flag $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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $pic_flag $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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds='$CC -shared $pic_flag $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
# Also, AIX nm treats weak defined symbols like other global
# defined symbols, whereas GNU nm marks them as "W".
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") || (\$ 2 == "W")) && (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.
if test "${lt_cv_aix_libpath+set}" = set; then
aix_libpath=$lt_cv_aix_libpath
else
if ${lt_cv_aix_libpath_+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\([^ ]*\) *$/\1/
p
}
}'
lt_cv_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 "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_="/usr/lib:/lib"
fi
fi
aix_libpath=$lt_cv_aix_libpath_
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 func_echo_all "${wl}${allow_undefined_flag}"; 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.
if test "${lt_cv_aix_libpath+set}" = set; then
aix_libpath=$lt_cv_aix_libpath
else
if ${lt_cv_aix_libpath_+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\([^ ]*\) *$/\1/
p
}
}'
lt_cv_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 "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath_"; then
lt_cv_aix_libpath_="/usr/lib:/lib"
fi
fi
aix_libpath=$lt_cv_aix_libpath_
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'
if test "$with_gnu_ld" = yes; then
# We only use this code for GNU lds that support --whole-archive.
whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
whole_archive_flag_spec='$convenience'
fi
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.
case $cc_basename in
cl*)
# Native MSVC
hardcode_libdir_flag_spec=' '
allow_undefined_flag=unsupported
always_export_symbols=yes
file_list_spec='@'
# 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 $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
else
sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
fi~
$CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
enable_shared_with_static_runtimes=yes
exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
# Don't use ranlib
old_postinstall_cmds='chmod 644 $oldlib'
postlink_cmds='lt_outputfile="@OUTPUT@"~
lt_tool_outputfile="@TOOL_OUTPUT@"~
case $lt_outputfile in
*.exe|*.EXE) ;;
*)
lt_outputfile="$lt_outputfile.exe"
lt_tool_outputfile="$lt_tool_outputfile.exe"
;;
esac~
if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
$MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
$RM "$lt_outputfile.manifest";
fi'
;;
*)
# Assume MSVC wrapper
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 `func_echo_all "$deplibs" | $SED '\''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'
enable_shared_with_static_runtimes=yes
;;
esac
;;
darwin* | rhapsody*)
archive_cmds_need_lc=no
hardcode_direct=no
hardcode_automatic=yes
hardcode_shlibpath_var=unsupported
if test "$lt_cv_ld_force_load" = "yes"; then
whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
else
whole_archive_flag_spec=''
fi
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=func_echo_all
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
;;
# 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 $pic_flag -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 $pic_flag ${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 && test "$with_gnu_ld" = no; then
archive_cmds='$CC -shared $pic_flag ${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_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 && test "$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 $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
archive_cmds='$CC -shared $pic_flag ${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'
;;
*)
# Older versions of the 11.00 compiler do not understand -b yet
# (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
$as_echo_n "checking if $CC understands -b... " >&6; }
if ${lt_cv_prog_compiler__b+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler__b=no
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -b"
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 "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
$SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
if diff conftest.exp conftest.er2 >/dev/null; then
lt_cv_prog_compiler__b=yes
fi
else
lt_cv_prog_compiler__b=yes
fi
fi
$RM -r conftest*
LDFLAGS="$save_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
$as_echo "$lt_cv_prog_compiler__b" >&6; }
if test x"$lt_cv_prog_compiler__b" = xyes; then
archive_cmds='$CC -b ${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
;;
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 $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${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.
# This should be the same for all languages, so no per-tag cache variable.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
if ${lt_cv_irix_exported_symbol+:} false; then :
$as_echo_n "(cached) " >&6
else
save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int foo (void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
lt_cv_irix_exported_symbol=yes
else
lt_cv_irix_exported_symbol=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS="$save_LDFLAGS"
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
$as_echo "$lt_cv_irix_exported_symbol" >&6; }
if test "$lt_cv_irix_exported_symbol" = yes; then
archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
fi
else
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${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" && func_echo_all "-set_version $verstring"` -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} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${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" && func_echo_all "-set_version $verstring"` -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 "-set_version $verstring"` -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 $pic_flag ${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 $pic_flag ${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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
if ${lt_cv_archive_cmds_need_lc+:} false; then :
$as_echo_n "(cached) " >&6
else
$RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } 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\":${as_lineno-$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:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then
lt_cv_archive_cmds_need_lc=no
else
lt_cv_archive_cmds_need_lc=yes
fi
allow_undefined_flag=$lt_save_allow_undefined_flag
else
cat conftest.err 1>&5
fi
$RM conftest*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
;;
esac
fi
;;
esac
{ $as_echo "$as_me:${as_lineno-$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
case $host_os in
mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
*) lt_sed_strip_eq="s,=/,/,g" ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
case $lt_search_path_spec in
*\;*)
# 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 's/;/ /g'`
;;
*)
lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
;;
esac
# 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; }
}'`
# AWK program above erroneously prepends '/' to C:/dos/paths
# for these hosts.
case $host_os in
mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
$SED 's,/\([A-Za-z]:\),\1,g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
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 # correct to gnu/linux during the next big refactor
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 # correct to gnu/linux during the next big refactor
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=`func_echo_all "$lib" | $SED '\''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 # correct to gnu/linux during the next big refactor
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,$cc_basename in
yes,*)
# gcc
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="$sys_lib_search_path_spec /usr/lib/w32api"
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
;;
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
dynamic_linker='Win32 ld.exe'
;;
*,cl*)
# Native MSVC
libname_spec='$name'
soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
library_names_spec='${libname}.dll.lib'
case $build_os in
mingw*)
sys_lib_search_path_spec=
lt_save_ifs=$IFS
IFS=';'
for lt_path in $LIB
do
IFS=$lt_save_ifs
# Let DOS variable expansion print the short 8.3 style file name.
lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
done
IFS=$lt_save_ifs
# Convert to MSYS style.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
;;
cygwin*)
# Convert to unix form, then to dos form, then back to unix form
# but this time dos style (no spaces!) so that the unix form looks
# like /cygdrive/c/PROGRA~1:/cygdr...
sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
;;
*)
sys_lib_search_path_spec="$LIB"
if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
# It is most probably a Windows format PATH.
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
# FIXME: find the short name or the path components, as spaces are
# common. (e.g. "Program Files" -> "PROGRA~1")
;;
esac
# 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'
postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
dlpath=$dir/\$dldll~
$RM \$dlpath'
shlibpath_overrides_runpath=yes
dynamic_linker='Win32 link.exe'
;;
*)
# Assume MSVC wrapper
library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
esac
# 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 # correct to gnu/linux during the next big refactor
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
;;
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[23].*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
version_type=freebsd-$objformat
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
;;
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 # correct to gnu/linux during the next big refactor
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
;;
haiku*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
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=LIBRARY_PATH
shlibpath_overrides_runpath=yes
sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
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'
# or fails outright, so override atomically:
install_override_mode=555
;;
interix[3-9]*)
version_type=linux # correct to gnu/linux during the next big refactor
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 # correct to gnu/linux during the next big refactor
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 glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
version_type=linux # correct to gnu/linux during the next big refactor
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
if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_shlibpath_overrides_runpath=no
save_LDFLAGS=$LDFLAGS
save_libdir=$libdir
eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
if ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
lt_cv_shlibpath_overrides_runpath=yes
fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LDFLAGS=$save_LDFLAGS
libdir=$save_libdir
fi
shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
# 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;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 # correct to gnu/linux during the next big refactor
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 # correct to gnu/linux during the next big refactor
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 # correct to gnu/linux during the next big refactor
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 # correct to gnu/linux during the next big refactor
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 # correct to gnu/linux during the next big refactor
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 # correct to gnu/linux during the next big refactor
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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dl_dlopen=yes
else
ac_cv_lib_dl_dlopen=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes; 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
;;
*)
ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
if test "x$ac_cv_func_shl_load" = xyes; then :
lt_cv_dlopen="shl_load"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
$as_echo_n "checking for shl_load in -ldld... " >&6; }
if ${ac_cv_lib_dld_shl_load+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dld_shl_load=yes
else
ac_cv_lib_dld_shl_load=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$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" = xyes; then :
lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
else
ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
if test "x$ac_cv_func_dlopen" = xyes; then :
lt_cv_dlopen="dlopen"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldl $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dl_dlopen=yes
else
ac_cv_lib_dl_dlopen=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
$as_echo_n "checking for dlopen in -lsvld... " >&6; }
if ${ac_cv_lib_svld_dlopen+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lsvld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_svld_dlopen=yes
else
ac_cv_lib_svld_dlopen=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
$as_echo_n "checking for dld_link in -ldld... " >&6; }
if ${ac_cv_lib_dld_dld_link+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-ldld $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* 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
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dld_dld_link=yes
else
ac_cv_lib_dld_dld_link=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$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" = xyes; 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:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
$as_echo_n "checking whether a program can dlopen itself... " >&6; }
if ${lt_cv_dlopen_self+:} false; 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 $LINENO "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
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
#endif
int fnord () { return 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;
else puts (dlerror ());
}
/* dlclose (self); */
}
else
puts (dlerror ());
return status;
}
_LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && 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:${as_lineno-$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:${as_lineno-$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 ${lt_cv_dlopen_self_static+:} false; 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 $LINENO "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
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
#endif
int fnord () { return 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;
else puts (dlerror ());
}
/* dlclose (self); */
}
else
puts (dlerror ());
return status;
}
_LT_EOF
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } && 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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
;;
*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
;;
esac
fi
# Report which library types will actually be built
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
$as_echo_n "checking if libtool supports shared libraries... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
$as_echo "$can_build_shared" >&6; }
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $enable_shared" >&5
$as_echo "$enable_shared" >&6; }
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:
# Determine host information
# Check for programs
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}gcc"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="gcc"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="${ac_tool_prefix}cc"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CC" >&5
$as_echo "$CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CC+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CC="$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
$as_echo "$ac_ct_CC" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "no acceptable C compiler found in \$PATH
See \`config.log' for more details" "$LINENO" 5; }
# Provide some information about the compiler.
$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
{ $as_echo "$as_me:${as_lineno-$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 ${ac_cv_c_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
$as_echo_n "checking whether $CC accepts -g... " >&6; }
if ${ac_cv_prog_cc_g+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
else
CFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
else
ac_c_werror_flag=$ac_save_c_werror_flag
CFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_g=yes
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:${as_lineno-$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:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
if ${ac_cv_prog_cc_c89+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_prog_cc_c89=no
ac_save_CC=$CC
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
#include
struct stat;
/* 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"
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_prog_cc_c89=$ac_arg
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:${as_lineno-$LINENO}: result: none needed" >&5
$as_echo "none needed" >&6; } ;;
xno)
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
$as_echo "unsupported" >&6; } ;;
*)
CC="$CC $ac_cv_prog_cc_c89"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
esac
if test "x$ac_cv_prog_cc_c89" != xno; then :
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_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:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
if ${am_cv_prog_cc_c_o+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
# Make sure it works both with $CC and with simple cc.
# Following AC_PROG_CC_C_O, we do the test twice because some
# compilers refuse to overwrite an existing .o file with -o,
# though they will create one.
am_cv_prog_cc_c_o=yes
for am_i in 1 2; do
if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } \
&& test -f conftest2.$ac_objext; then
: OK
else
am_cv_prog_cc_c_o=no
break
fi
done
rm -f core conftest*
unset am_i
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
$as_echo "$am_cv_prog_cc_c_o" >&6; }
if test "$am_cv_prog_cc_c_o" != 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=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:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CC_dependencies_compiler_type+:} false; 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".
rm -rf conftest.dir
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
am__universal=false
case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac
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 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# 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. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
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
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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:${as_lineno-$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:${as_lineno-$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 eval \${ac_cv_prog_make_${ac_make}_set+:} false; 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:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
SET_MAKE=
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
SET_MAKE="MAKE=${MAKE-make}"
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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_CXX+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $CXX" >&5
$as_echo "$CXX" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_CXX+:} false; 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 as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_prog_ac_ct_CXX="$ac_prog"
$as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
$as_echo "$ac_ct_CXX" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
set X $ac_compile
ac_compiler=$2
for ac_option in --version -v -V -qversion; do
{ { ac_try="$ac_compiler $ac_option >&5"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
$as_echo "$ac_try_echo"; } >&5
(eval "$ac_compiler $ac_option >&5") 2>conftest.err
ac_status=$?
if test -s conftest.err; then
sed '10a\
... rest of stderr output deleted ...
10q' conftest.err >conftest.er1
cat conftest.er1 >&5
fi
rm -f conftest.er1 conftest.err
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
done
{ $as_echo "$as_me:${as_lineno-$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 ${ac_cv_cxx_compiler_gnu+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
#ifndef __GNUC__
choke me
#endif
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_compiler_gnu=yes
else
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:${as_lineno-$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:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
$as_echo_n "checking whether $CXX accepts -g... " >&6; }
if ${ac_cv_prog_cxx_g+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_prog_cxx_g=yes
else
CXXFLAGS=""
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
else
ac_cxx_werror_flag=$ac_save_cxx_werror_flag
CXXFLAGS="-g"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_compile "$LINENO"; then :
ac_cv_prog_cxx_g=yes
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:${as_lineno-$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:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
$as_echo_n "checking dependency style of $depcc... " >&6; }
if ${am_cv_CXX_dependencies_compiler_type+:} false; 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".
rm -rf conftest.dir
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
am__universal=false
case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac
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 10 /bin/sh.
echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# 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. Also, some Intel
# versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
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
;;
msvc7 | msvc7msys | msvisualcpp | msvcmsys)
# This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj 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 $am__obj 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:${as_lineno-$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
func_stripname_cnf ()
{
case ${2} in
.*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
esac
} # func_stripname_cnf
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:${as_lineno-$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 ${ac_cv_prog_CXXCPP+:} false; 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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if ac_fn_cxx_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_cxx_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i 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:${as_lineno-$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 confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#ifdef __STDC__
# include
#else
# include
#endif
Syntax error
_ACEOF
if ac_fn_cxx_try_cpp "$LINENO"; then :
else
# Broken: fails on valid input.
continue
fi
rm -f conftest.err conftest.i conftest.$ac_ext
# OK, works on sane cases. Now check whether nonexistent headers
# can be detected and how.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include
_ACEOF
if ac_fn_cxx_try_cpp "$LINENO"; then :
# Broken: success on invalid input.
continue
else
# Passes both tests.
ac_preproc_ok=:
break
fi
rm -f conftest.err conftest.i conftest.$ac_ext
done
# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
rm -f conftest.i conftest.err conftest.$ac_ext
if $ac_preproc_ok; then :
else
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
See \`config.log' for more details" "$LINENO" 5; }
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_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
reload_flag_CXX=$reload_flag
reload_cmds_CXX=$reload_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_CFLAGS=$CFLAGS
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++"}
CFLAGS=$CXXFLAGS
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 "$cc_temp" | $SED "s%.*/%%; 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:${as_lineno-$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:${as_lineno-$LINENO}: checking for GNU ld" >&5
$as_echo_n "checking for GNU ld... " >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
$as_echo_n "checking for non-GNU ld... " >&6; }
fi
if ${lt_cv_path_LD+:} false; 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:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
if ${lt_cv_prog_gnu_ld+:} false; 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 $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
archive_expsym_cmds_CXX='$CC $pic_flag -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 -v "^Configured with:" | $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:${as_lineno-$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.
if test "${lt_cv_aix_libpath+set}" = set; then
aix_libpath=$lt_cv_aix_libpath
else
if ${lt_cv_aix_libpath__CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\([^ ]*\) *$/\1/
p
}
}'
lt_cv_aix_libpath__CXX=`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 "$lt_cv_aix_libpath__CXX"; then
lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath__CXX"; then
lt_cv_aix_libpath__CXX="/usr/lib:/lib"
fi
fi
aix_libpath=$lt_cv_aix_libpath__CXX
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 func_echo_all "${wl}${allow_undefined_flag}"; 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.
if test "${lt_cv_aix_libpath+set}" = set; then
aix_libpath=$lt_cv_aix_libpath
else
if ${lt_cv_aix_libpath__CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_cxx_try_link "$LINENO"; then :
lt_aix_libpath_sed='
/Import File Strings/,/^$/ {
/^0/ {
s/^0 *\([^ ]*\) *$/\1/
p
}
}'
lt_cv_aix_libpath__CXX=`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 "$lt_cv_aix_libpath__CXX"; then
lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath__CXX"; then
lt_cv_aix_libpath__CXX="/usr/lib:/lib"
fi
fi
aix_libpath=$lt_cv_aix_libpath__CXX
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'
if test "$with_gnu_ld" = yes; then
# We only use this code for GNU lds that support --whole-archive.
whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
whole_archive_flag_spec_CXX='$convenience'
fi
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*)
case $GXX,$cc_basename in
,cl* | no,cl*)
# Native MSVC
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec_CXX=' '
allow_undefined_flag_CXX=unsupported
always_export_symbols_CXX=yes
file_list_spec_CXX='@'
# 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_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
$SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
else
$SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
fi~
$CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
enable_shared_with_static_runtimes_CXX=yes
# Don't use ranlib
old_postinstall_cmds_CXX='chmod 644 $oldlib'
postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
lt_tool_outputfile="@TOOL_OUTPUT@"~
case $lt_outputfile in
*.exe|*.EXE) ;;
*)
lt_outputfile="$lt_outputfile.exe"
lt_tool_outputfile="$lt_tool_outputfile.exe"
;;
esac~
func_to_tool_file "$lt_outputfile"~
if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
$MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
$RM "$lt_outputfile.manifest";
fi'
;;
*)
# g++
# _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'
export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
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
;;
esac
;;
darwin* | rhapsody*)
archive_cmds_need_lc_CXX=no
hardcode_direct_CXX=no
hardcode_automatic_CXX=yes
hardcode_shlibpath_var_CXX=unsupported
if test "$lt_cv_ld_force_load" = "yes"; then
whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
else
whole_archive_flag_spec_CXX=''
fi
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=func_echo_all
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
;;
freebsd2.*)
# 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*)
;;
haiku*)
archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
link_all_deplibs_CXX=yes
;;
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; func_echo_all "$list"'
;;
*)
if test "$GXX" = yes; then
archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${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; func_echo_all "$list"'
;;
*)
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 $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
*)
archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${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" && func_echo_all "-set_version $verstring"` -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 $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -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 | kopensolaris*-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; func_echo_all "$list"'
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 | sort | $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 | sort | $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 | sort | $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 | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
;;
*) # Version 6 and above 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; func_echo_all \"$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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
;;
xl* | mpixl* | bgxl*)
# 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; func_echo_all \"$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='func_echo_all'
# 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=func_echo_all
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" && func_echo_all "${wl}-set_version $verstring"` -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" && func_echo_all "-set_version $verstring"` -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 "-set_version $verstring"` -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=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
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" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
;;
*)
archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${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 -v "^Configured with:" | $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* | sunCC*)
# 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='func_echo_all'
# 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 $pic_flag -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 $pic_flag -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 -v "^Configured with:" | $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 -v "^Configured with:" | $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'
old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
'"$old_archive_cmds_CXX"
reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
'"$reload_cmds_CXX"
;;
*)
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:${as_lineno-$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
_lt_libdeps_save_CFLAGS=$CFLAGS
case "$CC $CFLAGS " in #(
*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
esac
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; 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 ${prev}${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
fi
# Expand the sysroot to ease extracting the directories later.
if test -z "$prev"; then
case $p in
-L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
-R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
-l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
esac
fi
case $p in
=*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
esac
if test "$pre_test_object_deps_done" = no; then
case ${prev} 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
prev=
;;
*.lto.$objext) ;; # Ignore GCC LTO objects
*.$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
CFLAGS=$_lt_libdeps_save_CFLAGS
# 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* | sunCC*)
# 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=
# 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=
;;
haiku*)
# PIC is the default for Haiku.
# The "-static" flag exists, but is broken.
lt_prog_compiler_static_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
;;
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).
lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
;;
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 | kopensolaris*-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* | bgxl[cC]* | mpixl[cC]*)
# IBM XL 8.0, 9.0 on PPC and BlueGene
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* | sunCC*)
# 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:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
#
# Check to make sure the PIC flag actually works.
#
if test -n "$lt_prog_compiler_pic_CXX"; then
{ $as_echo "$as_me:${as_lineno-$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 ${lt_cv_prog_compiler_pic_works_CXX+:} false; 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:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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:${as_lineno-$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:${as_lineno-$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 ${lt_cv_prog_compiler_static_works_CXX+:} false; 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 "$_lt_linker_boilerplate" | $SED '/^$/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:${as_lineno-$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:${as_lineno-$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 ${lt_cv_prog_compiler_c_o_CXX+:} false; 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:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
{ $as_echo "$as_me:${as_lineno-$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 ${lt_cv_prog_compiler_c_o_CXX+:} false; 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:$LINENO: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:$LINENO: \$? = $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 "$_lt_compiler_boilerplate" | $SED '/^$/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:${as_lineno-$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:${as_lineno-$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:${as_lineno-$LINENO}: result: $hard_links" >&5
$as_echo "$hard_links" >&6; }
if test "$hard_links" = no; then
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$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'
exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
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
# Also, AIX nm treats weak defined symbols like other global defined
# symbols, whereas GNU nm marks them as "W".
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") || (\$ 2 == "W")) && (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*)
case $cc_basename in
cl*)
exclude_expsyms_CXX='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
;;
*)
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
;;
esac
;;
*)
export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
;;
esac
{ $as_echo "$as_me:${as_lineno-$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:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
$as_echo_n "(cached) " >&6
else
$RM conftest*
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; } 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\":${as_lineno-$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:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
then
lt_cv_archive_cmds_need_lc_CXX=no
else
lt_cv_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*
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
;;
esac
fi
;;
esac
{ $as_echo "$as_me:${as_lineno-$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 # correct to gnu/linux during the next big refactor
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 # correct to gnu/linux during the next big refactor
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