Index: trunk/MagicSoft/AMC/activemirrorcontrol/Makefile
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/Makefile	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/Makefile	(revision 3401)
@@ -0,0 +1,555 @@
+# Generated automatically from Makefile.in by config.pl.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 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.
+
+####### kdevelop will overwrite this part!!! (begin)##########
+
+
+SHELL = /bin/sh
+
+srcdir = .
+top_srcdir = .
+VPATH = .
+prefix = /opt/kde2
+exec_prefix = ${prefix}
+#>- 
+bindir = ${exec_prefix}/bin
+#>+ 3
+DEPDIR = .deps
+
+bindir = ${exec_prefix}/bin
+sbindir = ${exec_prefix}/sbin
+libexecdir = ${exec_prefix}/libexec
+datadir = ${prefix}/share
+sysconfdir = ${prefix}/etc
+sharedstatedir = ${prefix}/com
+localstatedir = ${prefix}/var
+libdir = ${exec_prefix}/lib
+infodir = ${prefix}/info
+mandir = ${prefix}/man
+includedir = ${prefix}/include
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/activemirrorcontrol
+pkglibdir = $(libdir)/activemirrorcontrol
+pkgincludedir = $(includedir)/activemirrorcontrol
+
+top_builddir = .
+
+ACLOCAL = aclocal
+AUTOCONF = autoconf
+AUTOMAKE = automake
+AUTOHEADER = autoheader
+
+INSTALL = /usr/bin/ginstall -c -p
+INSTALL_PROGRAM = ${INSTALL} $(INSTALL_STRIP_FLAG) $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_SCRIPT = ${INSTALL}
+transform = s,x,x,
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = i686-pc-linux-gnu
+build_triplet = i686-pc-linux-gnu
+host_alias = i686-pc-linux-gnu
+host_triplet = i686-pc-linux-gnu
+target_alias = i686-pc-linux-gnu
+target_triplet = i686-pc-linux-gnu
+ARTSCCONFIG = /opt/kde2/bin/artsc-config
+AS = @AS@
+AUTODIRS = 
+CC = gcc
+CONF_FILES =  $(top_srcdir)/./admin/configure.in.min $(top_srcdir)/configure.in.in
+CPP = gcc -E
+CXX = g++
+CXXCPP = g++ -E
+DCOPIDL = /opt/kde2/bin/dcopidl
+DCOPIDL2CPP = /opt/kde2/bin/dcopidl2cpp
+DCOP_DEPENDENCIES = $(DCOPIDL)
+DLLTOOL = @DLLTOOL@
+DPMSINC = @DPMSINC@
+DPMSLIB = @DPMSLIB@
+EXEEXT = 
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
+GLINC = @GLINC@
+GLLIB = @GLLIB@
+GMSGFMT = /usr/bin/msgfmt
+IDL = @IDL@
+IDL_DEPENDENCIES = @IDL_DEPENDENCIES@
+KDB2HTML = /opt/kde2/bin/kdb2html
+KDECONFIG = /opt/kde2/bin/kde-config
+KDE_CXXFLAGS = 
+KDE_EXTRA_RPATH = 
+KDE_INCLUDES = -I/opt/kde2/include
+KDE_LDFLAGS = -L/opt/kde2/lib
+KDE_PLUGIN = -avoid-version -module -no-undefined
+KDE_RPATH = -R $(kde_libraries) -R $(qt_libraries) -R $(x_libraries)
+KDE_USE_CLOSURE_FALSE = #
+KDE_USE_CLOSURE_TRUE = 
+KDE_USE_FINAL_FALSE = 
+KDE_USE_FINAL_TRUE = #
+LIBCOMPAT = 
+LIBCRYPT = -lcrypt
+LIBDL = -ldl
+LIBJPEG = -ljpeg
+LIBMICO = @LIBMICO@
+LIBOBJS = @LIBOBJS@
+LIBPNG = -lpng -lz -lm
+LIBPTHREAD = @LIBPTHREAD@
+LIBPYTHON = @LIBPYTHON@
+LIBQIMGIO = @LIBQIMGIO@
+LIBSM = -lSM -lICE
+LIBSOCKET = 
+LIBTIFF = @LIBTIFF@
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBUCB = 
+LIBZ = -lz
+LIB_KAB = -lkab
+LIB_KDECORE = -lkdecore
+LIB_KDEUI = -lkdeui
+LIB_KFILE = -lkfile
+LIB_KFM = 
+LIB_KFORMULA = -lkformula
+LIB_KHTML = -lkhtml
+LIB_KIMGIO = @LIB_KIMGIO@
+LIB_KIO = -lkio
+LIB_KPARTS = -lkparts
+LIB_KSPELL = -lkspell
+LIB_KSYCOCA = -lksycoca
+LIB_KWRITE = -lkwrite
+LIB_QT = -lqt $(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)
+LIB_SMB = -lsmb
+LIB_X11 = -lX11 $(LIBSOCKET)
+LN_S = ln -s
+MAKEINFO = makeinfo
+MCOPIDL = /opt/kde2/bin/mcopidl
+MICO_INCLUDES = @MICO_INCLUDES@
+MICO_LDFLAGS = @MICO_LDFLAGS@
+MOC = /usr/lib/qt2/bin/moc
+MSGFMT = /usr/bin/msgfmt
+NOOPT_CXXFLAGS =  -fno-exceptions -fno-check-new -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -Wnon-virtual-dtor -fno-builtin -g2 -Wall -fexceptions -DQT_THREAD_SUPPORT
+NOREPO = -fno-repo
+OBJDUMP = @OBJDUMP@
+OBJEXT = o
+PACKAGE = activemirrorcontrol
+PAMINC = @PAMINC@
+PAMLIBPATHS = @PAMLIBPATHS@
+PAMLIBS = @PAMLIBS@
+PYTHONINC = @PYTHONINC@
+PYTHONLIB = @PYTHONLIB@
+PYTHONMODDIR = @PYTHONMODDIR@
+QT_INCLUDES = -I/usr/lib/qt2/include
+QT_LDFLAGS = -L/usr/lib/qt2/lib
+RANLIB = ranlib
+REPO = -frepo
+STRIP = strip
+TOPSUBDIRS =  activemirrorcontrol doc po
+UIC = /usr/lib/qt2/bin/uic
+USER_INCLUDES = 
+USER_LDFLAGS = 
+USE_EXCEPTIONS = -fexceptions
+USE_RTTI = -frtti
+USE_THREADS = @USE_THREADS@
+VERSION = 0.1
+XGETTEXT = /usr/bin/xgettext
+XPMINC = @XPMINC@
+XPMLIB = @XPMLIB@
+X_EXTRA_LIBS = 
+X_INCLUDES = -I/usr/X11R6/include
+X_LDFLAGS = -L/usr/X11R6/lib
+X_PRE_LIBS = 
+all_includes = -I/opt/kde2/include -I/usr/lib/qt2/include -I/usr/X11R6/include 
+all_libraries = -L/usr/X11R6/lib -L/usr/lib/qt2/lib -L/opt/kde2/lib 
+idldir = @idldir@
+kde_appsdir = ${prefix}/share/applnk
+kde_bindir = ${exec_prefix}/bin
+kde_confdir = ${prefix}/share/config
+kde_datadir = ${prefix}/share/apps
+kde_htmldir = ${prefix}/share/doc/HTML
+kde_icondir = ${prefix}/share/icons
+kde_includes = /opt/kde2/include
+kde_libraries = /opt/kde2/lib
+kde_libs_htmldir = /opt/kde2/share/doc/HTML
+kde_libs_prefix = /opt/kde2
+kde_locale = ${prefix}/share/locale
+kde_mimedir = ${prefix}/share/mimelnk
+kde_moduledir = ${prefix}/lib/kde2
+kde_servicesdir = ${prefix}/share/services
+kde_servicetypesdir = ${prefix}/share/servicetypes
+kde_sounddir = ${prefix}/share/sounds
+kde_templatesdir = ${prefix}/share/templates
+kde_wallpaperdir = ${prefix}/share/wallpapers
+micodir = @micodir@
+qt_includes = /usr/lib/qt2/include
+qt_libraries = /usr/lib/qt2/lib
+x_includes = /usr/X11R6/include
+x_libraries = /usr/X11R6/lib
+
+SUBDIRS = activemirrorcontrol po doc 
+
+EXTRA_DIST = admin 
+
+####### kdevelop will overwrite this part!!! (end)############
+# not a GNU package. You can remove this line, if 
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 
+
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files 
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES = 
+DIST_COMMON =  ./stamp-h.in Makefile.am Makefile.in acinclude.m4 \
+aclocal.m4 config.h.in configure configure.in
+
+
+#>- DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 4
+KDE_DIST=Makefile.dist activemirrorcontrol.kdevprj configure.in.in activemirrorcontrol.doxygen messages.log 
+
+DISTFILES= $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+
+
+TAR = tar
+GZIP_ENV = --best
+#>- all: all-redirect
+#>+ 1
+all: docs-am  all-redirect
+.SUFFIXES:
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+#>- 	cd $(top_srcdir) && $(AUTOMAKE) --foreign ./Makefile
+#>+ 2
+	cd $(top_srcdir) && $(AUTOMAKE) --foreign ./Makefile
+	cd $(top_srcdir) && perl admin/am_edit Makefile.in
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+$(ACLOCAL_M4):  configure.in  acinclude.m4
+	cd $(srcdir) && $(ACLOCAL)
+
+config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+$(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+	cd $(srcdir) && $(AUTOCONF)
+
+config.h: stamp-h
+	@if test ! -f $@; then \
+		rm -f stamp-h; \
+		$(MAKE) stamp-h; \
+	else :; fi
+stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
+	cd $(top_builddir) \
+	  && CONFIG_FILES= CONFIG_HEADERS=config.h \
+	     $(SHELL) ./config.status
+	@echo timestamp > stamp-h 2> /dev/null
+$(srcdir)/config.h.in: $(srcdir)/stamp-h.in
+	@if test ! -f $@; then \
+		rm -f $(srcdir)/stamp-h.in; \
+		$(MAKE) $(srcdir)/stamp-h.in; \
+	else :; fi
+$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+	cd $(top_srcdir) && $(AUTOHEADER)
+	@echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null
+
+mostlyclean-hdr:
+
+clean-hdr:
+
+distclean-hdr:
+	-rm -f config.h
+
+maintainer-clean-hdr:
+
+# 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.
+
+
+
+all-recursive install-data-recursive install-exec-recursive \
+installdirs-recursive install-recursive uninstall-recursive  \
+check-recursive installcheck-recursive info-recursive dvi-recursive:
+	@set fnord $(MAKEFLAGS); amf=$$2; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; 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; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@set fnord $(MAKEFLAGS); amf=$$2; \
+	dot_seen=no; \
+	rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
+	  rev="$$subdir $$rev"; \
+	  test "$$subdir" = "." && dot_seen=yes; \
+	done; \
+	test "$$dot_seen" = "no" && rev=". $$rev"; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	here=`pwd` && cd $(srcdir) \
+	  && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+   if test "$$subdir" = .; then :; else \
+	    test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+   fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+	  || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+	-rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(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
+	-rm -rf $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz
+	mkdir $(distdir)/=build
+	mkdir $(distdir)/=inst
+	dc_install_base=`cd $(distdir)/=inst && pwd`; \
+	cd $(distdir)/=build \
+	  && ../configure --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) dist
+	-rm -rf $(distdir)
+	@banner="$(distdir).tar.gz is ready for distribution"; \
+	dashes=`echo "$$banner" | sed s/./=/g`; \
+	echo "$$dashes"; \
+	echo "$$banner"; \
+	echo "$$dashes"
+dist: distdir
+	-chmod -R a+r $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	-rm -rf $(distdir)
+dist-all: distdir
+	-chmod -R a+r $(distdir)
+	GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir)
+	-rm -rf $(distdir)
+distdir: $(DISTFILES)
+	-rm -rf $(distdir)
+	mkdir $(distdir)
+	-chmod 777 $(distdir)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign ./Makefile
+	@for file in $(DISTFILES); do \
+	  d=$(srcdir); \
+	  if test -d $$d/$$file; then \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+	  fi; \
+	done
+	for subdir in $(SUBDIRS); do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d $(distdir)/$$subdir \
+	    || mkdir $(distdir)/$$subdir \
+	    || exit 1; \
+	    chmod 777 $(distdir)/$$subdir; \
+	    (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	$(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook
+info-am:
+info: info-recursive
+dvi-am:
+dvi: dvi-recursive
+check-am: all-am
+check: check-recursive
+installcheck-am:
+installcheck: installcheck-recursive
+all-recursive-am: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+install-exec-am:
+install-exec: install-exec-recursive
+
+install-data-am:
+install-data: install-data-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-recursive
+uninstall-am:
+uninstall: uninstall-recursive
+all-am: Makefile config.h
+all-redirect: all-recursive-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs: installdirs-recursive
+installdirs-am:
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+mostlyclean-am:  mostlyclean-hdr mostlyclean-tags mostlyclean-generic
+
+mostlyclean: mostlyclean-recursive
+
+clean-am:  clean-hdr clean-tags clean-generic mostlyclean-am
+
+#>- clean: clean-recursive
+#>+ 1
+clean: kde-rpo-clean  clean-recursive
+
+distclean-am:  distclean-hdr distclean-tags distclean-generic clean-am
+	-rm -f libtool
+
+distclean: distclean-recursive
+	-rm -f config.status
+
+maintainer-clean-am:  maintainer-clean-hdr maintainer-clean-tags \
+		maintainer-clean-generic distclean-am
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f config.status
+
+.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
+install-data-recursive uninstall-data-recursive install-exec-recursive \
+uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \
+all-recursive check-recursive installcheck-recursive info-recursive \
+dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \
+maintainer-clean-recursive tags tags-recursive mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir info-am info \
+dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \
+install-exec-am install-exec install-data-am install-data install-am \
+install uninstall-am uninstall all-redirect all-am all installdirs-am \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
+
+$(top_srcdir)/subdirs:
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
+	@cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
+
+package-messages:
+	$(MAKE) -f admin/Makefile.common package-messages
+	$(MAKE) -C po merge
+
+dist-hook:
+	cd $(top_distdir) && perl admin/am_edit -padmin
+	cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+# 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:
+
+#>+ 2
+docs-am:
+
+#>+ 5
+force-reedit:
+		cd $(top_srcdir) && $(AUTOMAKE) --foreign ./Makefile
+	cd $(top_srcdir) && perl admin/am_edit Makefile.in
+
+
+#>+ 2
+final:
+	$(MAKE) all-am
+#>+ 2
+no-final:
+	$(MAKE) all-am
+#>+ 3
+cvs-clean:
+	$(MAKE) -f $(top_srcdir)/admin/Makefile.common cvs-clean
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
Index: trunk/MagicSoft/AMC/activemirrorcontrol/Makefile.am
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/Makefile.am	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/Makefile.am	(revision 3401)
@@ -0,0 +1,31 @@
+####### kdevelop will overwrite this part!!! (begin)##########
+
+SUBDIRS = activemirrorcontrol po doc 
+
+EXTRA_DIST = activemirrorcontrol.kdevprj 
+
+####### kdevelop will overwrite this part!!! (end)############
+# not a GNU package. You can remove this line, if 
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 
+
+$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
+
+$(top_srcdir)/subdirs:
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
+	@cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
+
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files 
+
+package-messages:
+	$(MAKE) -f admin/Makefile.common package-messages
+	$(MAKE) -C po merge
+
+EXTRA_DIST = admin 
+
+dist-hook:
+	cd $(top_distdir) && perl admin/am_edit -padmin
+	cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
Index: trunk/MagicSoft/AMC/activemirrorcontrol/Makefile.dist
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/Makefile.dist	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/Makefile.dist	(revision 3401)
@@ -0,0 +1,14 @@
+all: 
+	@echo "This Makefile is only for the CVS repository"
+	@echo "This will be deleted before making the distribution"
+	@echo ""
+	@if test ! -d admin; then \
+	   echo "Please recheckout this module!" ;\
+	   echo "for cvs: use checkout once and after that update again" ;\
+	   echo "for cvsup: checkout kde-common from cvsup and" ;\
+	   echo "   link kde-common/admin to ./admin" ;\
+	   exit 1 ;\
+	fi
+	$(MAKE) -f admin/Makefile.common cvs
+
+.SILENT:
Index: trunk/MagicSoft/AMC/activemirrorcontrol/Makefile.in
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/Makefile.in	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/Makefile.in	(revision 3401)
@@ -0,0 +1,568 @@
+# Makefile.in generated automatically by automake 1.5 from Makefile.am.
+
+# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
+# 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@
+
+####### kdevelop will overwrite this part!!! (begin)##########
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+top_builddir = .
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = @program_transform_name@
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+AMTAR = @AMTAR@
+ARTSCCONFIG = @ARTSCCONFIG@
+AS = @AS@
+AUTODIRS = @AUTODIRS@
+AWK = @AWK@
+CC = @CC@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DCOPIDL = @DCOPIDL@
+DCOPIDL2CPP = @DCOPIDL2CPP@
+DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPMSINC = @DPMSINC@
+DPMSLIB = @DPMSLIB@
+EXEEXT = @EXEEXT@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
+GLINC = @GLINC@
+GLLIB = @GLLIB@
+GMSGFMT = @GMSGFMT@
+IDL = @IDL@
+IDL_DEPENDENCIES = @IDL_DEPENDENCIES@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KDB2HTML = @KDB2HTML@
+KDECONFIG = @KDECONFIG@
+KDE_CXXFLAGS = @KDE_CXXFLAGS@
+KDE_EXTRA_RPATH = @KDE_EXTRA_RPATH@
+KDE_INCLUDES = @KDE_INCLUDES@
+KDE_LDFLAGS = @KDE_LDFLAGS@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_RPATH = @KDE_RPATH@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+LIBCOMPAT = @LIBCOMPAT@
+LIBCRYPT = @LIBCRYPT@
+LIBDL = @LIBDL@
+LIBJPEG = @LIBJPEG@
+LIBMICO = @LIBMICO@
+LIBOBJS = @LIBOBJS@
+LIBPNG = @LIBPNG@
+LIBPTHREAD = @LIBPTHREAD@
+LIBPYTHON = @LIBPYTHON@
+LIBQIMGIO = @LIBQIMGIO@
+LIBSM = @LIBSM@
+LIBSOCKET = @LIBSOCKET@
+LIBTIFF = @LIBTIFF@
+LIBTOOL = @LIBTOOL@
+LIBUCB = @LIBUCB@
+LIBZ = @LIBZ@
+LIB_KAB = @LIB_KAB@
+LIB_KDECORE = @LIB_KDECORE@
+LIB_KDEUI = @LIB_KDEUI@
+LIB_KFILE = @LIB_KFILE@
+LIB_KFM = @LIB_KFM@
+LIB_KFORMULA = @LIB_KFORMULA@
+LIB_KHTML = @LIB_KHTML@
+LIB_KIMGIO = @LIB_KIMGIO@
+LIB_KIO = @LIB_KIO@
+LIB_KPARTS = @LIB_KPARTS@
+LIB_KSPELL = @LIB_KSPELL@
+LIB_KSYCOCA = @LIB_KSYCOCA@
+LIB_KWRITE = @LIB_KWRITE@
+LIB_QT = @LIB_QT@
+LIB_SMB = @LIB_SMB@
+LIB_X11 = @LIB_X11@
+LN_S = @LN_S@
+MCOPIDL = @MCOPIDL@
+MICO_INCLUDES = @MICO_INCLUDES@
+MICO_LDFLAGS = @MICO_LDFLAGS@
+MOC = @MOC@
+MSGFMT = @MSGFMT@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+NOREPO = @NOREPO@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PAMINC = @PAMINC@
+PAMLIBPATHS = @PAMLIBPATHS@
+PAMLIBS = @PAMLIBS@
+PYTHONINC = @PYTHONINC@
+PYTHONLIB = @PYTHONLIB@
+PYTHONMODDIR = @PYTHONMODDIR@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+RANLIB = @RANLIB@
+REPO = @REPO@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+UIC = @UIC@
+USER_INCLUDES = @USER_INCLUDES@
+USER_LDFLAGS = @USER_LDFLAGS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+USE_THREADS = @USE_THREADS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XPMINC = @XPMINC@
+XPMLIB = @XPMLIB@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_INCLUDES = @X_INCLUDES@
+X_LDFLAGS = @X_LDFLAGS@
+X_PRE_LIBS = @X_PRE_LIBS@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+am__include = @am__include@
+am__quote = @am__quote@
+idldir = @idldir@
+install_sh = @install_sh@
+kde_appsdir = @kde_appsdir@
+kde_bindir = @kde_bindir@
+kde_confdir = @kde_confdir@
+kde_datadir = @kde_datadir@
+kde_htmldir = @kde_htmldir@
+kde_icondir = @kde_icondir@
+kde_includes = @kde_includes@
+kde_libraries = @kde_libraries@
+kde_libs_htmldir = @kde_libs_htmldir@
+kde_libs_prefix = @kde_libs_prefix@
+kde_locale = @kde_locale@
+kde_mimedir = @kde_mimedir@
+kde_moduledir = @kde_moduledir@
+kde_servicesdir = @kde_servicesdir@
+kde_servicetypesdir = @kde_servicetypesdir@
+kde_sounddir = @kde_sounddir@
+kde_templatesdir = @kde_templatesdir@
+kde_wallpaperdir = @kde_wallpaperdir@
+micodir = @micodir@
+qt_includes = @qt_includes@
+qt_libraries = @qt_libraries@
+x_includes = @x_includes@
+x_libraries = @x_libraries@
+
+SUBDIRS = activemirrorcontrol po doc 
+
+EXTRA_DIST = admin 
+
+####### kdevelop will overwrite this part!!! (end)############
+# not a GNU package. You can remove this line, if 
+# have all needed files, that a GNU package needs
+AUTOMAKE_OPTIONS = foreign 
+
+MAINTAINERCLEANFILES = subdirs configure.in acinclude.m4 configure.files 
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+DIST_SOURCES =
+
+RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \
+	uninstall-info-recursive all-recursive install-data-recursive \
+	install-exec-recursive installdirs-recursive install-recursive \
+	uninstall-recursive check-recursive installcheck-recursive
+DIST_COMMON = ./stamp-h.in Makefile.am Makefile.in acinclude.m4 \
+	aclocal.m4 admin/ChangeLog admin/config.guess admin/config.sub \
+	admin/depcomp admin/install-sh admin/ltcf-c.sh \
+	admin/ltcf-cxx.sh admin/ltcf-gcj.sh admin/ltconfig \
+	admin/ltmain.sh admin/missing admin/mkinstalldirs admin/ylwrap \
+	config.h.in configure configure.in
+DIST_SUBDIRS = $(SUBDIRS)
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool
+$(srcdir)/Makefile.in:  Makefile.am  $(top_srcdir)/configure.in $(ACLOCAL_M4)
+	cd $(top_srcdir) && \
+	  $(AUTOMAKE) --foreign  ./Makefile
+Makefile:  $(srcdir)/Makefile.in  $(top_builddir)/config.status
+	cd $(top_builddir) && \
+	  CONFIG_HEADERS= CONFIG_LINKS= \
+	  CONFIG_FILES=$@ $(SHELL) ./config.status
+
+$(top_builddir)/config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+$(srcdir)/configure:  $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
+	cd $(srcdir) && $(AUTOCONF)
+
+$(ACLOCAL_M4):  configure.in acinclude.m4
+	cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+config.h: stamp-h
+	@if test ! -f $@; then \
+		rm -f stamp-h; \
+		$(MAKE) stamp-h; \
+	else :; fi
+stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h stamp-hT
+	@echo timestamp > stamp-hT 2> /dev/null
+	cd $(top_builddir) \
+	  && CONFIG_FILES= CONFIG_HEADERS=config.h \
+	     $(SHELL) ./config.status
+	@mv stamp-hT stamp-h
+$(srcdir)/config.h.in:  $(srcdir)/./stamp-h.in
+	@if test ! -f $@; then \
+		rm -f $(srcdir)/./stamp-h.in; \
+		$(MAKE) $(srcdir)/./stamp-h.in; \
+	else :; fi
+$(srcdir)/./stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+	@rm -f $(srcdir)/./stamp-h.in $(srcdir)/./stamp-h.inT
+	@echo timestamp > $(srcdir)/./stamp-h.inT 2> /dev/null
+	cd $(top_srcdir) && $(AUTOHEADER)
+	@mv $(srcdir)/./stamp-h.inT $(srcdir)/./stamp-h.in
+
+distclean-hdr:
+	-rm -f config.h
+uninstall-info-am:
+
+# 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.
+$(RECURSIVE_TARGETS):
+	@set fnord $(MAKEFLAGS); amf=$$2; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; 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; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+mostlyclean-recursive clean-recursive distclean-recursive \
+maintainer-clean-recursive:
+	@set fnord $(MAKEFLAGS); amf=$$2; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	   || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	mkid -fID $$unique $(LISP)
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \
+	  || etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)
+
+GTAGS:
+	here=`CDPATH=: && cd $(top_builddir) && pwd` \
+	  && cd $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) $$here
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH
+
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+
+top_distdir = .
+# Avoid unsightly `./'.
+distdir = $(PACKAGE)-$(VERSION)
+
+GZIP_ENV = --best
+
+distdir: $(DISTFILES)
+	-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+	mkdir $(distdir)
+	$(mkinstalldirs) $(distdir)/admin
+	@for file in $(DISTFILES); do \
+	  if test -f $$file; then d=.; else d=$(srcdir); fi; \
+	  dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \
+	  if test "$$dir" != "$$file" && test "$$dir" != "."; then \
+	    $(mkinstalldirs) "$(distdir)/$$dir"; \
+	  fi; \
+	  if test -d $$d/$$file; then \
+	    cp -pR $$d/$$file $(distdir) \
+	    || exit 1; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || cp -p $$d/$$file $(distdir)/$$file \
+	    || exit 1; \
+	  fi; \
+	done
+	for subdir in $(SUBDIRS); do \
+	  if test "$$subdir" = .; then :; else \
+	    test -d $(distdir)/$$subdir \
+	    || mkdir $(distdir)/$$subdir \
+	    || exit 1; \
+	    (cd $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$(top_distdir)" \
+	        distdir=../$(distdir)/$$subdir \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	$(MAKE) $(AM_MAKEFLAGS) \
+	  top_distdir="${top_distdir}" distdir="$(distdir)" \
+	  dist-hook
+	-find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(SHELL) $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r $(distdir)
+dist: distdir
+	$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(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
+	-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+	GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(AMTAR) xf -
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/=build
+	mkdir $(distdir)/=inst
+	chmod a-w $(distdir)
+	dc_install_base=`CDPATH=: && cd $(distdir)/=inst && pwd` \
+	  && cd $(distdir)/=build \
+	  && ../configure --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 \
+	  && (test `find $$dc_install_base -type f -print | wc -l` -le 1 \
+	     || (echo "Error: files left after uninstall" 1>&2; \
+	         exit 1) ) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && $(MAKE) $(AM_MAKEFLAGS) distclean \
+	  && rm -f $(distdir).tar.gz \
+	  && (test `find . -type f -print | wc -l` -eq 0 \
+	     || (echo "Error: files left after distclean" 1>&2; \
+	         exit 1) )
+	-chmod -R a+w $(distdir) > /dev/null 2>&1; rm -rf $(distdir)
+	@echo "$(distdir).tar.gz is ready for distribution" | \
+	  sed 'h;s/./=/g;p;x;p;x'
+check-am: all-am
+check: check-recursive
+all-am: Makefile config.h
+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:
+	$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	  `test -z '$(STRIP)' || \
+	    echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES) stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+	-test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES)
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+dist-all: distdir
+	$(AMTAR) chof - $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	-chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir)
+distclean: distclean-recursive
+	-rm -f config.status config.cache config.log
+distclean-am: clean-am distclean-generic distclean-hdr distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-exec-am:
+
+install-info: install-info-recursive
+
+install-man:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+uninstall-am: uninstall-info-am
+
+uninstall-info: uninstall-info-recursive
+
+.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \
+	clean-generic clean-libtool clean-recursive dist dist-all \
+	distcheck distclean distclean-generic distclean-hdr \
+	distclean-libtool distclean-recursive distclean-tags distdir \
+	dvi dvi-am dvi-recursive info info-am info-recursive install \
+	install-am install-data install-data-am install-data-recursive \
+	install-exec install-exec-am install-exec-recursive \
+	install-info install-info-am install-info-recursive install-man \
+	install-recursive install-strip installcheck installcheck-am \
+	installdirs installdirs-am installdirs-recursive \
+	maintainer-clean maintainer-clean-generic \
+	maintainer-clean-recursive mostlyclean mostlyclean-generic \
+	mostlyclean-libtool mostlyclean-recursive tags tags-recursive \
+	uninstall uninstall-am uninstall-info-am \
+	uninstall-info-recursive uninstall-recursive
+
+
+$(top_srcdir)/configure.in: configure.in.in $(top_srcdir)/subdirs
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common configure.in ;
+
+$(top_srcdir)/subdirs:
+	cd $(top_srcdir) && $(MAKE) -f admin/Makefile.common subdirs
+
+$(top_srcdir)/acinclude.m4: $(top_srcdir)/admin/acinclude.m4.in $(top_srcdir)/admin/libtool.m4.in
+	@cd $(top_srcdir) && cat admin/acinclude.m4.in admin/libtool.m4.in > acinclude.m4
+
+package-messages:
+	$(MAKE) -f admin/Makefile.common package-messages
+	$(MAKE) -C po merge
+
+dist-hook:
+	cd $(top_distdir) && perl admin/am_edit -padmin
+	cd $(top_distdir) && $(MAKE) -f admin/Makefile.common subdirs
+# 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:
Index: trunk/MagicSoft/AMC/activemirrorcontrol/acinclude.m4
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/acinclude.m4	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/acinclude.m4	(revision 3401)
@@ -0,0 +1,4903 @@
+##   -*- autoconf -*-
+
+dnl    This file is part of the KDE libraries/packages
+dnl    Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
+dnl              (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
+
+dnl    This file is free software; you can redistribute it and/or
+dnl    modify it under the terms of the GNU Library General Public
+dnl    License as published by the Free Software Foundation; either
+dnl    version 2 of the License, or (at your option) any later version.
+
+dnl    This library is distributed in the hope that it will be useful,
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl    Library General Public License for more details.
+
+dnl    You should have received a copy of the GNU Library General Public License
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
+dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+dnl    Boston, MA 02111-1307, USA.
+
+dnl IMPORTANT NOTE:
+dnl Please do not modify this file unless you expect your modifications to be
+dnl carried into every other module in the repository. If you decide that you
+dnl really want to modify it, contact coolo@kde.org mentioning that you have
+dnl and that the modified file should be committed to every module.
+dnl
+dnl Single-module modifications are best placed in configure.in for kdelibs
+dnl and kdebase or configure.in.in if present.
+
+
+dnl ------------------------------------------------------------------------
+dnl Find a file (or one of more files in a list of dirs)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_FIND_FILE,
+[
+$3=NO
+for i in $2;
+do
+  for j in $1;
+  do
+    if test -r "$i/$j"; then
+      $3=$i
+      break 2
+    fi
+  done
+done
+])
+
+dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
+dnl	if-not-found, test-parameter)
+AC_DEFUN(KDE_FIND_PATH,
+[
+   AC_MSG_CHECKING([for $1])
+   if test -n "$$2"; then
+        kde_cv_path="$$2";
+   else
+        kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
+
+        AC_CACHE_VAL(kde_cv_path_$kde_cache,
+        [
+        kde_cv_path="NONE"
+	dirs="$3"
+	kde_save_IFS=$IFS
+	IFS=':'
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+        done
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/$1"; then
+	    if test -n "$5"
+	    then
+              evalstr="$dir/$1 $5 2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/$1"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/$1"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        ])
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      AC_MSG_RESULT(not found)
+      $4
+   else
+      AC_MSG_RESULT($kde_cv_path)
+      $2=$kde_cv_path
+
+   fi
+])
+
+AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
+[
+    AC_MSG_ERROR([No Qt meta object compiler (moc) found!
+Please check whether you installed Qt correctly.
+You need to have a running moc binary.
+configure tried to run $ac_cv_path_moc and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable MOC to the right one before running
+configure.
+])
+])
+
+AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
+[
+    AC_MSG_WARN([No Qt ui compiler (uic) found!
+Please check whether you installed Qt correctly.
+You need to have a running uic binary.
+configure tried to run $ac_cv_path_uic and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable UIC to the right one before running
+configure.
+])
+])
+
+dnl ------------------------------------------------------------------------
+dnl Find the meta object compiler and the ui compiler in the PATH,
+dnl in $QTDIR/bin, and some more usual places
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_PATH_QT_MOC_UIC,
+[
+   qt_bindirs=""
+   for dir in $kde_qt_dirs; do
+      qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
+   done
+   qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
+   if test ! "$ac_qt_bindir" = "NO"; then
+      qt_bindirs="$ac_qt_bindir $qt_bindirs"
+   fi
+
+   KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
+   KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC="" ; KDE_UIC_ERROR_MESSAGE])
+   if test -z "$UIC" ; then
+     if test -z "$UIC_NOT_NEEDED" ; then
+       exit 1
+     else
+       UIC="echo uic not available: "
+     fi
+   fi
+   AC_SUBST(MOC)
+   AC_SUBST(UIC)
+])
+
+AC_DEFUN(KDE_1_CHECK_PATHS,
+[
+  KDE_1_CHECK_PATH_HEADERS
+
+  KDE_TEST_RPATH=
+
+  if test -n "$USE_RPATH"; then
+
+     if test -n "$kde_libraries"; then
+       KDE_TEST_RPATH="-R $kde_libraries"
+     fi
+
+     if test -n "$qt_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
+     fi
+
+     if test -n "$x_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
+     fi
+
+     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
+  fi
+
+AC_MSG_CHECKING([for KDE libraries installed])
+ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_ERROR([your system fails at linking a small KDE application!
+Check, if your compiler is installed correctly and if you have used the
+same compiler to compile Qt and kdelibs as you did use now.
+For more details about this problem, look at the end of config.log.])
+fi
+
+if eval `KDEDIR= ./conftest 2>&5`; then
+  kde_result=done
+else
+  kde_result=problems
+fi
+
+KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
+kde_have_all_paths=yes
+
+KDE_SET_PATHS($kde_result)
+
+])
+
+AC_DEFUN(KDE_SET_PATHS,
+[
+  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+	kde_htmldir=\"$kde_htmldir\" \
+	kde_appsdir=\"$kde_appsdir\" \
+	kde_icondir=\"$kde_icondir\" \
+	kde_sounddir=\"$kde_sounddir\" \
+	kde_datadir=\"$kde_datadir\" \
+	kde_locale=\"$kde_locale\" \
+	kde_cgidir=\"$kde_cgidir\" \
+	kde_confdir=\"$kde_confdir\" \
+	kde_mimedir=\"$kde_mimedir\" \
+	kde_toolbardir=\"$kde_toolbardir\" \
+	kde_wallpaperdir=\"$kde_wallpaperdir\" \
+	kde_templatesdir=\"$kde_templatesdir\" \
+	kde_bindir=\"$kde_bindir\" \
+	kde_servicesdir=\"$kde_servicesdir\" \
+	kde_servicetypesdir=\"$kde_servicetypesdir\" \
+	kde_moduledir=\"$kde_moduledir\" \
+	kde_result=$1"
+])
+
+AC_DEFUN(KDE_SET_DEFAULT_PATHS,
+[
+if test "$1" = "default"; then
+
+  if test -z "$kde_htmldir"; then
+    kde_htmldir='\${prefix}/share/doc/HTML'
+  fi
+  if test -z "$kde_appsdir"; then
+    kde_appsdir='\${prefix}/share/applnk'
+  fi
+  if test -z "$kde_icondir"; then
+    kde_icondir='\${prefix}/share/icons'
+  fi
+  if test -z "$kde_sounddir"; then
+    kde_sounddir='\${prefix}/share/sounds'
+  fi
+  if test -z "$kde_datadir"; then
+    kde_datadir='\${prefix}/share/apps'
+  fi
+  if test -z "$kde_locale"; then
+    kde_locale='\${prefix}/share/locale'
+  fi
+  if test -z "$kde_cgidir"; then
+    kde_cgidir='\${exec_prefix}/cgi-bin'
+  fi
+  if test -z "$kde_confdir"; then
+    kde_confdir='\${prefix}/share/config'
+  fi
+  if test -z "$kde_mimedir"; then
+    kde_mimedir='\${prefix}/share/mimelnk'
+  fi
+  if test -z "$kde_toolbardir"; then
+    kde_toolbardir='\${prefix}/share/toolbar'
+  fi
+  if test -z "$kde_wallpaperdir"; then
+    kde_wallpaperdir='\${prefix}/share/wallpapers'
+  fi
+  if test -z "$kde_templatesdir"; then
+    kde_templatesdir='\${prefix}/share/templates'
+  fi
+  if test -z "$kde_bindir"; then
+    kde_bindir='\${exec_prefix}/bin'
+  fi
+  if test -z "$kde_servicesdir"; then
+    kde_servicesdir='\${prefix}/share/services'
+  fi
+  if test -z "$kde_servicetypesdir"; then
+    kde_servicetypesdir='\${prefix}/share/servicetypes'
+  fi
+  if test -z "$kde_moduledir"; then
+    kde_moduledir='\${prefix}/lib/kde2'
+  fi
+
+  KDE_SET_PATHS(defaults)
+
+else
+
+  if test $kde_qtver = 1; then
+     AC_MSG_RESULT([compiling])
+     KDE_1_CHECK_PATHS
+  else
+     AC_MSG_ERROR([path checking not yet supported for KDE 2])
+  fi
+
+fi
+])
+
+AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
+[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
+   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
+   test -z "$kde_datadir" || test -z "$kde_locale"  ||
+   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
+   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
+   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
+   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
+   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
+   test "$kde_have_all_paths" != "yes"; then
+     kde_have_all_paths=no
+  fi
+])
+
+AC_DEFUN(KDE_MISSING_PROG_ERROR,
+[
+    AC_MSG_ERROR([The important program $1 was not found!
+Please check whether you installed KDE correctly.
+])
+])
+
+AC_DEFUN(KDE_SUBST_PROGRAMS,
+[AC_REQUIRE([AC_CREATE_KFSSTND])dnl
+
+        kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde2/bin /usr/kde/bin /usr/local/kde/bin"
+        if test -n "$KDEDIRS"; then
+           kde_save_IFS=$IFS
+           IFS=:
+           for dir in $KDEDIRS; do
+                kde_default_bindirs="$dir/bin $kde_default_bindirs "
+           done
+           IFS=$kde_save_IFS
+        fi
+        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
+        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
+        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
+        KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
+        KDE_FIND_PATH(kdb2html, KDB2HTML, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kdb2html)])
+        KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
+        KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)])
+
+        DCOP_DEPENDENCIES='$(DCOPIDL)'
+        AC_SUBST(DCOPIDL)
+        AC_SUBST(DCOPIDL2CPP)
+        AC_SUBST(DCOP_DEPENDENCIES)
+        AC_SUBST(MCOPIDL)
+        AC_SUBST(KDB2HTML)
+        AC_SUBST(ARTSCCONFIG)
+        AC_SUBST(KDECONFIG)
+
+        if test -x "$KDECONFIG"; then # it can be "compiled"
+          kde_libs_prefix=`$KDECONFIG --prefix`
+          if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
+               AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
+                          This means it has been moved since you installed it.
+                          This won't work. Please recompile kdelibs for the new prefix.
+                          ])
+           fi
+           kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
+        else
+           kde_libs_prefix='$(prefix)'
+           kde_libs_htmldir='$(kde_htmldir)'
+        fi
+        AC_SUBST(kde_libs_prefix)
+        AC_SUBST(kde_libs_htmldir)
+])dnl
+
+AC_DEFUN(AC_CREATE_KFSSTND,
+[
+AC_REQUIRE([AC_CHECK_RPATH])
+
+AC_MSG_CHECKING([for KDE paths])
+kde_result=""
+kde_cached_paths=yes
+AC_CACHE_VAL(kde_cv_all_paths,
+[
+  KDE_SET_DEFAULT_PATHS($1)
+  kde_cached_paths=no
+])
+eval "$kde_cv_all_paths"
+KDE_CHECK_PATHS_FOR_COMPLETENESS
+if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
+  # wrong values were cached, may be, we can set better ones
+  kde_result=
+  kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
+  kde_datadir= kde_locale=  kde_cgidir=  kde_confdir=
+  kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
+  kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
+  kde_have_all_paths=
+  KDE_SET_DEFAULT_PATHS($1)
+  eval "$kde_cv_all_paths"
+  KDE_CHECK_PATHS_FOR_COMPLETENESS
+  kde_result="$kde_result (cache overridden)"
+fi
+if test "$kde_have_all_paths" = "no"; then
+  AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
+Since it had compiled and linked before, it must be a strange problem on your system.
+Look at config.log for details. If you are not able to fix this, look at
+http://www.kde.org/faq/installation.html or any www.kde.org mirror.
+(If you're using an egcs version on Linux, you may update binutils!)
+])
+else
+  rm -f conftest*
+  AC_MSG_RESULT($kde_result)
+fi
+
+bindir=$kde_bindir
+
+KDE_SUBST_PROGRAMS
+
+])
+
+AC_DEFUN(AC_SUBST_KFSSTND,
+[
+AC_SUBST(kde_htmldir)
+AC_SUBST(kde_appsdir)
+AC_SUBST(kde_icondir)
+AC_SUBST(kde_sounddir)
+AC_SUBST(kde_datadir)
+AC_SUBST(kde_locale)
+AC_SUBST(kde_confdir)
+AC_SUBST(kde_mimedir)
+AC_SUBST(kde_wallpaperdir)
+AC_SUBST(kde_bindir)
+dnl for KDE 2
+AC_SUBST(kde_templatesdir)
+AC_SUBST(kde_servicesdir)
+AC_SUBST(kde_servicetypesdir)
+AC_SUBST(kde_moduledir)
+if test "$kde_qtver" = 1; then
+  kde_minidir="$kde_icondir/mini"
+else
+# for KDE 1 - this breaks KDE2 apps using minidir, but
+# that's the plan ;-/
+  kde_minidir="/dev/null"
+fi
+dnl AC_SUBST(kde_minidir)
+dnl AC_SUBST(kde_cgidir)
+dnl AC_SUBST(kde_toolbardir)
+])
+
+AC_DEFUN(KDE_MISC_TESTS,
+[
+   AC_LANG_C
+   dnl Checks for libraries.
+   AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
+   AC_SUBST(LIBCOMPAT)
+   kde_have_crypt=
+   AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
+      AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
+        AC_MSG_WARN([you have no crypt in either libcrypt or libc.
+You should install libcrypt from another source or configure with PAM
+support])
+	kde_have_crypt=no
+      ]))
+   AC_SUBST(LIBCRYPT)
+   if test $kde_have_crypt = yes; then
+      AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
+   fi
+   AC_CHECK_KSIZE_T
+   AC_LANG_C
+   AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+   if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
+        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+   fi
+   AC_CHECK_FUNC(inet_ntoa)
+   if test $ac_cv_func_inet_ntoa = no; then
+     AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
+   fi
+   AC_CHECK_FUNC(connect)
+   if test $ac_cv_func_connect = no; then
+      AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
+        $X_EXTRA_LIBS)
+   fi
+
+   AC_CHECK_FUNC(remove)
+   if test $ac_cv_func_remove = no; then
+      AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
+   fi
+
+   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+   AC_CHECK_FUNC(shmat, ,
+     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
+   
+   # Solaris 2.6 needs -lresolv for res_init
+   AC_CHECK_FUNC(res_init, ,
+     AC_CHECK_LIB(resolv, res_init, X_EXTRA_LIBS="$X_EXTRA_LIBS -lresolv"))
+
+   LIBSOCKET="$X_EXTRA_LIBS"
+   AC_SUBST(LIBSOCKET)
+   AC_SUBST(X_EXTRA_LIBS)
+   AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
+   AC_SUBST(LIBUCB)
+
+   case $host in  dnl this *is* LynxOS specific
+   *-*-lynxos* )
+        AC_MSG_CHECKING([LynxOS header file wrappers])
+        [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
+        AC_MSG_RESULT(disabled)
+        AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
+         ;;
+    esac
+
+   KDE_CHECK_TYPES
+   KDE_CHECK_LIBDL
+])
+
+dnl ------------------------------------------------------------------------
+dnl Find the header files and libraries for X-Windows. Extended the
+dnl macro AC_PATH_X
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(K_PATH_X,
+[
+AC_REQUIRE([AC_PROG_CPP])dnl
+AC_REQUIRE([KDE_MISC_TESTS])dnl
+AC_MSG_CHECKING(for X)
+AC_LANG_SAVE
+AC_LANG_C
+AC_CACHE_VAL(kde_cv_have_x,
+[# One or both of the vars are not set, and there is no cached value.
+if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
+   kde_x_includes=NO
+else
+   kde_x_includes=$x_includes
+fi
+if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
+   kde_x_libraries=NO
+else
+   kde_x_libraries=$x_libraries
+fi
+
+# below we use the standard autoconf calls
+ac_x_libraries=$kde_x_libraries
+ac_x_includes=$kde_x_includes
+
+AC_PATH_X_DIRECT
+dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
+dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
+dnl location. The correct location is /usr/lib32 or an undefined value
+dnl (the linker is smart enough to pick the correct default library).
+dnl Things work just fine if you use just AC_PATH_X_DIRECT.
+case "$host" in
+mips-sgi-irix6*)
+  ;;
+*)
+  AC_PATH_X_XMKMF
+  if test -z "$ac_x_includes"; then
+    ac_x_includes="."
+  fi
+  if test -z "$ac_x_libraries"; then
+    ac_x_libraries="/usr/lib"
+  fi
+esac
+#from now on we use our own again
+
+# when the user already gave --x-includes, we ignore
+# what the standard autoconf macros told us.
+if test "$kde_x_includes" = NO; then
+  kde_x_includes=$ac_x_includes
+fi
+
+# for --x-libraries too
+if test "$kde_x_libraries" = NO; then
+  kde_x_libraries=$ac_x_libraries
+fi
+
+if test "$kde_x_includes" = NO; then
+  AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
+fi
+
+if test "$kde_x_libraries" = NO; then
+  AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
+fi
+
+# Record where we found X for the cache.
+kde_cv_have_x="have_x=yes \
+         kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
+])dnl
+eval "$kde_cv_have_x"
+
+if test "$have_x" != yes; then
+  AC_MSG_RESULT($have_x)
+  no_x=yes
+else
+  AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
+fi
+
+if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
+  X_INCLUDES=""
+  x_includes="."; dnl better than nothing :-
+ else
+  x_includes=$kde_x_includes
+  X_INCLUDES="-I$x_includes"
+fi
+
+if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
+  X_LDFLAGS=""
+  x_libraries="/usr/lib"; dnl better than nothing :-
+ else
+  x_libraries=$kde_x_libraries
+  X_LDFLAGS="-L$x_libraries"
+fi
+all_includes="$X_INCLUDES"
+all_libraries="$X_LDFLAGS"
+
+AC_SUBST(X_INCLUDES)
+AC_SUBST(X_LDFLAGS)
+AC_SUBST(x_libraries)
+AC_SUBST(x_includes)
+
+# Check for libraries that X11R6 Xt/Xaw programs need.
+ac_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+# check for ICE first), but we must link in the order -lSM -lICE or
+# we get undefined symbols.  So assume we have SM if we have ICE.
+# These have to be linked with before -lX11, unlike the other
+# libraries we check for below, so use a different variable.
+#  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
+AC_CHECK_LIB(ICE, IceConnectionNumber,
+  [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
+AC_SUBST(LIBSM)
+LDFLAGS="$ac_save_LDFLAGS"
+
+AC_SUBST(X_PRE_LIBS)
+
+LIB_X11='-lX11 $(LIBSOCKET)'
+AC_SUBST(LIB_X11)
+
+AC_MSG_CHECKING(for libXext)
+AC_CACHE_VAL(kde_cv_have_libXext,
+[
+kde_ldflags_safe="$LDFLAGS"
+kde_libs_safe="$LIBS"
+
+LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
+LIBS="-lXext -lX11 $LIBSOCKET"
+
+AC_TRY_LINK([
+#include <stdio.h>
+],
+[
+printf("hello Xext\n");
+],
+kde_cv_have_libXext=yes,
+kde_cv_have_libXext=no
+   )
+
+LDFLAGS=$kde_ldflags_safe
+LIBS=$kde_libs_safe
+ ])
+
+AC_MSG_RESULT($kde_cv_have_libXext)
+
+if test "$kde_cv_have_libXext" = "no"; then
+  AC_MSG_ERROR([We need a working libXext to proceed. Since configure
+can't find it itself, we stop here assuming that make wouldn't find
+them either.])
+fi
+
+])
+
+AC_LANG_RESTORE
+])
+
+AC_DEFUN(KDE_PRINT_QT_PROGRAM,
+[
+AC_REQUIRE([KDE_USE_QT])
+cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qglobal.h>
+#include <qapplication.h>
+#include <qapp.h>
+#include <qobjcoll.h>
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qevent.h>
+#include <qstring.h>
+#include <qstyle.h>
+EOF
+
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+#include <qiconview.h>
+EOF
+fi
+
+fi
+
+echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
+cat >> conftest.$ac_ext <<EOF
+#error 1
+#endif
+
+int main() {
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+    QStringList *t = new QStringList();
+EOF
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+    QIconView iv(0);
+    iv.setWordWrapIconText(false);
+    QString s;
+    s.setLatin1("Elvis is alive", 14);
+    int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
+EOF
+fi
+fi
+cat >> conftest.$ac_ext <<EOF
+    return 0;
+}
+EOF
+])
+
+AC_DEFUN(KDE_USE_QT,
+[
+
+if test -z "$1"; then
+  kde_qtver=2
+  kde_qtsubver=1
+else
+  kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
+  # following is the check if subversion isn´t found in passed argument
+  if test "$kde_qtsubver" = "$1"; then
+    kde_qtsubver=1
+  fi
+  kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
+  if test "$kde_qtver" = "1"; then
+    kde_qtsubver=42
+  else
+   # this is the version number fallback to 2.1, unless major version is 1 or 2
+   if test "$kde_qtver" != "2"; then
+    kde_qtver=2
+    kde_qtsubver=1
+   fi
+  fi
+fi
+
+if test -z "$2"; then
+  if test $kde_qtver = 2; then
+    if test $kde_qtsubver -gt 0; then
+      kde_qt_minversion=">= Qt 2.2.2"
+    else
+      kde_qt_minversion=">= Qt 2.0.2"
+    fi
+  else
+    kde_qt_minversion=">= 1.42 and < 2.0"
+  fi
+else
+   kde_qt_minversion=$2
+fi
+
+if test -z "$3"; then
+   if test $kde_qtver = 2; then
+    if test $kde_qtsubver -gt 0; then
+      kde_qt_verstring="QT_VERSION >= 222"
+    else
+      kde_qt_verstring="QT_VERSION >= 200"
+    fi
+   else
+    kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
+  fi
+else
+   kde_qt_verstring=$3
+fi
+
+if test $kde_qtver = 2; then
+   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
+else
+   kde_qt_dirs="$QTDIR /usr/lib/qt"
+fi
+])
+
+AC_DEFUN(KDE_CHECK_QT_DIRECT,
+[
+AC_REQUIRE([KDE_USE_QT])
+AC_MSG_CHECKING([if Qt compiles without flags])
+AC_CACHE_VAL(kde_cv_qt_direct,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
+ac_LIBRARY_PATH="$LIBRARY_PATH"
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_includes"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
+LD_LIBRARY_PATH=
+export LD_LIBRARY_PATH
+LIBRARY_PATH=
+export LIBRARY_PATH
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  kde_cv_qt_direct="yes"
+else
+  kde_cv_qt_direct="no"
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat conftest.$ac_ext >&AC_FD_CC
+fi
+
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
+export LD_LIBRARY_PATH
+LIBRARY_PATH="$ac_LIBRARY_PATH"
+export LIBRARY_PATH
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_qt_direct" = "yes"; then
+  AC_MSG_RESULT(yes)
+  $1
+else
+  AC_MSG_RESULT(no)
+  $2
+fi
+])
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the Qt headers and libraries.
+dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
+dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_PATH_QT_1_3,
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([KDE_USE_QT])
+
+dnl ------------------------------------------------------------------------
+dnl Add configure flag to enable linking to MT version of Qt library.
+dnl ------------------------------------------------------------------------
+
+AC_ARG_ENABLE(
+  mt,
+  [  --enable-mt             link to threaded Qt (experimental)],
+  kde_use_qt_mt=$enableval,
+  kde_use_qt_mt=no
+)
+
+USING_QT_MT=""
+
+dnl ------------------------------------------------------------------------
+dnl If we got --enable-qt-mt then adjust some vars for the host.
+dnl ------------------------------------------------------------------------
+
+if test "x$kde_use_qt_mt" = "xyes"; then
+
+  case $host in
+  *-*-linux-*)
+    if test "x$GCC" = "xyes"; then
+      CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT -pthread"
+      X_EXTRA_LIBS="$X_EXTRA_LIBS -pthread"
+    else
+      AC_MSG_WARN([Compiler is not gcc. MT support disabled.])
+    fi
+    ;;
+  *)
+    AC_MSG_WARN([MT not yet supported on $host - disabled.])
+    ;;
+  esac
+
+fi
+
+kde_qt_was_given=yes
+
+dnl ------------------------------------------------------------------------
+dnl If we haven't been told how to link to Qt, we work it out for ourselves.
+dnl ------------------------------------------------------------------------
+
+if test -z "$LIBQT_GLOB"; then
+
+  LIBQT_GLOB="libqt.*"
+
+fi
+
+if test -z "$LIBQT"; then
+
+  LIBQT="-lqt"
+  kde_int_qt="-lqt"
+
+dnl ------------------------------------------------------------------------
+dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
+dnl ------------------------------------------------------------------------
+
+  if test "x$kde_use_qt_mt" = "xyes"; then
+
+      case $host in
+      *-*-linux-*)
+        if test "x$GCC" = "xyes"; then
+          LIBQT="-lqt-mt"
+          kde_int_qt="-lqt-mt"
+          LIBQT_GLOB="libqt-mt.*"
+          USING_QT_MT="using -mt"
+        fi
+      ;;
+      esac
+  fi
+
+  kde_qt_was_given=no
+
+else
+  kde_int_qt="$LIBQT"
+fi
+
+if test $kde_qtver = 2; then
+
+  AC_REQUIRE([AC_FIND_PNG])
+  AC_REQUIRE([AC_FIND_JPEG])
+  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
+fi
+
+AC_MSG_CHECKING([for Qt])
+
+LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
+ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
+qt_libraries=""
+qt_includes=""
+AC_ARG_WITH(qt-dir,
+    [  --with-qt-dir=DIR       where the root of Qt is installed ],
+    [  ac_qt_includes="$withval"/include
+       ac_qt_libraries="$withval"/lib
+       ac_qt_bindir="$withval"/bin
+    ])
+
+AC_ARG_WITH(qt-includes,
+    [  --with-qt-includes=DIR  where the Qt includes are. ],
+    [
+       ac_qt_includes="$withval"
+    ])
+
+kde_qt_libs_given=no
+
+AC_ARG_WITH(qt-libraries,
+    [  --with-qt-libraries=DIR where the Qt library is installed.],
+    [  ac_qt_libraries="$withval"
+       kde_qt_libs_given=yes
+    ])
+
+AC_CACHE_VAL(ac_cv_have_qt,
+[#try to guess Qt locations
+
+qt_incdirs=""
+for dir in $kde_qt_dirs; do
+   qt_incdirs="$qt_incdirs $dir/include $dir"
+done
+qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt $x_includes"
+if test ! "$ac_qt_includes" = "NO"; then
+   qt_incdirs="$ac_qt_includes $qt_incdirs"
+fi
+
+if test "$kde_qtver" = "2"; then
+  kde_qt_header=qstyle.h
+else
+  kde_qt_header=qglobal.h
+fi
+
+AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
+ac_qt_includes="$qt_incdir"
+
+qt_libdirs=""
+for dir in $kde_qt_dirs; do
+   qt_libdirs="$qt_libdirs $dir/lib $dir"
+done
+qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
+if test ! "$ac_qt_libraries" = "NO"; then
+  qt_libdir=$ac_qt_libraries
+else
+  qt_libdirs="$ac_qt_libraries $qt_libdirs"
+  # if the Qt was given, the chance is too big that libqt.* doesn't exist
+  qt_libdir=NONE
+  for dir in $qt_libdirs; do
+    try="ls -1 $dir/${LIBQT_GLOB}"
+    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
+  done
+fi
+
+ac_qt_libraries="$qt_libdir"
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS"
+LIBS="$LIBS $LIBQT"
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  rm -f conftest*
+else
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat conftest.$ac_ext >&AC_FD_CC
+  ac_qt_libraries="NO"
+fi
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+AC_LANG_RESTORE
+if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
+  ac_cv_have_qt="have_qt=no"
+  ac_qt_notfound=""
+  if test "$ac_qt_includes" = NO; then
+    if test "$ac_qt_libraries" = NO; then
+      ac_qt_notfound="(headers and libraries)";
+    else
+      ac_qt_notfound="(headers)";
+    fi
+  else
+    ac_qt_notfound="(libraries)";
+  fi
+
+  AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
+For more details about this problem, look at the end of config.log.])
+else
+  have_qt="yes"
+fi
+])
+
+eval "$ac_cv_have_qt"
+
+if test "$have_qt" != yes; then
+  AC_MSG_RESULT([$have_qt]);
+else
+  ac_cv_have_qt="have_qt=yes \
+    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
+  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
+
+  qt_libraries="$ac_qt_libraries"
+  qt_includes="$ac_qt_includes"
+fi
+
+if test ! "$kde_qt_libs_given" = "yes"; then
+KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
+fi
+
+AC_SUBST(qt_libraries)
+AC_SUBST(qt_includes)
+
+if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
+ QT_INCLUDES="";
+else
+ QT_INCLUDES="-I$qt_includes"
+ all_includes="$QT_INCLUDES $all_includes"
+fi
+
+if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
+ QT_LDFLAGS=""
+else
+ QT_LDFLAGS="-L$qt_libraries"
+ all_libraries="$all_libraries $QT_LDFLAGS"
+fi
+
+AC_SUBST(QT_INCLUDES)
+AC_SUBST(QT_LDFLAGS)
+AC_PATH_QT_MOC_UIC
+
+LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
+AC_SUBST(LIB_QT)
+
+])
+
+AC_DEFUN(AC_PATH_QT,
+[
+AC_PATH_QT_1_3
+])
+
+AC_DEFUN(KDE_CHECK_FINAL,
+[
+  AC_ARG_ENABLE(final, [  --enable-final          build size optimized apps (experimental - needs lots of memory)],
+	kde_use_final=$enableval, kde_use_final=no)
+
+  KDE_COMPILER_REPO
+  if test "x$kde_use_final" = "xyes"; then
+      KDE_USE_FINAL_TRUE=""
+      KDE_USE_FINAL_FALSE="#"
+   else
+      KDE_USE_FINAL_TRUE="#"
+      KDE_USE_FINAL_FALSE=""
+  fi
+  AC_SUBST(KDE_USE_FINAL_TRUE)
+  AC_SUBST(KDE_USE_FINAL_FALSE)
+
+  AC_ARG_ENABLE(closure, [  --disable-closure       don't delay template instantiation],
+  	kde_use_closure=$enableval, kde_use_closure=yes)
+
+  if test "x$kde_use_closure" = "xyes"; then
+       KDE_USE_CLOSURE_TRUE=""
+       KDE_USE_CLOSURE_FALSE="#"
+#       CXXFLAGS="$CXXFLAGS $REPO"
+  else
+       KDE_USE_CLOSURE_TRUE="#"
+       KDE_USE_CLOSURE_FALSE=""
+  fi
+  AC_SUBST(KDE_USE_CLOSURE_TRUE)
+  AC_SUBST(KDE_USE_CLOSURE_FALSE)
+])
+
+dnl ------------------------------------------------------------------------
+dnl Now, the same with KDE
+dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
+dnl and $(kde_includes) will be the kdehdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_BASE_PATH_KDE,
+[
+AC_PREREQ([2.13])
+AC_REQUIRE([AC_PATH_QT])dnl
+AC_CHECK_RPATH
+AC_MSG_CHECKING([for KDE])
+
+if test "${prefix}" != NONE; then
+  kde_includes=${prefix}/include
+  ac_kde_includes=$prefix/include
+
+  if test "${exec_prefix}" != NONE; then
+    kde_libraries=${exec_prefix}/lib
+    ac_kde_libraries=$exec_prefix/lib
+  else
+    kde_libraries=${prefix}/lib
+    ac_kde_libraries=$prefix/lib
+  fi
+else
+  ac_kde_includes=
+  ac_kde_libraries=
+  kde_libraries=""
+  kde_includes=""
+fi
+
+AC_CACHE_VAL(ac_cv_have_kde,
+[#try to guess kde locations
+
+if test "$kde_qtver" = 1; then
+  kde_check_header="ksock.h"
+  kde_check_lib="libkdecore.la"
+else
+  kde_check_header="ksharedptr.h"
+  kde_check_lib="libkio.la"
+fi
+
+if test -z "$1"; then
+
+kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
+test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
+kde_incdirs="$ac_kde_includes $kde_incdirs"
+AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
+ac_kde_includes="$kde_incdir"
+
+if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
+  AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE headers installed. This will fail.
+So, check this please and use another prefix!])
+fi
+
+kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
+test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
+kde_libdirs="$ac_kde_libraries $kde_libdirs"
+AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
+ac_kde_libraries="$kde_libdir"
+
+if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
+AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE libraries installed. This will fail.
+So, check this please and use another prefix!])
+fi
+ac_kde_libraries="$kde_libdir"
+
+if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
+  ac_cv_have_kde="have_kde=no"
+else
+  ac_cv_have_kde="have_kde=yes \
+    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+fi
+
+else dnl test -z $1
+
+  ac_cv_have_kde="have_kde=no"
+
+fi
+])dnl
+
+eval "$ac_cv_have_kde"
+
+if test "$have_kde" != "yes"; then
+ if test "${prefix}" = NONE; then
+  ac_kde_prefix="$ac_default_prefix"
+ else
+  ac_kde_prefix="$prefix"
+ fi
+ if test "$exec_prefix" = NONE; then
+  ac_kde_exec_prefix="$ac_kde_prefix"
+  AC_MSG_RESULT([will be installed in $ac_kde_prefix])
+ else
+  ac_kde_exec_prefix="$exec_prefix"
+  AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
+ fi
+
+ kde_libraries="${ac_kde_exec_prefix}/lib"
+ kde_includes=${ac_kde_prefix}/include
+
+else
+  ac_cv_have_kde="have_kde=yes \
+    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+  AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
+
+  kde_libraries="$ac_kde_libraries"
+  kde_includes="$ac_kde_includes"
+fi
+AC_SUBST(kde_libraries)
+AC_SUBST(kde_includes)
+
+if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
+ KDE_INCLUDES=""
+else
+ KDE_INCLUDES="-I$kde_includes"
+ all_includes="$KDE_INCLUDES $all_includes"
+fi
+ 
+KDE_LDFLAGS="-L$kde_libraries"
+if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
+ all_libraries="$all_libraries $KDE_LDFLAGS"
+fi
+
+AC_SUBST(KDE_LDFLAGS)
+AC_SUBST(KDE_INCLUDES)
+
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+all_libraries="$all_libraries $USER_LDFLAGS"
+all_includes="$all_includes $USER_INCLUDES"
+AC_SUBST(all_includes)
+AC_SUBST(all_libraries)
+
+AC_SUBST(AUTODIRS)
+])
+
+AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
+[
+AC_MSG_CHECKING(for extra includes)
+AC_ARG_WITH(extra-includes, [  --with-extra-includes=DIR
+                          adds non standard include paths],
+  kde_use_extra_includes="$withval",
+  kde_use_extra_includes=NONE
+)
+kde_extra_includes=
+if test -n "$kde_use_extra_includes" && \
+   test "$kde_use_extra_includes" != "NONE"; then
+
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $kde_use_extra_includes; do
+     kde_extra_includes="$kde_extra_includes $dir"
+     USER_INCLUDES="$USER_INCLUDES -I$dir"
+   done
+   IFS=$ac_save_ifs
+   kde_use_extra_includes="added"
+else
+   kde_use_extra_includes="no"
+fi
+AC_SUBST(USER_INCLUDES)
+
+AC_MSG_RESULT($kde_use_extra_includes)
+
+kde_extra_libs=
+AC_MSG_CHECKING(for extra libs)
+AC_ARG_WITH(extra-libs, [  --with-extra-libs=DIR   adds non standard library paths],
+  kde_use_extra_libs=$withval,
+  kde_use_extra_libs=NONE
+)
+if test -n "$kde_use_extra_libs" && \
+   test "$kde_use_extra_libs" != "NONE"; then
+
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $kde_use_extra_libs; do
+     kde_extra_libs="$kde_extra_libs $dir"
+     KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
+     USER_LDFLAGS="$USER_LDFLAGS -L$dir"
+   done
+   IFS=$ac_save_ifs
+   kde_use_extra_libs="added"
+else
+   kde_use_extra_libs="no"
+fi
+
+AC_SUBST(USER_LDFLAGS)
+
+AC_MSG_RESULT($kde_use_extra_libs)
+
+])
+
+AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
+[
+    AC_MSG_CHECKING([for KDE headers installed])
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+cat > conftest.$ac_ext <<EOF
+#include <stdio.h>
+#include "confdefs.h"
+#include <kapp.h>
+
+int main() {
+    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
+    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
+    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
+    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
+    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
+    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
+    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
+    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
+    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
+    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
+    printf("kde_wallpaperdir=\\"%s\\"\n",
+	KApplication::kde_wallpaperdir().data());
+    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
+    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
+    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
+    return 0;
+    }
+EOF
+
+ ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
+ if AC_TRY_EVAL(ac_compile); then
+   AC_MSG_RESULT(yes)
+ else
+   AC_MSG_ERROR([your system is not able to compile a small KDE application!
+Check, if you installed the KDE header files correctly.
+For more details about this problem, look at the end of config.log.])
+  fi
+
+  AC_LANG_RESTORE
+])
+
+AC_DEFUN(KDE_CHECK_KDEQTADDON,
+[
+AC_MSG_CHECKING(for kde-qt-addon)
+AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
+[
+ kde_ldflags_safe="$LDFLAGS"
+ kde_libs_safe="$LIBS"
+ kde_cxxflags_safe="$CXXFLAGS"
+
+ LIBS="-lkde-qt-addon $LIBQT $LIBS"
+ CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
+ LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
+
+ AC_TRY_LINK([
+   #include <qdom.h>
+ ],
+ [
+   QDomDocument doc;
+ ],
+  kde_cv_have_kdeqtaddon=yes,
+  kde_cv_have_kdeqtaddon=no
+ )
+
+ LDFLAGS=$kde_ldflags_safe
+ LIBS=$kde_libs_safe
+ kde_cxxflags_safe="$CXXFLAGS"
+])
+
+AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
+
+if test "$kde_cv_have_kdeqtaddon" = "no"; then
+  AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
+It is a separate package (and CVS module) named kde-qt-addon.])
+fi
+])
+
+AC_DEFUN(KDE_CHECK_KIMGIO,
+[
+   AC_REQUIRE([AC_BASE_PATH_KDE])
+   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+   AC_REQUIRE([AC_FIND_TIFF])
+   AC_REQUIRE([AC_FIND_JPEG])
+   AC_REQUIRE([AC_FIND_PNG])
+   AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
+
+   if test "$1" = "existance"; then
+     AC_LANG_SAVE
+     AC_LANG_CPLUSPLUS
+     kde_save_LIBS="$LIBS"
+     LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
+     AC_CHECK_LIB(kimgio, kimgioRegister, [
+      LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
+      LIBS="$kde_save_LIBS"
+      AC_LANG_RESTORE
+   else
+      LIBKIMGIO_EXISTS=yes
+   fi
+
+   if test "$LIBKIMGIO_EXISTS" = "yes"; then
+     LIB_KIMGIO='-lkimgio'
+   else
+     LIB_KIMGIO=''
+   fi
+   AC_SUBST(LIB_KIMGIO)
+])
+
+AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
+[
+   AC_REQUIRE([KDE_MISC_TESTS])
+   AC_REQUIRE([KDE_CHECK_LIBDL])
+   AC_REQUIRE([K_PATH_X])
+
+if test $kde_qtver = 2; then
+   LIB_KDECORE='-lkdecore'
+   AC_SUBST(LIB_KDECORE)
+   LIB_KDEUI='-lkdeui'
+   AC_SUBST(LIB_KDEUI)
+   LIB_KFORMULA='-lkformula'
+   AC_SUBST(LIB_KFORMULA)
+   LIB_KIO='-lkio'
+   AC_SUBST(LIB_KIO)
+   LIB_KSYCOCA='-lksycoca'
+   AC_SUBST(LIB_KSYCOCA)
+   LIB_SMB='-lsmb'
+   AC_SUBST(LIB_SMB)
+   LIB_KFILE='-lkfile'
+   AC_SUBST(LIB_KFILE)
+   LIB_KAB='-lkab'
+   AC_SUBST(LIB_KAB)
+   LIB_KHTML='-lkhtml'
+   AC_SUBST(LIB_KHTML)
+   LIB_KSPELL='-lkspell'
+   AC_SUBST(LIB_KSPELL)
+   LIB_KPARTS='-lkparts'
+   AC_SUBST(LIB_KPARTS)
+   LIB_KWRITE='-lkwrite'
+   AC_SUBST(LIB_KWRITE)
+else
+   LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
+   AC_SUBST(LIB_KDECORE)
+   LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
+   AC_SUBST(LIB_KDEUI)
+   LIB_KFM='-lkfm $(LIB_KDECORE)'
+   AC_SUBST(LIB_KFM)
+   LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
+   AC_SUBST(LIB_KFILE)
+   LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
+   AC_SUBST(LIB_KAB)
+fi
+])
+
+AC_DEFUN(AC_PATH_KDE,
+[
+  AC_BASE_PATH_KDE
+  AC_ARG_ENABLE(path-check, [  --disable-path-check    don't try to find out, where to install],
+  [
+  if test "$enableval" = "no";
+    then ac_use_path_checking="default"
+    else ac_use_path_checking=""
+  fi
+  ],
+  [
+  if test "$kde_qtver" = 1;
+    then ac_use_path_checking=""
+    else ac_use_path_checking="default"
+  fi
+  ]
+  )
+
+  AC_CREATE_KFSSTND($ac_use_path_checking)
+
+  AC_SUBST_KFSSTND
+  KDE_CREATE_LIBS_ALIASES
+])
+
+dnl obsolete
+AC_DEFUN(AC_CHECK_SETENV,
+[
+   AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl 
+   AC_CHECK_FUNCS([setenv unsetenv])
+])
+
+AC_DEFUN(AC_CHECK_GETDOMAINNAME,
+[
+AC_MSG_CHECKING(for getdomainname)
+AC_CACHE_VAL(ac_cv_func_getdomainname,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+save_CXXFLAGS="$CXXFLAGS"
+kde_safe_LIBS="$LIBS"
+LIBS="$LIBS $X_EXTRA_LIBS"
+if test "$GCC" = "yes"; then
+CXXFLAGS="$CXXFLAGS -pedantic-errors"
+fi
+AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <unistd.h>
+],
+[
+char buffer[200];
+getdomainname(buffer, 200);
+],
+ac_cv_func_getdomainname=yes,
+ac_cv_func_getdomainname=no)
+CXXFLAGS="$save_CXXFLAGS"
+LIBS=$kde_safe_LIBS
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_func_getdomainname)
+
+AC_MSG_CHECKING([if getdomainname needs custom prototype])
+AC_CACHE_VAL(ac_cv_proto_getdomainname,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
+  ac_cv_proto_getdomainname=no
+else
+  kde_safe_libs=$LIBS
+  LIBS="$LIBS $X_EXTRA_LIBS"
+  AC_TRY_LINK([
+#include <stdlib.h>
+#include <unistd.h>
+
+extern "C" int getdomainname (char *, int);
+],
+[
+char buffer[200];
+getdomainname(buffer, 200);
+],
+  ac_cv_func_getdomainname=yes
+  ac_cv_proto_getdomainname=yes,
+  AC_MSG_RESULT([fatal error])
+  AC_MSG_ERROR([getdomainname unavailable]))
+fi
+LIBS=$kde_safe_libs
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_proto_getdomainname)
+
+if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
+  AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
+fi
+if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then
+  AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1,
+  [Define if you have getdomainname prototype])
+fi
+
+])
+
+AC_DEFUN(AC_CHECK_GETHOSTNAME,
+[
+
+AC_MSG_CHECKING([for gethostname])
+AC_CACHE_VAL(ac_cv_func_gethostname,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+save_CXXFLAGS="$CXXFLAGS"
+if test "$GCC" = "yes"; then
+CXXFLAGS="$CXXFLAGS -pedantic-errors"
+fi
+AC_TRY_LINK([
+#include <stdlib.h>
+#include <unistd.h>
+],
+[
+char buffer[200];
+gethostname(buffer, 200);
+],
+ac_cv_func_gethostname=yes,
+ac_cv_func_gethostname=no)
+CXXFLAGS="$save_CXXFLAGS"
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_func_gethostname)
+
+AC_MSG_CHECKING([if gethostname needs custom prototype])
+AC_CACHE_VAL(ac_cv_proto_gethostname,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
+  ac_cv_proto_gethostname=no
+else
+  AC_TRY_LINK([
+#include <stdlib.h>
+#include <unistd.h>
+
+extern "C" int gethostname (char *, int);
+],
+[
+char buffer[200];
+gethostname(buffer, 200);
+],
+  ac_cv_func_gethostname=yes
+  ac_cv_proto_gethostname=yes,
+  AC_MSG_RESULT([fatal error])
+  AC_MSG_ERROR(gethostname unavailable))
+fi
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_proto_gethostname)
+
+if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then
+  AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1,
+  [Define if you have gethostname prototype])
+fi
+if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
+  AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have getdomainname])
+fi
+])
+
+AC_DEFUN(AC_CHECK_USLEEP,
+[
+AC_MSG_CHECKING([for usleep])
+AC_CACHE_VAL(ac_cv_func_usleep,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_libs_safe="$LIBS"
+LIBS="$LIBS $LIBUCB"
+AC_TRY_LINK([
+#include <stdlib.h>
+#include <unistd.h>
+],
+[
+usleep(200);
+],
+ac_cv_func_usleep=yes,
+ac_cv_func_usleep=no)
+LIBS="$ac_libs_safe"
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_func_usleep)
+if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
+  AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
+fi
+])
+
+AC_DEFUN(AC_CHECK_RANDOM,
+[
+AC_MSG_CHECKING([for random])
+AC_CACHE_VAL(ac_cv_func_random,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_libs_safe="$LIBS"
+LIBS="$LIBS $LIBUCB"
+AC_TRY_LINK([
+#include <stdlib.h>
+],
+[
+random();
+],
+ac_cv_func_random=yes,
+ac_cv_func_random=no)
+LIBS="$ac_libs_safe"
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_func_random)
+if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
+  AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
+fi
+])
+
+AC_DEFUN(AC_FIND_GIF,
+   [AC_MSG_CHECKING([for giflib])
+AC_CACHE_VAL(ac_cv_lib_gif,
+[ac_save_LIBS="$LIBS"
+LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
+AC_TRY_LINK(dnl
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+int GifLastError(void);
+#ifdef __cplusplus
+}
+#endif
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+],
+            [return GifLastError();],
+            eval "ac_cv_lib_gif=yes",
+            eval "ac_cv_lib_gif=no")
+LIBS="$ac_save_LIBS"
+])dnl
+if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
+else
+  AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
+fi
+])
+
+AC_DEFUN(KDE_FIND_JPEG_HELPER,
+[
+AC_MSG_CHECKING([for libjpeg$2])
+AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
+[
+AC_LANG_C
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[/* Override any gcc2 internal prototype to avoid an error.  */
+struct jpeg_decompress_struct;
+typedef struct jpeg_decompress_struct * j_decompress_ptr;
+typedef int size_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+    void jpeg_CreateDecompress(j_decompress_ptr cinfo,
+                                    int version, size_t structsize);
+#ifdef __cplusplus
+}
+#endif
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+],
+            [jpeg_CreateDecompress(0L, 0, 0);],
+            eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
+            eval "ac_cv_lib_jpeg_$1=no")
+LIBS="$ac_save_LIBS"
+CFLAGS="$ac_save_CFLAGS"
+])
+
+if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
+  LIBJPEG="$ac_cv_lib_jpeg_$1"
+  AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
+else
+  AC_MSG_RESULT(no)
+  $3
+fi
+
+])
+
+AC_DEFUN(AC_FIND_JPEG,
+[
+dnl first look for libraries
+KDE_FIND_JPEG_HELPER(6b, 6b,
+   KDE_FIND_JPEG_HELPER(normal, [],
+    [
+dnl what to do, if the normal way fails:
+	if test -f "$kde_libraries/libjpeg.so"; then
+	   test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
+	   ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
+	else if test -f "$kde_libraries/libjpeg.sl"; then
+	   test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
+	   ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"	
+	else if test -f "$kde_libraries/libjpeg.a"; then
+	   test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
+	   ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
+        else
+	  ac_cv_lib_jpeg=
+	fi
+      fi
+   fi
+
+   LIBJPEG=$ac_cv_lib_jpeg
+]))
+
+dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
+dnl requires system dependent includes loaded before it)
+jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes"
+AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
+test "x$jpeg_incdir" = xNO && jpeg_incdir=
+
+dnl if headers _and_ libraries are missing, this is no error, and we
+dnl continue with a warning (the user will get no jpeg support in khtml)
+dnl if only one is missing, it means a configuration error, but we still
+dnl only warn
+if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
+else
+  if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
+    AC_MSG_WARN([
+There is an installation error in jpeg support. You seem to have only one
+of either the headers _or_ the libraries installed. You may need to either
+provide correct --with-extra-... options, or the development package of
+libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
+Disabling JPEG support.
+])
+  else
+    AC_MSG_WARN([libjpeg not found. disable JPEG support.])
+  fi
+  jpeg_incdir=
+  LIBJPEG=
+fi
+
+AC_SUBST(LIBJPEG)
+])
+
+AC_DEFUN(AC_FIND_ZLIB,
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for libz])
+AC_CACHE_VAL(ac_cv_lib_z,
+[
+AC_LANG_C
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(dnl
+[
+#include<zlib.h>
+],
+            [return (zlibVersion() == ZLIB_VERSION); ],
+            eval "ac_cv_lib_z='-lz'",
+            eval "ac_cv_lib_z=no")
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if test ! "$ac_cv_lib_z" = no; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
+  LIBZ="$ac_cv_lib_z"
+  AC_SUBST(LIBZ)
+  AC_MSG_RESULT($ac_cv_lib_z)
+else
+  AC_MSG_ERROR(not found. Check your installation and look into config.log)
+  LIBZ=""
+  AC_SUBST(LIBZ)
+fi
+])
+
+AC_DEFUN(KDE_TRY_TIFFLIB,
+[
+AC_MSG_CHECKING([for libtiff $1])
+
+AC_CACHE_VAL(kde_cv_libtiff_$1,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
+kde_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+[
+#include<tiffio.h>
+],
+    [return (TIFFOpen( "", "r") == 0); ],
+[
+    kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
+], [
+    kde_cv_libtiff_$1=no
+])
+
+LIBS="$kde_save_LIBS"
+CXXFLAGS="$kde_save_CXXFLAGS"
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_libtiff_$1" = "no"; then
+    AC_MSG_RESULT(no)
+    LIBTIFF=""
+    $3
+else
+    LIBTIFF="$kde_cv_libtiff_$1"
+    AC_MSG_RESULT(yes)
+    AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
+    $2
+fi
+
+])
+
+AC_DEFUN(AC_FIND_TIFF,
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+KDE_TRY_TIFFLIB(tiff, [],
+   KDE_TRY_TIFFLIB(tiff34))
+
+AC_SUBST(LIBTIFF)
+])
+
+
+AC_DEFUN(AC_FIND_PNG,
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_MSG_CHECKING([for libpng])
+AC_CACHE_VAL(ac_cv_lib_png,
+[
+kde_save_LIBS="$LIBS"
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_LANG_C
+AC_TRY_LINK(dnl
+    [
+    #include<png.h>
+    ],
+    [
+    png_structp png_ptr = png_create_read_struct(  /* image ptr */
+		PNG_LIBPNG_VER_STRING, 0, 0, 0 );
+    return( png_ptr != 0 );
+    ],
+    eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
+    eval "ac_cv_lib_png=no"
+)
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
+  LIBPNG="$ac_cv_lib_png"
+  AC_SUBST(LIBPNG)
+  AC_MSG_RESULT($ac_cv_lib_png)
+else
+  AC_MSG_RESULT(no)
+  LIBPNG=""
+  AC_SUBST(LIBPNG)
+fi
+])
+
+AC_DEFUN(AC_CHECK_BOOL,
+[
+  AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
+])
+
+AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
+[
+AC_MSG_CHECKING(if you need GNU extensions)
+AC_CACHE_VAL(ac_cv_gnu_extensions,
+[
+cat > conftest.c << EOF
+#include <features.h>
+
+#ifdef __GNU_LIBRARY__
+yes
+#endif
+EOF
+
+if (eval "$ac_cpp conftest.c") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_gnu_extensions=yes
+else
+  ac_cv_gnu_extensions=no
+fi
+])
+
+AC_MSG_RESULT($ac_cv_gnu_extensions)
+if test "$ac_cv_gnu_extensions" = "yes"; then
+  AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
+fi
+])
+
+AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
+[
+AC_REQUIRE([AC_CHECK_COMPILERS])
+AC_MSG_CHECKING(whether $CXX supports -$1)
+kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
+AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
+[
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+])
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+AC_DEFUN(KDE_PROG_CC_PG,
+[ AC_CACHE_CHECK(whether ${CC-cc} accepts -pg, kde_cv_prog_cc_pg,
+  [echo 'void f(){}' > conftest.c
+   if test -z "`${CC-cc} -pg -c conftest.c 2>&1`"; then
+     kde_cv_prog_cc_pg=yes
+   else
+     kde_cv_prog_cc_pg=no
+   fi
+   rm -f conftest*
+])])
+
+AC_DEFUN(KDE_PROG_CXX_PG,
+[ AC_CACHE_CHECK(whether ${CXX-g++} accepts -pg, kde_cv_prog_cxx_pg,
+  [echo 'void f(){}' > conftest.cc
+   if test -z "`${CXX-g++} -pg -c conftest.cc 2>&1`"; then
+     kde_cv_prog_cxx_pg=yes
+   else
+     kde_cv_prog_cxx_pg=no
+   fi
+  rm -f conftest*
+])])
+
+dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
+dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
+dnl it's all white-space separated
+AC_DEFUN(AC_REMOVE_FORBIDDEN,
+[ __val=$$1
+  __forbid=" $2 "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS=" 	"
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
+	*) # Careful to not add spaces, where there were none, because otherwise
+	   # libtool gets confused, if we change e.g. CXX
+	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    $1=$__new
+  fi
+])
+
+dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
+AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
+[dnl
+ AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
+])
+
+AC_DEFUN(AC_CHECK_COMPILERS,
+[
+  dnl this is somehow a fat lie, but prevents other macros from double checking
+  AC_PROVIDE([AC_PROG_CC])
+  AC_PROVIDE([AC_PROG_CPP])
+  AC_PROVIDE([AC_PROG_CXX])
+  AC_PROVIDE([AC_PROG_CXXCPP])
+
+  AC_ARG_ENABLE(debug,[  --enable-debug          enables debug symbols [default=no]],
+  [
+   if test $enableval = "no"; dnl
+     then
+       kde_use_debug_code="no"
+       kde_use_debug_define=yes
+     else
+       kde_use_debug_code="yes"
+       kde_use_debug_define=no
+   fi
+  ], [kde_use_debug_code="no"
+      kde_use_debug_define=no
+    ])
+  dnl Just for configure --help
+  AC_ARG_ENABLE(dummyoption,[  --disable-debug         disables debug output and debug symbols [default=no]],[],[])
+
+  AC_ARG_ENABLE(strict,[  --enable-strict         compiles with strict compiler options (may not work!)],
+   [
+    if test $enableval = "no"; then
+         kde_use_strict_options="no"
+       else
+         kde_use_strict_options="yes"
+    fi
+   ], [kde_use_strict_options="no"])
+
+  AC_ARG_ENABLE(profile,[  --enable-profile        creates profiling infos [default=no]],
+     [kde_use_profiling=$enableval],
+     [kde_use_profiling="no"]
+  )
+
+dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it
+  AC_MSG_CHECKING(for a C-Compiler)
+  dnl if there is one, print out. if not, don't matter
+  AC_MSG_RESULT($CC)
+
+  if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi
+  if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi
+  if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi
+  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+
+  AC_PROG_CC_WORKS
+  AC_PROG_CC_GNU
+
+  if test $ac_cv_prog_gcc = yes; then
+    GCC=yes
+  else
+    GCC=
+  fi
+
+  USER_CFLAGS=$CFLAGS
+  CFLAGS=
+
+  if test -z "$CFLAGS"; then
+    if test "$kde_use_debug_code" = "yes"; then
+      AC_PROG_CC_G
+      if test $ac_cv_prog_cc_g = yes; then
+	CFLAGS="-g"
+	case $host in
+   	*-*-linux-gnu)	
+           CFLAGS="$CFLAGS -ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE -D_BSD_SOURCE"
+         ;;
+        esac
+      fi
+    else
+      if test "$GCC" = "yes"; then
+        CFLAGS="-O2"
+      else
+        CFLAGS=""
+      fi
+      if test "$kde_use_debug_define" = "yes"; then
+        CFLAGS="$CFLAGS -DNDEBUG"
+	dnl damn buggy compilers :-(
+	dnl if test "$GCC" = "yes"; then
+    	dnl  CFLAGS="$CFLAGS -fomit-frame-pointer"
+	dnl   CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
+	dnl fi
+      fi
+    fi
+
+    if test "$kde_use_profiling" = yes; then
+      KDE_PROG_CC_PG
+      if test "$kde_cv_prog_cc_pg" = yes; then
+        CFLAGS="$CFLAGS -pg"
+      fi
+    fi
+
+    if test "$GCC" = "yes"; then
+     CFLAGS="$CFLAGS"
+
+     if test "$kde_use_strict_options" = "yes"; then
+	CFLAGS="$CFLAGS -W -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
+     fi
+    fi
+
+  fi
+
+  case "$host" in
+  *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";;
+  *-*-sysv5uw7*) CFLAGS="$CFLAGS -D_UNIXWARE7";;
+  esac
+
+  if test -n "$USER_CFLAGS"; then
+    CFLAGS="$CFLAGS $USER_CFLAGS"
+  fi
+
+  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
+     LDFLAGS=""
+  fi
+
+
+dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks
+dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?)
+
+  AC_MSG_CHECKING(how to run the C preprocessor)
+  # On Suns, sometimes $CPP names a directory.
+  if test -n "$CPP" && test -d "$CPP"; then
+    CPP=
+  fi
+  if test -z "$CPP"; then
+  AC_CACHE_VAL(ac_cv_prog_CPP,
+  [  # This must be in double quotes, not single quotes, because CPP may get
+    # substituted into the Makefile and "${CC-cc}" will confuse make.
+    CPP="${CC-cc} -E"
+    # On the NeXT, cc -E runs the code through the compiler's parser,
+    # not just through cpp.
+    dnl Use a header file that comes with gcc, so configuring glibc
+    dnl with a fresh cross-compiler works.
+    AC_TRY_CPP([#include <assert.h>
+    Syntax Error], ,
+    CPP="${CC-cc} -E -traditional-cpp"
+    AC_TRY_CPP([#include <assert.h>
+    Syntax Error], , CPP=/lib/cpp))
+    ac_cv_prog_CPP="$CPP"])dnl
+    CPP="$ac_cv_prog_CPP"
+  else
+    ac_cv_prog_CPP="$CPP"
+  fi
+  AC_MSG_RESULT($CPP)
+  AC_SUBST(CPP)dnl
+
+
+  AC_MSG_CHECKING(for a C++-Compiler)
+  dnl if there is one, print out. if not, don't matter
+  AC_MSG_RESULT($CXX)
+
+  if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi
+  if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi
+  if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi
+  if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi
+  test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH])
+
+  AC_PROG_CXX_WORKS
+  AC_PROG_CXX_GNU
+
+  if test $ac_cv_prog_gxx = yes; then
+    GXX=yes
+  fi
+
+  USER_CXXFLAGS=$CXXFLAGS
+  CXXFLAGS=""
+
+  if test -z "$CXXFLAGS"; then
+    if test "$kde_use_debug_code" = "yes"; then
+      AC_PROG_CXX_G
+      if test $ac_cv_prog_cxx_g = yes; then
+        CXXFLAGS="-g"
+	case $host in  dnl
+   	*-*-linux-gnu)
+           CXXFLAGS="$CXXFLAGS -ansi -D_XOPEN_SOURCE -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion"
+         ;;
+        esac
+      fi
+    else
+      if test "$GXX" = "yes"; then
+         CXXFLAGS="-O2"
+      fi
+      if test "$kde_use_debug_define" = "yes"; then
+         CXXFLAGS="$CXXFLAGS -DNDEBUG"
+      fi
+    fi
+
+    if test "$kde_use_profiling" = yes; then
+      KDE_PROG_CXX_PG
+      if test "$kde_cv_prog_cxx_pg" = yes; then
+        CXXFLAGS="$CXXFLAGS -pg"
+      fi
+    fi
+    
+    KDE_CHECK_COMPILER_FLAG(fno-exceptions,
+    [
+      CXXFLAGS="$CXXFLAGS -fno-exceptions"
+    ])
+      
+dnl WABA: Nothing wrong with RTTI, keep it on.
+dnl    KDE_CHECK_COMPILER_FLAG(fno-rtti,
+dnl	[
+dnl	  CXXFLAGS="$CXXFLAGS -fno-rtti"
+dnl	])
+
+    KDE_CHECK_COMPILER_FLAG(fno-check-new,
+	[
+	  CXXFLAGS="$CXXFLAGS -fno-check-new"
+	])
+
+    if test "$GXX" = "yes"; then
+       CXXFLAGS="$CXXFLAGS"
+
+       if test true || test "$kde_use_debug_code" = "yes"; then
+	 CXXFLAGS="$CXXFLAGS -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
+
+         KDE_CHECK_COMPILER_FLAG(Wno-long-long,
+	 [
+	   CXXFLAGS="$CXXFLAGS -Wno-long-long"
+	 ])
+         KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,
+         [
+           CXXFLAGS="$CXXFLAGS -Wnon-virtual-dtor"
+         ])
+         KDE_CHECK_COMPILER_FLAG(fno-builtin,
+         [
+           CXXFLAGS="$CXXFLAGS -fno-builtin"
+         ])
+	
+       fi
+
+       if test "$kde_use_strict_options" = "yes"; then
+	CXXFLAGS="$CXXFLAGS -Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align"
+       fi
+
+       if test "$kde_very_strict" = "yes"; then
+         CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wredundant-decls -Wconversion"
+       fi
+    fi
+  fi
+
+    KDE_CHECK_COMPILER_FLAG(fexceptions,
+	[
+	  USE_EXCEPTIONS="-fexceptions"
+	],
+	  USE_EXCEPTIONS=
+	)
+    AC_SUBST(USE_EXCEPTIONS)
+
+    KDE_CHECK_COMPILER_FLAG(frtti,
+	[
+	  USE_RTTI="-frtti"
+	],
+	  USE_RTTI=
+	)
+    AC_SUBST(USE_RTTI)
+
+    case "$host" in
+      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS" ;;
+      *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";;
+      *-*-sysv5uw7*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE7";;
+      *-*-solaris*) 
+        if test "$GXX" = yes; then
+          libstdcpp=`gcc -print-file-name=libstdc++.so`
+          if test ! -f $libstdcpp; then
+             AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
+          fi
+        fi
+        ;;
+    esac
+
+    if test -n "$USER_CXXFLAGS"; then
+       CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
+    fi
+
+    AC_VALIDIFY_CXXFLAGS
+
+    AC_MSG_CHECKING(how to run the C++ preprocessor)
+    if test -z "$CXXCPP"; then
+      AC_CACHE_VAL(ac_cv_prog_CXXCPP,
+      [
+         AC_LANG_SAVE[]dnl
+         AC_LANG_CPLUSPLUS[]dnl
+         CXXCPP="${CXX-g++} -E"
+         AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
+         ac_cv_prog_CXXCPP="$CXXCPP"
+         AC_LANG_RESTORE[]dnl
+     ])dnl
+     CXXCPP="$ac_cv_prog_CXXCPP"
+    fi
+    AC_MSG_RESULT($CXXCPP)
+    AC_SUBST(CXXCPP)dnl
+
+    # the following is to allow programs, that are known to
+    # have problems when compiled with -O2
+    if test -n "$CXXFLAGS"; then
+      kde_safe_IFS=$IFS
+      IFS=" "
+      NOOPT_CXXFLAGS=""
+      for i in $CXXFLAGS; do
+        case $i in
+          -O*)
+                ;;
+          *)
+                NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
+                ;;
+        esac
+      done
+      IFS=$kde_safe_IFS
+    fi
+    AC_SUBST(NOOPT_CXXFLAGS)
+
+    KDE_CHECK_FINAL
+
+    ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
+
+    KDE_CXXFLAGS=
+    AC_SUBST(KDE_CXXFLAGS)
+])
+
+AC_DEFUN(KDE_ADD_DEPENDENCIES,
+[
+   [A]M_DEPENDENCIES(CC)
+   [A]M_DEPENDENCIES(CXX)
+])
+
+dnl just a wrapper to clean up configure.in
+AC_DEFUN(KDE_PROG_LIBTOOL,
+[
+AC_REQUIRE([AC_CHECK_COMPILERS])
+AC_REQUIRE([AC_ENABLE_SHARED])
+AC_REQUIRE([AC_ENABLE_STATIC])
+
+AC_REQUIRE([AC_LIBTOOL_DLOPEN])
+
+AC_LANG_SAVE
+AC_LANG_C
+AC_OBJEXT
+AC_EXEEXT
+AC_LANG_RESTORE
+
+AM_PROG_LIBTOOL
+AC_LIBTOOL_CXX
+
+LIBTOOL_SHELL="/bin/sh ./libtool"
+#  LIBTOOL="$LIBTOOL --silent"
+KDE_PLUGIN="-avoid-version -module -no-undefined"
+AC_SUBST(KDE_PLUGIN)
+])
+
+AC_DEFUN(KDE_CHECK_TYPES,
+[  AC_CHECK_SIZEOF(int, 4)dnl
+  AC_CHECK_SIZEOF(long, 4)dnl
+  AC_CHECK_SIZEOF(char *, 4)dnl
+])dnl
+
+AC_DEFUN(KDE_DO_IT_ALL,
+[
+AC_CANONICAL_SYSTEM
+AC_ARG_PROGRAM
+AM_INIT_AUTOMAKE($1, $2)
+AM_DISABLE_LIBRARIES
+AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+AC_CHECK_COMPILERS
+KDE_PROG_LIBTOOL
+AM_KDE_WITH_NLS
+AC_PATH_KDE
+])
+
+AC_DEFUN(AC_CHECK_RPATH,
+[
+AC_MSG_CHECKING(for rpath)
+AC_ARG_ENABLE(rpath,
+      [  --disable-rpath         do not use the rpath feature of ld],
+      USE_RPATH=$enableval, USE_RPATH=yes)
+
+if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
+
+  KDE_RPATH="-R \$(kde_libraries)"
+
+  if test -n "$qt_libraries"; then
+    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
+  fi
+  dnl $x_libraries is set to /usr/lib in case
+  if test -n "$X_LDFLAGS"; then
+    KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
+  fi
+  if test -n "$KDE_EXTRA_RPATH"; then
+    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
+  fi
+fi
+AC_SUBST(KDE_EXTRA_RPATH)
+AC_SUBST(KDE_RPATH)
+AC_MSG_RESULT($USE_RPATH)
+])
+
+dnl Check for the type of the third argument of getsockname
+AC_DEFUN(AC_CHECK_KSIZE_T,
+[AC_MSG_CHECKING(for the third argument of getsockname)
+AC_CACHE_VAL(ac_cv_ksize_t,
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+],[
+socklen_t a=0;
+getsockname(0,(struct sockaddr*)0, &a);
+],
+ac_cv_ksize_t=socklen_t,
+ac_cv_ksize_t=)
+if test -z "$ac_cv_ksize_t"; then
+ac_safe_cxxflags="$CXXFLAGS"
+if test "$GCC" = "yes"; then
+  CXXFLAGS="-Werror $CXXFLAGS"
+fi
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+],[
+int a=0;
+getsockname(0,(struct sockaddr*)0, &a);
+],
+ac_cv_ksize_t=int,
+ac_cv_ksize_t=size_t)
+CXXFLAGS="$ac_safe_cxxflags"
+fi
+AC_LANG_RESTORE
+])
+
+if test -z "$ac_cv_ksize_t"; then
+  ac_cv_ksize_t=int
+fi
+
+AC_MSG_RESULT($ac_cv_ksize_t)
+AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t,
+      [Define the type of the third argument for getsockname]
+)
+
+])
+
+dnl This is a merge of some macros out of the gettext aclocal.m4
+dnl since we don't need anything, I took the things we need
+dnl the copyright for them is:
+dnl >
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+dnl >
+dnl for this file it is relicensed under LGPL
+
+AC_DEFUN(AM_KDE_WITH_NLS,
+  [
+    dnl If we use NLS figure out what method
+
+    AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
+        [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
+    AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+     if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
+        AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
+        GMSGFMT=":"
+      fi
+      MSGFMT=$GMSGFMT
+      AC_SUBST(GMSGFMT)
+      AC_SUBST(MSGFMT)
+
+      AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
+	[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+
+      dnl Test whether we really found GNU xgettext.
+      if test "$XGETTEXT" != ":"; then
+	dnl If it is no GNU xgettext we define it as : so that the
+	dnl Makefiles still can work.
+	if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+	  : ;
+	else
+	  AC_MSG_RESULT(
+	    [found xgettext programs is not GNU xgettext; ignore it])
+	  XGETTEXT=":"
+	fi
+      fi
+     AC_SUBST(XGETTEXT)
+
+  ])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+# serial 1
+# Stephan Kulow: I appended a _KDE against name conflicts
+
+dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  /*)
+  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in ifelse([$5], , $PATH, [$5]); do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if [$3]; then
+	ac_cv_path_$1="$ac_dir/$ac_word"
+	break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+  ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# serial 1
+
+AC_DEFUN(AM_LC_MESSAGES,
+  [if test $ac_cv_header_locale_h = yes; then
+    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+    if test $am_cv_val_LC_MESSAGES = yes; then
+      AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
+    fi
+  fi])
+
+dnl From Jim Meyering.
+dnl FIXME: migrate into libit.
+
+AC_DEFUN(AM_FUNC_OBSTACK,
+[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
+ [AC_TRY_LINK([#include "obstack.h"],
+	      [struct obstack *mem;obstack_free(mem,(char *) 0)],
+	      am_cv_func_obstack=yes,
+	      am_cv_func_obstack=no)])
+ if test $am_cv_func_obstack = yes; then
+   AC_DEFINE(HAVE_OBSTACK)
+ else
+   LIBOBJS="$LIBOBJS obstack.o"
+ fi
+])
+
+dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
+dnl FIXME: Migrate into libit
+
+AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
+[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
+ [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
+              am_cv_lib_error_at_line=yes,
+	      am_cv_lib_error_at_line=no)])
+ if test $am_cv_lib_error_at_line = no; then
+   LIBOBJS="$LIBOBJS error.o"
+ fi
+ AC_SUBST(LIBOBJS)dnl
+])
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# serial 1
+# Stephan Kulow: I put a KDE in it to avoid name conflicts
+
+AC_DEFUN(AM_KDE_GNU_GETTEXT,
+  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+   AC_REQUIRE([AC_PROG_RANLIB])dnl
+   AC_REQUIRE([AC_HEADER_STDC])dnl
+   AC_REQUIRE([AC_TYPE_OFF_T])dnl
+   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+   AC_REQUIRE([AC_FUNC_MMAP])dnl
+   AC_REQUIRE([AM_KDE_WITH_NLS])dnl
+   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h string.h values.h alloca.h])
+   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+   AC_MSG_CHECKING(for stpcpy)
+   AC_CACHE_VAL(kde_cv_func_stpcpy,
+   [
+   kde_safe_cxxflags=$CXXFLAGS
+   CXXFLAGS="-Wmissing-prototypes -Werror"
+   AC_LANG_SAVE
+   AC_LANG_CPLUSPLUS
+   AC_TRY_COMPILE([
+   #include <string.h>
+   ],
+   [
+   char buffer[200];
+   stpcpy(buffer, buffer);
+   ],
+   kde_cv_func_stpcpy=yes,
+   kde_cv_func_stpcpy=no)
+   AC_LANG_RESTORE
+   CXXFLAGS=$kde_safe_cxxflags
+   ])
+   AC_MSG_RESULT($kde_cv_func_stpcpy)
+   if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
+     AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
+   fi
+
+   AM_LC_MESSAGES
+
+   if test "x$CATOBJEXT" != "x"; then
+     if test "x$ALL_LINGUAS" = "x"; then
+       LINGUAS=
+     else
+       AC_MSG_CHECKING(for catalogs to be installed)
+       NEW_LINGUAS=
+       for lang in ${LINGUAS=$ALL_LINGUAS}; do
+         case "$ALL_LINGUAS" in
+          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+         esac
+       done
+       LINGUAS=$NEW_LINGUAS
+       AC_MSG_RESULT($LINGUAS)
+     fi
+
+     dnl Construct list of names of catalog files to be constructed.
+     if test -n "$LINGUAS"; then
+       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+     fi
+   fi
+
+  ])
+
+AC_DEFUN(AC_HAVE_XPM,
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
+ test -z "$XPM_INCLUDE" && XPM_INCLUDE=
+
+ AC_ARG_WITH(xpm, [  --without-xpm           disable color pixmap XPM tests],
+	xpm_test=$withval, xpm_test="yes")
+ if test "x$xpm_test" = xno; then
+   ac_cv_have_xpm=no
+ else
+   AC_MSG_CHECKING(for XPM)
+   AC_CACHE_VAL(ac_cv_have_xpm,
+   [
+    AC_LANG_C
+    ac_save_ldflags="$LDFLAGS"
+    ac_save_cflags="$CFLAGS"
+    LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
+    CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
+    test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
+    AC_TRY_LINK([#include <X11/xpm.h>],[],
+	ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
+    LDFLAGS="$ac_save_ldflags"
+    CFLAGS="$ac_save_cflags"
+   ])dnl
+
+  if test "$ac_cv_have_xpm" = no; then
+    AC_MSG_RESULT(no)
+    XPM_LDFLAGS=""
+    XPMINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
+    if test "$XPM_LDFLAGS" = ""; then
+       XPMLIB='-lXpm $(LIB_X11)'
+    else
+       XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
+    fi
+    if test "$XPM_INCLUDE" = ""; then
+       XPMINC=""
+    else
+       XPMINC="-I$XPM_INCLUDE"
+    fi
+    AC_MSG_RESULT(yes)
+    $1
+  fi
+ fi
+ AC_SUBST(XPMINC)
+ AC_SUBST(XPMLIB)
+])
+
+AC_DEFUN(AC_HAVE_DPMS,
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
+ test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
+ DPMS_LIB=
+
+ AC_ARG_WITH(dpms, [  --without-dpms          disable DPMS power saving],
+	dpms_test=$withval, dpms_test="yes")
+ if test "x$dpms_test" = xno; then
+   ac_cv_have_dpms=no
+ else
+   AC_MSG_CHECKING(for DPMS)
+   dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
+   dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
+   AC_CACHE_VAL(ac_cv_have_dpms,
+   [
+    AC_LANG_C
+    ac_save_ldflags="$LDFLAGS"
+    ac_save_cflags="$CFLAGS"
+    ac_save_libs="$LIBS"
+    LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
+    CFLAGS="$CFLAGS $X_INCLUDES"
+    test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+    AC_TRY_LINK([
+	#include <X11/Xproto.h>
+	#include <X11/X.h>
+	#include <X11/Xlib.h>
+	#include <X11/extensions/dpms.h>
+	int foo_test_dpms()
+	{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+	ac_cv_have_dpms="yes", [
+            LDFLAGS="$ac_save_ldflags"
+            CFLAGS="$ac_save_cflags"
+            LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
+            LIBS="$LIBS -lXdpms"
+            CFLAGS="$CFLAGS $X_INCLUDES"
+            test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+            AC_TRY_LINK([
+	        #include <X11/Xproto.h>
+        	#include <X11/X.h>
+        	#include <X11/Xlib.h>
+        	#include <X11/extensions/dpms.h>
+        	int foo_test_dpms()
+        	{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+        	[
+                ac_cv_have_dpms="-lXdpms"
+                ],ac_cv_have_dpms="no")
+            ])
+    LDFLAGS="$ac_save_ldflags"
+    CFLAGS="$ac_save_cflags"
+    LIBS="$ac_save_libs"
+   ])dnl
+
+  if test "$ac_cv_have_dpms" = no; then
+    AC_MSG_RESULT(no)
+    DPMS_LDFLAGS=""
+    DPMSINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
+    if test "$ac_cv_have_dpms" = "-lXdpms"; then
+       DPMS_LIB="-lXdpms"
+    fi
+    if test "$DPMS_LDFLAGS" = ""; then
+       DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
+    else
+       DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
+    fi
+    if test "$DPMS_INCLUDE" = ""; then
+       DPMSINC=""
+    else
+       DPMSINC="-I$DPMS_INCLUDE"
+    fi
+    AC_MSG_RESULT(yes)
+    $1
+  fi
+ fi
+ AC_SUBST(DPMSINC)
+ AC_SUBST(DPMSLIB)
+])
+
+AC_DEFUN(AC_HAVE_GL,
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$GL_LDFLAGS" && GL_LDFLAGS=
+ test -z "$GL_INCLUDE" && GL_INCLUDE=
+
+ AC_ARG_WITH(gl, [  --without-gl            disable 3D GL modes],
+	gl_test=$withval, gl_test="yes")
+ if test "x$gl_test" = xno; then
+   ac_cv_have_gl=no
+ else
+   AC_MSG_CHECKING(for GL)
+   AC_CACHE_VAL(ac_cv_have_gl,
+   [
+    AC_LANG_C
+    ac_save_ldflags="$LDFLAGS"
+    ac_save_cflags="$CFLAGS"
+    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
+    CFLAGS="$CFLAGS $X_INCLUDES"
+    test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
+    AC_TRY_LINK([#include <GL/gl.h>
+#include <GL/glu.h>           
+], [],
+	ac_cv_have_gl="mesa", ac_cv_have_gl="no")
+    if test "x$ac_cv_have_gl" = "xno"; then
+      LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU -lX11 -lXext -lm $LIBSOCKET"
+      CFLAGS="$ac_save_cflags $X_INCLUDES"
+      test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
+      AC_TRY_LINK([#include <GL/gl.h>
+#include <GL/glu.h>
+], [],
+	  ac_cv_have_gl="yes", ac_cv_have_gl="no")
+    fi
+    LDFLAGS="$ac_save_ldflags"
+    CFLAGS="$ac_save_cflags"
+   ])dnl
+
+  if test "$ac_cv_have_gl" = "no"; then
+    AC_MSG_RESULT(no)
+    GL_LDFLAGS=""
+    GLINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
+    if test "$GL_LDFLAGS" = ""; then
+       if test "$ac_cv_have_gl" = "mesa"; then
+          GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)'
+       else
+          GLLIB='-lGL -lGLU $(LIB_X11)'
+       fi
+    else
+       if test "$ac_cv_have_gl" = "mesa"; then
+          GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)'
+       else
+          GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)'
+       fi
+    fi
+    if test "$GL_INCLUDE" = ""; then
+       GLINC=""
+    else
+       GLINC="-I$GL_INCLUDE"
+    fi
+    AC_MSG_RESULT($ac_cv_have_gl)
+    $1
+  fi
+ fi
+ AC_SUBST(GLINC)
+ AC_SUBST(GLLIB)
+])
+
+ dnl PAM pam
+
+ dnl Should test for PAM (Pluggable Authentication Modules)
+ AC_DEFUN(AC_PATH_PAM_DIRECT,
+ [
+ test -z "$pam_direct_test_library" && pam_direct_test_library=pam
+ test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h
+
+   for ac_dir in               \
+                               \
+     /usr/local/include        \
+     /usr/include              \
+     /usr/unsupported/include  \
+     /opt/include              \
+     /usr/pam/include          \
+     /usr/local/pam/include    \
+     /usr/lib/pam/include      \
+ 			      \
+     $extra_include            \
+     ; \
+   do
+     if test -r "$ac_dir/$pam_direct_test_include"; then
+       no_pam= ac_pam_includes=$ac_dir
+       break
+     fi
+   done
+
+ # First see if replacing the include by lib works.
+ for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \
+                           \
+     /lib                  \
+     /usr/lib              \
+     /usr/local/lib        \
+     /usr/unsupported/lib  \
+     /lib/security         \
+     /usr/security/lib     \
+     $extra_lib            \
+     ; \
+ do
+   for ac_extension in a so sl; do
+     if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then
+       no_pam= ac_pam_libraries=$ac_dir
+       break 2
+     fi
+   done
+ done
+])
+
+AC_DEFUN(AC_PATH_PAM,
+ [
+  AC_REQUIRE([KDE_CHECK_LIBDL])
+  AC_REQUIRE_CPP()dnl
+
+dnl AC_CHECK_LIB(pam_misc, main, [PAM_MISC_LIB="-lpam_misc"
+dnl              AC_DEFINE_UNQUOTED(HAVE_PAM_MISC, 1, [Define if you have a PAM implementation with the pam_misc library])], [], [-lpam $LIBDL])
+
+ AC_MSG_CHECKING(for PAM)
+ AC_ARG_WITH(pam,
+[  --with-pam[=ARG]        enable support for PAM: ARG=[yes|no|service name]],
+  [
+    if test "x$withval" = "xyes"; then
+      no_pam=
+      default_pam=yes
+    elif test "x$withval" = "xno"; then
+      no_pam=yes
+    else
+      no_pam=
+      pam_service="$withval"
+        if test -z "$pam_service"; then
+        default_pam=yes
+        else
+        default_pam=
+        fi
+      fi
+  ], no_pam=yes
+ )
+
+ if test ! "$no_pam" = yes; then
+
+ AC_CACHE_VAL(ac_cv_path_pam,
+ [
+ ac_pam_includes=NONE
+ ac_pam_libraries=NONE
+ if test -z "$pam_libraries"; then
+   pam_libraries=NONE
+ fi
+ if test -z "$pam_includes"; then
+   pam_includes=NONE
+ fi
+
+ AC_PATH_PAM_DIRECT
+
+ test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
+ test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
+
+ if test ! "x$pam_includes" = xNONE && test ! "x$pam_libraries" = xNONE; then
+   ac_pam_libs="-lpam $PAM_MISC_LIB $LIBDL"
+   ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries ac_pam_libs=\"$ac_pam_libs\""
+ else
+   ac_cv_path_pam="no_pam=yes"
+ fi
+ ])
+
+ eval "$ac_cv_path_pam"
+
+ fi
+
+ if test "$no_pam" = yes; then
+   AC_MSG_RESULT(no)
+ else
+   AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules); Redhat-Users!])
+   PAMLIBS="$ac_pam_libs"
+   test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
+   test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
+   AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes])
+ if test "$default_pam" = yes; then
+   AC_MSG_RESULT(["default pam service name will be used"])
+ else
+   AC_DEFINE_UNQUOTED(KDE_PAM_SERVICE,"$pam_service", [Define to change the default name of the PAM service used by KDE])
+   AC_MSG_RESULT(["pam service name will be: " $pam_service])
+ fi
+dnl test whether struct pam_message is const (Linux) or not (Sun)
+   pam_appl_h="$ac_pam_includes/security/pam_appl.h"
+   AC_MSG_CHECKING(for const pam_message)
+   AC_EGREP_HEADER([struct pam_message],
+      $pam_appl_h,
+      [ AC_EGREP_HEADER([const struct pam_message],
+                        $pam_appl_h,
+                        [AC_MSG_RESULT(["const: Linux-type PAM"]) ],
+                        [AC_MSG_RESULT(["nonconst: Sun-type PAM"])
+                        AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
+                        )],
+       [AC_MSG_RESULT(["not found - assume const, Linux-type PAM"])]
+       )
+ fi
+
+ if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then
+     PAMLIBPATHS="-L$pam_libraries"
+ fi
+ if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then
+     PAMINC="-I$pam_includes"
+ fi
+
+ AC_SUBST(PAMINC)
+ AC_SUBST(PAMLIBS)
+ AC_SUBST(PAMLIBPATHS)
+
+])
+
+AC_DEFUN(KDE_CHECK_LIBDL,
+[
+AC_CHECK_LIB(dl, dlopen, [
+LIBDL="-ldl"
+ac_cv_have_dlfcn=yes
+])
+
+AC_CHECK_LIB(dld, shl_unload, [
+LIBDL="-ldld"
+ac_cv_have_shload=yes
+])
+
+AC_SUBST(LIBDL)
+])
+
+AC_DEFUN(KDE_CHECK_DLOPEN,
+[
+KDE_CHECK_LIBDL
+AC_CHECK_HEADERS(dlfcn.h dl.h)
+if test "$ac_cv_header_dlfcn_h" = "no"; then
+  ac_cv_have_dlfcn=no
+fi
+
+if test "$ac_cv_header_dl_h" = "no"; then
+  ac_cv_have_shload=no
+fi
+
+dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
+dnl (MM)
+AC_ARG_ENABLE(dlopen,
+[  --disable-dlopen        link statically [default=no]] ,
+enable_dlopen=$enableval,
+enable_dlopen=yes)
+
+# override the user's opinion, if we know it better ;)
+if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
+  enable_dlopen=no
+fi
+
+if test "$ac_cv_have_dlfcn" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
+fi
+
+if test "$ac_cv_have_shload" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
+fi
+
+if test "$enable_dlopen" = no ; then
+  test -n "$1" && eval $1
+else
+  test -n "$2" && eval $2
+fi
+
+])
+
+AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
+[
+KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
+KDE_PROG_LIBTOOL
+AC_MSG_CHECKING([dynamic loading])
+eval "`egrep '^build_libtool_libs=' libtool`"
+if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
+  dynamic_loading=yes
+  AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
+else
+  dynamic_loading=no
+fi
+AC_MSG_RESULT($dynamic_loading)
+if test "$dynamic_loading" = "yes"; then
+  $1
+else
+  $2
+fi
+])
+
+AC_DEFUN(KDE_ADD_INCLUDES,
+[
+if test -z "$1"; then
+  test_include="Pix.h"
+else
+  test_include="$1"
+fi
+
+AC_MSG_CHECKING([for libg++ ($test_include)])
+
+AC_CACHE_VAL(kde_cv_libgpp_includes,
+[
+kde_cv_libgpp_includes=no
+
+   for ac_dir in               \
+                               \
+     /usr/include/g++          \
+     /usr/include              \
+     /usr/unsupported/include  \
+     /opt/include              \
+     $extra_include            \
+     ; \
+   do
+     if test -r "$ac_dir/$test_include"; then
+       kde_cv_libgpp_includes=$ac_dir
+       break
+     fi
+   done
+])
+
+AC_MSG_RESULT($kde_cv_libgpp_includes)
+if test "$kde_cv_libgpp_includes" != "no"; then
+  all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
+fi
+])
+])
+
+
+AC_DEFUN(KDE_CHECK_MICO,
+[
+AC_REQUIRE([KDE_CHECK_LIBDL])
+AC_REQUIRE([KDE_MISC_TESTS])
+AC_MSG_CHECKING(for MICO)
+
+if test -z "$MICODIR"; then
+    kde_micodir=/usr/local
+ else
+    kde_micodir="$MICODIR"
+fi
+
+AC_ARG_WITH(micodir,
+  [  --with-micodir=micodir  where mico is installed ],
+  kde_micodir=$withval,
+  kde_micodir=$kde_micodir
+)
+
+AC_CACHE_VAL(kde_cv_mico_incdir,
+[
+  mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
+AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
+
+])
+kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
+
+if test ! -r  $kde_micodir/include/CORBA.h; then
+  AC_MSG_ERROR([No CORBA.h found, specify another micodir])
+fi
+
+AC_MSG_RESULT($kde_micodir)
+
+MICO_INCLUDES=-I$kde_micodir/include
+AC_SUBST(MICO_INCLUDES)
+MICO_LDFLAGS=-L$kde_micodir/lib
+AC_SUBST(MICO_LDFLAGS)
+micodir=$kde_micodir
+AC_SUBST(micodir)
+
+AC_MSG_CHECKING([for MICO version])
+AC_CACHE_VAL(kde_cv_mico_version,
+[
+AC_LANG_C
+cat >conftest.$ac_ext <<EOF
+#include <stdio.h>
+#include <mico/version.h>
+int main() {
+
+   printf("MICO_VERSION=%s\n",MICO_VERSION);
+   return (0);
+}
+EOF
+ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
+if AC_TRY_EVAL(ac_compile); then
+  if eval `./conftest 2>&5`; then
+    kde_cv_mico_version=$MICO_VERSION
+  else
+    AC_MSG_ERROR([your system is not able to execute a small application to
+    find MICO version! Check $kde_micodir/include/mico/version.h])
+  fi
+else
+  AC_MSG_ERROR([your system is not able to compile a small application to
+  find MICO version! Check $kde_micodir/include/mico/version.h])
+fi
+])
+
+dnl installed MICO version
+mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
+mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
+mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
+
+if test "x$1" = "x"; then
+ req_version="2.3.0"
+else
+ req_version=$1
+fi
+
+dnl required MICO version
+req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
+req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
+req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
+
+if test "$mico_v_maj" -lt "$req_v_maj" || \
+   ( test "$mico_v_maj" -eq "$req_v_maj" && \
+        test "$mico_v_mid" -lt "$req_v_mid" ) || \
+   ( test "$mico_v_mid" -eq "$req_v_mid" && \
+        test "$mico_v_min" -lt "$req_v_min" )
+
+then
+  AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
+at least is required. You should upgrade MICO.])
+else
+  AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
+fi
+
+LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
+AC_SUBST(LIBMICO)
+if test -z "$IDL"; then
+  IDL='$(kde_bindir)/cuteidl'
+fi
+AC_SUBST(IDL)
+IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
+AC_SUBST(IDL_DEPENDENCIES)
+
+idldir="\$(includedir)/idl"
+AC_SUBST(idldir)
+
+])
+
+AC_DEFUN(KDE_CHECK_MINI_STL,
+[
+AC_REQUIRE([KDE_CHECK_MICO])
+
+AC_MSG_CHECKING(if we use mico's mini-STL)
+AC_CACHE_VAL(kde_cv_have_mini_stl,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_cxxflags="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
+AC_TRY_COMPILE(
+[
+#include <mico/config.h>
+],
+[
+#ifdef HAVE_MINI_STL
+#error "nothing"
+#endif
+],
+kde_cv_have_mini_stl=no,
+kde_cv_have_mini_stl=yes)
+CXXFLAGS="$kde_save_cxxflags"
+AC_LANG_RESTORE
+])
+
+if test "x$kde_cv_have_mini_stl" = "xyes"; then
+   AC_MSG_RESULT(yes)
+   $1
+else
+   AC_MSG_RESULT(no)
+   $2
+fi
+])
+
+])
+
+
+AC_DEFUN(KDE_CHECK_LIBPTHREAD,
+[
+AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
+AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
+[
+    AC_ARG_ENABLE(kernel-threads, [  --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
+	kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
+
+    if test "$kde_use_kernthreads" = "yes"; then
+      ac_save_CXXFLAGS="$CXXFLAGS"
+      ac_save_CFLAGS="$CXXFLAGS"
+      CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
+      CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
+      AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
+      CXXFLAGS="$ac_save_CXXFLAGS"
+      CFLAGS="$ac_save_CFLAGS"
+      if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
+        kde_use_kernthreads=no
+      else
+        dnl Add proper -I and -l statements
+        AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
+        if test "x$LIBPTHREAD" = "x"; then
+          kde_use_kernthreads=no
+        else
+          USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
+        fi
+      fi
+    else 
+      USE_THREADS=""
+      if test -z "$LIBPTHREAD"; then
+        KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
+      fi
+    fi
+
+    case $host_os in
+ 	solaris*)
+		KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
+                CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS"
+                echo "Setting Solaris pthread compilation options"
+    		;;
+        freebsd*)
+                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+                echo "Setting FreeBSD pthread compilation options"
+                ;;
+        aix*)
+                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+                LIBPTHREAD="$LIBPTHREAD -lc_r"
+                echo "Setting AIX pthread compilation options"
+                ;;
+        linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+                USE_THREADS="$USE_THREADS -DPIC -fPIC"
+                echo "Setting Linux pthread compilation options"
+                ;;
+	*)
+		;;
+    esac
+    AC_SUBST(USE_THREADS)
+    AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN(KDE_CHECK_THREADING,
+[
+  AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+  AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
+  dnl default is yes if libpthread is found and no if no libpthread is available
+  if test -z "$LIBPTHREAD"; then
+    kde_check_threading_default=no
+  else
+    kde_check_threading_default=yes
+  fi
+  AC_ARG_ENABLE(threading, [  --disable-threading     disables threading even if libpthread found ],
+   kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
+
+  if test "x$kde_use_threading" = "xyes"; then
+    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
+  fi
+])
+
+AC_DEFUN(KDE_TRY_LINK_PYTHON,
+[
+if test "$kde_python_link_found" = no; then
+
+if test "$1" = normal; then
+  AC_MSG_CHECKING(if a Python application links)
+else
+  AC_MSG_CHECKING(if Python depends on $2)
+fi
+
+AC_CACHE_VAL(kde_cv_try_link_python_$1,
+[
+AC_LANG_SAVE
+AC_LANG_C
+kde_save_cflags="$CFLAGS"
+CFLAGS="$CFLAGS $PYTHONINC"
+kde_save_libs="$LIBS"
+LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
+kde_save_ldflags="$LDFLAGS"
+LDFLAGS="$LDFLAGS $PYTHONLIB"
+
+AC_TRY_LINK(
+[
+#include <Python.h>
+],[
+	PySys_SetArgv(1, 0);
+],
+	[kde_cv_try_link_python_$1=yes],
+	[kde_cv_try_link_python_$1=no]
+)
+CFLAGS="$kde_save_cflags"
+LIBS="$kde_save_libs"
+LDFLAGS="$kde_save_ldflags"
+])
+
+if test "$kde_cv_try_link_python_$1" = "yes"; then
+  AC_MSG_RESULT(yes)
+  kde_python_link_found=yes
+  if test ! "$1" = normal; then
+    LIBPYTHON="$LIBPYTHON $2"
+  fi
+  $3
+else
+  AC_MSG_RESULT(no)
+  $4
+fi
+AC_LANG_RESTORE
+
+fi
+
+])
+
+AC_DEFUN(KDE_CHECK_PYTHON,
+[
+AC_REQUIRE([KDE_CHECK_LIBDL])
+AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+
+AC_MSG_CHECKING([for Python directory])
+
+AC_CACHE_VAL(kde_cv_pythondir,
+[
+  if test -z "$PYTHONDIR"; then
+    kde_cv_pythondir=/usr/local
+  else
+    kde_cv_pythondir="$PYTHONDIR"
+  fi
+])
+
+AC_ARG_WITH(pythondir,
+[  --with-pythondir=pythondir   use python installed in pythondir ],
+[
+  ac_python_dir=$withval
+], ac_python_dir=$kde_cv_pythondir
+)
+
+AC_MSG_RESULT($ac_python_dir)
+
+if test -z "$1"; then
+  version="1.5"
+else
+  version="$1"
+fi
+
+AC_MSG_CHECKING([for Python$version])
+
+python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
+AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
+if test ! -r $python_incdir/Python.h; then
+  AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
+  python_incdir=$python_incdir/python$version
+  if test ! -r $python_incdir/Python.h; then
+    AC_MSG_ERROR(Python.h not found.)
+  fi
+fi
+
+PYTHONINC=-I$python_incdir
+
+python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
+AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
+if test ! -r $python_libdir/libpython$version.a; then
+  AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
+  python_libdir=$python_libdir/python$version/config
+  if test ! -r $python_libdir/libpython$version.a; then
+    AC_MSG_ERROR(libpython$version.a not found.)
+  fi
+fi
+
+PYTHONLIB=-L$python_libdir
+if test -z "$LIBPYTHON"; then
+LIBPYTHON=-lpython$version
+fi
+
+python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
+AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
+python_moddir=$python_moddir/python$version
+if test ! -r $python_moddir/copy.py; then
+  AC_MSG_ERROR(python module directory not found.)
+fi
+
+PYTHONMODDIR=$python_moddir
+
+AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
+
+dnl Note: this test is very weak
+kde_python_link_found=no
+KDE_TRY_LINK_PYTHON(normal)
+KDE_TRY_LINK_PYTHON(m, -lm)
+KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
+KDE_TRY_LINK_PYTHON(tcl, -ltcl)
+KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm], [],
+	[AC_MSG_WARN([it seems, Python depends on another library.
+    Pleae use \"make LIBPTYHON='-lpython$version -lotherlib'\" to fix this
+    and contact the authors to let them know about this problem])
+	])
+
+LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
+AC_SUBST(PYTHONINC)
+AC_SUBST(PYTHONLIB)
+AC_SUBST(LIBPYTHON)
+AC_SUBST(PYTHONMODDIR)
+
+])
+
+
+AC_DEFUN(KDE_CHECK_STL_SGI,
+[
+    AC_MSG_CHECKING([if STL implementation is SGI like])
+    AC_CACHE_VAL(kde_cv_stl_type_sgi,
+    [
+      AC_TRY_COMPILE([
+#include <string>
+using namespace std;
+],[
+  string astring="Hallo Welt.";
+  astring.erase(0, 6); // now astring is "Welt"
+  return 0;
+], kde_cv_stl_type_sgi=yes,
+   kde_cv_stl_type_sgi=no)
+])
+
+   AC_MSG_RESULT($kde_cv_stl_type_sgi)
+
+   if test "$kde_cv_stl_type_sgi" = "yes"; then
+	AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
+   fi
+])
+
+AC_DEFUN(KDE_CHECK_STL_HP,
+[
+    AC_MSG_CHECKING([if STL implementation is HP like])
+    AC_CACHE_VAL(kde_cv_stl_type_hp,
+    [
+      AC_TRY_COMPILE([
+#include <string>
+using namespace std;
+],[
+  string astring="Hello World";
+  astring.remove(0, 6); // now astring is "World"
+  return 0;
+], kde_cv_stl_type_hp=yes,
+   kde_cv_stl_type_hp=no)
+])
+   AC_MSG_RESULT($kde_cv_stl_type_hp)
+
+   if test "$kde_cv_stl_type_hp" = "yes"; then
+	AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by SGI])
+   fi
+])
+
+AC_DEFUN(KDE_CHECK_STL,
+[
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    ac_save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
+    KDE_CHECK_STL_SGI
+
+    if test "$kde_cv_stl_type_sgi" = "no"; then
+       KDE_CHECK_STL_HP
+
+       if test "$kde_cv_stl_type_hp" = "no"; then
+         AC_MSG_ERROR("no known STL type found")
+       fi
+    fi
+
+    CXXFLAGS="$ac_save_CXXFLAGS"
+    AC_LANG_RESTORE
+])
+
+AC_DEFUN(AC_FIND_QIMGIO,
+   [AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for qimgio])
+AC_CACHE_VAL(ac_cv_lib_qimgio,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+ac_save_CXXFLAGS="$CXXFLAGS"
+LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+AC_TRY_RUN(dnl
+[
+#include <qimageio.h>
+#include <qstring.h>
+int main() {
+		QString t = "hallo";
+		t.fill('t');
+		qInitImageIO();
+}
+],
+            ac_cv_lib_qimgio=yes,
+            ac_cv_lib_qimgio=no,
+	    ac_cv_lib_qimgio=no)
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+])dnl
+if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
+  LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
+  AC_SUBST(LIBQIMGIO)
+else
+  AC_MSG_RESULT(not found)
+fi
+])
+
+AC_DEFUN(KDE_CHECK_ANSI,
+[
+])
+
+AC_DEFUN(KDE_CHECK_INSURE,
+[
+  AC_ARG_ENABLE(insure, [  --enable-insure             use insure++ for debugging [default=no]],
+  [
+  if test $enableval = "no"; dnl
+	then ac_use_insure="no"
+	else ac_use_insure="yes"
+   fi
+  ], [ac_use_insure="no"])
+
+  AC_MSG_CHECKING(if we will use Insure++ to debug)
+  AC_MSG_RESULT($ac_use_insure)
+  if test "$ac_use_insure" = "yes"; dnl
+       then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
+   fi
+])
+
+AC_DEFUN(AM_DISABLE_LIBRARIES,
+[
+    AC_PROVIDE([AM_ENABLE_STATIC])
+    AC_PROVIDE([AM_ENABLE_SHARED])
+    enable_static=no
+    enable_shared=yes
+])
+
+
+AC_DEFUN(AC_CHECK_UTMP_FILE,
+[
+    AC_MSG_CHECKING([for utmp file])
+
+    AC_CACHE_VAL(kde_cv_utmp_file,
+    [
+    kde_cv_utmp_file=no
+
+    for ac_file in    \
+                      \
+	/var/run/utmp \
+	/var/adm/utmp \
+	/etc/utmp     \
+     ; \
+    do
+     if test -r "$ac_file"; then
+       kde_cv_utmp_file=$ac_file
+       break
+     fi
+    done
+    ])
+
+    if test "$kde_cv_utmp_file" != "no"; then
+	AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
+	$1
+	AC_MSG_RESULT($kde_cv_utmp_file)
+    else
+    	$2
+	AC_MSG_RESULT([non found])
+    fi
+])
+
+
+AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
+[
+
+DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
+
+if test ! -s $srcdir/subdirs; then
+  dnl Note: Makefile.common creates subdirs, so this is just a fallback
+  TOPSUBDIRS=""
+  files=`cd $srcdir && ls -1`
+  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
+  for i in $dirs; do
+    echo $i >> $srcdir/subdirs
+  done
+fi
+
+if test -s $srcdir/inst-apps; then
+  ac_topsubdirs="`cat $srcdir/inst-apps`"
+else
+  ac_topsubdirs="`cat $srcdir/subdirs`"
+fi
+
+for i in $ac_topsubdirs; do
+  AC_MSG_CHECKING([if $i should be compiled])
+  if test -d $srcdir/$i; then
+    install_it="yes"
+    for j in $DO_NOT_COMPILE; do
+      if test $i = $j; then
+        install_it="no"
+      fi
+    done
+  else
+    install_it="no"
+  fi
+  AC_MSG_RESULT($install_it)
+  if test $install_it = "yes"; then
+    TOPSUBDIRS="$TOPSUBDIRS $i"
+  fi
+done
+
+AC_SUBST(TOPSUBDIRS)
+])
+
+AC_DEFUN(KDE_CHECK_NAMESPACES,
+[
+AC_MSG_CHECKING(whether C++ compiler supports namespaces)
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILE([
+],
+[
+namespace Foo {
+  extern int i;
+  namespace Bar {
+    extern int i;
+  }
+}
+
+int Foo::i = 0;
+int Foo::Bar::i = 1;
+],[
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(HAVE_NAMESPACES)
+], [
+AC_MSG_RESULT(no)
+])
+AC_LANG_RESTORE
+])
+
+AC_DEFUN(KDE_CHECK_NEWLIBS,
+[
+
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_CHECK_S_ISSOCK,
+[
+AC_MSG_CHECKING(for S_ISSOCK)
+AC_CACHE_VAL(ac_cv_have_s_issock,
+[
+AC_LANG_SAVE
+AC_LANG_C
+AC_TRY_LINK(
+[
+#include <sys/stat.h>
+],
+[
+struct stat buff;
+int b = S_ISSOCK( buff.st_mode );
+],
+ac_cv_have_s_issock=yes,
+ac_cv_have_s_issock=no)
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_have_s_issock)
+if test "$ac_cv_have_s_issock" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
+fi
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
+[
+AC_MSG_CHECKING(for MAXPATHLEN)
+AC_CACHE_VAL(ac_cv_maxpathlen,
+[
+AC_LANG_C
+cat > conftest.$ac_ext <<EOF
+#include <stdio.h>
+#include <sys/param.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+KDE_HELLO MAXPATHLEN
+
+EOF
+
+ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
+
+if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
+    ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
+else
+    ac_cv_maxpathlen=1024
+fi
+
+rm conftest.*
+
+])
+AC_MSG_RESULT($ac_cv_maxpathlen)
+AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
+])
+
+dnl -------------------------------------------------------------------------
+dnl See if the compiler supports a template repository         bero@redhat.de
+dnl -------------------------------------------------------------------------
+AC_DEFUN(KDE_COMPILER_REPO,
+[
+  REPO=""
+  NOREPO=""
+
+  KDE_CHECK_COMPILER_FLAG(frepo,
+   [
+     REPO="-frepo"
+     NOREPO="-fno-repo"
+   ])
+
+  if test -z "$REPO"; then
+  KDE_CHECK_COMPILER_FLAG(instances=explicit,
+  [
+     REPO="-instances=explicit"
+     NOREPO="-instances=extern"
+  ])
+  fi
+
+  if test -n "$REPO"; then
+     AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
+		[C++ compiler supports template repository])
+     $1
+  fi
+
+  AC_SUBST(REPO)
+  AC_SUBST(NOREPO)
+])
+
+AC_DEFUN(KDE_CHECK_HEADER,
+[
+   AC_LANG_SAVE
+   kde_safe_cppflags=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS $all_includes"
+   AC_LANG_CPLUSPLUS
+   AC_CHECK_HEADER($1, $2, $3)
+   CPPFLAGS=$kde_safe_cppflags
+   AC_LANG_RESTORE
+])
+
+AC_DEFUN(KDE_CHECK_QWSPRITEFIELD,
+[
+  KDE_CHECK_HEADER(QwSpriteField.h, ,
+  [
+    AC_MSG_WARN([you don't have QwSpriteField.h somewhere. Please install
+       QwSpriteField out of kdesupport.])
+      $1
+  ])
+])
+
+AC_DEFUN(KDE_FAST_CONFIGURE,
+[
+  dnl makes configure fast (needs perl)
+  AC_ARG_ENABLE(fast-perl, [  --disable-fast-perl     disable fast Makefile generation (needs perl)],
+      with_fast_perl=$enableval, with_fast_perl=yes)
+])
+
+AC_DEFUN(KDE_CONF_FILES,
+[
+  val=
+  if test -f $srcdir/configure.files ; then
+    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
+  fi
+  CONF_FILES=
+  if test -n "$val" ; then
+    for i in $val ; do
+      CONF_FILES="$CONF_FILES $i"
+    done
+  fi
+  AC_SUBST(CONF_FILES)
+])dnl
+
+AC_DEFUN(KDE_SET_PREFIX,
+[
+  unset CDPATH
+  dnl make $KDEDIR the default for the installation
+  AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+
+  if test "x$prefix" = "xNONE"; then
+    prefix=$ac_default_prefix
+    ac_configure_args="$ac_configure_args --prefix $prefix"
+  fi
+  KDE_FAST_CONFIGURE
+  KDE_CONF_FILES
+])
+
+pushdef([AC_PROG_INSTALL],
+[
+  dnl our own version, testing for a -p flag
+  popdef([AC_PROG_INSTALL])
+  dnl as AC_PROG_INSTALL works as it works we first have
+  dnl to save if the user didn't specify INSTALL, as the
+  dnl autoconf one overwrites INSTALL and we have no chance to find
+  dnl out afterwards
+  test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
+  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
+  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
+  AC_PROG_INSTALL
+
+  if test -z "$kde_save_INSTALL_given" ; then
+    # OK, user hasn't given any INSTALL, autoconf found one for us
+    # now we test, if it supports the -p flag
+    AC_MSG_CHECKING(for -p flag to install)
+    rm -f confinst.$$.* > /dev/null 2>&1
+    echo "Testtest" > confinst.$$.orig
+    ac_res=no
+    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
+      if test -f confinst.$$.new ; then
+        # OK, -p seems to do no harm to install
+	INSTALL="${INSTALL} -p"
+	ac_res=yes
+      fi
+    fi
+    rm -f confinst.$$.*
+    AC_MSG_RESULT($ac_res)
+  fi
+  dnl the following tries to resolve some signs and wonders coming up
+  dnl with different autoconf/automake versions
+  dnl e.g.:
+  dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
+  dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
+  dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
+  dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
+  dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
+  dnl   install-@DIR@PROGRAMS targets to explicitly use that flag
+  dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
+  dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
+  dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
+  dnl  *sometimes KDE does not use the install-@DIR@PROGRAM targets from
+  dnl   automake (due to broken Makefile.am or whatever) to install programs,
+  dnl   and so does not see the -s flag in automake > 1.4
+  dnl to clean up that mess we:
+  dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
+  dnl   which cleans KDE's program with automake > 1.4;
+  dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
+  dnl   with automake<=1.4
+  dnl  note that dues to this sometimes two '-s' flags are used (if KDE
+  dnl   properly uses install-@DIR@PROGRAMS, but I don't care
+  dnl
+  dnl And to all this comes, that I even can't write in comments variable
+  dnl  names used by automake, because it is so stupid to think I wanted to
+  dnl  _use_ them, therefor I have written A_M_... instead of AM_
+  dnl hmm, I wanted to say something ... ahh yes: Arghhh.
+
+  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
+    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
+  fi
+  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
+    INSTALL_SCRIPT='${INSTALL}'
+  fi
+])dnl
+
+AC_DEFUN(KDE_LANG_CPLUSPLUS,
+[AC_LANG_CPLUSPLUS
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
+pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
+])
+
+pushdef([AC_LANG_CPLUSPLUS],
+[popdef([AC_LANG_CPLUSPLUS])
+KDE_LANG_CPLUSPLUS
+])
+
+AC_DEFUN(KDE_CHECK_LONG_LONG,
+[
+AC_MSG_CHECKING(for long long)
+AC_CACHE_VAL(kde_cv_c_long_long,
+[
+  AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+  AC_TRY_LINK([], [
+  long long foo = 0;
+  foo = foo+1;
+  ],
+  kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
+])
+AC_MSG_RESULT($kde_cv_c_long_long)
+if test "$kde_cv_c_long_long" = yes; then
+   AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
+fi
+])
+
+## libtool.m4 - Configure libtool for the host system. -*-Shell-script-*-
+## Copyright 1996, 1997, 1998, 1999, 2000, 2001
+## Free Software Foundation, Inc.
+## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful, but
+## WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+## General Public License for more details.
+##
+## You should have received a copy of the GNU General Public License
+## along with this program; if not, write to the Free Software
+## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+##
+## As a special exception to the GNU General Public License, if you
+## distribute this file as part of a program that contains a
+## configuration script generated by Autoconf, you may include it under
+## the same distribution terms that you use for the rest of that program.
+
+# serial 46 AC_PROG_LIBTOOL
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+        [AC_LIBTOOL_GCJ],
+	[AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+	  [AC_LIBTOOL_GCJ],
+	[ifdef([AC_PROG_GCJ],
+	       [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])
+	 ifdef([A][M_PROG_GCJ],
+	       [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])
+	 ifdef([LT_AC_PROG_GCJ],
+	       [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])])])])])
+
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# Save cache, so that ltconfig can load it
+AC_CACHE_SAVE
+
+# Actually configure libtool.  ac_aux_dir is where install-sh is found.
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+
+# Reload cache, that may have been modified by ltconfig
+AC_CACHE_LOAD
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+# Only perform the check for file, if the check method requires it
+case "$deplibs_check_method" in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
+[libtool_flags="$libtool_flags --enable-dlopen"])
+ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+[libtool_flags="$libtool_flags --enable-win32-dll"])
+AC_ARG_ENABLE(libtool-lock,
+  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+AC_ARG_WITH(pic,
+  [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
+     pic_mode="$withval", pic_mode=default)
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    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
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_SAVE
+     AC_LANG_C
+     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_RESTORE])
+  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
+  ;;
+
+ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+
+  # recent cygwin and mingw systems supply a stub DllMain which the user
+  # can override, but on older systems we have to supply one
+  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
+    [AC_TRY_LINK([],
+      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
+      DllMain (0, 0, 0);],
+      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
+
+  case "$host/$CC" in
+  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
+    # old mingw systems require "-dll" to link a DLL, while more recent ones
+    # require "-mdll"
+    SAVE_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS -mdll"
+    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
+      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
+    CFLAGS="$SAVE_CFLAGS" ;;
+  *-*-cygwin* | *-*-pw32*)
+    # cygwin systems need to pass --dll to the linker, and not link
+    # crt.o which will require a WinMain@16 definition.
+    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
+  esac
+  ;;
+  ])
+esac
+])
+
+# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+
+# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
+changequote([, ])dnl
+[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.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_shared=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)])
+
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
+changequote([, ])dnl
+[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.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_static=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+])
+
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)])
+
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[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.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+])
+
+# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)])
+
+# AC_LIBTOOL_PICMODE - implement the --with-pic flag
+# Usage: AC_LIBTOOL_PICMODE[(MODE)]
+#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
+#   `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)])
+
+
+# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case "$MAGIC_CMD" in
+  /*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC_CMD="$MAGIC_CMD"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="ifelse([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case "$deplibs_check_method" in
+	"file_magic "*)
+	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    egrep "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC_CMD="$ac_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+])
+
+
+# AC_PATH_MAGIC - find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])
+
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by GCC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case "$ac_prog" in
+    # Accept absolute paths.
+changequote(,)dnl
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+changequote([,])dnl
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+	test "$with_gnu_ld" != no && break
+      else
+	test "$with_gnu_ld" != yes && break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])
+
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  lt_cv_prog_gnu_ld=yes
+else
+  lt_cv_prog_gnu_ld=no
+fi])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])
+
+# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
+[lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+])
+
+# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependant libraries],
+lt_cv_deplibs_check_method,
+[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 egrep 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
+aix4*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  changequote(,)dnl
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  changequote([, ])dnl
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin* | mingw* |pw32*)
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+  ;;
+
+freebsd* )
+  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.
+      changequote(,)dnl
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+      changequote([, ])dnl
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20*|hpux11*)
+  # TODO:  Does this work for hpux-11 too?
+  changequote(,)dnl
+  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+  changequote([, ])dnl
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libc.sl
+  ;;
+
+irix5* | irix6*)
+  case "$host_os" in
+  irix5*)
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+    ;;
+  *)
+    case "$LD" in
+    *-32|*"-32 ") libmagic=32-bit;;
+    *-n32|*"-n32 ") libmagic=N32;;
+    *-64|*"-64 ") libmagic=64-bit;;
+    *) libmagic=never-match;;
+    esac
+    # this will be overridden with pass_all, but let us keep it just in case
+    changequote(,)dnl
+    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+    changequote([, ])dnl
+    ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+  case "$host_cpu" in
+  alpha* | i*86 | powerpc* | sparc* | ia64* | s390* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  *)
+    # glibc up to 2.1.1 does not perform some relocations on ARM
+    changequote(,)dnl
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+    changequote([, ])dnl
+  esac
+  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    [lt_cv_deplibs_check_method='file_magic NetBSD/[a-z0-9]* demand paged shared library']
+  else
+    [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object']
+  fi
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+  ;;
+
+openbsd* )
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case "$host_cpu" in
+    i*86 )
+      changequote(,)dnl
+      lt_cv_deplibs_check_method='file_magic OpenBSD/i[3-9]86 demand paged shared library'
+      changequote([, ])dnl
+      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
+  ;;
+
+newsos6)
+  [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
+  ;;
+
+osf3* | osf4* | osf5*)
+  # this will be overridden with pass_all, but let us keep it just in case
+  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=/lib/libc.so
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case "$host_vendor" in
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  motorola)
+    changequote(,)dnl
+    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]'
+    changequote([, ])dnl
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  esac
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+])
+
+
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm=$ac_dir/${ac_tool_prefix}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
+      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+	lt_cv_path_NM="$tmp_nm -B"
+	break
+      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+	lt_cv_path_NM="$tmp_nm -p"
+	break
+      else
+	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
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+AC_MSG_RESULT([$NM])
+])
+
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case "$host" in
+*-*-beos* | *-*-cygwin* | *-*-pw32*)
+  # These system don't have libm
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, main, LIBM="-lm")
+  ;;
+esac
+])
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library and INCLTDL to the include flags for
+# the libltdl header and adds --enable-ltdl-convenience to the
+# configure arguments.  Note that LIBLTDL and INCLTDL are not
+# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
+# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
+# with '${top_builddir}/' and INCLTDL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  case "$enable_ltdl_convenience" in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+])
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library and INCLTDL to the include flags for
+# the libltdl header and adds --enable-ltdl-install to the configure
+# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
+# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
+# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
+# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
+# with '${top_srcdir}/' (note the single quotes!).  If your package is
+# not flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, main,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    INCLTDL=
+  fi
+])
+
+# If this macro is not defined by Autoconf, define it here.
+ifdef([AC_PROVIDE_IFELSE],
+      [],
+      [define([AC_PROVIDE_IFELSE],
+              [ifdef([AC_PROVIDE_$1],
+                     [$2], [$3])])])
+
+# AC_LIBTOOL_CXX - enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])])
+
+AC_DEFUN([_AC_LIBTOOL_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
+dnl is set to the C++ compiler.
+AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
+|| AC_MSG_ERROR([libtool tag configuration failed])
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+# AC_LIBTOOL_GCJ - enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
+
+AC_DEFUN([_AC_LIBTOOL_GCJ],
+[AC_REQUIRE([AC_PROG_LIBTOOL])
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+         [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+           [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
+dnl is set to the C++ compiler.
+AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
+|| AC_MSG_ERROR([libtool tag configuration failed])
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+dnl old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+dnl This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])dnl
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
Index: trunk/MagicSoft/AMC/activemirrorcontrol/aclocal.m4
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/aclocal.m4	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/aclocal.m4	(revision 3401)
@@ -0,0 +1,5440 @@
+# aclocal.m4 generated automatically by aclocal 1.5
+
+# Copyright 1996, 1997, 1998, 1999, 2000, 2001
+# Free Software Foundation, Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+
+dnl    This file is part of the KDE libraries/packages
+dnl    Copyright (C) 1997 Janos Farkas (chexum@shadow.banki.hu)
+dnl              (C) 1997,98,99 Stephan Kulow (coolo@kde.org)
+
+dnl    This file is free software; you can redistribute it and/or
+dnl    modify it under the terms of the GNU Library General Public
+dnl    License as published by the Free Software Foundation; either
+dnl    version 2 of the License, or (at your option) any later version.
+
+dnl    This library is distributed in the hope that it will be useful,
+dnl    but WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+dnl    Library General Public License for more details.
+
+dnl    You should have received a copy of the GNU Library General Public License
+dnl    along with this library; see the file COPYING.LIB.  If not, write to
+dnl    the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+dnl    Boston, MA 02111-1307, USA.
+
+dnl IMPORTANT NOTE:
+dnl Please do not modify this file unless you expect your modifications to be
+dnl carried into every other module in the repository. If you decide that you
+dnl really want to modify it, contact coolo@kde.org mentioning that you have
+dnl and that the modified file should be committed to every module.
+dnl
+dnl Single-module modifications are best placed in configure.in for kdelibs
+dnl and kdebase or configure.in.in if present.
+
+
+dnl ------------------------------------------------------------------------
+dnl Find a file (or one of more files in a list of dirs)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_FIND_FILE,
+[
+$3=NO
+for i in $2;
+do
+  for j in $1;
+  do
+    if test -r "$i/$j"; then
+      $3=$i
+      break 2
+    fi
+  done
+done
+])
+
+dnl KDE_FIND_PATH(programm-name, variable-name, list of directories,
+dnl	if-not-found, test-parameter)
+AC_DEFUN(KDE_FIND_PATH,
+[
+   AC_MSG_CHECKING([for $1])
+   if test -n "$$2"; then
+        kde_cv_path="$$2";
+   else
+        kde_cache=`echo $1 | sed 'y%./+-%__p_%'`
+
+        AC_CACHE_VAL(kde_cv_path_$kde_cache,
+        [
+        kde_cv_path="NONE"
+	dirs="$3"
+	kde_save_IFS=$IFS
+	IFS=':'
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+        done
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/$1"; then
+	    if test -n "$5"
+	    then
+              evalstr="$dir/$1 $5 2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/$1"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/$1"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        ])
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      AC_MSG_RESULT(not found)
+      $4
+   else
+      AC_MSG_RESULT($kde_cv_path)
+      $2=$kde_cv_path
+
+   fi
+])
+
+AC_DEFUN(KDE_MOC_ERROR_MESSAGE,
+[
+    AC_MSG_ERROR([No Qt meta object compiler (moc) found!
+Please check whether you installed Qt correctly.
+You need to have a running moc binary.
+configure tried to run $ac_cv_path_moc and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable MOC to the right one before running
+configure.
+])
+])
+
+AC_DEFUN(KDE_UIC_ERROR_MESSAGE,
+[
+    AC_MSG_WARN([No Qt ui compiler (uic) found!
+Please check whether you installed Qt correctly.
+You need to have a running uic binary.
+configure tried to run $ac_cv_path_uic and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable UIC to the right one before running
+configure.
+])
+])
+
+dnl ------------------------------------------------------------------------
+dnl Find the meta object compiler and the ui compiler in the PATH,
+dnl in $QTDIR/bin, and some more usual places
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_PATH_QT_MOC_UIC,
+[
+   qt_bindirs=""
+   for dir in $kde_qt_dirs; do
+      qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
+   done
+   qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
+   if test ! "$ac_qt_bindir" = "NO"; then
+      qt_bindirs="$ac_qt_bindir $qt_bindirs"
+   fi
+
+   KDE_FIND_PATH(moc, MOC, [$qt_bindirs], [KDE_MOC_ERROR_MESSAGE])
+   KDE_FIND_PATH(uic, UIC, [$qt_bindirs], [UIC="" ; KDE_UIC_ERROR_MESSAGE])
+   if test -z "$UIC" ; then
+     if test -z "$UIC_NOT_NEEDED" ; then
+       exit 1
+     else
+       UIC="echo uic not available: "
+     fi
+   fi
+   AC_SUBST(MOC)
+   AC_SUBST(UIC)
+])
+
+AC_DEFUN(KDE_1_CHECK_PATHS,
+[
+  KDE_1_CHECK_PATH_HEADERS
+
+  KDE_TEST_RPATH=
+
+  if test -n "$USE_RPATH"; then
+
+     if test -n "$kde_libraries"; then
+       KDE_TEST_RPATH="-R $kde_libraries"
+     fi
+
+     if test -n "$qt_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
+     fi
+
+     if test -n "$x_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
+     fi
+
+     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
+  fi
+
+AC_MSG_CHECKING([for KDE libraries installed])
+ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  AC_MSG_RESULT(yes)
+else
+  AC_MSG_ERROR([your system fails at linking a small KDE application!
+Check, if your compiler is installed correctly and if you have used the
+same compiler to compile Qt and kdelibs as you did use now.
+For more details about this problem, look at the end of config.log.])
+fi
+
+if eval `KDEDIR= ./conftest 2>&5`; then
+  kde_result=done
+else
+  kde_result=problems
+fi
+
+KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
+kde_have_all_paths=yes
+
+KDE_SET_PATHS($kde_result)
+
+])
+
+AC_DEFUN(KDE_SET_PATHS,
+[
+  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+	kde_htmldir=\"$kde_htmldir\" \
+	kde_appsdir=\"$kde_appsdir\" \
+	kde_icondir=\"$kde_icondir\" \
+	kde_sounddir=\"$kde_sounddir\" \
+	kde_datadir=\"$kde_datadir\" \
+	kde_locale=\"$kde_locale\" \
+	kde_cgidir=\"$kde_cgidir\" \
+	kde_confdir=\"$kde_confdir\" \
+	kde_mimedir=\"$kde_mimedir\" \
+	kde_toolbardir=\"$kde_toolbardir\" \
+	kde_wallpaperdir=\"$kde_wallpaperdir\" \
+	kde_templatesdir=\"$kde_templatesdir\" \
+	kde_bindir=\"$kde_bindir\" \
+	kde_servicesdir=\"$kde_servicesdir\" \
+	kde_servicetypesdir=\"$kde_servicetypesdir\" \
+	kde_moduledir=\"$kde_moduledir\" \
+	kde_result=$1"
+])
+
+AC_DEFUN(KDE_SET_DEFAULT_PATHS,
+[
+if test "$1" = "default"; then
+
+  if test -z "$kde_htmldir"; then
+    kde_htmldir='\${prefix}/share/doc/HTML'
+  fi
+  if test -z "$kde_appsdir"; then
+    kde_appsdir='\${prefix}/share/applnk'
+  fi
+  if test -z "$kde_icondir"; then
+    kde_icondir='\${prefix}/share/icons'
+  fi
+  if test -z "$kde_sounddir"; then
+    kde_sounddir='\${prefix}/share/sounds'
+  fi
+  if test -z "$kde_datadir"; then
+    kde_datadir='\${prefix}/share/apps'
+  fi
+  if test -z "$kde_locale"; then
+    kde_locale='\${prefix}/share/locale'
+  fi
+  if test -z "$kde_cgidir"; then
+    kde_cgidir='\${exec_prefix}/cgi-bin'
+  fi
+  if test -z "$kde_confdir"; then
+    kde_confdir='\${prefix}/share/config'
+  fi
+  if test -z "$kde_mimedir"; then
+    kde_mimedir='\${prefix}/share/mimelnk'
+  fi
+  if test -z "$kde_toolbardir"; then
+    kde_toolbardir='\${prefix}/share/toolbar'
+  fi
+  if test -z "$kde_wallpaperdir"; then
+    kde_wallpaperdir='\${prefix}/share/wallpapers'
+  fi
+  if test -z "$kde_templatesdir"; then
+    kde_templatesdir='\${prefix}/share/templates'
+  fi
+  if test -z "$kde_bindir"; then
+    kde_bindir='\${exec_prefix}/bin'
+  fi
+  if test -z "$kde_servicesdir"; then
+    kde_servicesdir='\${prefix}/share/services'
+  fi
+  if test -z "$kde_servicetypesdir"; then
+    kde_servicetypesdir='\${prefix}/share/servicetypes'
+  fi
+  if test -z "$kde_moduledir"; then
+    kde_moduledir='\${prefix}/lib/kde2'
+  fi
+
+  KDE_SET_PATHS(defaults)
+
+else
+
+  if test $kde_qtver = 1; then
+     AC_MSG_RESULT([compiling])
+     KDE_1_CHECK_PATHS
+  else
+     AC_MSG_ERROR([path checking not yet supported for KDE 2])
+  fi
+
+fi
+])
+
+AC_DEFUN(KDE_CHECK_PATHS_FOR_COMPLETENESS,
+[ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
+   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
+   test -z "$kde_datadir" || test -z "$kde_locale"  ||
+   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
+   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
+   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
+   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
+   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
+   test "$kde_have_all_paths" != "yes"; then
+     kde_have_all_paths=no
+  fi
+])
+
+AC_DEFUN(KDE_MISSING_PROG_ERROR,
+[
+    AC_MSG_ERROR([The important program $1 was not found!
+Please check whether you installed KDE correctly.
+])
+])
+
+AC_DEFUN(KDE_SUBST_PROGRAMS,
+[AC_REQUIRE([AC_CREATE_KFSSTND])dnl
+
+        kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde2/bin /usr/kde/bin /usr/local/kde/bin"
+        if test -n "$KDEDIRS"; then
+           kde_save_IFS=$IFS
+           IFS=:
+           for dir in $KDEDIRS; do
+                kde_default_bindirs="$dir/bin $kde_default_bindirs "
+           done
+           IFS=$kde_save_IFS
+        fi
+        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
+        KDE_FIND_PATH(dcopidl, DCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl)])
+        KDE_FIND_PATH(dcopidl2cpp, DCOPIDL2CPP, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(dcopidl2cpp)])
+        KDE_FIND_PATH(mcopidl, MCOPIDL, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(mcopidl)])
+        KDE_FIND_PATH(kdb2html, KDB2HTML, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kdb2html)])
+        KDE_FIND_PATH(artsc-config, ARTSCCONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(artsc-config)])
+        KDE_FIND_PATH(kde-config, KDECONFIG, [$kde_default_bindirs], [KDE_MISSING_PROG_ERROR(kde-config)])
+
+        DCOP_DEPENDENCIES='$(DCOPIDL)'
+        AC_SUBST(DCOPIDL)
+        AC_SUBST(DCOPIDL2CPP)
+        AC_SUBST(DCOP_DEPENDENCIES)
+        AC_SUBST(MCOPIDL)
+        AC_SUBST(KDB2HTML)
+        AC_SUBST(ARTSCCONFIG)
+        AC_SUBST(KDECONFIG)
+
+        if test -x "$KDECONFIG"; then # it can be "compiled"
+          kde_libs_prefix=`$KDECONFIG --prefix`
+          if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
+               AC_MSG_ERROR([$KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
+                          This means it has been moved since you installed it.
+                          This won't work. Please recompile kdelibs for the new prefix.
+                          ])
+           fi
+           kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
+        else
+           kde_libs_prefix='$(prefix)'
+           kde_libs_htmldir='$(kde_htmldir)'
+        fi
+        AC_SUBST(kde_libs_prefix)
+        AC_SUBST(kde_libs_htmldir)
+])dnl
+
+AC_DEFUN(AC_CREATE_KFSSTND,
+[
+AC_REQUIRE([AC_CHECK_RPATH])
+
+AC_MSG_CHECKING([for KDE paths])
+kde_result=""
+kde_cached_paths=yes
+AC_CACHE_VAL(kde_cv_all_paths,
+[
+  KDE_SET_DEFAULT_PATHS($1)
+  kde_cached_paths=no
+])
+eval "$kde_cv_all_paths"
+KDE_CHECK_PATHS_FOR_COMPLETENESS
+if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
+  # wrong values were cached, may be, we can set better ones
+  kde_result=
+  kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
+  kde_datadir= kde_locale=  kde_cgidir=  kde_confdir=
+  kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
+  kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
+  kde_have_all_paths=
+  KDE_SET_DEFAULT_PATHS($1)
+  eval "$kde_cv_all_paths"
+  KDE_CHECK_PATHS_FOR_COMPLETENESS
+  kde_result="$kde_result (cache overridden)"
+fi
+if test "$kde_have_all_paths" = "no"; then
+  AC_MSG_ERROR([configure could not run a little KDE program to test the environment.
+Since it had compiled and linked before, it must be a strange problem on your system.
+Look at config.log for details. If you are not able to fix this, look at
+http://www.kde.org/faq/installation.html or any www.kde.org mirror.
+(If you're using an egcs version on Linux, you may update binutils!)
+])
+else
+  rm -f conftest*
+  AC_MSG_RESULT($kde_result)
+fi
+
+bindir=$kde_bindir
+
+KDE_SUBST_PROGRAMS
+
+])
+
+AC_DEFUN(AC_SUBST_KFSSTND,
+[
+AC_SUBST(kde_htmldir)
+AC_SUBST(kde_appsdir)
+AC_SUBST(kde_icondir)
+AC_SUBST(kde_sounddir)
+AC_SUBST(kde_datadir)
+AC_SUBST(kde_locale)
+AC_SUBST(kde_confdir)
+AC_SUBST(kde_mimedir)
+AC_SUBST(kde_wallpaperdir)
+AC_SUBST(kde_bindir)
+dnl for KDE 2
+AC_SUBST(kde_templatesdir)
+AC_SUBST(kde_servicesdir)
+AC_SUBST(kde_servicetypesdir)
+AC_SUBST(kde_moduledir)
+if test "$kde_qtver" = 1; then
+  kde_minidir="$kde_icondir/mini"
+else
+# for KDE 1 - this breaks KDE2 apps using minidir, but
+# that's the plan ;-/
+  kde_minidir="/dev/null"
+fi
+dnl AC_SUBST(kde_minidir)
+dnl AC_SUBST(kde_cgidir)
+dnl AC_SUBST(kde_toolbardir)
+])
+
+AC_DEFUN(KDE_MISC_TESTS,
+[
+   AC_LANG_C
+   dnl Checks for libraries.
+   AC_CHECK_LIB(compat, main, [LIBCOMPAT="-lcompat"]) dnl for FreeBSD
+   AC_SUBST(LIBCOMPAT)
+   kde_have_crypt=
+   AC_CHECK_LIB(crypt, crypt, [LIBCRYPT="-lcrypt"; kde_have_crypt=yes],
+      AC_CHECK_LIB(c, crypt, [kde_have_crypt=yes], [
+        AC_MSG_WARN([you have no crypt in either libcrypt or libc.
+You should install libcrypt from another source or configure with PAM
+support])
+	kde_have_crypt=no
+      ]))
+   AC_SUBST(LIBCRYPT)
+   if test $kde_have_crypt = yes; then
+      AC_DEFINE_UNQUOTED(HAVE_CRYPT, 1, [Defines if your system has the crypt function])
+   fi
+   AC_CHECK_KSIZE_T
+   AC_LANG_C
+   AC_CHECK_LIB(dnet, dnet_ntoa, [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"])
+   if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      AC_CHECK_LIB(dnet_stub, dnet_ntoa,
+        [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
+   fi
+   AC_CHECK_FUNC(inet_ntoa)
+   if test $ac_cv_func_inet_ntoa = no; then
+     AC_CHECK_LIB(nsl, inet_ntoa, X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl")
+   fi
+   AC_CHECK_FUNC(connect)
+   if test $ac_cv_func_connect = no; then
+      AC_CHECK_LIB(socket, connect, X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS", ,
+        $X_EXTRA_LIBS)
+   fi
+
+   AC_CHECK_FUNC(remove)
+   if test $ac_cv_func_remove = no; then
+      AC_CHECK_LIB(posix, remove, X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix")
+   fi
+
+   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+   AC_CHECK_FUNC(shmat, ,
+     AC_CHECK_LIB(ipc, shmat, X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"))
+   
+   # Solaris 2.6 needs -lresolv for res_init
+   AC_CHECK_FUNC(res_init, ,
+     AC_CHECK_LIB(resolv, res_init, X_EXTRA_LIBS="$X_EXTRA_LIBS -lresolv"))
+
+   LIBSOCKET="$X_EXTRA_LIBS"
+   AC_SUBST(LIBSOCKET)
+   AC_SUBST(X_EXTRA_LIBS)
+   AC_CHECK_LIB(ucb, killpg, [LIBUCB="-lucb"]) dnl for Solaris2.4
+   AC_SUBST(LIBUCB)
+
+   case $host in  dnl this *is* LynxOS specific
+   *-*-lynxos* )
+        AC_MSG_CHECKING([LynxOS header file wrappers])
+        [CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"]
+        AC_MSG_RESULT(disabled)
+        AC_CHECK_LIB(bsd, gethostbyname, [LIBSOCKET="-lbsd"]) dnl for LynxOS
+         ;;
+    esac
+
+   KDE_CHECK_TYPES
+   KDE_CHECK_LIBDL
+])
+
+dnl ------------------------------------------------------------------------
+dnl Find the header files and libraries for X-Windows. Extended the
+dnl macro AC_PATH_X
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(K_PATH_X,
+[
+AC_REQUIRE([AC_PROG_CPP])dnl
+AC_REQUIRE([KDE_MISC_TESTS])dnl
+AC_MSG_CHECKING(for X)
+AC_LANG_SAVE
+AC_LANG_C
+AC_CACHE_VAL(kde_cv_have_x,
+[# One or both of the vars are not set, and there is no cached value.
+if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
+   kde_x_includes=NO
+else
+   kde_x_includes=$x_includes
+fi
+if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
+   kde_x_libraries=NO
+else
+   kde_x_libraries=$x_libraries
+fi
+
+# below we use the standard autoconf calls
+ac_x_libraries=$kde_x_libraries
+ac_x_includes=$kde_x_includes
+
+AC_PATH_X_DIRECT
+dnl AC_PATH_X_XMKMF picks /usr/lib as the path for the X libraries.
+dnl Unfortunately, if compiling with the N32 ABI, this is not the correct
+dnl location. The correct location is /usr/lib32 or an undefined value
+dnl (the linker is smart enough to pick the correct default library).
+dnl Things work just fine if you use just AC_PATH_X_DIRECT.
+case "$host" in
+mips-sgi-irix6*)
+  ;;
+*)
+  AC_PATH_X_XMKMF
+  if test -z "$ac_x_includes"; then
+    ac_x_includes="."
+  fi
+  if test -z "$ac_x_libraries"; then
+    ac_x_libraries="/usr/lib"
+  fi
+esac
+#from now on we use our own again
+
+# when the user already gave --x-includes, we ignore
+# what the standard autoconf macros told us.
+if test "$kde_x_includes" = NO; then
+  kde_x_includes=$ac_x_includes
+fi
+
+# for --x-libraries too
+if test "$kde_x_libraries" = NO; then
+  kde_x_libraries=$ac_x_libraries
+fi
+
+if test "$kde_x_includes" = NO; then
+  AC_MSG_ERROR([Can't find X includes. Please check your installation and add the correct paths!])
+fi
+
+if test "$kde_x_libraries" = NO; then
+  AC_MSG_ERROR([Can't find X libraries. Please check your installation and add the correct paths!])
+fi
+
+# Record where we found X for the cache.
+kde_cv_have_x="have_x=yes \
+         kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
+])dnl
+eval "$kde_cv_have_x"
+
+if test "$have_x" != yes; then
+  AC_MSG_RESULT($have_x)
+  no_x=yes
+else
+  AC_MSG_RESULT([libraries $kde_x_libraries, headers $kde_x_includes])
+fi
+
+if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
+  X_INCLUDES=""
+  x_includes="."; dnl better than nothing :-
+ else
+  x_includes=$kde_x_includes
+  X_INCLUDES="-I$x_includes"
+fi
+
+if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
+  X_LDFLAGS=""
+  x_libraries="/usr/lib"; dnl better than nothing :-
+ else
+  x_libraries=$kde_x_libraries
+  X_LDFLAGS="-L$x_libraries"
+fi
+all_includes="$X_INCLUDES"
+all_libraries="$X_LDFLAGS"
+
+AC_SUBST(X_INCLUDES)
+AC_SUBST(X_LDFLAGS)
+AC_SUBST(x_libraries)
+AC_SUBST(x_includes)
+
+# Check for libraries that X11R6 Xt/Xaw programs need.
+ac_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+# check for ICE first), but we must link in the order -lSM -lICE or
+# we get undefined symbols.  So assume we have SM if we have ICE.
+# These have to be linked with before -lX11, unlike the other
+# libraries we check for below, so use a different variable.
+#  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
+AC_CHECK_LIB(ICE, IceConnectionNumber,
+  [LIBSM="-lSM -lICE"], , $X_EXTRA_LIBS)
+AC_SUBST(LIBSM)
+LDFLAGS="$ac_save_LDFLAGS"
+
+AC_SUBST(X_PRE_LIBS)
+
+LIB_X11='-lX11 $(LIBSOCKET)'
+AC_SUBST(LIB_X11)
+
+AC_MSG_CHECKING(for libXext)
+AC_CACHE_VAL(kde_cv_have_libXext,
+[
+kde_ldflags_safe="$LDFLAGS"
+kde_libs_safe="$LIBS"
+
+LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
+LIBS="-lXext -lX11 $LIBSOCKET"
+
+AC_TRY_LINK([
+#include <stdio.h>
+],
+[
+printf("hello Xext\n");
+],
+kde_cv_have_libXext=yes,
+kde_cv_have_libXext=no
+   )
+
+LDFLAGS=$kde_ldflags_safe
+LIBS=$kde_libs_safe
+ ])
+
+AC_MSG_RESULT($kde_cv_have_libXext)
+
+if test "$kde_cv_have_libXext" = "no"; then
+  AC_MSG_ERROR([We need a working libXext to proceed. Since configure
+can't find it itself, we stop here assuming that make wouldn't find
+them either.])
+fi
+
+])
+
+AC_LANG_RESTORE
+])
+
+AC_DEFUN(KDE_PRINT_QT_PROGRAM,
+[
+AC_REQUIRE([KDE_USE_QT])
+cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qglobal.h>
+#include <qapplication.h>
+#include <qapp.h>
+#include <qobjcoll.h>
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qevent.h>
+#include <qstring.h>
+#include <qstyle.h>
+EOF
+
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+#include <qiconview.h>
+EOF
+fi
+
+fi
+
+echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
+cat >> conftest.$ac_ext <<EOF
+#error 1
+#endif
+
+int main() {
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+    QStringList *t = new QStringList();
+EOF
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+    QIconView iv(0);
+    iv.setWordWrapIconText(false);
+    QString s;
+    s.setLatin1("Elvis is alive", 14);
+    int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
+EOF
+fi
+fi
+cat >> conftest.$ac_ext <<EOF
+    return 0;
+}
+EOF
+])
+
+AC_DEFUN(KDE_USE_QT,
+[
+
+if test -z "$1"; then
+  kde_qtver=2
+  kde_qtsubver=1
+else
+  kde_qtsubver=`echo "$1" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
+  # following is the check if subversion isn´t found in passed argument
+  if test "$kde_qtsubver" = "$1"; then
+    kde_qtsubver=1
+  fi
+  kde_qtver=`echo "$1" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
+  if test "$kde_qtver" = "1"; then
+    kde_qtsubver=42
+  else
+   # this is the version number fallback to 2.1, unless major version is 1 or 2
+   if test "$kde_qtver" != "2"; then
+    kde_qtver=2
+    kde_qtsubver=1
+   fi
+  fi
+fi
+
+if test -z "$2"; then
+  if test $kde_qtver = 2; then
+    if test $kde_qtsubver -gt 0; then
+      kde_qt_minversion=">= Qt 2.2.2"
+    else
+      kde_qt_minversion=">= Qt 2.0.2"
+    fi
+  else
+    kde_qt_minversion=">= 1.42 and < 2.0"
+  fi
+else
+   kde_qt_minversion=$2
+fi
+
+if test -z "$3"; then
+   if test $kde_qtver = 2; then
+    if test $kde_qtsubver -gt 0; then
+      kde_qt_verstring="QT_VERSION >= 222"
+    else
+      kde_qt_verstring="QT_VERSION >= 200"
+    fi
+   else
+    kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
+  fi
+else
+   kde_qt_verstring=$3
+fi
+
+if test $kde_qtver = 2; then
+   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
+else
+   kde_qt_dirs="$QTDIR /usr/lib/qt"
+fi
+])
+
+AC_DEFUN(KDE_CHECK_QT_DIRECT,
+[
+AC_REQUIRE([KDE_USE_QT])
+AC_MSG_CHECKING([if Qt compiles without flags])
+AC_CACHE_VAL(kde_cv_qt_direct,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
+ac_LIBRARY_PATH="$LIBRARY_PATH"
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_includes"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
+LD_LIBRARY_PATH=
+export LD_LIBRARY_PATH
+LIBRARY_PATH=
+export LIBRARY_PATH
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  kde_cv_qt_direct="yes"
+else
+  kde_cv_qt_direct="no"
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat conftest.$ac_ext >&AC_FD_CC
+fi
+
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
+export LD_LIBRARY_PATH
+LIBRARY_PATH="$ac_LIBRARY_PATH"
+export LIBRARY_PATH
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_qt_direct" = "yes"; then
+  AC_MSG_RESULT(yes)
+  $1
+else
+  AC_MSG_RESULT(no)
+  $2
+fi
+])
+
+dnl ------------------------------------------------------------------------
+dnl Try to find the Qt headers and libraries.
+dnl $(QT_LDFLAGS) will be -Lqtliblocation (if needed)
+dnl and $(QT_INCLUDES) will be -Iqthdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_PATH_QT_1_3,
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([KDE_USE_QT])
+
+dnl ------------------------------------------------------------------------
+dnl Add configure flag to enable linking to MT version of Qt library.
+dnl ------------------------------------------------------------------------
+
+AC_ARG_ENABLE(
+  mt,
+  [  --enable-mt             link to threaded Qt (experimental)],
+  kde_use_qt_mt=$enableval,
+  kde_use_qt_mt=no
+)
+
+USING_QT_MT=""
+
+dnl ------------------------------------------------------------------------
+dnl If we got --enable-qt-mt then adjust some vars for the host.
+dnl ------------------------------------------------------------------------
+
+if test "x$kde_use_qt_mt" = "xyes"; then
+
+  case $host in
+  *-*-linux-*)
+    if test "x$GCC" = "xyes"; then
+      CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT -pthread"
+      X_EXTRA_LIBS="$X_EXTRA_LIBS -pthread"
+    else
+      AC_MSG_WARN([Compiler is not gcc. MT support disabled.])
+    fi
+    ;;
+  *)
+    AC_MSG_WARN([MT not yet supported on $host - disabled.])
+    ;;
+  esac
+
+fi
+
+kde_qt_was_given=yes
+
+dnl ------------------------------------------------------------------------
+dnl If we haven't been told how to link to Qt, we work it out for ourselves.
+dnl ------------------------------------------------------------------------
+
+if test -z "$LIBQT_GLOB"; then
+
+  LIBQT_GLOB="libqt.*"
+
+fi
+
+if test -z "$LIBQT"; then
+
+  LIBQT="-lqt"
+  kde_int_qt="-lqt"
+
+dnl ------------------------------------------------------------------------
+dnl If we got --enable-qt-mt then adjust the Qt library name for the host.
+dnl ------------------------------------------------------------------------
+
+  if test "x$kde_use_qt_mt" = "xyes"; then
+
+      case $host in
+      *-*-linux-*)
+        if test "x$GCC" = "xyes"; then
+          LIBQT="-lqt-mt"
+          kde_int_qt="-lqt-mt"
+          LIBQT_GLOB="libqt-mt.*"
+          USING_QT_MT="using -mt"
+        fi
+      ;;
+      esac
+  fi
+
+  kde_qt_was_given=no
+
+else
+  kde_int_qt="$LIBQT"
+fi
+
+if test $kde_qtver = 2; then
+
+  AC_REQUIRE([AC_FIND_PNG])
+  AC_REQUIRE([AC_FIND_JPEG])
+  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
+fi
+
+AC_MSG_CHECKING([for Qt])
+
+LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
+ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
+qt_libraries=""
+qt_includes=""
+AC_ARG_WITH(qt-dir,
+    [  --with-qt-dir=DIR       where the root of Qt is installed ],
+    [  ac_qt_includes="$withval"/include
+       ac_qt_libraries="$withval"/lib
+       ac_qt_bindir="$withval"/bin
+    ])
+
+AC_ARG_WITH(qt-includes,
+    [  --with-qt-includes=DIR  where the Qt includes are. ],
+    [
+       ac_qt_includes="$withval"
+    ])
+
+kde_qt_libs_given=no
+
+AC_ARG_WITH(qt-libraries,
+    [  --with-qt-libraries=DIR where the Qt library is installed.],
+    [  ac_qt_libraries="$withval"
+       kde_qt_libs_given=yes
+    ])
+
+AC_CACHE_VAL(ac_cv_have_qt,
+[#try to guess Qt locations
+
+qt_incdirs=""
+for dir in $kde_qt_dirs; do
+   qt_incdirs="$qt_incdirs $dir/include $dir"
+done
+qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt $x_includes"
+if test ! "$ac_qt_includes" = "NO"; then
+   qt_incdirs="$ac_qt_includes $qt_incdirs"
+fi
+
+if test "$kde_qtver" = "2"; then
+  kde_qt_header=qstyle.h
+else
+  kde_qt_header=qglobal.h
+fi
+
+AC_FIND_FILE($kde_qt_header, $qt_incdirs, qt_incdir)
+ac_qt_includes="$qt_incdir"
+
+qt_libdirs=""
+for dir in $kde_qt_dirs; do
+   qt_libdirs="$qt_libdirs $dir/lib $dir"
+done
+qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
+if test ! "$ac_qt_libraries" = "NO"; then
+  qt_libdir=$ac_qt_libraries
+else
+  qt_libdirs="$ac_qt_libraries $qt_libdirs"
+  # if the Qt was given, the chance is too big that libqt.* doesn't exist
+  qt_libdir=NONE
+  for dir in $qt_libdirs; do
+    try="ls -1 $dir/${LIBQT_GLOB}"
+    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
+  done
+fi
+
+ac_qt_libraries="$qt_libdir"
+
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS"
+LIBS="$LIBS $LIBQT"
+
+KDE_PRINT_QT_PROGRAM
+
+if AC_TRY_EVAL(ac_link) && test -s conftest; then
+  rm -f conftest*
+else
+  echo "configure: failed program was:" >&AC_FD_CC
+  cat conftest.$ac_ext >&AC_FD_CC
+  ac_qt_libraries="NO"
+fi
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+AC_LANG_RESTORE
+if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
+  ac_cv_have_qt="have_qt=no"
+  ac_qt_notfound=""
+  if test "$ac_qt_includes" = NO; then
+    if test "$ac_qt_libraries" = NO; then
+      ac_qt_notfound="(headers and libraries)";
+    else
+      ac_qt_notfound="(headers)";
+    fi
+  else
+    ac_qt_notfound="(libraries)";
+  fi
+
+  AC_MSG_ERROR([Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
+For more details about this problem, look at the end of config.log.])
+else
+  have_qt="yes"
+fi
+])
+
+eval "$ac_cv_have_qt"
+
+if test "$have_qt" != yes; then
+  AC_MSG_RESULT([$have_qt]);
+else
+  ac_cv_have_qt="have_qt=yes \
+    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
+  AC_MSG_RESULT([libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT])
+
+  qt_libraries="$ac_qt_libraries"
+  qt_includes="$ac_qt_includes"
+fi
+
+if test ! "$kde_qt_libs_given" = "yes"; then
+KDE_CHECK_QT_DIRECT(qt_libraries= ,[])
+fi
+
+AC_SUBST(qt_libraries)
+AC_SUBST(qt_includes)
+
+if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
+ QT_INCLUDES="";
+else
+ QT_INCLUDES="-I$qt_includes"
+ all_includes="$QT_INCLUDES $all_includes"
+fi
+
+if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
+ QT_LDFLAGS=""
+else
+ QT_LDFLAGS="-L$qt_libraries"
+ all_libraries="$all_libraries $QT_LDFLAGS"
+fi
+
+AC_SUBST(QT_INCLUDES)
+AC_SUBST(QT_LDFLAGS)
+AC_PATH_QT_MOC_UIC
+
+LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
+AC_SUBST(LIB_QT)
+
+])
+
+AC_DEFUN(AC_PATH_QT,
+[
+AC_PATH_QT_1_3
+])
+
+AC_DEFUN(KDE_CHECK_FINAL,
+[
+  AC_ARG_ENABLE(final, [  --enable-final          build size optimized apps (experimental - needs lots of memory)],
+	kde_use_final=$enableval, kde_use_final=no)
+
+  KDE_COMPILER_REPO
+  if test "x$kde_use_final" = "xyes"; then
+      KDE_USE_FINAL_TRUE=""
+      KDE_USE_FINAL_FALSE="#"
+   else
+      KDE_USE_FINAL_TRUE="#"
+      KDE_USE_FINAL_FALSE=""
+  fi
+  AC_SUBST(KDE_USE_FINAL_TRUE)
+  AC_SUBST(KDE_USE_FINAL_FALSE)
+
+  AC_ARG_ENABLE(closure, [  --disable-closure       don't delay template instantiation],
+  	kde_use_closure=$enableval, kde_use_closure=yes)
+
+  if test "x$kde_use_closure" = "xyes"; then
+       KDE_USE_CLOSURE_TRUE=""
+       KDE_USE_CLOSURE_FALSE="#"
+#       CXXFLAGS="$CXXFLAGS $REPO"
+  else
+       KDE_USE_CLOSURE_TRUE="#"
+       KDE_USE_CLOSURE_FALSE=""
+  fi
+  AC_SUBST(KDE_USE_CLOSURE_TRUE)
+  AC_SUBST(KDE_USE_CLOSURE_FALSE)
+])
+
+dnl ------------------------------------------------------------------------
+dnl Now, the same with KDE
+dnl $(KDE_LDFLAGS) will be the kdeliblocation (if needed)
+dnl and $(kde_includes) will be the kdehdrlocation (if needed)
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_BASE_PATH_KDE,
+[
+AC_PREREQ([2.13])
+AC_REQUIRE([AC_PATH_QT])dnl
+AC_CHECK_RPATH
+AC_MSG_CHECKING([for KDE])
+
+if test "${prefix}" != NONE; then
+  kde_includes=${prefix}/include
+  ac_kde_includes=$prefix/include
+
+  if test "${exec_prefix}" != NONE; then
+    kde_libraries=${exec_prefix}/lib
+    ac_kde_libraries=$exec_prefix/lib
+  else
+    kde_libraries=${prefix}/lib
+    ac_kde_libraries=$prefix/lib
+  fi
+else
+  ac_kde_includes=
+  ac_kde_libraries=
+  kde_libraries=""
+  kde_includes=""
+fi
+
+AC_CACHE_VAL(ac_cv_have_kde,
+[#try to guess kde locations
+
+if test "$kde_qtver" = 1; then
+  kde_check_header="ksock.h"
+  kde_check_lib="libkdecore.la"
+else
+  kde_check_header="ksharedptr.h"
+  kde_check_lib="libkio.la"
+fi
+
+if test -z "$1"; then
+
+kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
+test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
+kde_incdirs="$ac_kde_includes $kde_incdirs"
+AC_FIND_FILE($kde_check_header, $kde_incdirs, kde_incdir)
+ac_kde_includes="$kde_incdir"
+
+if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
+  AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE headers installed. This will fail.
+So, check this please and use another prefix!])
+fi
+
+kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
+test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
+kde_libdirs="$ac_kde_libraries $kde_libdirs"
+AC_FIND_FILE($kde_check_lib, $kde_libdirs, kde_libdir)
+ac_kde_libraries="$kde_libdir"
+
+if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
+AC_MSG_ERROR([
+in the prefix, you've chosen, are no KDE libraries installed. This will fail.
+So, check this please and use another prefix!])
+fi
+ac_kde_libraries="$kde_libdir"
+
+if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
+  ac_cv_have_kde="have_kde=no"
+else
+  ac_cv_have_kde="have_kde=yes \
+    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+fi
+
+else dnl test -z $1
+
+  ac_cv_have_kde="have_kde=no"
+
+fi
+])dnl
+
+eval "$ac_cv_have_kde"
+
+if test "$have_kde" != "yes"; then
+ if test "${prefix}" = NONE; then
+  ac_kde_prefix="$ac_default_prefix"
+ else
+  ac_kde_prefix="$prefix"
+ fi
+ if test "$exec_prefix" = NONE; then
+  ac_kde_exec_prefix="$ac_kde_prefix"
+  AC_MSG_RESULT([will be installed in $ac_kde_prefix])
+ else
+  ac_kde_exec_prefix="$exec_prefix"
+  AC_MSG_RESULT([will be installed in $ac_kde_prefix and $ac_kde_exec_prefix])
+ fi
+
+ kde_libraries="${ac_kde_exec_prefix}/lib"
+ kde_includes=${ac_kde_prefix}/include
+
+else
+  ac_cv_have_kde="have_kde=yes \
+    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+  AC_MSG_RESULT([libraries $ac_kde_libraries, headers $ac_kde_includes])
+
+  kde_libraries="$ac_kde_libraries"
+  kde_includes="$ac_kde_includes"
+fi
+AC_SUBST(kde_libraries)
+AC_SUBST(kde_includes)
+
+if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
+ KDE_INCLUDES=""
+else
+ KDE_INCLUDES="-I$kde_includes"
+ all_includes="$KDE_INCLUDES $all_includes"
+fi
+ 
+KDE_LDFLAGS="-L$kde_libraries"
+if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
+ all_libraries="$all_libraries $KDE_LDFLAGS"
+fi
+
+AC_SUBST(KDE_LDFLAGS)
+AC_SUBST(KDE_INCLUDES)
+
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+all_libraries="$all_libraries $USER_LDFLAGS"
+all_includes="$all_includes $USER_INCLUDES"
+AC_SUBST(all_includes)
+AC_SUBST(all_libraries)
+
+AC_SUBST(AUTODIRS)
+])
+
+AC_DEFUN(KDE_CHECK_EXTRA_LIBS,
+[
+AC_MSG_CHECKING(for extra includes)
+AC_ARG_WITH(extra-includes, [  --with-extra-includes=DIR
+                          adds non standard include paths],
+  kde_use_extra_includes="$withval",
+  kde_use_extra_includes=NONE
+)
+kde_extra_includes=
+if test -n "$kde_use_extra_includes" && \
+   test "$kde_use_extra_includes" != "NONE"; then
+
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $kde_use_extra_includes; do
+     kde_extra_includes="$kde_extra_includes $dir"
+     USER_INCLUDES="$USER_INCLUDES -I$dir"
+   done
+   IFS=$ac_save_ifs
+   kde_use_extra_includes="added"
+else
+   kde_use_extra_includes="no"
+fi
+AC_SUBST(USER_INCLUDES)
+
+AC_MSG_RESULT($kde_use_extra_includes)
+
+kde_extra_libs=
+AC_MSG_CHECKING(for extra libs)
+AC_ARG_WITH(extra-libs, [  --with-extra-libs=DIR   adds non standard library paths],
+  kde_use_extra_libs=$withval,
+  kde_use_extra_libs=NONE
+)
+if test -n "$kde_use_extra_libs" && \
+   test "$kde_use_extra_libs" != "NONE"; then
+
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $kde_use_extra_libs; do
+     kde_extra_libs="$kde_extra_libs $dir"
+     KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
+     USER_LDFLAGS="$USER_LDFLAGS -L$dir"
+   done
+   IFS=$ac_save_ifs
+   kde_use_extra_libs="added"
+else
+   kde_use_extra_libs="no"
+fi
+
+AC_SUBST(USER_LDFLAGS)
+
+AC_MSG_RESULT($kde_use_extra_libs)
+
+])
+
+AC_DEFUN(KDE_1_CHECK_PATH_HEADERS,
+[
+    AC_MSG_CHECKING([for KDE headers installed])
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+cat > conftest.$ac_ext <<EOF
+#include <stdio.h>
+#include "confdefs.h"
+#include <kapp.h>
+
+int main() {
+    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
+    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
+    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
+    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
+    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
+    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
+    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
+    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
+    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
+    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
+    printf("kde_wallpaperdir=\\"%s\\"\n",
+	KApplication::kde_wallpaperdir().data());
+    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
+    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
+    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
+    return 0;
+    }
+EOF
+
+ ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
+ if AC_TRY_EVAL(ac_compile); then
+   AC_MSG_RESULT(yes)
+ else
+   AC_MSG_ERROR([your system is not able to compile a small KDE application!
+Check, if you installed the KDE header files correctly.
+For more details about this problem, look at the end of config.log.])
+  fi
+
+  AC_LANG_RESTORE
+])
+
+AC_DEFUN(KDE_CHECK_KDEQTADDON,
+[
+AC_MSG_CHECKING(for kde-qt-addon)
+AC_CACHE_VAL(kde_cv_have_kdeqtaddon,
+[
+ kde_ldflags_safe="$LDFLAGS"
+ kde_libs_safe="$LIBS"
+ kde_cxxflags_safe="$CXXFLAGS"
+
+ LIBS="-lkde-qt-addon $LIBQT $LIBS"
+ CXXFLAGS="$CXXFLAGS -I$prefix/include -I$prefix/include/kde $all_includes"
+ LDFLAGS="$LDFLAGS $all_libraries $USER_LDFLAGS"
+
+ AC_TRY_LINK([
+   #include <qdom.h>
+ ],
+ [
+   QDomDocument doc;
+ ],
+  kde_cv_have_kdeqtaddon=yes,
+  kde_cv_have_kdeqtaddon=no
+ )
+
+ LDFLAGS=$kde_ldflags_safe
+ LIBS=$kde_libs_safe
+ kde_cxxflags_safe="$CXXFLAGS"
+])
+
+AC_MSG_RESULT($kde_cv_have_kdeqtaddon)
+
+if test "$kde_cv_have_kdeqtaddon" = "no"; then
+  AC_MSG_ERROR([Can't find libkde-qt-addon. You need to install it first.
+It is a separate package (and CVS module) named kde-qt-addon.])
+fi
+])
+
+AC_DEFUN(KDE_CHECK_KIMGIO,
+[
+   AC_REQUIRE([AC_BASE_PATH_KDE])
+   AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+   AC_REQUIRE([AC_FIND_TIFF])
+   AC_REQUIRE([AC_FIND_JPEG])
+   AC_REQUIRE([AC_FIND_PNG])
+   AC_REQUIRE([KDE_CREATE_LIBS_ALIASES])
+
+   if test "$1" = "existance"; then
+     AC_LANG_SAVE
+     AC_LANG_CPLUSPLUS
+     kde_save_LIBS="$LIBS"
+     LIBS="$LIBS $all_libraries $LIBJPEG $LIBTIFF $LIBPNG $LIBQT -lm"
+     AC_CHECK_LIB(kimgio, kimgioRegister, [
+      LIBKIMGIO_EXISTS=yes],LIBKIMGIO_EXISTS=no)
+      LIBS="$kde_save_LIBS"
+      AC_LANG_RESTORE
+   else
+      LIBKIMGIO_EXISTS=yes
+   fi
+
+   if test "$LIBKIMGIO_EXISTS" = "yes"; then
+     LIB_KIMGIO='-lkimgio'
+   else
+     LIB_KIMGIO=''
+   fi
+   AC_SUBST(LIB_KIMGIO)
+])
+
+AC_DEFUN(KDE_CREATE_LIBS_ALIASES,
+[
+   AC_REQUIRE([KDE_MISC_TESTS])
+   AC_REQUIRE([KDE_CHECK_LIBDL])
+   AC_REQUIRE([K_PATH_X])
+
+if test $kde_qtver = 2; then
+   LIB_KDECORE='-lkdecore'
+   AC_SUBST(LIB_KDECORE)
+   LIB_KDEUI='-lkdeui'
+   AC_SUBST(LIB_KDEUI)
+   LIB_KFORMULA='-lkformula'
+   AC_SUBST(LIB_KFORMULA)
+   LIB_KIO='-lkio'
+   AC_SUBST(LIB_KIO)
+   LIB_KSYCOCA='-lksycoca'
+   AC_SUBST(LIB_KSYCOCA)
+   LIB_SMB='-lsmb'
+   AC_SUBST(LIB_SMB)
+   LIB_KFILE='-lkfile'
+   AC_SUBST(LIB_KFILE)
+   LIB_KAB='-lkab'
+   AC_SUBST(LIB_KAB)
+   LIB_KHTML='-lkhtml'
+   AC_SUBST(LIB_KHTML)
+   LIB_KSPELL='-lkspell'
+   AC_SUBST(LIB_KSPELL)
+   LIB_KPARTS='-lkparts'
+   AC_SUBST(LIB_KPARTS)
+   LIB_KWRITE='-lkwrite'
+   AC_SUBST(LIB_KWRITE)
+else
+   LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
+   AC_SUBST(LIB_KDECORE)
+   LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
+   AC_SUBST(LIB_KDEUI)
+   LIB_KFM='-lkfm $(LIB_KDECORE)'
+   AC_SUBST(LIB_KFM)
+   LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
+   AC_SUBST(LIB_KFILE)
+   LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
+   AC_SUBST(LIB_KAB)
+fi
+])
+
+AC_DEFUN(AC_PATH_KDE,
+[
+  AC_BASE_PATH_KDE
+  AC_ARG_ENABLE(path-check, [  --disable-path-check    don't try to find out, where to install],
+  [
+  if test "$enableval" = "no";
+    then ac_use_path_checking="default"
+    else ac_use_path_checking=""
+  fi
+  ],
+  [
+  if test "$kde_qtver" = 1;
+    then ac_use_path_checking=""
+    else ac_use_path_checking="default"
+  fi
+  ]
+  )
+
+  AC_CREATE_KFSSTND($ac_use_path_checking)
+
+  AC_SUBST_KFSSTND
+  KDE_CREATE_LIBS_ALIASES
+])
+
+dnl obsolete
+AC_DEFUN(AC_CHECK_SETENV,
+[
+   AC_OBSOLETE([$0], [; instead use AC_CHECK_FUNCS([setenv unsetenv])])dnl 
+   AC_CHECK_FUNCS([setenv unsetenv])
+])
+
+AC_DEFUN(AC_CHECK_GETDOMAINNAME,
+[
+AC_MSG_CHECKING(for getdomainname)
+AC_CACHE_VAL(ac_cv_func_getdomainname,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+save_CXXFLAGS="$CXXFLAGS"
+kde_safe_LIBS="$LIBS"
+LIBS="$LIBS $X_EXTRA_LIBS"
+if test "$GCC" = "yes"; then
+CXXFLAGS="$CXXFLAGS -pedantic-errors"
+fi
+AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <unistd.h>
+],
+[
+char buffer[200];
+getdomainname(buffer, 200);
+],
+ac_cv_func_getdomainname=yes,
+ac_cv_func_getdomainname=no)
+CXXFLAGS="$save_CXXFLAGS"
+LIBS=$kde_safe_LIBS
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_func_getdomainname)
+
+AC_MSG_CHECKING([if getdomainname needs custom prototype])
+AC_CACHE_VAL(ac_cv_proto_getdomainname,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
+  ac_cv_proto_getdomainname=no
+else
+  kde_safe_libs=$LIBS
+  LIBS="$LIBS $X_EXTRA_LIBS"
+  AC_TRY_LINK([
+#include <stdlib.h>
+#include <unistd.h>
+
+extern "C" int getdomainname (char *, int);
+],
+[
+char buffer[200];
+getdomainname(buffer, 200);
+],
+  ac_cv_func_getdomainname=yes
+  ac_cv_proto_getdomainname=yes,
+  AC_MSG_RESULT([fatal error])
+  AC_MSG_ERROR([getdomainname unavailable]))
+fi
+LIBS=$kde_safe_libs
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_proto_getdomainname)
+
+if eval "test \"`echo $ac_cv_func_getdomainname`\" = yes"; then
+  AC_DEFINE(HAVE_GETDOMAINNAME, 1, [Define if you have getdomainname])
+fi
+if eval "test \"`echo $ac_cv_proto_getdomainname`\" = no"; then
+  AC_DEFINE(HAVE_GETDOMAINNAME_PROTO, 1,
+  [Define if you have getdomainname prototype])
+fi
+
+])
+
+AC_DEFUN(AC_CHECK_GETHOSTNAME,
+[
+
+AC_MSG_CHECKING([for gethostname])
+AC_CACHE_VAL(ac_cv_func_gethostname,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+save_CXXFLAGS="$CXXFLAGS"
+if test "$GCC" = "yes"; then
+CXXFLAGS="$CXXFLAGS -pedantic-errors"
+fi
+AC_TRY_LINK([
+#include <stdlib.h>
+#include <unistd.h>
+],
+[
+char buffer[200];
+gethostname(buffer, 200);
+],
+ac_cv_func_gethostname=yes,
+ac_cv_func_gethostname=no)
+CXXFLAGS="$save_CXXFLAGS"
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_func_gethostname)
+
+AC_MSG_CHECKING([if gethostname needs custom prototype])
+AC_CACHE_VAL(ac_cv_proto_gethostname,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
+  ac_cv_proto_gethostname=no
+else
+  AC_TRY_LINK([
+#include <stdlib.h>
+#include <unistd.h>
+
+extern "C" int gethostname (char *, int);
+],
+[
+char buffer[200];
+gethostname(buffer, 200);
+],
+  ac_cv_func_gethostname=yes
+  ac_cv_proto_gethostname=yes,
+  AC_MSG_RESULT([fatal error])
+  AC_MSG_ERROR(gethostname unavailable))
+fi
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_proto_gethostname)
+
+if eval "test \"`echo $ac_cv_proto_gethostname`\" = no"; then
+  AC_DEFINE(HAVE_GETHOSTNAME_PROTO, 1,
+  [Define if you have gethostname prototype])
+fi
+if eval "test \"`echo $ac_cv_func_gethostname`\" = yes"; then
+  AC_DEFINE(HAVE_GETHOSTNAME, 1, [Define if you have getdomainname])
+fi
+])
+
+AC_DEFUN(AC_CHECK_USLEEP,
+[
+AC_MSG_CHECKING([for usleep])
+AC_CACHE_VAL(ac_cv_func_usleep,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_libs_safe="$LIBS"
+LIBS="$LIBS $LIBUCB"
+AC_TRY_LINK([
+#include <stdlib.h>
+#include <unistd.h>
+],
+[
+usleep(200);
+],
+ac_cv_func_usleep=yes,
+ac_cv_func_usleep=no)
+LIBS="$ac_libs_safe"
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_func_usleep)
+if eval "test \"`echo $ac_cv_func_usleep`\" = yes"; then
+  AC_DEFINE(HAVE_USLEEP, 1, [Define if you have the usleep function])
+fi
+])
+
+AC_DEFUN(AC_CHECK_RANDOM,
+[
+AC_MSG_CHECKING([for random])
+AC_CACHE_VAL(ac_cv_func_random,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_libs_safe="$LIBS"
+LIBS="$LIBS $LIBUCB"
+AC_TRY_LINK([
+#include <stdlib.h>
+],
+[
+random();
+],
+ac_cv_func_random=yes,
+ac_cv_func_random=no)
+LIBS="$ac_libs_safe"
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_func_random)
+if eval "test \"`echo $ac_cv_func_random`\" = yes"; then
+  AC_DEFINE(HAVE_RANDOM, 1, [Define if you have random])
+fi
+])
+
+AC_DEFUN(AC_FIND_GIF,
+   [AC_MSG_CHECKING([for giflib])
+AC_CACHE_VAL(ac_cv_lib_gif,
+[ac_save_LIBS="$LIBS"
+LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
+AC_TRY_LINK(dnl
+[
+#ifdef __cplusplus
+extern "C" {
+#endif
+int GifLastError(void);
+#ifdef __cplusplus
+}
+#endif
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+],
+            [return GifLastError();],
+            eval "ac_cv_lib_gif=yes",
+            eval "ac_cv_lib_gif=no")
+LIBS="$ac_save_LIBS"
+])dnl
+if eval "test \"`echo $ac_cv_lib_gif`\" = yes"; then
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED(HAVE_LIBGIF, 1, [Define if you have libgif])
+else
+  AC_MSG_ERROR(You need giflib30. Please install the kdesupport package)
+fi
+])
+
+AC_DEFUN(KDE_FIND_JPEG_HELPER,
+[
+AC_MSG_CHECKING([for libjpeg$2])
+AC_CACHE_VAL(ac_cv_lib_jpeg_$1,
+[
+AC_LANG_C
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -ljpeg$2 -lm"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(
+[/* Override any gcc2 internal prototype to avoid an error.  */
+struct jpeg_decompress_struct;
+typedef struct jpeg_decompress_struct * j_decompress_ptr;
+typedef int size_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+    void jpeg_CreateDecompress(j_decompress_ptr cinfo,
+                                    int version, size_t structsize);
+#ifdef __cplusplus
+}
+#endif
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+],
+            [jpeg_CreateDecompress(0L, 0, 0);],
+            eval "ac_cv_lib_jpeg_$1=-ljpeg$2",
+            eval "ac_cv_lib_jpeg_$1=no")
+LIBS="$ac_save_LIBS"
+CFLAGS="$ac_save_CFLAGS"
+])
+
+if eval "test ! \"`echo $ac_cv_lib_jpeg_$1`\" = no"; then
+  LIBJPEG="$ac_cv_lib_jpeg_$1"
+  AC_MSG_RESULT($ac_cv_lib_jpeg_$1)
+else
+  AC_MSG_RESULT(no)
+  $3
+fi
+
+])
+
+AC_DEFUN(AC_FIND_JPEG,
+[
+dnl first look for libraries
+KDE_FIND_JPEG_HELPER(6b, 6b,
+   KDE_FIND_JPEG_HELPER(normal, [],
+    [
+dnl what to do, if the normal way fails:
+	if test -f "$kde_libraries/libjpeg.so"; then
+	   test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
+	   ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
+	else if test -f "$kde_libraries/libjpeg.sl"; then
+	   test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
+	   ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"	
+	else if test -f "$kde_libraries/libjpeg.a"; then
+	   test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
+	   ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
+        else
+	  ac_cv_lib_jpeg=
+	fi
+      fi
+   fi
+
+   LIBJPEG=$ac_cv_lib_jpeg
+]))
+
+dnl then search the headers (can't use simply AC_TRY_xxx, as jpeglib.h
+dnl requires system dependent includes loaded before it)
+jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes"
+AC_FIND_FILE(jpeglib.h, $jpeg_incdirs, jpeg_incdir)
+test "x$jpeg_incdir" = xNO && jpeg_incdir=
+
+dnl if headers _and_ libraries are missing, this is no error, and we
+dnl continue with a warning (the user will get no jpeg support in khtml)
+dnl if only one is missing, it means a configuration error, but we still
+dnl only warn
+if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBJPEG, 1, [Define if you have libjpeg])
+else
+  if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
+    AC_MSG_WARN([
+There is an installation error in jpeg support. You seem to have only one
+of either the headers _or_ the libraries installed. You may need to either
+provide correct --with-extra-... options, or the development package of
+libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
+Disabling JPEG support.
+])
+  else
+    AC_MSG_WARN([libjpeg not found. disable JPEG support.])
+  fi
+  jpeg_incdir=
+  LIBJPEG=
+fi
+
+AC_SUBST(LIBJPEG)
+])
+
+AC_DEFUN(AC_FIND_ZLIB,
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for libz])
+AC_CACHE_VAL(ac_cv_lib_z,
+[
+AC_LANG_C
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_TRY_LINK(dnl
+[
+#include<zlib.h>
+],
+            [return (zlibVersion() == ZLIB_VERSION); ],
+            eval "ac_cv_lib_z='-lz'",
+            eval "ac_cv_lib_z=no")
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if test ! "$ac_cv_lib_z" = no; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBZ, 1, [Define if you have libz])
+  LIBZ="$ac_cv_lib_z"
+  AC_SUBST(LIBZ)
+  AC_MSG_RESULT($ac_cv_lib_z)
+else
+  AC_MSG_ERROR(not found. Check your installation and look into config.log)
+  LIBZ=""
+  AC_SUBST(LIBZ)
+fi
+])
+
+AC_DEFUN(KDE_TRY_TIFFLIB,
+[
+AC_MSG_CHECKING([for libtiff $1])
+
+AC_CACHE_VAL(kde_cv_libtiff_$1,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
+kde_save_CXXFLAGS="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $all_includes $USER_INCLUDES"
+
+AC_TRY_LINK(dnl
+[
+#include<tiffio.h>
+],
+    [return (TIFFOpen( "", "r") == 0); ],
+[
+    kde_cv_libtiff_$1="-l$1 $LIBJPEG $LIBZ"
+], [
+    kde_cv_libtiff_$1=no
+])
+
+LIBS="$kde_save_LIBS"
+CXXFLAGS="$kde_save_CXXFLAGS"
+AC_LANG_RESTORE
+])
+
+if test "$kde_cv_libtiff_$1" = "no"; then
+    AC_MSG_RESULT(no)
+    LIBTIFF=""
+    $3
+else
+    LIBTIFF="$kde_cv_libtiff_$1"
+    AC_MSG_RESULT(yes)
+    AC_DEFINE_UNQUOTED(HAVE_LIBTIFF, 1, [Define if you have libtiff])
+    $2
+fi
+
+])
+
+AC_DEFUN(AC_FIND_TIFF,
+[
+AC_REQUIRE([K_PATH_X])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+KDE_TRY_TIFFLIB(tiff, [],
+   KDE_TRY_TIFFLIB(tiff34))
+
+AC_SUBST(LIBTIFF)
+])
+
+
+AC_DEFUN(AC_FIND_PNG,
+[
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_REQUIRE([AC_FIND_ZLIB])
+AC_MSG_CHECKING([for libpng])
+AC_CACHE_VAL(ac_cv_lib_png,
+[
+kde_save_LIBS="$LIBS"
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+AC_LANG_C
+AC_TRY_LINK(dnl
+    [
+    #include<png.h>
+    ],
+    [
+    png_structp png_ptr = png_create_read_struct(  /* image ptr */
+		PNG_LIBPNG_VER_STRING, 0, 0, 0 );
+    return( png_ptr != 0 );
+    ],
+    eval "ac_cv_lib_png='-lpng $LIBZ -lm'",
+    eval "ac_cv_lib_png=no"
+)
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+])dnl
+if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
+  AC_DEFINE_UNQUOTED(HAVE_LIBPNG, 1, [Define if you have libpng])
+  LIBPNG="$ac_cv_lib_png"
+  AC_SUBST(LIBPNG)
+  AC_MSG_RESULT($ac_cv_lib_png)
+else
+  AC_MSG_RESULT(no)
+  LIBPNG=""
+  AC_SUBST(LIBPNG)
+fi
+])
+
+AC_DEFUN(AC_CHECK_BOOL,
+[
+  AC_DEFINE_UNQUOTED(HAVE_BOOL, 1, [You _must_ have bool])
+])
+
+AC_DEFUN(AC_CHECK_GNU_EXTENSIONS,
+[
+AC_MSG_CHECKING(if you need GNU extensions)
+AC_CACHE_VAL(ac_cv_gnu_extensions,
+[
+cat > conftest.c << EOF
+#include <features.h>
+
+#ifdef __GNU_LIBRARY__
+yes
+#endif
+EOF
+
+if (eval "$ac_cpp conftest.c") 2>&5 |
+  egrep "yes" >/dev/null 2>&1; then
+  rm -rf conftest*
+  ac_cv_gnu_extensions=yes
+else
+  ac_cv_gnu_extensions=no
+fi
+])
+
+AC_MSG_RESULT($ac_cv_gnu_extensions)
+if test "$ac_cv_gnu_extensions" = "yes"; then
+  AC_DEFINE_UNQUOTED(_GNU_SOURCE, 1, [Define if you need to use the GNU extensions])
+fi
+])
+
+AC_DEFUN(KDE_CHECK_COMPILER_FLAG,
+[
+AC_REQUIRE([AC_CHECK_COMPILERS])
+AC_MSG_CHECKING(whether $CXX supports -$1)
+kde_cache=`echo $1 | sed 'y%.=/+-%___p_%'`
+AC_CACHE_VAL(kde_cv_prog_cxx_$kde_cache,
+[
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -$1 -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -$1 -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+])
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ :
+ $2
+else
+ AC_MSG_RESULT(no)
+ :
+ $3
+fi
+])
+
+AC_DEFUN(KDE_PROG_CC_PG,
+[ AC_CACHE_CHECK(whether ${CC-cc} accepts -pg, kde_cv_prog_cc_pg,
+  [echo 'void f(){}' > conftest.c
+   if test -z "`${CC-cc} -pg -c conftest.c 2>&1`"; then
+     kde_cv_prog_cc_pg=yes
+   else
+     kde_cv_prog_cc_pg=no
+   fi
+   rm -f conftest*
+])])
+
+AC_DEFUN(KDE_PROG_CXX_PG,
+[ AC_CACHE_CHECK(whether ${CXX-g++} accepts -pg, kde_cv_prog_cxx_pg,
+  [echo 'void f(){}' > conftest.cc
+   if test -z "`${CXX-g++} -pg -c conftest.cc 2>&1`"; then
+     kde_cv_prog_cxx_pg=yes
+   else
+     kde_cv_prog_cxx_pg=no
+   fi
+  rm -f conftest*
+])])
+
+dnl AC_REMOVE_FORBIDDEN removes forbidden arguments from variables
+dnl use: AC_REMOVE_FORBIDDEN(CC, [-forbid -bad-option whatever])
+dnl it's all white-space separated
+AC_DEFUN(AC_REMOVE_FORBIDDEN,
+[ __val=$$1
+  __forbid=" $2 "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS=" 	"
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) AC_MSG_WARN([found forbidden $i in $1, removing it]) ;;
+	*) # Careful to not add spaces, where there were none, because otherwise
+	   # libtool gets confused, if we change e.g. CXX
+	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    $1=$__new
+  fi
+])
+
+dnl AC_VALIDIFY_CXXFLAGS checks for forbidden flags the user may have given
+AC_DEFUN(AC_VALIDIFY_CXXFLAGS,
+[dnl
+ AC_REMOVE_FORBIDDEN(CXX, [-fno-rtti -rpath])
+ AC_REMOVE_FORBIDDEN(CXXFLAGS, [-fno-rtti -rpath])
+])
+
+AC_DEFUN(AC_CHECK_COMPILERS,
+[
+  dnl this is somehow a fat lie, but prevents other macros from double checking
+  AC_PROVIDE([AC_PROG_CC])
+  AC_PROVIDE([AC_PROG_CPP])
+  AC_PROVIDE([AC_PROG_CXX])
+  AC_PROVIDE([AC_PROG_CXXCPP])
+
+  AC_ARG_ENABLE(debug,[  --enable-debug          enables debug symbols [default=no]],
+  [
+   if test $enableval = "no"; dnl
+     then
+       kde_use_debug_code="no"
+       kde_use_debug_define=yes
+     else
+       kde_use_debug_code="yes"
+       kde_use_debug_define=no
+   fi
+  ], [kde_use_debug_code="no"
+      kde_use_debug_define=no
+    ])
+  dnl Just for configure --help
+  AC_ARG_ENABLE(dummyoption,[  --disable-debug         disables debug output and debug symbols [default=no]],[],[])
+
+  AC_ARG_ENABLE(strict,[  --enable-strict         compiles with strict compiler options (may not work!)],
+   [
+    if test $enableval = "no"; then
+         kde_use_strict_options="no"
+       else
+         kde_use_strict_options="yes"
+    fi
+   ], [kde_use_strict_options="no"])
+
+  AC_ARG_ENABLE(profile,[  --enable-profile        creates profiling infos [default=no]],
+     [kde_use_profiling=$enableval],
+     [kde_use_profiling="no"]
+  )
+
+dnl this was AC_PROG_CC. I had to include it manualy, since I had to patch it
+  AC_MSG_CHECKING(for a C-Compiler)
+  dnl if there is one, print out. if not, don't matter
+  AC_MSG_RESULT($CC)
+
+  if test -z "$CC"; then AC_CHECK_PROG(CC, gcc, gcc) fi
+  if test -z "$CC"; then AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc) fi
+  if test -z "$CC"; then AC_CHECK_PROG(CC, xlc, xlc) fi
+  test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+
+  AC_PROG_CC_WORKS
+  AC_PROG_CC_GNU
+
+  if test $ac_cv_prog_gcc = yes; then
+    GCC=yes
+  else
+    GCC=
+  fi
+
+  USER_CFLAGS=$CFLAGS
+  CFLAGS=
+
+  if test -z "$CFLAGS"; then
+    if test "$kde_use_debug_code" = "yes"; then
+      AC_PROG_CC_G
+      if test $ac_cv_prog_cc_g = yes; then
+	CFLAGS="-g"
+	case $host in
+   	*-*-linux-gnu)	
+           CFLAGS="$CFLAGS -ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE -D_BSD_SOURCE"
+         ;;
+        esac
+      fi
+    else
+      if test "$GCC" = "yes"; then
+        CFLAGS="-O2"
+      else
+        CFLAGS=""
+      fi
+      if test "$kde_use_debug_define" = "yes"; then
+        CFLAGS="$CFLAGS -DNDEBUG"
+	dnl damn buggy compilers :-(
+	dnl if test "$GCC" = "yes"; then
+    	dnl  CFLAGS="$CFLAGS -fomit-frame-pointer"
+	dnl   CXXFLAGS="$CXXFLAGS -fomit-frame-pointer"
+	dnl fi
+      fi
+    fi
+
+    if test "$kde_use_profiling" = yes; then
+      KDE_PROG_CC_PG
+      if test "$kde_cv_prog_cc_pg" = yes; then
+        CFLAGS="$CFLAGS -pg"
+      fi
+    fi
+
+    if test "$GCC" = "yes"; then
+     CFLAGS="$CFLAGS"
+
+     if test "$kde_use_strict_options" = "yes"; then
+	CFLAGS="$CFLAGS -W -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
+     fi
+    fi
+
+  fi
+
+  case "$host" in
+  *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";;
+  *-*-sysv5uw7*) CFLAGS="$CFLAGS -D_UNIXWARE7";;
+  esac
+
+  if test -n "$USER_CFLAGS"; then
+    CFLAGS="$CFLAGS $USER_CFLAGS"
+  fi
+
+  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
+     LDFLAGS=""
+  fi
+
+
+dnl this is AC_PROG_CPP. I had to include it here, since autoconf checks
+dnl dependecies between AC_PROG_CPP and AC_PROG_CC (or is it automake?)
+
+  AC_MSG_CHECKING(how to run the C preprocessor)
+  # On Suns, sometimes $CPP names a directory.
+  if test -n "$CPP" && test -d "$CPP"; then
+    CPP=
+  fi
+  if test -z "$CPP"; then
+  AC_CACHE_VAL(ac_cv_prog_CPP,
+  [  # This must be in double quotes, not single quotes, because CPP may get
+    # substituted into the Makefile and "${CC-cc}" will confuse make.
+    CPP="${CC-cc} -E"
+    # On the NeXT, cc -E runs the code through the compiler's parser,
+    # not just through cpp.
+    dnl Use a header file that comes with gcc, so configuring glibc
+    dnl with a fresh cross-compiler works.
+    AC_TRY_CPP([#include <assert.h>
+    Syntax Error], ,
+    CPP="${CC-cc} -E -traditional-cpp"
+    AC_TRY_CPP([#include <assert.h>
+    Syntax Error], , CPP=/lib/cpp))
+    ac_cv_prog_CPP="$CPP"])dnl
+    CPP="$ac_cv_prog_CPP"
+  else
+    ac_cv_prog_CPP="$CPP"
+  fi
+  AC_MSG_RESULT($CPP)
+  AC_SUBST(CPP)dnl
+
+
+  AC_MSG_CHECKING(for a C++-Compiler)
+  dnl if there is one, print out. if not, don't matter
+  AC_MSG_RESULT($CXX)
+
+  if test -z "$CXX"; then AC_CHECK_PROG(CXX, g++, g++) fi
+  if test -z "$CXX"; then AC_CHECK_PROG(CXX, CC, CC) fi
+  if test -z "$CXX"; then AC_CHECK_PROG(CXX, xlC, xlC) fi
+  if test -z "$CXX"; then AC_CHECK_PROG(CXX, DCC, DCC) fi
+  test -z "$CXX" && AC_MSG_ERROR([no acceptable C++-compiler found in \$PATH])
+
+  AC_PROG_CXX_WORKS
+  AC_PROG_CXX_GNU
+
+  if test $ac_cv_prog_gxx = yes; then
+    GXX=yes
+  fi
+
+  USER_CXXFLAGS=$CXXFLAGS
+  CXXFLAGS=""
+
+  if test -z "$CXXFLAGS"; then
+    if test "$kde_use_debug_code" = "yes"; then
+      AC_PROG_CXX_G
+      if test $ac_cv_prog_cxx_g = yes; then
+        CXXFLAGS="-g"
+	case $host in  dnl
+   	*-*-linux-gnu)
+           CXXFLAGS="$CXXFLAGS -ansi -D_XOPEN_SOURCE -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion"
+         ;;
+        esac
+      fi
+    else
+      if test "$GXX" = "yes"; then
+         CXXFLAGS="-O2"
+      fi
+      if test "$kde_use_debug_define" = "yes"; then
+         CXXFLAGS="$CXXFLAGS -DNDEBUG"
+      fi
+    fi
+
+    if test "$kde_use_profiling" = yes; then
+      KDE_PROG_CXX_PG
+      if test "$kde_cv_prog_cxx_pg" = yes; then
+        CXXFLAGS="$CXXFLAGS -pg"
+      fi
+    fi
+    
+    KDE_CHECK_COMPILER_FLAG(fno-exceptions,
+    [
+      CXXFLAGS="$CXXFLAGS -fno-exceptions"
+    ])
+      
+dnl WABA: Nothing wrong with RTTI, keep it on.
+dnl    KDE_CHECK_COMPILER_FLAG(fno-rtti,
+dnl	[
+dnl	  CXXFLAGS="$CXXFLAGS -fno-rtti"
+dnl	])
+
+    KDE_CHECK_COMPILER_FLAG(fno-check-new,
+	[
+	  CXXFLAGS="$CXXFLAGS -fno-check-new"
+	])
+
+    if test "$GXX" = "yes"; then
+       CXXFLAGS="$CXXFLAGS"
+
+       if test true || test "$kde_use_debug_code" = "yes"; then
+	 CXXFLAGS="$CXXFLAGS -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
+
+         KDE_CHECK_COMPILER_FLAG(Wno-long-long,
+	 [
+	   CXXFLAGS="$CXXFLAGS -Wno-long-long"
+	 ])
+         KDE_CHECK_COMPILER_FLAG(Wnon-virtual-dtor,
+         [
+           CXXFLAGS="$CXXFLAGS -Wnon-virtual-dtor"
+         ])
+         KDE_CHECK_COMPILER_FLAG(fno-builtin,
+         [
+           CXXFLAGS="$CXXFLAGS -fno-builtin"
+         ])
+	
+       fi
+
+       if test "$kde_use_strict_options" = "yes"; then
+	CXXFLAGS="$CXXFLAGS -Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align"
+       fi
+
+       if test "$kde_very_strict" = "yes"; then
+         CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wredundant-decls -Wconversion"
+       fi
+    fi
+  fi
+
+    KDE_CHECK_COMPILER_FLAG(fexceptions,
+	[
+	  USE_EXCEPTIONS="-fexceptions"
+	],
+	  USE_EXCEPTIONS=
+	)
+    AC_SUBST(USE_EXCEPTIONS)
+
+    KDE_CHECK_COMPILER_FLAG(frtti,
+	[
+	  USE_RTTI="-frtti"
+	],
+	  USE_RTTI=
+	)
+    AC_SUBST(USE_RTTI)
+
+    case "$host" in
+      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS" ;;
+      *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";;
+      *-*-sysv5uw7*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE7";;
+      *-*-solaris*) 
+        if test "$GXX" = yes; then
+          libstdcpp=`gcc -print-file-name=libstdc++.so`
+          if test ! -f $libstdcpp; then
+             AC_MSG_ERROR([You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so])
+          fi
+        fi
+        ;;
+    esac
+
+    if test -n "$USER_CXXFLAGS"; then
+       CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
+    fi
+
+    AC_VALIDIFY_CXXFLAGS
+
+    AC_MSG_CHECKING(how to run the C++ preprocessor)
+    if test -z "$CXXCPP"; then
+      AC_CACHE_VAL(ac_cv_prog_CXXCPP,
+      [
+         AC_LANG_SAVE[]dnl
+         AC_LANG_CPLUSPLUS[]dnl
+         CXXCPP="${CXX-g++} -E"
+         AC_TRY_CPP([#include <stdlib.h>], , CXXCPP=/lib/cpp)
+         ac_cv_prog_CXXCPP="$CXXCPP"
+         AC_LANG_RESTORE[]dnl
+     ])dnl
+     CXXCPP="$ac_cv_prog_CXXCPP"
+    fi
+    AC_MSG_RESULT($CXXCPP)
+    AC_SUBST(CXXCPP)dnl
+
+    # the following is to allow programs, that are known to
+    # have problems when compiled with -O2
+    if test -n "$CXXFLAGS"; then
+      kde_safe_IFS=$IFS
+      IFS=" "
+      NOOPT_CXXFLAGS=""
+      for i in $CXXFLAGS; do
+        case $i in
+          -O*)
+                ;;
+          *)
+                NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
+                ;;
+        esac
+      done
+      IFS=$kde_safe_IFS
+    fi
+    AC_SUBST(NOOPT_CXXFLAGS)
+
+    KDE_CHECK_FINAL
+
+    ifdef([AM_DEPENDENCIES], AC_REQUIRE([KDE_ADD_DEPENDENCIES]), [])
+
+    KDE_CXXFLAGS=
+    AC_SUBST(KDE_CXXFLAGS)
+])
+
+AC_DEFUN(KDE_ADD_DEPENDENCIES,
+[
+   [A]M_DEPENDENCIES(CC)
+   [A]M_DEPENDENCIES(CXX)
+])
+
+dnl just a wrapper to clean up configure.in
+AC_DEFUN(KDE_PROG_LIBTOOL,
+[
+AC_REQUIRE([AC_CHECK_COMPILERS])
+AC_REQUIRE([AC_ENABLE_SHARED])
+AC_REQUIRE([AC_ENABLE_STATIC])
+
+AC_REQUIRE([AC_LIBTOOL_DLOPEN])
+
+AC_LANG_SAVE
+AC_LANG_C
+AC_OBJEXT
+AC_EXEEXT
+AC_LANG_RESTORE
+
+AM_PROG_LIBTOOL
+AC_LIBTOOL_CXX
+
+LIBTOOL_SHELL="/bin/sh ./libtool"
+#  LIBTOOL="$LIBTOOL --silent"
+KDE_PLUGIN="-avoid-version -module -no-undefined"
+AC_SUBST(KDE_PLUGIN)
+])
+
+AC_DEFUN(KDE_CHECK_TYPES,
+[  AC_CHECK_SIZEOF(int, 4)dnl
+  AC_CHECK_SIZEOF(long, 4)dnl
+  AC_CHECK_SIZEOF(char *, 4)dnl
+])dnl
+
+AC_DEFUN(KDE_DO_IT_ALL,
+[
+AC_CANONICAL_SYSTEM
+AC_ARG_PROGRAM
+AM_INIT_AUTOMAKE($1, $2)
+AM_DISABLE_LIBRARIES
+AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+AC_CHECK_COMPILERS
+KDE_PROG_LIBTOOL
+AM_KDE_WITH_NLS
+AC_PATH_KDE
+])
+
+AC_DEFUN(AC_CHECK_RPATH,
+[
+AC_MSG_CHECKING(for rpath)
+AC_ARG_ENABLE(rpath,
+      [  --disable-rpath         do not use the rpath feature of ld],
+      USE_RPATH=$enableval, USE_RPATH=yes)
+
+if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
+
+  KDE_RPATH="-R \$(kde_libraries)"
+
+  if test -n "$qt_libraries"; then
+    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
+  fi
+  dnl $x_libraries is set to /usr/lib in case
+  if test -n "$X_LDFLAGS"; then
+    KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
+  fi
+  if test -n "$KDE_EXTRA_RPATH"; then
+    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
+  fi
+fi
+AC_SUBST(KDE_EXTRA_RPATH)
+AC_SUBST(KDE_RPATH)
+AC_MSG_RESULT($USE_RPATH)
+])
+
+dnl Check for the type of the third argument of getsockname
+AC_DEFUN(AC_CHECK_KSIZE_T,
+[AC_MSG_CHECKING(for the third argument of getsockname)
+AC_CACHE_VAL(ac_cv_ksize_t,
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+[AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+],[
+socklen_t a=0;
+getsockname(0,(struct sockaddr*)0, &a);
+],
+ac_cv_ksize_t=socklen_t,
+ac_cv_ksize_t=)
+if test -z "$ac_cv_ksize_t"; then
+ac_safe_cxxflags="$CXXFLAGS"
+if test "$GCC" = "yes"; then
+  CXXFLAGS="-Werror $CXXFLAGS"
+fi
+AC_TRY_COMPILE([
+#include <sys/types.h>
+#include <sys/socket.h>
+],[
+int a=0;
+getsockname(0,(struct sockaddr*)0, &a);
+],
+ac_cv_ksize_t=int,
+ac_cv_ksize_t=size_t)
+CXXFLAGS="$ac_safe_cxxflags"
+fi
+AC_LANG_RESTORE
+])
+
+if test -z "$ac_cv_ksize_t"; then
+  ac_cv_ksize_t=int
+fi
+
+AC_MSG_RESULT($ac_cv_ksize_t)
+AC_DEFINE_UNQUOTED(ksize_t, $ac_cv_ksize_t,
+      [Define the type of the third argument for getsockname]
+)
+
+])
+
+dnl This is a merge of some macros out of the gettext aclocal.m4
+dnl since we don't need anything, I took the things we need
+dnl the copyright for them is:
+dnl >
+dnl Copyright (C) 1994, 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
+dnl This Makefile.in is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl This program is distributed in the hope that it will be useful,
+dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+dnl PARTICULAR PURPOSE.
+dnl >
+dnl for this file it is relicensed under LGPL
+
+AC_DEFUN(AM_KDE_WITH_NLS,
+  [
+    dnl If we use NLS figure out what method
+
+    AM_PATH_PROG_WITH_TEST_KDE(MSGFMT, msgfmt,
+        [test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"], msgfmt)
+    AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
+
+     if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
+        AC_MSG_RESULT([found msgfmt program is not GNU msgfmt; ignore it])
+        GMSGFMT=":"
+      fi
+      MSGFMT=$GMSGFMT
+      AC_SUBST(GMSGFMT)
+      AC_SUBST(MSGFMT)
+
+      AM_PATH_PROG_WITH_TEST_KDE(XGETTEXT, xgettext,
+	[test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :)
+
+      dnl Test whether we really found GNU xgettext.
+      if test "$XGETTEXT" != ":"; then
+	dnl If it is no GNU xgettext we define it as : so that the
+	dnl Makefiles still can work.
+	if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+	  : ;
+	else
+	  AC_MSG_RESULT(
+	    [found xgettext programs is not GNU xgettext; ignore it])
+	  XGETTEXT=":"
+	fi
+      fi
+     AC_SUBST(XGETTEXT)
+
+  ])
+
+# Search path for a program which passes the given test.
+# Ulrich Drepper <drepper@cygnus.com>, 1996.
+
+# serial 1
+# Stephan Kulow: I appended a _KDE against name conflicts
+
+dnl AM_PATH_PROG_WITH_TEST_KDE(VARIABLE, PROG-TO-CHECK-FOR,
+dnl   TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
+AC_DEFUN(AM_PATH_PROG_WITH_TEST_KDE,
+[# Extract the first word of "$2", so it can be a program name with args.
+set dummy $2; ac_word=[$]2
+AC_MSG_CHECKING([for $ac_word])
+AC_CACHE_VAL(ac_cv_path_$1,
+[case "[$]$1" in
+  /*)
+  ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in ifelse([$5], , $PATH, [$5]); do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if [$3]; then
+	ac_cv_path_$1="$ac_dir/$ac_word"
+	break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+dnl If no 4th arg is given, leave the cache variable unset,
+dnl so AC_PATH_PROGS will keep looking.
+ifelse([$4], , , [  test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
+])dnl
+  ;;
+esac])dnl
+$1="$ac_cv_path_$1"
+if test -n "[$]$1"; then
+  AC_MSG_RESULT([$]$1)
+else
+  AC_MSG_RESULT(no)
+fi
+AC_SUBST($1)dnl
+])
+
+
+# Check whether LC_MESSAGES is available in <locale.h>.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# serial 1
+
+AC_DEFUN(AM_LC_MESSAGES,
+  [if test $ac_cv_header_locale_h = yes; then
+    AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
+      [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
+       am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
+    if test $am_cv_val_LC_MESSAGES = yes; then
+      AC_DEFINE(HAVE_LC_MESSAGES, 1, [Define if your locale.h file contains LC_MESSAGES])
+    fi
+  fi])
+
+dnl From Jim Meyering.
+dnl FIXME: migrate into libit.
+
+AC_DEFUN(AM_FUNC_OBSTACK,
+[AC_CACHE_CHECK([for obstacks], am_cv_func_obstack,
+ [AC_TRY_LINK([#include "obstack.h"],
+	      [struct obstack *mem;obstack_free(mem,(char *) 0)],
+	      am_cv_func_obstack=yes,
+	      am_cv_func_obstack=no)])
+ if test $am_cv_func_obstack = yes; then
+   AC_DEFINE(HAVE_OBSTACK)
+ else
+   LIBOBJS="$LIBOBJS obstack.o"
+ fi
+])
+
+dnl From Jim Meyering.  Use this if you use the GNU error.[ch].
+dnl FIXME: Migrate into libit
+
+AC_DEFUN(AM_FUNC_ERROR_AT_LINE,
+[AC_CACHE_CHECK([for error_at_line], am_cv_lib_error_at_line,
+ [AC_TRY_LINK([],[error_at_line(0, 0, "", 0, "");],
+              am_cv_lib_error_at_line=yes,
+	      am_cv_lib_error_at_line=no)])
+ if test $am_cv_lib_error_at_line = no; then
+   LIBOBJS="$LIBOBJS error.o"
+ fi
+ AC_SUBST(LIBOBJS)dnl
+])
+
+# Macro to add for using GNU gettext.
+# Ulrich Drepper <drepper@cygnus.com>, 1995.
+
+# serial 1
+# Stephan Kulow: I put a KDE in it to avoid name conflicts
+
+AC_DEFUN(AM_KDE_GNU_GETTEXT,
+  [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+   AC_REQUIRE([AC_PROG_RANLIB])dnl
+   AC_REQUIRE([AC_HEADER_STDC])dnl
+   AC_REQUIRE([AC_TYPE_OFF_T])dnl
+   AC_REQUIRE([AC_TYPE_SIZE_T])dnl
+   AC_REQUIRE([AC_FUNC_ALLOCA])dnl
+   AC_REQUIRE([AC_FUNC_MMAP])dnl
+   AC_REQUIRE([AM_KDE_WITH_NLS])dnl
+   AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h string.h values.h alloca.h])
+   AC_CHECK_FUNCS([getcwd munmap putenv setenv setlocale strchr strcasecmp \
+__argz_count __argz_stringify __argz_next])
+
+   AC_MSG_CHECKING(for stpcpy)
+   AC_CACHE_VAL(kde_cv_func_stpcpy,
+   [
+   kde_safe_cxxflags=$CXXFLAGS
+   CXXFLAGS="-Wmissing-prototypes -Werror"
+   AC_LANG_SAVE
+   AC_LANG_CPLUSPLUS
+   AC_TRY_COMPILE([
+   #include <string.h>
+   ],
+   [
+   char buffer[200];
+   stpcpy(buffer, buffer);
+   ],
+   kde_cv_func_stpcpy=yes,
+   kde_cv_func_stpcpy=no)
+   AC_LANG_RESTORE
+   CXXFLAGS=$kde_safe_cxxflags
+   ])
+   AC_MSG_RESULT($kde_cv_func_stpcpy)
+   if eval "test \"`echo $kde_cv_func_stpcpy`\" = yes"; then
+     AC_DEFINE(HAVE_STPCPY, 1, [Define if you have stpcpy])
+   fi
+
+   AM_LC_MESSAGES
+
+   if test "x$CATOBJEXT" != "x"; then
+     if test "x$ALL_LINGUAS" = "x"; then
+       LINGUAS=
+     else
+       AC_MSG_CHECKING(for catalogs to be installed)
+       NEW_LINGUAS=
+       for lang in ${LINGUAS=$ALL_LINGUAS}; do
+         case "$ALL_LINGUAS" in
+          *$lang*) NEW_LINGUAS="$NEW_LINGUAS $lang" ;;
+         esac
+       done
+       LINGUAS=$NEW_LINGUAS
+       AC_MSG_RESULT($LINGUAS)
+     fi
+
+     dnl Construct list of names of catalog files to be constructed.
+     if test -n "$LINGUAS"; then
+       for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
+     fi
+   fi
+
+  ])
+
+AC_DEFUN(AC_HAVE_XPM,
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$XPM_LDFLAGS" && XPM_LDFLAGS=
+ test -z "$XPM_INCLUDE" && XPM_INCLUDE=
+
+ AC_ARG_WITH(xpm, [  --without-xpm           disable color pixmap XPM tests],
+	xpm_test=$withval, xpm_test="yes")
+ if test "x$xpm_test" = xno; then
+   ac_cv_have_xpm=no
+ else
+   AC_MSG_CHECKING(for XPM)
+   AC_CACHE_VAL(ac_cv_have_xpm,
+   [
+    AC_LANG_C
+    ac_save_ldflags="$LDFLAGS"
+    ac_save_cflags="$CFLAGS"
+    LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
+    CFLAGS="$CFLAGS $X_INCLUDES $USER_INCLUDES"
+    test -n "$XPM_INCLUDE" && CFLAGS="-I$XPM_INCLUDE $CFLAGS"
+    AC_TRY_LINK([#include <X11/xpm.h>],[],
+	ac_cv_have_xpm="yes",ac_cv_have_xpm="no")
+    LDFLAGS="$ac_save_ldflags"
+    CFLAGS="$ac_save_cflags"
+   ])dnl
+
+  if test "$ac_cv_have_xpm" = no; then
+    AC_MSG_RESULT(no)
+    XPM_LDFLAGS=""
+    XPMINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_XPM, 1, [Define if you have XPM support])
+    if test "$XPM_LDFLAGS" = ""; then
+       XPMLIB='-lXpm $(LIB_X11)'
+    else
+       XPMLIB="-L$XPM_LDFLAGS -lXpm "'$(LIB_X11)'
+    fi
+    if test "$XPM_INCLUDE" = ""; then
+       XPMINC=""
+    else
+       XPMINC="-I$XPM_INCLUDE"
+    fi
+    AC_MSG_RESULT(yes)
+    $1
+  fi
+ fi
+ AC_SUBST(XPMINC)
+ AC_SUBST(XPMLIB)
+])
+
+AC_DEFUN(AC_HAVE_DPMS,
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$DPMS_LDFLAGS" && DPMS_LDFLAGS=
+ test -z "$DPMS_INCLUDE" && DPMS_INCLUDE=
+ DPMS_LIB=
+
+ AC_ARG_WITH(dpms, [  --without-dpms          disable DPMS power saving],
+	dpms_test=$withval, dpms_test="yes")
+ if test "x$dpms_test" = xno; then
+   ac_cv_have_dpms=no
+ else
+   AC_MSG_CHECKING(for DPMS)
+   dnl Note: ac_cv_have_dpms can be no, yes, or -lXdpms.
+   dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
+   AC_CACHE_VAL(ac_cv_have_dpms,
+   [
+    AC_LANG_C
+    ac_save_ldflags="$LDFLAGS"
+    ac_save_cflags="$CFLAGS"
+    ac_save_libs="$LIBS"
+    LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
+    CFLAGS="$CFLAGS $X_INCLUDES"
+    test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+    AC_TRY_LINK([
+	#include <X11/Xproto.h>
+	#include <X11/X.h>
+	#include <X11/Xlib.h>
+	#include <X11/extensions/dpms.h>
+	int foo_test_dpms()
+	{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+	ac_cv_have_dpms="yes", [
+            LDFLAGS="$ac_save_ldflags"
+            CFLAGS="$ac_save_cflags"
+            LDFLAGS="$LDFLAGS $DPMS_LDFLAGS $all_libraries -lX11 -lXext $LIBSOCKET"
+            LIBS="$LIBS -lXdpms"
+            CFLAGS="$CFLAGS $X_INCLUDES"
+            test -n "$DPMS_INCLUDE" && CFLAGS="-I$DPMS_INCLUDE $CFLAGS"
+            AC_TRY_LINK([
+	        #include <X11/Xproto.h>
+        	#include <X11/X.h>
+        	#include <X11/Xlib.h>
+        	#include <X11/extensions/dpms.h>
+        	int foo_test_dpms()
+        	{ return DPMSSetTimeouts( 0, 0, 0, 0 ); }],[],
+        	[
+                ac_cv_have_dpms="-lXdpms"
+                ],ac_cv_have_dpms="no")
+            ])
+    LDFLAGS="$ac_save_ldflags"
+    CFLAGS="$ac_save_cflags"
+    LIBS="$ac_save_libs"
+   ])dnl
+
+  if test "$ac_cv_have_dpms" = no; then
+    AC_MSG_RESULT(no)
+    DPMS_LDFLAGS=""
+    DPMSINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_DPMS, 1, [Define if you have DPMS support])
+    if test "$ac_cv_have_dpms" = "-lXdpms"; then
+       DPMS_LIB="-lXdpms"
+    fi
+    if test "$DPMS_LDFLAGS" = ""; then
+       DPMSLIB="$DPMS_LIB "'$(LIB_X11)'
+    else
+       DPMSLIB="$DPMS_LDFLAGS $DPMS_LIB "'$(LIB_X11)'
+    fi
+    if test "$DPMS_INCLUDE" = ""; then
+       DPMSINC=""
+    else
+       DPMSINC="-I$DPMS_INCLUDE"
+    fi
+    AC_MSG_RESULT(yes)
+    $1
+  fi
+ fi
+ AC_SUBST(DPMSINC)
+ AC_SUBST(DPMSLIB)
+])
+
+AC_DEFUN(AC_HAVE_GL,
+ [AC_REQUIRE_CPP()dnl
+  AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+
+ test -z "$GL_LDFLAGS" && GL_LDFLAGS=
+ test -z "$GL_INCLUDE" && GL_INCLUDE=
+
+ AC_ARG_WITH(gl, [  --without-gl            disable 3D GL modes],
+	gl_test=$withval, gl_test="yes")
+ if test "x$gl_test" = xno; then
+   ac_cv_have_gl=no
+ else
+   AC_MSG_CHECKING(for GL)
+   AC_CACHE_VAL(ac_cv_have_gl,
+   [
+    AC_LANG_C
+    ac_save_ldflags="$LDFLAGS"
+    ac_save_cflags="$CFLAGS"
+    LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU -lX11 -lXext -lm $LIBSOCKET"
+    CFLAGS="$CFLAGS $X_INCLUDES"
+    test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
+    AC_TRY_LINK([#include <GL/gl.h>
+#include <GL/glu.h>           
+], [],
+	ac_cv_have_gl="mesa", ac_cv_have_gl="no")
+    if test "x$ac_cv_have_gl" = "xno"; then
+      LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGL -lGLU -lX11 -lXext -lm $LIBSOCKET"
+      CFLAGS="$ac_save_cflags $X_INCLUDES"
+      test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
+      AC_TRY_LINK([#include <GL/gl.h>
+#include <GL/glu.h>
+], [],
+	  ac_cv_have_gl="yes", ac_cv_have_gl="no")
+    fi
+    LDFLAGS="$ac_save_ldflags"
+    CFLAGS="$ac_save_cflags"
+   ])dnl
+
+  if test "$ac_cv_have_gl" = "no"; then
+    AC_MSG_RESULT(no)
+    GL_LDFLAGS=""
+    GLINC=""
+    $2
+  else
+    AC_DEFINE(HAVE_GL, 1, [Defines if you have GL (Mesa, OpenGL, ...)])
+    if test "$GL_LDFLAGS" = ""; then
+       if test "$ac_cv_have_gl" = "mesa"; then
+          GLLIB='-lMesaGL -lMesaGLU $(LIB_X11)'
+       else
+          GLLIB='-lGL -lGLU $(LIB_X11)'
+       fi
+    else
+       if test "$ac_cv_have_gl" = "mesa"; then
+          GLLIB="$GL_LDFLAGS -lMesaGL -lMesaGLU "'$(LIB_X11)'
+       else
+          GLLIB="$GL_LDFLAGS -lGL -lGLU "'$(LIB_X11)'
+       fi
+    fi
+    if test "$GL_INCLUDE" = ""; then
+       GLINC=""
+    else
+       GLINC="-I$GL_INCLUDE"
+    fi
+    AC_MSG_RESULT($ac_cv_have_gl)
+    $1
+  fi
+ fi
+ AC_SUBST(GLINC)
+ AC_SUBST(GLLIB)
+])
+
+ dnl PAM pam
+
+ dnl Should test for PAM (Pluggable Authentication Modules)
+ AC_DEFUN(AC_PATH_PAM_DIRECT,
+ [
+ test -z "$pam_direct_test_library" && pam_direct_test_library=pam
+ test -z "$pam_direct_test_include" && pam_direct_test_include=security/pam_appl.h
+
+   for ac_dir in               \
+                               \
+     /usr/local/include        \
+     /usr/include              \
+     /usr/unsupported/include  \
+     /opt/include              \
+     /usr/pam/include          \
+     /usr/local/pam/include    \
+     /usr/lib/pam/include      \
+ 			      \
+     $extra_include            \
+     ; \
+   do
+     if test -r "$ac_dir/$pam_direct_test_include"; then
+       no_pam= ac_pam_includes=$ac_dir
+       break
+     fi
+   done
+
+ # First see if replacing the include by lib works.
+ for ac_dir in `echo "$ac_pam_includes" | sed s/include/lib/` \
+                           \
+     /lib                  \
+     /usr/lib              \
+     /usr/local/lib        \
+     /usr/unsupported/lib  \
+     /lib/security         \
+     /usr/security/lib     \
+     $extra_lib            \
+     ; \
+ do
+   for ac_extension in a so sl; do
+     if test -r $ac_dir/lib${pam_direct_test_library}.$ac_extension; then
+       no_pam= ac_pam_libraries=$ac_dir
+       break 2
+     fi
+   done
+ done
+])
+
+AC_DEFUN(AC_PATH_PAM,
+ [
+  AC_REQUIRE([KDE_CHECK_LIBDL])
+  AC_REQUIRE_CPP()dnl
+
+dnl AC_CHECK_LIB(pam_misc, main, [PAM_MISC_LIB="-lpam_misc"
+dnl              AC_DEFINE_UNQUOTED(HAVE_PAM_MISC, 1, [Define if you have a PAM implementation with the pam_misc library])], [], [-lpam $LIBDL])
+
+ AC_MSG_CHECKING(for PAM)
+ AC_ARG_WITH(pam,
+[  --with-pam[=ARG]        enable support for PAM: ARG=[yes|no|service name]],
+  [
+    if test "x$withval" = "xyes"; then
+      no_pam=
+      default_pam=yes
+    elif test "x$withval" = "xno"; then
+      no_pam=yes
+    else
+      no_pam=
+      pam_service="$withval"
+        if test -z "$pam_service"; then
+        default_pam=yes
+        else
+        default_pam=
+        fi
+      fi
+  ], no_pam=yes
+ )
+
+ if test ! "$no_pam" = yes; then
+
+ AC_CACHE_VAL(ac_cv_path_pam,
+ [
+ ac_pam_includes=NONE
+ ac_pam_libraries=NONE
+ if test -z "$pam_libraries"; then
+   pam_libraries=NONE
+ fi
+ if test -z "$pam_includes"; then
+   pam_includes=NONE
+ fi
+
+ AC_PATH_PAM_DIRECT
+
+ test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
+ test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
+
+ if test ! "x$pam_includes" = xNONE && test ! "x$pam_libraries" = xNONE; then
+   ac_pam_libs="-lpam $PAM_MISC_LIB $LIBDL"
+   ac_cv_path_pam="no_pam= ac_pam_includes=$ac_pam_includes ac_pam_libraries=$ac_pam_libraries ac_pam_libs=\"$ac_pam_libs\""
+ else
+   ac_cv_path_pam="no_pam=yes"
+ fi
+ ])
+
+ eval "$ac_cv_path_pam"
+
+ fi
+
+ if test "$no_pam" = yes; then
+   AC_MSG_RESULT(no)
+ else
+   AC_DEFINE(HAVE_PAM, 1, [Defines if you have PAM (Pluggable Authentication Modules); Redhat-Users!])
+   PAMLIBS="$ac_pam_libs"
+   test "x$pam_includes" = xNONE && pam_includes=$ac_pam_includes
+   test "x$pam_libraries" = xNONE && pam_libraries=$ac_pam_libraries
+   AC_MSG_RESULT([libraries $pam_libraries, headers $pam_includes])
+ if test "$default_pam" = yes; then
+   AC_MSG_RESULT(["default pam service name will be used"])
+ else
+   AC_DEFINE_UNQUOTED(KDE_PAM_SERVICE,"$pam_service", [Define to change the default name of the PAM service used by KDE])
+   AC_MSG_RESULT(["pam service name will be: " $pam_service])
+ fi
+dnl test whether struct pam_message is const (Linux) or not (Sun)
+   pam_appl_h="$ac_pam_includes/security/pam_appl.h"
+   AC_MSG_CHECKING(for const pam_message)
+   AC_EGREP_HEADER([struct pam_message],
+      $pam_appl_h,
+      [ AC_EGREP_HEADER([const struct pam_message],
+                        $pam_appl_h,
+                        [AC_MSG_RESULT(["const: Linux-type PAM"]) ],
+                        [AC_MSG_RESULT(["nonconst: Sun-type PAM"])
+                        AC_DEFINE(PAM_MESSAGE_NONCONST, 1, [Define if your PAM support takes non-const arguments (Solaris)])]
+                        )],
+       [AC_MSG_RESULT(["not found - assume const, Linux-type PAM"])]
+       )
+ fi
+
+ if test "x$pam_libraries" != x && test "x$pam_libraries" != xNONE ; then
+     PAMLIBPATHS="-L$pam_libraries"
+ fi
+ if test "x$pam_includes" != x && test "x$pam_includes" != xNONE ; then
+     PAMINC="-I$pam_includes"
+ fi
+
+ AC_SUBST(PAMINC)
+ AC_SUBST(PAMLIBS)
+ AC_SUBST(PAMLIBPATHS)
+
+])
+
+AC_DEFUN(KDE_CHECK_LIBDL,
+[
+AC_CHECK_LIB(dl, dlopen, [
+LIBDL="-ldl"
+ac_cv_have_dlfcn=yes
+])
+
+AC_CHECK_LIB(dld, shl_unload, [
+LIBDL="-ldld"
+ac_cv_have_shload=yes
+])
+
+AC_SUBST(LIBDL)
+])
+
+AC_DEFUN(KDE_CHECK_DLOPEN,
+[
+KDE_CHECK_LIBDL
+AC_CHECK_HEADERS(dlfcn.h dl.h)
+if test "$ac_cv_header_dlfcn_h" = "no"; then
+  ac_cv_have_dlfcn=no
+fi
+
+if test "$ac_cv_header_dl_h" = "no"; then
+  ac_cv_have_shload=no
+fi
+
+dnl XXX why change enable_dlopen? its already set by autoconf's AC_ARG_ENABLE
+dnl (MM)
+AC_ARG_ENABLE(dlopen,
+[  --disable-dlopen        link statically [default=no]] ,
+enable_dlopen=$enableval,
+enable_dlopen=yes)
+
+# override the user's opinion, if we know it better ;)
+if test "$ac_cv_have_dlfcn" = "no" && test "$ac_cv_have_shload" = "no"; then
+  enable_dlopen=no
+fi
+
+if test "$ac_cv_have_dlfcn" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_DLFCN, 1, [Define if you have dlfcn])
+fi
+
+if test "$ac_cv_have_shload" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_SHLOAD, 1, [Define if you have shload])
+fi
+
+if test "$enable_dlopen" = no ; then
+  test -n "$1" && eval $1
+else
+  test -n "$2" && eval $2
+fi
+
+])
+
+AC_DEFUN(KDE_CHECK_DYNAMIC_LOADING,
+[
+KDE_CHECK_DLOPEN(libtool_enable_shared=yes, libtool_enable_static=no)
+KDE_PROG_LIBTOOL
+AC_MSG_CHECKING([dynamic loading])
+eval "`egrep '^build_libtool_libs=' libtool`"
+if test "$build_libtool_libs" = "yes" && test "$enable_dlopen" = "yes"; then
+  dynamic_loading=yes
+  AC_DEFINE_UNQUOTED(HAVE_DYNAMIC_LOADING)
+else
+  dynamic_loading=no
+fi
+AC_MSG_RESULT($dynamic_loading)
+if test "$dynamic_loading" = "yes"; then
+  $1
+else
+  $2
+fi
+])
+
+AC_DEFUN(KDE_ADD_INCLUDES,
+[
+if test -z "$1"; then
+  test_include="Pix.h"
+else
+  test_include="$1"
+fi
+
+AC_MSG_CHECKING([for libg++ ($test_include)])
+
+AC_CACHE_VAL(kde_cv_libgpp_includes,
+[
+kde_cv_libgpp_includes=no
+
+   for ac_dir in               \
+                               \
+     /usr/include/g++          \
+     /usr/include              \
+     /usr/unsupported/include  \
+     /opt/include              \
+     $extra_include            \
+     ; \
+   do
+     if test -r "$ac_dir/$test_include"; then
+       kde_cv_libgpp_includes=$ac_dir
+       break
+     fi
+   done
+])
+
+AC_MSG_RESULT($kde_cv_libgpp_includes)
+if test "$kde_cv_libgpp_includes" != "no"; then
+  all_includes="-I$kde_cv_libgpp_includes $all_includes $USER_INCLUDES"
+fi
+])
+])
+
+
+AC_DEFUN(KDE_CHECK_MICO,
+[
+AC_REQUIRE([KDE_CHECK_LIBDL])
+AC_REQUIRE([KDE_MISC_TESTS])
+AC_MSG_CHECKING(for MICO)
+
+if test -z "$MICODIR"; then
+    kde_micodir=/usr/local
+ else
+    kde_micodir="$MICODIR"
+fi
+
+AC_ARG_WITH(micodir,
+  [  --with-micodir=micodir  where mico is installed ],
+  kde_micodir=$withval,
+  kde_micodir=$kde_micodir
+)
+
+AC_CACHE_VAL(kde_cv_mico_incdir,
+[
+  mico_incdirs="$kde_micodir/include /usr/include /usr/local/include /usr/local/include /opt/local/include $kde_extra_includes"
+AC_FIND_FILE(CORBA.h, $mico_incdirs, kde_cv_mico_incdir)
+
+])
+kde_micodir=`echo $kde_cv_mico_incdir | sed -e 's#/include##'`
+
+if test ! -r  $kde_micodir/include/CORBA.h; then
+  AC_MSG_ERROR([No CORBA.h found, specify another micodir])
+fi
+
+AC_MSG_RESULT($kde_micodir)
+
+MICO_INCLUDES=-I$kde_micodir/include
+AC_SUBST(MICO_INCLUDES)
+MICO_LDFLAGS=-L$kde_micodir/lib
+AC_SUBST(MICO_LDFLAGS)
+micodir=$kde_micodir
+AC_SUBST(micodir)
+
+AC_MSG_CHECKING([for MICO version])
+AC_CACHE_VAL(kde_cv_mico_version,
+[
+AC_LANG_C
+cat >conftest.$ac_ext <<EOF
+#include <stdio.h>
+#include <mico/version.h>
+int main() {
+
+   printf("MICO_VERSION=%s\n",MICO_VERSION);
+   return (0);
+}
+EOF
+ac_compile='${CC-gcc} $CFLAGS $MICO_INCLUDES conftest.$ac_ext -o conftest'
+if AC_TRY_EVAL(ac_compile); then
+  if eval `./conftest 2>&5`; then
+    kde_cv_mico_version=$MICO_VERSION
+  else
+    AC_MSG_ERROR([your system is not able to execute a small application to
+    find MICO version! Check $kde_micodir/include/mico/version.h])
+  fi
+else
+  AC_MSG_ERROR([your system is not able to compile a small application to
+  find MICO version! Check $kde_micodir/include/mico/version.h])
+fi
+])
+
+dnl installed MICO version
+mico_v_maj=`echo $kde_cv_mico_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
+mico_v_mid=`echo $kde_cv_mico_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
+mico_v_min=`echo $kde_cv_mico_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
+
+if test "x$1" = "x"; then
+ req_version="2.3.0"
+else
+ req_version=$1
+fi
+
+dnl required MICO version
+req_v_maj=`echo $req_version | sed -e 's/^\(.*\)\..*\..*$/\1/'`
+req_v_mid=`echo $req_version | sed -e 's/^.*\.\(.*\)\..*$/\1/'`
+req_v_min=`echo $req_version | sed -e 's/^.*\..*\.\(.*\)$/\1/'`
+
+if test "$mico_v_maj" -lt "$req_v_maj" || \
+   ( test "$mico_v_maj" -eq "$req_v_maj" && \
+        test "$mico_v_mid" -lt "$req_v_mid" ) || \
+   ( test "$mico_v_mid" -eq "$req_v_mid" && \
+        test "$mico_v_min" -lt "$req_v_min" )
+
+then
+  AC_MSG_ERROR([found MICO version $kde_cv_mico_version but version $req_version \
+at least is required. You should upgrade MICO.])
+else
+  AC_MSG_RESULT([$kde_cv_mico_version (minimum version $req_version, ok)])
+fi
+
+LIBMICO="-lmico$kde_cv_mico_version $LIBCRYPT $LIBSOCKET $LIBDL"
+AC_SUBST(LIBMICO)
+if test -z "$IDL"; then
+  IDL='$(kde_bindir)/cuteidl'
+fi
+AC_SUBST(IDL)
+IDL_DEPENDENCIES='$(kde_includes)/CUTE.h'
+AC_SUBST(IDL_DEPENDENCIES)
+
+idldir="\$(includedir)/idl"
+AC_SUBST(idldir)
+
+])
+
+AC_DEFUN(KDE_CHECK_MINI_STL,
+[
+AC_REQUIRE([KDE_CHECK_MICO])
+
+AC_MSG_CHECKING(if we use mico's mini-STL)
+AC_CACHE_VAL(kde_cv_have_mini_stl,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+kde_save_cxxflags="$CXXFLAGS"
+CXXFLAGS="$CXXFLAGS $MICO_INCLUDES"
+AC_TRY_COMPILE(
+[
+#include <mico/config.h>
+],
+[
+#ifdef HAVE_MINI_STL
+#error "nothing"
+#endif
+],
+kde_cv_have_mini_stl=no,
+kde_cv_have_mini_stl=yes)
+CXXFLAGS="$kde_save_cxxflags"
+AC_LANG_RESTORE
+])
+
+if test "x$kde_cv_have_mini_stl" = "xyes"; then
+   AC_MSG_RESULT(yes)
+   $1
+else
+   AC_MSG_RESULT(no)
+   $2
+fi
+])
+
+])
+
+
+AC_DEFUN(KDE_CHECK_LIBPTHREAD,
+[
+AC_CHECK_LIB(pthread, pthread_create, [LIBPTHREAD="-lpthread"] )
+AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN(KDE_CHECK_PTHREAD_OPTION,
+[
+    AC_ARG_ENABLE(kernel-threads, [  --enable-kernel-threads Enable the use of the LinuxThreads port on FreeBSD/i386 only.],
+	kde_use_kernthreads=$enableval, kde_use_kernthreads=no)
+
+    if test "$kde_use_kernthreads" = "yes"; then
+      ac_save_CXXFLAGS="$CXXFLAGS"
+      ac_save_CFLAGS="$CXXFLAGS"
+      CXXFLAGS="-I/usr/local/include/pthread/linuxthreads $CXXFLAGS"
+      CFLAGS="-I/usr/local/include/pthread/linuxthreads $CFLAGS"
+      AC_CHECK_HEADERS(pthread/linuxthreads/pthread.h)
+      CXXFLAGS="$ac_save_CXXFLAGS"
+      CFLAGS="$ac_save_CFLAGS"
+      if test "$ac_cv_header_pthread_linuxthreads_pthread_h" = "no"; then
+        kde_use_kernthreads=no
+      else
+        dnl Add proper -I and -l statements
+        AC_CHECK_LIB(lthread, pthread_join, [LIBPTHREAD="-llthread -llgcc_r"]) dnl for FreeBSD
+        if test "x$LIBPTHREAD" = "x"; then
+          kde_use_kernthreads=no
+        else
+          USE_THREADS="-D_THREAD_SAFE -I/usr/local/include/pthread/linuxthreads"
+        fi
+      fi
+    else 
+      USE_THREADS=""
+      if test -z "$LIBPTHREAD"; then
+        KDE_CHECK_COMPILER_FLAG(pthread, [USE_THREADS="-pthread"] )
+      fi
+    fi
+
+    case $host_os in
+ 	solaris*)
+		KDE_CHECK_COMPILER_FLAG(mt, [USE_THREADS="-mt"])
+                CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS"
+                echo "Setting Solaris pthread compilation options"
+    		;;
+        freebsd*)
+                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+                echo "Setting FreeBSD pthread compilation options"
+                ;;
+        aix*)
+                CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
+                LIBPTHREAD="$LIBPTHREAD -lc_r"
+                echo "Setting AIX pthread compilation options"
+                ;;
+        linux*) CPPFLAGS="$CPPFLAGS -D_REENTRANT"
+                USE_THREADS="$USE_THREADS -DPIC -fPIC"
+                echo "Setting Linux pthread compilation options"
+                ;;
+	*)
+		;;
+    esac
+    AC_SUBST(USE_THREADS)
+    AC_SUBST(LIBPTHREAD)
+])
+
+AC_DEFUN(KDE_CHECK_THREADING,
+[
+  AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+  AC_REQUIRE([KDE_CHECK_PTHREAD_OPTION])
+  dnl default is yes if libpthread is found and no if no libpthread is available
+  if test -z "$LIBPTHREAD"; then
+    kde_check_threading_default=no
+  else
+    kde_check_threading_default=yes
+  fi
+  AC_ARG_ENABLE(threading, [  --disable-threading     disables threading even if libpthread found ],
+   kde_use_threading=$enableval, kde_use_threading=$kde_check_threading_default)
+
+  if test "x$kde_use_threading" = "xyes"; then
+    AC_DEFINE(HAVE_LIBPTHREAD, 1, [Define if you have a working libpthread (will enable threaded code)])
+  fi
+])
+
+AC_DEFUN(KDE_TRY_LINK_PYTHON,
+[
+if test "$kde_python_link_found" = no; then
+
+if test "$1" = normal; then
+  AC_MSG_CHECKING(if a Python application links)
+else
+  AC_MSG_CHECKING(if Python depends on $2)
+fi
+
+AC_CACHE_VAL(kde_cv_try_link_python_$1,
+[
+AC_LANG_SAVE
+AC_LANG_C
+kde_save_cflags="$CFLAGS"
+CFLAGS="$CFLAGS $PYTHONINC"
+kde_save_libs="$LIBS"
+LIBS="$LIBS $LIBPYTHON $2 $LIBDL $LIBSOCKET"
+kde_save_ldflags="$LDFLAGS"
+LDFLAGS="$LDFLAGS $PYTHONLIB"
+
+AC_TRY_LINK(
+[
+#include <Python.h>
+],[
+	PySys_SetArgv(1, 0);
+],
+	[kde_cv_try_link_python_$1=yes],
+	[kde_cv_try_link_python_$1=no]
+)
+CFLAGS="$kde_save_cflags"
+LIBS="$kde_save_libs"
+LDFLAGS="$kde_save_ldflags"
+])
+
+if test "$kde_cv_try_link_python_$1" = "yes"; then
+  AC_MSG_RESULT(yes)
+  kde_python_link_found=yes
+  if test ! "$1" = normal; then
+    LIBPYTHON="$LIBPYTHON $2"
+  fi
+  $3
+else
+  AC_MSG_RESULT(no)
+  $4
+fi
+AC_LANG_RESTORE
+
+fi
+
+])
+
+AC_DEFUN(KDE_CHECK_PYTHON,
+[
+AC_REQUIRE([KDE_CHECK_LIBDL])
+AC_REQUIRE([KDE_CHECK_LIBPTHREAD])
+
+AC_MSG_CHECKING([for Python directory])
+
+AC_CACHE_VAL(kde_cv_pythondir,
+[
+  if test -z "$PYTHONDIR"; then
+    kde_cv_pythondir=/usr/local
+  else
+    kde_cv_pythondir="$PYTHONDIR"
+  fi
+])
+
+AC_ARG_WITH(pythondir,
+[  --with-pythondir=pythondir   use python installed in pythondir ],
+[
+  ac_python_dir=$withval
+], ac_python_dir=$kde_cv_pythondir
+)
+
+AC_MSG_RESULT($ac_python_dir)
+
+if test -z "$1"; then
+  version="1.5"
+else
+  version="$1"
+fi
+
+AC_MSG_CHECKING([for Python$version])
+
+python_incdirs="$ac_python_dir/include /usr/include /usr/local/include/ $kde_extra_includes"
+AC_FIND_FILE(Python.h, $python_incdirs, python_incdir)
+if test ! -r $python_incdir/Python.h; then
+  AC_FIND_FILE(python$version/Python.h, $python_incdirs, python_incdir)
+  python_incdir=$python_incdir/python$version
+  if test ! -r $python_incdir/Python.h; then
+    AC_MSG_ERROR(Python.h not found.)
+  fi
+fi
+
+PYTHONINC=-I$python_incdir
+
+python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
+AC_FIND_FILE(libpython$version.a, $python_libdirs, python_libdir)
+if test ! -r $python_libdir/libpython$version.a; then
+  AC_FIND_FILE(python$version/config/libpython$version.a, $python_libdirs, python_libdir)
+  python_libdir=$python_libdir/python$version/config
+  if test ! -r $python_libdir/libpython$version.a; then
+    AC_MSG_ERROR(libpython$version.a not found.)
+  fi
+fi
+
+PYTHONLIB=-L$python_libdir
+if test -z "$LIBPYTHON"; then
+LIBPYTHON=-lpython$version
+fi
+
+python_libdirs="$ac_python_dir/lib /usr/lib /usr/local /usr/lib $kde_extra_libs"
+AC_FIND_FILE(python$version/copy.py, $python_libdirs, python_moddir)
+python_moddir=$python_moddir/python$version
+if test ! -r $python_moddir/copy.py; then
+  AC_MSG_ERROR(python module directory not found.)
+fi
+
+PYTHONMODDIR=$python_moddir
+
+AC_MSG_RESULT(header $python_incdir library $python_libdir modules $python_moddir)
+
+dnl Note: this test is very weak
+kde_python_link_found=no
+KDE_TRY_LINK_PYTHON(normal)
+KDE_TRY_LINK_PYTHON(m, -lm)
+KDE_TRY_LINK_PYTHON(pthread, $LIBPTHREAD)
+KDE_TRY_LINK_PYTHON(tcl, -ltcl)
+KDE_TRY_LINK_PYTHON(m_and_thread, [$LIBPTHREAD -lm], [],
+	[AC_MSG_WARN([it seems, Python depends on another library.
+    Pleae use \"make LIBPTYHON='-lpython$version -lotherlib'\" to fix this
+    and contact the authors to let them know about this problem])
+	])
+
+LIBPYTHON="$LIBPYTHON $LIBDL $LIBSOCKET"
+AC_SUBST(PYTHONINC)
+AC_SUBST(PYTHONLIB)
+AC_SUBST(LIBPYTHON)
+AC_SUBST(PYTHONMODDIR)
+
+])
+
+
+AC_DEFUN(KDE_CHECK_STL_SGI,
+[
+    AC_MSG_CHECKING([if STL implementation is SGI like])
+    AC_CACHE_VAL(kde_cv_stl_type_sgi,
+    [
+      AC_TRY_COMPILE([
+#include <string>
+using namespace std;
+],[
+  string astring="Hallo Welt.";
+  astring.erase(0, 6); // now astring is "Welt"
+  return 0;
+], kde_cv_stl_type_sgi=yes,
+   kde_cv_stl_type_sgi=no)
+])
+
+   AC_MSG_RESULT($kde_cv_stl_type_sgi)
+
+   if test "$kde_cv_stl_type_sgi" = "yes"; then
+	AC_DEFINE_UNQUOTED(HAVE_SGI_STL, 1, [Define if you have a STL implementation by SGI])
+   fi
+])
+
+AC_DEFUN(KDE_CHECK_STL_HP,
+[
+    AC_MSG_CHECKING([if STL implementation is HP like])
+    AC_CACHE_VAL(kde_cv_stl_type_hp,
+    [
+      AC_TRY_COMPILE([
+#include <string>
+using namespace std;
+],[
+  string astring="Hello World";
+  astring.remove(0, 6); // now astring is "World"
+  return 0;
+], kde_cv_stl_type_hp=yes,
+   kde_cv_stl_type_hp=no)
+])
+   AC_MSG_RESULT($kde_cv_stl_type_hp)
+
+   if test "$kde_cv_stl_type_hp" = "yes"; then
+	AC_DEFINE_UNQUOTED(HAVE_HP_STL, 1, [Define if you have a STL implementation by SGI])
+   fi
+])
+
+AC_DEFUN(KDE_CHECK_STL,
+[
+    AC_LANG_SAVE
+    AC_LANG_CPLUSPLUS
+    ac_save_CXXFLAGS="$CXXFLAGS"
+    CXXFLAGS="`echo $CXXFLAGS | sed s/-fno-exceptions//`"
+    KDE_CHECK_STL_SGI
+
+    if test "$kde_cv_stl_type_sgi" = "no"; then
+       KDE_CHECK_STL_HP
+
+       if test "$kde_cv_stl_type_hp" = "no"; then
+         AC_MSG_ERROR("no known STL type found")
+       fi
+    fi
+
+    CXXFLAGS="$ac_save_CXXFLAGS"
+    AC_LANG_RESTORE
+])
+
+AC_DEFUN(AC_FIND_QIMGIO,
+   [AC_REQUIRE([AC_FIND_JPEG])
+AC_REQUIRE([KDE_CHECK_EXTRA_LIBS])
+AC_MSG_CHECKING([for qimgio])
+AC_CACHE_VAL(ac_cv_lib_qimgio,
+[
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+ac_save_LIBS="$LIBS"
+ac_save_CXXFLAGS="$CXXFLAGS"
+LIBS="$all_libraries -lqimgio -lpng -lz $LIBJPEG $LIBQT"
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+AC_TRY_RUN(dnl
+[
+#include <qimageio.h>
+#include <qstring.h>
+int main() {
+		QString t = "hallo";
+		t.fill('t');
+		qInitImageIO();
+}
+],
+            ac_cv_lib_qimgio=yes,
+            ac_cv_lib_qimgio=no,
+	    ac_cv_lib_qimgio=no)
+LIBS="$ac_save_LIBS"
+CXXFLAGS="$ac_save_CXXFLAGS"
+AC_LANG_RESTORE
+])dnl
+if eval "test \"`echo $ac_cv_lib_qimgio`\" = yes"; then
+  LIBQIMGIO="-lqimgio -lpng -lz $LIBJPEG"
+  AC_MSG_RESULT(yes)
+  AC_DEFINE_UNQUOTED(HAVE_QIMGIO, 1, [Define if you have the Qt extension qimgio available])
+  AC_SUBST(LIBQIMGIO)
+else
+  AC_MSG_RESULT(not found)
+fi
+])
+
+AC_DEFUN(KDE_CHECK_ANSI,
+[
+])
+
+AC_DEFUN(KDE_CHECK_INSURE,
+[
+  AC_ARG_ENABLE(insure, [  --enable-insure             use insure++ for debugging [default=no]],
+  [
+  if test $enableval = "no"; dnl
+	then ac_use_insure="no"
+	else ac_use_insure="yes"
+   fi
+  ], [ac_use_insure="no"])
+
+  AC_MSG_CHECKING(if we will use Insure++ to debug)
+  AC_MSG_RESULT($ac_use_insure)
+  if test "$ac_use_insure" = "yes"; dnl
+       then CC="insure"; CXX="insure"; dnl CFLAGS="$CLAGS -fno-rtti -fno-exceptions "????
+   fi
+])
+
+AC_DEFUN(AM_DISABLE_LIBRARIES,
+[
+    AC_PROVIDE([AM_ENABLE_STATIC])
+    AC_PROVIDE([AM_ENABLE_SHARED])
+    enable_static=no
+    enable_shared=yes
+])
+
+
+AC_DEFUN(AC_CHECK_UTMP_FILE,
+[
+    AC_MSG_CHECKING([for utmp file])
+
+    AC_CACHE_VAL(kde_cv_utmp_file,
+    [
+    kde_cv_utmp_file=no
+
+    for ac_file in    \
+                      \
+	/var/run/utmp \
+	/var/adm/utmp \
+	/etc/utmp     \
+     ; \
+    do
+     if test -r "$ac_file"; then
+       kde_cv_utmp_file=$ac_file
+       break
+     fi
+    done
+    ])
+
+    if test "$kde_cv_utmp_file" != "no"; then
+	AC_DEFINE_UNQUOTED(UTMP, "$kde_cv_utmp_file", [Define the file for utmp entries])
+	$1
+	AC_MSG_RESULT($kde_cv_utmp_file)
+    else
+    	$2
+	AC_MSG_RESULT([non found])
+    fi
+])
+
+
+AC_DEFUN(KDE_CREATE_SUBDIRSLIST,
+[
+
+DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
+
+if test ! -s $srcdir/subdirs; then
+  dnl Note: Makefile.common creates subdirs, so this is just a fallback
+  TOPSUBDIRS=""
+  files=`cd $srcdir && ls -1`
+  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
+  for i in $dirs; do
+    echo $i >> $srcdir/subdirs
+  done
+fi
+
+if test -s $srcdir/inst-apps; then
+  ac_topsubdirs="`cat $srcdir/inst-apps`"
+else
+  ac_topsubdirs="`cat $srcdir/subdirs`"
+fi
+
+for i in $ac_topsubdirs; do
+  AC_MSG_CHECKING([if $i should be compiled])
+  if test -d $srcdir/$i; then
+    install_it="yes"
+    for j in $DO_NOT_COMPILE; do
+      if test $i = $j; then
+        install_it="no"
+      fi
+    done
+  else
+    install_it="no"
+  fi
+  AC_MSG_RESULT($install_it)
+  if test $install_it = "yes"; then
+    TOPSUBDIRS="$TOPSUBDIRS $i"
+  fi
+done
+
+AC_SUBST(TOPSUBDIRS)
+])
+
+AC_DEFUN(KDE_CHECK_NAMESPACES,
+[
+AC_MSG_CHECKING(whether C++ compiler supports namespaces)
+AC_LANG_SAVE
+AC_LANG_CPLUSPLUS
+AC_TRY_COMPILE([
+],
+[
+namespace Foo {
+  extern int i;
+  namespace Bar {
+    extern int i;
+  }
+}
+
+int Foo::i = 0;
+int Foo::Bar::i = 1;
+],[
+  AC_MSG_RESULT(yes)
+  AC_DEFINE(HAVE_NAMESPACES)
+], [
+AC_MSG_RESULT(no)
+])
+AC_LANG_RESTORE
+])
+
+AC_DEFUN(KDE_CHECK_NEWLIBS,
+[
+
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for S_ISSOCK macro. Doesn't exist on Unix SCO. faure@kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_CHECK_S_ISSOCK,
+[
+AC_MSG_CHECKING(for S_ISSOCK)
+AC_CACHE_VAL(ac_cv_have_s_issock,
+[
+AC_LANG_SAVE
+AC_LANG_C
+AC_TRY_LINK(
+[
+#include <sys/stat.h>
+],
+[
+struct stat buff;
+int b = S_ISSOCK( buff.st_mode );
+],
+ac_cv_have_s_issock=yes,
+ac_cv_have_s_issock=no)
+AC_LANG_RESTORE
+])
+AC_MSG_RESULT($ac_cv_have_s_issock)
+if test "$ac_cv_have_s_issock" = "yes"; then
+  AC_DEFINE_UNQUOTED(HAVE_S_ISSOCK, 1, [Define if sys/stat.h declares S_ISSOCK.])
+fi
+])
+
+dnl ------------------------------------------------------------------------
+dnl Check for MAXPATHLEN macro, defines KDEMAXPATHLEN. faure@kde.org
+dnl ------------------------------------------------------------------------
+dnl
+AC_DEFUN(AC_CHECK_KDEMAXPATHLEN,
+[
+AC_MSG_CHECKING(for MAXPATHLEN)
+AC_CACHE_VAL(ac_cv_maxpathlen,
+[
+AC_LANG_C
+cat > conftest.$ac_ext <<EOF
+#include <stdio.h>
+#include <sys/param.h>
+#ifndef MAXPATHLEN
+#define MAXPATHLEN 1024
+#endif
+
+KDE_HELLO MAXPATHLEN
+
+EOF
+
+ac_try="$ac_cpp conftest.$ac_ext 2>/dev/null | grep '^KDE_HELLO' >conftest.out"
+
+if AC_TRY_EVAL(ac_try) && test -s conftest.out; then
+    ac_cv_maxpathlen=`sed 's#KDE_HELLO ##' conftest.out`
+else
+    ac_cv_maxpathlen=1024
+fi
+
+rm conftest.*
+
+])
+AC_MSG_RESULT($ac_cv_maxpathlen)
+AC_DEFINE_UNQUOTED(KDEMAXPATHLEN,$ac_cv_maxpathlen, [Define a safe value for MAXPATHLEN] )
+])
+
+dnl -------------------------------------------------------------------------
+dnl See if the compiler supports a template repository         bero@redhat.de
+dnl -------------------------------------------------------------------------
+AC_DEFUN(KDE_COMPILER_REPO,
+[
+  REPO=""
+  NOREPO=""
+
+  KDE_CHECK_COMPILER_FLAG(frepo,
+   [
+     REPO="-frepo"
+     NOREPO="-fno-repo"
+   ])
+
+  if test -z "$REPO"; then
+  KDE_CHECK_COMPILER_FLAG(instances=explicit,
+  [
+     REPO="-instances=explicit"
+     NOREPO="-instances=extern"
+  ])
+  fi
+
+  if test -n "$REPO"; then
+     AC_DEFINE_UNQUOTED(HAVE_TEMPLATE_REPOSITORY, 1,
+		[C++ compiler supports template repository])
+     $1
+  fi
+
+  AC_SUBST(REPO)
+  AC_SUBST(NOREPO)
+])
+
+AC_DEFUN(KDE_CHECK_HEADER,
+[
+   AC_LANG_SAVE
+   kde_safe_cppflags=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS $all_includes"
+   AC_LANG_CPLUSPLUS
+   AC_CHECK_HEADER($1, $2, $3)
+   CPPFLAGS=$kde_safe_cppflags
+   AC_LANG_RESTORE
+])
+
+AC_DEFUN(KDE_CHECK_QWSPRITEFIELD,
+[
+  KDE_CHECK_HEADER(QwSpriteField.h, ,
+  [
+    AC_MSG_WARN([you don't have QwSpriteField.h somewhere. Please install
+       QwSpriteField out of kdesupport.])
+      $1
+  ])
+])
+
+AC_DEFUN(KDE_FAST_CONFIGURE,
+[
+  dnl makes configure fast (needs perl)
+  AC_ARG_ENABLE(fast-perl, [  --disable-fast-perl     disable fast Makefile generation (needs perl)],
+      with_fast_perl=$enableval, with_fast_perl=yes)
+])
+
+AC_DEFUN(KDE_CONF_FILES,
+[
+  val=
+  if test -f $srcdir/configure.files ; then
+    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
+  fi
+  CONF_FILES=
+  if test -n "$val" ; then
+    for i in $val ; do
+      CONF_FILES="$CONF_FILES $i"
+    done
+  fi
+  AC_SUBST(CONF_FILES)
+])dnl
+
+AC_DEFUN(KDE_SET_PREFIX,
+[
+  unset CDPATH
+  dnl make $KDEDIR the default for the installation
+  AC_PREFIX_DEFAULT(${KDEDIR:-/usr/local/kde})
+
+  if test "x$prefix" = "xNONE"; then
+    prefix=$ac_default_prefix
+    ac_configure_args="$ac_configure_args --prefix $prefix"
+  fi
+  KDE_FAST_CONFIGURE
+  KDE_CONF_FILES
+])
+
+pushdef([AC_PROG_INSTALL],
+[
+  dnl our own version, testing for a -p flag
+  popdef([AC_PROG_INSTALL])
+  dnl as AC_PROG_INSTALL works as it works we first have
+  dnl to save if the user didn't specify INSTALL, as the
+  dnl autoconf one overwrites INSTALL and we have no chance to find
+  dnl out afterwards
+  test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
+  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
+  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
+  AC_PROG_INSTALL
+
+  if test -z "$kde_save_INSTALL_given" ; then
+    # OK, user hasn't given any INSTALL, autoconf found one for us
+    # now we test, if it supports the -p flag
+    AC_MSG_CHECKING(for -p flag to install)
+    rm -f confinst.$$.* > /dev/null 2>&1
+    echo "Testtest" > confinst.$$.orig
+    ac_res=no
+    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
+      if test -f confinst.$$.new ; then
+        # OK, -p seems to do no harm to install
+	INSTALL="${INSTALL} -p"
+	ac_res=yes
+      fi
+    fi
+    rm -f confinst.$$.*
+    AC_MSG_RESULT($ac_res)
+  fi
+  dnl the following tries to resolve some signs and wonders coming up
+  dnl with different autoconf/automake versions
+  dnl e.g.:
+  dnl  *automake 1.4 install-strip sets A_M_INSTALL_PROGRAM_FLAGS to -s
+  dnl   and has INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(A_M_INSTALL_PROGRAM_FLAGS)
+  dnl   it header-vars.am, so there the actual INSTALL_PROGRAM gets the -s
+  dnl  *automake 1.4a (and above) use INSTALL_STRIP_FLAG and only has
+  dnl   INSTALL_PROGRAM = @INSTALL_PROGRAM@ there, but changes the
+  dnl   install-@DIR@PROGRAMS targets to explicitly use that flag
+  dnl  *autoconf 2.13 is dumb, and thinks it can use INSTALL_PROGRAM as
+  dnl   INSTALL_SCRIPT, which breaks with automake <= 1.4
+  dnl  *autoconf >2.13 (since 10.Apr 1999) has not that failure
+  dnl  *sometimes KDE does not use the install-@DIR@PROGRAM targets from
+  dnl   automake (due to broken Makefile.am or whatever) to install programs,
+  dnl   and so does not see the -s flag in automake > 1.4
+  dnl to clean up that mess we:
+  dnl  +set INSTALL_PROGRAM to use INSTALL_STRIP_FLAG
+  dnl   which cleans KDE's program with automake > 1.4;
+  dnl  +set INSTALL_SCRIPT to only use INSTALL, to clean up autoconf's problems
+  dnl   with automake<=1.4
+  dnl  note that dues to this sometimes two '-s' flags are used (if KDE
+  dnl   properly uses install-@DIR@PROGRAMS, but I don't care
+  dnl
+  dnl And to all this comes, that I even can't write in comments variable
+  dnl  names used by automake, because it is so stupid to think I wanted to
+  dnl  _use_ them, therefor I have written A_M_... instead of AM_
+  dnl hmm, I wanted to say something ... ahh yes: Arghhh.
+
+  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
+    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
+  fi
+  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
+    INSTALL_SCRIPT='${INSTALL}'
+  fi
+])dnl
+
+AC_DEFUN(KDE_LANG_CPLUSPLUS,
+[AC_LANG_CPLUSPLUS
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AC_FD_CC'
+pushdef([AC_LANG_CPLUSPLUS], [popdef([AC_LANG_CPLUSPLUS]) KDE_LANG_CPLUSPLUS])
+])
+
+pushdef([AC_LANG_CPLUSPLUS],
+[popdef([AC_LANG_CPLUSPLUS])
+KDE_LANG_CPLUSPLUS
+])
+
+AC_DEFUN(KDE_CHECK_LONG_LONG,
+[
+AC_MSG_CHECKING(for long long)
+AC_CACHE_VAL(kde_cv_c_long_long,
+[
+  AC_LANG_SAVE
+  AC_LANG_CPLUSPLUS
+  AC_TRY_LINK([], [
+  long long foo = 0;
+  foo = foo+1;
+  ],
+  kde_cv_c_long_long=yes, kde_cv_c_long_long=no)
+])
+AC_MSG_RESULT($kde_cv_c_long_long)
+if test "$kde_cv_c_long_long" = yes; then
+   AC_DEFINE(HAVE_LONG_LONG, 1, [Define if you have long long as datatype])
+fi
+])
+
+
+# serial 46 AC_PROG_LIBTOOL
+AC_DEFUN([AC_PROG_LIBTOOL],
+[AC_REQUIRE([_AC_PROG_LIBTOOL])dnl
+dnl If AC_PROG_CXX has already been expanded, run AC_LIBTOOL_CXX
+dnl immediately, otherwise, hook it in at the end of AC_PROG_CXX.
+  AC_PROVIDE_IFELSE([AC_PROG_CXX],
+    [AC_LIBTOOL_CXX],
+    [define([AC_PROG_CXX], defn([AC_PROG_CXX])[AC_LIBTOOL_CXX
+])])
+
+dnl Quote A][M_PROG_GCJ so that aclocal doesn't bring it in needlessly.
+dnl If either AC_PROG_GCJ or A][M_PROG_GCJ have already been expanded, run
+dnl AC_LIBTOOL_GCJ immediately, otherwise, hook it in at the end of both.
+  AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+    [AC_LIBTOOL_GCJ],
+    [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+        [AC_LIBTOOL_GCJ],
+	[AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],
+	  [AC_LIBTOOL_GCJ],
+	[ifdef([AC_PROG_GCJ],
+	       [define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])
+	 ifdef([A][M_PROG_GCJ],
+	       [define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])
+	 ifdef([LT_AC_PROG_GCJ],
+	       [define([LT_AC_PROG_GCJ], defn([LT_AC_PROG_GCJ])[AC_LIBTOOL_GCJ
+])])])])])])
+
+AC_DEFUN([_AC_PROG_LIBTOOL],
+[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_CXX])dnl
+AC_BEFORE([$0],[AC_LIBTOOL_GCJ])dnl
+
+# Save cache, so that ltconfig can load it
+AC_CACHE_SAVE
+
+# Actually configure libtool.  ac_aux_dir is where install-sh is found.
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
+|| AC_MSG_ERROR([libtool configure failed])
+
+# Reload cache, that may have been modified by ltconfig
+AC_CACHE_LOAD
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+AC_DEFUN([AC_LIBTOOL_SETUP],
+[AC_PREREQ(2.13)dnl
+AC_REQUIRE([AC_ENABLE_SHARED])dnl
+AC_REQUIRE([AC_ENABLE_STATIC])dnl
+AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_LD])dnl
+AC_REQUIRE([AC_PROG_LD_RELOAD_FLAG])dnl
+AC_REQUIRE([AC_PROG_NM])dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+AC_REQUIRE([AC_DEPLIBS_CHECK_METHOD])dnl
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+AC_REQUIRE([AC_OBJEXT])dnl
+AC_REQUIRE([AC_EXEEXT])dnl
+dnl
+
+# Only perform the check for file, if the check method requires it
+case "$deplibs_check_method" in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    AC_PATH_MAGIC
+  fi
+  ;;
+esac
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+AC_CHECK_TOOL(STRIP, strip, :)
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
+[libtool_flags="$libtool_flags --enable-dlopen"])
+ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+[libtool_flags="$libtool_flags --enable-win32-dll"])
+AC_ARG_ENABLE(libtool-lock,
+  [  --disable-libtool-lock  avoid locking (might break parallel builds)])
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+AC_ARG_WITH(pic,
+  [  --with-pic              try to use only PIC/non-PIC objects [default=use both]],
+     pic_mode="$withval", pic_mode=default)
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line __oline__ "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    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
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_SAVE
+     AC_LANG_C
+     AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_RESTORE])
+  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
+  ;;
+
+ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
+[*-*-cygwin* | *-*-mingw* | *-*-pw32*)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+
+  # recent cygwin and mingw systems supply a stub DllMain which the user
+  # can override, but on older systems we have to supply one
+  AC_CACHE_CHECK([if libtool should supply DllMain function], lt_cv_need_dllmain,
+    [AC_TRY_LINK([],
+      [extern int __attribute__((__stdcall__)) DllMain(void*, int, void*);
+      DllMain (0, 0, 0);],
+      [lt_cv_need_dllmain=no],[lt_cv_need_dllmain=yes])])
+
+  case "$host/$CC" in
+  *-*-cygwin*/gcc*-mno-cygwin*|*-*-mingw*)
+    # old mingw systems require "-dll" to link a DLL, while more recent ones
+    # require "-mdll"
+    SAVE_CFLAGS="$CFLAGS"
+    CFLAGS="$CFLAGS -mdll"
+    AC_CACHE_CHECK([how to link DLLs], lt_cv_cc_dll_switch,
+      [AC_TRY_LINK([], [], [lt_cv_cc_dll_switch=-mdll],[lt_cv_cc_dll_switch=-dll])])
+    CFLAGS="$SAVE_CFLAGS" ;;
+  *-*-cygwin* | *-*-pw32*)
+    # cygwin systems need to pass --dll to the linker, and not link
+    # crt.o which will require a WinMain@16 definition.
+    lt_cv_cc_dll_switch="-Wl,--dll -nostartfiles" ;;
+  esac
+  ;;
+  ])
+esac
+])
+
+# AC_LIBTOOL_DLOPEN - enable checks for dlopen support
+AC_DEFUN([AC_LIBTOOL_DLOPEN], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
+
+# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
+AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
+
+# AC_ENABLE_SHARED - implement the --enable-shared flag
+# Usage: AC_ENABLE_SHARED[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN([AC_ENABLE_SHARED],
+[define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(shared,
+changequote(<<, >>)dnl
+<<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
+changequote([, ])dnl
+[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.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_shared=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
+])
+
+# AC_DISABLE_SHARED - set the default shared flag to --disable-shared
+AC_DEFUN([AC_DISABLE_SHARED], [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_SHARED(no)])
+
+# AC_ENABLE_STATIC - implement the --enable-static flag
+# Usage: AC_ENABLE_STATIC[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN([AC_ENABLE_STATIC],
+[define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(static,
+changequote(<<, >>)dnl
+<<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
+changequote([, ])dnl
+[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.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_static=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
+])
+
+# AC_DISABLE_STATIC - set the default static flag to --disable-static
+AC_DEFUN([AC_DISABLE_STATIC],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_STATIC(no)])
+
+
+# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
+# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
+#   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
+#   `yes'.
+AC_DEFUN([AC_ENABLE_FAST_INSTALL],
+[define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
+AC_ARG_ENABLE(fast-install,
+changequote(<<, >>)dnl
+<<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
+changequote([, ])dnl
+[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.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac],
+enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
+])
+
+# AC_DISABLE_FAST_INSTALL - set the default to --disable-fast-install
+AC_DEFUN([AC_DISABLE_FAST_INSTALL],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+AC_ENABLE_FAST_INSTALL(no)])
+
+# AC_LIBTOOL_PICMODE - implement the --with-pic flag
+# Usage: AC_LIBTOOL_PICMODE[(MODE)]
+#   Where MODE is either `yes' or `no'.  If omitted, it defaults to
+#   `both'.
+AC_DEFUN([AC_LIBTOOL_PICMODE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+pic_mode=ifelse($#,1,$1,default)])
+
+
+# AC_PATH_TOOL_PREFIX - find a file program which can recognise shared library
+AC_DEFUN([AC_PATH_TOOL_PREFIX],
+[AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case "$MAGIC_CMD" in
+  /*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC_CMD="$MAGIC_CMD"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="ifelse([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case "$deplibs_check_method" in
+	"file_magic "*)
+	  file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`"
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    egrep "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC_CMD="$ac_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+])
+
+
+# AC_PATH_MAGIC - find a file program which can recognise a shared library
+AC_DEFUN([AC_PATH_MAGIC],
+[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
+AC_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin:$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    AC_PATH_TOOL_PREFIX(file, /usr/bin:$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])
+
+
+# AC_PROG_LD - find the path to the GNU or non-GNU linker
+AC_DEFUN([AC_PROG_LD],
+[AC_ARG_WITH(gnu-ld,
+[  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
+test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by GCC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case "$ac_prog" in
+    # Accept absolute paths.
+changequote(,)dnl
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+changequote([,])dnl
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+	test "$with_gnu_ld" != no && break
+      else
+	test "$with_gnu_ld" != yes && break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+AC_PROG_LD_GNU
+])
+
+AC_DEFUN([AC_PROG_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  lt_cv_prog_gnu_ld=yes
+else
+  lt_cv_prog_gnu_ld=no
+fi])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])
+
+# AC_PROG_LD_RELOAD_FLAG - find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+AC_DEFUN([AC_PROG_LD_RELOAD_FLAG],
+[AC_CACHE_CHECK([for $LD option to reload object files], lt_cv_ld_reload_flag,
+[lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+])
+
+# AC_DEPLIBS_CHECK_METHOD - how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+AC_DEFUN([AC_DEPLIBS_CHECK_METHOD],
+[AC_CACHE_CHECK([how to recognise dependant libraries],
+lt_cv_deplibs_check_method,
+[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 egrep 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
+aix4*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+  changequote(,)dnl
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  changequote([, ])dnl
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin* | mingw* |pw32*)
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+  ;;
+
+freebsd* )
+  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.
+      changequote(,)dnl
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD)/i[3-9]86 (compact )?demand paged shared library'
+      changequote([, ])dnl
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20*|hpux11*)
+  # TODO:  Does this work for hpux-11 too?
+  changequote(,)dnl
+  lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library'
+  changequote([, ])dnl
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libc.sl
+  ;;
+
+irix5* | irix6*)
+  case "$host_os" in
+  irix5*)
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+    ;;
+  *)
+    case "$LD" in
+    *-32|*"-32 ") libmagic=32-bit;;
+    *-n32|*"-n32 ") libmagic=N32;;
+    *-64|*"-64 ") libmagic=64-bit;;
+    *) libmagic=never-match;;
+    esac
+    # this will be overridden with pass_all, but let us keep it just in case
+    changequote(,)dnl
+    lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+    changequote([, ])dnl
+    ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+  case "$host_cpu" in
+  alpha* | i*86 | powerpc* | sparc* | ia64* | s390* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  *)
+    # glibc up to 2.1.1 does not perform some relocations on ARM
+    changequote(,)dnl
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+    changequote([, ])dnl
+  esac
+  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    [lt_cv_deplibs_check_method='file_magic NetBSD/[a-z0-9]* demand paged shared library']
+  else
+    [lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object']
+  fi
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+  ;;
+
+openbsd* )
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case "$host_cpu" in
+    i*86 )
+      changequote(,)dnl
+      lt_cv_deplibs_check_method='file_magic OpenBSD/i[3-9]86 demand paged shared library'
+      changequote([, ])dnl
+      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
+  ;;
+
+newsos6)
+  [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
+  ;;
+
+osf3* | osf4* | osf5*)
+  # this will be overridden with pass_all, but let us keep it just in case
+  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=/lib/libc.so
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case "$host_vendor" in
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  motorola)
+    changequote(,)dnl
+    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]'
+    changequote([, ])dnl
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  esac
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+])
+
+
+# AC_PROG_NM - find the path to a BSD-compatible name lister
+AC_DEFUN([AC_PROG_NM],
+[AC_MSG_CHECKING([for BSD-compatible nm])
+AC_CACHE_VAL(lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm=$ac_dir/${ac_tool_prefix}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
+      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+	lt_cv_path_NM="$tmp_nm -B"
+	break
+      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+	lt_cv_path_NM="$tmp_nm -p"
+	break
+      else
+	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
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi])
+NM="$lt_cv_path_NM"
+AC_MSG_RESULT([$NM])
+])
+
+# AC_CHECK_LIBM - check for math library
+AC_DEFUN([AC_CHECK_LIBM],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case "$host" in
+*-*-beos* | *-*-cygwin* | *-*-pw32*)
+  # These system don't have libm
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, main, LIBM="-lm")
+  ;;
+esac
+])
+
+# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl convenience library and INCLTDL to the include flags for
+# the libltdl header and adds --enable-ltdl-convenience to the
+# configure arguments.  Note that LIBLTDL and INCLTDL are not
+# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
+# provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
+# with '${top_builddir}/' and INCLTDL will be prefixed with
+# '${top_srcdir}/' (note the single quotes!).  If your package is not
+# flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+AC_DEFUN([AC_LIBLTDL_CONVENIENCE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  case "$enable_ltdl_convenience" in
+  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
+  "") enable_ltdl_convenience=yes
+      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
+  esac
+  LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
+  INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+])
+
+# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
+# the libltdl installable library and INCLTDL to the include flags for
+# the libltdl header and adds --enable-ltdl-install to the configure
+# arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
+# AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
+# libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
+# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
+# with '${top_srcdir}/' (note the single quotes!).  If your package is
+# not flat and you're not using automake, define top_builddir and
+# top_srcdir appropriately in the Makefiles.
+# In the future, this macro may have to be called after AC_PROG_LIBTOOL.
+AC_DEFUN([AC_LIBLTDL_INSTALLABLE],
+[AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
+  AC_CHECK_LIB(ltdl, main,
+  [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
+  [if test x"$enable_ltdl_install" = xno; then
+     AC_MSG_WARN([libltdl not installed, but installation disabled])
+   else
+     enable_ltdl_install=yes
+   fi
+  ])
+  if test x"$enable_ltdl_install" = x"yes"; then
+    ac_configure_args="$ac_configure_args --enable-ltdl-install"
+    LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
+    INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
+  else
+    ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
+    LIBLTDL="-lltdl"
+    INCLTDL=
+  fi
+])
+
+# If this macro is not defined by Autoconf, define it here.
+ifdef([AC_PROVIDE_IFELSE],
+      [],
+      [define([AC_PROVIDE_IFELSE],
+              [ifdef([AC_PROVIDE_$1],
+                     [$2], [$3])])])
+
+# AC_LIBTOOL_CXX - enable support for C++ libraries
+AC_DEFUN([AC_LIBTOOL_CXX], [AC_REQUIRE([_AC_LIBTOOL_CXX])])
+
+AC_DEFUN([_AC_LIBTOOL_CXX],
+[AC_REQUIRE([AC_PROG_CXX])
+AC_REQUIRE([AC_PROG_CXXCPP])
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
+dnl is set to the C++ compiler.
+AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
+|| AC_MSG_ERROR([libtool tag configuration failed])
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+# AC_LIBTOOL_GCJ - enable support for GCJ libraries
+AC_DEFUN([AC_LIBTOOL_GCJ],[AC_REQUIRE([_AC_LIBTOOL_GCJ])])
+
+AC_DEFUN([_AC_LIBTOOL_GCJ],
+[AC_REQUIRE([AC_PROG_LIBTOOL])
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],[],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],[],
+    [AC_PROVIDE_IFELSE([LT_AC_PROG_GCJ],[],
+      [ifdef([AC_PROG_GCJ],[AC_REQUIRE([AC_PROG_GCJ])],
+         [ifdef([A][M_PROG_GCJ],[AC_REQUIRE([A][M_PROG_GCJ])],
+           [AC_REQUIRE([A][C_PROG_GCJ_OR_A][M_PROG_GCJ])])])])])])
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-gcj.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+dnl Make sure LTCC is set to the C compiler, i.e. set LTCC before CC
+dnl is set to the C++ compiler.
+AR="$AR" LTCC="$CC" CC="$GCJ" CFLAGS="$GCJFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=GCJ $ac_aux_dir/ltcf-gcj.sh $host \
+|| AC_MSG_ERROR([libtool tag configuration failed])
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+])
+
+dnl old names
+AC_DEFUN([AM_PROG_LIBTOOL],   [AC_PROG_LIBTOOL])
+AC_DEFUN([AM_ENABLE_SHARED],  [AC_ENABLE_SHARED($@)])
+AC_DEFUN([AM_ENABLE_STATIC],  [AC_ENABLE_STATIC($@)])
+AC_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+AC_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+AC_DEFUN([AM_PROG_LD],        [AC_PROG_LD])
+AC_DEFUN([AM_PROG_NM],        [AC_PROG_NM])
+
+dnl This is just to silence aclocal about the macro not being used
+ifelse([AC_DISABLE_FAST_INSTALL])dnl
+
+AC_DEFUN([LT_AC_PROG_GCJ],
+[AC_CHECK_TOOL(GCJ, gcj, no)
+  test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+  AC_SUBST(GCJFLAGS)
+])
+
+# Do all the work for Automake.  This macro actually does too much --
+# some checks are only needed if your package does certain things.
+# But this isn't really a big deal.
+
+# serial 5
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# We require 2.13 because we rely on SHELL being computed by configure.
+AC_PREREQ([2.13])
+
+# AC_PROVIDE_IFELSE(MACRO-NAME, IF-PROVIDED, IF-NOT-PROVIDED)
+# -----------------------------------------------------------
+# If MACRO-NAME is provided do IF-PROVIDED, else IF-NOT-PROVIDED.
+# The purpose of this macro is to provide the user with a means to
+# check macros which are provided without letting her know how the
+# information is coded.
+# If this macro is not defined by Autoconf, define it here.
+ifdef([AC_PROVIDE_IFELSE],
+      [],
+      [define([AC_PROVIDE_IFELSE],
+              [ifdef([AC_PROVIDE_$1],
+                     [$2], [$3])])])
+
+
+# AM_INIT_AUTOMAKE(PACKAGE,VERSION, [NO-DEFINE])
+# ----------------------------------------------
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_REQUIRE([AC_PROG_INSTALL])dnl
+# test to see if srcdir already configured
+if test "`CDPATH=:; cd $srcdir && pwd`" != "`pwd`" &&
+   test -f $srcdir/config.status; then
+  AC_MSG_ERROR([source directory already configured; run \"make distclean\" there first])
+fi
+
+# Define the identity of the package.
+PACKAGE=$1
+AC_SUBST(PACKAGE)dnl
+VERSION=$2
+AC_SUBST(VERSION)dnl
+ifelse([$3],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])
+
+# Autoconf 2.50 wants to disallow AM_ names.  We explicitly allow
+# the ones we care about.
+ifdef([m4_pattern_allow],
+      [m4_pattern_allow([^AM_[A-Z]+FLAGS])])dnl
+
+# Autoconf 2.50 always computes EXEEXT.  However we need to be
+# compatible with 2.13, for now.  So we always define EXEEXT, but we
+# don't compute it.
+AC_SUBST(EXEEXT)
+# Similar for OBJEXT -- only we only use OBJEXT if the user actually
+# requests that it be used.  This is a bit dumb.
+: ${OBJEXT=o}
+AC_SUBST(OBJEXT)
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal)
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake)
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG(AMTAR, tar)
+AM_PROG_INSTALL_SH
+AM_PROG_INSTALL_STRIP
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_PROVIDE_IFELSE([AC_PROG_][CC],
+                  [_AM_DEPENDENCIES(CC)],
+                  [define([AC_PROG_][CC],
+                          defn([AC_PROG_][CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_][CXX],
+                  [_AM_DEPENDENCIES(CXX)],
+                  [define([AC_PROG_][CXX],
+                          defn([AC_PROG_][CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+])
+
+#
+# Check to make sure that the build environment is sane.
+#
+
+# serial 3
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+
+# serial 2
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  am_backtick='`'
+  AC_MSG_WARN([${am_backtick}missing' script is too old or missing])
+fi
+])
+
+# AM_AUX_DIR_EXPAND
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND], [
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`CDPATH=:; cd $ac_aux_dir && pwd`
+])
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+install_sh=${install_sh-"$am_aux_dir/install-sh"}
+AC_SUBST(install_sh)])
+
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# serial 4						-*- Autoconf -*-
+
+
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+
+# _AM_DEPENDENCIES(NAME)
+# ---------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX" or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc']
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  for depmode in $am_compiler_list; do
+    # 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.
+    echo '#include "conftest.h"' > conftest.c
+    echo 'int i;' > conftest.h
+    echo "${am__include} ${am__quote}conftest.Po${am__quote}" > confmf
+
+    case $depmode in
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    none) break ;;
+    esac
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.
+    if depmode=$depmode \
+       source=conftest.c object=conftest.o \
+       depfile=conftest.Po tmpdepfile=conftest.TPo \
+       $SHELL ./depcomp $depcc -c conftest.c -o conftest.o >/dev/null 2>&1 &&
+       grep conftest.h conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      am_cv_$1_dependencies_compiler_type=$depmode
+      break
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+$1DEPMODE="depmode=$am_cv_$1_dependencies_compiler_type"
+AC_SUBST([$1DEPMODE])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[rm -f .deps 2>/dev/null
+mkdir .deps 2>/dev/null
+if test -d .deps; then
+  DEPDIR=.deps
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  DEPDIR=_deps
+fi
+rmdir .deps 2>/dev/null
+AC_SUBST(DEPDIR)
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking Speeds up one-time builds
+  --enable-dependency-tracking  Do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+pushdef([subst], defn([AC_SUBST]))
+subst(AMDEPBACKSLASH)
+popdef([subst])
+])
+
+# Generate code to set up dependency tracking.
+# This macro should only be invoked once -- use via AC_REQUIRE.
+# Usage:
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],[
+AC_OUTPUT_COMMANDS([
+test x"$AMDEP_TRUE" != x"" ||
+for mf in $CONFIG_FILES; do
+  case "$mf" in
+  Makefile) dirpart=.;;
+  */Makefile) dirpart=`echo "$mf" | sed -e 's|/[^/]*$||'`;;
+  *) continue;;
+  esac
+  grep '^DEP_FILES *= *[^ #]' < "$mf" > /dev/null || continue
+  # Extract the definition of DEP_FILES from the Makefile without
+  # running `make'.
+  DEPDIR=`sed -n -e '/^DEPDIR = / s///p' < "$mf"`
+  test -z "$DEPDIR" && continue
+  # When using ansi2knr, U may be empty or an underscore; expand it
+  U=`sed -n -e '/^U = / s///p' < "$mf"`
+  test -d "$dirpart/$DEPDIR" || mkdir "$dirpart/$DEPDIR"
+  # We invoke sed twice because it is the simplest approach to
+  # changing $(DEPDIR) to its actual value in the expansion.
+  for file in `sed -n -e '
+    /^DEP_FILES = .*\\\\$/ {
+      s/^DEP_FILES = //
+      :loop
+	s/\\\\$//
+	p
+	n
+	/\\\\$/ b loop
+      p
+    }
+    /^DEP_FILES = / s/^DEP_FILES = //p' < "$mf" | \
+       sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+    # Make sure the directory exists.
+    test -f "$dirpart/$file" && continue
+    fdir=`echo "$file" | sed -e 's|/[^/]*$||'`
+    $ac_aux_dir/mkinstalldirs "$dirpart/$fdir" > /dev/null 2>&1
+    # echo "creating $dirpart/$file"
+    echo '# dummy' > "$dirpart/$file"
+  done
+done
+], [AMDEP_TRUE="$AMDEP_TRUE"
+ac_aux_dir="$ac_aux_dir"])])
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+doit:
+	@echo done
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include='#'
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# We grep out `Entering directory' and `Leaving directory'
+# messages which can occur if `w' ends up in MAKEFLAGS.
+# In particular we don't look at `^make:' because GNU make might
+# be invoked under some other name (usually "gmake"), in which
+# case it prints its new name instead of `make'.
+if test "`$am_make -s -f confmf 2> /dev/null | fgrep -v 'ing directory'`" = "done"; then
+   am__include=include
+   am__quote=
+   _am_result=GNU
+fi
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
+      am__include=.include
+      am__quote='"'
+      _am_result=BSD
+   fi
+fi
+AC_SUBST(am__include)
+AC_SUBST(am__quote)
+AC_MSG_RESULT($_am_result)
+rm -f confinc confmf
+])
+
+# serial 3
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+#
+# FIXME: Once using 2.50, use this:
+# m4_match([$1], [^TRUE\|FALSE$], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_DEFUN([AM_CONDITIONAL],
+[ifelse([$1], [TRUE],
+        [errprint(__file__:__line__: [$0: invalid condition: $1
+])dnl
+m4exit(1)])dnl
+ifelse([$1], [FALSE],
+       [errprint(__file__:__line__: [$0: invalid condition: $1
+])dnl
+m4exit(1)])dnl
+AC_SUBST([$1_TRUE])
+AC_SUBST([$1_FALSE])
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi])
+
+# Like AC_CONFIG_HEADER, but automatically create stamp file.
+
+# serial 3
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  We must strip everything past the first ":",
+# and everything past the last "/".
+
+AC_PREREQ([2.12])
+
+AC_DEFUN([AM_CONFIG_HEADER],
+[ifdef([AC_FOREACH],dnl
+	 [dnl init our file count if it isn't already
+	 m4_ifndef([_AM_Config_Header_Index], m4_define([_AM_Config_Header_Index], [0]))
+	 dnl prepare to store our destination file list for use in config.status
+	 AC_FOREACH([_AM_File], [$1],
+		    [m4_pushdef([_AM_Dest], m4_patsubst(_AM_File, [:.*]))
+		    m4_define([_AM_Config_Header_Index], m4_incr(_AM_Config_Header_Index))
+		    dnl and add it to the list of files AC keeps track of, along
+		    dnl with our hook
+		    AC_CONFIG_HEADERS(_AM_File,
+dnl COMMANDS, [, INIT-CMDS]
+[# update the timestamp
+echo timestamp >"AS_ESCAPE(_AM_DIRNAME(]_AM_Dest[))/stamp-h]_AM_Config_Header_Index["
+][$2]m4_ifval([$3], [, [$3]]))dnl AC_CONFIG_HEADERS
+		    m4_popdef([_AM_Dest])])],dnl
+[AC_CONFIG_HEADER([$1])
+  AC_OUTPUT_COMMANDS(
+   ifelse(patsubst([$1], [[^ ]], []),
+	  [],
+	  [test -z "$CONFIG_HEADERS" || echo timestamp >dnl
+	   patsubst([$1], [^\([^:]*/\)?.*], [\1])stamp-h]),dnl
+[am_indx=1
+for am_file in $1; do
+  case " \$CONFIG_HEADERS " in
+  *" \$am_file "*)
+    am_dir=\`echo \$am_file |sed 's%:.*%%;s%[^/]*\$%%'\`
+    if test -n "\$am_dir"; then
+      am_tmpdir=\`echo \$am_dir |sed 's%^\(/*\).*\$%\1%'\`
+      for am_subdir in \`echo \$am_dir |sed 's%/% %'\`; do
+        am_tmpdir=\$am_tmpdir\$am_subdir/
+        if test ! -d \$am_tmpdir; then
+          mkdir \$am_tmpdir
+        fi
+      done
+    fi
+    echo timestamp > "\$am_dir"stamp-h\$am_indx
+    ;;
+  esac
+  am_indx=\`expr \$am_indx + 1\`
+done])
+])]) # AM_CONFIG_HEADER
+
+# _AM_DIRNAME(PATH)
+# -----------------
+# Like AS_DIRNAME, only do it during macro expansion
+AC_DEFUN([_AM_DIRNAME],
+       [m4_if(m4_regexp([$1], [^.*[^/]//*[^/][^/]*/*$]), -1,
+	      m4_if(m4_regexp([$1], [^//\([^/]\|$\)]), -1,
+		    m4_if(m4_regexp([$1], [^/.*]), -1,
+			  [.],
+			  m4_patsubst([$1], [^\(/\).*], [\1])),
+		    m4_patsubst([$1], [^\(//\)\([^/].*\|$\)], [\1])),
+	      m4_patsubst([$1], [^\(.*[^/]\)//*[^/][^/]*/*$], [\1]))[]dnl
+]) # _AM_DIRNAME
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol.doxygen
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol.doxygen	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol.doxygen	(revision 3401)
@@ -0,0 +1,155 @@
+# Doxygen configuration generated by Doxywizard version 0.1
+#---------------------------------------------------------------------------
+# General configuration options
+#---------------------------------------------------------------------------
+PROJECT_NAME           = "Active Mirror Control"
+PROJECT_NUMBER         = 1
+OUTPUT_DIRECTORY       = /home/amc/projects/activemirrorcontrol/activemirrorcontrol-api/
+OUTPUT_LANGUAGE        = English
+EXTRACT_ALL            = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+HIDE_UNDOC_MEMBERS     = NO
+HIDE_UNDOC_CLASSES     = NO
+BRIEF_MEMBER_DESC      = YES
+REPEAT_BRIEF           = YES
+ALWAYS_DETAILED_SEC    = YES
+FULL_PATH_NAMES        = NO
+STRIP_FROM_PATH        = 
+INTERNAL_DOCS          = NO
+CLASS_DIAGRAMS         = YES
+SOURCE_BROWSER         = NO
+INLINE_SOURCES         = NO
+STRIP_CODE_COMMENTS    = YES
+CASE_SENSE_NAMES       = YES
+HIDE_SCOPE_NAMES       = NO
+VERBATIM_HEADERS       = YES
+SHOW_INCLUDE_FILES     = YES
+JAVADOC_AUTOBRIEF      = NO
+INHERIT_DOCS           = YES
+INLINE_INFO            = YES
+SORT_MEMBER_DOCS       = YES
+DISTRIBUTE_GROUP_DOC   = NO
+TAB_SIZE               = 4
+ENABLED_SECTIONS       = 
+GENERATE_TODOLIST      = YES
+GENERATE_TESTLIST      = YES
+GENERATE_BUGLIST       = YES
+ALIASES                = 
+MAX_INITIALIZER_LINES  = 30
+OPTIMIZE_OUTPUT_FOR_C  = NO
+SHOW_USED_FILES        = YES
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET                  = NO
+WARNINGS               = YES
+WARN_IF_UNDOCUMENTED   = NO
+WARN_FORMAT            = "$file:$line: $text"
+WARN_LOGFILE           = 
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT                  = /home/amc/projects/activemirrorcontrol/
+FILE_PATTERNS          = *.h \
+                         *.hh \
+                         *.H
+RECURSIVE              = YES
+EXCLUDE                = 
+EXCLUDE_PATTERNS       = 
+EXAMPLE_PATH           = 
+EXAMPLE_PATTERNS       = 
+IMAGE_PATH             = 
+INPUT_FILTER           = 
+FILTER_SOURCE_FILES    = NO
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX     = YES
+COLS_IN_ALPHA_INDEX    = 5
+IGNORE_PREFIX          = 
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML          = YES
+HTML_OUTPUT            = html
+HTML_HEADER            = 
+HTML_FOOTER            = 
+HTML_STYLESHEET        = 
+HTML_ALIGN_MEMBERS     = YES
+GENERATE_HTMLHELP      = NO
+GENERATE_CHI           = NO
+BINARY_TOC             = NO
+TOC_EXPAND             = NO
+DISABLE_INDEX          = NO
+ENUM_VALUES_PER_LINE   = 4
+GENERATE_TREEVIEW      = NO
+TREEVIEW_WIDTH         = 250
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX         = YES
+LATEX_OUTPUT           = latex
+COMPACT_LATEX          = NO
+PAPER_TYPE             = a4wide
+EXTRA_PACKAGES         = 
+LATEX_HEADER           = 
+PDF_HYPERLINKS         = NO
+USE_PDFLATEX           = NO
+LATEX_BATCHMODE        = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF           = NO
+RTF_OUTPUT             = rtf
+COMPACT_RTF            = NO
+RTF_HYPERLINKS         = NO
+RTF_STYLESHEET_FILE    = 
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN           = NO
+MAN_OUTPUT             = man
+MAN_EXTENSION          = .3
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor   
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING   = YES
+MACRO_EXPANSION        = NO
+EXPAND_ONLY_PREDEF     = NO
+SEARCH_INCLUDES        = YES
+INCLUDE_PATH           = 
+INCLUDE_FILE_PATTERNS  = 
+PREDEFINED             = 
+EXPAND_AS_DEFINED      = 
+#---------------------------------------------------------------------------
+# Configuration::addtions related to external references   
+#---------------------------------------------------------------------------
+TAGFILES               = 
+GENERATE_TAGFILE       = 
+ALLEXTERNALS           = NO
+PERL_PATH              = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool   
+#---------------------------------------------------------------------------
+HAVE_DOT               = NO
+CLASS_GRAPH            = YES
+COLLABORATION_GRAPH    = YES
+INCLUDE_GRAPH          = YES
+INCLUDED_BY_GRAPH      = YES
+GRAPHICAL_HIERARCHY    = YES
+DOT_PATH               = 
+MAX_DOT_GRAPH_WIDTH    = 1024
+MAX_DOT_GRAPH_HEIGHT   = 1024
+GENERATE_LEGEND        = YES
+DOT_CLEANUP            = YES
+#---------------------------------------------------------------------------
+# Configuration::addtions related to the search engine   
+#---------------------------------------------------------------------------
+SEARCHENGINE           = NO
+CGI_NAME               = search.cgi
+CGI_URL                = 
+DOC_URL                = 
+DOC_ABSPATH            = 
+BIN_ABSPATH            = /usr/local/bin/
+EXT_DOC_PATHS          = 
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol.kdevprj
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol.kdevprj	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol.kdevprj	(revision 3401)
@@ -0,0 +1,730 @@
+[Config for BinMakefileAm]
+addcxxflags=-fexceptions -DQT_THREAD_SUPPORT
+bin_program=activemirrorcontrol
+cxxflags=\s-O0 -g2 -Wall
+ldadd=-lqt-mt -lkdeui -lkdecore
+ldflags=
+
+[General]
+AMChanged=false
+author=Martin Merck
+configure_args=--with-qt-dir=/usr/lib/qt2 --prefix=/opt/kde2
+email=merck@astro.uni-wuerzburg.de
+kdevprj_version=1.3
+lfv_open_groups=User Interface
+make_options=\s-j1
+makefiles=Makefile.am,activemirrorcontrol/Makefile.am,doc/Makefile.am,doc/en/Makefile.am,po/Makefile.am
+modifyMakefiles=true
+project_name=ActiveMirrorControl
+project_type=mini_kde2
+sgml_file=/home/amc/projects/KDE-Develop/activemirrorcontrol/doc/en/index.docbook
+short_info=
+sub_dir=activemirrorcontrol/
+version=0.1
+version_control=None
+workspace=1
+
+[LFV Groups]
+Headers=*.h,*.hh,*.hxx,*.hpp,*.H
+Others=*
+Sources=*.cpp,*.c,*.cc,*.C,*.cxx,*.ec,*.ecpp,*.lxx,*.l++,*.ll,*.l
+Translations=*.po
+User Interface=*.kdevdlg,*.ui,*.rc
+groups=Headers,Sources,User Interface,Translations,Others
+
+[Makefile.am]
+files=activemirrorcontrol.kdevprj
+sub_dirs=activemirrorcontrol,po,doc
+type=normal
+
+[Workspace_1]
+browser_file=file:/usr/lib/qt2/doc/html/qregexp.html
+cpp_file=/home/amc/projects/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.cpp
+header_file=/home/amc/projects/activemirrorcontrol/activemirrorcontrol/amcstate.h
+openfiles=Untitled.h,Untitled.cpp,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.h,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/main.cpp,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.cpp,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/adjustthreadcontroller.cpp,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/adjustthread.cpp,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/amcprogdlg.cpp,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/amclog.cpp,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/amcerror.cpp,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/amcerror.h,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/amcprogdlg.h,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/amcmotor.h,/usr/lib/qt-2.3.0/include/qstring.h,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/amcstate.h,/home/amc/projects/activemirrorcontrol/activemirrorcontrol/Makefile
+show_outputview=true
+show_treeview=true
+
+[activemirrorcontrol.kdevprj]
+dist=true
+install=false
+install_location=
+type=DATA
+
+[activemirrorcontrol/Makefile.am]
+files=activemirrorcontrol/main.cpp,activemirrorcontrol/activemirrorcontrol.cpp,activemirrorcontrol/activemirrorcontrol.h,activemirrorcontrol/lo32-app-activemirrorcontrol.png,activemirrorcontrol/lo16-app-activemirrorcontrol.png,activemirrorcontrol/activemirrorcontrolbase.ui,activemirrorcontrol/amccmdserversocket.cpp,activemirrorcontrol/amccmdserversocket.h,activemirrorcontrol/amcreportsocket.h,activemirrorcontrol/amcreportsocket.cpp,activemirrorcontrol/cc_defs.h,activemirrorcontrol/amcstate.cpp,activemirrorcontrol/amcstate.h,activemirrorcontrol/amcerror.cpp,activemirrorcontrol/amcerror.h,activemirrorcontrol/amcerrors.h,activemirrorcontrol/amcmirrorpanel.cpp,activemirrorcontrol/amcmirrorpanel.h,activemirrorcontrol/amcmotor.cpp,activemirrorcontrol/amcmotor.h,activemirrorcontrol/amcpushbutton.cpp,activemirrorcontrol/amcpushbutton.h,activemirrorcontrol/amccommands.h,activemirrorcontrol/amcserialport.cpp,activemirrorcontrol/amcserialport.h,activemirrorcontrol/adjustmirrordlg.cpp,activemirrorcontrol/adjustmirrordlg.h,activemirrorcontrol/adjustmirrordlgbase.ui,activemirrorcontrol/mirrorselector.cpp,activemirrorcontrol/mirrorselector.h,activemirrorcontrol/videoframe.cpp,activemirrorcontrol/videoframe.h,activemirrorcontrol/videodisplaybase.ui,activemirrorcontrol/videodisplay.cpp,activemirrorcontrol/videodisplay.h,activemirrorcontrol/motorthread.cpp,activemirrorcontrol/motorthread.h,activemirrorcontrol/motorthreadcontroller.cpp,activemirrorcontrol/motorthreadcontroller.h,activemirrorcontrol/motorthreaddialog.cpp,activemirrorcontrol/motorthreaddialog.h,activemirrorcontrol/motorthreaddialogbase.ui,activemirrorcontrol/threadevent.cpp,activemirrorcontrol/threadevent.h,activemirrorcontrol/threadinfo.cpp,activemirrorcontrol/threadinfo.h,activemirrorcontrol/magicmirror.cpp,activemirrorcontrol/magicmirror.h,activemirrorcontrol/laserthread.cpp,activemirrorcontrol/laserthread.h,activemirrorcontrol/laserthreadcontroller.cpp,activemirrorcontrol/laserthreadcontroller.h,activemirrorcontrol/amcprogdlg.cpp,activemirrorcontrol/amcprogdlg.h,activemirrorcontrol/amcprogdlgbase.ui,activemirrorcontrol/threadcontroller.cpp,activemirrorcontrol/threadcontroller.h,activemirrorcontrol/amcframegrabber.cpp,activemirrorcontrol/amcframegrabber.h,activemirrorcontrol/centerthread.h,activemirrorcontrol/centertread.cpp,activemirrorcontrol/movethread.cpp,activemirrorcontrol/movethread.h,activemirrorcontrol/errorinfoevent.cpp,activemirrorcontrol/errorinfoevent.h,activemirrorcontrol/calibratelasermovementdialog.cpp,activemirrorcontrol/calibratelasermovementdialog.h,activemirrorcontrol/calibratelasermovementdialogbase.ui,activemirrorcontrol/progressinfoevent.cpp,activemirrorcontrol/progressinfoevent.h,activemirrorcontrol/eventdefs.h,activemirrorcontrol/frameevent.cpp,activemirrorcontrol/frameevent.h,activemirrorcontrol/linearregression.cpp,activemirrorcontrol/linearregression.h,activemirrorcontrol/heatstate.cpp,activemirrorcontrol/heatstate.h,activemirrorcontrol/amclog.cpp,activemirrorcontrol/amclog.h,activemirrorcontrol/defocusthread.cpp,activemirrorcontrol/defocusthread.h,activemirrorcontrol/defocusthreadcontroller.cpp,activemirrorcontrol/defocusthreadcontroller.h,activemirrorcontrol/videopixel.cpp,activemirrorcontrol/videopixel.h,activemirrorcontrol/videospot.cpp,activemirrorcontrol/videospot.h,activemirrorcontrol/videothread.cpp,activemirrorcontrol/videothread.h,activemirrorcontrol/videospotthread.cpp,activemirrorcontrol/videospotthread.h,activemirrorcontrol/calibratepaneldialog.cpp,activemirrorcontrol/calibratepaneldialog.h,activemirrorcontrol/calibratepaneldialogbase.ui,activemirrorcontrol/adjustthread.cpp,activemirrorcontrol/adjustthread.h,activemirrorcontrol/adjustthreadcontroller.cpp,activemirrorcontrol/adjustthreadcontroller.h,activemirrorcontrol/laseradjustthread.cpp,activemirrorcontrol/laseradjustthread.h,activemirrorcontrol/laseradjustthreadcontroller.cpp,activemirrorcontrol/laseradjustthreadcontroller.h,activemirrorcontrol/amclookuptable.cpp,activemirrorcontrol/amclookuptable.h,activemirrorcontrol/amcdefs.h,activemirrorcontrol/errortestthread.cpp,activemirrorcontrol/errortestthread.h,activemirrorcontrol/errortestthreadcontroller.cpp,activemirrorcontrol/errortestthreadcontroller.h
+sub_dirs=
+type=prog_main
+
+[activemirrorcontrol/activemirrorcontrol.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/activemirrorcontrol.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/activemirrorcontrolbase.ui]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/adjustmirrordlg.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/adjustmirrordlg.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/adjustmirrordlgbase.ui]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/adjustthread.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/adjustthread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/adjustthreadcontroller.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/adjustthreadcontroller.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amccmdserversocket.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amccmdserversocket.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amccommands.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcdefs.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcerror.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amcerror.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcerrors.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcframegrabber.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amcframegrabber.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amclog.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amclog.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amclookuptable.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amclookuptable.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcmirrorpanel.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amcmirrorpanel.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcmotor.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amcmotor.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcprogdlg.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amcprogdlg.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcprogdlgbase.ui]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amcpushbutton.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amcpushbutton.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcreportsocket.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amcreportsocket.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcserialport.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amcserialport.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/amcstate.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/amcstate.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/calibratelasermovementdialog.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/calibratelasermovementdialog.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/calibratelasermovementdialogbase.ui]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/calibratepaneldialog.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/calibratepaneldialog.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/calibratepaneldialogbase.ui]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/cc_defs.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/centerthread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/centertread.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/defocusthread.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/defocusthread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/defocusthreadcontroller.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/defocusthreadcontroller.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/errorinfoevent.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/errorinfoevent.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/errortestthread.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/errortestthread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/errortestthreadcontroller.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/errortestthreadcontroller.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/eventdefs.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/frameevent.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/frameevent.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/heatstate.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/heatstate.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/laseradjustthread.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/laseradjustthread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/laseradjustthreadcontroller.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/laseradjustthreadcontroller.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/laserthread.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/laserthread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/laserthreadcontroller.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/laserthreadcontroller.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/linearregression.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/linearregression.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/lo16-app-activemirrorcontrol.png]
+dist=true
+install=true
+install_location=$$(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+type=DATA
+
+[activemirrorcontrol/lo32-app-activemirrorcontrol.png]
+dist=true
+install=true
+install_location=$$(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+type=DATA
+
+[activemirrorcontrol/magicmirror.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/magicmirror.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/main.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/mirrorselector.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/mirrorselector.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/motorthread.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/motorthread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/motorthreadcontroller.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/motorthreadcontroller.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/motorthreaddialog.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/motorthreaddialog.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/motorthreaddialogbase.ui]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/movethread.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/movethread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/progressinfoevent.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/progressinfoevent.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/threadcontroller.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/threadcontroller.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/threadevent.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/threadevent.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/threadinfo.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/threadinfo.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/videodisplay.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/videodisplay.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/videodisplaybase.ui]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/videoframe.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/videoframe.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/videopixel.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/videopixel.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/videospot.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/videospot.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/videospotthread.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/videospotthread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[activemirrorcontrol/videothread.cpp]
+dist=true
+install=false
+install_location=
+type=SOURCE
+
+[activemirrorcontrol/videothread.h]
+dist=true
+install=false
+install_location=
+type=HEADER
+
+[doc/Makefile.am]
+sub_dirs=en
+type=normal
+
+[doc/en/Makefile.am]
+files=doc/en/index.docbook
+sub_dirs=
+type=normal
+
+[doc/en/index.docbook]
+dist=true
+install=false
+install_location=$$(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+type=DATA
+
+[po/Makefile.am]
+sub_dirs=
+type=po
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol.kdevses
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol.kdevses	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol.kdevses	(revision 3401)
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE KDevPrjSession ><KDevPrjSession>
+ <Mainframe MaximizeMode="0" />
+ <DocsAndViews NumberOfDocuments="1" >
+  <Doc0 CursorPosLine="9" Type="KWriteDoc" NumberOfViews="1" CursorPosCol="0" FileName="/home/merck/CVS/AMC/activemirrorcontrol/activemirrorcontrol/errorinfoevent.h" >
+   <View0 Top="0" Width="881" Attach="0" Height="561" Left="0" Focus="1" Type="KWriteView" MinMaxMode="0" />
+  </Doc0>
+ </DocsAndViews>
+</KDevPrjSession>
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/Makefile
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/Makefile	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/Makefile	(revision 3401)
@@ -0,0 +1,988 @@
+# Generated automatically from Makefile.in by config.pl.
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 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.
+
+####### kdevelop will overwrite this part!!! (begin)##########
+
+
+SHELL = /bin/sh
+
+srcdir = .
+top_srcdir = ..
+VPATH = .
+prefix = /opt/kde2
+exec_prefix = ${prefix}
+#>- 
+bindir = ${exec_prefix}/bin
+#>+ 3
+DEPDIR = .deps
+
+bindir = ${exec_prefix}/bin
+sbindir = ${exec_prefix}/sbin
+libexecdir = ${exec_prefix}/libexec
+datadir = ${prefix}/share
+sysconfdir = ${prefix}/etc
+sharedstatedir = ${prefix}/com
+localstatedir = ${prefix}/var
+libdir = ${exec_prefix}/lib
+infodir = ${prefix}/info
+mandir = ${prefix}/man
+includedir = ${prefix}/include
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/activemirrorcontrol
+pkglibdir = $(libdir)/activemirrorcontrol
+pkgincludedir = $(includedir)/activemirrorcontrol
+
+top_builddir = ..
+
+ACLOCAL = aclocal
+AUTOCONF = autoconf
+AUTOMAKE = automake
+AUTOHEADER = autoheader
+
+INSTALL = /usr/bin/ginstall -c -p
+INSTALL_PROGRAM = ${INSTALL} $(INSTALL_STRIP_FLAG) $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = ${INSTALL} -m 644
+INSTALL_SCRIPT = ${INSTALL}
+transform = s,x,x,
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = i686-pc-linux-gnu
+build_triplet = i686-pc-linux-gnu
+host_alias = i686-pc-linux-gnu
+host_triplet = i686-pc-linux-gnu
+target_alias = i686-pc-linux-gnu
+target_triplet = i686-pc-linux-gnu
+ARTSCCONFIG = /opt/kde2/bin/artsc-config
+AS = @AS@
+AUTODIRS = 
+CC = gcc
+CONF_FILES =  $(top_srcdir)/./admin/configure.in.min $(top_srcdir)/configure.in.in
+CPP = gcc -E
+CXX = g++
+CXXCPP = g++ -E
+DCOPIDL = /opt/kde2/bin/dcopidl
+DCOPIDL2CPP = /opt/kde2/bin/dcopidl2cpp
+DCOP_DEPENDENCIES = $(DCOPIDL)
+DLLTOOL = @DLLTOOL@
+DPMSINC = @DPMSINC@
+DPMSLIB = @DPMSLIB@
+EXEEXT = 
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
+GLINC = @GLINC@
+GLLIB = @GLLIB@
+GMSGFMT = /usr/bin/msgfmt
+IDL = @IDL@
+IDL_DEPENDENCIES = @IDL_DEPENDENCIES@
+KDB2HTML = /opt/kde2/bin/kdb2html
+KDECONFIG = /opt/kde2/bin/kde-config
+KDE_CXXFLAGS = 
+KDE_EXTRA_RPATH = 
+KDE_INCLUDES = -I/opt/kde2/include
+KDE_LDFLAGS = -L/opt/kde2/lib
+KDE_PLUGIN = -avoid-version -module -no-undefined
+KDE_RPATH = -R $(kde_libraries) -R $(qt_libraries) -R $(x_libraries)
+KDE_USE_CLOSURE_FALSE = #
+KDE_USE_CLOSURE_TRUE = 
+KDE_USE_FINAL_FALSE = 
+KDE_USE_FINAL_TRUE = #
+LIBCOMPAT = 
+LIBCRYPT = -lcrypt
+LIBDL = -ldl
+LIBJPEG = -ljpeg
+LIBMICO = @LIBMICO@
+LIBOBJS = @LIBOBJS@
+LIBPNG = -lpng -lz -lm
+LIBPTHREAD = @LIBPTHREAD@
+LIBPYTHON = @LIBPYTHON@
+LIBQIMGIO = @LIBQIMGIO@
+LIBSM = -lSM -lICE
+LIBSOCKET = 
+LIBTIFF = @LIBTIFF@
+LIBTOOL = $(SHELL) $(top_builddir)/libtool
+LIBUCB = 
+LIBZ = -lz
+LIB_KAB = -lkab
+LIB_KDECORE = -lkdecore
+LIB_KDEUI = -lkdeui
+LIB_KFILE = -lkfile
+LIB_KFM = 
+LIB_KFORMULA = -lkformula
+LIB_KHTML = -lkhtml
+LIB_KIMGIO = @LIB_KIMGIO@
+LIB_KIO = -lkio
+LIB_KPARTS = -lkparts
+LIB_KSPELL = -lkspell
+LIB_KSYCOCA = -lksycoca
+LIB_KWRITE = -lkwrite
+LIB_QT = -lqt $(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)
+LIB_SMB = -lsmb
+LIB_X11 = -lX11 $(LIBSOCKET)
+LN_S = ln -s
+MAKEINFO = makeinfo
+MCOPIDL = /opt/kde2/bin/mcopidl
+MICO_INCLUDES = @MICO_INCLUDES@
+MICO_LDFLAGS = @MICO_LDFLAGS@
+MOC = /usr/lib/qt2/bin/moc
+MSGFMT = /usr/bin/msgfmt
+NOOPT_CXXFLAGS =  -fno-exceptions -fno-check-new -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -Wnon-virtual-dtor -fno-builtin -g2 -Wall -fexceptions -DQT_THREAD_SUPPORT
+NOREPO = -fno-repo
+OBJDUMP = @OBJDUMP@
+OBJEXT = o
+PACKAGE = activemirrorcontrol
+PAMINC = @PAMINC@
+PAMLIBPATHS = @PAMLIBPATHS@
+PAMLIBS = @PAMLIBS@
+PYTHONINC = @PYTHONINC@
+PYTHONLIB = @PYTHONLIB@
+PYTHONMODDIR = @PYTHONMODDIR@
+QT_INCLUDES = -I/usr/lib/qt2/include
+QT_LDFLAGS = -L/usr/lib/qt2/lib
+RANLIB = ranlib
+REPO = -frepo
+STRIP = strip
+TOPSUBDIRS =  activemirrorcontrol doc po
+UIC = /usr/lib/qt2/bin/uic
+USER_INCLUDES = 
+USER_LDFLAGS = 
+USE_EXCEPTIONS = -fexceptions
+USE_RTTI = -frtti
+USE_THREADS = @USE_THREADS@
+VERSION = 0.1
+XGETTEXT = /usr/bin/xgettext
+XPMINC = @XPMINC@
+XPMLIB = @XPMLIB@
+X_EXTRA_LIBS = 
+X_INCLUDES = -I/usr/X11R6/include
+X_LDFLAGS = -L/usr/X11R6/lib
+X_PRE_LIBS = 
+all_includes = -I/opt/kde2/include -I/usr/lib/qt2/include -I/usr/X11R6/include 
+all_libraries = -L/usr/X11R6/lib -L/usr/lib/qt2/lib -L/opt/kde2/lib 
+idldir = @idldir@
+kde_appsdir = ${prefix}/share/applnk
+kde_bindir = ${exec_prefix}/bin
+kde_confdir = ${prefix}/share/config
+kde_datadir = ${prefix}/share/apps
+kde_htmldir = ${prefix}/share/doc/HTML
+kde_icondir = ${prefix}/share/icons
+kde_includes = /opt/kde2/include
+kde_libraries = /opt/kde2/lib
+kde_libs_htmldir = /opt/kde2/share/doc/HTML
+kde_libs_prefix = /opt/kde2
+kde_locale = ${prefix}/share/locale
+kde_mimedir = ${prefix}/share/mimelnk
+kde_moduledir = ${prefix}/lib/kde2
+kde_servicesdir = ${prefix}/share/services
+kde_servicetypesdir = ${prefix}/share/servicetypes
+kde_sounddir = ${prefix}/share/sounds
+kde_templatesdir = ${prefix}/share/templates
+kde_wallpaperdir = ${prefix}/share/wallpapers
+micodir = @micodir@
+qt_includes = /usr/lib/qt2/include
+qt_libraries = /usr/lib/qt2/lib
+x_includes = /usr/X11R6/include
+x_libraries = /usr/X11R6/lib
+
+bin_PROGRAMS = activemirrorcontrol
+#>- activemirrorcontrol_SOURCES = errortestthreadcontroller.cpp errortestthread.cpp amclookuptable.cpp laseradjustthreadcontroller.cpp laseradjustthread.cpp adjustthreadcontroller.cpp adjustthread.cpp calibratepaneldialogbase.ui calibratepaneldialog.cpp videospotthread.cpp videothread.cpp videospot.cpp videopixel.cpp defocusthreadcontroller.cpp defocusthread.cpp amclog.cpp heatstate.cpp linearregression.cpp frameevent.cpp progressinfoevent.cpp calibratelasermovementdialogbase.ui calibratelasermovementdialog.cpp errorinfoevent.cpp movethread.cpp centertread.cpp amcframegrabber.cpp threadcontroller.cpp amcprogdlgbase.ui amcprogdlg.cpp laserthreadcontroller.cpp laserthread.cpp magicmirror.cpp threadinfo.cpp threadevent.cpp motorthreaddialogbase.ui motorthreaddialog.cpp motorthreadcontroller.cpp motorthread.cpp videodisplay.cpp videodisplaybase.ui videoframe.cpp mirrorselector.cpp adjustmirrordlgbase.ui adjustmirrordlg.cpp amcserialport.cpp amcpushbutton.cpp amcmotor.cpp amcmirrorpanel.cpp amcerror.cpp amcstate.cpp amcreportsocket.cpp amccmdserversocket.cpp activemirrorcontrolbase.ui activemirrorcontrol.cpp main.cpp 
+#>+ 1
+activemirrorcontrol_SOURCES=errortestthreadcontroller.cpp errortestthread.cpp amclookuptable.cpp laseradjustthreadcontroller.cpp laseradjustthread.cpp adjustthreadcontroller.cpp adjustthread.cpp  calibratepaneldialog.cpp videospotthread.cpp videothread.cpp videospot.cpp videopixel.cpp defocusthreadcontroller.cpp defocusthread.cpp amclog.cpp heatstate.cpp linearregression.cpp frameevent.cpp progressinfoevent.cpp  calibratelasermovementdialog.cpp errorinfoevent.cpp movethread.cpp centertread.cpp amcframegrabber.cpp threadcontroller.cpp  amcprogdlg.cpp laserthreadcontroller.cpp laserthread.cpp magicmirror.cpp threadinfo.cpp threadevent.cpp  motorthreaddialog.cpp motorthreadcontroller.cpp motorthread.cpp videodisplay.cpp  videoframe.cpp mirrorselector.cpp  adjustmirrordlg.cpp amcserialport.cpp amcpushbutton.cpp amcmotor.cpp amcmirrorpanel.cpp amcerror.cpp amcstate.cpp amcreportsocket.cpp amccmdserversocket.cpp  activemirrorcontrol.cpp main.cpp  calibratepaneldialogbase.cpp calibratelasermovementdialogbase.cpp amcprogdlgbase.cpp motorthreaddialogbase.cpp videodisplaybase.cpp adjustmirrordlgbase.cpp activemirrorcontrolbase.cpp
+activemirrorcontrol_LDADD = -lqt-mt -lkdeui -lkdecore $(LIBSOCKET)
+
+EXTRA_DIST = main.cpp activemirrorcontrol.cpp activemirrorcontrol.h lo32-app-activemirrorcontrol.png lo16-app-activemirrorcontrol.png activemirrorcontrolbase.ui amccmdserversocket.cpp amccmdserversocket.h amcreportsocket.h amcreportsocket.cpp cc_defs.h amcstate.cpp amcstate.h amcerror.cpp amcerror.h amcerrors.h amcmirrorpanel.cpp amcmirrorpanel.h amcmotor.cpp amcmotor.h amcpushbutton.cpp amcpushbutton.h amccommands.h amcserialport.cpp amcserialport.h adjustmirrordlg.cpp adjustmirrordlg.h adjustmirrordlgbase.ui mirrorselector.cpp mirrorselector.h videoframe.cpp videoframe.h videodisplaybase.ui videodisplay.cpp videodisplay.h motorthread.cpp motorthread.h motorthreadcontroller.cpp motorthreadcontroller.h motorthreaddialog.cpp motorthreaddialog.h motorthreaddialogbase.ui threadevent.cpp threadevent.h threadinfo.cpp threadinfo.h magicmirror.cpp magicmirror.h laserthread.cpp laserthread.h laserthreadcontroller.cpp laserthreadcontroller.h amcprogdlg.cpp amcprogdlg.h amcprogdlgbase.ui threadcontroller.cpp threadcontroller.h amcframegrabber.cpp amcframegrabber.h centerthread.h centertread.cpp movethread.cpp movethread.h errorinfoevent.cpp errorinfoevent.h calibratelasermovementdialog.cpp calibratelasermovementdialog.h calibratelasermovementdialogbase.ui progressinfoevent.cpp progressinfoevent.h eventdefs.h frameevent.cpp frameevent.h linearregression.cpp linearregression.h heatstate.cpp heatstate.h amclog.cpp amclog.h defocusthread.cpp defocusthread.h defocusthreadcontroller.cpp defocusthreadcontroller.h videopixel.cpp videopixel.h videospot.cpp videospot.h videothread.cpp videothread.h videospotthread.cpp videospotthread.h calibratepaneldialog.cpp calibratepaneldialog.h calibratepaneldialogbase.ui adjustthread.cpp adjustthread.h adjustthreadcontroller.cpp adjustthreadcontroller.h laseradjustthread.cpp laseradjustthread.h laseradjustthreadcontroller.cpp laseradjustthreadcontroller.h amclookuptable.cpp amclookuptable.h amcdefs.h errortestthread.cpp errortestthread.h errortestthreadcontroller.cpp errortestthreadcontroller.h 
+
+####### kdevelop will overwrite this part!!! (end)############
+# this 10 paths are KDE specific. Use them:
+# kde_htmldir       Where your docs should go to. (contains lang subdirs)
+# kde_appsdir       Where your application file (.kdelnk) should go to. 
+# kde_icondir       Where your icon should go to.
+# kde_minidir       Where your mini icon should go to.
+# kde_datadir       Where you install application data. (Use a subdir)
+# kde_locale        Where translation files should go to.(contains lang subdirs)
+# kde_cgidir        Where cgi-bin executables should go to.
+# kde_confdir       Where config files should go to.
+# kde_mimedir       Where mimetypes should go to.
+# kde_toolbardir    Where general toolbar icons should go to.
+# kde_wallpaperdir  Where general wallpapers should go to.
+
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+#>- METASOURCES = AUTO
+
+# the library search path. 
+activemirrorcontrol_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES = 
+bin_PROGRAMS =  activemirrorcontrol$(EXEEXT)
+PROGRAMS =  $(bin_PROGRAMS)
+
+
+DEFS = -DHAVE_CONFIG_H -I. -I$(srcdir) -I..
+CPPFLAGS = 
+LDFLAGS =   
+LIBS = 
+#>- activemirrorcontrol_OBJECTS =  errortestthreadcontroller.$(OBJEXT) \
+#>- errortestthread.$(OBJEXT) amclookuptable.$(OBJEXT) \
+#>- laseradjustthreadcontroller.$(OBJEXT) laseradjustthread.$(OBJEXT) \
+#>- adjustthreadcontroller.$(OBJEXT) adjustthread.$(OBJEXT) \
+#>- calibratepaneldialog.$(OBJEXT) videospotthread.$(OBJEXT) \
+#>- videothread.$(OBJEXT) videospot.$(OBJEXT) videopixel.$(OBJEXT) \
+#>- defocusthreadcontroller.$(OBJEXT) defocusthread.$(OBJEXT) \
+#>- amclog.$(OBJEXT) heatstate.$(OBJEXT) linearregression.$(OBJEXT) \
+#>- frameevent.$(OBJEXT) progressinfoevent.$(OBJEXT) \
+#>- calibratelasermovementdialog.$(OBJEXT) errorinfoevent.$(OBJEXT) \
+#>- movethread.$(OBJEXT) centertread.$(OBJEXT) amcframegrabber.$(OBJEXT) \
+#>- threadcontroller.$(OBJEXT) amcprogdlg.$(OBJEXT) \
+#>- laserthreadcontroller.$(OBJEXT) laserthread.$(OBJEXT) \
+#>- magicmirror.$(OBJEXT) threadinfo.$(OBJEXT) threadevent.$(OBJEXT) \
+#>- motorthreaddialog.$(OBJEXT) motorthreadcontroller.$(OBJEXT) \
+#>- motorthread.$(OBJEXT) videodisplay.$(OBJEXT) videoframe.$(OBJEXT) \
+#>- mirrorselector.$(OBJEXT) adjustmirrordlg.$(OBJEXT) \
+#>- amcserialport.$(OBJEXT) amcpushbutton.$(OBJEXT) amcmotor.$(OBJEXT) \
+#>- amcmirrorpanel.$(OBJEXT) amcerror.$(OBJEXT) amcstate.$(OBJEXT) \
+#>- amcreportsocket.$(OBJEXT) amccmdserversocket.$(OBJEXT) \
+#>- activemirrorcontrol.$(OBJEXT) main.$(OBJEXT)
+#>+ 26
+activemirrorcontrol_final_OBJECTS = activemirrorcontrol.all_cpp.o 
+activemirrorcontrol_nofinal_OBJECTS = errortestthreadcontroller.$(OBJEXT) \
+errortestthread.$(OBJEXT) amclookuptable.$(OBJEXT) \
+laseradjustthreadcontroller.$(OBJEXT) laseradjustthread.$(OBJEXT) \
+adjustthreadcontroller.$(OBJEXT) adjustthread.$(OBJEXT) \
+calibratepaneldialog.$(OBJEXT) videospotthread.$(OBJEXT) \
+videothread.$(OBJEXT) videospot.$(OBJEXT) videopixel.$(OBJEXT) \
+defocusthreadcontroller.$(OBJEXT) defocusthread.$(OBJEXT) \
+amclog.$(OBJEXT) heatstate.$(OBJEXT) linearregression.$(OBJEXT) \
+frameevent.$(OBJEXT) progressinfoevent.$(OBJEXT) \
+calibratelasermovementdialog.$(OBJEXT) errorinfoevent.$(OBJEXT) \
+movethread.$(OBJEXT) centertread.$(OBJEXT) amcframegrabber.$(OBJEXT) \
+threadcontroller.$(OBJEXT) amcprogdlg.$(OBJEXT) \
+laserthreadcontroller.$(OBJEXT) laserthread.$(OBJEXT) \
+magicmirror.$(OBJEXT) threadinfo.$(OBJEXT) threadevent.$(OBJEXT) \
+motorthreaddialog.$(OBJEXT) motorthreadcontroller.$(OBJEXT) \
+motorthread.$(OBJEXT) videodisplay.$(OBJEXT) videoframe.$(OBJEXT) \
+mirrorselector.$(OBJEXT) adjustmirrordlg.$(OBJEXT) \
+amcserialport.$(OBJEXT) amcpushbutton.$(OBJEXT) amcmotor.$(OBJEXT) \
+amcmirrorpanel.$(OBJEXT) amcerror.$(OBJEXT) amcstate.$(OBJEXT) \
+amcreportsocket.$(OBJEXT) amccmdserversocket.$(OBJEXT) \
+activemirrorcontrol.$(OBJEXT) main.$(OBJEXT) calibratepaneldialogbase.$(OBJEXT) calibratelasermovementdialogbase.$(OBJEXT) amcprogdlgbase.$(OBJEXT) motorthreaddialogbase.$(OBJEXT) videodisplaybase.$(OBJEXT) adjustmirrordlgbase.$(OBJEXT) activemirrorcontrolbase.$(OBJEXT)\
+calibratepaneldialog.moc.o mirrorselector.moc.o amcprogdlg.moc.o activemirrorcontrol.moc.o motorthreaddialog.moc.o heatstate.moc.o amcstate.moc.o videodisplay.moc.o amcpushbutton.moc.o videoframe.moc.o adjustmirrordlg.moc.o amccmdserversocket.moc.o amcreportsocket.moc.o calibratelasermovementdialog.moc.o amcframegrabber.moc.o  \
+activemirrorcontrol_meta_unload.o 
+activemirrorcontrol_OBJECTS = $(activemirrorcontrol_nofinal_OBJECTS)
+#activemirrorcontrol_OBJECTS = $(activemirrorcontrol_final_OBJECTS)
+activemirrorcontrol_DEPENDENCIES = 
+CXXFLAGS = -O2 -fno-exceptions -fno-check-new -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -Wnon-virtual-dtor -fno-builtin -O0 -g2 -Wall -fexceptions -DQT_THREAD_SUPPORT
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 1
+CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 1
+LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+#>+ 1
+CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON =  Makefile.am Makefile.in
+
+
+#>- DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 4
+KDE_DIST=Frame06.png mainthreadcontroller.h Spots03.txt Spots07.txt Frame03.png focusthread.cpp Dark1.png Spots00.txt Frame07.png calibratelasermovementdialogbase.h Spots04.txt Frame00.png adjustmirrordlgbase.h Spots08.txt calibratepaneldialogbase.h Frame04.png focusthread.h activemirrorcontrol_meta_unload.cpp amcprogdlgbase.h Spots01.txt Frame08.png Spots05.txt Frame01.png Spots09.txt activemirrorcontrolbase.h Frame05.png mainthreadcontroller.cpp motorthreaddialogbase.h Spots02.txt Frame09.png Spots06.txt Frame02.png videodisplaybase.h 
+
+DISTFILES= $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+
+
+TAR = tar
+GZIP_ENV = --best
+#>- DEP_FILES =  .deps/activemirrorcontrol.P .deps/adjustmirrordlg.P \
+#>- .deps/adjustthread.P .deps/adjustthreadcontroller.P \
+#>- .deps/amccmdserversocket.P .deps/amcerror.P .deps/amcframegrabber.P \
+#>- .deps/amclog.P .deps/amclookuptable.P .deps/amcmirrorpanel.P \
+#>- .deps/amcmotor.P .deps/amcprogdlg.P .deps/amcpushbutton.P \
+#>- .deps/amcreportsocket.P .deps/amcserialport.P .deps/amcstate.P \
+#>- .deps/calibratelasermovementdialog.P .deps/calibratepaneldialog.P \
+#>- .deps/centertread.P .deps/defocusthread.P \
+#>- .deps/defocusthreadcontroller.P .deps/errorinfoevent.P \
+#>- .deps/errortestthread.P .deps/errortestthreadcontroller.P \
+#>- .deps/frameevent.P .deps/heatstate.P .deps/laseradjustthread.P \
+#>- .deps/laseradjustthreadcontroller.P .deps/laserthread.P \
+#>- .deps/laserthreadcontroller.P .deps/linearregression.P \
+#>- .deps/magicmirror.P .deps/main.P .deps/mirrorselector.P \
+#>- .deps/motorthread.P .deps/motorthreadcontroller.P \
+#>- .deps/motorthreaddialog.P .deps/movethread.P .deps/progressinfoevent.P \
+#>- .deps/threadcontroller.P .deps/threadevent.P .deps/threadinfo.P \
+#>- .deps/videodisplay.P .deps/videoframe.P .deps/videopixel.P \
+#>- .deps/videospot.P .deps/videospotthread.P .deps/videothread.P
+#>+ 40
+#DEP_FILES =  $(DEPDIR)/calibratepaneldialogbase.P $(DEPDIR)/calibratelasermovementdialogbase.P $(DEPDIR)/amcprogdlgbase.P $(DEPDIR)/motorthreaddialogbase.P $(DEPDIR)/videodisplaybase.P $(DEPDIR)/adjustmirrordlgbase.P $(DEPDIR)/activemirrorcontrolbase.P $(DEPDIR)/calibratepaneldialog.moc.P $(DEPDIR)/mirrorselector.moc.P $(DEPDIR)/amcprogdlg.moc.P $(DEPDIR)/activemirrorcontrol.moc.P $(DEPDIR)/motorthreaddialog.moc.P $(DEPDIR)/heatstate.moc.P $(DEPDIR)/amcstate.moc.P $(DEPDIR)/videodisplay.moc.P $(DEPDIR)/amcpushbutton.moc.P $(DEPDIR)/videoframe.moc.P $(DEPDIR)/adjustmirrordlg.moc.P $(DEPDIR)/amccmdserversocket.moc.P $(DEPDIR)/amcreportsocket.moc.P $(DEPDIR)/calibratelasermovementdialog.moc.P $(DEPDIR)/amcframegrabber.moc.P $(DEPDIR)/activemirrorcontrol_meta_unload.P  $(DEPDIR)/activemirrorcontrol.all_cpp.P \
+	  .deps/activemirrorcontrol.P .deps/adjustmirrordlg.P \
+.deps/adjustthread.P .deps/adjustthreadcontroller.P \
+.deps/amccmdserversocket.P .deps/amcerror.P .deps/amcframegrabber.P \
+.deps/amclog.P .deps/amclookuptable.P .deps/amcmirrorpanel.P \
+.deps/amcmotor.P .deps/amcprogdlg.P .deps/amcpushbutton.P \
+.deps/amcreportsocket.P .deps/amcserialport.P .deps/amcstate.P \
+.deps/calibratelasermovementdialog.P .deps/calibratepaneldialog.P \
+.deps/centertread.P .deps/defocusthread.P \
+.deps/defocusthreadcontroller.P .deps/errorinfoevent.P \
+.deps/errortestthread.P .deps/errortestthreadcontroller.P \
+.deps/frameevent.P .deps/heatstate.P .deps/laseradjustthread.P \
+.deps/laseradjustthreadcontroller.P .deps/laserthread.P \
+.deps/laserthreadcontroller.P .deps/linearregression.P \
+.deps/magicmirror.P .deps/main.P .deps/mirrorselector.P \
+.deps/motorthread.P .deps/motorthreadcontroller.P \
+.deps/motorthreaddialog.P .deps/movethread.P .deps/progressinfoevent.P \
+.deps/threadcontroller.P .deps/threadevent.P .deps/threadinfo.P \
+.deps/videodisplay.P .deps/videoframe.P .deps/videopixel.P \
+.deps/videospot.P .deps/videospotthread.P .deps/videothread.P
+DEP_FILES =  $(DEPDIR)/calibratepaneldialogbase.P $(DEPDIR)/calibratelasermovementdialogbase.P $(DEPDIR)/amcprogdlgbase.P $(DEPDIR)/motorthreaddialogbase.P $(DEPDIR)/videodisplaybase.P $(DEPDIR)/adjustmirrordlgbase.P $(DEPDIR)/activemirrorcontrolbase.P $(DEPDIR)/calibratepaneldialog.moc.P $(DEPDIR)/mirrorselector.moc.P $(DEPDIR)/amcprogdlg.moc.P $(DEPDIR)/activemirrorcontrol.moc.P $(DEPDIR)/motorthreaddialog.moc.P $(DEPDIR)/heatstate.moc.P $(DEPDIR)/amcstate.moc.P $(DEPDIR)/videodisplay.moc.P $(DEPDIR)/amcpushbutton.moc.P $(DEPDIR)/videoframe.moc.P $(DEPDIR)/adjustmirrordlg.moc.P $(DEPDIR)/amccmdserversocket.moc.P $(DEPDIR)/amcreportsocket.moc.P $(DEPDIR)/calibratelasermovementdialog.moc.P $(DEPDIR)/amcframegrabber.moc.P $(DEPDIR)/activemirrorcontrol_meta_unload.P   .deps/activemirrorcontrol.P .deps/adjustmirrordlg.P \
+.deps/adjustthread.P .deps/adjustthreadcontroller.P \
+.deps/amccmdserversocket.P .deps/amcerror.P .deps/amcframegrabber.P \
+.deps/amclog.P .deps/amclookuptable.P .deps/amcmirrorpanel.P \
+.deps/amcmotor.P .deps/amcprogdlg.P .deps/amcpushbutton.P \
+.deps/amcreportsocket.P .deps/amcserialport.P .deps/amcstate.P \
+.deps/calibratelasermovementdialog.P .deps/calibratepaneldialog.P \
+.deps/centertread.P .deps/defocusthread.P \
+.deps/defocusthreadcontroller.P .deps/errorinfoevent.P \
+.deps/errortestthread.P .deps/errortestthreadcontroller.P \
+.deps/frameevent.P .deps/heatstate.P .deps/laseradjustthread.P \
+.deps/laseradjustthreadcontroller.P .deps/laserthread.P \
+.deps/laserthreadcontroller.P .deps/linearregression.P \
+.deps/magicmirror.P .deps/main.P .deps/mirrorselector.P \
+.deps/motorthread.P .deps/motorthreadcontroller.P \
+.deps/motorthreaddialog.P .deps/movethread.P .deps/progressinfoevent.P \
+.deps/threadcontroller.P .deps/threadevent.P .deps/threadinfo.P \
+.deps/videodisplay.P .deps/videoframe.P .deps/videopixel.P \
+.deps/videospot.P .deps/videospotthread.P .deps/videothread.P
+
+SOURCES = $(activemirrorcontrol_SOURCES)
+OBJECTS = $(activemirrorcontrol_OBJECTS)
+
+#>- all: all-redirect
+#>+ 1
+all: docs-am  all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .cpp .lo .o .obj .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+#>- 	cd $(top_srcdir) && $(AUTOMAKE) --gnu activemirrorcontrol/Makefile
+#>+ 2
+	cd $(top_srcdir) && $(AUTOMAKE) --gnu activemirrorcontrol/Makefile
+	cd $(top_srcdir) && perl admin/am_edit activemirrorcontrol/Makefile.in
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-binPROGRAMS:
+
+clean-binPROGRAMS:
+	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	done
+
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+	$(COMPILE) -c `cygpath -w $<`
+
+.s.o:
+	$(COMPILE) -c $<
+
+.S.o:
+	$(COMPILE) -c $<
+
+mostlyclean-compile:
+	-rm -f *.o core *.core
+	-rm -f *.$(OBJEXT)
+
+clean-compile:
+
+distclean-compile:
+	-rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.s.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+activemirrorcontrol$(EXEEXT): $(activemirrorcontrol_OBJECTS) $(activemirrorcontrol_DEPENDENCIES)
+	@rm -f activemirrorcontrol$(EXEEXT)
+	$(CXXLINK) $(activemirrorcontrol_LDFLAGS) $(activemirrorcontrol_OBJECTS) $(activemirrorcontrol_LDADD) $(LIBS)
+.cpp.o:
+	$(CXXCOMPILE) -c $<
+.cpp.obj:
+	$(CXXCOMPILE) -c `cygpath -w $<`
+.cpp.lo:
+	$(LTCXXCOMPILE) -c $<
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	here=`pwd` && cd $(srcdir) \
+	  && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+	  || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+	-rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = activemirrorcontrol
+
+distdir: $(DISTFILES)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(top_distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu activemirrorcontrol/Makefile
+	@for file in $(DISTFILES); do \
+	  d=$(srcdir); \
+	  if test -d $$d/$$file; then \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+	  fi; \
+	done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+	-rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.c
+	@echo '$(LTCOMPILE) -c $<'; \
+	$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+
+%.o: %.cpp
+	@echo '$(CXXCOMPILE) -c $<'; \
+	$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.cpp
+	@echo '$(LTCXXCOMPILE) -c $<'; \
+	$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am: install-binPROGRAMS
+install-exec: install-exec-am
+
+install-data-am: install-data-local
+install-data: install-data-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-binPROGRAMS uninstall-local
+uninstall: uninstall-am
+all-am: Makefile $(PROGRAMS)
+all-redirect: all-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+	$(mkinstalldirs)  $(DESTDIR)$(bindir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am:  mostlyclean-binPROGRAMS mostlyclean-compile \
+		mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+		mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+#>- clean-am:  clean-binPROGRAMS clean-compile clean-libtool clean-tags \
+#>- 		clean-depend clean-generic mostlyclean-am
+#>+ 2
+clean-am: clean-metasources clean-ui clean-moc-classes clean-final   clean-binPROGRAMS clean-compile clean-libtool clean-tags \
+		clean-depend clean-generic mostlyclean-am
+
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+distclean-am:  distclean-binPROGRAMS distclean-compile distclean-libtool \
+		distclean-tags distclean-depend distclean-generic \
+		clean-am
+	-rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am:  maintainer-clean-binPROGRAMS \
+		maintainer-clean-compile maintainer-clean-libtool \
+		maintainer-clean-tags maintainer-clean-depend \
+		maintainer-clean-generic distclean-am
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir \
+mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-local install-data-am install-data install-am install \
+uninstall-local uninstall-am uninstall all-redirect all-am all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+install-data-local:
+#>- 	$(mkinstalldirs) $(kde_icondir)/locolor/32x32/apps/
+#>+ 1
+	$(mkinstalldirs) $(DESTDIR)$(kde_icondir)/locolor/32x32/apps/
+#>- 	$(INSTALL_DATA) $(srcdir)/lo32-app-activemirrorcontrol.png $(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+#>+ 1
+	$(INSTALL_DATA) $(srcdir)/lo32-app-activemirrorcontrol.png $(DESTDIR)$(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+#>- 	$(mkinstalldirs) $(kde_icondir)/locolor/16x16/apps/
+#>+ 1
+	$(mkinstalldirs) $(DESTDIR)$(kde_icondir)/locolor/16x16/apps/
+#>- 	$(INSTALL_DATA) $(srcdir)/lo16-app-activemirrorcontrol.png $(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+#>+ 1
+	$(INSTALL_DATA) $(srcdir)/lo16-app-activemirrorcontrol.png $(DESTDIR)$(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+
+uninstall-local:
+#>- 	-rm -f $(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+#>+ 1
+	-rm -f $(DESTDIR)$(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+#>- 	-rm -f $(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+#>+ 1
+	-rm -f $(DESTDIR)$(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+
+# Uncomment the following two lines if you add a ui.rc file for your application to make use of
+# KDE
+#rcdir = $(kde_datadir)/activemirrorcontrol
+#rc_DATA = activemirrorcontrolui.rc
+
+#WARNING: if you use a ui.rc file above, use:
+
+# messages: rc.cpp
+
+# instead of 
+
+# messages:
+
+messages: 
+	LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
+	if test -n "$$LIST"; then \
+	 $(XGETTEXT) $$LIST -o $(podir)/activemirrorcontrol.pot; \
+	fi
+
+# 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:
+
+#>+ 78
+calibratepaneldialogbase.cpp: $(srcdir)/calibratepaneldialogbase.ui calibratepaneldialogbase.h calibratepaneldialogbase.moc
+	rm -f calibratepaneldialogbase.cpp
+	echo '#include <klocale.h>' > calibratepaneldialogbase.cpp
+	$(UIC) -tr i18n -i calibratepaneldialogbase.h $(srcdir)/calibratepaneldialogbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> calibratepaneldialogbase.cpp || rm -f calibratepaneldialogbase.cpp
+	echo '#include "calibratepaneldialogbase.moc"' >> calibratepaneldialogbase.cpp
+
+calibratepaneldialogbase.h: $(srcdir)/calibratepaneldialogbase.ui
+	$(UIC) -o calibratepaneldialogbase.h $(srcdir)/calibratepaneldialogbase.ui
+
+calibratepaneldialogbase.moc: calibratepaneldialogbase.h
+	$(MOC) calibratepaneldialogbase.h -o calibratepaneldialogbase.moc
+calibratelasermovementdialogbase.cpp: $(srcdir)/calibratelasermovementdialogbase.ui calibratelasermovementdialogbase.h calibratelasermovementdialogbase.moc
+	rm -f calibratelasermovementdialogbase.cpp
+	echo '#include <klocale.h>' > calibratelasermovementdialogbase.cpp
+	$(UIC) -tr i18n -i calibratelasermovementdialogbase.h $(srcdir)/calibratelasermovementdialogbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> calibratelasermovementdialogbase.cpp || rm -f calibratelasermovementdialogbase.cpp
+	echo '#include "calibratelasermovementdialogbase.moc"' >> calibratelasermovementdialogbase.cpp
+
+calibratelasermovementdialogbase.h: $(srcdir)/calibratelasermovementdialogbase.ui
+	$(UIC) -o calibratelasermovementdialogbase.h $(srcdir)/calibratelasermovementdialogbase.ui
+
+calibratelasermovementdialogbase.moc: calibratelasermovementdialogbase.h
+	$(MOC) calibratelasermovementdialogbase.h -o calibratelasermovementdialogbase.moc
+amcprogdlgbase.cpp: $(srcdir)/amcprogdlgbase.ui amcprogdlgbase.h amcprogdlgbase.moc
+	rm -f amcprogdlgbase.cpp
+	echo '#include <klocale.h>' > amcprogdlgbase.cpp
+	$(UIC) -tr i18n -i amcprogdlgbase.h $(srcdir)/amcprogdlgbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> amcprogdlgbase.cpp || rm -f amcprogdlgbase.cpp
+	echo '#include "amcprogdlgbase.moc"' >> amcprogdlgbase.cpp
+
+amcprogdlgbase.h: $(srcdir)/amcprogdlgbase.ui
+	$(UIC) -o amcprogdlgbase.h $(srcdir)/amcprogdlgbase.ui
+
+amcprogdlgbase.moc: amcprogdlgbase.h
+	$(MOC) amcprogdlgbase.h -o amcprogdlgbase.moc
+motorthreaddialogbase.cpp: $(srcdir)/motorthreaddialogbase.ui motorthreaddialogbase.h motorthreaddialogbase.moc
+	rm -f motorthreaddialogbase.cpp
+	echo '#include <klocale.h>' > motorthreaddialogbase.cpp
+	$(UIC) -tr i18n -i motorthreaddialogbase.h $(srcdir)/motorthreaddialogbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> motorthreaddialogbase.cpp || rm -f motorthreaddialogbase.cpp
+	echo '#include "motorthreaddialogbase.moc"' >> motorthreaddialogbase.cpp
+
+motorthreaddialogbase.h: $(srcdir)/motorthreaddialogbase.ui
+	$(UIC) -o motorthreaddialogbase.h $(srcdir)/motorthreaddialogbase.ui
+
+motorthreaddialogbase.moc: motorthreaddialogbase.h
+	$(MOC) motorthreaddialogbase.h -o motorthreaddialogbase.moc
+videodisplaybase.cpp: $(srcdir)/videodisplaybase.ui videodisplaybase.h videodisplaybase.moc
+	rm -f videodisplaybase.cpp
+	echo '#include <klocale.h>' > videodisplaybase.cpp
+	$(UIC) -tr i18n -i videodisplaybase.h $(srcdir)/videodisplaybase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> videodisplaybase.cpp || rm -f videodisplaybase.cpp
+	echo '#include "videodisplaybase.moc"' >> videodisplaybase.cpp
+
+videodisplaybase.h: $(srcdir)/videodisplaybase.ui
+	$(UIC) -o videodisplaybase.h $(srcdir)/videodisplaybase.ui
+
+videodisplaybase.moc: videodisplaybase.h
+	$(MOC) videodisplaybase.h -o videodisplaybase.moc
+adjustmirrordlgbase.cpp: $(srcdir)/adjustmirrordlgbase.ui adjustmirrordlgbase.h adjustmirrordlgbase.moc
+	rm -f adjustmirrordlgbase.cpp
+	echo '#include <klocale.h>' > adjustmirrordlgbase.cpp
+	$(UIC) -tr i18n -i adjustmirrordlgbase.h $(srcdir)/adjustmirrordlgbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> adjustmirrordlgbase.cpp || rm -f adjustmirrordlgbase.cpp
+	echo '#include "adjustmirrordlgbase.moc"' >> adjustmirrordlgbase.cpp
+
+adjustmirrordlgbase.h: $(srcdir)/adjustmirrordlgbase.ui
+	$(UIC) -o adjustmirrordlgbase.h $(srcdir)/adjustmirrordlgbase.ui
+
+adjustmirrordlgbase.moc: adjustmirrordlgbase.h
+	$(MOC) adjustmirrordlgbase.h -o adjustmirrordlgbase.moc
+activemirrorcontrolbase.cpp: $(srcdir)/activemirrorcontrolbase.ui activemirrorcontrolbase.h activemirrorcontrolbase.moc
+	rm -f activemirrorcontrolbase.cpp
+	echo '#include <klocale.h>' > activemirrorcontrolbase.cpp
+	$(UIC) -tr i18n -i activemirrorcontrolbase.h $(srcdir)/activemirrorcontrolbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> activemirrorcontrolbase.cpp || rm -f activemirrorcontrolbase.cpp
+	echo '#include "activemirrorcontrolbase.moc"' >> activemirrorcontrolbase.cpp
+
+activemirrorcontrolbase.h: $(srcdir)/activemirrorcontrolbase.ui
+	$(UIC) -o activemirrorcontrolbase.h $(srcdir)/activemirrorcontrolbase.ui
+
+activemirrorcontrolbase.moc: activemirrorcontrolbase.h
+	$(MOC) activemirrorcontrolbase.h -o activemirrorcontrolbase.moc
+
+#>+ 3
+calibratepaneldialogbase.moc: $(srcdir)/calibratepaneldialogbase.h
+	$(MOC) $(srcdir)/calibratepaneldialogbase.h -o calibratepaneldialogbase.moc
+
+#>+ 3
+calibratepaneldialog.moc.cpp: $(srcdir)/calibratepaneldialog.h
+	$(MOC) $(srcdir)/calibratepaneldialog.h -o calibratepaneldialog.moc.cpp
+
+#>+ 3
+calibratelasermovementdialogbase.moc: $(srcdir)/calibratelasermovementdialogbase.h
+	$(MOC) $(srcdir)/calibratelasermovementdialogbase.h -o calibratelasermovementdialogbase.moc
+
+#>+ 3
+mirrorselector.moc.cpp: $(srcdir)/mirrorselector.h
+	$(MOC) $(srcdir)/mirrorselector.h -o mirrorselector.moc.cpp
+
+#>+ 3
+amcprogdlg.moc.cpp: $(srcdir)/amcprogdlg.h
+	$(MOC) $(srcdir)/amcprogdlg.h -o amcprogdlg.moc.cpp
+
+#>+ 3
+videodisplaybase.moc: $(srcdir)/videodisplaybase.h
+	$(MOC) $(srcdir)/videodisplaybase.h -o videodisplaybase.moc
+
+#>+ 3
+activemirrorcontrol.moc.cpp: $(srcdir)/activemirrorcontrol.h
+	$(MOC) $(srcdir)/activemirrorcontrol.h -o activemirrorcontrol.moc.cpp
+
+#>+ 3
+amcprogdlgbase.moc: $(srcdir)/amcprogdlgbase.h
+	$(MOC) $(srcdir)/amcprogdlgbase.h -o amcprogdlgbase.moc
+
+#>+ 3
+activemirrorcontrolbase.moc: $(srcdir)/activemirrorcontrolbase.h
+	$(MOC) $(srcdir)/activemirrorcontrolbase.h -o activemirrorcontrolbase.moc
+
+#>+ 3
+motorthreaddialog.moc.cpp: $(srcdir)/motorthreaddialog.h
+	$(MOC) $(srcdir)/motorthreaddialog.h -o motorthreaddialog.moc.cpp
+
+#>+ 3
+heatstate.moc.cpp: $(srcdir)/heatstate.h
+	$(MOC) $(srcdir)/heatstate.h -o heatstate.moc.cpp
+
+#>+ 3
+adjustmirrordlgbase.moc: $(srcdir)/adjustmirrordlgbase.h
+	$(MOC) $(srcdir)/adjustmirrordlgbase.h -o adjustmirrordlgbase.moc
+
+#>+ 3
+amcstate.moc.cpp: $(srcdir)/amcstate.h
+	$(MOC) $(srcdir)/amcstate.h -o amcstate.moc.cpp
+
+#>+ 3
+videodisplay.moc.cpp: $(srcdir)/videodisplay.h
+	$(MOC) $(srcdir)/videodisplay.h -o videodisplay.moc.cpp
+
+#>+ 3
+amcpushbutton.moc.cpp: $(srcdir)/amcpushbutton.h
+	$(MOC) $(srcdir)/amcpushbutton.h -o amcpushbutton.moc.cpp
+
+#>+ 3
+videoframe.moc.cpp: $(srcdir)/videoframe.h
+	$(MOC) $(srcdir)/videoframe.h -o videoframe.moc.cpp
+
+#>+ 3
+motorthreaddialogbase.moc: $(srcdir)/motorthreaddialogbase.h
+	$(MOC) $(srcdir)/motorthreaddialogbase.h -o motorthreaddialogbase.moc
+
+#>+ 3
+adjustmirrordlg.moc.cpp: $(srcdir)/adjustmirrordlg.h
+	$(MOC) $(srcdir)/adjustmirrordlg.h -o adjustmirrordlg.moc.cpp
+
+#>+ 3
+amccmdserversocket.moc.cpp: $(srcdir)/amccmdserversocket.h
+	$(MOC) $(srcdir)/amccmdserversocket.h -o amccmdserversocket.moc.cpp
+
+#>+ 3
+amcreportsocket.moc.cpp: $(srcdir)/amcreportsocket.h
+	$(MOC) $(srcdir)/amcreportsocket.h -o amcreportsocket.moc.cpp
+
+#>+ 3
+calibratelasermovementdialog.moc.cpp: $(srcdir)/calibratelasermovementdialog.h
+	$(MOC) $(srcdir)/calibratelasermovementdialog.h -o calibratelasermovementdialog.moc.cpp
+
+#>+ 3
+amcframegrabber.moc.cpp: $(srcdir)/amcframegrabber.h
+	$(MOC) $(srcdir)/amcframegrabber.h -o amcframegrabber.moc.cpp
+
+#>+ 3
+clean-metasources:
+	-rm -f  calibratepaneldialogbase.moc calibratepaneldialog.moc.cpp calibratelasermovementdialogbase.moc mirrorselector.moc.cpp amcprogdlg.moc.cpp videodisplaybase.moc activemirrorcontrol.moc.cpp amcprogdlgbase.moc activemirrorcontrolbase.moc motorthreaddialog.moc.cpp heatstate.moc.cpp adjustmirrordlgbase.moc amcstate.moc.cpp videodisplay.moc.cpp amcpushbutton.moc.cpp videoframe.moc.cpp motorthreaddialogbase.moc adjustmirrordlg.moc.cpp amccmdserversocket.moc.cpp amcreportsocket.moc.cpp calibratelasermovementdialog.moc.cpp amcframegrabber.moc.cpp
+
+#>+ 10
+clean-ui:
+	-rm -f \
+	calibratepaneldialogbase.cpp calibratepaneldialogbase.h calibratepaneldialogbase.moc \
+	calibratelasermovementdialogbase.cpp calibratelasermovementdialogbase.h calibratelasermovementdialogbase.moc \
+	amcprogdlgbase.cpp amcprogdlgbase.h amcprogdlgbase.moc \
+	motorthreaddialogbase.cpp motorthreaddialogbase.h motorthreaddialogbase.moc \
+	videodisplaybase.cpp videodisplaybase.h videodisplaybase.moc \
+	adjustmirrordlgbase.cpp adjustmirrordlgbase.h adjustmirrordlgbase.moc \
+	activemirrorcontrolbase.cpp activemirrorcontrolbase.h activemirrorcontrolbase.moc 
+
+#>+ 2
+docs-am:
+
+#>+ 5
+force-reedit:
+		cd $(top_srcdir) && $(AUTOMAKE) --gnu activemirrorcontrol/Makefile
+	cd $(top_srcdir) && perl admin/am_edit activemirrorcontrol/Makefile.in
+
+
+#>+ 10
+activemirrorcontrol_meta_unload.cpp:  calibratepaneldialogbase.moc calibratelasermovementdialogbase.moc calibratepaneldialog.moc.cpp mirrorselector.moc.cpp amcprogdlg.moc.cpp videodisplaybase.moc activemirrorcontrol.moc.cpp amcprogdlgbase.moc activemirrorcontrolbase.moc motorthreaddialog.moc.cpp heatstate.moc.cpp adjustmirrordlgbase.moc amcstate.moc.cpp videodisplay.moc.cpp amcpushbutton.moc.cpp videoframe.moc.cpp motorthreaddialogbase.moc adjustmirrordlg.moc.cpp amccmdserversocket.moc.cpp amcreportsocket.moc.cpp calibratelasermovementdialog.moc.cpp amcframegrabber.moc.cpp calibratepaneldialogbase.moc calibratelasermovementdialogbase.moc amcprogdlgbase.moc motorthreaddialogbase.moc videodisplaybase.moc adjustmirrordlgbase.moc activemirrorcontrolbase.moc
+	@echo 'creating activemirrorcontrol_meta_unload.cpp'
+	-rm -f activemirrorcontrol_meta_unload.cpp
+	@echo 'static const char * _metalist_activemirrorcontrol[] = {' > activemirrorcontrol_meta_unload.cpp
+	cat  calibratepaneldialogbase.moc calibratelasermovementdialogbase.moc calibratepaneldialog.moc.cpp mirrorselector.moc.cpp amcprogdlg.moc.cpp videodisplaybase.moc activemirrorcontrol.moc.cpp amcprogdlgbase.moc activemirrorcontrolbase.moc motorthreaddialog.moc.cpp heatstate.moc.cpp adjustmirrordlgbase.moc amcstate.moc.cpp videodisplay.moc.cpp amcpushbutton.moc.cpp videoframe.moc.cpp motorthreaddialogbase.moc adjustmirrordlg.moc.cpp amccmdserversocket.moc.cpp amcreportsocket.moc.cpp calibratelasermovementdialog.moc.cpp amcframegrabber.moc.cpp calibratepaneldialogbase.moc calibratelasermovementdialogbase.moc amcprogdlgbase.moc motorthreaddialogbase.moc videodisplaybase.moc adjustmirrordlgbase.moc activemirrorcontrolbase.moc | grep 'char.*className' | sed -e 's/.*[^A-Za-z0-9_:]\([A-Za-z0-9_:]*\)::className.*$$/\"\1\",/' | sort | uniq >> activemirrorcontrol_meta_unload.cpp
+	@echo '0};' >> activemirrorcontrol_meta_unload.cpp
+	@echo '#include <kunload.h>' >> activemirrorcontrol_meta_unload.cpp
+	@echo '_UNLOAD(activemirrorcontrol)' >> activemirrorcontrol_meta_unload.cpp
+
+
+#>+ 3
+clean-moc-classes:
+	-rm -f  activemirrorcontrol_meta_unload.cpp
+
+#>+ 11
+activemirrorcontrol.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/errortestthreadcontroller.cpp $(srcdir)/errortestthread.cpp $(srcdir)/amclookuptable.cpp $(srcdir)/laseradjustthreadcontroller.cpp $(srcdir)/laseradjustthread.cpp $(srcdir)/adjustthreadcontroller.cpp $(srcdir)/adjustthread.cpp $(srcdir)/calibratepaneldialog.cpp $(srcdir)/videospotthread.cpp $(srcdir)/videothread.cpp $(srcdir)/videospot.cpp $(srcdir)/videopixel.cpp $(srcdir)/defocusthreadcontroller.cpp $(srcdir)/defocusthread.cpp $(srcdir)/amclog.cpp $(srcdir)/heatstate.cpp $(srcdir)/linearregression.cpp $(srcdir)/frameevent.cpp $(srcdir)/progressinfoevent.cpp $(srcdir)/calibratelasermovementdialog.cpp $(srcdir)/errorinfoevent.cpp $(srcdir)/movethread.cpp $(srcdir)/centertread.cpp $(srcdir)/amcframegrabber.cpp $(srcdir)/threadcontroller.cpp $(srcdir)/amcprogdlg.cpp $(srcdir)/laserthreadcontroller.cpp $(srcdir)/laserthread.cpp $(srcdir)/magicmirror.cpp $(srcdir)/threadinfo.cpp $(srcdir)/threadevent.cpp $(srcdir)/motorthreaddialog.cpp $(srcdir)/motorthreadcontroller.cpp $(srcdir)/motorthread.cpp $(srcdir)/videodisplay.cpp $(srcdir)/videoframe.cpp $(srcdir)/mirrorselector.cpp $(srcdir)/adjustmirrordlg.cpp $(srcdir)/amcserialport.cpp $(srcdir)/amcpushbutton.cpp $(srcdir)/amcmotor.cpp $(srcdir)/amcmirrorpanel.cpp $(srcdir)/amcerror.cpp $(srcdir)/amcstate.cpp $(srcdir)/amcreportsocket.cpp $(srcdir)/amccmdserversocket.cpp $(srcdir)/activemirrorcontrol.cpp $(srcdir)/main.cpp $(srcdir)/calibratepaneldialogbase.cpp $(srcdir)/calibratelasermovementdialogbase.cpp $(srcdir)/amcprogdlgbase.cpp $(srcdir)/motorthreaddialogbase.cpp $(srcdir)/videodisplaybase.cpp $(srcdir)/adjustmirrordlgbase.cpp $(srcdir)/activemirrorcontrolbase.cpp $(srcdir)/activemirrorcontrol_meta_unload.cpp  calibratepaneldialog.moc.cpp mirrorselector.moc.cpp amcprogdlg.moc.cpp activemirrorcontrol.moc.cpp motorthreaddialog.moc.cpp heatstate.moc.cpp amcstate.moc.cpp videodisplay.moc.cpp amcpushbutton.moc.cpp videoframe.moc.cpp adjustmirrordlg.moc.cpp amccmdserversocket.moc.cpp amcreportsocket.moc.cpp calibratelasermovementdialog.moc.cpp amcframegrabber.moc.cpp calibratepaneldialogbase.moc calibratelasermovementdialogbase.moc videodisplaybase.moc amcprogdlgbase.moc activemirrorcontrolbase.moc adjustmirrordlgbase.moc motorthreaddialogbase.moc 
+	@echo 'creating activemirrorcontrol.all_cpp.cpp ...'; \
+	rm -f activemirrorcontrol.all_cpp.files activemirrorcontrol.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> activemirrorcontrol.all_cpp.final; \
+	for file in errortestthreadcontroller.cpp errortestthread.cpp amclookuptable.cpp laseradjustthreadcontroller.cpp laseradjustthread.cpp adjustthreadcontroller.cpp adjustthread.cpp calibratepaneldialog.cpp videospotthread.cpp videothread.cpp videospot.cpp videopixel.cpp defocusthreadcontroller.cpp defocusthread.cpp amclog.cpp heatstate.cpp linearregression.cpp frameevent.cpp progressinfoevent.cpp calibratelasermovementdialog.cpp errorinfoevent.cpp movethread.cpp centertread.cpp amcframegrabber.cpp threadcontroller.cpp amcprogdlg.cpp laserthreadcontroller.cpp laserthread.cpp magicmirror.cpp threadinfo.cpp threadevent.cpp motorthreaddialog.cpp motorthreadcontroller.cpp motorthread.cpp videodisplay.cpp videoframe.cpp mirrorselector.cpp adjustmirrordlg.cpp amcserialport.cpp amcpushbutton.cpp amcmotor.cpp amcmirrorpanel.cpp amcerror.cpp amcstate.cpp amcreportsocket.cpp amccmdserversocket.cpp activemirrorcontrol.cpp main.cpp calibratepaneldialogbase.cpp calibratelasermovementdialogbase.cpp amcprogdlgbase.cpp motorthreaddialogbase.cpp videodisplaybase.cpp adjustmirrordlgbase.cpp activemirrorcontrolbase.cpp activemirrorcontrol_meta_unload.cpp  calibratepaneldialog.moc.cpp mirrorselector.moc.cpp amcprogdlg.moc.cpp activemirrorcontrol.moc.cpp motorthreaddialog.moc.cpp heatstate.moc.cpp amcstate.moc.cpp videodisplay.moc.cpp amcpushbutton.moc.cpp videoframe.moc.cpp adjustmirrordlg.moc.cpp amccmdserversocket.moc.cpp amcreportsocket.moc.cpp calibratelasermovementdialog.moc.cpp amcframegrabber.moc.cpp; do \
+	  echo "#include \"$$file\"" >> activemirrorcontrol.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> activemirrorcontrol.all_cpp.final; \
+	done; \
+	cat activemirrorcontrol.all_cpp.final activemirrorcontrol.all_cpp.files  > activemirrorcontrol.all_cpp.cpp; \
+	rm -f activemirrorcontrol.all_cpp.final activemirrorcontrol.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f activemirrorcontrol.all_cpp.cpp
+
+#>+ 2
+final:
+	$(MAKE) activemirrorcontrol_OBJECTS="$(activemirrorcontrol_final_OBJECTS)" all-am
+#>+ 2
+no-final:
+	$(MAKE) activemirrorcontrol_OBJECTS="$(activemirrorcontrol_nofinal_OBJECTS)" all-am
+#>+ 3
+cvs-clean:
+	$(MAKE) -f $(top_srcdir)/admin/Makefile.common cvs-clean
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 56
+$(srcdir)/videospotthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/adjustthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/activemirrorcontrol.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/linearregression.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/errortestthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/laseradjustthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/errortestthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/centertread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/movethread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/main.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/threadinfo.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videoframe.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videodisplay.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/defocusthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/threadevent.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/magicmirror.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcstate.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/motorthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/adjustmirrordlg.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videopixel.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amccmdserversocket.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/calibratepaneldialogbase.cpp: calibratepaneldialogbase.moc 
+$(srcdir)/adjustthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/frameevent.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcpushbutton.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcprogdlg.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/laserthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videothread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videodisplaybase.cpp: videodisplaybase.moc 
+$(srcdir)/amcmirrorpanel.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcmotor.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcerror.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/heatstate.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/calibratepaneldialog.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/defocusthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amclog.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/adjustmirrordlgbase.cpp: adjustmirrordlgbase.moc 
+$(srcdir)/amcserialport.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/progressinfoevent.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/errorinfoevent.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcframegrabber.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amclookuptable.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/threadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/motorthreaddialogbase.cpp: motorthreaddialogbase.moc 
+$(srcdir)/laseradjustthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/motorthreaddialog.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/mirrorselector.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcprogdlgbase.cpp: amcprogdlgbase.moc 
+$(srcdir)/motorthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/laserthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/calibratelasermovementdialogbase.cpp: calibratelasermovementdialogbase.moc 
+$(srcdir)/calibratelasermovementdialog.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/activemirrorcontrolbase.cpp: activemirrorcontrolbase.moc 
+$(srcdir)/amcreportsocket.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videospot.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/Makefile.am
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/Makefile.am	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/Makefile.am	(revision 3401)
@@ -0,0 +1,59 @@
+####### kdevelop will overwrite this part!!! (begin)##########
+bin_PROGRAMS = activemirrorcontrol
+activemirrorcontrol_SOURCES = errortestthreadcontroller.cpp errortestthread.cpp amclookuptable.cpp laseradjustthreadcontroller.cpp laseradjustthread.cpp adjustthreadcontroller.cpp adjustthread.cpp calibratepaneldialogbase.ui calibratepaneldialog.cpp videospotthread.cpp videothread.cpp videospot.cpp videopixel.cpp defocusthreadcontroller.cpp defocusthread.cpp amclog.cpp heatstate.cpp linearregression.cpp frameevent.cpp progressinfoevent.cpp calibratelasermovementdialogbase.ui calibratelasermovementdialog.cpp errorinfoevent.cpp movethread.cpp centertread.cpp amcframegrabber.cpp threadcontroller.cpp amcprogdlgbase.ui amcprogdlg.cpp laserthreadcontroller.cpp laserthread.cpp magicmirror.cpp threadinfo.cpp threadevent.cpp motorthreaddialogbase.ui motorthreaddialog.cpp motorthreadcontroller.cpp motorthread.cpp videodisplay.cpp videodisplaybase.ui videoframe.cpp mirrorselector.cpp adjustmirrordlgbase.ui adjustmirrordlg.cpp amcserialport.cpp amcpushbutton.cpp amcmotor.cpp amcmirrorpanel.cpp amcerror.cpp amcstate.cpp amcreportsocket.cpp amccmdserversocket.cpp activemirrorcontrolbase.ui activemirrorcontrol.cpp main.cpp 
+activemirrorcontrol_LDADD   = -lqt-mt -lkdeui -lkdecore $(LIBSOCKET)
+
+
+EXTRA_DIST = main.cpp activemirrorcontrol.cpp activemirrorcontrol.h lo32-app-activemirrorcontrol.png lo16-app-activemirrorcontrol.png activemirrorcontrolbase.ui amccmdserversocket.cpp amccmdserversocket.h amcreportsocket.h amcreportsocket.cpp cc_defs.h amcstate.cpp amcstate.h amcerror.cpp amcerror.h amcerrors.h amcmirrorpanel.cpp amcmirrorpanel.h amcmotor.cpp amcmotor.h amcpushbutton.cpp amcpushbutton.h amccommands.h amcserialport.cpp amcserialport.h adjustmirrordlg.cpp adjustmirrordlg.h adjustmirrordlgbase.ui mirrorselector.cpp mirrorselector.h videoframe.cpp videoframe.h videodisplaybase.ui videodisplay.cpp videodisplay.h motorthread.cpp motorthread.h motorthreadcontroller.cpp motorthreadcontroller.h motorthreaddialog.cpp motorthreaddialog.h motorthreaddialogbase.ui threadevent.cpp threadevent.h threadinfo.cpp threadinfo.h magicmirror.cpp magicmirror.h laserthread.cpp laserthread.h laserthreadcontroller.cpp laserthreadcontroller.h amcprogdlg.cpp amcprogdlg.h amcprogdlgbase.ui threadcontroller.cpp threadcontroller.h amcframegrabber.cpp amcframegrabber.h centerthread.h centertread.cpp movethread.cpp movethread.h errorinfoevent.cpp errorinfoevent.h calibratelasermovementdialog.cpp calibratelasermovementdialog.h calibratelasermovementdialogbase.ui progressinfoevent.cpp progressinfoevent.h eventdefs.h frameevent.cpp frameevent.h linearregression.cpp linearregression.h heatstate.cpp heatstate.h amclog.cpp amclog.h defocusthread.cpp defocusthread.h defocusthreadcontroller.cpp defocusthreadcontroller.h videopixel.cpp videopixel.h videospot.cpp videospot.h videothread.cpp videothread.h videospotthread.cpp videospotthread.h calibratepaneldialog.cpp calibratepaneldialog.h calibratepaneldialogbase.ui adjustthread.cpp adjustthread.h adjustthreadcontroller.cpp adjustthreadcontroller.h laseradjustthread.cpp laseradjustthread.h laseradjustthreadcontroller.cpp laseradjustthreadcontroller.h amclookuptable.cpp amclookuptable.h amcdefs.h errortestthread.cpp errortestthread.h errortestthreadcontroller.cpp errortestthreadcontroller.h 
+
+install-data-local:
+	$(mkinstalldirs) $(kde_icondir)/locolor/32x32/apps/
+	$(INSTALL_DATA) $(srcdir)/lo32-app-activemirrorcontrol.png $(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+	$(mkinstalldirs) $(kde_icondir)/locolor/16x16/apps/
+	$(INSTALL_DATA) $(srcdir)/lo16-app-activemirrorcontrol.png $(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+
+uninstall-local:
+	-rm -f $(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+	-rm -f $(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+
+####### kdevelop will overwrite this part!!! (end)############
+# this 10 paths are KDE specific. Use them:
+# kde_htmldir       Where your docs should go to. (contains lang subdirs)
+# kde_appsdir       Where your application file (.kdelnk) should go to. 
+# kde_icondir       Where your icon should go to.
+# kde_minidir       Where your mini icon should go to.
+# kde_datadir       Where you install application data. (Use a subdir)
+# kde_locale        Where translation files should go to.(contains lang subdirs)
+# kde_cgidir        Where cgi-bin executables should go to.
+# kde_confdir       Where config files should go to.
+# kde_mimedir       Where mimetypes should go to.
+# kde_toolbardir    Where general toolbar icons should go to.
+# kde_wallpaperdir  Where general wallpapers should go to.
+
+# set the include path for X, qt and KDE
+INCLUDES= $(all_includes)
+
+METASOURCES = AUTO
+
+# the library search path. 
+activemirrorcontrol_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+
+# Uncomment the following two lines if you add a ui.rc file for your application to make use of
+# KDE
+#rcdir = $(kde_datadir)/activemirrorcontrol
+#rc_DATA = activemirrorcontrolui.rc
+
+#WARNING: if you use a ui.rc file above, use:
+
+# messages: rc.cpp
+
+# instead of 
+
+# messages:
+
+messages: 
+	LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
+	if test -n "$$LIST"; then \
+	 $(XGETTEXT) $$LIST -o $(podir)/activemirrorcontrol.pot; \
+	fi
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/Makefile.in
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/Makefile.in	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/Makefile.in	(revision 3401)
@@ -0,0 +1,987 @@
+# KDE tags expanded automatically by am_edit - $Revision: 1.1 $ 
+# Makefile.in generated automatically by automake 1.4 from Makefile.am
+
+# Copyright (C) 1994, 1995-8, 1999 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.
+
+####### kdevelop will overwrite this part!!! (begin)##########
+
+
+SHELL = @SHELL@
+
+srcdir = @srcdir@
+top_srcdir = @top_srcdir@
+VPATH = @srcdir@
+prefix = @prefix@
+exec_prefix = @exec_prefix@
+#>- 
+bindir = @bindir@
+#>+ 3
+DEPDIR = .deps
+
+bindir = @bindir@
+sbindir = @sbindir@
+libexecdir = @libexecdir@
+datadir = @datadir@
+sysconfdir = @sysconfdir@
+sharedstatedir = @sharedstatedir@
+localstatedir = @localstatedir@
+libdir = @libdir@
+infodir = @infodir@
+mandir = @mandir@
+includedir = @includedir@
+oldincludedir = /usr/include
+
+DESTDIR =
+
+pkgdatadir = $(datadir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+
+top_builddir = ..
+
+ACLOCAL = @ACLOCAL@
+AUTOCONF = @AUTOCONF@
+AUTOMAKE = @AUTOMAKE@
+AUTOHEADER = @AUTOHEADER@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS)
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+transform = @program_transform_name@
+
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_alias = @build_alias@
+build_triplet = @build@
+host_alias = @host_alias@
+host_triplet = @host@
+target_alias = @target_alias@
+target_triplet = @target@
+ARTSCCONFIG = @ARTSCCONFIG@
+AS = @AS@
+AUTODIRS = @AUTODIRS@
+CC = @CC@
+CONF_FILES = @CONF_FILES@
+CPP = @CPP@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+DCOPIDL = @DCOPIDL@
+DCOPIDL2CPP = @DCOPIDL2CPP@
+DCOP_DEPENDENCIES = @DCOP_DEPENDENCIES@
+DLLTOOL = @DLLTOOL@
+DPMSINC = @DPMSINC@
+DPMSLIB = @DPMSLIB@
+EXEEXT = @EXEEXT@
+GCJ = @GCJ@
+GCJFLAGS = @GCJFLAGS@
+GLINC = @GLINC@
+GLLIB = @GLLIB@
+GMSGFMT = @GMSGFMT@
+IDL = @IDL@
+IDL_DEPENDENCIES = @IDL_DEPENDENCIES@
+KDB2HTML = @KDB2HTML@
+KDECONFIG = @KDECONFIG@
+KDE_CXXFLAGS = @KDE_CXXFLAGS@
+KDE_EXTRA_RPATH = @KDE_EXTRA_RPATH@
+KDE_INCLUDES = @KDE_INCLUDES@
+KDE_LDFLAGS = @KDE_LDFLAGS@
+KDE_PLUGIN = @KDE_PLUGIN@
+KDE_RPATH = @KDE_RPATH@
+KDE_USE_CLOSURE_FALSE = @KDE_USE_CLOSURE_FALSE@
+KDE_USE_CLOSURE_TRUE = @KDE_USE_CLOSURE_TRUE@
+KDE_USE_FINAL_FALSE = @KDE_USE_FINAL_FALSE@
+KDE_USE_FINAL_TRUE = @KDE_USE_FINAL_TRUE@
+LIBCOMPAT = @LIBCOMPAT@
+LIBCRYPT = @LIBCRYPT@
+LIBDL = @LIBDL@
+LIBJPEG = @LIBJPEG@
+LIBMICO = @LIBMICO@
+LIBOBJS = @LIBOBJS@
+LIBPNG = @LIBPNG@
+LIBPTHREAD = @LIBPTHREAD@
+LIBPYTHON = @LIBPYTHON@
+LIBQIMGIO = @LIBQIMGIO@
+LIBSM = @LIBSM@
+LIBSOCKET = @LIBSOCKET@
+LIBTIFF = @LIBTIFF@
+LIBTOOL = @LIBTOOL@
+LIBUCB = @LIBUCB@
+LIBZ = @LIBZ@
+LIB_KAB = @LIB_KAB@
+LIB_KDECORE = @LIB_KDECORE@
+LIB_KDEUI = @LIB_KDEUI@
+LIB_KFILE = @LIB_KFILE@
+LIB_KFM = @LIB_KFM@
+LIB_KFORMULA = @LIB_KFORMULA@
+LIB_KHTML = @LIB_KHTML@
+LIB_KIMGIO = @LIB_KIMGIO@
+LIB_KIO = @LIB_KIO@
+LIB_KPARTS = @LIB_KPARTS@
+LIB_KSPELL = @LIB_KSPELL@
+LIB_KSYCOCA = @LIB_KSYCOCA@
+LIB_KWRITE = @LIB_KWRITE@
+LIB_QT = @LIB_QT@
+LIB_SMB = @LIB_SMB@
+LIB_X11 = @LIB_X11@
+LN_S = @LN_S@
+MAKEINFO = @MAKEINFO@
+MCOPIDL = @MCOPIDL@
+MICO_INCLUDES = @MICO_INCLUDES@
+MICO_LDFLAGS = @MICO_LDFLAGS@
+MOC = @MOC@
+MSGFMT = @MSGFMT@
+NOOPT_CXXFLAGS = @NOOPT_CXXFLAGS@
+NOREPO = @NOREPO@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+PACKAGE = @PACKAGE@
+PAMINC = @PAMINC@
+PAMLIBPATHS = @PAMLIBPATHS@
+PAMLIBS = @PAMLIBS@
+PYTHONINC = @PYTHONINC@
+PYTHONLIB = @PYTHONLIB@
+PYTHONMODDIR = @PYTHONMODDIR@
+QT_INCLUDES = @QT_INCLUDES@
+QT_LDFLAGS = @QT_LDFLAGS@
+RANLIB = @RANLIB@
+REPO = @REPO@
+STRIP = @STRIP@
+TOPSUBDIRS = @TOPSUBDIRS@
+UIC = @UIC@
+USER_INCLUDES = @USER_INCLUDES@
+USER_LDFLAGS = @USER_LDFLAGS@
+USE_EXCEPTIONS = @USE_EXCEPTIONS@
+USE_RTTI = @USE_RTTI@
+USE_THREADS = @USE_THREADS@
+VERSION = @VERSION@
+XGETTEXT = @XGETTEXT@
+XPMINC = @XPMINC@
+XPMLIB = @XPMLIB@
+X_EXTRA_LIBS = @X_EXTRA_LIBS@
+X_INCLUDES = @X_INCLUDES@
+X_LDFLAGS = @X_LDFLAGS@
+X_PRE_LIBS = @X_PRE_LIBS@
+all_includes = @all_includes@
+all_libraries = @all_libraries@
+idldir = @idldir@
+kde_appsdir = @kde_appsdir@
+kde_bindir = @kde_bindir@
+kde_confdir = @kde_confdir@
+kde_datadir = @kde_datadir@
+kde_htmldir = @kde_htmldir@
+kde_icondir = @kde_icondir@
+kde_includes = @kde_includes@
+kde_libraries = @kde_libraries@
+kde_libs_htmldir = @kde_libs_htmldir@
+kde_libs_prefix = @kde_libs_prefix@
+kde_locale = @kde_locale@
+kde_mimedir = @kde_mimedir@
+kde_moduledir = @kde_moduledir@
+kde_servicesdir = @kde_servicesdir@
+kde_servicetypesdir = @kde_servicetypesdir@
+kde_sounddir = @kde_sounddir@
+kde_templatesdir = @kde_templatesdir@
+kde_wallpaperdir = @kde_wallpaperdir@
+micodir = @micodir@
+qt_includes = @qt_includes@
+qt_libraries = @qt_libraries@
+x_includes = @x_includes@
+x_libraries = @x_libraries@
+
+bin_PROGRAMS = activemirrorcontrol
+#>- activemirrorcontrol_SOURCES = errortestthreadcontroller.cpp errortestthread.cpp amclookuptable.cpp laseradjustthreadcontroller.cpp laseradjustthread.cpp adjustthreadcontroller.cpp adjustthread.cpp calibratepaneldialogbase.ui calibratepaneldialog.cpp videospotthread.cpp videothread.cpp videospot.cpp videopixel.cpp defocusthreadcontroller.cpp defocusthread.cpp amclog.cpp heatstate.cpp linearregression.cpp frameevent.cpp progressinfoevent.cpp calibratelasermovementdialogbase.ui calibratelasermovementdialog.cpp errorinfoevent.cpp movethread.cpp centertread.cpp amcframegrabber.cpp threadcontroller.cpp amcprogdlgbase.ui amcprogdlg.cpp laserthreadcontroller.cpp laserthread.cpp magicmirror.cpp threadinfo.cpp threadevent.cpp motorthreaddialogbase.ui motorthreaddialog.cpp motorthreadcontroller.cpp motorthread.cpp videodisplay.cpp videodisplaybase.ui videoframe.cpp mirrorselector.cpp adjustmirrordlgbase.ui adjustmirrordlg.cpp amcserialport.cpp amcpushbutton.cpp amcmotor.cpp amcmirrorpanel.cpp amcerror.cpp amcstate.cpp amcreportsocket.cpp amccmdserversocket.cpp activemirrorcontrolbase.ui activemirrorcontrol.cpp main.cpp 
+#>+ 1
+activemirrorcontrol_SOURCES=errortestthreadcontroller.cpp errortestthread.cpp amclookuptable.cpp laseradjustthreadcontroller.cpp laseradjustthread.cpp adjustthreadcontroller.cpp adjustthread.cpp  calibratepaneldialog.cpp videospotthread.cpp videothread.cpp videospot.cpp videopixel.cpp defocusthreadcontroller.cpp defocusthread.cpp amclog.cpp heatstate.cpp linearregression.cpp frameevent.cpp progressinfoevent.cpp  calibratelasermovementdialog.cpp errorinfoevent.cpp movethread.cpp centertread.cpp amcframegrabber.cpp threadcontroller.cpp  amcprogdlg.cpp laserthreadcontroller.cpp laserthread.cpp magicmirror.cpp threadinfo.cpp threadevent.cpp  motorthreaddialog.cpp motorthreadcontroller.cpp motorthread.cpp videodisplay.cpp  videoframe.cpp mirrorselector.cpp  adjustmirrordlg.cpp amcserialport.cpp amcpushbutton.cpp amcmotor.cpp amcmirrorpanel.cpp amcerror.cpp amcstate.cpp amcreportsocket.cpp amccmdserversocket.cpp  activemirrorcontrol.cpp main.cpp  calibratepaneldialogbase.cpp calibratelasermovementdialogbase.cpp amcprogdlgbase.cpp motorthreaddialogbase.cpp videodisplaybase.cpp adjustmirrordlgbase.cpp activemirrorcontrolbase.cpp
+activemirrorcontrol_LDADD = -lqt-mt -lkdeui -lkdecore $(LIBSOCKET)
+
+EXTRA_DIST = main.cpp activemirrorcontrol.cpp activemirrorcontrol.h lo32-app-activemirrorcontrol.png lo16-app-activemirrorcontrol.png activemirrorcontrolbase.ui amccmdserversocket.cpp amccmdserversocket.h amcreportsocket.h amcreportsocket.cpp cc_defs.h amcstate.cpp amcstate.h amcerror.cpp amcerror.h amcerrors.h amcmirrorpanel.cpp amcmirrorpanel.h amcmotor.cpp amcmotor.h amcpushbutton.cpp amcpushbutton.h amccommands.h amcserialport.cpp amcserialport.h adjustmirrordlg.cpp adjustmirrordlg.h adjustmirrordlgbase.ui mirrorselector.cpp mirrorselector.h videoframe.cpp videoframe.h videodisplaybase.ui videodisplay.cpp videodisplay.h motorthread.cpp motorthread.h motorthreadcontroller.cpp motorthreadcontroller.h motorthreaddialog.cpp motorthreaddialog.h motorthreaddialogbase.ui threadevent.cpp threadevent.h threadinfo.cpp threadinfo.h magicmirror.cpp magicmirror.h laserthread.cpp laserthread.h laserthreadcontroller.cpp laserthreadcontroller.h amcprogdlg.cpp amcprogdlg.h amcprogdlgbase.ui threadcontroller.cpp threadcontroller.h amcframegrabber.cpp amcframegrabber.h centerthread.h centertread.cpp movethread.cpp movethread.h errorinfoevent.cpp errorinfoevent.h calibratelasermovementdialog.cpp calibratelasermovementdialog.h calibratelasermovementdialogbase.ui progressinfoevent.cpp progressinfoevent.h eventdefs.h frameevent.cpp frameevent.h linearregression.cpp linearregression.h heatstate.cpp heatstate.h amclog.cpp amclog.h defocusthread.cpp defocusthread.h defocusthreadcontroller.cpp defocusthreadcontroller.h videopixel.cpp videopixel.h videospot.cpp videospot.h videothread.cpp videothread.h videospotthread.cpp videospotthread.h calibratepaneldialog.cpp calibratepaneldialog.h calibratepaneldialogbase.ui adjustthread.cpp adjustthread.h adjustthreadcontroller.cpp adjustthreadcontroller.h laseradjustthread.cpp laseradjustthread.h laseradjustthreadcontroller.cpp laseradjustthreadcontroller.h amclookuptable.cpp amclookuptable.h amcdefs.h errortestthread.cpp errortestthread.h errortestthreadcontroller.cpp errortestthreadcontroller.h 
+
+####### kdevelop will overwrite this part!!! (end)############
+# this 10 paths are KDE specific. Use them:
+# kde_htmldir       Where your docs should go to. (contains lang subdirs)
+# kde_appsdir       Where your application file (.kdelnk) should go to. 
+# kde_icondir       Where your icon should go to.
+# kde_minidir       Where your mini icon should go to.
+# kde_datadir       Where you install application data. (Use a subdir)
+# kde_locale        Where translation files should go to.(contains lang subdirs)
+# kde_cgidir        Where cgi-bin executables should go to.
+# kde_confdir       Where config files should go to.
+# kde_mimedir       Where mimetypes should go to.
+# kde_toolbardir    Where general toolbar icons should go to.
+# kde_wallpaperdir  Where general wallpapers should go to.
+
+# set the include path for X, qt and KDE
+INCLUDES = $(all_includes)
+
+#>- METASOURCES = AUTO
+
+# the library search path. 
+activemirrorcontrol_LDFLAGS = $(all_libraries) $(KDE_RPATH)
+mkinstalldirs = $(SHELL) $(top_srcdir)/admin/mkinstalldirs
+CONFIG_HEADER = ../config.h
+CONFIG_CLEAN_FILES = 
+bin_PROGRAMS =  activemirrorcontrol$(EXEEXT)
+PROGRAMS =  $(bin_PROGRAMS)
+
+
+DEFS = @DEFS@ -I. -I$(srcdir) -I..
+CPPFLAGS = @CPPFLAGS@
+LDFLAGS = @LDFLAGS@
+LIBS = @LIBS@
+#>- activemirrorcontrol_OBJECTS =  errortestthreadcontroller.$(OBJEXT) \
+#>- errortestthread.$(OBJEXT) amclookuptable.$(OBJEXT) \
+#>- laseradjustthreadcontroller.$(OBJEXT) laseradjustthread.$(OBJEXT) \
+#>- adjustthreadcontroller.$(OBJEXT) adjustthread.$(OBJEXT) \
+#>- calibratepaneldialog.$(OBJEXT) videospotthread.$(OBJEXT) \
+#>- videothread.$(OBJEXT) videospot.$(OBJEXT) videopixel.$(OBJEXT) \
+#>- defocusthreadcontroller.$(OBJEXT) defocusthread.$(OBJEXT) \
+#>- amclog.$(OBJEXT) heatstate.$(OBJEXT) linearregression.$(OBJEXT) \
+#>- frameevent.$(OBJEXT) progressinfoevent.$(OBJEXT) \
+#>- calibratelasermovementdialog.$(OBJEXT) errorinfoevent.$(OBJEXT) \
+#>- movethread.$(OBJEXT) centertread.$(OBJEXT) amcframegrabber.$(OBJEXT) \
+#>- threadcontroller.$(OBJEXT) amcprogdlg.$(OBJEXT) \
+#>- laserthreadcontroller.$(OBJEXT) laserthread.$(OBJEXT) \
+#>- magicmirror.$(OBJEXT) threadinfo.$(OBJEXT) threadevent.$(OBJEXT) \
+#>- motorthreaddialog.$(OBJEXT) motorthreadcontroller.$(OBJEXT) \
+#>- motorthread.$(OBJEXT) videodisplay.$(OBJEXT) videoframe.$(OBJEXT) \
+#>- mirrorselector.$(OBJEXT) adjustmirrordlg.$(OBJEXT) \
+#>- amcserialport.$(OBJEXT) amcpushbutton.$(OBJEXT) amcmotor.$(OBJEXT) \
+#>- amcmirrorpanel.$(OBJEXT) amcerror.$(OBJEXT) amcstate.$(OBJEXT) \
+#>- amcreportsocket.$(OBJEXT) amccmdserversocket.$(OBJEXT) \
+#>- activemirrorcontrol.$(OBJEXT) main.$(OBJEXT)
+#>+ 26
+activemirrorcontrol_final_OBJECTS = activemirrorcontrol.all_cpp.o 
+activemirrorcontrol_nofinal_OBJECTS = errortestthreadcontroller.$(OBJEXT) \
+errortestthread.$(OBJEXT) amclookuptable.$(OBJEXT) \
+laseradjustthreadcontroller.$(OBJEXT) laseradjustthread.$(OBJEXT) \
+adjustthreadcontroller.$(OBJEXT) adjustthread.$(OBJEXT) \
+calibratepaneldialog.$(OBJEXT) videospotthread.$(OBJEXT) \
+videothread.$(OBJEXT) videospot.$(OBJEXT) videopixel.$(OBJEXT) \
+defocusthreadcontroller.$(OBJEXT) defocusthread.$(OBJEXT) \
+amclog.$(OBJEXT) heatstate.$(OBJEXT) linearregression.$(OBJEXT) \
+frameevent.$(OBJEXT) progressinfoevent.$(OBJEXT) \
+calibratelasermovementdialog.$(OBJEXT) errorinfoevent.$(OBJEXT) \
+movethread.$(OBJEXT) centertread.$(OBJEXT) amcframegrabber.$(OBJEXT) \
+threadcontroller.$(OBJEXT) amcprogdlg.$(OBJEXT) \
+laserthreadcontroller.$(OBJEXT) laserthread.$(OBJEXT) \
+magicmirror.$(OBJEXT) threadinfo.$(OBJEXT) threadevent.$(OBJEXT) \
+motorthreaddialog.$(OBJEXT) motorthreadcontroller.$(OBJEXT) \
+motorthread.$(OBJEXT) videodisplay.$(OBJEXT) videoframe.$(OBJEXT) \
+mirrorselector.$(OBJEXT) adjustmirrordlg.$(OBJEXT) \
+amcserialport.$(OBJEXT) amcpushbutton.$(OBJEXT) amcmotor.$(OBJEXT) \
+amcmirrorpanel.$(OBJEXT) amcerror.$(OBJEXT) amcstate.$(OBJEXT) \
+amcreportsocket.$(OBJEXT) amccmdserversocket.$(OBJEXT) \
+activemirrorcontrol.$(OBJEXT) main.$(OBJEXT) calibratepaneldialogbase.$(OBJEXT) calibratelasermovementdialogbase.$(OBJEXT) amcprogdlgbase.$(OBJEXT) motorthreaddialogbase.$(OBJEXT) videodisplaybase.$(OBJEXT) adjustmirrordlgbase.$(OBJEXT) activemirrorcontrolbase.$(OBJEXT)\
+calibratepaneldialog.moc.o mirrorselector.moc.o amcprogdlg.moc.o activemirrorcontrol.moc.o motorthreaddialog.moc.o heatstate.moc.o amcstate.moc.o videodisplay.moc.o amcpushbutton.moc.o videoframe.moc.o adjustmirrordlg.moc.o amccmdserversocket.moc.o amcreportsocket.moc.o calibratelasermovementdialog.moc.o amcframegrabber.moc.o  \
+activemirrorcontrol_meta_unload.o 
+@KDE_USE_FINAL_FALSE@activemirrorcontrol_OBJECTS = $(activemirrorcontrol_nofinal_OBJECTS)
+@KDE_USE_FINAL_TRUE@activemirrorcontrol_OBJECTS = $(activemirrorcontrol_final_OBJECTS)
+activemirrorcontrol_DEPENDENCIES = 
+CXXFLAGS = @CXXFLAGS@
+#>- CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 1
+CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+#>- LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+#>+ 1
+LTCXXCOMPILE = $(LIBTOOL) --mode=compile --tag=CXX $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS)
+CXXLD = $(CXX)
+#>- CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@
+#>+ 1
+CXXLINK = $(LIBTOOL) --mode=link --tag=CXX $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(KDE_CXXFLAGS) $(LDFLAGS) -o $@
+DIST_COMMON =  Makefile.am Makefile.in
+
+
+#>- DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
+#>+ 4
+KDE_DIST=Frame06.png mainthreadcontroller.h Spots03.txt Spots07.txt Frame03.png focusthread.cpp Dark1.png Spots00.txt Frame07.png calibratelasermovementdialogbase.h Spots04.txt Frame00.png adjustmirrordlgbase.h Spots08.txt calibratepaneldialogbase.h Frame04.png focusthread.h activemirrorcontrol_meta_unload.cpp amcprogdlgbase.h Spots01.txt Frame08.png Spots05.txt Frame01.png Spots09.txt activemirrorcontrolbase.h Frame05.png mainthreadcontroller.cpp motorthreaddialogbase.h Spots02.txt Frame09.png Spots06.txt Frame02.png videodisplaybase.h 
+
+DISTFILES= $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) $(KDE_DIST)
+
+
+TAR = tar
+GZIP_ENV = --best
+#>- DEP_FILES =  .deps/activemirrorcontrol.P .deps/adjustmirrordlg.P \
+#>- .deps/adjustthread.P .deps/adjustthreadcontroller.P \
+#>- .deps/amccmdserversocket.P .deps/amcerror.P .deps/amcframegrabber.P \
+#>- .deps/amclog.P .deps/amclookuptable.P .deps/amcmirrorpanel.P \
+#>- .deps/amcmotor.P .deps/amcprogdlg.P .deps/amcpushbutton.P \
+#>- .deps/amcreportsocket.P .deps/amcserialport.P .deps/amcstate.P \
+#>- .deps/calibratelasermovementdialog.P .deps/calibratepaneldialog.P \
+#>- .deps/centertread.P .deps/defocusthread.P \
+#>- .deps/defocusthreadcontroller.P .deps/errorinfoevent.P \
+#>- .deps/errortestthread.P .deps/errortestthreadcontroller.P \
+#>- .deps/frameevent.P .deps/heatstate.P .deps/laseradjustthread.P \
+#>- .deps/laseradjustthreadcontroller.P .deps/laserthread.P \
+#>- .deps/laserthreadcontroller.P .deps/linearregression.P \
+#>- .deps/magicmirror.P .deps/main.P .deps/mirrorselector.P \
+#>- .deps/motorthread.P .deps/motorthreadcontroller.P \
+#>- .deps/motorthreaddialog.P .deps/movethread.P .deps/progressinfoevent.P \
+#>- .deps/threadcontroller.P .deps/threadevent.P .deps/threadinfo.P \
+#>- .deps/videodisplay.P .deps/videoframe.P .deps/videopixel.P \
+#>- .deps/videospot.P .deps/videospotthread.P .deps/videothread.P
+#>+ 40
+@KDE_USE_FINAL_TRUE@DEP_FILES =  $(DEPDIR)/calibratepaneldialogbase.P $(DEPDIR)/calibratelasermovementdialogbase.P $(DEPDIR)/amcprogdlgbase.P $(DEPDIR)/motorthreaddialogbase.P $(DEPDIR)/videodisplaybase.P $(DEPDIR)/adjustmirrordlgbase.P $(DEPDIR)/activemirrorcontrolbase.P $(DEPDIR)/calibratepaneldialog.moc.P $(DEPDIR)/mirrorselector.moc.P $(DEPDIR)/amcprogdlg.moc.P $(DEPDIR)/activemirrorcontrol.moc.P $(DEPDIR)/motorthreaddialog.moc.P $(DEPDIR)/heatstate.moc.P $(DEPDIR)/amcstate.moc.P $(DEPDIR)/videodisplay.moc.P $(DEPDIR)/amcpushbutton.moc.P $(DEPDIR)/videoframe.moc.P $(DEPDIR)/adjustmirrordlg.moc.P $(DEPDIR)/amccmdserversocket.moc.P $(DEPDIR)/amcreportsocket.moc.P $(DEPDIR)/calibratelasermovementdialog.moc.P $(DEPDIR)/amcframegrabber.moc.P $(DEPDIR)/activemirrorcontrol_meta_unload.P  $(DEPDIR)/activemirrorcontrol.all_cpp.P \
+	  .deps/activemirrorcontrol.P .deps/adjustmirrordlg.P \
+.deps/adjustthread.P .deps/adjustthreadcontroller.P \
+.deps/amccmdserversocket.P .deps/amcerror.P .deps/amcframegrabber.P \
+.deps/amclog.P .deps/amclookuptable.P .deps/amcmirrorpanel.P \
+.deps/amcmotor.P .deps/amcprogdlg.P .deps/amcpushbutton.P \
+.deps/amcreportsocket.P .deps/amcserialport.P .deps/amcstate.P \
+.deps/calibratelasermovementdialog.P .deps/calibratepaneldialog.P \
+.deps/centertread.P .deps/defocusthread.P \
+.deps/defocusthreadcontroller.P .deps/errorinfoevent.P \
+.deps/errortestthread.P .deps/errortestthreadcontroller.P \
+.deps/frameevent.P .deps/heatstate.P .deps/laseradjustthread.P \
+.deps/laseradjustthreadcontroller.P .deps/laserthread.P \
+.deps/laserthreadcontroller.P .deps/linearregression.P \
+.deps/magicmirror.P .deps/main.P .deps/mirrorselector.P \
+.deps/motorthread.P .deps/motorthreadcontroller.P \
+.deps/motorthreaddialog.P .deps/movethread.P .deps/progressinfoevent.P \
+.deps/threadcontroller.P .deps/threadevent.P .deps/threadinfo.P \
+.deps/videodisplay.P .deps/videoframe.P .deps/videopixel.P \
+.deps/videospot.P .deps/videospotthread.P .deps/videothread.P
+@KDE_USE_FINAL_FALSE@DEP_FILES =  $(DEPDIR)/calibratepaneldialogbase.P $(DEPDIR)/calibratelasermovementdialogbase.P $(DEPDIR)/amcprogdlgbase.P $(DEPDIR)/motorthreaddialogbase.P $(DEPDIR)/videodisplaybase.P $(DEPDIR)/adjustmirrordlgbase.P $(DEPDIR)/activemirrorcontrolbase.P $(DEPDIR)/calibratepaneldialog.moc.P $(DEPDIR)/mirrorselector.moc.P $(DEPDIR)/amcprogdlg.moc.P $(DEPDIR)/activemirrorcontrol.moc.P $(DEPDIR)/motorthreaddialog.moc.P $(DEPDIR)/heatstate.moc.P $(DEPDIR)/amcstate.moc.P $(DEPDIR)/videodisplay.moc.P $(DEPDIR)/amcpushbutton.moc.P $(DEPDIR)/videoframe.moc.P $(DEPDIR)/adjustmirrordlg.moc.P $(DEPDIR)/amccmdserversocket.moc.P $(DEPDIR)/amcreportsocket.moc.P $(DEPDIR)/calibratelasermovementdialog.moc.P $(DEPDIR)/amcframegrabber.moc.P $(DEPDIR)/activemirrorcontrol_meta_unload.P   .deps/activemirrorcontrol.P .deps/adjustmirrordlg.P \
+.deps/adjustthread.P .deps/adjustthreadcontroller.P \
+.deps/amccmdserversocket.P .deps/amcerror.P .deps/amcframegrabber.P \
+.deps/amclog.P .deps/amclookuptable.P .deps/amcmirrorpanel.P \
+.deps/amcmotor.P .deps/amcprogdlg.P .deps/amcpushbutton.P \
+.deps/amcreportsocket.P .deps/amcserialport.P .deps/amcstate.P \
+.deps/calibratelasermovementdialog.P .deps/calibratepaneldialog.P \
+.deps/centertread.P .deps/defocusthread.P \
+.deps/defocusthreadcontroller.P .deps/errorinfoevent.P \
+.deps/errortestthread.P .deps/errortestthreadcontroller.P \
+.deps/frameevent.P .deps/heatstate.P .deps/laseradjustthread.P \
+.deps/laseradjustthreadcontroller.P .deps/laserthread.P \
+.deps/laserthreadcontroller.P .deps/linearregression.P \
+.deps/magicmirror.P .deps/main.P .deps/mirrorselector.P \
+.deps/motorthread.P .deps/motorthreadcontroller.P \
+.deps/motorthreaddialog.P .deps/movethread.P .deps/progressinfoevent.P \
+.deps/threadcontroller.P .deps/threadevent.P .deps/threadinfo.P \
+.deps/videodisplay.P .deps/videoframe.P .deps/videopixel.P \
+.deps/videospot.P .deps/videospotthread.P .deps/videothread.P
+
+SOURCES = $(activemirrorcontrol_SOURCES)
+OBJECTS = $(activemirrorcontrol_OBJECTS)
+
+#>- all: all-redirect
+#>+ 1
+all: docs-am  all-redirect
+.SUFFIXES:
+.SUFFIXES: .S .c .cpp .lo .o .obj .s
+$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) 
+#>- 	cd $(top_srcdir) && $(AUTOMAKE) --gnu activemirrorcontrol/Makefile
+#>+ 2
+	cd $(top_srcdir) && $(AUTOMAKE) --gnu activemirrorcontrol/Makefile
+	cd $(top_srcdir) && perl admin/am_edit activemirrorcontrol/Makefile.in
+
+Makefile: $(srcdir)/Makefile.in  $(top_builddir)/config.status $(BUILT_SOURCES)
+	cd $(top_builddir) \
+	  && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status
+
+
+mostlyclean-binPROGRAMS:
+
+clean-binPROGRAMS:
+	-test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS)
+
+distclean-binPROGRAMS:
+
+maintainer-clean-binPROGRAMS:
+
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	$(mkinstalldirs) $(DESTDIR)$(bindir)
+	@list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  if test -f $$p; then \
+	    echo " $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \
+	    $(LIBTOOL)  --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	  else :; fi; \
+	done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	list='$(bin_PROGRAMS)'; for p in $$list; do \
+	  rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \
+	done
+
+# FIXME: We should only use cygpath when building on Windows,
+# and only if it is available.
+.c.obj:
+	$(COMPILE) -c `cygpath -w $<`
+
+.s.o:
+	$(COMPILE) -c $<
+
+.S.o:
+	$(COMPILE) -c $<
+
+mostlyclean-compile:
+	-rm -f *.o core *.core
+	-rm -f *.$(OBJEXT)
+
+clean-compile:
+
+distclean-compile:
+	-rm -f *.tab.c
+
+maintainer-clean-compile:
+
+.s.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+.S.lo:
+	$(LIBTOOL) --mode=compile $(COMPILE) -c $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+
+maintainer-clean-libtool:
+
+activemirrorcontrol$(EXEEXT): $(activemirrorcontrol_OBJECTS) $(activemirrorcontrol_DEPENDENCIES)
+	@rm -f activemirrorcontrol$(EXEEXT)
+	$(CXXLINK) $(activemirrorcontrol_LDFLAGS) $(activemirrorcontrol_OBJECTS) $(activemirrorcontrol_LDADD) $(LIBS)
+.cpp.o:
+	$(CXXCOMPILE) -c $<
+.cpp.obj:
+	$(CXXCOMPILE) -c `cygpath -w $<`
+.cpp.lo:
+	$(LTCXXCOMPILE) -c $<
+
+tags: TAGS
+
+ID: $(HEADERS) $(SOURCES) $(LISP)
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	here=`pwd` && cd $(srcdir) \
+	  && mkid -f$$here/ID $$unique $(LISP)
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) $(LISP)
+	tags=; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)'; \
+	unique=`for i in $$list; do echo $$i; done | \
+	  awk '    { files[$$0] = 1; } \
+	       END { for (i in files) print i; }'`; \
+	test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \
+	  || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags  $$unique $(LISP) -o $$here/TAGS)
+
+mostlyclean-tags:
+
+clean-tags:
+
+distclean-tags:
+	-rm -f TAGS ID
+
+maintainer-clean-tags:
+
+distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir)
+
+subdir = activemirrorcontrol
+
+distdir: $(DISTFILES)
+	here=`cd $(top_builddir) && pwd`; \
+	top_distdir=`cd $(top_distdir) && pwd`; \
+	distdir=`cd $(distdir) && pwd`; \
+	cd $(top_srcdir) \
+	  && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu activemirrorcontrol/Makefile
+	@for file in $(DISTFILES); do \
+	  d=$(srcdir); \
+	  if test -d $$d/$$file; then \
+	    cp -pr $$d/$$file $(distdir)/$$file; \
+	  else \
+	    test -f $(distdir)/$$file \
+	    || ln $$d/$$file $(distdir)/$$file 2> /dev/null \
+	    || cp -p $$d/$$file $(distdir)/$$file || :; \
+	  fi; \
+	done
+
+DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :)
+
+-include $(DEP_FILES)
+
+mostlyclean-depend:
+
+clean-depend:
+
+distclean-depend:
+	-rm -rf .deps
+
+maintainer-clean-depend:
+
+%.o: %.c
+	@echo '$(COMPILE) -c $<'; \
+	$(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.c
+	@echo '$(LTCOMPILE) -c $<'; \
+	$(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+
+%.o: %.cpp
+	@echo '$(CXXCOMPILE) -c $<'; \
+	$(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-cp .deps/$(*F).pp .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm .deps/$(*F).pp
+
+%.lo: %.cpp
+	@echo '$(LTCXXCOMPILE) -c $<'; \
+	$(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $<
+	@-sed -e 's/^\([^:]*\)\.o[ 	]*:/\1.lo \1.o :/' \
+	  < .deps/$(*F).pp > .deps/$(*F).P; \
+	tr ' ' '\012' < .deps/$(*F).pp \
+	  | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \
+	    >> .deps/$(*F).P; \
+	rm -f .deps/$(*F).pp
+info-am:
+info: info-am
+dvi-am:
+dvi: dvi-am
+check-am: all-am
+check: check-am
+installcheck-am:
+installcheck: installcheck-am
+install-exec-am: install-binPROGRAMS
+install-exec: install-exec-am
+
+install-data-am: install-data-local
+install-data: install-data-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+install: install-am
+uninstall-am: uninstall-binPROGRAMS uninstall-local
+uninstall: uninstall-am
+all-am: Makefile $(PROGRAMS)
+all-redirect: all-am
+install-strip:
+	$(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install
+installdirs:
+	$(mkinstalldirs)  $(DESTDIR)$(bindir)
+
+
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-rm -f Makefile $(CONFIG_CLEAN_FILES)
+	-rm -f config.cache config.log stamp-h stamp-h[0-9]*
+
+maintainer-clean-generic:
+mostlyclean-am:  mostlyclean-binPROGRAMS mostlyclean-compile \
+		mostlyclean-libtool mostlyclean-tags mostlyclean-depend \
+		mostlyclean-generic
+
+mostlyclean: mostlyclean-am
+
+#>- clean-am:  clean-binPROGRAMS clean-compile clean-libtool clean-tags \
+#>- 		clean-depend clean-generic mostlyclean-am
+#>+ 2
+clean-am: clean-metasources clean-ui clean-moc-classes clean-final   clean-binPROGRAMS clean-compile clean-libtool clean-tags \
+		clean-depend clean-generic mostlyclean-am
+
+#>- clean: clean-am
+#>+ 1
+clean: kde-rpo-clean  clean-am
+
+distclean-am:  distclean-binPROGRAMS distclean-compile distclean-libtool \
+		distclean-tags distclean-depend distclean-generic \
+		clean-am
+	-rm -f libtool
+
+distclean: distclean-am
+
+maintainer-clean-am:  maintainer-clean-binPROGRAMS \
+		maintainer-clean-compile maintainer-clean-libtool \
+		maintainer-clean-tags maintainer-clean-depend \
+		maintainer-clean-generic distclean-am
+	@echo "This command is intended for maintainers to use;"
+	@echo "it deletes files that may require special tools to rebuild."
+
+maintainer-clean: maintainer-clean-am
+
+.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \
+maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \
+mostlyclean-compile distclean-compile clean-compile \
+maintainer-clean-compile mostlyclean-libtool distclean-libtool \
+clean-libtool maintainer-clean-libtool tags mostlyclean-tags \
+distclean-tags clean-tags maintainer-clean-tags distdir \
+mostlyclean-depend distclean-depend clean-depend \
+maintainer-clean-depend info-am info dvi-am dvi check check-am \
+installcheck-am installcheck install-exec-am install-exec \
+install-data-local install-data-am install-data install-am install \
+uninstall-local uninstall-am uninstall all-redirect all-am all \
+installdirs mostlyclean-generic distclean-generic clean-generic \
+maintainer-clean-generic clean mostlyclean distclean maintainer-clean
+
+
+install-data-local:
+#>- 	$(mkinstalldirs) $(kde_icondir)/locolor/32x32/apps/
+#>+ 1
+	$(mkinstalldirs) $(DESTDIR)$(kde_icondir)/locolor/32x32/apps/
+#>- 	$(INSTALL_DATA) $(srcdir)/lo32-app-activemirrorcontrol.png $(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+#>+ 1
+	$(INSTALL_DATA) $(srcdir)/lo32-app-activemirrorcontrol.png $(DESTDIR)$(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+#>- 	$(mkinstalldirs) $(kde_icondir)/locolor/16x16/apps/
+#>+ 1
+	$(mkinstalldirs) $(DESTDIR)$(kde_icondir)/locolor/16x16/apps/
+#>- 	$(INSTALL_DATA) $(srcdir)/lo16-app-activemirrorcontrol.png $(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+#>+ 1
+	$(INSTALL_DATA) $(srcdir)/lo16-app-activemirrorcontrol.png $(DESTDIR)$(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+
+uninstall-local:
+#>- 	-rm -f $(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+#>+ 1
+	-rm -f $(DESTDIR)$(kde_icondir)/locolor/32x32/apps/activemirrorcontrol.png
+#>- 	-rm -f $(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+#>+ 1
+	-rm -f $(DESTDIR)$(kde_icondir)/locolor/16x16/apps/activemirrorcontrol.png
+
+# Uncomment the following two lines if you add a ui.rc file for your application to make use of
+# KDE
+#rcdir = $(kde_datadir)/activemirrorcontrol
+#rc_DATA = activemirrorcontrolui.rc
+
+#WARNING: if you use a ui.rc file above, use:
+
+# messages: rc.cpp
+
+# instead of 
+
+# messages:
+
+messages: 
+	LIST=`find . -name \*.h -o -name \*.hh -o -name \*.H -o -name \*.hxx -o -name \*.hpp -o -name \*.cpp -o -name \*.cc -o -name \*.cxx -o -name \*.ecpp -o -name \*.C`; \
+	if test -n "$$LIST"; then \
+	 $(XGETTEXT) $$LIST -o $(podir)/activemirrorcontrol.pot; \
+	fi
+
+# 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:
+
+#>+ 78
+calibratepaneldialogbase.cpp: $(srcdir)/calibratepaneldialogbase.ui calibratepaneldialogbase.h calibratepaneldialogbase.moc
+	rm -f calibratepaneldialogbase.cpp
+	echo '#include <klocale.h>' > calibratepaneldialogbase.cpp
+	$(UIC) -tr i18n -i calibratepaneldialogbase.h $(srcdir)/calibratepaneldialogbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> calibratepaneldialogbase.cpp || rm -f calibratepaneldialogbase.cpp
+	echo '#include "calibratepaneldialogbase.moc"' >> calibratepaneldialogbase.cpp
+
+calibratepaneldialogbase.h: $(srcdir)/calibratepaneldialogbase.ui
+	$(UIC) -o calibratepaneldialogbase.h $(srcdir)/calibratepaneldialogbase.ui
+
+calibratepaneldialogbase.moc: calibratepaneldialogbase.h
+	$(MOC) calibratepaneldialogbase.h -o calibratepaneldialogbase.moc
+calibratelasermovementdialogbase.cpp: $(srcdir)/calibratelasermovementdialogbase.ui calibratelasermovementdialogbase.h calibratelasermovementdialogbase.moc
+	rm -f calibratelasermovementdialogbase.cpp
+	echo '#include <klocale.h>' > calibratelasermovementdialogbase.cpp
+	$(UIC) -tr i18n -i calibratelasermovementdialogbase.h $(srcdir)/calibratelasermovementdialogbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> calibratelasermovementdialogbase.cpp || rm -f calibratelasermovementdialogbase.cpp
+	echo '#include "calibratelasermovementdialogbase.moc"' >> calibratelasermovementdialogbase.cpp
+
+calibratelasermovementdialogbase.h: $(srcdir)/calibratelasermovementdialogbase.ui
+	$(UIC) -o calibratelasermovementdialogbase.h $(srcdir)/calibratelasermovementdialogbase.ui
+
+calibratelasermovementdialogbase.moc: calibratelasermovementdialogbase.h
+	$(MOC) calibratelasermovementdialogbase.h -o calibratelasermovementdialogbase.moc
+amcprogdlgbase.cpp: $(srcdir)/amcprogdlgbase.ui amcprogdlgbase.h amcprogdlgbase.moc
+	rm -f amcprogdlgbase.cpp
+	echo '#include <klocale.h>' > amcprogdlgbase.cpp
+	$(UIC) -tr i18n -i amcprogdlgbase.h $(srcdir)/amcprogdlgbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> amcprogdlgbase.cpp || rm -f amcprogdlgbase.cpp
+	echo '#include "amcprogdlgbase.moc"' >> amcprogdlgbase.cpp
+
+amcprogdlgbase.h: $(srcdir)/amcprogdlgbase.ui
+	$(UIC) -o amcprogdlgbase.h $(srcdir)/amcprogdlgbase.ui
+
+amcprogdlgbase.moc: amcprogdlgbase.h
+	$(MOC) amcprogdlgbase.h -o amcprogdlgbase.moc
+motorthreaddialogbase.cpp: $(srcdir)/motorthreaddialogbase.ui motorthreaddialogbase.h motorthreaddialogbase.moc
+	rm -f motorthreaddialogbase.cpp
+	echo '#include <klocale.h>' > motorthreaddialogbase.cpp
+	$(UIC) -tr i18n -i motorthreaddialogbase.h $(srcdir)/motorthreaddialogbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> motorthreaddialogbase.cpp || rm -f motorthreaddialogbase.cpp
+	echo '#include "motorthreaddialogbase.moc"' >> motorthreaddialogbase.cpp
+
+motorthreaddialogbase.h: $(srcdir)/motorthreaddialogbase.ui
+	$(UIC) -o motorthreaddialogbase.h $(srcdir)/motorthreaddialogbase.ui
+
+motorthreaddialogbase.moc: motorthreaddialogbase.h
+	$(MOC) motorthreaddialogbase.h -o motorthreaddialogbase.moc
+videodisplaybase.cpp: $(srcdir)/videodisplaybase.ui videodisplaybase.h videodisplaybase.moc
+	rm -f videodisplaybase.cpp
+	echo '#include <klocale.h>' > videodisplaybase.cpp
+	$(UIC) -tr i18n -i videodisplaybase.h $(srcdir)/videodisplaybase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> videodisplaybase.cpp || rm -f videodisplaybase.cpp
+	echo '#include "videodisplaybase.moc"' >> videodisplaybase.cpp
+
+videodisplaybase.h: $(srcdir)/videodisplaybase.ui
+	$(UIC) -o videodisplaybase.h $(srcdir)/videodisplaybase.ui
+
+videodisplaybase.moc: videodisplaybase.h
+	$(MOC) videodisplaybase.h -o videodisplaybase.moc
+adjustmirrordlgbase.cpp: $(srcdir)/adjustmirrordlgbase.ui adjustmirrordlgbase.h adjustmirrordlgbase.moc
+	rm -f adjustmirrordlgbase.cpp
+	echo '#include <klocale.h>' > adjustmirrordlgbase.cpp
+	$(UIC) -tr i18n -i adjustmirrordlgbase.h $(srcdir)/adjustmirrordlgbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> adjustmirrordlgbase.cpp || rm -f adjustmirrordlgbase.cpp
+	echo '#include "adjustmirrordlgbase.moc"' >> adjustmirrordlgbase.cpp
+
+adjustmirrordlgbase.h: $(srcdir)/adjustmirrordlgbase.ui
+	$(UIC) -o adjustmirrordlgbase.h $(srcdir)/adjustmirrordlgbase.ui
+
+adjustmirrordlgbase.moc: adjustmirrordlgbase.h
+	$(MOC) adjustmirrordlgbase.h -o adjustmirrordlgbase.moc
+activemirrorcontrolbase.cpp: $(srcdir)/activemirrorcontrolbase.ui activemirrorcontrolbase.h activemirrorcontrolbase.moc
+	rm -f activemirrorcontrolbase.cpp
+	echo '#include <klocale.h>' > activemirrorcontrolbase.cpp
+	$(UIC) -tr i18n -i activemirrorcontrolbase.h $(srcdir)/activemirrorcontrolbase.ui | sed -e "s,i18n( \"\" ),QString::null,g" >> activemirrorcontrolbase.cpp || rm -f activemirrorcontrolbase.cpp
+	echo '#include "activemirrorcontrolbase.moc"' >> activemirrorcontrolbase.cpp
+
+activemirrorcontrolbase.h: $(srcdir)/activemirrorcontrolbase.ui
+	$(UIC) -o activemirrorcontrolbase.h $(srcdir)/activemirrorcontrolbase.ui
+
+activemirrorcontrolbase.moc: activemirrorcontrolbase.h
+	$(MOC) activemirrorcontrolbase.h -o activemirrorcontrolbase.moc
+
+#>+ 3
+calibratepaneldialogbase.moc: $(srcdir)/calibratepaneldialogbase.h
+	$(MOC) $(srcdir)/calibratepaneldialogbase.h -o calibratepaneldialogbase.moc
+
+#>+ 3
+calibratepaneldialog.moc.cpp: $(srcdir)/calibratepaneldialog.h
+	$(MOC) $(srcdir)/calibratepaneldialog.h -o calibratepaneldialog.moc.cpp
+
+#>+ 3
+calibratelasermovementdialogbase.moc: $(srcdir)/calibratelasermovementdialogbase.h
+	$(MOC) $(srcdir)/calibratelasermovementdialogbase.h -o calibratelasermovementdialogbase.moc
+
+#>+ 3
+mirrorselector.moc.cpp: $(srcdir)/mirrorselector.h
+	$(MOC) $(srcdir)/mirrorselector.h -o mirrorselector.moc.cpp
+
+#>+ 3
+amcprogdlg.moc.cpp: $(srcdir)/amcprogdlg.h
+	$(MOC) $(srcdir)/amcprogdlg.h -o amcprogdlg.moc.cpp
+
+#>+ 3
+videodisplaybase.moc: $(srcdir)/videodisplaybase.h
+	$(MOC) $(srcdir)/videodisplaybase.h -o videodisplaybase.moc
+
+#>+ 3
+activemirrorcontrol.moc.cpp: $(srcdir)/activemirrorcontrol.h
+	$(MOC) $(srcdir)/activemirrorcontrol.h -o activemirrorcontrol.moc.cpp
+
+#>+ 3
+amcprogdlgbase.moc: $(srcdir)/amcprogdlgbase.h
+	$(MOC) $(srcdir)/amcprogdlgbase.h -o amcprogdlgbase.moc
+
+#>+ 3
+activemirrorcontrolbase.moc: $(srcdir)/activemirrorcontrolbase.h
+	$(MOC) $(srcdir)/activemirrorcontrolbase.h -o activemirrorcontrolbase.moc
+
+#>+ 3
+motorthreaddialog.moc.cpp: $(srcdir)/motorthreaddialog.h
+	$(MOC) $(srcdir)/motorthreaddialog.h -o motorthreaddialog.moc.cpp
+
+#>+ 3
+heatstate.moc.cpp: $(srcdir)/heatstate.h
+	$(MOC) $(srcdir)/heatstate.h -o heatstate.moc.cpp
+
+#>+ 3
+adjustmirrordlgbase.moc: $(srcdir)/adjustmirrordlgbase.h
+	$(MOC) $(srcdir)/adjustmirrordlgbase.h -o adjustmirrordlgbase.moc
+
+#>+ 3
+amcstate.moc.cpp: $(srcdir)/amcstate.h
+	$(MOC) $(srcdir)/amcstate.h -o amcstate.moc.cpp
+
+#>+ 3
+videodisplay.moc.cpp: $(srcdir)/videodisplay.h
+	$(MOC) $(srcdir)/videodisplay.h -o videodisplay.moc.cpp
+
+#>+ 3
+amcpushbutton.moc.cpp: $(srcdir)/amcpushbutton.h
+	$(MOC) $(srcdir)/amcpushbutton.h -o amcpushbutton.moc.cpp
+
+#>+ 3
+videoframe.moc.cpp: $(srcdir)/videoframe.h
+	$(MOC) $(srcdir)/videoframe.h -o videoframe.moc.cpp
+
+#>+ 3
+motorthreaddialogbase.moc: $(srcdir)/motorthreaddialogbase.h
+	$(MOC) $(srcdir)/motorthreaddialogbase.h -o motorthreaddialogbase.moc
+
+#>+ 3
+adjustmirrordlg.moc.cpp: $(srcdir)/adjustmirrordlg.h
+	$(MOC) $(srcdir)/adjustmirrordlg.h -o adjustmirrordlg.moc.cpp
+
+#>+ 3
+amccmdserversocket.moc.cpp: $(srcdir)/amccmdserversocket.h
+	$(MOC) $(srcdir)/amccmdserversocket.h -o amccmdserversocket.moc.cpp
+
+#>+ 3
+amcreportsocket.moc.cpp: $(srcdir)/amcreportsocket.h
+	$(MOC) $(srcdir)/amcreportsocket.h -o amcreportsocket.moc.cpp
+
+#>+ 3
+calibratelasermovementdialog.moc.cpp: $(srcdir)/calibratelasermovementdialog.h
+	$(MOC) $(srcdir)/calibratelasermovementdialog.h -o calibratelasermovementdialog.moc.cpp
+
+#>+ 3
+amcframegrabber.moc.cpp: $(srcdir)/amcframegrabber.h
+	$(MOC) $(srcdir)/amcframegrabber.h -o amcframegrabber.moc.cpp
+
+#>+ 3
+clean-metasources:
+	-rm -f  calibratepaneldialogbase.moc calibratepaneldialog.moc.cpp calibratelasermovementdialogbase.moc mirrorselector.moc.cpp amcprogdlg.moc.cpp videodisplaybase.moc activemirrorcontrol.moc.cpp amcprogdlgbase.moc activemirrorcontrolbase.moc motorthreaddialog.moc.cpp heatstate.moc.cpp adjustmirrordlgbase.moc amcstate.moc.cpp videodisplay.moc.cpp amcpushbutton.moc.cpp videoframe.moc.cpp motorthreaddialogbase.moc adjustmirrordlg.moc.cpp amccmdserversocket.moc.cpp amcreportsocket.moc.cpp calibratelasermovementdialog.moc.cpp amcframegrabber.moc.cpp
+
+#>+ 10
+clean-ui:
+	-rm -f \
+	calibratepaneldialogbase.cpp calibratepaneldialogbase.h calibratepaneldialogbase.moc \
+	calibratelasermovementdialogbase.cpp calibratelasermovementdialogbase.h calibratelasermovementdialogbase.moc \
+	amcprogdlgbase.cpp amcprogdlgbase.h amcprogdlgbase.moc \
+	motorthreaddialogbase.cpp motorthreaddialogbase.h motorthreaddialogbase.moc \
+	videodisplaybase.cpp videodisplaybase.h videodisplaybase.moc \
+	adjustmirrordlgbase.cpp adjustmirrordlgbase.h adjustmirrordlgbase.moc \
+	activemirrorcontrolbase.cpp activemirrorcontrolbase.h activemirrorcontrolbase.moc 
+
+#>+ 2
+docs-am:
+
+#>+ 5
+force-reedit:
+		cd $(top_srcdir) && $(AUTOMAKE) --gnu activemirrorcontrol/Makefile
+	cd $(top_srcdir) && perl admin/am_edit activemirrorcontrol/Makefile.in
+
+
+#>+ 10
+activemirrorcontrol_meta_unload.cpp:  calibratepaneldialogbase.moc calibratelasermovementdialogbase.moc calibratepaneldialog.moc.cpp mirrorselector.moc.cpp amcprogdlg.moc.cpp videodisplaybase.moc activemirrorcontrol.moc.cpp amcprogdlgbase.moc activemirrorcontrolbase.moc motorthreaddialog.moc.cpp heatstate.moc.cpp adjustmirrordlgbase.moc amcstate.moc.cpp videodisplay.moc.cpp amcpushbutton.moc.cpp videoframe.moc.cpp motorthreaddialogbase.moc adjustmirrordlg.moc.cpp amccmdserversocket.moc.cpp amcreportsocket.moc.cpp calibratelasermovementdialog.moc.cpp amcframegrabber.moc.cpp calibratepaneldialogbase.moc calibratelasermovementdialogbase.moc amcprogdlgbase.moc motorthreaddialogbase.moc videodisplaybase.moc adjustmirrordlgbase.moc activemirrorcontrolbase.moc
+	@echo 'creating activemirrorcontrol_meta_unload.cpp'
+	-rm -f activemirrorcontrol_meta_unload.cpp
+	@echo 'static const char * _metalist_activemirrorcontrol[] = {' > activemirrorcontrol_meta_unload.cpp
+	cat  calibratepaneldialogbase.moc calibratelasermovementdialogbase.moc calibratepaneldialog.moc.cpp mirrorselector.moc.cpp amcprogdlg.moc.cpp videodisplaybase.moc activemirrorcontrol.moc.cpp amcprogdlgbase.moc activemirrorcontrolbase.moc motorthreaddialog.moc.cpp heatstate.moc.cpp adjustmirrordlgbase.moc amcstate.moc.cpp videodisplay.moc.cpp amcpushbutton.moc.cpp videoframe.moc.cpp motorthreaddialogbase.moc adjustmirrordlg.moc.cpp amccmdserversocket.moc.cpp amcreportsocket.moc.cpp calibratelasermovementdialog.moc.cpp amcframegrabber.moc.cpp calibratepaneldialogbase.moc calibratelasermovementdialogbase.moc amcprogdlgbase.moc motorthreaddialogbase.moc videodisplaybase.moc adjustmirrordlgbase.moc activemirrorcontrolbase.moc | grep 'char.*className' | sed -e 's/.*[^A-Za-z0-9_:]\([A-Za-z0-9_:]*\)::className.*$$/\"\1\",/' | sort | uniq >> activemirrorcontrol_meta_unload.cpp
+	@echo '0};' >> activemirrorcontrol_meta_unload.cpp
+	@echo '#include <kunload.h>' >> activemirrorcontrol_meta_unload.cpp
+	@echo '_UNLOAD(activemirrorcontrol)' >> activemirrorcontrol_meta_unload.cpp
+
+
+#>+ 3
+clean-moc-classes:
+	-rm -f  activemirrorcontrol_meta_unload.cpp
+
+#>+ 11
+activemirrorcontrol.all_cpp.cpp: $(srcdir)/Makefile.in $(srcdir)/errortestthreadcontroller.cpp $(srcdir)/errortestthread.cpp $(srcdir)/amclookuptable.cpp $(srcdir)/laseradjustthreadcontroller.cpp $(srcdir)/laseradjustthread.cpp $(srcdir)/adjustthreadcontroller.cpp $(srcdir)/adjustthread.cpp $(srcdir)/calibratepaneldialog.cpp $(srcdir)/videospotthread.cpp $(srcdir)/videothread.cpp $(srcdir)/videospot.cpp $(srcdir)/videopixel.cpp $(srcdir)/defocusthreadcontroller.cpp $(srcdir)/defocusthread.cpp $(srcdir)/amclog.cpp $(srcdir)/heatstate.cpp $(srcdir)/linearregression.cpp $(srcdir)/frameevent.cpp $(srcdir)/progressinfoevent.cpp $(srcdir)/calibratelasermovementdialog.cpp $(srcdir)/errorinfoevent.cpp $(srcdir)/movethread.cpp $(srcdir)/centertread.cpp $(srcdir)/amcframegrabber.cpp $(srcdir)/threadcontroller.cpp $(srcdir)/amcprogdlg.cpp $(srcdir)/laserthreadcontroller.cpp $(srcdir)/laserthread.cpp $(srcdir)/magicmirror.cpp $(srcdir)/threadinfo.cpp $(srcdir)/threadevent.cpp $(srcdir)/motorthreaddialog.cpp $(srcdir)/motorthreadcontroller.cpp $(srcdir)/motorthread.cpp $(srcdir)/videodisplay.cpp $(srcdir)/videoframe.cpp $(srcdir)/mirrorselector.cpp $(srcdir)/adjustmirrordlg.cpp $(srcdir)/amcserialport.cpp $(srcdir)/amcpushbutton.cpp $(srcdir)/amcmotor.cpp $(srcdir)/amcmirrorpanel.cpp $(srcdir)/amcerror.cpp $(srcdir)/amcstate.cpp $(srcdir)/amcreportsocket.cpp $(srcdir)/amccmdserversocket.cpp $(srcdir)/activemirrorcontrol.cpp $(srcdir)/main.cpp $(srcdir)/calibratepaneldialogbase.cpp $(srcdir)/calibratelasermovementdialogbase.cpp $(srcdir)/amcprogdlgbase.cpp $(srcdir)/motorthreaddialogbase.cpp $(srcdir)/videodisplaybase.cpp $(srcdir)/adjustmirrordlgbase.cpp $(srcdir)/activemirrorcontrolbase.cpp $(srcdir)/activemirrorcontrol_meta_unload.cpp  calibratepaneldialog.moc.cpp mirrorselector.moc.cpp amcprogdlg.moc.cpp activemirrorcontrol.moc.cpp motorthreaddialog.moc.cpp heatstate.moc.cpp amcstate.moc.cpp videodisplay.moc.cpp amcpushbutton.moc.cpp videoframe.moc.cpp adjustmirrordlg.moc.cpp amccmdserversocket.moc.cpp amcreportsocket.moc.cpp calibratelasermovementdialog.moc.cpp amcframegrabber.moc.cpp calibratepaneldialogbase.moc calibratelasermovementdialogbase.moc videodisplaybase.moc amcprogdlgbase.moc activemirrorcontrolbase.moc adjustmirrordlgbase.moc motorthreaddialogbase.moc 
+	@echo 'creating activemirrorcontrol.all_cpp.cpp ...'; \
+	rm -f activemirrorcontrol.all_cpp.files activemirrorcontrol.all_cpp.final; \
+	echo "#define KDE_USE_FINAL 1" >> activemirrorcontrol.all_cpp.final; \
+	for file in errortestthreadcontroller.cpp errortestthread.cpp amclookuptable.cpp laseradjustthreadcontroller.cpp laseradjustthread.cpp adjustthreadcontroller.cpp adjustthread.cpp calibratepaneldialog.cpp videospotthread.cpp videothread.cpp videospot.cpp videopixel.cpp defocusthreadcontroller.cpp defocusthread.cpp amclog.cpp heatstate.cpp linearregression.cpp frameevent.cpp progressinfoevent.cpp calibratelasermovementdialog.cpp errorinfoevent.cpp movethread.cpp centertread.cpp amcframegrabber.cpp threadcontroller.cpp amcprogdlg.cpp laserthreadcontroller.cpp laserthread.cpp magicmirror.cpp threadinfo.cpp threadevent.cpp motorthreaddialog.cpp motorthreadcontroller.cpp motorthread.cpp videodisplay.cpp videoframe.cpp mirrorselector.cpp adjustmirrordlg.cpp amcserialport.cpp amcpushbutton.cpp amcmotor.cpp amcmirrorpanel.cpp amcerror.cpp amcstate.cpp amcreportsocket.cpp amccmdserversocket.cpp activemirrorcontrol.cpp main.cpp calibratepaneldialogbase.cpp calibratelasermovementdialogbase.cpp amcprogdlgbase.cpp motorthreaddialogbase.cpp videodisplaybase.cpp adjustmirrordlgbase.cpp activemirrorcontrolbase.cpp activemirrorcontrol_meta_unload.cpp  calibratepaneldialog.moc.cpp mirrorselector.moc.cpp amcprogdlg.moc.cpp activemirrorcontrol.moc.cpp motorthreaddialog.moc.cpp heatstate.moc.cpp amcstate.moc.cpp videodisplay.moc.cpp amcpushbutton.moc.cpp videoframe.moc.cpp adjustmirrordlg.moc.cpp amccmdserversocket.moc.cpp amcreportsocket.moc.cpp calibratelasermovementdialog.moc.cpp amcframegrabber.moc.cpp; do \
+	  echo "#include \"$$file\"" >> activemirrorcontrol.all_cpp.files; \
+	  test ! -f $(srcdir)/$$file || egrep '^#pragma +implementation' $(srcdir)/$$file >> activemirrorcontrol.all_cpp.final; \
+	done; \
+	cat activemirrorcontrol.all_cpp.final activemirrorcontrol.all_cpp.files  > activemirrorcontrol.all_cpp.cpp; \
+	rm -f activemirrorcontrol.all_cpp.final activemirrorcontrol.all_cpp.files
+
+#>+ 3
+clean-final:
+	-rm -f activemirrorcontrol.all_cpp.cpp
+
+#>+ 2
+final:
+	$(MAKE) activemirrorcontrol_OBJECTS="$(activemirrorcontrol_final_OBJECTS)" all-am
+#>+ 2
+no-final:
+	$(MAKE) activemirrorcontrol_OBJECTS="$(activemirrorcontrol_nofinal_OBJECTS)" all-am
+#>+ 3
+cvs-clean:
+	$(MAKE) -f $(top_srcdir)/admin/Makefile.common cvs-clean
+
+#>+ 3
+kde-rpo-clean:
+	-rm -f *.rpo
+
+#>+ 56
+$(srcdir)/videospotthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/adjustthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/activemirrorcontrol.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/linearregression.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/errortestthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/laseradjustthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/errortestthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/centertread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/movethread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/main.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/threadinfo.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videoframe.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videodisplay.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/defocusthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/threadevent.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/magicmirror.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcstate.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/motorthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/adjustmirrordlg.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videopixel.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amccmdserversocket.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/calibratepaneldialogbase.cpp: calibratepaneldialogbase.moc 
+$(srcdir)/adjustthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/frameevent.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcpushbutton.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcprogdlg.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/laserthread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videothread.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videodisplaybase.cpp: videodisplaybase.moc 
+$(srcdir)/amcmirrorpanel.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcmotor.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcerror.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/heatstate.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/calibratepaneldialog.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/defocusthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amclog.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/adjustmirrordlgbase.cpp: adjustmirrordlgbase.moc 
+$(srcdir)/amcserialport.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/progressinfoevent.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/errorinfoevent.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcframegrabber.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amclookuptable.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/threadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/motorthreaddialogbase.cpp: motorthreaddialogbase.moc 
+$(srcdir)/laseradjustthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/motorthreaddialog.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/mirrorselector.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/amcprogdlgbase.cpp: amcprogdlgbase.moc 
+$(srcdir)/motorthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/laserthreadcontroller.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/calibratelasermovementdialogbase.cpp: calibratelasermovementdialogbase.moc 
+$(srcdir)/calibratelasermovementdialog.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/activemirrorcontrolbase.cpp: activemirrorcontrolbase.moc 
+$(srcdir)/amcreportsocket.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
+$(srcdir)/videospot.cpp: calibratepaneldialogbase.h calibratelasermovementdialogbase.h amcprogdlgbase.h motorthreaddialogbase.h videodisplaybase.h adjustmirrordlgbase.h activemirrorcontrolbase.h 
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.cpp	(revision 3401)
@@ -0,0 +1,589 @@
+/***************************************************************************
+                          activemirrorcontrol.cpp  -  description
+                             -------------------
+    begin                : Wed Mar 26 14:23:48 UTC 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "activemirrorcontrol.h"
+#include "adjustmirrordlg.h"
+#include "amccmdserversocket.h"
+#include "amclookuptable.h"
+#include "amclog.h"
+#include "amcprogdlg.h"
+#include "amcreportsocket.h"
+#include "amcstate.h"
+#include "heatstate.h"
+#include "calibratelasermovementdialog.h"
+#include "motorthreaddialog.h"
+#include "threadcontroller.h"
+#include "cc_defs.h"
+#include <qdatetime.h>
+#include <qlabel.h>
+#include <qlcdnumber.h>
+#include <qlineedit.h>
+#include <qmessagebox.h>
+#include <qmultilineedit.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <stdio.h>
+#include <math.h>
+
+extern AMCState*  g_pAMCState;
+extern HEATState* g_pHEATState;
+extern AMCLog*	  g_pLog;
+
+
+ActiveMirrorControl::ActiveMirrorControl(QWidget *parent, const char *name) : ActiveMirrorControlBase(parent, name)
+{
+	m_zCCMode = true;
+	qDebug("Connecting AMCState signal");
+	connect( g_pAMCState, SIGNAL( stateChanged( int, int  ) ), SLOT( stateChangedSlot( int, int)));
+	qDebug("Connecting HEATState signal");
+	connect( g_pHEATState, SIGNAL( stateChanged( int, int  ) ), SLOT( heatStateChangedSlot( int, int)));
+	qDebug("Setting AMCState");
+	g_pAMCState->setState( AMC_STATE_NOT_AVAILABLE );
+	qDebug("Setting HEATState");
+	g_pHEATState->setState( HEAT_STATE_NOT_AVAILABLE );
+
+	qDebug("Creating AMCCmdServerSocket");
+	m_pCmdServerSocket = new AMCCmdServerSocket();
+	connect( m_pCmdServerSocket, SIGNAL( newConnect() ), SLOT( cmdConnected()));
+	connect( m_pCmdServerSocket, SIGNAL( endConnect() ), SLOT( cmdDisconnected()));
+	connect( m_pCmdServerSocket, SIGNAL( cmdFromCC( QString ) ), SLOT( cmdReceived( QString )));
+	connect( m_pCmdServerSocket, SIGNAL( reportFromCC( QString ) ), SLOT( ccReportReceived( QString )));
+	connect( m_pCmdServerSocket, SIGNAL( errorFromSocket( QString ) ), SLOT( logMessage( QString )));
+
+	qDebug("Creating AMCReportSocket");
+	m_pReportSocket = new AMCReportSocket( this );
+	connect( m_pReportSocket, SIGNAL( ccConnected() ), SLOT( ccReportConnection()));
+	connect( m_pReportSocket, SIGNAL( ccConnectionRefused() ), SLOT( ccNoConnection()));
+	connect( m_pReportSocket, SIGNAL( reportDelivered( QDateTime&, QString& ) ), SLOT( reportDelivered( QDateTime&, QString& )));
+
+  connect( &m_qtCCRetryTimer, SIGNAL( timeout( ) ), SLOT( reconnectCCTimeout() ) );
+}
+
+ActiveMirrorControl::~ActiveMirrorControl()
+{
+	qDebug("Deleting AMCCmdServerSocket");
+	delete m_pCmdServerSocket;
+	qDebug("Deleting AMCReportSocket");
+	delete m_pReportSocket;
+}
+
+/** Slot invoked when we got a connection from
+Central Control */
+void ActiveMirrorControl::cmdConnected()
+{
+	g_pLog->logInfo( "ActiveMirrorControl::cmdConnected", "Connected to command port of CC" );
+}
+
+/** Slot called when connection to CC is closed */
+void ActiveMirrorControl::cmdDisconnected()
+{
+	g_pLog->logInfo( "ActiveMirrorControl::cmdDisconnected", "Closed connection from command port of CC" );
+	qDebug( "Closed connection from command port of CC" );
+	reconnectCCTimeout();
+}
+
+
+/** Slot envoked when we receive a command
+from Central Control */
+void ActiveMirrorControl::cmdReceived( QString m_qsCmd )
+{
+	g_pLog->logInfo( "ActiveMirrorControl::cmdReceived", m_qsCmd );
+	QDateTime rcvTime = QDateTime::currentDateTime();
+	QString dateString;
+	dateString.sprintf( "%02d.%02d.%4d %02d:%02d:%02d",
+						rcvTime.date().day(), rcvTime.date().month(), rcvTime.date().year(),
+						rcvTime.time().hour(), rcvTime.time().minute(), rcvTime.time().second() );
+	CommandTime->setText( dateString );
+	CommandLabel->setText( m_qsCmd );
+	logMessage( m_qsCmd );
+
+  QTextStream qts( m_qsCmd, IO_ReadOnly );
+	QString qsCommand;
+  qts >> qsCommand;
+	if ( qsCommand == "INAMC" )
+	{	
+		qDebug("FIX ME: INAMC");
+	}
+	if ( qsCommand == "ADJST" )
+	{	
+		qDebug("FIX ME: ADJST");
+	}
+	if ( qsCommand == "INAMC" )
+	{	
+		qDebug("FIX ME: LSADJ");
+	}
+	if ( qsCommand == "BREAK" )
+	{	
+		qDebug("FIX ME: BREAK");
+	}
+	if ( qsCommand == "SHUTD" )
+	{	
+		qDebug("FIX ME: SHUTD");
+	}
+	
+}
+
+/** Slot envoked when we receive a command
+from Central Control */
+void ActiveMirrorControl::ccReportReceived( QString p_qsReport )
+{
+//	qDebug( "Received CC report" );
+//	qDebug( m_qsReport );
+//	QDateTime rcvTime = QDateTime::currentDateTime();
+//	QString dateString;
+//	dateString.sprintf( "%02d.%02d.%4d %02d:%02d:%02d",
+//						rcvTime.date().day(), rcvTime.date().month(), rcvTime.date().year(),
+//						rcvTime.time().hour(), rcvTime.time().minute(), rcvTime.time().second() );
+	
+	g_pLog->logInfo( "ActiveMirrorControl::ccReportReceived", p_qsReport );
+
+  QTextStream qts( &p_qsReport, IO_ReadOnly );
+  QString tag;
+  int iCCState;
+  qts >> dec >> tag >> iCCState;
+  int iYear, iMonth, iDay;
+  int iHour, iMinute, iSecond, iMillis;
+	qts >> iYear >> iMonth >> iDay;
+  qts >> iHour >> iMinute >> iSecond >> iMillis;
+	int iStateWeather, iStateUPS, iStateThresholds, iStateDelays, iStateGPS;
+	qts >> iStateWeather >> iStateUPS >> iStateThresholds >> iStateDelays >> iStateGPS;
+  int iStateDAQ, iStateCAOS, iStateDrive, iStateStarGuider;
+  qts >> iStateDAQ >> iStateCAOS >> iStateDrive >> iStateStarGuider;
+  int iStateCaCo, iStateCalib, iStateSentinel, iStateHVPS, iStateLid;
+  int iStateLV, iStateCool, iStateHV, iStateDC, iStateLEDs;
+  int iStateFADCFans, iStateCalCan, iStateCalIO, iStateCalLV;
+  qts >> iStateCaCo >> iStateCalib >> iStateSentinel >> iStateHVPS >> iStateLid;
+  qts >> iStateLV >> iStateCool >> iStateHV >> iStateDC >> iStateLEDs;
+  qts >> iStateFADCFans >> iStateCalCan >> iStateCalIO >> iStateCalLV;
+  int iStateAMC, iStateHEAT;
+  qts >> iStateAMC >> iStateHEAT;
+  int iStateLIDAR, iStateOptical, iStateL2T, iStateAUX, iStateGRB;
+  qts >> iStateLIDAR >> iStateOptical >> iStateL2T >> iStateAUX >> iStateGRB;
+	double dZd, dAz, dDec, dRA;
+	qts >> dZd >> dAz >> dDec >> dRA;
+	double dTemp, dSolar, dWind, dHum;
+	qts >> dTemp >> dSolar >> dWind >> dHum;
+	double dUPS_V, dRub_GPS_us;
+	qts >> dUPS_V >> dRub_GPS_us;
+  qts >> tag;
+  if ( tag != "OVER" )
+		qDebug("Error decoding string"  );
+
+//	CommandTime->setText( dateString );
+	CCStateLCD->display( iCCState );
+
+  QString qsLID, qsLEDs;
+  switch (iStateLid)
+	{
+		case 0:
+			qsLID.sprintf("Error");
+      break;
+		case 1:
+			qsLID.sprintf("Limit");
+      break;
+		case 4:
+			qsLID.sprintf("Closed");
+      break;
+		case 5:
+			qsLID.sprintf("Open");
+      break;
+		case 6:
+			qsLID.sprintf("Moving");
+      break;
+		case 7:
+			qsLID.sprintf("Stopped");
+      break;
+		case 9:
+			qsLID.sprintf("Not available");
+      break;
+		default:
+			qsLID.sprintf("Unknown");
+  }
+  switch (iStateLEDs)
+	{
+		case 0:
+			qsLEDs.sprintf("Error");
+      break;
+		case 4:
+			qsLEDs.sprintf("Off");
+      break;
+		case 5:
+			qsLEDs.sprintf("On");
+      break;
+		case 9:
+			qsLEDs.sprintf("Not available");
+      break;
+		default:
+			qsLEDs.sprintf("Unknown");
+  }
+
+	ActualAlt->setText( QString::number( dZd ) );
+	ActualAz->setText( QString::number( dAz ) );
+
+	QString strReport;					// short readable representation of Report important to CC
+	strReport.sprintf( "CC_REPORT %04d %02d %02d %02d %02d %02d -- Lid: %s LEDs: %s -- Zd: %4.1f Az: %5.1f",
+                     iYear, iMonth, iDay, iHour, iMinute, iSecond, qsLID.latin1(), qsLEDs.latin1(), dZd, dAz);
+	logMessage( strReport );
+
+  int iState;
+	if( m_zCCMode )
+		iState = g_pAMCState->getState();
+  else
+		iState = m_iStoredState;
+	if ( ( iState == AMC_STATE_INITIALIZED )
+       ||
+       ( iState == AMC_STATE_ADJUSTED )
+       ||
+       ( iState == AMC_STATE_LASERADJUSTED ) )
+  {
+    bool zOk;
+		double dFocusZd = LUTAlt->text().toDouble( &zOk );
+		if ( ( dZd > 1.0 ) && ( fabs( dZd - dFocusZd ) > 3.0 ) )
+		{
+		  // Set the state information
+			if( m_zCCMode )
+				g_pAMCState->setState( AMC_STATE_READJUST );
+  		else
+			{
+				m_iStoredState = AMC_STATE_READJUST;
+        adjustSlot();
+			}
+    }
+	}
+}
+
+/** Log a message to the statuis window */
+void ActiveMirrorControl::logMessage( QString p_qsMsg )
+{
+	InfoField->append( p_qsMsg.stripWhiteSpace() );
+	InfoField->setCursorPosition( InfoField->numLines()+1, 0 );
+}
+
+/** Slot envoked when we get a reporting connection to the CC
+  */
+void ActiveMirrorControl::ccReportConnection()
+{
+	g_pLog->logInfo( "ActiveMirrorControl::ccReportConnection", "Opened Report connection to CC" );
+	m_qtCCRetryTimer.stop();
+  g_pAMCState->setState( AMC_STATE_UNDEFINED );
+  g_pHEATState->setState( HEAT_STATE_OFF );
+}
+
+/** Slot envoked each time a report is send to CC */
+void ActiveMirrorControl::reportDelivered( QDateTime& p_qtReportTime , QString& p_qsReport )
+{
+	QString dateString;
+	dateString.sprintf( "%02d.%02d.%4d %02d:%02d:%02d",
+						p_qtReportTime.date().day(), p_qtReportTime.date().month(), p_qtReportTime.date().year(),
+						p_qtReportTime.time().hour(), p_qtReportTime.time().minute(), p_qtReportTime.time().second() );
+	ReportTime->setText( dateString );
+
+  QTextStream qts( &p_qsReport, IO_ReadOnly );
+
+  QString tag1;
+  int iAMCState;
+  qts >> dec >> tag1 >> iAMCState;
+  int iYear, iMonth, iDay;
+  int iHour, iMinute, iSecond, iMillis;
+	qts >> iYear >> iMonth >> iDay;
+  qts >> iHour >> iMinute >> iSecond >> iMillis;
+  int iComState;
+  qts >> iComState;
+  int iComYear, iComMonth, iComDay;
+  int iComHour, iComMinute, iComSecond, iComMillis;
+	qts >> iComYear >> iComMonth >> iComDay;
+  qts >> iComHour >> iComMinute >> iComSecond >> iComMillis;
+  int iHEATState;
+  qts >> iHEATState;
+  int iInstalledPanels, iErrorPanels;
+  QString tag2, tag3;
+  qts >> tag2 >> iInstalledPanels >> iErrorPanels >> tag3;
+  if ( tag3 != "OVER" )
+  {
+		qDebug("Error decoding string");
+    qDebug("%s %02d %04d %02d %02d %s %02d %02d %s",
+           tag1.latin1(), iAMCState, iYear, iMonth, iDay,
+           tag2.latin1(), iInstalledPanels, iErrorPanels, tag3.latin1() );
+  }
+
+  QString qsReport;
+	qsReport.sprintf("AMC: %02d HEAT: %02d -- PANELS: %03d installed, %03d errors",
+                    iAMCState, iHEATState, iInstalledPanels, iErrorPanels);
+	ReportLabel->setText( qsReport );
+//  qDebug(p_qsReport);
+}
+
+void ActiveMirrorControl::userModeSlot()
+{
+	g_pLog->logInfo( "ActiveMirrorControl::userModeSlot", "Going to user mode" );
+	
+	if( m_zCCMode )
+	{
+		ModeButton->setText( "Go to CC mode  " );
+		ManualButton->setEnabled( true );
+		AdjustButton->setEnabled( true );
+		LaserAdjustButton->setEnabled( true );
+		CenterAllButton->setEnabled( true );
+		CalButton->setEnabled( true );
+		m_zCCMode = false;
+		m_iStoredState = g_pAMCState->getState( );
+		g_pAMCState->setState( AMC_STATE_USER );
+	}
+	else
+	{
+		ModeButton->setText( "Go to user mode" );
+		ManualButton->setEnabled( false );
+		AdjustButton->setEnabled( false );
+		LaserAdjustButton->setEnabled( false );
+		CenterAllButton->setEnabled( false );
+		CalButton->setEnabled( false );
+		m_zCCMode = true;
+		g_pAMCState->setState( m_iStoredState );
+	}
+
+}
+
+void ActiveMirrorControl::stateChangedSlot( int p_iOldState, int p_iNewState )
+{
+	QString qsMsg;
+  qsMsg.sprintf("AMC State changed: %d -> %d", p_iOldState, p_iNewState );
+	g_pLog->logInfo( "ActiveMirrorControl::stateChangedSlot", qsMsg );
+
+	StateLCD->display( p_iNewState );
+  StateLabel->setText( g_pAMCState->getText( p_iNewState ) );
+
+	if ( ( p_iNewState == AMC_STATE_READJUST ) && m_zAutoFocus )
+     adjustSlot();
+}
+
+void ActiveMirrorControl::heatStateChangedSlot( int p_iOldState, int p_iNewState )
+{
+	QString qsMsg;
+  qsMsg.sprintf("HEAT State changed: %d -> %d", p_iOldState, p_iNewState );
+	g_pLog->logInfo( "ActiveMirrorControl::heatStateChangedSlot", qsMsg );
+
+//	StateLCD->display( p_iNewState );
+//  StateLabel->setText( g_pHEATState->getText( p_iNewState) );
+}
+
+/** Slot invoked when no connection to CC is possible. */
+void ActiveMirrorControl::ccNoConnection()
+{
+	m_qtCCRetryTimer.start( 15000 );
+}
+
+/** No descriptions */
+void ActiveMirrorControl::reconnectCCTimeout()
+{
+//  qDebug("!! reconnectCCTimeout");
+  m_pReportSocket->connectToHost( CC_HOST_ADDRESS, AMC_REP_PORT);
+}
+
+/** Move the mirrors manually. */
+void ActiveMirrorControl::moveManuallySlot()
+{
+	g_pLog->logInfo( "ActiveMirrorControl::moveManuallySlot", "Move Panels manually" );
+
+  AdjustMirrorDlg* pMyDialog = new AdjustMirrorDlg( this, "Manual Mode", true );
+	pMyDialog->move(10,10);
+	int ret = pMyDialog->exec();
+	delete pMyDialog;
+}
+
+/** Slot invoked to start the calibration dialog. */
+void ActiveMirrorControl::calibrateSlot()
+{
+	g_pLog->logInfo( "ActiveMirrorControl::calibrateSlot", "Calibarte all Panels" );
+
+  CalibrateLaserMovementDialog* pDialog = new CalibrateLaserMovementDialog( this, "Calibration", true );
+	int ret = pDialog->exec();
+	delete pDialog;
+}
+
+/** Slot invoked to start the calibration dialog. */
+void ActiveMirrorControl::centerAllSlot()
+{
+	g_pLog->logInfo( "ActiveMirrorControl::centerAllSlot", "Centering and setting to Roque-Lamp focus" );
+
+  //Set state to moving.
+	if( m_zCCMode )
+		g_pAMCState->setState( AMC_STATE_MOVING );
+
+  QString qsMsg("Initializing");
+	AMCProgDlg* pDialog = new AMCProgDlg( MOTOR_THREAD_CTRL, this, qsMsg, true );
+	
+	qsMsg.sprintf("Centering and setting to Roque-Lamp focus" );
+	pDialog->setText( qsMsg );
+	pDialog->start();
+	pDialog->exec();
+//  MotorThreadDialog* pDialog = new MotorThreadDialog( this, "Centering", true );
+//	int ret = pDialog->exec();
+	delete pDialog;
+
+  LUTAlt->setText( QString::number( 75 ) );
+  LUTAz->setText( QString::number( 0 ) );
+
+  // Set the state information
+	if( m_zCCMode )
+		g_pAMCState->setState( AMC_STATE_INITIALIZED );
+  else
+		m_iStoredState = AMC_STATE_INITIALIZED;
+
+}
+
+/** Perform a lookup table adjustment. */
+void ActiveMirrorControl::adjustSlot()
+{
+	// Get Altitude and Zenith Distance and
+	double dZd, dAz;
+	if ( ! getZdAz( dZd, dAz ) )
+		return;
+
+  //Set state to moving.
+	if( m_zCCMode )
+		g_pAMCState->setState( AMC_STATE_MOVING );
+
+  QString qsMsg("Adjusting all mirrors");
+	AMCProgDlg* pDialog = new AMCProgDlg( ADJUST_THREAD_CTRL, this, qsMsg, true );
+
+	QString qsLUTName = AMCLookUpTable::findLUT( dZd, dAz );	
+	qsMsg.sprintf("Using lookup table  %s  for Zd: %3.0f Az: %4.0f", qsLUTName.latin1(), dZd, dAz );
+	pDialog->setText( qsMsg );
+
+	qsMsg;
+  qsMsg.sprintf("Adjust for Zd: %6.2f Az: %6.2f using LUT %s", dZd, dAz, qsLUTName.latin1());
+	g_pLog->logInfo( "ActiveMirrorControl::adjustSlot", qsMsg );
+
+	pDialog->start();
+	pDialog->exec();
+
+	delete pDialog;
+
+	int iFileZd = qsLUTName.mid(25,2).toInt();
+	int iFileAz = qsLUTName.mid(28,3).toInt();
+  LUTAlt->setText( QString::number( iFileZd ) );
+  LUTAz->setText( QString::number( iFileAz ) );
+
+  // Set the state information
+	if( m_zCCMode )
+		g_pAMCState->setState( AMC_STATE_ADJUSTED );
+  else
+		m_iStoredState = AMC_STATE_ADJUSTED;
+}
+
+/** Perform a laser adjustment. */
+void ActiveMirrorControl::laserAdjustSlot()
+{
+	double dZd, dAz;
+	if ( ! getZdAz( dZd, dAz ) )
+		return;
+
+	if( m_zCCMode )
+		g_pAMCState->setState( AMC_STATE_MOVING );
+
+	QString qsMsg;
+  qsMsg.sprintf("Laser adjust for Zd: %6.2f Az: 6.2f", dZd, dAz);
+	g_pLog->logInfo( "ActiveMirrorControl::laserAdjustSlot", qsMsg );
+
+  qsMsg.sprintf("Laser Adjustment");
+	AMCProgDlg* pDialog = new AMCProgDlg( LASER_ADJUST_THREAD_CTRL, this, qsMsg, true );
+	// To not have to synchronize on the framegrabber, we run through all
+	// mirror panels sequentially.
+	pDialog->setParallel( false );
+	
+	qsMsg.sprintf("Zd: %3.0f Az: %4.0f", dZd, dAz );
+	pDialog->setText( qsMsg );
+	pDialog->start();
+	pDialog->exec();
+	AMCLookUpTable::saveLUT( dZd, dAz );	
+  LUTAlt->setText( QString::number( dZd ) );
+  LUTAz->setText( QString::number( dAz ) );
+
+	delete pDialog;
+
+  // Set the state information
+	if( m_zCCMode )
+		g_pAMCState->setState( AMC_STATE_LASERADJUSTED );
+  else
+		m_iStoredState = AMC_STATE_LASERADJUSTED;
+}
+
+/** Perform a error testing loop. */
+void ActiveMirrorControl::errorTestSlot()
+{
+  m_iLoops = LoopsSpinBox->value();
+	qDebug("numLoops: %d", m_iLoops );
+
+  QString qsMsg;
+	qsMsg.sprintf("Communication Error Testing: %d Loops", m_iLoops );
+	AMCProgDlg* pDialog = new AMCProgDlg( ERROR_TEST_THREAD_CTRL, this, qsMsg, true );
+	// To not have to synchronize on the framegrabber, we run through all
+	// mirror panels sequentially.
+//	pDialog->setParallel( false );
+	
+	qsMsg.sprintf("Tersting for communication errors");
+	pDialog->setText( qsMsg );
+	pDialog->start();
+	pDialog->exec();
+	delete pDialog;
+}
+
+bool ActiveMirrorControl::getZdAz( double& p_dZd, double& p_dAz)
+{
+  bool zOk;
+	p_dZd = ActualAlt->text().toDouble( &zOk );
+	if( zOk == true )
+		p_dAz  = ActualAz->text().toDouble( &zOk );
+	
+	if( zOk == false )
+	{
+		QMessageBox::warning( this, "Active Mirror Control",
+													"Wrong format of Azimuth or Zenith Distance",
+													QMessageBox::Ok | QMessageBox::Default,
+												QMessageBox::NoButton );
+		return false;
+	}
+	if( p_dZd < 0.0 || p_dZd > 95.0 )
+	{
+		QMessageBox::warning( this, "Active Mirror Control",
+													"Zenith distance out of range ( 0 - 95 )",
+													QMessageBox::Ok | QMessageBox::Default,
+												QMessageBox::NoButton );
+		return false;
+	}
+
+	if( p_dAz < -90.0 || p_dAz > 318.0 )
+	{
+		QMessageBox::warning( this, "Active Mirror Control",
+													"Azimuth out of range ( -90 - 318 )",
+													QMessageBox::Ok | QMessageBox::Default,
+													QMessageBox::NoButton );
+		return false;
+	}
+
+	return true;
+}
+
+/** No descriptions */
+void ActiveMirrorControl::autoFocusSlot( bool p_zOn )
+{
+	if ( p_zOn )
+		qDebug( "Turning AutoFocus ON" );
+  else
+		qDebug( "Turning AutoFocus OFF" );
+  m_zAutoFocus = p_zOn;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.h	(revision 3401)
@@ -0,0 +1,101 @@
+/***************************************************************************
+                          activemirrorcontrol.h  -  description
+                             -------------------
+    begin                : Wed Mar 26 14:23:48 UTC 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef ACTIVEMIRRORCONTROL_H
+#define ACTIVEMIRRORCONTROL_H
+
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "activemirrorcontrolbase.h"
+#include <qtimer.h>
+
+class AMCCmdServerSocket;
+class AMCReportSocket;
+class AMCState;
+class HEATState;
+class QDateTime;
+
+/** ActiveMirrorControl is the base class of the porject */
+class ActiveMirrorControl : public ActiveMirrorControlBase
+{
+  Q_OBJECT 
+
+public:
+    /** construtor */
+    ActiveMirrorControl(QWidget* parent=0, const char *name=0);
+    /** destructor */
+    ~ActiveMirrorControl();
+		bool getZdAz( double& p_dZd, double& p_dAz );
+		int getNumLoops() { return m_iLoops; }
+
+public slots:
+  virtual void userModeSlot();
+  virtual void stateChangedSlot( int p_iOldState, int p_iNewState );
+  virtual void heatStateChangedSlot( int p_iOldState, int p_iNewState );
+  /** Slot invoked when no connection to CC is possible. */
+  void ccNoConnection();
+  /** No descriptions */
+  void reconnectCCTimeout();
+  /** Move the mirrors manually. */
+  void moveManuallySlot();
+  /** Slot invoked to start the calibration dialog. */
+  void centerAllSlot();
+  /** Slot invoked to start the calibration dialog. */
+  void calibrateSlot();
+  /** Perform a lookup table adjustment. */
+  void adjustSlot();
+  /** No descriptions */
+  void autoFocusSlot( bool p_zOn );
+
+private slots: // Private slots
+	/** Slot invoked when we got a connection from Central Control */
+	void cmdConnected();
+	/** Slot called when connection to CC is closed */
+	void cmdDisconnected();
+	/** Slot envoked when we receive a command from Central Control */
+	void cmdReceived( QString m_qsCmd );
+	/** Slot envoked when we receive a report from Central Control */
+	void ccReportReceived( QString m_qsReport );
+	/** Log a message to the statuis window */
+  /** Slot envoked when we get a reporting connection to the CC
+  */
+  void ccReportConnection();
+	void logMessage( QString p_qsMsg );
+  /** Slot envoked each time a report is send to CC */
+  void reportDelivered( QDateTime& p_qtReportTime , QString& p_qsReport );
+  /** Perform a laser adjustment. */
+  void laserAdjustSlot();
+  /** Perform a laser adjustment. */
+  void errorTestSlot();
+
+private:
+	AMCCmdServerSocket*	m_pCmdServerSocket;
+	AMCReportSocket*		m_pReportSocket;
+  bool								m_zCCMode;
+  bool								m_zAutoFocus;
+  /** State stored during user mode */
+  int									m_iStoredState;
+  /** Number of loops for error testing */
+  int									m_iLoops;
+  /** Timer used to retry a connection to CC. */
+  QTimer							m_qtCCRetryTimer;
+
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol.moc.cpp	(revision 3401)
@@ -0,0 +1,207 @@
+/****************************************************************************
+** ActiveMirrorControl meta object code from reading C++ file 'activemirrorcontrol.h'
+**
+** Created: Fri Feb 6 19:17:23 2004
+**      by: The Qt MOC ($Id: activemirrorcontrol.moc.cpp,v 1.1 2004-03-04 16:31:16 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "activemirrorcontrol.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *ActiveMirrorControl::className() const
+{
+    return "ActiveMirrorControl";
+}
+
+QMetaObject *ActiveMirrorControl::metaObj = 0;
+
+void ActiveMirrorControl::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(ActiveMirrorControlBase::className(), "ActiveMirrorControlBase") != 0 )
+	badSuperclassWarning("ActiveMirrorControl","ActiveMirrorControlBase");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString ActiveMirrorControl::tr(const char* s)
+{
+    return qApp->translate( "ActiveMirrorControl", s, 0 );
+}
+
+QString ActiveMirrorControl::tr(const char* s, const char * c)
+{
+    return qApp->translate( "ActiveMirrorControl", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* ActiveMirrorControl::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) ActiveMirrorControlBase::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (ActiveMirrorControl::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    typedef void (ActiveMirrorControl::*m1_t1)(int,int);
+    typedef void (QObject::*om1_t1)(int,int);
+    typedef void (ActiveMirrorControl::*m1_t2)(int,int);
+    typedef void (QObject::*om1_t2)(int,int);
+    typedef void (ActiveMirrorControl::*m1_t3)();
+    typedef void (QObject::*om1_t3)();
+    typedef void (ActiveMirrorControl::*m1_t4)();
+    typedef void (QObject::*om1_t4)();
+    typedef void (ActiveMirrorControl::*m1_t5)();
+    typedef void (QObject::*om1_t5)();
+    typedef void (ActiveMirrorControl::*m1_t6)();
+    typedef void (QObject::*om1_t6)();
+    typedef void (ActiveMirrorControl::*m1_t7)();
+    typedef void (QObject::*om1_t7)();
+    typedef void (ActiveMirrorControl::*m1_t8)();
+    typedef void (QObject::*om1_t8)();
+    typedef void (ActiveMirrorControl::*m1_t9)(bool);
+    typedef void (QObject::*om1_t9)(bool);
+    typedef void (ActiveMirrorControl::*m1_t10)();
+    typedef void (QObject::*om1_t10)();
+    typedef void (ActiveMirrorControl::*m1_t11)();
+    typedef void (QObject::*om1_t11)();
+    typedef void (ActiveMirrorControl::*m1_t12)(QString);
+    typedef void (QObject::*om1_t12)(QString);
+    typedef void (ActiveMirrorControl::*m1_t13)(QString);
+    typedef void (QObject::*om1_t13)(QString);
+    typedef void (ActiveMirrorControl::*m1_t14)();
+    typedef void (QObject::*om1_t14)();
+    typedef void (ActiveMirrorControl::*m1_t15)(QString);
+    typedef void (QObject::*om1_t15)(QString);
+    typedef void (ActiveMirrorControl::*m1_t16)(QDateTime&,QString&);
+    typedef void (QObject::*om1_t16)(QDateTime&,QString&);
+    typedef void (ActiveMirrorControl::*m1_t17)();
+    typedef void (QObject::*om1_t17)();
+    typedef void (ActiveMirrorControl::*m1_t18)();
+    typedef void (QObject::*om1_t18)();
+    m1_t0 v1_0 = &ActiveMirrorControl::userModeSlot;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &ActiveMirrorControl::stateChangedSlot;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &ActiveMirrorControl::heatStateChangedSlot;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &ActiveMirrorControl::ccNoConnection;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    m1_t4 v1_4 = &ActiveMirrorControl::reconnectCCTimeout;
+    om1_t4 ov1_4 = (om1_t4)v1_4;
+    m1_t5 v1_5 = &ActiveMirrorControl::moveManuallySlot;
+    om1_t5 ov1_5 = (om1_t5)v1_5;
+    m1_t6 v1_6 = &ActiveMirrorControl::centerAllSlot;
+    om1_t6 ov1_6 = (om1_t6)v1_6;
+    m1_t7 v1_7 = &ActiveMirrorControl::calibrateSlot;
+    om1_t7 ov1_7 = (om1_t7)v1_7;
+    m1_t8 v1_8 = &ActiveMirrorControl::adjustSlot;
+    om1_t8 ov1_8 = (om1_t8)v1_8;
+    m1_t9 v1_9 = &ActiveMirrorControl::autoFocusSlot;
+    om1_t9 ov1_9 = (om1_t9)v1_9;
+    m1_t10 v1_10 = &ActiveMirrorControl::cmdConnected;
+    om1_t10 ov1_10 = (om1_t10)v1_10;
+    m1_t11 v1_11 = &ActiveMirrorControl::cmdDisconnected;
+    om1_t11 ov1_11 = (om1_t11)v1_11;
+    m1_t12 v1_12 = &ActiveMirrorControl::cmdReceived;
+    om1_t12 ov1_12 = (om1_t12)v1_12;
+    m1_t13 v1_13 = &ActiveMirrorControl::ccReportReceived;
+    om1_t13 ov1_13 = (om1_t13)v1_13;
+    m1_t14 v1_14 = &ActiveMirrorControl::ccReportConnection;
+    om1_t14 ov1_14 = (om1_t14)v1_14;
+    m1_t15 v1_15 = &ActiveMirrorControl::logMessage;
+    om1_t15 ov1_15 = (om1_t15)v1_15;
+    m1_t16 v1_16 = &ActiveMirrorControl::reportDelivered;
+    om1_t16 ov1_16 = (om1_t16)v1_16;
+    m1_t17 v1_17 = &ActiveMirrorControl::laserAdjustSlot;
+    om1_t17 ov1_17 = (om1_t17)v1_17;
+    m1_t18 v1_18 = &ActiveMirrorControl::errorTestSlot;
+    om1_t18 ov1_18 = (om1_t18)v1_18;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(19);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(19);
+    slot_tbl[0].name = "userModeSlot()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "stateChangedSlot(int,int)";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    slot_tbl[2].name = "heatStateChangedSlot(int,int)";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Public;
+    slot_tbl[3].name = "ccNoConnection()";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Public;
+    slot_tbl[4].name = "reconnectCCTimeout()";
+    slot_tbl[4].ptr = (QMember)ov1_4;
+    slot_tbl_access[4] = QMetaData::Public;
+    slot_tbl[5].name = "moveManuallySlot()";
+    slot_tbl[5].ptr = (QMember)ov1_5;
+    slot_tbl_access[5] = QMetaData::Public;
+    slot_tbl[6].name = "centerAllSlot()";
+    slot_tbl[6].ptr = (QMember)ov1_6;
+    slot_tbl_access[6] = QMetaData::Public;
+    slot_tbl[7].name = "calibrateSlot()";
+    slot_tbl[7].ptr = (QMember)ov1_7;
+    slot_tbl_access[7] = QMetaData::Public;
+    slot_tbl[8].name = "adjustSlot()";
+    slot_tbl[8].ptr = (QMember)ov1_8;
+    slot_tbl_access[8] = QMetaData::Public;
+    slot_tbl[9].name = "autoFocusSlot(bool)";
+    slot_tbl[9].ptr = (QMember)ov1_9;
+    slot_tbl_access[9] = QMetaData::Public;
+    slot_tbl[10].name = "cmdConnected()";
+    slot_tbl[10].ptr = (QMember)ov1_10;
+    slot_tbl_access[10] = QMetaData::Private;
+    slot_tbl[11].name = "cmdDisconnected()";
+    slot_tbl[11].ptr = (QMember)ov1_11;
+    slot_tbl_access[11] = QMetaData::Private;
+    slot_tbl[12].name = "cmdReceived(QString)";
+    slot_tbl[12].ptr = (QMember)ov1_12;
+    slot_tbl_access[12] = QMetaData::Private;
+    slot_tbl[13].name = "ccReportReceived(QString)";
+    slot_tbl[13].ptr = (QMember)ov1_13;
+    slot_tbl_access[13] = QMetaData::Private;
+    slot_tbl[14].name = "ccReportConnection()";
+    slot_tbl[14].ptr = (QMember)ov1_14;
+    slot_tbl_access[14] = QMetaData::Private;
+    slot_tbl[15].name = "logMessage(QString)";
+    slot_tbl[15].ptr = (QMember)ov1_15;
+    slot_tbl_access[15] = QMetaData::Private;
+    slot_tbl[16].name = "reportDelivered(QDateTime&,QString&)";
+    slot_tbl[16].ptr = (QMember)ov1_16;
+    slot_tbl_access[16] = QMetaData::Private;
+    slot_tbl[17].name = "laserAdjustSlot()";
+    slot_tbl[17].ptr = (QMember)ov1_17;
+    slot_tbl_access[17] = QMetaData::Private;
+    slot_tbl[18].name = "errorTestSlot()";
+    slot_tbl[18].ptr = (QMember)ov1_18;
+    slot_tbl_access[18] = QMetaData::Private;
+    metaObj = QMetaObject::new_metaobject(
+	"ActiveMirrorControl", "ActiveMirrorControlBase",
+	slot_tbl, 19,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol_meta_unload.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol_meta_unload.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrol_meta_unload.cpp	(revision 3401)
@@ -0,0 +1,26 @@
+static const char * _metalist_activemirrorcontrol[] = {
+"AMCCmdServerSocket",
+"AMCFrameGrabber",
+"AMCProgDlg",
+"AMCProgDlgBase",
+"AMCPushButton",
+"AMCReportSocket",
+"AMCState",
+"ActiveMirrorControl",
+"ActiveMirrorControlBase",
+"AdjustMirrorDlg",
+"AdjustMirrorDlgBase",
+"CalibrateLaserMovementDialog",
+"CalibrateLaserMovementDialogBase",
+"CalibratePanelDialog",
+"CalibratePanelDialogBase",
+"HEATState",
+"MirrorSelector",
+"MotorThreadDialog",
+"MotorThreadDlgBase",
+"VideoDisplay",
+"VideoDisplayBase",
+"VideoFrame",
+0};
+#include <kunload.h>
+_UNLOAD(activemirrorcontrol)
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.cpp	(revision 3401)
@@ -0,0 +1,455 @@
+#include <klocale.h>
+/****************************************************************************
+** Form implementation generated from reading ui file './activemirrorcontrolbase.ui'
+**
+** Created: Fri Feb 6 20:23:07 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "activemirrorcontrolbase.h"
+
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qframe.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlcdnumber.h>
+#include <qlineedit.h>
+#include <qmultilineedit.h>
+#include <qpushbutton.h>
+#include <qspinbox.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/* 
+ *  Constructs a ActiveMirrorControlBase which is a child of 'parent', with the 
+ *  name 'name' and widget flags set to 'f' 
+ *
+ *  The dialog will by default be modeless, unless you set 'modal' to
+ *  TRUE to construct a modal dialog.
+ */
+ActiveMirrorControlBase::ActiveMirrorControlBase( QWidget* parent,  const char* name, bool modal, WFlags fl )
+    : QDialog( parent, name, modal, fl )
+{
+    if ( !name )
+	setName( "ActiveMirrorControlBase" );
+    resize( 638, 587 ); 
+    setCaption( i18n( "AMC" ) );
+    ActiveMirrorControlBaseLayout = new QGridLayout( this ); 
+    ActiveMirrorControlBaseLayout->setSpacing( 6 );
+    ActiveMirrorControlBaseLayout->setMargin( 11 );
+
+    ActionGroup = new QButtonGroup( this, "ActionGroup" );
+    ActionGroup->setTitle( i18n( "Actions" ) );
+    ActionGroup->setColumnLayout(0, Qt::Vertical );
+    ActionGroup->layout()->setSpacing( 0 );
+    ActionGroup->layout()->setMargin( 0 );
+    ActionGroupLayout = new QVBoxLayout( ActionGroup->layout() );
+    ActionGroupLayout->setAlignment( Qt::AlignTop );
+    ActionGroupLayout->setSpacing( 6 );
+    ActionGroupLayout->setMargin( 11 );
+
+    ModeButton = new QPushButton( ActionGroup, "ModeButton" );
+    ModeButton->setText( i18n( "Go to user mode" ) );
+    ModeButton->setToggleButton( FALSE );
+    ModeButton->setToggleButton( FALSE );
+    ActionGroupLayout->addWidget( ModeButton );
+
+    ManualButton = new QPushButton( ActionGroup, "ManualButton" );
+    ManualButton->setEnabled( FALSE );
+    ManualButton->setText( i18n( "Move manualy" ) );
+    ManualButton->setOn( FALSE );
+    ManualButton->setOn( FALSE );
+    ActionGroupLayout->addWidget( ManualButton );
+
+    AdjustButton = new QPushButton( ActionGroup, "AdjustButton" );
+    AdjustButton->setEnabled( FALSE );
+    AdjustButton->setText( i18n( "Adjust" ) );
+    ActionGroupLayout->addWidget( AdjustButton );
+
+    LaserAdjustButton = new QPushButton( ActionGroup, "LaserAdjustButton" );
+    LaserAdjustButton->setEnabled( FALSE );
+    LaserAdjustButton->setText( i18n( "Laser Adjust" ) );
+    ActionGroupLayout->addWidget( LaserAdjustButton );
+
+    CenterAllButton = new QPushButton( ActionGroup, "CenterAllButton" );
+    CenterAllButton->setEnabled( FALSE );
+    CenterAllButton->setText( i18n( "Initialize AMC (Roque Lamp)" ) );
+    ActionGroupLayout->addWidget( CenterAllButton );
+
+    CalButton = new QPushButton( ActionGroup, "CalButton" );
+    CalButton->setEnabled( FALSE );
+    CalButton->setText( i18n( "Calibrate" ) );
+    ActionGroupLayout->addWidget( CalButton );
+
+    AutoFocusBox = new QCheckBox( ActionGroup, "AutoFocusBox" );
+    AutoFocusBox->setText( i18n( "Autofocus" ) );
+    ActionGroupLayout->addWidget( AutoFocusBox );
+
+    ActiveMirrorControlBaseLayout->addWidget( ActionGroup, 0, 3 );
+    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    ActiveMirrorControlBaseLayout->addItem( spacer, 0, 2 );
+
+    Frame3 = new QFrame( this, "Frame3" );
+    Frame3->setFrameShape( QFrame::NoFrame );
+    Frame3->setFrameShadow( QFrame::Raised );
+    Frame3->setLineWidth( 0 );
+    Frame3Layout = new QHBoxLayout( Frame3 ); 
+    Frame3Layout->setSpacing( 6 );
+    Frame3Layout->setMargin( 11 );
+
+    LoopsSpinBox = new QSpinBox( Frame3, "LoopsSpinBox" );
+    LoopsSpinBox->setEnabled( FALSE );
+    LoopsSpinBox->setMaxValue( 500 );
+    LoopsSpinBox->setMinValue( 50 );
+    LoopsSpinBox->setLineStep( 50 );
+    LoopsSpinBox->setValue( 50 );
+    Frame3Layout->addWidget( LoopsSpinBox );
+
+    ErrorTestButton = new QPushButton( Frame3, "ErrorTestButton" );
+    ErrorTestButton->setEnabled( FALSE );
+    ErrorTestButton->setText( i18n( "ErrorTest" ) );
+    Frame3Layout->addWidget( ErrorTestButton );
+    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Frame3Layout->addItem( spacer_2 );
+
+    exitButton = new QPushButton( Frame3, "exitButton" );
+    exitButton->setText( i18n( "&Exit" ) );
+    exitButton->setDefault( FALSE );
+    Frame3Layout->addWidget( exitButton );
+
+    ActiveMirrorControlBaseLayout->addMultiCellWidget( Frame3, 2, 2, 0, 3 );
+
+    InfoField = new QMultiLineEdit( this, "InfoField" );
+    QPalette pal;
+    QColorGroup cg;
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 237, 237, 237) );
+    cg.setColor( QColorGroup::Dark, QColor( 110, 110, 110) );
+    cg.setColor( QColorGroup::Mid, QColor( 146, 146, 146) );
+    cg.setColor( QColorGroup::Text, QColor( 255, 255, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 84, 112, 152) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setActive( cg );
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 253, 253, 253) );
+    cg.setColor( QColorGroup::Dark, QColor( 110, 110, 110) );
+    cg.setColor( QColorGroup::Mid, QColor( 146, 146, 146) );
+    cg.setColor( QColorGroup::Text, QColor( 255, 255, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 84, 112, 152) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setInactive( cg );
+    cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Button, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 253, 253, 253) );
+    cg.setColor( QColorGroup::Dark, QColor( 110, 110, 110) );
+    cg.setColor( QColorGroup::Mid, QColor( 146, 146, 146) );
+    cg.setColor( QColorGroup::Text, QColor( 255, 255, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 84, 112, 152) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setDisabled( cg );
+    InfoField->setPalette( pal );
+
+    ActiveMirrorControlBaseLayout->addMultiCellWidget( InfoField, 1, 1, 0, 3 );
+
+    PositionGroup = new QGroupBox( this, "PositionGroup" );
+    PositionGroup->setTitle( i18n( "Pointing Info" ) );
+    PositionGroup->setColumnLayout(0, Qt::Vertical );
+    PositionGroup->layout()->setSpacing( 0 );
+    PositionGroup->layout()->setMargin( 0 );
+    PositionGroupLayout = new QGridLayout( PositionGroup->layout() );
+    PositionGroupLayout->setAlignment( Qt::AlignTop );
+    PositionGroupLayout->setSpacing( 6 );
+    PositionGroupLayout->setMargin( 11 );
+
+    TablePointing = new QGroupBox( PositionGroup, "TablePointing" );
+    TablePointing->setEnabled( TRUE );
+    TablePointing->setTitle( i18n( "LUT pointing" ) );
+    TablePointing->setColumnLayout(0, Qt::Vertical );
+    TablePointing->layout()->setSpacing( 0 );
+    TablePointing->layout()->setMargin( 0 );
+    TablePointingLayout = new QGridLayout( TablePointing->layout() );
+    TablePointingLayout->setAlignment( Qt::AlignTop );
+    TablePointingLayout->setSpacing( 6 );
+    TablePointingLayout->setMargin( 11 );
+
+    LUTAlt = new QLineEdit( TablePointing, "LUTAlt" );
+    LUTAlt->setEnabled( FALSE );
+    LUTAlt->setMaximumSize( QSize( 50, 32767 ) );
+    LUTAlt->setMaxLength( 3 );
+    LUTAlt->setEdited( FALSE );
+
+    TablePointingLayout->addWidget( LUTAlt, 0, 1 );
+
+    TextLabel3_2_2 = new QLabel( TablePointing, "TextLabel3_2_2" );
+    TextLabel3_2_2->setText( i18n( "Az.:" ) );
+
+    TablePointingLayout->addWidget( TextLabel3_2_2, 1, 0 );
+
+    TextLabel3_3 = new QLabel( TablePointing, "TextLabel3_3" );
+    TextLabel3_3->setText( i18n( "Zd.:" ) );
+
+    TablePointingLayout->addWidget( TextLabel3_3, 0, 0 );
+
+    LUTAz = new QLineEdit( TablePointing, "LUTAz" );
+    LUTAz->setEnabled( FALSE );
+    LUTAz->setMaximumSize( QSize( 50, 32767 ) );
+    LUTAz->setMaxLength( 3 );
+    LUTAz->setEdited( FALSE );
+
+    TablePointingLayout->addWidget( LUTAz, 1, 1 );
+
+    PositionGroupLayout->addWidget( TablePointing, 1, 0 );
+
+    ActualPointing = new QGroupBox( PositionGroup, "ActualPointing" );
+    ActualPointing->setTitle( i18n( "Actual pointing" ) );
+    ActualPointing->setColumnLayout(0, Qt::Vertical );
+    ActualPointing->layout()->setSpacing( 0 );
+    ActualPointing->layout()->setMargin( 0 );
+    ActualPointingLayout = new QGridLayout( ActualPointing->layout() );
+    ActualPointingLayout->setAlignment( Qt::AlignTop );
+    ActualPointingLayout->setSpacing( 6 );
+    ActualPointingLayout->setMargin( 11 );
+
+    ActualAlt = new QLineEdit( ActualPointing, "ActualAlt" );
+    ActualAlt->setEnabled( TRUE );
+    ActualAlt->setMaximumSize( QSize( 50, 32767 ) );
+    ActualAlt->setMaxLength( 6 );
+    ActualAlt->setEdited( FALSE );
+
+    ActualPointingLayout->addWidget( ActualAlt, 0, 1 );
+
+    TextLabel3_2 = new QLabel( ActualPointing, "TextLabel3_2" );
+    TextLabel3_2->setText( i18n( "Az.:" ) );
+
+    ActualPointingLayout->addWidget( TextLabel3_2, 1, 0 );
+
+    TextLabel3 = new QLabel( ActualPointing, "TextLabel3" );
+    TextLabel3->setText( i18n( "Zd.:" ) );
+
+    ActualPointingLayout->addWidget( TextLabel3, 0, 0 );
+
+    ActualAz = new QLineEdit( ActualPointing, "ActualAz" );
+    ActualAz->setEnabled( TRUE );
+    ActualAz->setMaximumSize( QSize( 50, 32767 ) );
+    ActualAz->setMaxLength( 6 );
+    ActualAz->setEdited( FALSE );
+
+    ActualPointingLayout->addWidget( ActualAz, 1, 1 );
+
+    PositionGroupLayout->addWidget( ActualPointing, 0, 0 );
+
+    ActiveMirrorControlBaseLayout->addWidget( PositionGroup, 0, 1 );
+
+    StateBox = new QGroupBox( this, "StateBox" );
+    StateBox->setTitle( i18n( "State" ) );
+    StateBox->setColumnLayout(0, Qt::Vertical );
+    StateBox->layout()->setSpacing( 0 );
+    StateBox->layout()->setMargin( 0 );
+    StateBoxLayout = new QGridLayout( StateBox->layout() );
+    StateBoxLayout->setAlignment( Qt::AlignTop );
+    StateBoxLayout->setSpacing( 6 );
+    StateBoxLayout->setMargin( 11 );
+
+    TextLabel1 = new QLabel( StateBox, "TextLabel1" );
+    QFont TextLabel1_font(  TextLabel1->font() );
+    TextLabel1_font.setFamily( "adobe-helvetica" );
+    TextLabel1_font.setPointSize( 14 );
+    TextLabel1->setFont( TextLabel1_font ); 
+    TextLabel1->setText( i18n( "State" ) );
+
+    StateBoxLayout->addWidget( TextLabel1, 0, 0 );
+
+    StateLabel = new QLabel( StateBox, "StateLabel" );
+    StateLabel->setText( i18n( "AMC is not available" ) );
+
+    StateBoxLayout->addMultiCellWidget( StateLabel, 1, 1, 0, 2 );
+
+    TextLabel1_2 = new QLabel( StateBox, "TextLabel1_2" );
+    QFont TextLabel1_2_font(  TextLabel1_2->font() );
+    TextLabel1_2_font.setFamily( "adobe-helvetica" );
+    TextLabel1_2_font.setPointSize( 14 );
+    TextLabel1_2->setFont( TextLabel1_2_font ); 
+    TextLabel1_2->setText( i18n( "Last Report" ) );
+
+    StateBoxLayout->addWidget( TextLabel1_2, 2, 0 );
+    QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    StateBoxLayout->addItem( spacer_3, 2, 1 );
+
+    CommandTime = new QLabel( StateBox, "CommandTime" );
+    CommandTime->setText( QString::null );
+
+    StateBoxLayout->addWidget( CommandTime, 4, 2 );
+    QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    StateBoxLayout->addItem( spacer_4, 4, 1 );
+
+    ReportLabel = new QLabel( StateBox, "ReportLabel" );
+    ReportLabel->setText( i18n( "Startup" ) );
+
+    StateBoxLayout->addMultiCellWidget( ReportLabel, 3, 3, 0, 2 );
+
+    CommandLabel = new QLabel( StateBox, "CommandLabel" );
+    CommandLabel->setText( i18n( "Global CC state" ) );
+
+    StateBoxLayout->addWidget( CommandLabel, 5, 0 );
+    QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    StateBoxLayout->addItem( spacer_5, 0, 1 );
+
+    StateLCD = new QLCDNumber( StateBox, "StateLCD" );
+    QFont StateLCD_font(  StateLCD->font() );
+    StateLCD_font.setFamily( "adobe-helvetica" );
+    StateLCD_font.setPointSize( 14 );
+    StateLCD->setFont( StateLCD_font ); 
+    StateLCD->setCursor( QCursor( 0 ) );
+    StateLCD->setNumDigits( 1 );
+    StateLCD->setSegmentStyle( QLCDNumber::Filled );
+    StateLCD->setProperty( "intValue", 9 );
+
+    StateBoxLayout->addWidget( StateLCD, 0, 2 );
+
+    CCStateLCD = new QLCDNumber( StateBox, "CCStateLCD" );
+    QFont CCStateLCD_font(  CCStateLCD->font() );
+    CCStateLCD_font.setFamily( "adobe-helvetica" );
+    CCStateLCD_font.setPointSize( 14 );
+    CCStateLCD->setFont( CCStateLCD_font ); 
+    CCStateLCD->setCursor( QCursor( 0 ) );
+    CCStateLCD->setNumDigits( 1 );
+    CCStateLCD->setSegmentStyle( QLCDNumber::Filled );
+    CCStateLCD->setProperty( "intValue", 9 );
+
+    StateBoxLayout->addWidget( CCStateLCD, 5, 2 );
+
+    TextLabel1_2_2 = new QLabel( StateBox, "TextLabel1_2_2" );
+    QFont TextLabel1_2_2_font(  TextLabel1_2_2->font() );
+    TextLabel1_2_2_font.setFamily( "adobe-helvetica" );
+    TextLabel1_2_2_font.setPointSize( 14 );
+    TextLabel1_2_2->setFont( TextLabel1_2_2_font ); 
+    TextLabel1_2_2->setText( i18n( "Last Command" ) );
+
+    StateBoxLayout->addWidget( TextLabel1_2_2, 4, 0 );
+    QSpacerItem* spacer_6 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    StateBoxLayout->addItem( spacer_6, 5, 1 );
+
+    ReportTime = new QLabel( StateBox, "ReportTime" );
+    ReportTime->setText( QString::null );
+
+    StateBoxLayout->addWidget( ReportTime, 2, 2 );
+
+    ActiveMirrorControlBaseLayout->addWidget( StateBox, 0, 0 );
+
+    // signals and slots connections
+    connect( exitButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
+    connect( ModeButton, SIGNAL( clicked() ), this, SLOT( userModeSlot() ) );
+    connect( ManualButton, SIGNAL( clicked() ), this, SLOT( moveManuallySlot() ) );
+    connect( CalButton, SIGNAL( clicked() ), this, SLOT( calibrateSlot() ) );
+    connect( CenterAllButton, SIGNAL( clicked() ), this, SLOT( centerAllSlot() ) );
+    connect( LaserAdjustButton, SIGNAL( clicked() ), this, SLOT( laserAdjustSlot() ) );
+    connect( ErrorTestButton, SIGNAL( clicked() ), this, SLOT( errorTestSlot() ) );
+    connect( AutoFocusBox, SIGNAL( toggled(bool) ), this, SLOT( autoFocusSlot( bool ) ) );
+    connect( AdjustButton, SIGNAL( clicked() ), this, SLOT( adjustSlot() ) );
+}
+
+/*  
+ *  Destroys the object and frees any allocated resources
+ */
+ActiveMirrorControlBase::~ActiveMirrorControlBase()
+{
+    // no need to delete child widgets, Qt does it all for us
+}
+
+/*  
+ *  Main event handler. Reimplemented to handle application
+ *  font changes
+ */
+bool ActiveMirrorControlBase::event( QEvent* ev )
+{
+    bool ret = QDialog::event( ev ); 
+    if ( ev->type() == QEvent::ApplicationFontChange ) {
+	QFont TextLabel1_font(  TextLabel1->font() );
+	TextLabel1_font.setFamily( "adobe-helvetica" );
+	TextLabel1_font.setPointSize( 14 );
+	TextLabel1->setFont( TextLabel1_font ); 
+	QFont TextLabel1_2_font(  TextLabel1_2->font() );
+	TextLabel1_2_font.setFamily( "adobe-helvetica" );
+	TextLabel1_2_font.setPointSize( 14 );
+	TextLabel1_2->setFont( TextLabel1_2_font ); 
+	QFont StateLCD_font(  StateLCD->font() );
+	StateLCD_font.setFamily( "adobe-helvetica" );
+	StateLCD_font.setPointSize( 14 );
+	StateLCD->setFont( StateLCD_font ); 
+	QFont CCStateLCD_font(  CCStateLCD->font() );
+	CCStateLCD_font.setFamily( "adobe-helvetica" );
+	CCStateLCD_font.setPointSize( 14 );
+	CCStateLCD->setFont( CCStateLCD_font ); 
+	QFont TextLabel1_2_2_font(  TextLabel1_2_2->font() );
+	TextLabel1_2_2_font.setFamily( "adobe-helvetica" );
+	TextLabel1_2_2_font.setPointSize( 14 );
+	TextLabel1_2_2->setFont( TextLabel1_2_2_font ); 
+    }
+    return ret;
+}
+
+void ActiveMirrorControlBase::autoFocusSlot( bool )
+{
+    qWarning( "ActiveMirrorControlBase::autoFocusSlot( bool ): Not implemented yet!" );
+}
+
+void ActiveMirrorControlBase::calibrateSlot()
+{
+    qWarning( "ActiveMirrorControlBase::calibrateSlot(): Not implemented yet!" );
+}
+
+void ActiveMirrorControlBase::centerAllSlot()
+{
+    qWarning( "ActiveMirrorControlBase::centerAllSlot(): Not implemented yet!" );
+}
+
+void ActiveMirrorControlBase::errorTestSlot()
+{
+    qWarning( "ActiveMirrorControlBase::errorTestSlot(): Not implemented yet!" );
+}
+
+void ActiveMirrorControlBase::laserAdjustSlot()
+{
+    qWarning( "ActiveMirrorControlBase::laserAdjustSlot(): Not implemented yet!" );
+}
+
+void ActiveMirrorControlBase::moveManuallySlot()
+{
+    qWarning( "ActiveMirrorControlBase::moveManuallySlot(): Not implemented yet!" );
+}
+
+void ActiveMirrorControlBase::adjustSlot()
+{
+    qWarning( "ActiveMirrorControlBase::adjustSlot(): Not implemented yet!" );
+}
+
+void ActiveMirrorControlBase::userModeSlot()
+{
+    qWarning( "ActiveMirrorControlBase::userModeSlot(): Not implemented yet!" );
+}
+
+#include "activemirrorcontrolbase.moc"
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.h	(revision 3401)
@@ -0,0 +1,93 @@
+/****************************************************************************
+** Form interface generated from reading ui file './activemirrorcontrolbase.ui'
+**
+** Created: Fri Feb 6 20:22:57 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ACTIVEMIRRORCONTROLBASE_H
+#define ACTIVEMIRRORCONTROLBASE_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+class QVBoxLayout; 
+class QHBoxLayout; 
+class QGridLayout; 
+class QButtonGroup;
+class QCheckBox;
+class QFrame;
+class QGroupBox;
+class QLCDNumber;
+class QLabel;
+class QLineEdit;
+class QMultiLineEdit;
+class QPushButton;
+class QSpinBox;
+
+class ActiveMirrorControlBase : public QDialog
+{ 
+    Q_OBJECT
+
+public:
+    ActiveMirrorControlBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+    ~ActiveMirrorControlBase();
+
+    QButtonGroup* ActionGroup;
+    QPushButton* ModeButton;
+    QPushButton* ManualButton;
+    QPushButton* AdjustButton;
+    QPushButton* LaserAdjustButton;
+    QPushButton* CenterAllButton;
+    QPushButton* CalButton;
+    QCheckBox* AutoFocusBox;
+    QFrame* Frame3;
+    QSpinBox* LoopsSpinBox;
+    QPushButton* ErrorTestButton;
+    QPushButton* exitButton;
+    QMultiLineEdit* InfoField;
+    QGroupBox* PositionGroup;
+    QGroupBox* TablePointing;
+    QLineEdit* LUTAlt;
+    QLabel* TextLabel3_2_2;
+    QLabel* TextLabel3_3;
+    QLineEdit* LUTAz;
+    QGroupBox* ActualPointing;
+    QLineEdit* ActualAlt;
+    QLabel* TextLabel3_2;
+    QLabel* TextLabel3;
+    QLineEdit* ActualAz;
+    QGroupBox* StateBox;
+    QLabel* TextLabel1;
+    QLabel* StateLabel;
+    QLabel* TextLabel1_2;
+    QLabel* CommandTime;
+    QLabel* ReportLabel;
+    QLabel* CommandLabel;
+    QLCDNumber* StateLCD;
+    QLCDNumber* CCStateLCD;
+    QLabel* TextLabel1_2_2;
+    QLabel* ReportTime;
+
+public slots:
+    virtual void autoFocusSlot( bool );
+    virtual void calibrateSlot();
+    virtual void centerAllSlot();
+    virtual void errorTestSlot();
+    virtual void laserAdjustSlot();
+    virtual void moveManuallySlot();
+    virtual void adjustSlot();
+    virtual void userModeSlot();
+
+protected:
+    QGridLayout* ActiveMirrorControlBaseLayout;
+    QVBoxLayout* ActionGroupLayout;
+    QHBoxLayout* Frame3Layout;
+    QGridLayout* PositionGroupLayout;
+    QGridLayout* TablePointingLayout;
+    QGridLayout* ActualPointingLayout;
+    QGridLayout* StateBoxLayout;
+    bool event( QEvent* );
+};
+
+#endif // ACTIVEMIRRORCONTROLBASE_H
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.moc
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.moc	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.moc	(revision 3401)
@@ -0,0 +1,130 @@
+/****************************************************************************
+** ActiveMirrorControlBase meta object code from reading C++ file 'activemirrorcontrolbase.h'
+**
+** Created: Fri Feb 6 20:23:07 2004
+**      by: The Qt MOC ($Id: activemirrorcontrolbase.moc,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "activemirrorcontrolbase.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *ActiveMirrorControlBase::className() const
+{
+    return "ActiveMirrorControlBase";
+}
+
+QMetaObject *ActiveMirrorControlBase::metaObj = 0;
+
+void ActiveMirrorControlBase::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QDialog::className(), "QDialog") != 0 )
+	badSuperclassWarning("ActiveMirrorControlBase","QDialog");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString ActiveMirrorControlBase::tr(const char* s)
+{
+    return qApp->translate( "ActiveMirrorControlBase", s, 0 );
+}
+
+QString ActiveMirrorControlBase::tr(const char* s, const char * c)
+{
+    return qApp->translate( "ActiveMirrorControlBase", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* ActiveMirrorControlBase::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QDialog::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (ActiveMirrorControlBase::*m1_t0)(bool);
+    typedef void (QObject::*om1_t0)(bool);
+    typedef void (ActiveMirrorControlBase::*m1_t1)();
+    typedef void (QObject::*om1_t1)();
+    typedef void (ActiveMirrorControlBase::*m1_t2)();
+    typedef void (QObject::*om1_t2)();
+    typedef void (ActiveMirrorControlBase::*m1_t3)();
+    typedef void (QObject::*om1_t3)();
+    typedef void (ActiveMirrorControlBase::*m1_t4)();
+    typedef void (QObject::*om1_t4)();
+    typedef void (ActiveMirrorControlBase::*m1_t5)();
+    typedef void (QObject::*om1_t5)();
+    typedef void (ActiveMirrorControlBase::*m1_t6)();
+    typedef void (QObject::*om1_t6)();
+    typedef void (ActiveMirrorControlBase::*m1_t7)();
+    typedef void (QObject::*om1_t7)();
+    m1_t0 v1_0 = &ActiveMirrorControlBase::autoFocusSlot;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &ActiveMirrorControlBase::calibrateSlot;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &ActiveMirrorControlBase::centerAllSlot;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &ActiveMirrorControlBase::errorTestSlot;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    m1_t4 v1_4 = &ActiveMirrorControlBase::laserAdjustSlot;
+    om1_t4 ov1_4 = (om1_t4)v1_4;
+    m1_t5 v1_5 = &ActiveMirrorControlBase::moveManuallySlot;
+    om1_t5 ov1_5 = (om1_t5)v1_5;
+    m1_t6 v1_6 = &ActiveMirrorControlBase::adjustSlot;
+    om1_t6 ov1_6 = (om1_t6)v1_6;
+    m1_t7 v1_7 = &ActiveMirrorControlBase::userModeSlot;
+    om1_t7 ov1_7 = (om1_t7)v1_7;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(8);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(8);
+    slot_tbl[0].name = "autoFocusSlot(bool)";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "calibrateSlot()";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    slot_tbl[2].name = "centerAllSlot()";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Public;
+    slot_tbl[3].name = "errorTestSlot()";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Public;
+    slot_tbl[4].name = "laserAdjustSlot()";
+    slot_tbl[4].ptr = (QMember)ov1_4;
+    slot_tbl_access[4] = QMetaData::Public;
+    slot_tbl[5].name = "moveManuallySlot()";
+    slot_tbl[5].ptr = (QMember)ov1_5;
+    slot_tbl_access[5] = QMetaData::Public;
+    slot_tbl[6].name = "adjustSlot()";
+    slot_tbl[6].ptr = (QMember)ov1_6;
+    slot_tbl_access[6] = QMetaData::Public;
+    slot_tbl[7].name = "userModeSlot()";
+    slot_tbl[7].ptr = (QMember)ov1_7;
+    slot_tbl_access[7] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"ActiveMirrorControlBase", "QDialog",
+	slot_tbl, 8,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.ui
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.ui	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/activemirrorcontrolbase.ui	(revision 3401)
@@ -0,0 +1,1082 @@
+<!DOCTYPE UI><UI>
+<class>ActiveMirrorControlBase</class>
+<widget>
+    <class>QDialog</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>ActiveMirrorControlBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>638</width>
+            <height>587</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>AMC</string>
+    </property>
+    <grid>
+        <property stdset="1">
+            <name>margin</name>
+            <number>11</number>
+        </property>
+        <property stdset="1">
+            <name>spacing</name>
+            <number>6</number>
+        </property>
+        <widget row="0"  column="3" >
+            <class>QButtonGroup</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>ActionGroup</cstring>
+            </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>Actions</string>
+            </property>
+            <vbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>11</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ModeButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Go to user mode</string>
+                    </property>
+                    <property stdset="1">
+                        <name>toggleButton</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>toggleButton</name>
+                        <bool>false</bool>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ManualButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Move manualy</string>
+                    </property>
+                    <property stdset="1">
+                        <name>on</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>on</name>
+                        <bool>false</bool>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>AdjustButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Adjust</string>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>LaserAdjustButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Laser Adjust</string>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>CenterAllButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Initialize AMC (Roque Lamp)</string>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>CalButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Calibrate</string>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QCheckBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>AutoFocusBox</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Autofocus</string>
+                    </property>
+                </widget>
+            </vbox>
+        </widget>
+        <spacer row="0"  column="2" >
+            <property>
+                <name>name</name>
+                <cstring>Spacer12</cstring>
+            </property>
+            <property stdset="1">
+                <name>orientation</name>
+                <enum>Horizontal</enum>
+            </property>
+            <property stdset="1">
+                <name>sizeType</name>
+                <enum>Expanding</enum>
+            </property>
+            <property>
+                <name>sizeHint</name>
+                <size>
+                    <width>20</width>
+                    <height>20</height>
+                </size>
+            </property>
+        </spacer>
+        <widget row="2"  column="0"  rowspan="1"  colspan="4" >
+            <class>QFrame</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Frame3</cstring>
+            </property>
+            <property stdset="1">
+                <name>frameShape</name>
+                <enum>NoFrame</enum>
+            </property>
+            <property stdset="1">
+                <name>frameShadow</name>
+                <enum>Raised</enum>
+            </property>
+            <property stdset="1">
+                <name>lineWidth</name>
+                <number>0</number>
+            </property>
+            <property>
+                <name>layoutMargin</name>
+            </property>
+            <property>
+                <name>layoutSpacing</name>
+            </property>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>11</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QSpinBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>LoopsSpinBox</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>maxValue</name>
+                        <number>500</number>
+                    </property>
+                    <property stdset="1">
+                        <name>minValue</name>
+                        <number>50</number>
+                    </property>
+                    <property stdset="1">
+                        <name>lineStep</name>
+                        <number>50</number>
+                    </property>
+                    <property stdset="1">
+                        <name>value</name>
+                        <number>50</number>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ErrorTestButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>ErrorTest</string>
+                    </property>
+                </widget>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer1</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>exitButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Exit</string>
+                    </property>
+                    <property stdset="1">
+                        <name>default</name>
+                        <bool>false</bool>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <widget row="1"  column="0"  rowspan="1"  colspan="4" >
+            <class>QMultiLineEdit</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>InfoField</cstring>
+            </property>
+            <property stdset="1">
+                <name>palette</name>
+                <palette>
+                    <active>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>220</red>
+                            <green>220</green>
+                            <blue>220</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                        <color>
+                            <red>237</red>
+                            <green>237</green>
+                            <blue>237</blue>
+                        </color>
+                        <color>
+                            <red>110</red>
+                            <green>110</green>
+                            <blue>110</blue>
+                        </color>
+                        <color>
+                            <red>146</red>
+                            <green>146</green>
+                            <blue>146</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>220</red>
+                            <green>220</green>
+                            <blue>220</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>84</red>
+                            <green>112</green>
+                            <blue>152</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                    </active>
+                    <disabled>
+                        <color>
+                            <red>128</red>
+                            <green>128</green>
+                            <blue>128</blue>
+                        </color>
+                        <color>
+                            <red>220</red>
+                            <green>220</green>
+                            <blue>220</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                        <color>
+                            <red>253</red>
+                            <green>253</green>
+                            <blue>253</blue>
+                        </color>
+                        <color>
+                            <red>110</red>
+                            <green>110</green>
+                            <blue>110</blue>
+                        </color>
+                        <color>
+                            <red>146</red>
+                            <green>146</green>
+                            <blue>146</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                        <color>
+                            <red>128</red>
+                            <green>128</green>
+                            <blue>128</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>220</red>
+                            <green>220</green>
+                            <blue>220</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>84</red>
+                            <green>112</green>
+                            <blue>152</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                    </disabled>
+                    <inactive>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>220</red>
+                            <green>220</green>
+                            <blue>220</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                        <color>
+                            <red>253</red>
+                            <green>253</green>
+                            <blue>253</blue>
+                        </color>
+                        <color>
+                            <red>110</red>
+                            <green>110</green>
+                            <blue>110</blue>
+                        </color>
+                        <color>
+                            <red>146</red>
+                            <green>146</green>
+                            <blue>146</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>220</red>
+                            <green>220</green>
+                            <blue>220</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>84</red>
+                            <green>112</green>
+                            <blue>152</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                    </inactive>
+                </palette>
+            </property>
+        </widget>
+        <widget row="0"  column="1" >
+            <class>QGroupBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>PositionGroup</cstring>
+            </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>Pointing Info</string>
+            </property>
+            <grid>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>11</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget row="1"  column="0" >
+                    <class>QGroupBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>TablePointing</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>true</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>title</name>
+                        <string>LUT pointing</string>
+                    </property>
+                    <grid>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>11</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget row="0"  column="1" >
+                            <class>QLineEdit</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>LUTAlt</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>enabled</name>
+                                <bool>false</bool>
+                            </property>
+                            <property stdset="1">
+                                <name>maximumSize</name>
+                                <size>
+                                    <width>50</width>
+                                    <height>32767</height>
+                                </size>
+                            </property>
+                            <property stdset="1">
+                                <name>maxLength</name>
+                                <number>3</number>
+                            </property>
+                            <property stdset="1">
+                                <name>edited</name>
+                                <bool>false</bool>
+                            </property>
+                        </widget>
+                        <widget row="1"  column="0" >
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>TextLabel3_2_2</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Az.:</string>
+                            </property>
+                        </widget>
+                        <widget row="0"  column="0" >
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>TextLabel3_3</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Zd.:</string>
+                            </property>
+                        </widget>
+                        <widget row="1"  column="1" >
+                            <class>QLineEdit</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>LUTAz</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>enabled</name>
+                                <bool>false</bool>
+                            </property>
+                            <property stdset="1">
+                                <name>maximumSize</name>
+                                <size>
+                                    <width>50</width>
+                                    <height>32767</height>
+                                </size>
+                            </property>
+                            <property stdset="1">
+                                <name>maxLength</name>
+                                <number>3</number>
+                            </property>
+                            <property stdset="1">
+                                <name>edited</name>
+                                <bool>false</bool>
+                            </property>
+                        </widget>
+                    </grid>
+                </widget>
+                <widget row="0"  column="0" >
+                    <class>QGroupBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ActualPointing</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>title</name>
+                        <string>Actual pointing</string>
+                    </property>
+                    <grid>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>11</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget row="0"  column="1" >
+                            <class>QLineEdit</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>ActualAlt</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>enabled</name>
+                                <bool>true</bool>
+                            </property>
+                            <property stdset="1">
+                                <name>maximumSize</name>
+                                <size>
+                                    <width>50</width>
+                                    <height>32767</height>
+                                </size>
+                            </property>
+                            <property stdset="1">
+                                <name>maxLength</name>
+                                <number>6</number>
+                            </property>
+                            <property stdset="1">
+                                <name>edited</name>
+                                <bool>false</bool>
+                            </property>
+                        </widget>
+                        <widget row="1"  column="0" >
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>TextLabel3_2</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Az.:</string>
+                            </property>
+                        </widget>
+                        <widget row="0"  column="0" >
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>TextLabel3</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Zd.:</string>
+                            </property>
+                        </widget>
+                        <widget row="1"  column="1" >
+                            <class>QLineEdit</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>ActualAz</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>enabled</name>
+                                <bool>true</bool>
+                            </property>
+                            <property stdset="1">
+                                <name>maximumSize</name>
+                                <size>
+                                    <width>50</width>
+                                    <height>32767</height>
+                                </size>
+                            </property>
+                            <property stdset="1">
+                                <name>maxLength</name>
+                                <number>6</number>
+                            </property>
+                            <property stdset="1">
+                                <name>edited</name>
+                                <bool>false</bool>
+                            </property>
+                        </widget>
+                    </grid>
+                </widget>
+            </grid>
+        </widget>
+        <widget row="0"  column="0" >
+            <class>QGroupBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>StateBox</cstring>
+            </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>State</string>
+            </property>
+            <grid>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>11</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget row="0"  column="0" >
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>TextLabel1</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>font</name>
+                        <font>
+                            <family>adobe-helvetica</family>
+                            <pointsize>14</pointsize>
+                        </font>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>State</string>
+                    </property>
+                </widget>
+                <widget row="1"  column="0"  rowspan="1"  colspan="3" >
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>StateLabel</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>AMC is not available</string>
+                    </property>
+                </widget>
+                <widget row="2"  column="0" >
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>TextLabel1_2</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>font</name>
+                        <font>
+                            <family>adobe-helvetica</family>
+                            <pointsize>14</pointsize>
+                        </font>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Last Report</string>
+                    </property>
+                </widget>
+                <spacer row="2"  column="1" >
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer6</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget row="4"  column="2" >
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>CommandTime</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string></string>
+                    </property>
+                </widget>
+                <spacer row="4"  column="1" >
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer6_2</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget row="3"  column="0"  rowspan="1"  colspan="3" >
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ReportLabel</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Startup</string>
+                    </property>
+                </widget>
+                <widget row="5"  column="0" >
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>CommandLabel</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Global CC state</string>
+                    </property>
+                </widget>
+                <spacer row="0"  column="1" >
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer4</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget row="0"  column="2" >
+                    <class>QLCDNumber</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>StateLCD</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>font</name>
+                        <font>
+                            <family>adobe-helvetica</family>
+                            <pointsize>14</pointsize>
+                        </font>
+                    </property>
+                    <property stdset="1">
+                        <name>cursor</name>
+                        <cursor>0</cursor>
+                    </property>
+                    <property stdset="1">
+                        <name>numDigits</name>
+                        <number>1</number>
+                    </property>
+                    <property stdset="1">
+                        <name>segmentStyle</name>
+                        <enum>Filled</enum>
+                    </property>
+                    <property>
+                        <name>intValue</name>
+                        <number>9</number>
+                    </property>
+                </widget>
+                <widget row="5"  column="2" >
+                    <class>QLCDNumber</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>CCStateLCD</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>font</name>
+                        <font>
+                            <family>adobe-helvetica</family>
+                            <pointsize>14</pointsize>
+                        </font>
+                    </property>
+                    <property stdset="1">
+                        <name>cursor</name>
+                        <cursor>0</cursor>
+                    </property>
+                    <property stdset="1">
+                        <name>numDigits</name>
+                        <number>1</number>
+                    </property>
+                    <property stdset="1">
+                        <name>segmentStyle</name>
+                        <enum>Filled</enum>
+                    </property>
+                    <property>
+                        <name>intValue</name>
+                        <number>9</number>
+                    </property>
+                </widget>
+                <widget row="4"  column="0" >
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>TextLabel1_2_2</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>font</name>
+                        <font>
+                            <family>adobe-helvetica</family>
+                            <pointsize>14</pointsize>
+                        </font>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Last Command</string>
+                    </property>
+                </widget>
+                <spacer row="5"  column="1" >
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer4_2</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget row="2"  column="2" >
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ReportTime</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string></string>
+                    </property>
+                </widget>
+            </grid>
+        </widget>
+    </grid>
+</widget>
+<connections>
+    <connection>
+        <sender>exitButton</sender>
+        <signal>clicked()</signal>
+        <receiver>ActiveMirrorControlBase</receiver>
+        <slot>accept()</slot>
+    </connection>
+    <connection>
+        <sender>ModeButton</sender>
+        <signal>clicked()</signal>
+        <receiver>ActiveMirrorControlBase</receiver>
+        <slot>userModeSlot()</slot>
+    </connection>
+    <connection>
+        <sender>ManualButton</sender>
+        <signal>clicked()</signal>
+        <receiver>ActiveMirrorControlBase</receiver>
+        <slot>moveManuallySlot()</slot>
+    </connection>
+    <connection>
+        <sender>CalButton</sender>
+        <signal>clicked()</signal>
+        <receiver>ActiveMirrorControlBase</receiver>
+        <slot>calibrateSlot()</slot>
+    </connection>
+    <connection>
+        <sender>CenterAllButton</sender>
+        <signal>clicked()</signal>
+        <receiver>ActiveMirrorControlBase</receiver>
+        <slot>centerAllSlot()</slot>
+    </connection>
+    <connection>
+        <sender>LaserAdjustButton</sender>
+        <signal>clicked()</signal>
+        <receiver>ActiveMirrorControlBase</receiver>
+        <slot>laserAdjustSlot()</slot>
+    </connection>
+    <connection>
+        <sender>ErrorTestButton</sender>
+        <signal>clicked()</signal>
+        <receiver>ActiveMirrorControlBase</receiver>
+        <slot>errorTestSlot()</slot>
+    </connection>
+    <connection>
+        <sender>AutoFocusBox</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>ActiveMirrorControlBase</receiver>
+        <slot>autoFocusSlot( bool )</slot>
+    </connection>
+    <connection>
+        <sender>AdjustButton</sender>
+        <signal>clicked()</signal>
+        <receiver>ActiveMirrorControlBase</receiver>
+        <slot>adjustSlot()</slot>
+    </connection>
+    <slot access="public">autoFocusSlot( bool )</slot>
+    <slot access="public">calibrateSlot()</slot>
+    <slot access="public">centerAllSlot()</slot>
+    <slot access="public">errorTestSlot()</slot>
+    <slot access="public">laserAdjustSlot()</slot>
+    <slot access="public">moveManuallySlot()</slot>
+    <slot access="public">adjustSlot()</slot>
+    <slot access="public">userModeSlot()</slot>
+</connections>
+</UI>
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlg.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlg.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlg.cpp	(revision 3401)
@@ -0,0 +1,526 @@
+/***************************************************************************
+                          adjustmirrordlg.cpp  -  description
+                             -------------------
+    begin                : Sat Nov 23 08:23:53 UTC 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#include <qlayout.h>
+#include <qmessagebox.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+#include <qpopupmenu.h>
+#include <qlabel.h>
+#include <qvalidator.h>
+#include <kapp.h>
+#include "amcerror.h"
+#include "amcserialport.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcprogdlg.h"
+#include "adjustmirrordlg.h"
+#include "threadcontroller.h"
+#include "magicmirror.h"
+#include "videodisplay.h"
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern KApplication*	g_theApp;
+extern AMCSerialPort* g_pPort[];
+extern MagicMirror*		g_theMirror;
+
+AdjustMirrorDlg::AdjustMirrorDlg(QWidget *parent, const char *name, bool modal = FALSE)
+	: AdjustMirrorDlgBase(parent, name, modal)
+{
+	m_pMotor = 0;
+	m_pCurrentPanel = 0;
+	
+	// now we add the mirror selector to the dialog panel
+	m_mirrorWidget = new MirrorSelector( this, "Mirror Selector");
+	((QGridLayout*) this->layout())->addWidget( m_mirrorWidget,0,0 );
+	
+	QObject::connect( m_mirrorWidget, SIGNAL( panelSelectedSignal( AMCMirrorPanel* ) ),
+					  this, SLOT( mirrorSelectedSlot( AMCMirrorPanel* ) ) );
+	
+	// create the context menu.
+	m_contextMenu = new QPopupMenu();
+	m_contextMenu->insertItem( "Save positions", this, SLOT( savePositionsSlot() ) );
+
+  Frequency_Value->setValidator( new QIntValidator( 0, 2000, Frequency_Value ) );
+  Working_I_Value->setValidator( new QIntValidator( 0, 2000, Working_I_Value ) );
+  Holding_I_Value->setValidator( new QIntValidator( 0, 2000, Holding_I_Value ) );
+
+  X_Goto_Value->setValidator( new QIntValidator( -3000, 3000, X_Goto_Value ) );
+  Y_Goto_Value->setValidator( new QIntValidator( -3000, 3000, Y_Goto_Value ) );
+}
+
+AdjustMirrorDlg::~AdjustMirrorDlg()
+{
+//	delete m_mirrorWidget;
+}
+
+/** No descriptions */
+void AdjustMirrorDlg::mirrorSelectedSlot( AMCMirrorPanel* pPanel )
+{
+	if( !pPanel->isPowerOn() )
+	{
+		Motor_Power_Check->setChecked( false );
+		
+		QString str;
+   		int iRes = QMessageBox::warning( this,
+   										 "AMC Warning",
+										 "The motor power for this panel has previously been\n"
+										 "switched off. By selecting this driver the power will\n"
+										 "be switched on automatically!\n"
+										 "Do you want to proceed?",
+										 "Yes",
+										 "No" );
+		if( iRes == 1)
+		{
+			if(m_pMotor != 0 )
+			{
+				try
+				{
+					m_pMotor->unselectBox();
+				}
+				catch( AMCError& e )
+				{
+				}
+				delete m_pMotor;
+				m_pMotor = 0;
+			}
+			enableButtons( false );
+			Panel_Info->setTitle( "Panel" );
+			Device_Label->setText( "Device: -" );
+			Box_Label->setText( "Box: --" );
+			Driver_Label->setText( "Driver: -" );
+			return;
+		}
+		
+		pPanel->setPowerOn( true );
+		
+	}
+	m_pCurrentPanel = pPanel;
+	int iPort   = pPanel->port();
+	AMCSerialPort* pPort = g_pPort[ iPort-1 ];
+	
+	QString info;
+	Panel_Info->setTitle( info.sprintf( "Panel: %d,%d", pPanel->i(), pPanel->j() ) );
+	Device_Label->setText( info.sprintf( "Device: /dev/ttyS%d", pPanel->port()+3 ) );
+	Box_Label->setText( info.sprintf( "Box: %02d", pPanel->box() ) );
+	Driver_Label->setText( info.sprintf( "Driver: %d", pPanel->driver() ) );
+	
+	if(m_pMotor != 0 )
+	{
+		delete m_pMotor;
+	}
+		
+	m_pMotor = new AMCMotor( pPort );
+	try
+	{
+		m_pMotor->unselectBox();
+	}
+	catch( AMCError& e )
+	{
+	}
+	
+//	QString str;
+//   	QMessageBox::information( this,
+//   							  "AMC Info",
+//							  str.sprintf( "%d %d %d",
+//							  			   pPanel->port(),
+//							  			   pPanel->box(),
+//							  			   pPanel->driver() ),
+//							  QMessageBox::Ok | QMessageBox:: Default );
+	
+	try
+	{
+		enableButtons( true );
+		
+		int iBox = pPanel->box();
+		m_pMotor->selectBox( iBox );
+		
+		int iTemp, iHum, iPowerI, iPowerV, iSecondV, iLogicV;
+		m_pMotor->getInfo( &iTemp, &iHum, &iPowerI, &iPowerV, &iSecondV, &iLogicV);
+
+		// Convert ADC vaues to primary voltages or currents
+		double dTemp, dHum, dPowerI, dPowerV, dSecondV, dLogicV;
+		dTemp   =  ( ((double) iTemp) );
+		dPowerI =  ( ((double) iPowerI) );
+		dPowerV =  ( ((double) iPowerV) / 1024.0) * 2.56 * 103.0 / 3.0;
+		dSecondV = ( ((double) iSecondV) / 1024.0) * 2.56 * 103.0 / 3.0;
+		dLogicV =  ( ((double) iLogicV) / 1024.0) * 2.56 * 6.9 / 2.2;
+		
+		Temperature_Value->setText( QString::number( dTemp, 'f', 1 ) );
+		Humidity_Value->setText( QString::number( iHum ) );
+		Power_I_Value->setText( QString::number( dPowerI, 'f', 1 ) );
+		Power_V_Value->setText( QString::number( dPowerV, 'f', 1 ) );
+		Secondary_V_Value->setText( QString::number( dSecondV, 'f', 1 ) );
+		Logical_V_Value->setText( QString::number( dLogicV, 'f', 1 ) );
+		
+		int iDriver = pPanel->driver();
+		m_pMotor->selectDriver( iDriver );
+		
+		int iFrequency      = m_pMotor->getFrequency();
+		int iWorkingCurrent = m_pMotor->getWorkingCurrent();
+		int iHoldingCurrent = m_pMotor->getHoldingCurrent();
+		
+		Frequency_Value->setText( QString::number( iFrequency ) );
+		Working_I_Value->setText( QString::number( iWorkingCurrent ) );
+		Holding_I_Value->setText( QString::number( iHoldingCurrent ) );
+		
+		Laser_Check->setChecked( pPanel->isLaserOn() );
+		Motor_Power_Check->setChecked( pPanel->isPowerOn() );
+	}
+	catch( AMCError& e )
+	{
+		QString str;
+		QMessageBox::information( this,
+								  "AMCError",
+  							  	  e.getErrorText(),
+  							  	  QMessageBox::Ok | QMessageBox:: Default );
+		enableButtons( false );
+		delete m_pMotor;
+		m_pMotor = 0;
+		m_pCurrentPanel = 0;
+		qDebug(e.formatError(0));
+	}
+	
+	
+}
+
+/** No descriptions */
+void AdjustMirrorDlg::enableButtons( bool p_zEnable ) const
+{
+	Temperature_Value->setEnabled( p_zEnable );
+	Humidity_Value->setEnabled( p_zEnable );
+	Power_I_Value->setEnabled( p_zEnable );
+	Power_V_Value->setEnabled( p_zEnable );
+	Secondary_V_Value->setEnabled( p_zEnable );
+	Logical_V_Value->setEnabled( p_zEnable );
+	
+	Frequency_Value->setEnabled( p_zEnable );
+	Working_I_Value->setEnabled( p_zEnable );
+	Holding_I_Value->setEnabled( p_zEnable );
+	Set_Button->setEnabled( p_zEnable );
+	Laser_Check->setEnabled( p_zEnable );
+	Motor_Power_Check->setEnabled( p_zEnable );
+	
+	X_Inc_100_Button->setEnabled( p_zEnable );
+	X_Inc_10_Button->setEnabled( p_zEnable );
+	X_Goto_Value->setEnabled( p_zEnable );
+	X_Go_Button->setEnabled( p_zEnable );
+	X_Dec_10_Button->setEnabled( p_zEnable );
+	X_Dec_100_Button->setEnabled( p_zEnable );
+	
+	Y_Inc_100_Button->setEnabled( p_zEnable );
+	Y_Inc_10_Button->setEnabled( p_zEnable );
+	Y_Goto_Value->setEnabled( p_zEnable );
+	Y_Go_Button->setEnabled( p_zEnable );
+	Y_Dec_10_Button->setEnabled( p_zEnable );
+	Y_Dec_100_Button->setEnabled( p_zEnable );
+		
+	if( p_zEnable )
+	{
+		int x = m_pCurrentPanel->getX();
+		int y = m_pCurrentPanel->getY();
+		
+		QString str;
+		X_Mot_Box->setTitle( str.sprintf("X=%d",x ) );
+		Y_Mot_Box->setTitle( str.sprintf("Y=%d",y ) );
+		X_Inc_100_Button->setEnabled( (x > 2400) ? false : true );
+		X_Inc_10_Button->setEnabled( (x > 2490) ? false : true );
+		X_Dec_10_Button->setEnabled( (x < -2490) ? false : true );
+		X_Dec_100_Button->setEnabled( (x < -2400) ? false : true );
+		
+		Y_Inc_100_Button->setEnabled( (y > 2400) ? false : true );
+		Y_Inc_10_Button->setEnabled( (y > 2490) ? false : true );
+		Y_Dec_10_Button->setEnabled( (y < -2490) ? false : true );
+		Y_Dec_100_Button->setEnabled( (y < -2400) ? false : true );
+
+	}
+	
+	Center_Button->setEnabled( p_zEnable );
+	VideoButton->setEnabled( p_zEnable );
+}
+
+/** Switch the laser on. */
+void AdjustMirrorDlg::switchLaserSlot( bool p_zOn )
+{
+  if( p_zOn )
+		qDebug("Switching LASER on for Panel %p", m_pMotor);
+	else
+		qDebug("Switching LASER off for Panel %p", m_pMotor);
+	try
+	{
+		m_pMotor->switchLaser( p_zOn );
+		m_pCurrentPanel->setLaserOn( p_zOn );
+	}
+	catch( AMCError& e )
+	{
+		QMessageBox::information( this,
+								  "AMCError",
+  							  	  e.getErrorText(),
+  							  	  QMessageBox::Ok | QMessageBox:: Default );
+		enableButtons( false );
+		delete m_pMotor;
+		m_pMotor = 0;
+		m_pCurrentPanel = 0;
+	}
+		
+}
+
+/** Power motors on or off. */
+void AdjustMirrorDlg::powerMotorsSlot()
+{
+
+	if ( m_pCurrentPanel->isPowerOn( ) )
+	{
+  		int iRes = QMessageBox::warning( this,
+  										 "AMC Warning",
+  										 "Turning the motor power of will also stop the holding\n"
+  										 "current. You should only do this in case of problems\n"
+  										 "with this driver!\n"
+  										 "Selecting a movement command or the driver will automatically\n"
+  										 "switch the power back on. Do you wish to proceed?",
+  										 "Yes",
+  										 "No" );
+		if( iRes == 1)
+		{
+			m_pCurrentPanel->setPowerOn( true );	
+			return;
+		}
+	}
+	
+	bool zOn = !m_pCurrentPanel->isPowerOn( );
+	try
+	{
+		m_pMotor->powerMotors( zOn );
+		m_pCurrentPanel->setPowerOn( zOn );
+	}
+	catch( AMCError& e )
+	{
+		QMessageBox::information( this,
+								  "AMCError",
+  							  	  e.getErrorText(),
+  							  	  QMessageBox::Ok | QMessageBox:: Default );
+		enableButtons( false );
+		delete m_pMotor;
+		m_pMotor = 0;
+		m_pCurrentPanel = 0;
+	}
+}
+
+/** Power motors on or off. */
+void AdjustMirrorDlg::setParamsSlot()
+{
+  bool zOk;
+	int iFrequency = Frequency_Value->text().toInt( &zOk );
+	int iWorkingI = Working_I_Value->text().toInt( &zOk );
+	int iHoldingI = Holding_I_Value->text().toInt( &zOk );
+	try
+	{
+		m_pMotor->setFrequency( iFrequency );
+		m_pMotor->setWorkingCurrent( iWorkingI );
+		m_pMotor->setHoldingCurrent( iHoldingI );
+	}
+	catch( AMCError& e )
+	{
+		QMessageBox::information( this,
+								  "AMCError",
+  							  	  e.getErrorText(),
+  							  	  QMessageBox::Ok | QMessageBox:: Default );
+		enableButtons( false );
+		delete m_pMotor;
+		m_pMotor = 0;
+		m_pCurrentPanel = 0;
+	}
+}
+
+/** Center the motors. */
+void AdjustMirrorDlg::centerSlot()
+{
+//	Motor_Power_Check->setChecked( false );
+	enableButtons( false );
+//	g_theApp->processEvents();
+	try
+	{
+		m_pMotor->centerMotors();
+		m_pMotor->waitForMotors( m_pMotor->calcTimeout( 17000 )+2 );
+	}
+	catch( AMCError& e )
+	{
+		QMessageBox::information( this,
+								  "AMCError",
+  							  	  e.getErrorText(),
+  							  	  QMessageBox::Ok | QMessageBox:: Default );
+		enableButtons( false );
+		delete m_pMotor;
+		m_pMotor = 0;
+		m_pCurrentPanel = 0;
+		return;
+	}
+	m_pCurrentPanel->setX( 0 );
+	m_pCurrentPanel->setY( 0 );
+	enableButtons( true );
+}
+
+/** Goto the position given by X. */
+void AdjustMirrorDlg::goXSlot()
+{
+  bool zOk;
+	int iX = X_Goto_Value->text().toInt( &zOk );
+	moveMotors( iX - m_pCurrentPanel->getX(), 0 );
+}
+
+/** Goto the position given by Y. */
+void AdjustMirrorDlg::goYSlot()
+{
+  bool zOk;
+	int iY = Y_Goto_Value->text().toInt( &zOk );
+	moveMotors( 0, iY - m_pCurrentPanel->getY() );
+}
+
+/** Move motors relative by the given amount of steps. */
+void AdjustMirrorDlg::moveMotors( int p_iX, int p_iY )
+{
+	if( (p_iX == 0) && (p_iY == 0) )
+		return;
+	Motor_Power_Check->setChecked( true );
+	
+	enableButtons( false );
+//	g_theApp->processEvents();
+	try
+	{
+		m_pMotor->moveMotors( p_iX, p_iY );
+		m_pMotor->waitForMotors( m_pMotor->calcTimeout( MAX( abs(p_iX), abs(p_iY) ) ) );			
+	
+		int x = m_pCurrentPanel->getX() + p_iX;
+		int y = m_pCurrentPanel->getY() + p_iY;
+		m_pCurrentPanel->setX( x );
+		m_pCurrentPanel->setY( y );
+	}
+	catch( AMCError& e )
+	{
+		QMessageBox::information( this,
+								  "AMCError",
+  							  	  e.formatError(),
+  							  	  QMessageBox::Ok | QMessageBox:: Default );
+		enableButtons( false );
+		m_pMotor->resetBox();
+		delete m_pMotor;
+		m_pMotor = 0;
+		m_pCurrentPanel = 0;
+		return;
+	}
+	
+	enableButtons( true );
+}
+
+/** No descriptions */
+void AdjustMirrorDlg::closeEvent( QCloseEvent* e )
+{
+	qDebug("AdjustMirrorDlg::closeEvent");
+	int iRes = QMessageBox::warning( this,
+							  "AMC Exiting",
+  							  "Save current mirror positions as defaults?",
+  							  "Save",
+  							  "Discard" );
+  if( iRes == 0)
+		g_theMirror->saveMirrorPanels();
+		
+	e->accept();
+}
+
+/** Save the positions to the file. */
+void AdjustMirrorDlg::savePositionsSlot()
+{
+	qDebug("AdjustMirrorDlg::savePositionsSlot");
+	g_theMirror->saveMirrorPanels();
+}
+
+/** Check to see if the right mouse button was pressed and
+	show the context menu in this case.
+  */
+void AdjustMirrorDlg::mousePressEvent( QMouseEvent* p_pEvent )
+{
+	if( p_pEvent->button() == RightButton )
+		m_contextMenu->exec( QCursor::pos() );
+}
+
+/** show / hide video.
+  */
+void AdjustMirrorDlg::videoSlot()
+{
+	enableButtons( false );
+	qDebug("Creating new Videodisplay() ");
+	VideoDisplay* pDlg = new VideoDisplay( this, "Video", true);
+	pDlg->setMotor( m_pMotor );
+	pDlg->setPanel( m_pCurrentPanel );
+	int iRet = pDlg->exec();
+	delete pDlg;
+	Laser_Check->setChecked( m_pCurrentPanel->isLaserOn() );
+	enableButtons( true );
+	qDebug("Returning from videoSlot() ");
+}
+
+/** No descriptions */
+void AdjustMirrorDlg::allLasersOnSlot()
+{
+	allLasersOnOff( QString("Switching all lasers on"), true);
+}
+
+/** No descriptions */
+void AdjustMirrorDlg::allLasersOffSlot()
+{
+	allLasersOnOff( QString("Switching all lasers off"), false);
+}
+
+/** No descriptions */
+void AdjustMirrorDlg::allLasersOnOff( QString p_qsMsg, bool p_zOn)
+{
+	AMCProgDlg* pDialog = new AMCProgDlg( LASER_THREAD_CTRL, this, p_qsMsg, true );
+	pDialog->setText( p_qsMsg );
+	pDialog->setBool( p_zOn );
+	pDialog->start();
+	pDialog->exec();
+	delete pDialog;
+
+	if( m_pCurrentPanel != 0 )
+	{
+		try
+		{
+			// reselect the currently selected panel
+			m_pMotor->unselectBox();
+			int iBox = m_pCurrentPanel->box();
+			m_pMotor->selectBox( iBox );
+			int iDriver = m_pCurrentPanel->driver();
+			m_pMotor->selectDriver( iDriver );
+		}
+		catch( AMCError& e )
+		{
+			QMessageBox::information( this,
+									  "AMCError",
+  						  	  e.formatError(),
+  						  	  QMessageBox::Ok | QMessageBox:: Default );
+			enableButtons( false );
+			delete m_pMotor;
+			m_pMotor = 0;
+			m_pCurrentPanel = 0;
+			return;
+		}
+		// We may need to togle the switch on the display of the laser status.
+		// Befor we do this we have to check if the laser is realy on or of.
+		Laser_Check->setChecked( m_pCurrentPanel->isLaserOn() );
+	}
+
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlg.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlg.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlg.h	(revision 3401)
@@ -0,0 +1,106 @@
+/***************************************************************************
+                          adjustmirrordlg.h  -  description
+                             -------------------
+    begin                : Sat Nov 23 08:23:53 UTC 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#ifndef ADJUSTMIRRORDLG_H
+#define ADJUSTMIRRORDLG_H
+
+//#ifdef HAVE_CONFIG_H
+//#include <config.h>
+//#endif
+
+#include <qwidget.h>
+#include "adjustmirrordlgbase.h"
+#include "mirrorselector.h"
+
+class AMCSerialPort;
+class AMCMotor;
+
+/** AdjustMirrorDlg is the base class of the porject */
+class AdjustMirrorDlg : public AdjustMirrorDlgBase
+{
+  Q_OBJECT 
+  public:
+    /** construtor */
+    AdjustMirrorDlg(QWidget* parent=0, const char *name=0, bool modal = FALSE);
+    /** destructor */
+    ~AdjustMirrorDlg();
+
+public: // Public attributes
+  /**  */
+  MirrorSelector* m_mirrorWidget;
+
+private: // Private attributes
+  /** pointer to the currently used motor class. */
+  AMCMotor* m_pMotor;
+  /** Internal variable to hold currently selected panel. */
+  AMCMirrorPanel* m_pCurrentPanel;
+  /** Context menu, shown when the user hits the right mouse button.  */
+  QPopupMenu* m_contextMenu;
+
+public slots: // Public slots
+  /** No descriptions */
+  virtual void mirrorSelectedSlot( AMCMirrorPanel* pPanel );
+  /** Move the X motor 10 steps forward. */
+  virtual void incX10Slot() { moveMotors( 10, 0 ); };
+  /** Move the X motor 100 steps forward. */
+  virtual void incX100Slot() { moveMotors( 100, 0 ); };
+  /** Move the X motor 10 steps downward. */
+  virtual void decX10Slot() { moveMotors( -10, 0 ); };
+  /** Move the X motor 100 steps downward. */
+  virtual void decX100Slot() { moveMotors( -100, 0 ); };
+  /** Move the Y motor 10 steps forward. */
+  virtual void incY10Slot() { moveMotors( 0, 10 ); };
+  /** Move the Y motor 100 steps forward. */
+  virtual void incY100Slot() { moveMotors( 0, 100 ); };
+  /** Move the Y motor 10 steps downward. */
+  virtual void decY10Slot() { moveMotors( 0, -10 ); };
+  /** Move the Y motor 100 steps downward. */
+  virtual void decY100Slot() { moveMotors( 0, -100 ); };
+  /** Center the motors. */
+  virtual void centerSlot();
+  /** Power motors on or off. */
+  virtual void powerMotorsSlot();
+  /** Switch the laser on. */
+  virtual void switchLaserSlot( bool p_zOn );
+  /** Set he motor parameters. */
+  virtual void setParamsSlot();
+  /** Goto the position given by X. */
+  virtual void goXSlot();
+  /** Goto the position given by Y. */
+  virtual void goYSlot();
+  /** No descriptions */
+  virtual void closeEvent( QCloseEvent* e );
+  /** Check to see if the right mouse button was pressed and show the context menu in this case. */
+  virtual void mousePressEvent( QMouseEvent* p_pEvent );
+  /** Move motors relative by the given amount of steps. */
+  virtual void moveMotors( int x, int y );
+  /** show / hide video. */
+  virtual void videoSlot();
+private: // Private methods
+  /** No descriptions */
+  void enableButtons( bool p_zEnable ) const;
+  /** No descriptions */
+	void allLasersOnOff( QString p_qsMsg, bool p_zOn);
+private slots: // Private slots
+  /** Save the positions to the file. */
+  void savePositionsSlot();
+public slots: // Public slots
+  /** No descriptions */
+  void allLasersOnSlot();
+  /** No descriptions */
+  void allLasersOffSlot();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlg.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlg.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlg.moc.cpp	(revision 3401)
@@ -0,0 +1,228 @@
+/****************************************************************************
+** AdjustMirrorDlg meta object code from reading C++ file 'adjustmirrordlg.h'
+**
+** Created: Thu Jan 29 00:51:53 2004
+**      by: The Qt MOC ($Id: adjustmirrordlg.moc.cpp,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "adjustmirrordlg.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *AdjustMirrorDlg::className() const
+{
+    return "AdjustMirrorDlg";
+}
+
+QMetaObject *AdjustMirrorDlg::metaObj = 0;
+
+void AdjustMirrorDlg::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(AdjustMirrorDlgBase::className(), "AdjustMirrorDlgBase") != 0 )
+	badSuperclassWarning("AdjustMirrorDlg","AdjustMirrorDlgBase");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString AdjustMirrorDlg::tr(const char* s)
+{
+    return qApp->translate( "AdjustMirrorDlg", s, 0 );
+}
+
+QString AdjustMirrorDlg::tr(const char* s, const char * c)
+{
+    return qApp->translate( "AdjustMirrorDlg", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* AdjustMirrorDlg::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) AdjustMirrorDlgBase::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (AdjustMirrorDlg::*m1_t0)(AMCMirrorPanel*);
+    typedef void (QObject::*om1_t0)(AMCMirrorPanel*);
+    typedef void (AdjustMirrorDlg::*m1_t1)();
+    typedef void (QObject::*om1_t1)();
+    typedef void (AdjustMirrorDlg::*m1_t2)();
+    typedef void (QObject::*om1_t2)();
+    typedef void (AdjustMirrorDlg::*m1_t3)();
+    typedef void (QObject::*om1_t3)();
+    typedef void (AdjustMirrorDlg::*m1_t4)();
+    typedef void (QObject::*om1_t4)();
+    typedef void (AdjustMirrorDlg::*m1_t5)();
+    typedef void (QObject::*om1_t5)();
+    typedef void (AdjustMirrorDlg::*m1_t6)();
+    typedef void (QObject::*om1_t6)();
+    typedef void (AdjustMirrorDlg::*m1_t7)();
+    typedef void (QObject::*om1_t7)();
+    typedef void (AdjustMirrorDlg::*m1_t8)();
+    typedef void (QObject::*om1_t8)();
+    typedef void (AdjustMirrorDlg::*m1_t9)();
+    typedef void (QObject::*om1_t9)();
+    typedef void (AdjustMirrorDlg::*m1_t10)();
+    typedef void (QObject::*om1_t10)();
+    typedef void (AdjustMirrorDlg::*m1_t11)(bool);
+    typedef void (QObject::*om1_t11)(bool);
+    typedef void (AdjustMirrorDlg::*m1_t12)();
+    typedef void (QObject::*om1_t12)();
+    typedef void (AdjustMirrorDlg::*m1_t13)();
+    typedef void (QObject::*om1_t13)();
+    typedef void (AdjustMirrorDlg::*m1_t14)();
+    typedef void (QObject::*om1_t14)();
+    typedef void (AdjustMirrorDlg::*m1_t15)(QCloseEvent*);
+    typedef void (QObject::*om1_t15)(QCloseEvent*);
+    typedef void (AdjustMirrorDlg::*m1_t16)(QMouseEvent*);
+    typedef void (QObject::*om1_t16)(QMouseEvent*);
+    typedef void (AdjustMirrorDlg::*m1_t17)(int,int);
+    typedef void (QObject::*om1_t17)(int,int);
+    typedef void (AdjustMirrorDlg::*m1_t18)();
+    typedef void (QObject::*om1_t18)();
+    typedef void (AdjustMirrorDlg::*m1_t19)();
+    typedef void (QObject::*om1_t19)();
+    typedef void (AdjustMirrorDlg::*m1_t20)();
+    typedef void (QObject::*om1_t20)();
+    typedef void (AdjustMirrorDlg::*m1_t21)();
+    typedef void (QObject::*om1_t21)();
+    m1_t0 v1_0 = &AdjustMirrorDlg::mirrorSelectedSlot;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &AdjustMirrorDlg::incX10Slot;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &AdjustMirrorDlg::incX100Slot;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &AdjustMirrorDlg::decX10Slot;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    m1_t4 v1_4 = &AdjustMirrorDlg::decX100Slot;
+    om1_t4 ov1_4 = (om1_t4)v1_4;
+    m1_t5 v1_5 = &AdjustMirrorDlg::incY10Slot;
+    om1_t5 ov1_5 = (om1_t5)v1_5;
+    m1_t6 v1_6 = &AdjustMirrorDlg::incY100Slot;
+    om1_t6 ov1_6 = (om1_t6)v1_6;
+    m1_t7 v1_7 = &AdjustMirrorDlg::decY10Slot;
+    om1_t7 ov1_7 = (om1_t7)v1_7;
+    m1_t8 v1_8 = &AdjustMirrorDlg::decY100Slot;
+    om1_t8 ov1_8 = (om1_t8)v1_8;
+    m1_t9 v1_9 = &AdjustMirrorDlg::centerSlot;
+    om1_t9 ov1_9 = (om1_t9)v1_9;
+    m1_t10 v1_10 = &AdjustMirrorDlg::powerMotorsSlot;
+    om1_t10 ov1_10 = (om1_t10)v1_10;
+    m1_t11 v1_11 = &AdjustMirrorDlg::switchLaserSlot;
+    om1_t11 ov1_11 = (om1_t11)v1_11;
+    m1_t12 v1_12 = &AdjustMirrorDlg::setParamsSlot;
+    om1_t12 ov1_12 = (om1_t12)v1_12;
+    m1_t13 v1_13 = &AdjustMirrorDlg::goXSlot;
+    om1_t13 ov1_13 = (om1_t13)v1_13;
+    m1_t14 v1_14 = &AdjustMirrorDlg::goYSlot;
+    om1_t14 ov1_14 = (om1_t14)v1_14;
+    m1_t15 v1_15 = &AdjustMirrorDlg::closeEvent;
+    om1_t15 ov1_15 = (om1_t15)v1_15;
+    m1_t16 v1_16 = &AdjustMirrorDlg::mousePressEvent;
+    om1_t16 ov1_16 = (om1_t16)v1_16;
+    m1_t17 v1_17 = &AdjustMirrorDlg::moveMotors;
+    om1_t17 ov1_17 = (om1_t17)v1_17;
+    m1_t18 v1_18 = &AdjustMirrorDlg::videoSlot;
+    om1_t18 ov1_18 = (om1_t18)v1_18;
+    m1_t19 v1_19 = &AdjustMirrorDlg::savePositionsSlot;
+    om1_t19 ov1_19 = (om1_t19)v1_19;
+    m1_t20 v1_20 = &AdjustMirrorDlg::allLasersOnSlot;
+    om1_t20 ov1_20 = (om1_t20)v1_20;
+    m1_t21 v1_21 = &AdjustMirrorDlg::allLasersOffSlot;
+    om1_t21 ov1_21 = (om1_t21)v1_21;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(22);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(22);
+    slot_tbl[0].name = "mirrorSelectedSlot(AMCMirrorPanel*)";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "incX10Slot()";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    slot_tbl[2].name = "incX100Slot()";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Public;
+    slot_tbl[3].name = "decX10Slot()";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Public;
+    slot_tbl[4].name = "decX100Slot()";
+    slot_tbl[4].ptr = (QMember)ov1_4;
+    slot_tbl_access[4] = QMetaData::Public;
+    slot_tbl[5].name = "incY10Slot()";
+    slot_tbl[5].ptr = (QMember)ov1_5;
+    slot_tbl_access[5] = QMetaData::Public;
+    slot_tbl[6].name = "incY100Slot()";
+    slot_tbl[6].ptr = (QMember)ov1_6;
+    slot_tbl_access[6] = QMetaData::Public;
+    slot_tbl[7].name = "decY10Slot()";
+    slot_tbl[7].ptr = (QMember)ov1_7;
+    slot_tbl_access[7] = QMetaData::Public;
+    slot_tbl[8].name = "decY100Slot()";
+    slot_tbl[8].ptr = (QMember)ov1_8;
+    slot_tbl_access[8] = QMetaData::Public;
+    slot_tbl[9].name = "centerSlot()";
+    slot_tbl[9].ptr = (QMember)ov1_9;
+    slot_tbl_access[9] = QMetaData::Public;
+    slot_tbl[10].name = "powerMotorsSlot()";
+    slot_tbl[10].ptr = (QMember)ov1_10;
+    slot_tbl_access[10] = QMetaData::Public;
+    slot_tbl[11].name = "switchLaserSlot(bool)";
+    slot_tbl[11].ptr = (QMember)ov1_11;
+    slot_tbl_access[11] = QMetaData::Public;
+    slot_tbl[12].name = "setParamsSlot()";
+    slot_tbl[12].ptr = (QMember)ov1_12;
+    slot_tbl_access[12] = QMetaData::Public;
+    slot_tbl[13].name = "goXSlot()";
+    slot_tbl[13].ptr = (QMember)ov1_13;
+    slot_tbl_access[13] = QMetaData::Public;
+    slot_tbl[14].name = "goYSlot()";
+    slot_tbl[14].ptr = (QMember)ov1_14;
+    slot_tbl_access[14] = QMetaData::Public;
+    slot_tbl[15].name = "closeEvent(QCloseEvent*)";
+    slot_tbl[15].ptr = (QMember)ov1_15;
+    slot_tbl_access[15] = QMetaData::Public;
+    slot_tbl[16].name = "mousePressEvent(QMouseEvent*)";
+    slot_tbl[16].ptr = (QMember)ov1_16;
+    slot_tbl_access[16] = QMetaData::Public;
+    slot_tbl[17].name = "moveMotors(int,int)";
+    slot_tbl[17].ptr = (QMember)ov1_17;
+    slot_tbl_access[17] = QMetaData::Public;
+    slot_tbl[18].name = "videoSlot()";
+    slot_tbl[18].ptr = (QMember)ov1_18;
+    slot_tbl_access[18] = QMetaData::Public;
+    slot_tbl[19].name = "savePositionsSlot()";
+    slot_tbl[19].ptr = (QMember)ov1_19;
+    slot_tbl_access[19] = QMetaData::Private;
+    slot_tbl[20].name = "allLasersOnSlot()";
+    slot_tbl[20].ptr = (QMember)ov1_20;
+    slot_tbl_access[20] = QMetaData::Public;
+    slot_tbl[21].name = "allLasersOffSlot()";
+    slot_tbl[21].ptr = (QMember)ov1_21;
+    slot_tbl_access[21] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"AdjustMirrorDlg", "AdjustMirrorDlgBase",
+	slot_tbl, 22,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.cpp	(revision 3401)
@@ -0,0 +1,572 @@
+#include <klocale.h>
+/****************************************************************************
+** Form implementation generated from reading ui file './adjustmirrordlgbase.ui'
+**
+** Created: Thu Jan 29 00:51:34 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "adjustmirrordlgbase.h"
+
+#include <qbuttongroup.h>
+#include <qcheckbox.h>
+#include <qframe.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/* 
+ *  Constructs a AdjustMirrorDlgBase which is a child of 'parent', with the 
+ *  name 'name' and widget flags set to 'f' 
+ *
+ *  The dialog will by default be modeless, unless you set 'modal' to
+ *  TRUE to construct a modal dialog.
+ */
+AdjustMirrorDlgBase::AdjustMirrorDlgBase( QWidget* parent,  const char* name, bool modal, WFlags fl )
+    : QDialog( parent, name, modal, fl )
+{
+    if ( !name )
+	setName( "AdjustMirrorDlgBase" );
+    resize( 918, 591 ); 
+    setSizeIncrement( QSize( 0, 0 ) );
+    setCaption( i18n( "MAGIC - AMC" ) );
+    setSizeGripEnabled( TRUE );
+    AdjustMirrorDlgBaseLayout = new QGridLayout( this ); 
+    AdjustMirrorDlgBaseLayout->setSpacing( 6 );
+    AdjustMirrorDlgBaseLayout->setMargin( 11 );
+
+    Frame3 = new QFrame( this, "Frame3" );
+    Frame3->setMinimumSize( QSize( 500, 200 ) );
+    Frame3->setFrameShape( QFrame::NoFrame );
+    Frame3->setFrameShadow( QFrame::Raised );
+
+    AdjustMirrorDlgBaseLayout->addMultiCellWidget( Frame3, 0, 1, 0, 0 );
+
+    ActionGroup = new QButtonGroup( this, "ActionGroup" );
+    ActionGroup->setTitle( i18n( "Actions" ) );
+    ActionGroup->setColumnLayout(0, Qt::Vertical );
+    ActionGroup->layout()->setSpacing( 0 );
+    ActionGroup->layout()->setMargin( 0 );
+    ActionGroupLayout = new QHBoxLayout( ActionGroup->layout() );
+    ActionGroupLayout->setAlignment( Qt::AlignTop );
+    ActionGroupLayout->setSpacing( 6 );
+    ActionGroupLayout->setMargin( 11 );
+
+    VideoButton = new QPushButton( ActionGroup, "VideoButton" );
+    VideoButton->setEnabled( FALSE );
+    VideoButton->setText( i18n( "Show Video" ) );
+    ActionGroupLayout->addWidget( VideoButton );
+    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    ActionGroupLayout->addItem( spacer );
+
+    ExitButton = new QPushButton( ActionGroup, "ExitButton" );
+    ExitButton->setText( i18n( "Exit" ) );
+    ExitButton->setDefault( FALSE );
+    ActionGroupLayout->addWidget( ExitButton );
+
+    AdjustMirrorDlgBaseLayout->addWidget( ActionGroup, 1, 1 );
+
+    Layout7 = new QVBoxLayout; 
+    Layout7->setSpacing( 6 );
+    Layout7->setMargin( 0 );
+
+    Panel_Info = new QGroupBox( this, "Panel_Info" );
+    Panel_Info->setTitle( i18n( "Panel" ) );
+    Panel_Info->setColumnLayout(0, Qt::Vertical );
+    Panel_Info->layout()->setSpacing( 0 );
+    Panel_Info->layout()->setMargin( 0 );
+    Panel_InfoLayout = new QHBoxLayout( Panel_Info->layout() );
+    Panel_InfoLayout->setAlignment( Qt::AlignTop );
+    Panel_InfoLayout->setSpacing( 6 );
+    Panel_InfoLayout->setMargin( 11 );
+
+    Device_Label = new QLabel( Panel_Info, "Device_Label" );
+    Device_Label->setText( i18n( "Device: -" ) );
+    Panel_InfoLayout->addWidget( Device_Label );
+    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Panel_InfoLayout->addItem( spacer_2 );
+
+    Box_Label = new QLabel( Panel_Info, "Box_Label" );
+    Box_Label->setText( i18n( "Box: --" ) );
+    Panel_InfoLayout->addWidget( Box_Label );
+    QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Panel_InfoLayout->addItem( spacer_3 );
+
+    Driver_Label = new QLabel( Panel_Info, "Driver_Label" );
+    Driver_Label->setText( i18n( "Driver: -" ) );
+    Panel_InfoLayout->addWidget( Driver_Label );
+    Layout7->addWidget( Panel_Info );
+
+    Layout9 = new QHBoxLayout; 
+    Layout9->setSpacing( 6 );
+    Layout9->setMargin( 0 );
+
+    Box_Group = new QGroupBox( this, "Box_Group" );
+    Box_Group->setTitle( i18n( "BOX Info" ) );
+    Box_Group->setColumnLayout(0, Qt::Vertical );
+    Box_Group->layout()->setSpacing( 0 );
+    Box_Group->layout()->setMargin( 0 );
+    Box_GroupLayout = new QGridLayout( Box_Group->layout() );
+    Box_GroupLayout->setAlignment( Qt::AlignTop );
+    Box_GroupLayout->setSpacing( 6 );
+    Box_GroupLayout->setMargin( 11 );
+
+    Power_V_Label = new QLabel( Box_Group, "Power_V_Label" );
+    Power_V_Label->setText( i18n( "Power V" ) );
+    QToolTip::add(  Power_V_Label, i18n( "Current powering the motors" ) );
+
+    Box_GroupLayout->addWidget( Power_V_Label, 3, 0 );
+
+    Power_V_Value = new QLineEdit( Box_Group, "Power_V_Value" );
+    Power_V_Value->setEnabled( FALSE );
+    Power_V_Value->setMinimumSize( QSize( 50, 0 ) );
+    Power_V_Value->setAcceptDrops( FALSE );
+    Power_V_Value->setText( i18n( "0" ) );
+    QToolTip::add(  Power_V_Value, i18n( "Humidity inside the box" ) );
+    QWhatsThis::add(  Power_V_Value, i18n( "The measured humidity in the box" ) );
+
+    Box_GroupLayout->addWidget( Power_V_Value, 3, 1 );
+
+    Secondary_V_Label = new QLabel( Box_Group, "Secondary_V_Label" );
+    Secondary_V_Label->setText( i18n( "Secondary V" ) );
+    QToolTip::add(  Secondary_V_Label, i18n( "Current powering the motors" ) );
+
+    Box_GroupLayout->addWidget( Secondary_V_Label, 4, 0 );
+
+    Secondary_V_Value = new QLineEdit( Box_Group, "Secondary_V_Value" );
+    Secondary_V_Value->setEnabled( FALSE );
+    Secondary_V_Value->setMinimumSize( QSize( 50, 0 ) );
+    Secondary_V_Value->setAcceptDrops( FALSE );
+    Secondary_V_Value->setText( i18n( "0" ) );
+    QToolTip::add(  Secondary_V_Value, i18n( "Humidity inside the box" ) );
+    QWhatsThis::add(  Secondary_V_Value, i18n( "The measured humidity in the box" ) );
+
+    Box_GroupLayout->addWidget( Secondary_V_Value, 4, 1 );
+
+    Logical_V_Value = new QLineEdit( Box_Group, "Logical_V_Value" );
+    Logical_V_Value->setEnabled( FALSE );
+    Logical_V_Value->setMinimumSize( QSize( 50, 0 ) );
+    Logical_V_Value->setAcceptDrops( FALSE );
+    Logical_V_Value->setText( i18n( "0" ) );
+    QToolTip::add(  Logical_V_Value, i18n( "Humidity inside the box" ) );
+    QWhatsThis::add(  Logical_V_Value, i18n( "The measured humidity in the box" ) );
+
+    Box_GroupLayout->addWidget( Logical_V_Value, 5, 1 );
+
+    Logical_V_Label = new QLabel( Box_Group, "Logical_V_Label" );
+    Logical_V_Label->setText( i18n( "Logical V" ) );
+    QToolTip::add(  Logical_V_Label, i18n( "Current powering the motors" ) );
+
+    Box_GroupLayout->addWidget( Logical_V_Label, 5, 0 );
+
+    Temperature_Label = new QLabel( Box_Group, "Temperature_Label" );
+    Temperature_Label->setText( i18n( "Temperature" ) );
+
+    Box_GroupLayout->addWidget( Temperature_Label, 0, 0 );
+
+    Temperature_Value = new QLineEdit( Box_Group, "Temperature_Value" );
+    Temperature_Value->setEnabled( FALSE );
+    Temperature_Value->setMinimumSize( QSize( 50, 0 ) );
+    Temperature_Value->setAcceptDrops( FALSE );
+    Temperature_Value->setText( i18n( "0" ) );
+    QToolTip::add(  Temperature_Value, i18n( "Temperatur inside the box" ) );
+
+    Box_GroupLayout->addWidget( Temperature_Value, 0, 1 );
+
+    Humidity_Label = new QLabel( Box_Group, "Humidity_Label" );
+    Humidity_Label->setText( i18n( "Humidity" ) );
+
+    Box_GroupLayout->addWidget( Humidity_Label, 1, 0 );
+
+    Humidity_Value = new QLineEdit( Box_Group, "Humidity_Value" );
+    Humidity_Value->setEnabled( FALSE );
+    Humidity_Value->setMinimumSize( QSize( 50, 0 ) );
+    Humidity_Value->setAcceptDrops( FALSE );
+    Humidity_Value->setText( i18n( "0" ) );
+    QToolTip::add(  Humidity_Value, i18n( "Humidity inside the box" ) );
+    QWhatsThis::add(  Humidity_Value, i18n( "The measured humidity in the box" ) );
+
+    Box_GroupLayout->addWidget( Humidity_Value, 1, 1 );
+
+    Power_I_Label = new QLabel( Box_Group, "Power_I_Label" );
+    Power_I_Label->setText( i18n( "Power I" ) );
+    QToolTip::add(  Power_I_Label, i18n( "Current powering the motors" ) );
+
+    Box_GroupLayout->addWidget( Power_I_Label, 2, 0 );
+
+    Power_I_Value = new QLineEdit( Box_Group, "Power_I_Value" );
+    Power_I_Value->setEnabled( FALSE );
+    Power_I_Value->setMinimumSize( QSize( 50, 0 ) );
+    Power_I_Value->setAcceptDrops( FALSE );
+    Power_I_Value->setText( i18n( "0" ) );
+    QToolTip::add(  Power_I_Value, i18n( "Humidity inside the box" ) );
+    QWhatsThis::add(  Power_I_Value, i18n( "The measured humidity in the box" ) );
+
+    Box_GroupLayout->addWidget( Power_I_Value, 2, 1 );
+    Layout9->addWidget( Box_Group );
+
+    Layout8 = new QVBoxLayout; 
+    Layout8->setSpacing( 6 );
+    Layout8->setMargin( 0 );
+
+    Info_Box = new QGroupBox( this, "Info_Box" );
+    Info_Box->setTitle( i18n( "Info" ) );
+    Info_Box->setColumnLayout(0, Qt::Vertical );
+    Info_Box->layout()->setSpacing( 0 );
+    Info_Box->layout()->setMargin( 0 );
+    Info_BoxLayout = new QVBoxLayout( Info_Box->layout() );
+    Info_BoxLayout->setAlignment( Qt::AlignTop );
+    Info_BoxLayout->setSpacing( 6 );
+    Info_BoxLayout->setMargin( 11 );
+
+    Layout1 = new QGridLayout; 
+    Layout1->setSpacing( 6 );
+    Layout1->setMargin( 0 );
+
+    Working_I_Value = new QLineEdit( Info_Box, "Working_I_Value" );
+    Working_I_Value->setEnabled( FALSE );
+    Working_I_Value->setMinimumSize( QSize( 50, 0 ) );
+    Working_I_Value->setText( i18n( "0" ) );
+
+    Layout1->addWidget( Working_I_Value, 1, 1 );
+
+    Holding_I_Label = new QLabel( Info_Box, "Holding_I_Label" );
+    Holding_I_Label->setText( i18n( "Holding I" ) );
+
+    Layout1->addWidget( Holding_I_Label, 2, 0 );
+
+    Frequency_Value = new QLineEdit( Info_Box, "Frequency_Value" );
+    Frequency_Value->setEnabled( FALSE );
+    Frequency_Value->setMinimumSize( QSize( 50, 0 ) );
+    Frequency_Value->setText( i18n( "0" ) );
+
+    Layout1->addWidget( Frequency_Value, 0, 1 );
+
+    Holding_I_Value = new QLineEdit( Info_Box, "Holding_I_Value" );
+    Holding_I_Value->setEnabled( FALSE );
+    Holding_I_Value->setMinimumSize( QSize( 50, 0 ) );
+    Holding_I_Value->setText( i18n( "0" ) );
+
+    Layout1->addWidget( Holding_I_Value, 2, 1 );
+
+    Working_I_Label = new QLabel( Info_Box, "Working_I_Label" );
+    Working_I_Label->setText( i18n( "Working I" ) );
+
+    Layout1->addWidget( Working_I_Label, 1, 0 );
+
+    Frequency_Label = new QLabel( Info_Box, "Frequency_Label" );
+    Frequency_Label->setText( i18n( "Frequency" ) );
+
+    Layout1->addWidget( Frequency_Label, 0, 0 );
+    Info_BoxLayout->addLayout( Layout1 );
+    QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+    Info_BoxLayout->addItem( spacer_4 );
+
+    Set_Button = new QPushButton( Info_Box, "Set_Button" );
+    Set_Button->setEnabled( FALSE );
+    Set_Button->setText( i18n( "Set" ) );
+    Info_BoxLayout->addWidget( Set_Button );
+    Layout8->addWidget( Info_Box );
+
+    Motor_Power_Check = new QCheckBox( this, "Motor_Power_Check" );
+    Motor_Power_Check->setEnabled( FALSE );
+    Motor_Power_Check->setText( i18n( "Motor power" ) );
+    Layout8->addWidget( Motor_Power_Check );
+
+    Laser_Check = new QCheckBox( this, "Laser_Check" );
+    Laser_Check->setEnabled( FALSE );
+    Laser_Check->setText( i18n( "Laser" ) );
+    Layout8->addWidget( Laser_Check );
+
+    Layout7_2 = new QHBoxLayout; 
+    Layout7_2->setSpacing( 6 );
+    Layout7_2->setMargin( 0 );
+
+    SwitchAllLasersOn = new QPushButton( this, "SwitchAllLasersOn" );
+    SwitchAllLasersOn->setText( i18n( "All Lasers On" ) );
+    SwitchAllLasersOn->setToggleButton( FALSE );
+    SwitchAllLasersOn->setToggleButton( FALSE );
+    Layout7_2->addWidget( SwitchAllLasersOn );
+
+    SwitchAllLasersOff = new QPushButton( this, "SwitchAllLasersOff" );
+    SwitchAllLasersOff->setText( i18n( "All Lasers Off" ) );
+    SwitchAllLasersOff->setToggleButton( FALSE );
+    SwitchAllLasersOff->setToggleButton( FALSE );
+    Layout7_2->addWidget( SwitchAllLasersOff );
+    Layout8->addLayout( Layout7_2 );
+    Layout9->addLayout( Layout8 );
+    Layout7->addLayout( Layout9 );
+
+    Motors_Box = new QGroupBox( this, "Motors_Box" );
+    Motors_Box->setTitle( i18n( "Motors" ) );
+    Motors_Box->setColumnLayout(0, Qt::Vertical );
+    Motors_Box->layout()->setSpacing( 0 );
+    Motors_Box->layout()->setMargin( 0 );
+    Motors_BoxLayout = new QVBoxLayout( Motors_Box->layout() );
+    Motors_BoxLayout->setAlignment( Qt::AlignTop );
+    Motors_BoxLayout->setSpacing( 6 );
+    Motors_BoxLayout->setMargin( 11 );
+
+    Layout8_2 = new QHBoxLayout; 
+    Layout8_2->setSpacing( 6 );
+    Layout8_2->setMargin( 0 );
+
+    X_Mot_Box = new QGroupBox( Motors_Box, "X_Mot_Box" );
+    X_Mot_Box->setTitle( i18n( "X=0" ) );
+    X_Mot_Box->setColumnLayout(0, Qt::Vertical );
+    X_Mot_Box->layout()->setSpacing( 0 );
+    X_Mot_Box->layout()->setMargin( 0 );
+    X_Mot_BoxLayout = new QGridLayout( X_Mot_Box->layout() );
+    X_Mot_BoxLayout->setAlignment( Qt::AlignTop );
+    X_Mot_BoxLayout->setSpacing( 0 );
+    X_Mot_BoxLayout->setMargin( 11 );
+
+    X_Inc_100_Button = new QPushButton( X_Mot_Box, "X_Inc_100_Button" );
+    X_Inc_100_Button->setEnabled( FALSE );
+    X_Inc_100_Button->setMinimumSize( QSize( 0, 0 ) );
+    X_Inc_100_Button->setText( i18n( "+100" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Inc_100_Button, 0, 0 );
+
+    X_Dec_10_Button = new QPushButton( X_Mot_Box, "X_Dec_10_Button" );
+    X_Dec_10_Button->setEnabled( FALSE );
+    X_Dec_10_Button->setMinimumSize( QSize( 0, 0 ) );
+    X_Dec_10_Button->setText( i18n( "-10" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Dec_10_Button, 5, 0 );
+
+    X_Dec_100_Button = new QPushButton( X_Mot_Box, "X_Dec_100_Button" );
+    X_Dec_100_Button->setEnabled( FALSE );
+    X_Dec_100_Button->setMinimumSize( QSize( 0, 0 ) );
+    X_Dec_100_Button->setText( i18n( "-100" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Dec_100_Button, 6, 0 );
+
+    X_Inc_10_Button = new QPushButton( X_Mot_Box, "X_Inc_10_Button" );
+    X_Inc_10_Button->setEnabled( FALSE );
+    X_Inc_10_Button->setMinimumSize( QSize( 0, 0 ) );
+    X_Inc_10_Button->setText( i18n( "+10" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Inc_10_Button, 1, 0 );
+    QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    X_Mot_BoxLayout->addItem( spacer_5, 0, 1 );
+    QSpacerItem* spacer_6 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    X_Mot_BoxLayout->addItem( spacer_6, 1, 1 );
+    QSpacerItem* spacer_7 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    X_Mot_BoxLayout->addItem( spacer_7, 5, 1 );
+    QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    X_Mot_BoxLayout->addItem( spacer_8, 6, 1 );
+
+    X_Goto_Value = new QLineEdit( X_Mot_Box, "X_Goto_Value" );
+    X_Goto_Value->setEnabled( FALSE );
+    X_Goto_Value->setMinimumSize( QSize( 50, 0 ) );
+    X_Goto_Value->setText( i18n( "0" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Goto_Value, 3, 0 );
+
+    X_Go_Button = new QPushButton( X_Mot_Box, "X_Go_Button" );
+    X_Go_Button->setEnabled( FALSE );
+    X_Go_Button->setMinimumSize( QSize( 50, 0 ) );
+    X_Go_Button->setText( i18n( "Go" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Go_Button, 3, 1 );
+    Layout8_2->addWidget( X_Mot_Box );
+
+    Y_Mot_Box = new QGroupBox( Motors_Box, "Y_Mot_Box" );
+    Y_Mot_Box->setTitle( i18n( "Y=0" ) );
+    Y_Mot_Box->setColumnLayout(0, Qt::Vertical );
+    Y_Mot_Box->layout()->setSpacing( 0 );
+    Y_Mot_Box->layout()->setMargin( 0 );
+    Y_Mot_BoxLayout = new QGridLayout( Y_Mot_Box->layout() );
+    Y_Mot_BoxLayout->setAlignment( Qt::AlignTop );
+    Y_Mot_BoxLayout->setSpacing( 0 );
+    Y_Mot_BoxLayout->setMargin( 11 );
+
+    Y_Dec_100_Button = new QPushButton( Y_Mot_Box, "Y_Dec_100_Button" );
+    Y_Dec_100_Button->setEnabled( FALSE );
+    Y_Dec_100_Button->setText( i18n( "-100" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Dec_100_Button, 6, 0 );
+
+    Y_Dec_10_Button = new QPushButton( Y_Mot_Box, "Y_Dec_10_Button" );
+    Y_Dec_10_Button->setEnabled( FALSE );
+    Y_Dec_10_Button->setText( i18n( "-10" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Dec_10_Button, 5, 0 );
+
+    Y_Inc_100_Button = new QPushButton( Y_Mot_Box, "Y_Inc_100_Button" );
+    Y_Inc_100_Button->setEnabled( FALSE );
+    Y_Inc_100_Button->setText( i18n( "+100" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Inc_100_Button, 0, 0 );
+
+    Y_Inc_10_Button = new QPushButton( Y_Mot_Box, "Y_Inc_10_Button" );
+    Y_Inc_10_Button->setEnabled( FALSE );
+    Y_Inc_10_Button->setText( i18n( "+10" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Inc_10_Button, 1, 0 );
+    QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Y_Mot_BoxLayout->addItem( spacer_9, 0, 1 );
+    QSpacerItem* spacer_10 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Y_Mot_BoxLayout->addItem( spacer_10, 5, 1 );
+    QSpacerItem* spacer_11 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Y_Mot_BoxLayout->addItem( spacer_11, 6, 1 );
+
+    Y_Goto_Value = new QLineEdit( Y_Mot_Box, "Y_Goto_Value" );
+    Y_Goto_Value->setEnabled( FALSE );
+    Y_Goto_Value->setMinimumSize( QSize( 50, 0 ) );
+    Y_Goto_Value->setText( i18n( "0" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Goto_Value, 3, 0 );
+    QSpacerItem* spacer_12 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Y_Mot_BoxLayout->addItem( spacer_12, 1, 1 );
+
+    Y_Go_Button = new QPushButton( Y_Mot_Box, "Y_Go_Button" );
+    Y_Go_Button->setEnabled( FALSE );
+    Y_Go_Button->setMinimumSize( QSize( 50, 0 ) );
+    Y_Go_Button->setText( i18n( "Go" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Go_Button, 3, 1 );
+    Layout8_2->addWidget( Y_Mot_Box );
+    Motors_BoxLayout->addLayout( Layout8_2 );
+    QSpacerItem* spacer_13 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+    Motors_BoxLayout->addItem( spacer_13 );
+
+    Layout7_3 = new QHBoxLayout; 
+    Layout7_3->setSpacing( 6 );
+    Layout7_3->setMargin( 0 );
+    QSpacerItem* spacer_14 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout7_3->addItem( spacer_14 );
+
+    Center_Button = new QPushButton( Motors_Box, "Center_Button" );
+    Center_Button->setEnabled( FALSE );
+    Center_Button->setText( i18n( "Center" ) );
+    Layout7_3->addWidget( Center_Button );
+    QSpacerItem* spacer_15 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout7_3->addItem( spacer_15 );
+    Motors_BoxLayout->addLayout( Layout7_3 );
+    Layout7->addWidget( Motors_Box );
+
+    AdjustMirrorDlgBaseLayout->addLayout( Layout7, 0, 1 );
+
+    // signals and slots connections
+    connect( Set_Button, SIGNAL( clicked() ), this, SLOT( setParamsSlot() ) );
+    connect( X_Inc_100_Button, SIGNAL( clicked() ), this, SLOT( incX100Slot() ) );
+    connect( X_Inc_10_Button, SIGNAL( clicked() ), this, SLOT( incX10Slot() ) );
+    connect( X_Dec_100_Button, SIGNAL( clicked() ), this, SLOT( decX100Slot() ) );
+    connect( X_Go_Button, SIGNAL( clicked() ), this, SLOT( goXSlot() ) );
+    connect( Y_Go_Button, SIGNAL( clicked() ), this, SLOT( goYSlot() ) );
+    connect( Motor_Power_Check, SIGNAL( clicked() ), this, SLOT( powerMotorsSlot() ) );
+    connect( Laser_Check, SIGNAL( toggled(bool) ), this, SLOT( switchLaserSlot( bool ) ) );
+    connect( Y_Inc_100_Button, SIGNAL( clicked() ), this, SLOT( incY100Slot() ) );
+    connect( Y_Inc_10_Button, SIGNAL( clicked() ), this, SLOT( incY10Slot() ) );
+    connect( Y_Dec_10_Button, SIGNAL( clicked() ), this, SLOT( decY10Slot() ) );
+    connect( Y_Dec_100_Button, SIGNAL( clicked() ), this, SLOT( decY100Slot() ) );
+    connect( VideoButton, SIGNAL( clicked() ), this, SLOT( videoSlot() ) );
+    connect( ExitButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
+    connect( Center_Button, SIGNAL( clicked() ), this, SLOT( centerSlot() ) );
+    connect( SwitchAllLasersOff, SIGNAL( clicked() ), this, SLOT( allLasersOffSlot() ) );
+    connect( SwitchAllLasersOn, SIGNAL( clicked() ), this, SLOT( allLasersOnSlot() ) );
+    connect( X_Dec_10_Button, SIGNAL( clicked() ), this, SLOT( decX10Slot() ) );
+}
+
+/*  
+ *  Destroys the object and frees any allocated resources
+ */
+AdjustMirrorDlgBase::~AdjustMirrorDlgBase()
+{
+    // no need to delete child widgets, Qt does it all for us
+}
+
+void AdjustMirrorDlgBase::allLasersOffSlot()
+{
+    qWarning( "AdjustMirrorDlgBase::allLasersOffSlot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::allLasersOnSlot()
+{
+    qWarning( "AdjustMirrorDlgBase::allLasersOnSlot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::centerSlot()
+{
+    qWarning( "AdjustMirrorDlgBase::centerSlot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::decX100Slot()
+{
+    qWarning( "AdjustMirrorDlgBase::decX100Slot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::decX10Slot()
+{
+    qWarning( "AdjustMirrorDlgBase::decX10Slot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::decY100Slot()
+{
+    qWarning( "AdjustMirrorDlgBase::decY100Slot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::decY10Slot()
+{
+    qWarning( "AdjustMirrorDlgBase::decY10Slot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::goXSlot()
+{
+    qWarning( "AdjustMirrorDlgBase::goXSlot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::goYSlot()
+{
+    qWarning( "AdjustMirrorDlgBase::goYSlot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::incX100Slot()
+{
+    qWarning( "AdjustMirrorDlgBase::incX100Slot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::incX10Slot()
+{
+    qWarning( "AdjustMirrorDlgBase::incX10Slot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::incY100Slot()
+{
+    qWarning( "AdjustMirrorDlgBase::incY100Slot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::incY10Slot()
+{
+    qWarning( "AdjustMirrorDlgBase::incY10Slot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::powerMotorsSlot()
+{
+    qWarning( "AdjustMirrorDlgBase::powerMotorsSlot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::setParamsSlot()
+{
+    qWarning( "AdjustMirrorDlgBase::setParamsSlot(): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::switchLaserSlot( bool )
+{
+    qWarning( "AdjustMirrorDlgBase::switchLaserSlot( bool ): Not implemented yet!" );
+}
+
+void AdjustMirrorDlgBase::videoSlot()
+{
+    qWarning( "AdjustMirrorDlgBase::videoSlot(): Not implemented yet!" );
+}
+
+#include "adjustmirrordlgbase.moc"
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.h	(revision 3401)
@@ -0,0 +1,120 @@
+/****************************************************************************
+** Form interface generated from reading ui file './adjustmirrordlgbase.ui'
+**
+** Created: Thu Jan 29 00:50:29 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef ADJUSTMIRRORDLGBASE_H
+#define ADJUSTMIRRORDLGBASE_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+class QVBoxLayout; 
+class QHBoxLayout; 
+class QGridLayout; 
+class QButtonGroup;
+class QCheckBox;
+class QFrame;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+
+class AdjustMirrorDlgBase : public QDialog
+{ 
+    Q_OBJECT
+
+public:
+    AdjustMirrorDlgBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+    ~AdjustMirrorDlgBase();
+
+    QFrame* Frame3;
+    QButtonGroup* ActionGroup;
+    QPushButton* VideoButton;
+    QPushButton* ExitButton;
+    QGroupBox* Panel_Info;
+    QLabel* Device_Label;
+    QLabel* Box_Label;
+    QLabel* Driver_Label;
+    QGroupBox* Box_Group;
+    QLabel* Power_V_Label;
+    QLineEdit* Power_V_Value;
+    QLabel* Secondary_V_Label;
+    QLineEdit* Secondary_V_Value;
+    QLineEdit* Logical_V_Value;
+    QLabel* Logical_V_Label;
+    QLabel* Temperature_Label;
+    QLineEdit* Temperature_Value;
+    QLabel* Humidity_Label;
+    QLineEdit* Humidity_Value;
+    QLabel* Power_I_Label;
+    QLineEdit* Power_I_Value;
+    QGroupBox* Info_Box;
+    QLineEdit* Working_I_Value;
+    QLabel* Holding_I_Label;
+    QLineEdit* Frequency_Value;
+    QLineEdit* Holding_I_Value;
+    QLabel* Working_I_Label;
+    QLabel* Frequency_Label;
+    QPushButton* Set_Button;
+    QCheckBox* Motor_Power_Check;
+    QCheckBox* Laser_Check;
+    QPushButton* SwitchAllLasersOn;
+    QPushButton* SwitchAllLasersOff;
+    QGroupBox* Motors_Box;
+    QGroupBox* X_Mot_Box;
+    QPushButton* X_Inc_100_Button;
+    QPushButton* X_Dec_10_Button;
+    QPushButton* X_Dec_100_Button;
+    QPushButton* X_Inc_10_Button;
+    QLineEdit* X_Goto_Value;
+    QPushButton* X_Go_Button;
+    QGroupBox* Y_Mot_Box;
+    QPushButton* Y_Dec_100_Button;
+    QPushButton* Y_Dec_10_Button;
+    QPushButton* Y_Inc_100_Button;
+    QPushButton* Y_Inc_10_Button;
+    QLineEdit* Y_Goto_Value;
+    QPushButton* Y_Go_Button;
+    QPushButton* Center_Button;
+
+public slots:
+    virtual void allLasersOffSlot();
+    virtual void allLasersOnSlot();
+    virtual void centerSlot();
+    virtual void decX100Slot();
+    virtual void decX10Slot();
+    virtual void decY100Slot();
+    virtual void decY10Slot();
+    virtual void goXSlot();
+    virtual void goYSlot();
+    virtual void incX100Slot();
+    virtual void incX10Slot();
+    virtual void incY100Slot();
+    virtual void incY10Slot();
+    virtual void powerMotorsSlot();
+    virtual void setParamsSlot();
+    virtual void switchLaserSlot( bool );
+    virtual void videoSlot();
+
+protected:
+    QGridLayout* AdjustMirrorDlgBaseLayout;
+    QHBoxLayout* ActionGroupLayout;
+    QVBoxLayout* Layout7;
+    QHBoxLayout* Panel_InfoLayout;
+    QHBoxLayout* Layout9;
+    QGridLayout* Box_GroupLayout;
+    QVBoxLayout* Layout8;
+    QVBoxLayout* Info_BoxLayout;
+    QGridLayout* Layout1;
+    QHBoxLayout* Layout7_2;
+    QVBoxLayout* Motors_BoxLayout;
+    QHBoxLayout* Layout8_2;
+    QGridLayout* X_Mot_BoxLayout;
+    QGridLayout* Y_Mot_BoxLayout;
+    QHBoxLayout* Layout7_3;
+};
+
+#endif // ADJUSTMIRRORDLGBASE_H
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.moc
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.moc	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.moc	(revision 3401)
@@ -0,0 +1,193 @@
+/****************************************************************************
+** AdjustMirrorDlgBase meta object code from reading C++ file 'adjustmirrordlgbase.h'
+**
+** Created: Thu Jan 29 00:51:34 2004
+**      by: The Qt MOC ($Id: adjustmirrordlgbase.moc,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "adjustmirrordlgbase.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *AdjustMirrorDlgBase::className() const
+{
+    return "AdjustMirrorDlgBase";
+}
+
+QMetaObject *AdjustMirrorDlgBase::metaObj = 0;
+
+void AdjustMirrorDlgBase::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QDialog::className(), "QDialog") != 0 )
+	badSuperclassWarning("AdjustMirrorDlgBase","QDialog");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString AdjustMirrorDlgBase::tr(const char* s)
+{
+    return qApp->translate( "AdjustMirrorDlgBase", s, 0 );
+}
+
+QString AdjustMirrorDlgBase::tr(const char* s, const char * c)
+{
+    return qApp->translate( "AdjustMirrorDlgBase", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* AdjustMirrorDlgBase::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QDialog::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (AdjustMirrorDlgBase::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    typedef void (AdjustMirrorDlgBase::*m1_t1)();
+    typedef void (QObject::*om1_t1)();
+    typedef void (AdjustMirrorDlgBase::*m1_t2)();
+    typedef void (QObject::*om1_t2)();
+    typedef void (AdjustMirrorDlgBase::*m1_t3)();
+    typedef void (QObject::*om1_t3)();
+    typedef void (AdjustMirrorDlgBase::*m1_t4)();
+    typedef void (QObject::*om1_t4)();
+    typedef void (AdjustMirrorDlgBase::*m1_t5)();
+    typedef void (QObject::*om1_t5)();
+    typedef void (AdjustMirrorDlgBase::*m1_t6)();
+    typedef void (QObject::*om1_t6)();
+    typedef void (AdjustMirrorDlgBase::*m1_t7)();
+    typedef void (QObject::*om1_t7)();
+    typedef void (AdjustMirrorDlgBase::*m1_t8)();
+    typedef void (QObject::*om1_t8)();
+    typedef void (AdjustMirrorDlgBase::*m1_t9)();
+    typedef void (QObject::*om1_t9)();
+    typedef void (AdjustMirrorDlgBase::*m1_t10)();
+    typedef void (QObject::*om1_t10)();
+    typedef void (AdjustMirrorDlgBase::*m1_t11)();
+    typedef void (QObject::*om1_t11)();
+    typedef void (AdjustMirrorDlgBase::*m1_t12)();
+    typedef void (QObject::*om1_t12)();
+    typedef void (AdjustMirrorDlgBase::*m1_t13)();
+    typedef void (QObject::*om1_t13)();
+    typedef void (AdjustMirrorDlgBase::*m1_t14)();
+    typedef void (QObject::*om1_t14)();
+    typedef void (AdjustMirrorDlgBase::*m1_t15)(bool);
+    typedef void (QObject::*om1_t15)(bool);
+    typedef void (AdjustMirrorDlgBase::*m1_t16)();
+    typedef void (QObject::*om1_t16)();
+    m1_t0 v1_0 = &AdjustMirrorDlgBase::allLasersOffSlot;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &AdjustMirrorDlgBase::allLasersOnSlot;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &AdjustMirrorDlgBase::centerSlot;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &AdjustMirrorDlgBase::decX100Slot;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    m1_t4 v1_4 = &AdjustMirrorDlgBase::decX10Slot;
+    om1_t4 ov1_4 = (om1_t4)v1_4;
+    m1_t5 v1_5 = &AdjustMirrorDlgBase::decY100Slot;
+    om1_t5 ov1_5 = (om1_t5)v1_5;
+    m1_t6 v1_6 = &AdjustMirrorDlgBase::decY10Slot;
+    om1_t6 ov1_6 = (om1_t6)v1_6;
+    m1_t7 v1_7 = &AdjustMirrorDlgBase::goXSlot;
+    om1_t7 ov1_7 = (om1_t7)v1_7;
+    m1_t8 v1_8 = &AdjustMirrorDlgBase::goYSlot;
+    om1_t8 ov1_8 = (om1_t8)v1_8;
+    m1_t9 v1_9 = &AdjustMirrorDlgBase::incX100Slot;
+    om1_t9 ov1_9 = (om1_t9)v1_9;
+    m1_t10 v1_10 = &AdjustMirrorDlgBase::incX10Slot;
+    om1_t10 ov1_10 = (om1_t10)v1_10;
+    m1_t11 v1_11 = &AdjustMirrorDlgBase::incY100Slot;
+    om1_t11 ov1_11 = (om1_t11)v1_11;
+    m1_t12 v1_12 = &AdjustMirrorDlgBase::incY10Slot;
+    om1_t12 ov1_12 = (om1_t12)v1_12;
+    m1_t13 v1_13 = &AdjustMirrorDlgBase::powerMotorsSlot;
+    om1_t13 ov1_13 = (om1_t13)v1_13;
+    m1_t14 v1_14 = &AdjustMirrorDlgBase::setParamsSlot;
+    om1_t14 ov1_14 = (om1_t14)v1_14;
+    m1_t15 v1_15 = &AdjustMirrorDlgBase::switchLaserSlot;
+    om1_t15 ov1_15 = (om1_t15)v1_15;
+    m1_t16 v1_16 = &AdjustMirrorDlgBase::videoSlot;
+    om1_t16 ov1_16 = (om1_t16)v1_16;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(17);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(17);
+    slot_tbl[0].name = "allLasersOffSlot()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "allLasersOnSlot()";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    slot_tbl[2].name = "centerSlot()";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Public;
+    slot_tbl[3].name = "decX100Slot()";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Public;
+    slot_tbl[4].name = "decX10Slot()";
+    slot_tbl[4].ptr = (QMember)ov1_4;
+    slot_tbl_access[4] = QMetaData::Public;
+    slot_tbl[5].name = "decY100Slot()";
+    slot_tbl[5].ptr = (QMember)ov1_5;
+    slot_tbl_access[5] = QMetaData::Public;
+    slot_tbl[6].name = "decY10Slot()";
+    slot_tbl[6].ptr = (QMember)ov1_6;
+    slot_tbl_access[6] = QMetaData::Public;
+    slot_tbl[7].name = "goXSlot()";
+    slot_tbl[7].ptr = (QMember)ov1_7;
+    slot_tbl_access[7] = QMetaData::Public;
+    slot_tbl[8].name = "goYSlot()";
+    slot_tbl[8].ptr = (QMember)ov1_8;
+    slot_tbl_access[8] = QMetaData::Public;
+    slot_tbl[9].name = "incX100Slot()";
+    slot_tbl[9].ptr = (QMember)ov1_9;
+    slot_tbl_access[9] = QMetaData::Public;
+    slot_tbl[10].name = "incX10Slot()";
+    slot_tbl[10].ptr = (QMember)ov1_10;
+    slot_tbl_access[10] = QMetaData::Public;
+    slot_tbl[11].name = "incY100Slot()";
+    slot_tbl[11].ptr = (QMember)ov1_11;
+    slot_tbl_access[11] = QMetaData::Public;
+    slot_tbl[12].name = "incY10Slot()";
+    slot_tbl[12].ptr = (QMember)ov1_12;
+    slot_tbl_access[12] = QMetaData::Public;
+    slot_tbl[13].name = "powerMotorsSlot()";
+    slot_tbl[13].ptr = (QMember)ov1_13;
+    slot_tbl_access[13] = QMetaData::Public;
+    slot_tbl[14].name = "setParamsSlot()";
+    slot_tbl[14].ptr = (QMember)ov1_14;
+    slot_tbl_access[14] = QMetaData::Public;
+    slot_tbl[15].name = "switchLaserSlot(bool)";
+    slot_tbl[15].ptr = (QMember)ov1_15;
+    slot_tbl_access[15] = QMetaData::Public;
+    slot_tbl[16].name = "videoSlot()";
+    slot_tbl[16].ptr = (QMember)ov1_16;
+    slot_tbl_access[16] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"AdjustMirrorDlgBase", "QDialog",
+	slot_tbl, 17,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.ui
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.ui	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustmirrordlgbase.ui	(revision 3401)
@@ -0,0 +1,1564 @@
+<!DOCTYPE UI><UI>
+<class>AdjustMirrorDlgBase</class>
+<widget>
+    <class>QDialog</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>AdjustMirrorDlgBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>918</width>
+            <height>591</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>sizeIncrement</name>
+        <size>
+            <width>0</width>
+            <height>0</height>
+        </size>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>MAGIC - AMC</string>
+    </property>
+    <property stdset="1">
+        <name>sizeGripEnabled</name>
+        <bool>true</bool>
+    </property>
+    <grid>
+        <property stdset="1">
+            <name>margin</name>
+            <number>11</number>
+        </property>
+        <property stdset="1">
+            <name>spacing</name>
+            <number>6</number>
+        </property>
+        <widget row="0"  column="0"  rowspan="2"  colspan="1" >
+            <class>QFrame</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Frame3</cstring>
+            </property>
+            <property stdset="1">
+                <name>minimumSize</name>
+                <size>
+                    <width>500</width>
+                    <height>200</height>
+                </size>
+            </property>
+            <property stdset="1">
+                <name>frameShape</name>
+                <enum>NoFrame</enum>
+            </property>
+            <property stdset="1">
+                <name>frameShadow</name>
+                <enum>Raised</enum>
+            </property>
+        </widget>
+        <widget row="1"  column="1" >
+            <class>QButtonGroup</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>ActionGroup</cstring>
+            </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>Actions</string>
+            </property>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>11</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>VideoButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Show Video</string>
+                    </property>
+                </widget>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer20</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ExitButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Exit</string>
+                    </property>
+                    <property stdset="1">
+                        <name>default</name>
+                        <bool>false</bool>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <widget row="0"  column="1" >
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout7</cstring>
+            </property>
+            <vbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QGroupBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Panel_Info</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>title</name>
+                        <string>Panel</string>
+                    </property>
+                    <hbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>11</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Device_Label</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Device: -</string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property>
+                                <name>name</name>
+                                <cstring>Spacer17_2_2</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>sizeType</name>
+                                <enum>Expanding</enum>
+                            </property>
+                            <property>
+                                <name>sizeHint</name>
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget>
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Box_Label</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Box: --</string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property>
+                                <name>name</name>
+                                <cstring>Spacer18_2_2</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>sizeType</name>
+                                <enum>Expanding</enum>
+                            </property>
+                            <property>
+                                <name>sizeHint</name>
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget>
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Driver_Label</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Driver: -</string>
+                            </property>
+                        </widget>
+                    </hbox>
+                </widget>
+                <widget>
+                    <class>QLayoutWidget</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Layout9</cstring>
+                    </property>
+                    <hbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>0</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Box_Group</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>BOX Info</string>
+                            </property>
+                            <grid>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget row="3"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Power_V_Label</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Power V</string>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Current powering the motors</string>
+                                    </property>
+                                </widget>
+                                <widget row="3"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Power_V_Value</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>50</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>acceptDrops</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>0</string>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Humidity inside the box</string>
+                                        <comment>Temperature from box</comment>
+                                    </property>
+                                    <property>
+                                        <name>whatsThis</name>
+                                        <string>The measured humidity in the box</string>
+                                    </property>
+                                </widget>
+                                <widget row="4"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Secondary_V_Label</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Secondary V</string>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Current powering the motors</string>
+                                    </property>
+                                </widget>
+                                <widget row="4"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Secondary_V_Value</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>50</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>acceptDrops</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>0</string>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Humidity inside the box</string>
+                                        <comment>Temperature from box</comment>
+                                    </property>
+                                    <property>
+                                        <name>whatsThis</name>
+                                        <string>The measured humidity in the box</string>
+                                    </property>
+                                </widget>
+                                <widget row="5"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Logical_V_Value</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>50</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>acceptDrops</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>0</string>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Humidity inside the box</string>
+                                        <comment>Temperature from box</comment>
+                                    </property>
+                                    <property>
+                                        <name>whatsThis</name>
+                                        <string>The measured humidity in the box</string>
+                                    </property>
+                                </widget>
+                                <widget row="5"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Logical_V_Label</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Logical V</string>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Current powering the motors</string>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Temperature_Label</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Temperature</string>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Temperature_Value</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>50</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>acceptDrops</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>0</string>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Temperatur inside the box</string>
+                                        <comment>Temperature from box</comment>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Humidity_Label</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Humidity</string>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Humidity_Value</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>50</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>acceptDrops</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>0</string>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Humidity inside the box</string>
+                                        <comment>Temperature from box</comment>
+                                    </property>
+                                    <property>
+                                        <name>whatsThis</name>
+                                        <string>The measured humidity in the box</string>
+                                    </property>
+                                </widget>
+                                <widget row="2"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Power_I_Label</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Power I</string>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Current powering the motors</string>
+                                    </property>
+                                </widget>
+                                <widget row="2"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Power_I_Value</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>50</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>acceptDrops</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>0</string>
+                                    </property>
+                                    <property>
+                                        <name>toolTip</name>
+                                        <string>Humidity inside the box</string>
+                                        <comment>Temperature from box</comment>
+                                    </property>
+                                    <property>
+                                        <name>whatsThis</name>
+                                        <string>The measured humidity in the box</string>
+                                    </property>
+                                </widget>
+                            </grid>
+                        </widget>
+                        <widget>
+                            <class>QLayoutWidget</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Layout8</cstring>
+                            </property>
+                            <vbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>0</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QGroupBox</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Info_Box</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>title</name>
+                                        <string>Info</string>
+                                    </property>
+                                    <vbox>
+                                        <property stdset="1">
+                                            <name>margin</name>
+                                            <number>11</number>
+                                        </property>
+                                        <property stdset="1">
+                                            <name>spacing</name>
+                                            <number>6</number>
+                                        </property>
+                                        <widget>
+                                            <class>QLayoutWidget</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>Layout1</cstring>
+                                            </property>
+                                            <grid>
+                                                <property stdset="1">
+                                                    <name>margin</name>
+                                                    <number>0</number>
+                                                </property>
+                                                <property stdset="1">
+                                                    <name>spacing</name>
+                                                    <number>6</number>
+                                                </property>
+                                                <widget row="1"  column="1" >
+                                                    <class>QLineEdit</class>
+                                                    <property stdset="1">
+                                                        <name>name</name>
+                                                        <cstring>Working_I_Value</cstring>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>enabled</name>
+                                                        <bool>false</bool>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>minimumSize</name>
+                                                        <size>
+                                                            <width>50</width>
+                                                            <height>0</height>
+                                                        </size>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>text</name>
+                                                        <string>0</string>
+                                                    </property>
+                                                </widget>
+                                                <widget row="2"  column="0" >
+                                                    <class>QLabel</class>
+                                                    <property stdset="1">
+                                                        <name>name</name>
+                                                        <cstring>Holding_I_Label</cstring>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>text</name>
+                                                        <string>Holding I</string>
+                                                    </property>
+                                                </widget>
+                                                <widget row="0"  column="1" >
+                                                    <class>QLineEdit</class>
+                                                    <property stdset="1">
+                                                        <name>name</name>
+                                                        <cstring>Frequency_Value</cstring>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>enabled</name>
+                                                        <bool>false</bool>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>minimumSize</name>
+                                                        <size>
+                                                            <width>50</width>
+                                                            <height>0</height>
+                                                        </size>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>text</name>
+                                                        <string>0</string>
+                                                    </property>
+                                                </widget>
+                                                <widget row="2"  column="1" >
+                                                    <class>QLineEdit</class>
+                                                    <property stdset="1">
+                                                        <name>name</name>
+                                                        <cstring>Holding_I_Value</cstring>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>enabled</name>
+                                                        <bool>false</bool>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>minimumSize</name>
+                                                        <size>
+                                                            <width>50</width>
+                                                            <height>0</height>
+                                                        </size>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>text</name>
+                                                        <string>0</string>
+                                                    </property>
+                                                </widget>
+                                                <widget row="1"  column="0" >
+                                                    <class>QLabel</class>
+                                                    <property stdset="1">
+                                                        <name>name</name>
+                                                        <cstring>Working_I_Label</cstring>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>text</name>
+                                                        <string>Working I</string>
+                                                    </property>
+                                                </widget>
+                                                <widget row="0"  column="0" >
+                                                    <class>QLabel</class>
+                                                    <property stdset="1">
+                                                        <name>name</name>
+                                                        <cstring>Frequency_Label</cstring>
+                                                    </property>
+                                                    <property stdset="1">
+                                                        <name>text</name>
+                                                        <string>Frequency</string>
+                                                    </property>
+                                                </widget>
+                                            </grid>
+                                        </widget>
+                                        <spacer>
+                                            <property>
+                                                <name>name</name>
+                                                <cstring>Spacer1</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>orientation</name>
+                                                <enum>Vertical</enum>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>sizeType</name>
+                                                <enum>Expanding</enum>
+                                            </property>
+                                            <property>
+                                                <name>sizeHint</name>
+                                                <size>
+                                                    <width>20</width>
+                                                    <height>20</height>
+                                                </size>
+                                            </property>
+                                        </spacer>
+                                        <widget>
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>Set_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>Set</string>
+                                            </property>
+                                        </widget>
+                                    </vbox>
+                                </widget>
+                                <widget>
+                                    <class>QCheckBox</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Motor_Power_Check</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Motor power</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QCheckBox</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Laser_Check</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Laser</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLayoutWidget</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Layout7</cstring>
+                                    </property>
+                                    <hbox>
+                                        <property stdset="1">
+                                            <name>margin</name>
+                                            <number>0</number>
+                                        </property>
+                                        <property stdset="1">
+                                            <name>spacing</name>
+                                            <number>6</number>
+                                        </property>
+                                        <widget>
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>SwitchAllLasersOn</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>All Lasers On</string>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>toggleButton</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>toggleButton</name>
+                                                <bool>false</bool>
+                                            </property>
+                                        </widget>
+                                        <widget>
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>SwitchAllLasersOff</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>All Lasers Off</string>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>toggleButton</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>toggleButton</name>
+                                                <bool>false</bool>
+                                            </property>
+                                        </widget>
+                                    </hbox>
+                                </widget>
+                            </vbox>
+                        </widget>
+                    </hbox>
+                </widget>
+                <widget>
+                    <class>QGroupBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Motors_Box</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>title</name>
+                        <string>Motors</string>
+                    </property>
+                    <vbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>11</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QLayoutWidget</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Layout8</cstring>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>0</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QGroupBox</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>X_Mot_Box</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>title</name>
+                                        <string>X=0</string>
+                                    </property>
+                                    <property>
+                                        <name>layoutSpacing</name>
+                                    </property>
+                                    <grid>
+                                        <property stdset="1">
+                                            <name>margin</name>
+                                            <number>11</number>
+                                        </property>
+                                        <property stdset="1">
+                                            <name>spacing</name>
+                                            <number>0</number>
+                                        </property>
+                                        <widget row="0"  column="0" >
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>X_Inc_100_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>minimumSize</name>
+                                                <size>
+                                                    <width>0</width>
+                                                    <height>0</height>
+                                                </size>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>+100</string>
+                                            </property>
+                                        </widget>
+                                        <widget row="5"  column="0" >
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>X_Dec_10_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>minimumSize</name>
+                                                <size>
+                                                    <width>0</width>
+                                                    <height>0</height>
+                                                </size>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>-10</string>
+                                            </property>
+                                        </widget>
+                                        <widget row="6"  column="0" >
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>X_Dec_100_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>minimumSize</name>
+                                                <size>
+                                                    <width>0</width>
+                                                    <height>0</height>
+                                                </size>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>-100</string>
+                                            </property>
+                                        </widget>
+                                        <widget row="1"  column="0" >
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>X_Inc_10_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>minimumSize</name>
+                                                <size>
+                                                    <width>0</width>
+                                                    <height>0</height>
+                                                </size>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>+10</string>
+                                            </property>
+                                        </widget>
+                                        <spacer row="0"  column="1" >
+                                            <property>
+                                                <name>name</name>
+                                                <cstring>Spacer3_2</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>orientation</name>
+                                                <enum>Horizontal</enum>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>sizeType</name>
+                                                <enum>Expanding</enum>
+                                            </property>
+                                            <property>
+                                                <name>sizeHint</name>
+                                                <size>
+                                                    <width>20</width>
+                                                    <height>20</height>
+                                                </size>
+                                            </property>
+                                        </spacer>
+                                        <spacer row="1"  column="1" >
+                                            <property>
+                                                <name>name</name>
+                                                <cstring>Spacer4_3</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>orientation</name>
+                                                <enum>Horizontal</enum>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>sizeType</name>
+                                                <enum>Expanding</enum>
+                                            </property>
+                                            <property>
+                                                <name>sizeHint</name>
+                                                <size>
+                                                    <width>20</width>
+                                                    <height>20</height>
+                                                </size>
+                                            </property>
+                                        </spacer>
+                                        <spacer row="5"  column="1" >
+                                            <property>
+                                                <name>name</name>
+                                                <cstring>Spacer4_2_2_2_2</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>orientation</name>
+                                                <enum>Horizontal</enum>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>sizeType</name>
+                                                <enum>Expanding</enum>
+                                            </property>
+                                            <property>
+                                                <name>sizeHint</name>
+                                                <size>
+                                                    <width>20</width>
+                                                    <height>20</height>
+                                                </size>
+                                            </property>
+                                        </spacer>
+                                        <spacer row="6"  column="1" >
+                                            <property>
+                                                <name>name</name>
+                                                <cstring>Spacer4_2_2_3_2</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>orientation</name>
+                                                <enum>Horizontal</enum>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>sizeType</name>
+                                                <enum>Expanding</enum>
+                                            </property>
+                                            <property>
+                                                <name>sizeHint</name>
+                                                <size>
+                                                    <width>20</width>
+                                                    <height>20</height>
+                                                </size>
+                                            </property>
+                                        </spacer>
+                                        <widget row="3"  column="0" >
+                                            <class>QLineEdit</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>X_Goto_Value</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>minimumSize</name>
+                                                <size>
+                                                    <width>50</width>
+                                                    <height>0</height>
+                                                </size>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>0</string>
+                                            </property>
+                                        </widget>
+                                        <widget row="3"  column="1" >
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>X_Go_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>minimumSize</name>
+                                                <size>
+                                                    <width>50</width>
+                                                    <height>0</height>
+                                                </size>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>Go</string>
+                                            </property>
+                                        </widget>
+                                    </grid>
+                                </widget>
+                                <widget>
+                                    <class>QGroupBox</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Y_Mot_Box</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>title</name>
+                                        <string>Y=0</string>
+                                    </property>
+                                    <property>
+                                        <name>layoutSpacing</name>
+                                    </property>
+                                    <grid>
+                                        <property stdset="1">
+                                            <name>margin</name>
+                                            <number>11</number>
+                                        </property>
+                                        <property stdset="1">
+                                            <name>spacing</name>
+                                            <number>0</number>
+                                        </property>
+                                        <widget row="6"  column="0" >
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>Y_Dec_100_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>-100</string>
+                                            </property>
+                                        </widget>
+                                        <widget row="5"  column="0" >
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>Y_Dec_10_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>-10</string>
+                                            </property>
+                                        </widget>
+                                        <widget row="0"  column="0" >
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>Y_Inc_100_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>+100</string>
+                                            </property>
+                                        </widget>
+                                        <widget row="1"  column="0" >
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>Y_Inc_10_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>+10</string>
+                                            </property>
+                                        </widget>
+                                        <spacer row="0"  column="1" >
+                                            <property>
+                                                <name>name</name>
+                                                <cstring>Spacer11</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>orientation</name>
+                                                <enum>Horizontal</enum>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>sizeType</name>
+                                                <enum>Expanding</enum>
+                                            </property>
+                                            <property>
+                                                <name>sizeHint</name>
+                                                <size>
+                                                    <width>20</width>
+                                                    <height>20</height>
+                                                </size>
+                                            </property>
+                                        </spacer>
+                                        <spacer row="5"  column="1" >
+                                            <property>
+                                                <name>name</name>
+                                                <cstring>Spacer15</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>orientation</name>
+                                                <enum>Horizontal</enum>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>sizeType</name>
+                                                <enum>Expanding</enum>
+                                            </property>
+                                            <property>
+                                                <name>sizeHint</name>
+                                                <size>
+                                                    <width>20</width>
+                                                    <height>20</height>
+                                                </size>
+                                            </property>
+                                        </spacer>
+                                        <spacer row="6"  column="1" >
+                                            <property>
+                                                <name>name</name>
+                                                <cstring>Spacer16</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>orientation</name>
+                                                <enum>Horizontal</enum>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>sizeType</name>
+                                                <enum>Expanding</enum>
+                                            </property>
+                                            <property>
+                                                <name>sizeHint</name>
+                                                <size>
+                                                    <width>20</width>
+                                                    <height>20</height>
+                                                </size>
+                                            </property>
+                                        </spacer>
+                                        <widget row="3"  column="0" >
+                                            <class>QLineEdit</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>Y_Goto_Value</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>minimumSize</name>
+                                                <size>
+                                                    <width>50</width>
+                                                    <height>0</height>
+                                                </size>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>0</string>
+                                            </property>
+                                        </widget>
+                                        <spacer row="1"  column="1" >
+                                            <property>
+                                                <name>name</name>
+                                                <cstring>Spacer12</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>orientation</name>
+                                                <enum>Horizontal</enum>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>sizeType</name>
+                                                <enum>Expanding</enum>
+                                            </property>
+                                            <property>
+                                                <name>sizeHint</name>
+                                                <size>
+                                                    <width>20</width>
+                                                    <height>20</height>
+                                                </size>
+                                            </property>
+                                        </spacer>
+                                        <widget row="3"  column="1" >
+                                            <class>QPushButton</class>
+                                            <property stdset="1">
+                                                <name>name</name>
+                                                <cstring>Y_Go_Button</cstring>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>enabled</name>
+                                                <bool>false</bool>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>minimumSize</name>
+                                                <size>
+                                                    <width>50</width>
+                                                    <height>0</height>
+                                                </size>
+                                            </property>
+                                            <property stdset="1">
+                                                <name>text</name>
+                                                <string>Go</string>
+                                            </property>
+                                        </widget>
+                                    </grid>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <spacer>
+                            <property>
+                                <name>name</name>
+                                <cstring>Spacer19</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>orientation</name>
+                                <enum>Vertical</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>sizeType</name>
+                                <enum>Expanding</enum>
+                            </property>
+                            <property>
+                                <name>sizeHint</name>
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget>
+                            <class>QLayoutWidget</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Layout7</cstring>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>0</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer17</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Center_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Center</string>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer18</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                            </hbox>
+                        </widget>
+                    </vbox>
+                </widget>
+            </vbox>
+        </widget>
+    </grid>
+</widget>
+<connections>
+    <connection>
+        <sender>Set_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>setParamsSlot()</slot>
+    </connection>
+    <connection>
+        <sender>X_Inc_100_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>incX100Slot()</slot>
+    </connection>
+    <connection>
+        <sender>X_Inc_10_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>incX10Slot()</slot>
+    </connection>
+    <connection>
+        <sender>X_Dec_100_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>decX100Slot()</slot>
+    </connection>
+    <connection>
+        <sender>X_Go_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>goXSlot()</slot>
+    </connection>
+    <connection>
+        <sender>Y_Go_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>goYSlot()</slot>
+    </connection>
+    <connection>
+        <sender>Motor_Power_Check</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>powerMotorsSlot()</slot>
+    </connection>
+    <connection>
+        <sender>Laser_Check</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>switchLaserSlot( bool )</slot>
+    </connection>
+    <connection>
+        <sender>Y_Inc_100_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>incY100Slot()</slot>
+    </connection>
+    <connection>
+        <sender>Y_Inc_10_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>incY10Slot()</slot>
+    </connection>
+    <connection>
+        <sender>Y_Dec_10_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>decY10Slot()</slot>
+    </connection>
+    <connection>
+        <sender>Y_Dec_100_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>decY100Slot()</slot>
+    </connection>
+    <connection>
+        <sender>VideoButton</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>videoSlot()</slot>
+    </connection>
+    <connection>
+        <sender>ExitButton</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>accept()</slot>
+    </connection>
+    <connection>
+        <sender>Center_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>centerSlot()</slot>
+    </connection>
+    <connection>
+        <sender>SwitchAllLasersOff</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>allLasersOffSlot()</slot>
+    </connection>
+    <connection>
+        <sender>SwitchAllLasersOn</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>allLasersOnSlot()</slot>
+    </connection>
+    <connection>
+        <sender>X_Dec_10_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>AdjustMirrorDlgBase</receiver>
+        <slot>decX10Slot()</slot>
+    </connection>
+    <slot access="public">allLasersOffSlot()</slot>
+    <slot access="public">allLasersOnSlot()</slot>
+    <slot access="public">centerSlot()</slot>
+    <slot access="public">decX100Slot()</slot>
+    <slot access="public">decX10Slot()</slot>
+    <slot access="public">decY100Slot()</slot>
+    <slot access="public">decY10Slot()</slot>
+    <slot access="public">goXSlot()</slot>
+    <slot access="public">goYSlot()</slot>
+    <slot access="public">incX100Slot()</slot>
+    <slot access="public">incX10Slot()</slot>
+    <slot access="public">incY100Slot()</slot>
+    <slot access="public">incY10Slot()</slot>
+    <slot access="public">powerMotorsSlot()</slot>
+    <slot access="public">setParamsSlot()</slot>
+    <slot access="public">switchLaserSlot( bool )</slot>
+    <slot access="public">videoSlot()</slot>
+</connections>
+</UI>
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthread.cpp	(revision 3401)
@@ -0,0 +1,97 @@
+// AdjustThread.cpp: Implementierung der Klasse LaserThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "adjustthread.h"
+#include "motorthreaddialog.h"
+#include "threadevent.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcserialport.h"
+#include "amcerror.h"
+#include <qmessagebox.h>
+#include <qevent.h>
+#include <qthread.h>
+#include <qstring.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern AMCSerialPort* g_pPort[];
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+AdjustThread::AdjustThread( QObject* p_pReceiver )
+	: m_pPanel( NULL ), m_pReceiver( p_pReceiver ), m_zOn( false )
+{
+}
+
+AdjustThread::~AdjustThread()
+{
+}
+
+void AdjustThread::run()
+{
+	QString qsMsg;
+	qsMsg.sprintf( "Panel(%d,%d) at Port: %d, Box:%d, Driver:%d",
+			           m_pPanel->i(), m_pPanel->j(),
+                 m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+
+	QTime t;
+	t.start();                          // start clock
+
+	// We use only one motor instance and reuse it for each panel
+	AMCSerialPort* pPort = g_pPort[ m_pPanel->port()-1 ];
+	AMCMotor* pMotor = new AMCMotor( pPort );
+
+	bool zLaser = false;
+	try
+	{
+		pMotor->unselectBox();
+		pMotor->selectBox( m_pPanel->box() );
+		pMotor->selectDriver( m_pPanel->driver() );
+		pMotor->getFrequency();
+
+		int x = m_pPanel->getRefX() - m_pPanel->getX();
+		int y = m_pPanel->getRefY() - m_pPanel->getY();
+		int steps = MAX( abs(x), abs(y) );
+		if( ! ((x == 0) && (y == 0)) )			// only move is necesary
+		{
+			// check that the movement is in the allowed range
+      // of the motors (-2500 - 2500)
+		  if( ( abs(m_pPanel->getRefX()) < 2500 )
+			    &&
+					( abs(m_pPanel->getRefY()) < 2500 ) )
+      {
+			  pMotor->moveMotors(x,y);
+				pMotor->waitForMotors( pMotor->calcTimeout(steps) );
+
+				m_pPanel->setX( m_pPanel->getX() + x );
+				m_pPanel->setY( m_pPanel->getY() + y );
+			}
+		}
+	}
+	catch( AMCError& e )
+	{
+		qsMsg.sprintf( "AMCError: Panel (%d,%d)  Port: %d, Box:%d, Driver:%d -- ",
+			       				m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+		qsMsg.append( e.getErrorText() );
+		QThread::postEvent( m_pReceiver, new ThreadErrorEvent( qsMsg, e ) );
+	}
+	delete pMotor;
+
+	qsMsg.sprintf( "Time: %dms", t.elapsed() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+	QThread::postEvent( m_pReceiver, new QCustomEvent( PROGRESS_EVENT ) );
+
+}
+
+void AdjustThread::setPanel(AMCMirrorPanel* p_pPanel)
+{
+	m_pPanel = p_pPanel;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthread.h	(revision 3401)
@@ -0,0 +1,32 @@
+// AdjustThread.h: Schnittstelle für die Klasse MotorThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef ADJUSTTHREAD_H
+#define ADJUSTTHREAD_H
+
+
+#include <qthread.h>
+
+class AMCMirrorPanel;
+
+class AdjustThread : public QThread
+{
+
+public:
+	AdjustThread( QObject* p_pReceiver );
+	virtual ~AdjustThread();
+
+	void setPanel( AMCMirrorPanel* p_pPanel );
+	void setLaser( bool p_zOn ) { m_zOn = p_zOn; };
+	AMCMirrorPanel* getPanel() { return m_pPanel; };
+
+protected:
+	virtual void run();
+private:
+	AMCMirrorPanel* m_pPanel;
+	QObject*				m_pReceiver;
+	bool						m_zOn;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthreadcontroller.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthreadcontroller.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthreadcontroller.cpp	(revision 3401)
@@ -0,0 +1,40 @@
+// AdjustThreadController.cpp: Implementierung der Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "adjustthreadcontroller.h"
+#include "adjustthread.h"
+#include "amcmirrorpanel.h"
+#include <qthread.h>
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+AdjustThreadController::AdjustThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver )
+	: ThreadController( p_qlPanels, p_pReceiver )
+{
+}
+
+AdjustThreadController::~AdjustThreadController()
+{
+
+}
+
+void AdjustThreadController::run()
+{
+	for( AMCMirrorPanel* pActualPanel = m_qlPanels.first();
+		 pActualPanel; pActualPanel = m_qlPanels.next() )
+	{
+		if( m_zStop )
+			return;
+		AdjustThread* pThread = new AdjustThread( m_pReceiver );
+		pThread->setPanel( pActualPanel );
+		pThread->setLaser( m_zTrue );
+		pThread->start();
+		pThread->wait();
+		delete pThread;
+	}
+
+	return;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthreadcontroller.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthreadcontroller.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/adjustthreadcontroller.h	(revision 3401)
@@ -0,0 +1,20 @@
+// AdjustThreadController.h: Schnittstelle für die Klasse LaserThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef ADJUSTTHREADCONTROLLER_H
+#define ADJUSTTHREADCONTROLLER_H
+
+#include "threadcontroller.h"
+
+class AdjustThreadController : public ThreadController
+{
+public:
+	AdjustThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver );
+	virtual ~AdjustThreadController();
+
+protected:
+	virtual void run();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccmdserversocket.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccmdserversocket.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccmdserversocket.cpp	(revision 3401)
@@ -0,0 +1,108 @@
+// amccmdserversocket.cpp: Implementierung der Klasse CoCoControler.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "amccmdserversocket.h"
+#include "activemirrorcontrol.h"
+#include "cc_defs.h"
+
+#include <qtimer.h>
+#include <qsocket.h>
+#include <qregexp.h>
+#include <qtextstream.h>
+
+#include <stdlib.h>
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+AMCCmdServerSocket::AMCCmdServerSocket( QObject* parent ) :
+	QServerSocket( AMC_CMD_PORT, 0, parent)
+{
+	m_pParent = (ActiveMirrorControl*) parent;
+
+	if ( !ok() ) {
+	    qWarning( "Failed to bind to port %d", AMC_REP_PORT );
+	    exit(1);
+	}
+}
+
+AMCCmdServerSocket::~AMCCmdServerSocket()
+{
+
+}
+
+void AMCCmdServerSocket::newConnection( int socket)
+{
+	QSocket* s = new QSocket(this);
+	connect( s, SIGNAL( readyRead() ), SLOT(readClient()));
+	connect( s, SIGNAL( connectionClosed() ), SLOT(discardClient()));
+  connect( s, SIGNAL( error( int ) ), SLOT( error( int ) ) );
+	s->setSocket(socket);
+
+  connect( &m_qtTimer, SIGNAL( timeout( ) ), SLOT( timeout() ) );
+	m_qtTimer.start( AMC_REPORT_TIMEOUT, true );
+
+	emit newConnect();
+}
+
+void AMCCmdServerSocket::readClient()
+{
+//	qDebug( "msg from CC" );
+	QSocket* socket = (QSocket*)sender();
+	if (socket->canReadLine()) 
+	{
+		QString msg = socket->readLine();
+		if( msg.startsWith("CC-REPORT") )
+		{
+			m_qtTimer.stop();
+			m_qtTimer.start( CC_REPORT_TIMEOUT, true );
+//			qDebug( msg );
+			emit reportFromCC( msg );
+//			m_pParent->setAMCState( iStatus );
+		}
+		else
+		{
+			qDebug( msg );
+			emit cmdFromCC( msg );
+		}
+	}		
+}
+
+void AMCCmdServerSocket::discardClient()
+{
+	QSocket* socket = (QSocket*)sender();
+	delete socket;
+	emit endConnect();
+}
+
+/** Slot called when a TCP error occures. */
+void AMCCmdServerSocket::error( int p_iErrno )
+{
+	QString errText;
+	switch( p_iErrno )
+	{
+	case QSocket::ErrConnectionRefused:
+		errText.sprintf( "TCPIP error: ConnectionRefused" );
+		break;
+	case QSocket::ErrHostNotFound :
+		errText.sprintf( "TCPIP error: HostNotFound " );
+		break;
+	case QSocket::ErrSocketRead :
+		errText.sprintf( "TCPIP error: SocketRead " );
+		break;
+	default:
+		errText.sprintf( "TCPIP error: Unknown" );
+		break;
+	}
+	qDebug( errText );
+	emit errorFromSocket( errText );
+}
+
+
+void AMCCmdServerSocket::timeout()
+{
+//	m_pParent->setAMCState( AMC_STATE_NOT_AVAILABLE );
+}
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccmdserversocket.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccmdserversocket.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccmdserversocket.h	(revision 3401)
@@ -0,0 +1,40 @@
+// amccmdserversocket.h: Schnittstelle für die Klasse CoCoControler.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef AMCCMDSERVERSOCKET_H
+#define AMCCMDSERVERSOCKET_H
+
+#include <qserversocket.h>
+#include <qtimer.h>
+
+class ActiveMirrorControl;
+
+class AMCCmdServerSocket : public QServerSocket
+{
+    Q_OBJECT
+
+public:
+	AMCCmdServerSocket( QObject* parent=0 );
+	virtual ~AMCCmdServerSocket();
+	void newConnection( int socket );
+
+signals:
+    void newConnect();
+    void endConnect();
+    void cmdFromCC( QString p_qsCommand );
+    void reportFromCC( QString p_qsCommand );
+    void errorFromSocket( QString p_qsCommand );
+
+private slots:
+    void readClient();
+    void discardClient();
+    void error( int p_iErrno );
+    void timeout();
+
+private:
+	  ActiveMirrorControl*	m_pParent;
+		QTimer								m_qtTimer;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccmdserversocket.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccmdserversocket.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccmdserversocket.moc.cpp	(revision 3401)
@@ -0,0 +1,163 @@
+/****************************************************************************
+** AMCCmdServerSocket meta object code from reading C++ file 'amccmdserversocket.h'
+**
+** Created: Thu Jan 29 00:51:55 2004
+**      by: The Qt MOC ($Id: amccmdserversocket.moc.cpp,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "amccmdserversocket.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *AMCCmdServerSocket::className() const
+{
+    return "AMCCmdServerSocket";
+}
+
+QMetaObject *AMCCmdServerSocket::metaObj = 0;
+
+void AMCCmdServerSocket::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QServerSocket::className(), "QServerSocket") != 0 )
+	badSuperclassWarning("AMCCmdServerSocket","QServerSocket");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString AMCCmdServerSocket::tr(const char* s)
+{
+    return qApp->translate( "AMCCmdServerSocket", s, 0 );
+}
+
+QString AMCCmdServerSocket::tr(const char* s, const char * c)
+{
+    return qApp->translate( "AMCCmdServerSocket", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* AMCCmdServerSocket::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QServerSocket::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (AMCCmdServerSocket::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    typedef void (AMCCmdServerSocket::*m1_t1)();
+    typedef void (QObject::*om1_t1)();
+    typedef void (AMCCmdServerSocket::*m1_t2)(int);
+    typedef void (QObject::*om1_t2)(int);
+    typedef void (AMCCmdServerSocket::*m1_t3)();
+    typedef void (QObject::*om1_t3)();
+    m1_t0 v1_0 = &AMCCmdServerSocket::readClient;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &AMCCmdServerSocket::discardClient;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &AMCCmdServerSocket::error;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &AMCCmdServerSocket::timeout;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(4);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(4);
+    slot_tbl[0].name = "readClient()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Private;
+    slot_tbl[1].name = "discardClient()";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Private;
+    slot_tbl[2].name = "error(int)";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Private;
+    slot_tbl[3].name = "timeout()";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Private;
+    typedef void (AMCCmdServerSocket::*m2_t0)();
+    typedef void (QObject::*om2_t0)();
+    typedef void (AMCCmdServerSocket::*m2_t1)();
+    typedef void (QObject::*om2_t1)();
+    typedef void (AMCCmdServerSocket::*m2_t2)(QString);
+    typedef void (QObject::*om2_t2)(QString);
+    typedef void (AMCCmdServerSocket::*m2_t3)(QString);
+    typedef void (QObject::*om2_t3)(QString);
+    typedef void (AMCCmdServerSocket::*m2_t4)(QString);
+    typedef void (QObject::*om2_t4)(QString);
+    m2_t0 v2_0 = &AMCCmdServerSocket::newConnect;
+    om2_t0 ov2_0 = (om2_t0)v2_0;
+    m2_t1 v2_1 = &AMCCmdServerSocket::endConnect;
+    om2_t1 ov2_1 = (om2_t1)v2_1;
+    m2_t2 v2_2 = &AMCCmdServerSocket::cmdFromCC;
+    om2_t2 ov2_2 = (om2_t2)v2_2;
+    m2_t3 v2_3 = &AMCCmdServerSocket::reportFromCC;
+    om2_t3 ov2_3 = (om2_t3)v2_3;
+    m2_t4 v2_4 = &AMCCmdServerSocket::errorFromSocket;
+    om2_t4 ov2_4 = (om2_t4)v2_4;
+    QMetaData *signal_tbl = QMetaObject::new_metadata(5);
+    signal_tbl[0].name = "newConnect()";
+    signal_tbl[0].ptr = (QMember)ov2_0;
+    signal_tbl[1].name = "endConnect()";
+    signal_tbl[1].ptr = (QMember)ov2_1;
+    signal_tbl[2].name = "cmdFromCC(QString)";
+    signal_tbl[2].ptr = (QMember)ov2_2;
+    signal_tbl[3].name = "reportFromCC(QString)";
+    signal_tbl[3].ptr = (QMember)ov2_3;
+    signal_tbl[4].name = "errorFromSocket(QString)";
+    signal_tbl[4].ptr = (QMember)ov2_4;
+    metaObj = QMetaObject::new_metaobject(
+	"AMCCmdServerSocket", "QServerSocket",
+	slot_tbl, 4,
+	signal_tbl, 5,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
+
+// SIGNAL newConnect
+void AMCCmdServerSocket::newConnect()
+{
+    activate_signal( "newConnect()" );
+}
+
+// SIGNAL endConnect
+void AMCCmdServerSocket::endConnect()
+{
+    activate_signal( "endConnect()" );
+}
+
+// SIGNAL cmdFromCC
+void AMCCmdServerSocket::cmdFromCC( QString t0 )
+{
+    activate_signal_string( "cmdFromCC(QString)", t0 );
+}
+
+// SIGNAL reportFromCC
+void AMCCmdServerSocket::reportFromCC( QString t0 )
+{
+    activate_signal_string( "reportFromCC(QString)", t0 );
+}
+
+// SIGNAL errorFromSocket
+void AMCCmdServerSocket::errorFromSocket( QString t0 )
+{
+    activate_signal_string( "errorFromSocket(QString)", t0 );
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccommands.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccommands.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amccommands.h	(revision 3401)
@@ -0,0 +1,75 @@
+/***************************************************************************
+                          amccommands.h  -  description
+                             -------------------
+    begin                : Sun Nov 24 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+// Definitions of the individual commands of the AMC
+// controler box.
+
+#define IDS_COMMAND_BOX 					"B%02d\r"
+#define IDS_COMMAND_UNSELECT_BOX			"U\r"
+#define IDS_COMMAND_RESET					"R\r"
+#define IDS_COMMAND_INFO					"G\r"
+#define IDS_COMMAND_QUERY					"Q\r"
+#define IDS_COMMAND_DRIVER					"D%d\r"
+#define IDS_COMMAND_DRIVER_RESET			"DR\r"
+#define IDS_COMMAND_KILL					"K\r"
+#define IDS_COMMAND_CENTER					"C\r"
+#define IDS_COMMAND_LASER_ON				"L+\r"
+#define IDS_COMMAND_LASER_OFF				"L-\r"
+#define IDS_COMMAND_POWER_ON				"P+\r"
+#define IDS_COMMAND_POWER_OFF				"P-\r"
+#define IDS_COMMAND_MOVE					"MX%dY%d\r"
+#define IDS_COMMAND_PERIOD					"Nx%dY%dN%d\r"
+#define IDS_COMMAND_FREQUENCY_READ			"FR\r"
+#define IDS_COMMAND_FREQUENCY_WRITE			"FW%d\r"
+#define IDS_COMMAND_WORKING_READ			"WR\r"
+#define IDS_COMMAND_WORKING_WRITE			"WW%d\r"
+#define IDS_COMMAND_HOLDING_READ			"HR\r"
+#define IDS_COMMAND_HOLDING_WRITE			"HW%d\r"
+#define IDS_COMMAND_TEMP_LOW_READ			"VRLT\r"
+#define IDS_COMMAND_TEMP_LOW_WRITE			"VWLT%d\r"
+#define IDS_COMMAND_TEMP_HIGH_READ			"VRHT\r"
+#define IDS_COMMAND_TEMP_HIGH_WRITE			"VWHT%d\r"
+#define IDS_COMMAND_HUMIDITY_LOW_READ		"VRLH\r"
+#define IDS_COMMAND_HUMIDITY_LOW_WRITE		"VWLH%d\r"
+#define IDS_COMMAND_HUMIDITY_HIGH_READ		"VRHH\r"
+#define IDS_COMMAND_HUMIDITY_HIGH_WRITE		"VWHH%d\r"
+#define IDS_COMMAND_I_POWER_LOW_READ		"VRLI\r"
+#define IDS_COMMAND_I_POWER_LOW_WRITE		"VWLI%d\r"
+#define IDS_COMMAND_I_POWER_HIGH_READ		"VRHI\r"
+#define IDS_COMMAND_I_POWER_HIGHH_WRITE		"VWHI%d\r"
+#define IDS_COMMAND_V_POWER_LOW_READ		"VRLV\r"
+#define IDS_COMMAND_V_POWER_LOW_WRITE		"VWLV%d\r"
+#define IDS_COMMAND_V_POWER_HIGH_READ		"VRHV\r"
+#define IDS_COMMAND_V_POWER_HIGH_WRITE		"VWHV%d\r"
+#define IDS_COMMAND_V_SECONDARY_LOW_READ	"VRLS\r"
+#define IDS_COMMAND_V_SECONDARY_LOW_WRITE	"VWLS%d\r"
+#define IDS_COMMAND_V_SECONDARY_HIGH_READ	"VRHS\r"
+#define IDS_COMMAND_V_SECONDARY_HIGH_WRITE	"VWHS%d\r"
+#define IDS_COMMAND_V_LOGICAL_LOW_READ		"VRLL\r"
+#define IDS_COMMAND_V_LOGICAL_LOW_WRITE		"VWLL%d\r"
+#define IDS_COMMAND_V_LOGICAL_HIGH_READ		"VRHL\r"
+#define IDS_COMMAND_V_LOGICAL_HIGH_WRITE	"VWHL%d\r"
+#define IDS_COMMAND_TUNE_READ_DIR_X			"TRDX\r"
+#define IDS_COMMAND_TUNE_WRITE_DIR_X		"TWDX%X\r"
+#define IDS_COMMAND_TUNE_READ_DIR_Y			"TRDY\r"
+#define IDS_COMMAND_TUNE_WRITE_DIR_Y		"TWDY%X\r"
+#define IDS_COMMAND_TUNE_READ_POS_LIMIT_X	"TRPX\r"
+#define IDS_COMMAND_TUNE_WRITE_POS_LIMIT_X	"TWPX%X\r"
+#define IDS_COMMAND_TUNE_READ_POS_LIMIT_Y	"TRPY\r"
+#define IDS_COMMAND_TUNE_WRITE_POS_LIMIT_Y	"TWPY%X\r"
+#define IDS_COMMAND_TUNE_READ_NEG_LIMIT_X	"TRNX\r"
+#define IDS_COMMAND_TUNE_WRITE_NEG_LIMIT_X	"TWNX%X\r"
+#define IDS_COMMAND_TUNE_READ_NEG_LIMIT_Y	"TRNY\r"
+#define IDS_COMMAND_TUNE_WRITE_NEG_LIMIT_Y	"TWNY%X\r"
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcdefs.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcdefs.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcdefs.h	(revision 3401)
@@ -0,0 +1,31 @@
+/***************************************************************************
+                          amcdefs.h  -  description
+                             -------------------
+    begin                : Tue Jan 27 2004
+    copyright            : (C) 2004 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#define CAMERA_X		316			
+#define CAMERA_Y		248					
+
+#define LED1_X			159
+#define LED1_Y			136
+
+#define LED2_X			464
+#define LED2_Y			131
+
+#define LED3_X			163
+#define LED3_Y			376
+
+#define LED4_X			467
+#define LED4_Y			371
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcerror.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcerror.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcerror.cpp	(revision 3401)
@@ -0,0 +1,70 @@
+/***************************************************************************
+                          amcerror.cpp  -  description
+                             -------------------
+    begin                : Sun Nov 24 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#include <qstring.h>
+#include <qdatetime.h>
+#include <qregexp.h>
+#include "amcerror.h"
+
+AMCError::AMCError( const char* p_sError, int p_iDriver ) : m_iDriver(p_iDriver)
+{
+	m_time = QDateTime::currentDateTime();
+	setErrorText( p_sError );
+}
+
+AMCError::~AMCError(){
+}
+
+/** Set the number of the driver generating the error */
+void AMCError::setDriver( int p_iDriver )
+{
+	m_iDriver = p_iDriver;
+}
+
+/** Set the text describing the error condition. */
+void AMCError::setErrorText( const char* p_sError )
+{
+	m_sError = QString::fromLocal8Bit( p_sError );
+}
+
+/** Return a reference to the string describing the error. */
+const QString& AMCError::getErrorText() const
+{
+	return m_sError;
+}
+
+/** No descriptions */
+QString AMCError::formatError( int iNumSpace ) const
+{
+	// Generate a string containing the given numer of spaces
+	// for formating the message.
+	QString	spaceString;
+	spaceString.fill( QChar( ' ' ), iNumSpace);
+	
+	QString sResult;
+	sResult += spaceString + m_sError + "\n";
+	if( !m_sCommand.isEmpty() )
+		sResult += spaceString + "Command:  " + QString( m_sCommand ).replace( QRegExp("/010"), "" );
+	if( !m_sResponse.isEmpty() )
+	{
+		sResult += spaceString + " Response: " + QString( m_sResponse ).replace( QRegExp("/010"), "" );
+		QString qsTemp;
+		for( int i=0; i< m_sResponse.length(); i++)
+			sResult += qsTemp.sprintf(" %02X",(unsigned char) m_sResponse[i]);
+	}
+	sResult += "\n";
+	
+	return sResult;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcerror.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcerror.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcerror.h	(revision 3401)
@@ -0,0 +1,62 @@
+/***************************************************************************
+                          amcerror.h  -  description
+                             -------------------
+    begin                : Sun Nov 24 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#ifndef AMCERROR_H
+#define AMCERROR_H
+
+#include <qstring.h>
+#include <qdatetime.h>
+
+/**
+  * This class intended to be used as the exception class
+  * we throw when we encounter an error.
+  *@author Martin Merck
+  */
+
+class AMCError {
+public: 
+	AMCError( const char* p_sError = 0, int p_iDriver = 0 );
+	~AMCError();
+	/** Return the driver number of the driver generating the error. */
+	int getDriver() const { return m_iDriver; }
+	/** Set the driver number of the driver generating the error. */
+	void setDriver( int p_iDriver );
+	/** return the Panel originating the error. */
+	void getPanel( int& p_iX, int& p_iY) const { p_iX = m_iX; p_iY = m_iY;  }
+	/** Set the Panel originating the error. */
+	void setPanel( int p_iX, int p_iY) { m_iX = p_iX; m_iY = p_iY;  }
+	/** Return a reference to the string describing the error. */
+	const QString& getErrorText() const;
+	/** Set the text describing the error condition. */
+	void setErrorText( const char* p_sError );
+	/** No descriptions */
+	void setCommand( QCString p_sCommand ) { m_sCommand = p_sCommand; }
+	/** No descriptions */
+	void setResponse( QCString p_sResponse ) { m_sResponse = p_sResponse; }
+	/** No descriptions */
+	QString formatError( int iNumSpace = 0 ) const;
+private: // Private attributes
+	/** Description of the error */
+	/**  */
+ 	QCString m_sCommand;
+ 	QCString m_sResponse;
+	QString m_sError;
+  int m_iDriver;
+  int m_iX, m_iY;
+	/**  */
+	QDateTime m_time;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcerrors.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcerrors.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcerrors.h	(revision 3401)
@@ -0,0 +1,54 @@
+/***************************************************************************
+                          amcerrors.h  -  description
+                             -------------------
+    begin                : Sun Nov 24 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+// Definitions serial port errors
+// the AMC due to problems sending commands
+#define IDS_ERROR_PORT_OPEN					"Can't open serial device"
+#define IDS_ERROR_PORT_GET_ATTR				"Can't get TERMIO data structre from serial port"
+#define IDS_ERROR_PORT_SET_ATTR				"Can't set TERMIO data structre for serial port"
+
+
+// Definitions of errors and warnings send by
+// the AMC contorller
+#define IDS_ERROR_NOERROR					"No error!"
+#define IDS_ERROR_UNKNOWN					"Unknown AMC error!"
+#define IDS_ERROR_SPI_OVERFLOW				"Overflow of SPI buffer!"
+#define IDS_ERROR_SPI_WTIMEOUT				"SPI write timeout!"
+#define IDS_ERROR_SPI_RTIMEOUT				"SPI read timeout!"
+#define IDS_ERROR_BAD_ARGUMENT				"Bad argument in AMC command!"
+#define IDS_ERROR_NO_DRIVER					"AMC command send with no driver selected!"
+#define IDS_ERROR_BAD_DRIVER				"AMC command to select a driver with wrong driver number!"
+#define IDS_ERROR_TEMP_RANGE				"Temperature information from AMC box is out of range!"
+#define IDS_ERROR_HUMIDITY_RANGE			"Humidity information from AMC box is out of range!"
+#define IDS_ERROR_I_POWER_RANGE				"Power supply current information from AMC box is out of range!"
+#define IDS_ERROR_V_POWER_RANGE				"Power supply voltage information from AMC box is out of range!"
+#define IDS_ERROR_V_SECONDARY_RANGE			"Secondary supply voltage information from AMC box is out of range!"
+#define IDS_ERROR_V_LOGICAL_RANGE			"Logical supply voltage information from AMC box is out of range!"
+
+
+// Definitions of errors and warnings send by
+// the AMC due to problems sending commands
+#define IDS_ERROR_NO_RESPONSE				"AMC controller didn't respond to command"
+#define IDS_ERROR_NO_AMC_STATUS				"AMC controller didn't respond with an allowed status. We may have lost part of the response"
+#define IDS_ERROR_MOVEMENT_TIMEOUT			"The motor movement didn't complete in the expected time. We killed the movement and reseted the driver."
+#define IDS_WARNING_WRONG_TUNING			"Attention!!! The settings are not valid. They will be resetted to the default values now!"
+
+
+// Definitions of errors and warnings generated
+// when laser adjusting the mirror
+#define IDS_ERROR_NO_SPOT				"No video spot found"
+#define IDS_ERROR_MULTI_SPOT				"Multiple video spot found"
+#define IDS_ERROR_NO_CONVERGENCE				"Laser adjustment didn't converge"
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcframegrabber.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcframegrabber.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcframegrabber.cpp	(revision 3401)
@@ -0,0 +1,278 @@
+#include "amcframegrabber.h"
+#include <qdatetime.h>
+#include <qtimer.h>
+#include <qthread.h>
+
+AMCFrameGrabber::AMCFrameGrabber()
+{
+	m_pMutex = new QMutex();
+
+	m_iOffset = 0;
+	
+	// assign /dev/video0 to device if none is assigned.
+	m_pDevice = "/dev/video0";
+  
+	//opens the fgrabber for reading only.
+	m_iVid = open(m_pDevice, O_RDONLY);
+	if (m_iVid < 0)
+	{
+		fprintf(stderr, "Can't open %s\n", m_pDevice);
+	}
+
+	getPixelFormats();
+	getVideoStandards();
+	getStandard();
+	setStandardPAL();
+	getStandard();
+	getBufferFormats();
+	getControls();
+
+	// finds out what the fgrabber is capable of
+	m_iErr = ioctl(m_iVid, VIDIOC_QUERYCAP, &m_stCap);
+	if (m_iErr)
+	{
+		fprintf(stderr, "QUERYCAP returned error %d\n", errno);
+		close(m_iVid);
+	}
+
+	qDebug( "Device:    %s", m_stCap.name);
+	qDebug( "Type:      %d", m_stCap.type);
+	qDebug( "Inputs:    %d", m_stCap.inputs);
+	qDebug( "Outputs:   %d", m_stCap.outputs);
+	qDebug( "MaxWidth:  %d", m_stCap.maxwidth);
+	qDebug( "MaxHeight: %d", m_stCap.maxheight);
+	qDebug( "MinWidth:  %d", m_stCap.minwidth);
+	qDebug( "MinHeight: %d", m_stCap.minheight);
+	qDebug( "F-rate:    %d", m_stCap.maxframerate);
+
+	// check if it is an image capturing device
+	if (m_stCap.type != V4L2_TYPE_CAPTURE)
+  {
+		fprintf( stderr, "Device %s is not a video capture device.\n", m_pDevice);
+		close(m_iVid);
+	}
+  
+	// check if the device can be read like a file.
+	if (!(m_stCap.flags & V4L2_FLAG_READ))
+	{
+		fprintf(stderr, "Device %s doesn't support read().\n", m_pDevice);
+		close(m_iVid);
+	}
+
+	// getting the available formats.
+	m_stFmt.type = V4L2_BUF_TYPE_CAPTURE;
+	m_iErr = ioctl(m_iVid, VIDIOC_G_FMT, &m_stFmt);
+	if (m_iErr)
+	{
+		fprintf(stderr, "G_FMT returned error %d\n", errno);
+		close(m_iVid);
+	}
+  
+	//assigning desired format
+	m_stFmt.fmt.pix.flags = FMT_FLAG;
+	m_stFmt.fmt.pix.width = MY_WIDTH;
+	m_stFmt.fmt.pix.height = MY_HEIGHT;
+	m_stFmt.fmt.pix.pixelformat = MY_PIXEL_FORMAT;
+	m_iErr = ioctl(m_iVid, VIDIOC_S_FMT, &m_stFmt);
+	if (m_iErr)
+	{
+		fprintf(stderr, "S_FMT returned error %d\n", errno);
+		close(m_iVid);
+	}
+	qDebug( "Width: %d", m_stFmt.fmt.pix.width);
+	qDebug( "Height: %d", m_stFmt.fmt.pix.height);
+	qDebug( "Size: %d", m_stFmt.fmt.pix.sizeimage);
+	m_iBuffsize = m_stFmt.fmt.pix.sizeimage;
+
+};
+
+AMCFrameGrabber::~AMCFrameGrabber()
+{
+	//closing the device and freeing allocated memory.
+	close(m_iVid);
+};
+
+u_int AMCFrameGrabber::getBuffsize() const
+{
+	return m_iBuffsize;
+};
+
+int AMCFrameGrabber::grabFrame(u_char *data)
+{
+  fd_set rfds;
+  FD_ZERO(&rfds);
+  FD_SET( m_iVid, &rfds);
+  struct timeval tv;
+  tv.tv_sec = 0;
+  tv.tv_usec = 1000;
+  int retval = select(m_iVid+1, &rfds, NULL, NULL, &tv);
+  if( ! retval )
+    qDebug("Timed out waiting for frame");
+
+  int n;
+  n = read(m_iVid, data, m_stFmt.fmt.pix.sizeimage);
+
+  //one can do a tricky thing with pointers.
+    
+	if (n < 0)
+	{
+		fprintf(stderr, "read()3 returned error %d\n", errno);
+		perror("Descripton");
+//		close(vid);
+		return -1;
+	}
+  
+	return n;
+};
+
+/**  */
+void AMCFrameGrabber::getPixelFormats( )
+{
+  // Enum the supported pixel formats
+  qDebug("Pixel formats:");
+  for(int i=0;;i++)
+  {
+    m_stFmtDesc.index = i;
+    int err = ioctl(m_iVid, VIDIOC_ENUM_PIXFMT, &m_stFmtDesc);
+    if (err)
+      break;
+    qDebug("Index:          %d", m_stFmtDesc.index);
+    qDebug("Description:    %s", m_stFmtDesc.description);
+    qDebug("Flags:          %d", m_stFmtDesc.flags);
+    qDebug("Depth:          %d\n", m_stFmtDesc.depth);
+
+  }
+}
+
+/**  */
+void AMCFrameGrabber::getBufferFormats( )
+{
+  // Enum the supported frame buffer formats
+  qDebug("Buffer formats:");
+  for(int i=0;;i++)
+  {
+    m_stFmtDesc.index = i;
+    int err = ioctl(m_iVid, VIDIOC_ENUM_FBUFFMT, &m_stFmtDesc);
+    if (err)
+      break;
+    qDebug("Index:          %d", m_stFmtDesc.index);
+    qDebug("Description:    %s", m_stFmtDesc.description);
+    qDebug("Flags:          %d", m_stFmtDesc.flags);
+    qDebug("Depth:          %d\n", m_stFmtDesc.depth);
+
+  }
+}
+
+/**  */
+void AMCFrameGrabber::getVideoStandards( )
+{
+  // Enum the supported frame buffer formats
+  qDebug("Video formats:");
+  for(int i=0;;i++)
+  {
+    m_stEnumStd.index = i;
+    int err = ioctl(m_iVid, VIDIOC_ENUMSTD, &m_stEnumStd);
+    if (err)
+      break;
+    qDebug("Name:                  %s", m_stEnumStd.std.name);
+    qDebug("Length:                %d", strlen(m_stEnumStd.std.name));
+    qDebug("Framerate Numerator:   %d", m_stEnumStd.std.framerate.numerator);
+    qDebug("Framerate Denominator: %d", m_stEnumStd.std.framerate.denominator);
+    qDebug("Framelines  :          %d", m_stEnumStd.std.framelines);
+    qDebug("Inputs  :              %X\n", m_stEnumStd.inputs);
+    if(strcmp( m_stEnumStd.std.name, "PAL" ) == 0)
+			m_stStdPAL = m_stEnumStd.std;
+    if(strcmp( m_stEnumStd.std.name, "NTSC" ) == 0)
+			m_stStdNTSC = m_stEnumStd.std;
+  }
+}
+
+/**  */
+void AMCFrameGrabber::getStandard()
+{
+  // Enum the supported frame buffer formats
+  qDebug("Actual video standard:");
+  int err = ioctl(m_iVid, VIDIOC_G_STD, &m_stStandard);
+  qDebug("Name:                  %s\n", m_stStandard.name);
+}
+
+/**  */
+void AMCFrameGrabber::setStandardPAL()
+{
+  // Enum the supported frame buffer formats
+  int err = ioctl(m_iVid, VIDIOC_S_STD, &m_stStdPAL);
+}
+
+/**  */
+void AMCFrameGrabber::setStandardNTSC()
+{
+  // Enum the supported frame buffer formats
+  int err = ioctl(m_iVid, VIDIOC_S_STD, &m_stStdNTSC);
+}
+
+/**  */
+void AMCFrameGrabber::getControls( )
+{
+  // Enum the supported frame buffer formats
+//  qDebug("Controls:");
+  for(int i=V4L2_CID_BASE;;i++)
+  {
+    m_stCtrlDesc.id = i;
+    int err = ioctl(m_iVid, VIDIOC_QUERYCTRL, &m_stCtrlDesc);
+    if (err)
+		{
+      break;
+		}
+
+		// Skip disabled controls
+		if( m_stCtrlDesc.flags == V4L2_CTRL_FLAG_DISABLED )
+			continue;
+/*    qDebug( "  Name:       %s (%d)  %3d-%3d  Step: %2d  Def: %3d Group: %s",
+					  m_stCtrlDesc.name,
+					  m_stCtrlDesc.id,
+					  m_stCtrlDesc.minimum,
+					  m_stCtrlDesc.maximum,
+					  m_stCtrlDesc.step,
+					  m_stCtrlDesc.default_value,
+					  m_stCtrlDesc.group );
+*/
+  }
+//  qDebug("Controls2:");
+  for(int i=V4L2_CID_PRIVATE_BASE;;i++)
+  {
+    m_stCtrlDesc.id = i;
+    int err = ioctl(m_iVid, VIDIOC_QUERYCTRL, &m_stCtrlDesc);
+    if (err)
+		{
+      break;
+		}
+/*    qDebug( "  Name:       %s (%d)  %3d-%3d  Step: %2d  Def: %3d Group: %s",
+					  m_stCtrlDesc.name,
+					  m_stCtrlDesc.id,
+					  m_stCtrlDesc.minimum,
+					  m_stCtrlDesc.maximum,
+					  m_stCtrlDesc.step,
+					  m_stCtrlDesc.default_value,
+					  m_stCtrlDesc.group );
+*/
+  }
+
+}
+
+/** Set the control. */
+void AMCFrameGrabber::setControl( unsigned int p_iCtrl, int p_iValue )
+{
+	v4l2_control stCtrl;
+  stCtrl.id = p_iCtrl;
+	stCtrl.value = p_iValue;
+  int err = ioctl(m_iVid, VIDIOC_S_CTRL, &stCtrl);
+}
+
+/** Get the control. */
+int AMCFrameGrabber::getControl( unsigned int p_iCtrl )
+{
+	v4l2_control stCtrl;
+  stCtrl.id = p_iCtrl;
+  int err = ioctl(m_iVid, VIDIOC_G_CTRL, &stCtrl);
+	return stCtrl.value;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcframegrabber.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcframegrabber.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcframegrabber.h	(revision 3401)
@@ -0,0 +1,129 @@
+/***************************************************************************
+                          AMCMirrorPanel.h  -  description
+                             -------------------
+    begin                : Sat Nov 23 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.                                    *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef AMCFRAMEGRABBER_H
+#define AMCFRAMEGRABBER_H
+
+
+/**
+  *@author Martin Merck
+  */
+
+#include <sys/time.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <sys/ioctl.h>
+#include <fcntl.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <sys/mman.h>
+#include <errno.h>
+#include <qobject.h>
+
+/* Video for Linux Two */
+#include </usr/src/linux/include/linux/videodev.h>
+
+#define FMT_FLAG V4L2_FMT_FLAG_INTERLACED
+//#define FMT_FLAG V4L2_FMT_FLAG_INTERLACED
+
+#define MY_WIDTH  640
+#define MY_HEIGHT 480
+//#define MY_DEPTH  3
+#define MY_DEPTH  4
+//#define MY_WIDTH  768
+//#define MY_HEIGHT 576
+//#define MY_WIDTH  320
+//#define MY_HEIGHT 240
+#define BUFSIZE		(MY_WIDTH * MY_HEIGHT * MY_DEPTH)
+
+//#define MY_PIXEL_FORMAT V4L2_PIX_FMT_BGR24
+#define MY_PIXEL_FORMAT V4L2_PIX_FMT_BGR32
+
+class QMutex;
+
+class AMCFrameGrabber : public QObject
+{
+   Q_OBJECT
+
+public:
+	AMCFrameGrabber();
+	virtual ~AMCFrameGrabber();
+	
+	virtual int grabFrame( uchar* p_pData );
+
+	virtual uint getBuffsize() const;
+	/** */
+	virtual int getBrightness() { return( getControl( V4L2_CID_BRIGHTNESS ) ); };
+	/** */
+	virtual int getContrast() { return( getControl( V4L2_CID_CONTRAST ) ); };
+	/** */
+	virtual int getSaturation() { return( getControl( V4L2_CID_SATURATION ) ); };
+	/** */
+	virtual int getHue() { return( getControl( V4L2_CID_HUE ) ); };
+	/** */
+	virtual QMutex* getMutex() { return( m_pMutex ); };
+
+protected: // Protected methods
+	virtual void getPixelFormats();
+	/** */
+	virtual void getBufferFormats();
+	/** */
+	virtual void getVideoStandards();
+	/** */
+	virtual void getStandard();
+	/** */
+	virtual void setStandardPAL();
+	/** */
+	virtual void setStandardNTSC();
+	/** */
+	virtual void getControls();
+	/** */
+	virtual void setControl( unsigned int p_iCtrl, int p_iValue );
+	/** */
+	virtual int getControl( unsigned int p_iCtrl );
+	
+public slots: // Public slots
+  /** Set the birghtness control. */
+  void setBrightness( int p_iBrightness ) { setControl( V4L2_CID_BRIGHTNESS, p_iBrightness); };
+  /** Set the contrast control. */
+  void setContrast( int p_iContrast) { setControl( V4L2_CID_CONTRAST, p_iContrast); };
+  /** Set the birghtness control. */
+  void setSaturation( int p_iSaturation ) { setControl( V4L2_CID_SATURATION, p_iSaturation); };
+  /** Set the contrast control. */
+  void setHue( int p_iHue ) { setControl( V4L2_CID_HUE, p_iHue); };
+
+private: // Private attributes
+	/** Offset into data buffer where to start next send */
+	int											m_iOffset;
+	
+	char*										m_pDevice;
+	int											m_iVid;
+	int											m_iErr;
+	int											m_iBuffsize;
+	struct v4l2_capability	m_stCap;
+	struct v4l2_format			m_stFmt;
+  struct v4l2_fmtdesc	 		m_stFmtDesc;
+  struct v4l2_queryctrl		m_stCtrlDesc;
+	struct v4l2_enumstd			m_stEnumStd;
+	struct v4l2_standard		m_stStandard;
+	struct v4l2_standard		m_stStdPAL;
+	struct v4l2_standard		m_stStdNTSC;
+	QMutex*									m_pMutex;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcframegrabber.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcframegrabber.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcframegrabber.moc.cpp	(revision 3401)
@@ -0,0 +1,102 @@
+/****************************************************************************
+** AMCFrameGrabber meta object code from reading C++ file 'amcframegrabber.h'
+**
+** Created: Thu Jan 29 00:51:59 2004
+**      by: The Qt MOC ($Id: amcframegrabber.moc.cpp,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "amcframegrabber.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *AMCFrameGrabber::className() const
+{
+    return "AMCFrameGrabber";
+}
+
+QMetaObject *AMCFrameGrabber::metaObj = 0;
+
+void AMCFrameGrabber::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QObject::className(), "QObject") != 0 )
+	badSuperclassWarning("AMCFrameGrabber","QObject");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString AMCFrameGrabber::tr(const char* s)
+{
+    return qApp->translate( "AMCFrameGrabber", s, 0 );
+}
+
+QString AMCFrameGrabber::tr(const char* s, const char * c)
+{
+    return qApp->translate( "AMCFrameGrabber", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* AMCFrameGrabber::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QObject::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (AMCFrameGrabber::*m1_t0)(int);
+    typedef void (QObject::*om1_t0)(int);
+    typedef void (AMCFrameGrabber::*m1_t1)(int);
+    typedef void (QObject::*om1_t1)(int);
+    typedef void (AMCFrameGrabber::*m1_t2)(int);
+    typedef void (QObject::*om1_t2)(int);
+    typedef void (AMCFrameGrabber::*m1_t3)(int);
+    typedef void (QObject::*om1_t3)(int);
+    m1_t0 v1_0 = &AMCFrameGrabber::setBrightness;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &AMCFrameGrabber::setContrast;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &AMCFrameGrabber::setSaturation;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &AMCFrameGrabber::setHue;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(4);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(4);
+    slot_tbl[0].name = "setBrightness(int)";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "setContrast(int)";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    slot_tbl[2].name = "setSaturation(int)";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Public;
+    slot_tbl[3].name = "setHue(int)";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"AMCFrameGrabber", "QObject",
+	slot_tbl, 4,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclog.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclog.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclog.cpp	(revision 3401)
@@ -0,0 +1,75 @@
+/***************************************************************************
+                          amclog.cpp  -  description
+                             -------------------
+    begin                : Mon Aug 25 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.				                 	   *
+ ***************************************************************************/
+
+#include <qfile.h>
+#include <qstring.h>
+#include <qdatetime.h>
+#include <qregexp.h>
+#include <qtextstream.h>
+#include "amclog.h"
+#include "amcerror.h"
+
+AMCLog::AMCLog()
+{
+	QDateTime theDT = QDateTime::currentDateTime();
+	QDate theDate = theDT.date();
+	QTime theTime = theDT.time();
+	QString qsFileName;
+	qsFileName.sprintf( "/home/amc/data/AMC_%04d_%02d_%02d_%02d_%02d_%02d.log",
+                      theDate.year(), theDate.month(), theDate.day(),
+                      theTime.hour(), theTime.minute(), theTime.second() );
+	m_qfFile.setName( qsFileName );
+	if( ! m_qfFile.open( IO_WriteOnly ) )
+	{
+		qDebug( "ERROR: Can't open file: %s\n", qsFileName.latin1() );
+	}
+	m_qtsStream.setDevice( &m_qfFile );
+	m_qtsStream	<< "AMC Log started at: " << theDT.toString() << endl;
+	m_qfFile.flush();
+}
+
+AMCLog::~AMCLog()
+{
+	QDateTime theDT = QDateTime::currentDateTime();
+	m_qtsStream	<< "AMC Log closed at:  " << theDT.toString() << endl;
+	m_qfFile.close();
+}
+
+void AMCLog::logError( const QString& p_qsMsg1, const AMCError& e )
+{
+	QDateTime theDT = QDateTime::currentDateTime();
+	m_qtsStream << "ERROR: " << "[ " << theDT.toString() << "]" << endl;
+	m_qtsStream << "       " << p_qsMsg1 << endl;
+	m_qtsStream << e.formatError(7) << endl;
+	m_qfFile.flush();
+}
+
+void AMCLog::logWarning( const QString& p_qsMsg1, const QString& p_qsMsg2 )
+{
+	QDateTime theDT = QDateTime::currentDateTime();
+	m_qtsStream << "[" << theDT.toString() << " " << p_qsMsg1 << "]" << endl;
+	m_qtsStream << QString( p_qsMsg2 ).replace( QRegExp("/012"), "" ) << endl << endl;
+	m_qfFile.flush();
+}
+
+void AMCLog::logInfo( const QString& p_qsMsg1, const QString& p_qsMsg2 )
+{
+	QDateTime theDT = QDateTime::currentDateTime();
+	m_qtsStream << "[" << theDT.toString() << " " << p_qsMsg1 << "]" << endl;
+	m_qtsStream << QString( p_qsMsg2 ).replace( QRegExp("/012"), "" ) << endl << endl;
+	m_qfFile.flush();
+}
+
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclog.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclog.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclog.h	(revision 3401)
@@ -0,0 +1,46 @@
+/***************************************************************************
+                          amclog.h  -  description
+                             -------------------
+    begin                : Mon Aug 25 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.			                		   *
+ ***************************************************************************/
+
+#ifndef AMCLOG_H
+#define AMCLOG_H
+
+#include <qfile.h>
+#include <qtextstream.h>
+
+/**
+  * This class intended to be used as the exception class
+  * we throw when we encounter an error.
+  *@author Martin Merck
+  */
+
+class AMCError;
+class QString;
+
+class AMCLog {
+public: 
+	AMCLog();
+	~AMCLog();
+	/** Log an error to the logfile. */
+	void logError( const QString& p_qsMsg1, const AMCError& e );
+	/** Log an error to the logfile. */
+	void logWarning( const QString& p_qsMsg1, const QString& p_qsMsg2 );
+	/** Log an error to the logfile. */
+	void logInfo( const QString& p_qsMsg1, const QString& p_qsMsg2 );
+private: // Private attributes
+	QFile					m_qfFile;
+	QTextStream		m_qtsStream;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclookuptable.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclookuptable.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclookuptable.cpp	(revision 3401)
@@ -0,0 +1,152 @@
+/***************************************************************************
+                          amclookuptable.cpp  -  description
+                             -------------------
+    begin                : Sun Sep 28 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "amclookuptable.h"
+#include "amcmirrorpanel.h"
+#include "magicmirror.h"
+#include "math.h"
+#include "stdlib.h"
+#include <qdir.h>
+#include <qfile.h>
+#include <qstring.h>
+#include <qdatetime.h>
+#include <qtextstream.h>
+
+extern MagicMirror*		g_theMirror;
+
+
+/** Static method to find the next matching LUT */
+QString AMCLookUpTable::findLUT( double p_dZd, double p_dAz )
+{
+	// Round Zenith distance and Azimuth to next ten degree value
+	int iZd = (int) (rint( p_dZd ));
+	int iAz  = (int) (rint( p_dAz ));
+	qDebug( "Searching for LUT near Alt: %2d Az: %3d", iZd, iAz );
+
+	QDir shareDir( "/home/amc/share/amc", "*.lut" );
+
+	int iZdMin = 90;
+	int iAzMin = 360;
+	int iIndex = -1;
+	for ( unsigned int i=0; i<shareDir.count(); i++ )
+	{
+		int iFileZd = shareDir[i].mid(5,2).toInt();
+
+		if( abs( iZd - iFileZd ) <= iZdMin )
+		{
+			iZdMin = abs( iZd - iFileZd );
+		}
+	}
+
+	for ( unsigned int i=0; i<shareDir.count(); i++ )
+	{
+		int iFileZd = shareDir[i].mid(5,2).toInt();
+		int iFileAz = shareDir[i].mid(8,3).toInt();
+
+		if( abs( iZd - iFileZd ) == iZdMin )
+		{
+			if( abs( iAz - iFileAz ) <= iAzMin )
+			{
+				iIndex = i;
+				iAzMin = abs( iAz - iFileAz );
+			}
+		}
+	}
+
+	if( iIndex == -1 ) 	
+		return 0;
+
+	QString qsFileName;
+	qsFileName.sprintf( "/home/amc/share/amc/%s", shareDir[iIndex].latin1() );
+	qDebug( "Using LUT %d %s", iIndex, qsFileName.latin1() );
+
+	readLUT( qsFileName );
+	return qsFileName;
+}
+
+/** No descriptions */
+void AMCLookUpTable::saveLUT( double p_dZd, double p_dAz )
+{
+	// Round Altitude and Azimuth to next 5 degree value
+	int iZd = (int) (rint( p_dZd / 5.0 )) * 5;
+	int iAz = (int) (rint( p_dAz / 5.0 )) * 5;
+
+	QDateTime theDT = QDateTime::currentDateTime();
+	QDate theDate = theDT.date();
+	QTime theTime = theDT.time();
+
+	QString qsFileName;
+	qsFileName.sprintf( "/home/amc/data/AMC_%04d_%02d_%02d_%02d_%02d_%02d__(%02d_%03d).lut",
+                      theDate.year(), theDate.month(), theDate.day(),
+                      theTime.hour(), theTime.minute(), theTime.second(),
+											iZd, iAz );
+	QFile file( qsFileName );
+
+	QCString line;
+
+	if( file.open( IO_WriteOnly ) )
+	{
+		QTextStream stream( &file );
+		for(int j=0; j<17; j++)
+		{
+			line.sprintf("# Column %d\n",j-8);
+			stream << line;
+			for(int i=0; i<17; i++)
+			{
+				AMCMirrorPanel* pPanel = g_theMirror->panelAt( i, j );
+				line.sprintf( "%3d %3d\t%5d\t%5d\t%5d\t%5d\n",
+											pPanel->i(),
+											pPanel->j(),
+											pPanel->getX(),
+											pPanel->getY(),
+											pPanel->getLaserX(),
+											pPanel->getLaserY() );
+				stream << line;
+			}
+		}
+					
+	}
+}
+
+/** No descriptions */
+void AMCLookUpTable::readLUT( const QString& p_qsFileName )
+{
+
+	QFile file( p_qsFileName );
+	if( file.open( IO_ReadOnly ) )
+	{
+		QTextStream stream( &file );
+		QString line;
+		while( !stream.eof() )
+		{
+			line = stream.readLine();
+		
+			// Skip comment lines
+			if( line[0] == '#')
+				continue;
+					
+			int ii, ij, iX, iY, iLaserX, iLaserY;
+			sscanf( line.data(),"%d %d %d %d %d %d",
+							&ii, &ij, &iX, &iY, &iLaserX, &iLaserY );
+			AMCMirrorPanel* pPanel = g_theMirror->panelAt( ii+8, ij+8 );
+			pPanel->setRefX( iX );
+			pPanel->setRefY( iY );
+//			pPanel->setLaserX( iLaserX );
+//			pPanel->setLaserY( iLaserY );
+		}
+	}
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclookuptable.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclookuptable.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amclookuptable.h	(revision 3401)
@@ -0,0 +1,41 @@
+/***************************************************************************
+                          amclookuptable.h  -  description
+                             -------------------
+    begin                : Sun Sep 28 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef AMCLOOKUPTABLE_H
+#define AMCLOOKUPTABLE_H
+
+#include <qfile.h>
+
+/**
+  *@author Martin Merck
+  */
+
+class AMCLookUpTable
+{
+public: 
+
+public:
+	static QString findLUT( double p_dZd, double p_dAz );
+  /** No descriptions */
+  static void saveLUT( double p_dZd, double p_dAz );
+  /** No descriptions */
+  static void readLUT( const QString& p_qsFileName );
+
+private: // Private attributes
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmirrorpanel.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmirrorpanel.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmirrorpanel.cpp	(revision 3401)
@@ -0,0 +1,32 @@
+/***************************************************************************
+                          amcmirrorpanel.cpp  -  description
+                             -------------------
+    begin                : Sat Nov 23 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#include "amcmirrorpanel.h"
+
+AMCMirrorPanel::AMCMirrorPanel( int i, int j, int iType, int iPort, int iBox, int iDriver)
+		: m_i(i), m_j(j), m_iType(iType), m_iPort(iPort), m_iBox(iBox), m_iDriver(iDriver)
+{
+	m_zLaserOn = false;
+	m_zMotorPower = true;
+	m_iX = m_iY = 0;
+	m_iRefX = m_iRefY = 0;
+	m_iLaserX = m_iLaserY = 0;
+	m_dAxisX = m_dAxisY = 0.0;
+	m_dSlopeX = m_dSlopeY = 0.0;
+	m_dConversionX = m_dConversionY = 0.0;
+}
+
+AMCMirrorPanel::~AMCMirrorPanel(){
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmirrorpanel.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmirrorpanel.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmirrorpanel.h	(revision 3401)
@@ -0,0 +1,158 @@
+/***************************************************************************
+                          AMCMirrorPanel.h  -  description
+                             -------------------
+    begin                : Sat Nov 23 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.                                    *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef AMCMIRRORPANEL_H
+#define AMCMIRRORPANEL_H
+
+
+/**
+  *@author Martin Merck
+  */
+
+class AMCMirrorPanel {
+public: 
+	AMCMirrorPanel( int ii, int ij, int iType, int iPort, int iBox, int iDriver);
+	~AMCMirrorPanel();
+	/** return the type (orientation) of the panel for selecting
+			the correct icon */
+	int type() const { return m_iType; }
+	/** return the serial port number for this panel */
+	int port() const { return m_iPort; }
+	/** return the AMC box number for this panel */
+	int box() const { return m_iBox; }
+	/** return the AMC druver number for this panel */
+	int driver() const { return m_iDriver; }
+	/** return the panel index I */
+	int i() const { return m_i; }
+	/** return the panel index J */
+	int j() const { return m_j; }
+	/** query if this panel is installed */
+	bool isInstalled() const { return m_zInstalled; }
+	/** mark this panel as installed in the dish */
+	void setInstalled( bool zInst) { m_zInstalled = zInst; }
+	/** query if laser is on */
+	bool isLaserOn() const { return m_zLaserOn; }
+	/** set laser to on */
+	void setLaserOn( bool zOn ) { m_zLaserOn = zOn; }
+	/** Query if motor power is on */
+	bool isPowerOn() const { return m_zMotorPower; }
+	/** turn motor power on */
+	void setPowerOn( bool zOn ) { m_zMotorPower = zOn; }
+	/** get current position of motor in steps from centered */
+	int getX() const { return m_iX; }
+	/** get current position of motor in steps from centered */
+	void setX( int p_iX ) { m_iX = p_iX; }
+	/** get current position of motor in steps from centered */
+	int getY() const { return m_iY; }
+	/** get current position of motor in steps from centered */
+	void setY( int p_iY ) { m_iY = p_iY; }
+	/** get reference position of motor in steps from centered */
+	int getRefX() const { return m_iRefX; }
+	/** get reference position of motor in steps from centered */
+	void setRefX( int p_iX ) { m_iRefX = p_iX; }
+	/** get reference position of motor in steps from centered */
+	int getRefY() const { return m_iRefY; }
+	/** set reference position of motor in steps from centered */
+	void setRefY( int p_iY ) { m_iRefY = p_iY; }
+	/** get laser position X for reference position of motors */
+	int getLaserX() const { return m_iLaserX; }
+	/** set laser position X for reference position of motors */
+	void setLaserX( int p_iX ) { m_iLaserX = p_iX; }
+	/** get laser position Y for reference position of motors */
+	int getLaserY() const { return m_iLaserY; }
+	/** set laser position Y for reference position of motors */
+	void setLaserY( int p_iY ) { m_iLaserY = p_iY; }
+	/** get laser position Y for reference position of motors */
+	double getAxisX() const { return m_dAxisX; }
+	/** set laser position Y for reference position of motors */
+	void setAxisX( double p_dX ) { m_dAxisX = p_dX; }
+	/** get laser position Y for reference position of motors */
+	double getAxisY() const { return m_dAxisY; }
+	/** set laser position Y for reference position of motors */
+	void setAxisY( double p_dY ) { m_dAxisY = p_dY; }
+	/** get laser position Y for reference position of motors */
+	double getSlopeX() const { return m_dSlopeX; }
+	/** set laser position Y for reference position of motors */
+	void setSlopeX( double p_dX ) { m_dSlopeX = p_dX; }
+	/** get laser position Y for reference position of motors */
+	double getSlopeY() const { return m_dSlopeY; }
+	/** set laser position Y for reference position of motors */
+	void setSlopeY( double p_dY ) { m_dSlopeY = p_dY; }
+	/** get laser position Y for reference position of motors */
+	double getConversionX() const { return m_dConversionX; }
+	/** set laser position Y for reference position of motors */
+	void setConversionX( double p_dX ) { m_dConversionX = p_dX; }
+	/** get laser position Y for reference position of motors */
+	double getConversionY() const { return m_dConversionY; }
+	/** set laser position Y for reference position of motors */
+	void setConversionY( double p_dY ) { m_dConversionY = p_dY; }
+	/** get laser position Y for reference position of motors */
+	int getStepsX() const { return m_iStepsX; }
+	/** set laser position Y for reference position of motors */
+	void setStepsX( int p_iX ) { m_iStepsX = p_iX; }
+	/** get laser position Y for reference position of motors */
+	int getStepsY() const { return m_iStepsY; }
+	/** set laser position Y for reference position of motors */
+	void setStepsY( int p_iY ) { m_iStepsY = p_iY; }
+
+private: // Public attributes
+	/**  */
+	int m_i;
+	int m_j;
+	int m_iType;
+	int m_iPort;
+	int m_iBox;
+	int m_iDriver;
+	bool m_zInstalled;
+	/** Hold information if laser is on */
+	bool m_zLaserOn;
+	/** Hold information if motor power is on */
+	bool m_zMotorPower;
+	/** Current position of X motor. */
+	int m_iX;
+	/** Current position of Y motor. */
+	int m_iY;
+	/** Reference position of X motor. */
+	int m_iRefX;
+	/** Reference position of Y motor. */
+	int m_iRefY;
+	/** Laser X position position for reference position. */
+	int m_iLaserX;
+	/** Laser Y position position for reference position. */
+	int m_iLaserY;
+	/** X axis of regression line for X motor. */
+	double m_dAxisX;
+	/** X slope of regression line for X motor. */
+	double m_dSlopeX;
+	/** Conversion factor from camera pixels to motor steps for X motor. */
+	double m_dConversionX;
+	/** Y axis of regression line for Y motor. */
+	double m_dAxisY;
+	/** Y slope of regression line for Y motor. */
+	double m_dSlopeY;
+	/** Conversion factor from camera pixels to motor steps for Y motor. */
+	double m_dConversionY;
+	/** Laser X position position for reference position. */
+	int m_iSpotX;
+	/** Laser Y position position for reference position. */
+	int m_iSpotY;
+	/** Laser X position position for reference position. */
+	int m_iStepsX;
+  /** Laser Y position position for reference position. */
+	int m_iStepsY;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmotor.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmotor.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmotor.cpp	(revision 3401)
@@ -0,0 +1,541 @@
+/***************************************************************************
+                          amcmotor.cpp  -  description
+                             -------------------
+    begin                : Sun Nov 24 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#include <qcstring.h>
+#include <qdatetime.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <math.h>
+#include "amcmotor.h"
+#include "amcerror.h"
+#include "amcserialport.h"
+#include "amcerrors.h"
+#include "amccommands.h"
+
+AMCMotor::AMCMotor( AMCSerialPort* p_pPort ) :
+	m_pPort( p_pPort ), m_iCurrDriver(0), m_iCurrFreq(0)
+{
+}
+
+AMCMotor::~AMCMotor(){
+}
+
+/** No descriptions */
+void AMCMotor::sendCommand(const QCString& p_sCommand, QCString& p_sResponse ) const
+{
+	char	buffer[256];	
+
+  // This is because of test with optical fiber
+	int iNumEcho;
+  iNumEcho = NUM_ECHO;
+//  if( m_iPort == 3 )
+//		iNumEcho = 1;
+
+  int rrlen;
+	int len = p_sCommand.length();
+	for( int i=0; i<len; i++)
+	{
+		int wres = m_pPort->transmitChar( p_sCommand[i] );
+		// if we send the last charachter in the command we exprect
+		// the full response from the AMC master, otherwise we expect
+		// two echo characters, one from the line, the second from the
+		// AMC master. If no box is selected we expect only the echo
+		// from the line.
+		int max;
+		if( i == len-1 )
+		{
+      // sleep 30 ms to be sure to get the whole response
+	    usleep(30000);
+			max = 255;
+		}
+		else
+			max = iNumEcho;
+//			max = NUM_ECHO;
+		int rlen = m_pPort->readBlock( buffer, max );
+		// set the end of the response string to a 0 char to
+		// convert the buffer into a cstring.
+		buffer[rlen] = 0;
+    rrlen = rlen;
+	}
+	
+	// Reset and unselect commands will not return any status
+	if( (p_sCommand == IDS_COMMAND_UNSELECT_BOX)
+		||
+		(p_sCommand == IDS_COMMAND_RESET) )
+	return;
+
+	if( (p_sCommand == IDS_COMMAND_INFO)
+      &&
+			(buffer[rrlen-1] != '>') )
+	{
+    usleep(20000);
+		int rlen = m_pPort->readBlock( buffer+rrlen, 255 );
+		qDebug("Second iteration for info command. %d bytes", rlen);
+		buffer[rrlen+rlen] = 0;
+	}
+
+	QCString sResp = buffer;
+	// We expect at least two echos of the last character of the command
+	// (the carriage return) and one AMC master status byte.
+//	if( sResp.length() < NUM_ECHO + 1)
+	if( sResp.length() < iNumEcho + 1)
+	{
+		// This is a hack for an ununderstood problem of the
+		// AMC masters. It seems that we somtimes don't
+		// get a response when sending very often the query
+		// command.
+		if( p_sCommand == IDS_COMMAND_QUERY)
+			sResp = "  @";
+		else
+		{
+			AMCError aErr( IDS_ERROR_NO_RESPONSE );
+			aErr.setCommand( p_sCommand );
+			aErr.setResponse( sResp );
+			throw aErr;
+		}
+	}
+	
+	// Remove the trailling echos of the carriage return of the command.
+//	p_sResponse = sResp.right( sResp.length() - NUM_ECHO );
+	p_sResponse = sResp.right( sResp.length() - iNumEcho );
+	
+	// We now get the last character from the response send bz the AMC
+	// master and check for controller errors.
+	char ch = sResp[ sResp.length()-1 ];
+	// Is it a valid AMC status byte ?
+	if( ( ch != '>' )
+		&&
+		( ch != '@' )
+		&&
+		( ch != '#' ) )
+	{
+		AMCError aErr( IDS_ERROR_NO_AMC_STATUS );
+		aErr.setCommand( p_sCommand );
+		aErr.setResponse( p_sResponse );
+		qDebug("No AMC status: " + aErr.formatError(0));
+		qDebug("Response length %d",sResp.length() );
+//		if( p_sCommand != IDS_COMMAND_QUERY)
+			throw aErr;
+	}
+	
+	// It seems that the AMC master software was changed. Test revealed
+	// that some AMC boxes return '?>' in the case they don't understand
+	// the command.
+	if( ch =='?' )
+	{
+		AMCError aErr( IDS_ERROR_BAD_ARGUMENT );
+		aErr.setCommand( p_sCommand );
+		aErr.setResponse( p_sResponse );
+		throw aErr;
+	}
+	
+	// If AMC status indicades error Check which type of error code.
+	// Here we recursivly call this method sendCommand.
+	if( ch =='#' )
+	{
+		QCString sComm, sResp2;
+		
+		// send the query command
+		sComm.sprintf( IDS_COMMAND_QUERY );
+		sendCommand( sComm, sResp2 );
+		
+		// The response should contain the error code in HEX plus '\r>'
+		int iErrCode;
+		sscanf( (const char*) sResp2, "%X\r", &iErrCode );
+		qDebug("ErrorCode %X  %X %X", iErrCode, iErrCode & 0x07, iErrCode & 0xFF0);
+		
+		AMCError aErr;
+		aErr.setCommand( p_sCommand + " - " + sComm );
+		aErr.setResponse( p_sResponse + " - " + sResp2 );
+		aErr.setDriver( iErrCode & 0x07 );
+		
+		switch( iErrCode & 0xFF0 )
+		{
+		case (0x10):
+			aErr.setErrorText( IDS_ERROR_SPI_OVERFLOW );
+			break;
+		case (0x20):
+			aErr.setErrorText( IDS_ERROR_SPI_WTIMEOUT );
+			break;
+		case (0x40):
+			aErr.setErrorText( IDS_ERROR_SPI_RTIMEOUT );
+			break;
+		case (0x60):
+			aErr.setErrorText( IDS_ERROR_BAD_DRIVER );
+			break;
+		case (0x80):
+			aErr.setErrorText( IDS_ERROR_BAD_ARGUMENT );
+			break;
+		case (0x100):
+			aErr.setErrorText( IDS_ERROR_NO_DRIVER );
+			break;
+		case (0x200):
+			{
+				// we detected a verges error. Some information parameters
+				// of the box are outside the range. Lets find out which.
+				sComm.sprintf( IDS_COMMAND_INFO );
+				sendCommand( sComm, sResp2 );
+				
+				aErr.setCommand( p_sCommand + " - " + sComm );
+				aErr.setResponse( p_sResponse + " - " + sResp2 );
+				// The response should be: 'E%2X\r>'
+				int iParErr;
+				sscanf( (const char*) sResp, "E%X\r", &iParErr );
+				switch( iParErr )
+				{
+				case (0x04):						// Temeperature
+					aErr.setErrorText( IDS_ERROR_TEMP_RANGE );
+					break;
+				case (0x08):						// Humidity
+					aErr.setErrorText( IDS_ERROR_HUMIDITY_RANGE );
+					break;
+				case (0x10):						// Power current
+					aErr.setErrorText( IDS_ERROR_I_POWER_RANGE );
+					break;
+				case (0x20):						// Power voltage
+					aErr.setErrorText( IDS_ERROR_V_POWER_RANGE );
+					break;
+				case (0x40):						// Secondary voltage
+					aErr.setErrorText( IDS_ERROR_V_SECONDARY_RANGE );
+					break;
+				case (0x80):						// Logical voltage
+					aErr.setErrorText( IDS_ERROR_V_LOGICAL_RANGE );
+					break;
+				default:
+					aErr.setErrorText( IDS_ERROR_UNKNOWN );
+					break;
+				}
+			}
+		default:
+			aErr.setErrorText( IDS_ERROR_UNKNOWN );
+			break;
+		}
+		// throw the exception
+		throw aErr;
+	}
+	
+	return;
+}
+
+
+/** Select a AMC box. */
+void AMCMotor::selectBox( int p_iBox ) const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_BOX, p_iBox );
+	sendCommand( sComm, sResp );
+}
+
+
+/** Select one of the four drivers */
+void AMCMotor::selectDriver( int p_iDriver ) const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_DRIVER, p_iDriver-1 );
+	sendCommand( sComm, sResp );
+	m_iCurrDriver = p_iDriver;
+	return;
+}
+
+/** Reset a driver. Kill an active movment and turn laser and motor
+ *  power off. */
+void AMCMotor::Reset() const
+{
+	killMovement();
+	switchLaser( false );
+	powerMotors( false );
+	return;
+}
+
+/** Kill the last movement command. We should send this command
+ *  when the motor movement doesnt finish in the expected time.
+ *  In this case the motor may be stuck. We want to kill the
+ *  movement command to not destroy anything. */
+void AMCMotor::killMovement() const
+{
+	QCString sComm, sResp;
+
+  qDebug("Sending kill command");	
+	sComm.sprintf( IDS_COMMAND_KILL );
+	sendCommand( sComm, sResp );
+	return;
+}
+
+/** Get the environmental information from the AMC box */
+void AMCMotor::getInfo( int* p_iTemp,
+						int* p_iHum,
+						int* p_iPowerI,
+						int* p_iPowerV,
+						int* p_iSecondV,
+						int* p_iLogicV ) const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_INFO );
+	sendCommand( sComm, sResp );
+	sscanf( (const char*) sResp,
+			"T=%d\rH=%d\rI=%d\rV=%d\rS=%d\rL=%d\r",
+			p_iTemp,
+			p_iHum,
+			p_iPowerI,
+			p_iPowerV,
+			p_iSecondV,
+			p_iLogicV );
+			
+	return;
+}
+
+/** Return the frequency with which the motors are driven */
+int AMCMotor::getFrequency() const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_FREQUENCY_READ );
+	sendCommand( sComm, sResp );
+	
+	int iFrequency;
+	sscanf( (const char*) sResp, "%d\r", &iFrequency);
+	m_iCurrFreq = iFrequency;
+	return( iFrequency );
+}
+
+/** Set the frequency with which the current driver will drive the motors.  */
+void AMCMotor::setFrequency( int p_iFreq ) const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_FREQUENCY_WRITE, p_iFreq );
+	sendCommand( sComm, sResp );
+	m_iCurrFreq = p_iFreq;
+
+	return;	
+}
+
+/** Return the working current set for the selected driver. */
+int AMCMotor::getWorkingCurrent() const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_WORKING_READ );
+	sendCommand( sComm, sResp );
+	
+	int iCurrent;
+	sscanf( (const char*) sResp, "%d\r", &iCurrent);
+	return( iCurrent );
+}
+
+/** Set the working current with which the current driver will drive the motors. */
+void AMCMotor::setWorkingCurrent( int p_iCurrent ) const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_WORKING_WRITE, p_iCurrent );
+	sendCommand( sComm, sResp );
+
+	return;	
+}
+
+/** Return the holding current set for the selected driver. */
+int AMCMotor::getHoldingCurrent() const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_HOLDING_READ );
+	sendCommand( sComm, sResp );
+	
+	int iCurrent;
+	sscanf( (const char*) sResp, "%d\r", &iCurrent);
+	return( iCurrent );
+}
+
+/** Set the holding current with which the current driver will drive the motors. */
+void AMCMotor::setHoldingCurrent( int p_iCurrent ) const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_HOLDING_WRITE, p_iCurrent );
+	sendCommand( sComm, sResp );
+
+	return;	
+}
+
+/** Switch the laser on or off. */
+void AMCMotor::switchLaser( bool zOn ) const
+{
+	QCString sComm, sResp;
+	
+	if( zOn	)
+		sComm.sprintf( IDS_COMMAND_LASER_ON );
+	else
+		sComm.sprintf( IDS_COMMAND_LASER_OFF );
+	sendCommand( sComm, sResp );
+
+	return;	
+}
+/** Turn the power to the motors on or off. By default the motors are always powered on.
+  * This is necesary to send the holding current through the motors. We can turn
+  * the power off in case of a broken motor. However the power will remain turned off
+  * only if we deselect the driver in the next command. Selecting the driverv again
+  * or sending a movement command, will automatically turn the motor power on again.
+  */
+void AMCMotor::powerMotors( bool zOn ) const
+{
+	QCString sComm, sResp;
+	
+	if( zOn	)
+		sComm.sprintf( IDS_COMMAND_POWER_ON );
+	else
+		sComm.sprintf( IDS_COMMAND_POWER_OFF );
+	sendCommand( sComm, sResp );
+
+	return;	
+}
+
+/** Move the motors to the end switches and then find the central poosition. */
+void AMCMotor::centerMotors() const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_CENTER );
+	sendCommand( sComm, sResp );
+
+	return;	
+}
+
+/** Move the motors by the given number of steps. If the number is positive we move
+ * upwards, if negative downwards. Be aware that the directions can be changed with
+ * the tuning commands.
+ */
+void AMCMotor::moveMotors( int p_iX, int p_iY ) const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_MOVE, p_iX, p_iY );
+	sendCommand( sComm, sResp );
+
+	return;	
+}
+
+/** Calculate the time needed by the motors to complete the number of steps.
+ * We add 200 ms for the communications overhead. The returned value
+ * is the next high integer number of seconds.
+ */
+int AMCMotor::calcTimeout( int p_iSteps ) const
+{
+	// timeout for negative number of steps
+	if( p_iSteps < 0)
+		return(0);
+		
+	if( m_iCurrFreq == 0 )
+		getFrequency();
+
+	// The timeout is calculated by deviding the number of steps by the frequency.
+	// We add 200ms to account for the communications overhead.
+	// We convert the result to the next higher integer and return the timeout
+	// in seconds.		
+	int iTimeout = (int) ceil( ((double) p_iSteps / (double) m_iCurrFreq) + 0.2 );
+	return(iTimeout);
+	
+}
+
+/** Wait for the motor movement to complete. */
+void AMCMotor::waitForMotors( int p_iTimeout ) const
+{
+	QTime qtStop, qtStart;
+	QCString sComm, sResp;
+	
+	qtStart.start();
+	qtStop = qtStart.addSecs( p_iTimeout );
+	// near midnight the time may wrap. In this case we sleep
+	// timeout seconds to be sure to be in the next day.
+	if (qtStop < qtStart)
+		sleep( p_iTimeout );
+	
+	sComm.sprintf( IDS_COMMAND_QUERY );
+	for(;;)
+	{
+		// Check for a timeout during centering
+		if( qtStart.elapsed() > p_iTimeout*1000 )
+		{
+			// Kill the current movemnet
+			qDebug("Killing movement after %d msecs when %ds where expected", qtStart.elapsed(), p_iTimeout);
+			killMovement();
+			resetBox();
+			// throw the exception
+			AMCError aErr( IDS_ERROR_MOVEMENT_TIMEOUT, m_iCurrDriver );
+			throw aErr;
+		}
+		sendCommand( sComm, sResp );
+		if( sResp[0] != '@' )
+		{
+			// During centering when we hit the end switches
+			// the AMC box will issue the status "xx\r>" and
+			// then change direction. xx will give the number
+			// of steps needed to come out of the end switch.
+			// In such a case we still are in the movement so
+			// we continue checking, otherwise we quit.
+			if( ( sResp.length() > 1 )
+				&&
+				( sResp[sResp.length()-1] == '>' ) )
+				continue;
+//			qDebug("Waiting for motors %d %s", sResp.length(), sResp );
+//			break;
+			if( (sResp.length() == 1) && (sResp[0] == '>') )
+			{
+        qDebug("panel movement stopped after %dms when waiting %ds", qtStart.elapsed(), p_iTimeout );
+				break;
+			}
+		}
+    usleep(30000);
+	}
+		
+	return;	
+	
+}
+
+/** Unselect the currently selected box. */
+void AMCMotor::unselectBox() const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_UNSELECT_BOX );
+	sendCommand( sComm, sResp );
+
+	return;	
+}
+
+/** Reset the currently selected box. */
+void AMCMotor::resetBox() const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_RESET );
+	sendCommand( sComm, sResp );
+
+	return;	
+}
+
+/** Reset the currently selected box. */
+void AMCMotor::resetDriver() const
+{
+	QCString sComm, sResp;
+	
+	sComm.sprintf( IDS_COMMAND_DRIVER_RESET );
+	sendCommand( sComm, sResp );
+
+	return;	
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmotor.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmotor.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcmotor.h	(revision 3401)
@@ -0,0 +1,139 @@
+/***************************************************************************
+                          amcmotor.h  -  description
+                             -------------------
+    begin                : Sun Nov 24 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#ifndef AMCMOTOR_H
+#define AMCMOTOR_H
+
+class QCString;
+class AMCSerialPort;
+
+// Number of echo characters. In the actual RS 485 configuration
+// we will normally get 2 echo characters. The first one comes
+// from the line itself, as we use only one pair of cables and
+// the write and read lines are connected. The second echo character
+// comes from the AMC master itself.
+#define NUM_ECHO	2
+
+/**This class combines the functionalitz of the individual mirror panels
+  *@author Martin Merck
+  */
+
+class AMCMotor {
+public: 
+  AMCMotor( AMCSerialPort* p_pPort );
+  ~AMCMotor();
+
+  /** Select the given AMC box */
+  void selectBox( int p_iBox ) const;
+
+  /** Select he given AMC driver in the box. If no box has been
+   * selected we may get a communication error.
+   */
+  void selectDriver( int p_iDriver ) const;
+
+  /** Reset the status of the current box. This will kill any current
+   * motor movement, turn off the laser and power of the motors */
+  void Reset() const;
+
+  /** Kill the current motor movement */
+  void killMovement() const;
+
+  /** Return information from the AMC box */
+  void getInfo( int* p_iTemp,
+  				int* p_iHum,
+  				int* p_iPowerI,
+  				int* p_iPowerV,
+  				int* p_iSecondV,
+  				int* p_iLogicV ) const;
+  				
+  /** Set the frequency with which the current driver will drive the motors.  */
+  void setFrequency( int p_iFreq ) const;
+  				
+  /** Return the frequency with which the motors are driven */
+  int getFrequency() const;
+
+  /** Set the working current with which the current driver will drive the motors. */
+  void setWorkingCurrent( int p_iCurrent ) const;
+
+  /** Return the working current set for the selected driver. */
+  int getWorkingCurrent() const;
+
+  /** Set the holding current with which the current driver will drive the motors. */
+  void setHoldingCurrent( int p_iCurrent ) const;
+
+  /** Return the holding current set for the selected driver. */
+  int getHoldingCurrent() const;
+
+  /** Switch the laser on or off. */
+  void switchLaser( bool zOn ) const;
+
+  /** Turn the power to the motors on or off. By default the motors are always powered on.
+   * This is necesary to send the holding current through the motors. We can turn
+   * the power off in case of a broken motor. However the power will remain turned off
+   * only if we deselect the driver in the next command. Selecting the driver again
+   * or sending a movement command, will automatically turn the motor power on again.
+   */
+  void powerMotors( bool zOn ) const;
+
+  /** Move the motors by the given number of steps. If the number is positive we move
+   * upwards, if negative downwards. Be aware that the directions can be changed with
+   * the tuning commands. */
+  void moveMotors( int p_iX, int p_iY ) const;
+
+  /** Move the motors to the end switches and then find the central poosition. */
+  void centerMotors() const;
+
+  /** Calculate the time needed by the motors to complete the number of steps.
+   * We add 200 ms for the communications overhead. The returned value
+   * is the next high integer number of seconds.
+   */
+  int calcTimeout( int p_iSteps ) const;
+
+  /** Wait for the motor movement to complete. */
+  void waitForMotors( int p_iTimeout ) const;
+
+  /** Unselect the currently selected box. */
+  void unselectBox() const;
+
+  /** Reset the currently selected box. */
+  void resetBox() const;
+
+  /** Reset the currently selected box. */
+  void resetDriver() const;
+
+  /** No descriptions */
+  void setPort( AMCSerialPort* pPort ) { m_pPort = pPort; };
+
+  /** No descriptions */
+  void setPortNum( int p_iPort ) { m_iPort = p_iPort; };
+
+private: // Private methods
+  /** No descriptions */
+  void sendCommand(const QCString& p_sCommand, QCString& p_sResponse ) const;
+
+private: // Private attributes
+  /** Pointer to the serial port to use */
+  AMCSerialPort* m_pPort;
+  int m_iPort;
+
+  /** The currently selected driver */
+  mutable int m_iCurrDriver;
+
+  /** Holds the current frequency used to power theb motors. We need this value internally
+   * to calculate the timeout.  */
+  mutable int m_iCurrFreq;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlg.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlg.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlg.cpp	(revision 3401)
@@ -0,0 +1,244 @@
+/***************************************************************************
+                          amcprogdlg.cpp  -  description
+                             -------------------
+    begin                : Sun Apr 6 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "amcprogdlg.h"
+#include "activemirrorcontrol.h"
+#include "amclog.h"
+#include "amcmirrorpanel.h"
+#include "amcstate.h"
+#include "errortestthreadcontroller.h"
+#include "heatstate.h"
+#include "magicmirror.h"
+#include "threadevent.h"
+#include "threadcontroller.h"
+#include <qlabel.h>
+#include <qprogressbar.h>
+#include <qlineedit.h>
+#include <qdatetime.h>
+#include <unistd.h>
+
+extern AMCLog*			g_pLog;
+extern MagicMirror* g_theMirror;
+extern AMCState*    g_pAMCState;
+extern HEATState*   g_pHEATState;
+
+AMCProgDlg::AMCProgDlg( int p_iType, QWidget *parent, const char *name, bool modal )
+	: AMCProgDlgBase( parent, name, modal ),
+		m_iType( p_iType ), m_iNumErrors( 0 ), m_zTrue( false ), m_zParallel( true )
+{
+	ProgressBar->setTotalSteps( g_theMirror->getNumPanels() );
+
+	for( int i=0; i<17; i++)
+		for( int j=0; j<17; j++)
+			m_arrErrors[i][j] = 0;
+
+	for( int i=0; i<8; i++)
+		m_portErrors[i] = 0;
+
+  if( m_iType == LASER_ADJUST_THREAD_CTRL)
+	{
+		double dAlt, dAz;
+		((ActiveMirrorControl*) parent)->getZdAz( dAlt, dAz );
+		
+		QDateTime theDT = QDateTime::currentDateTime();
+		QDate theDate = theDT.date();
+		QTime theTime = theDT.time();
+
+		QString qsFileName;
+		qsFileName.sprintf( "/home/amc/data/AMC_%04d_%02d_%02d_%02d_%02d_%02d__(%02d_%03d).info",
+    	                  theDate.year(), theDate.month(), theDate.day(),
+                        theTime.hour(), theTime.minute(), theTime.second(),
+				  							(int) dAlt, (int) dAz );
+		m_pFile = new QFile( qsFileName );
+
+		if( m_pFile->open( IO_WriteOnly ) )
+		{
+			m_pStream = new QTextStream( m_pFile );
+		}
+  }
+
+  if( m_iType == ERROR_TEST_THREAD_CTRL)
+	{
+		ActiveMirrorControl* pAMC = (ActiveMirrorControl*) parent;
+		ProgressBar->setTotalSteps( pAMC->getNumLoops() * 8 );
+
+		QDateTime theDT = QDateTime::currentDateTime();
+		QDate theDate = theDT.date();
+		QTime theTime = theDT.time();
+
+		QString qsFileName;
+		qsFileName.sprintf( "/home/amc/data/AMC_%04d_%02d_%02d_%02d_%02d_%02d.errtest",
+    	                  theDate.year(), theDate.month(), theDate.day(),
+                        theTime.hour(), theTime.minute(), theTime.second() );
+		m_pFile = new QFile( qsFileName );
+
+		if( m_pFile->open( IO_WriteOnly ) )
+		{
+			m_pStream = new QTextStream( m_pFile );
+		}
+  }
+}
+
+AMCProgDlg::~AMCProgDlg(){
+
+  if ( m_iType == ERROR_TEST_THREAD_CTRL )
+	{
+		for( int j=16; j>=0; j--)
+		{
+			for( int i=0; i<17 ; i++ )
+			{
+				if( g_theMirror->panelAt(i,j)->isInstalled() )
+				{
+					m_portErrors[ g_theMirror->panelAt(i,j)->port()-1 ] += m_arrErrors[i][j];
+					*m_pStream << std::setw(4) << m_arrErrors[i][j] << "  ";
+        }
+				else
+				{
+					if( m_arrErrors[i][j] != 0)
+					{
+						qDebug("WARNING: %d Errors in uninstalled panel (%d,%d)", m_arrErrors[i][j], i, j );
+					}
+					*m_pStream << "      ";
+				}
+			}
+			*m_pStream << std::endl;
+		}
+		*m_pStream << std::endl;
+		for( int i=0; i<8; i++)
+		{
+			*m_pStream << "Port " << std::setw(1) << i+1 << ": " << std::setw(6) << m_portErrors[i] << std::endl;
+		}
+		*m_pStream << std::endl;
+	}
+
+  if ( ( m_iType == LASER_ADJUST_THREAD_CTRL)
+     ||
+       ( m_iType == ERROR_TEST_THREAD_CTRL) )
+	{
+	  m_pFile->close();
+  	delete m_pStream;
+  	delete m_pFile;
+	}
+}
+
+void AMCProgDlg::setText( const QString& p_qsText )
+{
+	ProgressLabel->setText( p_qsText );
+}
+
+void AMCProgDlg::customEvent(QCustomEvent *e)
+{
+  if ( e->type() == THREAD_EVENT )
+	{
+		ThreadEvent* te = (ThreadEvent*)e;
+    qDebug(te->getMessage());
+	  if( m_iType == LASER_ADJUST_THREAD_CTRL)
+      *m_pStream << te->getMessage() << endl;
+	}
+
+  if ( e->type() == THREAD_ERROR_EVENT )
+	{
+		ThreadErrorEvent* tee = (ThreadErrorEvent*)e;
+		QString msg;
+		msg.sprintf("%d", ++m_iNumErrors);
+		NumErrors->setText( msg );
+		g_pLog->logError( tee->getMessage(), tee->getError() );
+	  if( m_iType == LASER_ADJUST_THREAD_CTRL)
+      *m_pStream << tee->getMessage() << tee->getError().formatError(7) << endl;
+	  if( m_iType == ERROR_TEST_THREAD_CTRL)
+		{
+      int i,j;
+			tee->getError().getPanel(i, j);
+			m_arrErrors[i+8][j+8]++;
+//      scanf( tee->getError().getErrorText(), "%*s (%d,%d)", &i, &j);
+      *m_pStream << tee->getError().formatError(0) << endl;
+//			qDebug("Error in Panel (%d,%d)", i, j);
+		}
+	}
+
+  if ( e->type() == PROGRESS_EVENT )
+		ProgressBar->setProgress( ProgressBar->progress()+1 );
+
+  if ( e->type() == THREAD_END_EVENT )
+		this->accept();
+}
+
+void AMCProgDlg::run()
+{
+  qDebug("AMCProgDlg PID: %d - PPID: %d", getpid(), getppid() );
+  QTime t;
+  t.start();                          // start clock
+
+	for(int i=0; i<8; i++)
+	{
+		qDebug("Starting ThreadController of Type: %d number %d", m_iType, i);
+		if( ! m_zParallel )
+			m_pTController[i] = ThreadController::getController( m_iType, g_theMirror->panelList(), this );
+		else
+			m_pTController[i] = ThreadController::getController( m_iType, g_theMirror->panelForPort(i), this );
+		m_pTController[i]->setBool( m_zTrue );
+		// Set the number of Loops for the ErrorTestThreadController
+		if( m_iType == ERROR_TEST_THREAD_CTRL )
+		{
+			int iLoops = ((ActiveMirrorControl*) parentWidget())->getNumLoops();
+      ((ErrorTestThreadController*) m_pTController[i])->setNumLoops( iLoops );
+		}
+		m_pTController[i]->start();
+
+		// If we do not want to execute in parallel we must exit the loop here.
+		if( ! m_zParallel )
+			break;
+	}
+
+	if( m_zParallel )
+	{
+		for(int i=0; i<8; i++)
+		{
+			m_pTController[i]->wait();
+			delete m_pTController[i];
+		}
+	}
+	else
+	{
+		m_pTController[0]->wait();
+			delete m_pTController[0];
+	}		
+
+	QString qsMsg;
+	qsMsg.sprintf( "Total Time: %dms", t.elapsed() );
+	QThread::postEvent( this, new ThreadEvent( qsMsg ) );
+	QThread::postEvent( this, new QCustomEvent( THREAD_END_EVENT ) );
+
+  bool zOk;
+  int iNumErr = NumErrors->text().toInt( &zOk );
+	if( zOk == true )
+    g_pAMCState->setErrorPanels( iNumErr );
+
+}
+/** No descriptions */
+void AMCProgDlg::reject()
+{
+	if( m_zParallel )
+	{
+		for(int i=0; i<8; i++)
+			m_pTController[i]->stop();
+	}
+	else
+	{
+		m_pTController[0]->stop();
+	}
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlg.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlg.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlg.h	(revision 3401)
@@ -0,0 +1,65 @@
+/***************************************************************************
+                          amcprogdlg.h  -  description
+                             -------------------
+    begin                : Sun Apr 6 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef AMCPROGDLG_H
+#define AMCPROGDLG_H
+
+#include "amcprogdlgbase.h"
+#include <qwidget.h>
+#include <qthread.h>
+
+/**
+  *@author Martin Merck
+  */
+class QFile;
+class QTextStream;
+class ThreadController;
+
+class AMCProgDlg : public AMCProgDlgBase, public QThread
+{
+   Q_OBJECT
+
+public: 
+	AMCProgDlg(int p_iType, QWidget *parent=0, const char *name=0, bool modal = FALSE);
+	~AMCProgDlg();
+	
+	void setText( const QString& p_qsText );
+	void setBool( bool p_zTrue ) { m_zTrue = p_zTrue; };
+	void setParallel( bool p_zParallel ) { m_zParallel = p_zParallel; };
+	void customEvent( QCustomEvent* e );
+
+protected:
+	virtual void run();
+
+private:
+	int		m_iType;
+	int		m_iNumErrors;
+  int		m_arrErrors[17][17];
+  int		m_portErrors[8];
+  QFile*	m_pFile;
+  QTextStream* m_pStream;
+	ThreadController* m_pTController[8];
+	bool	m_zTrue;        // Flag used by the controller to pass to worker threads
+												// Used to indicate if lasers should be turned on or off
+												// or if we should defocus or focus the mirror.
+	bool	m_zParallel;		// Flag nidicating if we should process panels in parallel (default true)
+protected slots: // Protected slots
+  /** No descriptions */
+  void reject();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlg.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlg.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlg.moc.cpp	(revision 3401)
@@ -0,0 +1,81 @@
+/****************************************************************************
+** AMCProgDlg meta object code from reading C++ file 'amcprogdlg.h'
+**
+** Created: Thu Jan 29 10:28:58 2004
+**      by: The Qt MOC ($Id: amcprogdlg.moc.cpp,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "amcprogdlg.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *AMCProgDlg::className() const
+{
+    return "AMCProgDlg";
+}
+
+QMetaObject *AMCProgDlg::metaObj = 0;
+
+void AMCProgDlg::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(AMCProgDlgBase::className(), "AMCProgDlgBase") != 0 )
+	badSuperclassWarning("AMCProgDlg","AMCProgDlgBase");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString AMCProgDlg::tr(const char* s)
+{
+    return qApp->translate( "AMCProgDlg", s, 0 );
+}
+
+QString AMCProgDlg::tr(const char* s, const char * c)
+{
+    return qApp->translate( "AMCProgDlg", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* AMCProgDlg::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) AMCProgDlgBase::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (AMCProgDlg::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    m1_t0 v1_0 = &AMCProgDlg::reject;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(1);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(1);
+    slot_tbl[0].name = "reject()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Protected;
+    metaObj = QMetaObject::new_metaobject(
+	"AMCProgDlg", "AMCProgDlgBase",
+	slot_tbl, 1,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.cpp	(revision 3401)
@@ -0,0 +1,95 @@
+#include <klocale.h>
+/****************************************************************************
+** Form implementation generated from reading ui file './amcprogdlgbase.ui'
+**
+** Created: Thu Jan 29 23:03:52 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "amcprogdlgbase.h"
+
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qprogressbar.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/* 
+ *  Constructs a AMCProgDlgBase which is a child of 'parent', with the 
+ *  name 'name' and widget flags set to 'f' 
+ *
+ *  The dialog will by default be modeless, unless you set 'modal' to
+ *  TRUE to construct a modal dialog.
+ */
+AMCProgDlgBase::AMCProgDlgBase( QWidget* parent,  const char* name, bool modal, WFlags fl )
+    : QDialog( parent, name, modal, fl )
+{
+    if ( !name )
+	setName( "AMCProgDlgBase" );
+    resize( 287, 145 ); 
+    setCaption( i18n( "AMC Action Progress" ) );
+    AMCProgDlgBaseLayout = new QVBoxLayout( this ); 
+    AMCProgDlgBaseLayout->setSpacing( 6 );
+    AMCProgDlgBaseLayout->setMargin( 11 );
+
+    ProgressLabel = new QLabel( this, "ProgressLabel" );
+    ProgressLabel->setText( i18n( "Switching all Lasers Off" ) );
+    AMCProgDlgBaseLayout->addWidget( ProgressLabel );
+
+    ProgressBar = new QProgressBar( this, "ProgressBar" );
+    AMCProgDlgBaseLayout->addWidget( ProgressBar );
+    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+    AMCProgDlgBaseLayout->addItem( spacer );
+
+    Layout2 = new QHBoxLayout; 
+    Layout2->setSpacing( 6 );
+    Layout2->setMargin( 0 );
+
+    TextLabel1_2 = new QLabel( this, "TextLabel1_2" );
+    TextLabel1_2->setText( i18n( "Errors" ) );
+    Layout2->addWidget( TextLabel1_2 );
+    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout2->addItem( spacer_2 );
+
+    NumErrors = new QLineEdit( this, "NumErrors" );
+    NumErrors->setEnabled( FALSE );
+    NumErrors->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, NumErrors->sizePolicy().hasHeightForWidth() ) );
+    NumErrors->setMinimumSize( QSize( 50, 0 ) );
+    NumErrors->setMaximumSize( QSize( 50, 32767 ) );
+    NumErrors->setText( i18n( "0" ) );
+    NumErrors->setMaxLength( 5 );
+    NumErrors->setAlignment( int( QLineEdit::AlignRight ) );
+    Layout2->addWidget( NumErrors );
+    AMCProgDlgBaseLayout->addLayout( Layout2 );
+    QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+    AMCProgDlgBaseLayout->addItem( spacer_3 );
+
+    Layout4 = new QHBoxLayout; 
+    Layout4->setSpacing( 6 );
+    Layout4->setMargin( 0 );
+    QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout4->addItem( spacer_4 );
+
+    CancelButton = new QPushButton( this, "CancelButton" );
+    CancelButton->setText( i18n( "Cancel" ) );
+    CancelButton->setDefault( FALSE );
+    Layout4->addWidget( CancelButton );
+    AMCProgDlgBaseLayout->addLayout( Layout4 );
+
+    // signals and slots connections
+    connect( CancelButton, SIGNAL( clicked() ), this, SLOT( reject() ) );
+}
+
+/*  
+ *  Destroys the object and frees any allocated resources
+ */
+AMCProgDlgBase::~AMCProgDlgBase()
+{
+    // no need to delete child widgets, Qt does it all for us
+}
+
+#include "amcprogdlgbase.moc"
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.h	(revision 3401)
@@ -0,0 +1,42 @@
+/****************************************************************************
+** Form interface generated from reading ui file './amcprogdlgbase.ui'
+**
+** Created: Thu Jan 29 23:03:39 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef AMCPROGDLGBASE_H
+#define AMCPROGDLGBASE_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+class QVBoxLayout; 
+class QHBoxLayout; 
+class QGridLayout; 
+class QLabel;
+class QLineEdit;
+class QProgressBar;
+class QPushButton;
+
+class AMCProgDlgBase : public QDialog
+{ 
+    Q_OBJECT
+
+public:
+    AMCProgDlgBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+    ~AMCProgDlgBase();
+
+    QLabel* ProgressLabel;
+    QProgressBar* ProgressBar;
+    QLabel* TextLabel1_2;
+    QLineEdit* NumErrors;
+    QPushButton* CancelButton;
+
+protected:
+    QVBoxLayout* AMCProgDlgBaseLayout;
+    QHBoxLayout* Layout2;
+    QHBoxLayout* Layout4;
+};
+
+#endif // AMCPROGDLGBASE_H
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.moc
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.moc	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.moc	(revision 3401)
@@ -0,0 +1,73 @@
+/****************************************************************************
+** AMCProgDlgBase meta object code from reading C++ file 'amcprogdlgbase.h'
+**
+** Created: Thu Jan 29 23:03:52 2004
+**      by: The Qt MOC ($Id: amcprogdlgbase.moc,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "amcprogdlgbase.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *AMCProgDlgBase::className() const
+{
+    return "AMCProgDlgBase";
+}
+
+QMetaObject *AMCProgDlgBase::metaObj = 0;
+
+void AMCProgDlgBase::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QDialog::className(), "QDialog") != 0 )
+	badSuperclassWarning("AMCProgDlgBase","QDialog");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString AMCProgDlgBase::tr(const char* s)
+{
+    return qApp->translate( "AMCProgDlgBase", s, 0 );
+}
+
+QString AMCProgDlgBase::tr(const char* s, const char * c)
+{
+    return qApp->translate( "AMCProgDlgBase", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* AMCProgDlgBase::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QDialog::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    QMetaData::Access *slot_tbl_access = 0;
+    metaObj = QMetaObject::new_metaobject(
+	"AMCProgDlgBase", "QDialog",
+	0, 0,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.ui
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.ui	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcprogdlgbase.ui	(revision 3401)
@@ -0,0 +1,250 @@
+<!DOCTYPE UI><UI>
+<class>AMCProgDlgBase</class>
+<widget>
+    <class>QDialog</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>AMCProgDlgBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>287</width>
+            <height>145</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>AMC Action Progress</string>
+    </property>
+    <vbox>
+        <property stdset="1">
+            <name>margin</name>
+            <number>11</number>
+        </property>
+        <property stdset="1">
+            <name>spacing</name>
+            <number>6</number>
+        </property>
+        <widget>
+            <class>QLabel</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>ProgressLabel</cstring>
+            </property>
+            <property stdset="1">
+                <name>text</name>
+                <string>Switching all Lasers Off</string>
+            </property>
+        </widget>
+        <widget>
+            <class>QProgressBar</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>ProgressBar</cstring>
+            </property>
+        </widget>
+        <spacer>
+            <property>
+                <name>name</name>
+                <cstring>Spacer6</cstring>
+            </property>
+            <property stdset="1">
+                <name>orientation</name>
+                <enum>Vertical</enum>
+            </property>
+            <property stdset="1">
+                <name>sizeType</name>
+                <enum>Expanding</enum>
+            </property>
+            <property>
+                <name>sizeHint</name>
+                <size>
+                    <width>20</width>
+                    <height>20</height>
+                </size>
+            </property>
+        </spacer>
+        <widget>
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout2</cstring>
+            </property>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>TextLabel1_2</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Errors</string>
+                    </property>
+                </widget>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer1</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QLineEdit</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>NumErrors</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>sizePolicy</name>
+                        <sizepolicy>
+                            <hsizetype>0</hsizetype>
+                            <vsizetype>0</vsizetype>
+                        </sizepolicy>
+                    </property>
+                    <property stdset="1">
+                        <name>minimumSize</name>
+                        <size>
+                            <width>50</width>
+                            <height>0</height>
+                        </size>
+                    </property>
+                    <property stdset="1">
+                        <name>maximumSize</name>
+                        <size>
+                            <width>50</width>
+                            <height>32767</height>
+                        </size>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>0</string>
+                    </property>
+                    <property stdset="1">
+                        <name>maxLength</name>
+                        <number>5</number>
+                    </property>
+                    <property stdset="1">
+                        <name>alignment</name>
+                        <set>AlignRight</set>
+                    </property>
+                    <property>
+                        <name>hAlign</name>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <spacer>
+            <property>
+                <name>name</name>
+                <cstring>Spacer7</cstring>
+            </property>
+            <property stdset="1">
+                <name>orientation</name>
+                <enum>Vertical</enum>
+            </property>
+            <property stdset="1">
+                <name>sizeType</name>
+                <enum>Expanding</enum>
+            </property>
+            <property>
+                <name>sizeHint</name>
+                <size>
+                    <width>20</width>
+                    <height>20</height>
+                </size>
+            </property>
+        </spacer>
+        <widget>
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout4</cstring>
+            </property>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer3</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>CancelButton</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Cancel</string>
+                    </property>
+                    <property stdset="1">
+                        <name>default</name>
+                        <bool>false</bool>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+    </vbox>
+</widget>
+<connections>
+    <connection>
+        <sender>CancelButton</sender>
+        <signal>clicked()</signal>
+        <receiver>AMCProgDlgBase</receiver>
+        <slot>reject()</slot>
+    </connection>
+</connections>
+</UI>
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcpushbutton.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcpushbutton.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcpushbutton.cpp	(revision 3401)
@@ -0,0 +1,29 @@
+/***************************************************************************
+                          amcpushbutton.cpp  -  description
+                             -------------------
+    begin                : Sat Nov 23 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#include "amcpushbutton.h"
+
+AMCPushButton::AMCPushButton(QWidget *parent, const char *name ) : QPushButton(parent,name) {
+}
+AMCPushButton::~AMCPushButton(){
+}
+/** Force the button to be rectangular. Therfore we return the width as the needed height. */
+int AMCPushButton::heightForWidth( int w ) const{
+	return w;
+}
+/** No descriptions */
+void AMCPushButton::drawButton( QPainter *thePainter ){
+	drawButtonLabel( thePainter );
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcpushbutton.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcpushbutton.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcpushbutton.h	(revision 3401)
@@ -0,0 +1,38 @@
+/***************************************************************************
+                          amcpushbutton.h  -  description
+                             -------------------
+    begin                : Sat Nov 23 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#ifndef AMCPUSHBUTTON_H
+#define AMCPUSHBUTTON_H
+
+#include <qwidget.h>
+#include <qpushbutton.h>
+
+/**
+  *@author Martin Merck
+  */
+
+class AMCPushButton : public QPushButton  {
+   Q_OBJECT
+public: 
+	AMCPushButton(QWidget *parent=0, const char *name=0);
+	~AMCPushButton();
+protected: // Protected methods
+  /** Force the button to be rectangular. Therfore we return the width as the needed height. */
+  virtual int heightForWidth( int w ) const;
+  /** No descriptions */
+  virtual void drawButton( QPainter* );
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcpushbutton.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcpushbutton.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcpushbutton.moc.cpp	(revision 3401)
@@ -0,0 +1,73 @@
+/****************************************************************************
+** AMCPushButton meta object code from reading C++ file 'amcpushbutton.h'
+**
+** Created: Thu Jan 29 00:51:51 2004
+**      by: The Qt MOC ($Id: amcpushbutton.moc.cpp,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "amcpushbutton.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *AMCPushButton::className() const
+{
+    return "AMCPushButton";
+}
+
+QMetaObject *AMCPushButton::metaObj = 0;
+
+void AMCPushButton::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QPushButton::className(), "QPushButton") != 0 )
+	badSuperclassWarning("AMCPushButton","QPushButton");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString AMCPushButton::tr(const char* s)
+{
+    return qApp->translate( "AMCPushButton", s, 0 );
+}
+
+QString AMCPushButton::tr(const char* s, const char * c)
+{
+    return qApp->translate( "AMCPushButton", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* AMCPushButton::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QPushButton::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    QMetaData::Access *slot_tbl_access = 0;
+    metaObj = QMetaObject::new_metaobject(
+	"AMCPushButton", "QPushButton",
+	0, 0,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcreportsocket.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcreportsocket.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcreportsocket.cpp	(revision 3401)
@@ -0,0 +1,140 @@
+// amcreportsocket.cpp: Implementierung der Klasse ReportController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "amcreportsocket.h"
+#include "activemirrorcontrol.h"
+#include "amcstate.h"
+#include "heatstate.h"
+#include "cc_defs.h"
+#include <qsocket.h>
+#include <qtimer.h>
+#include <qdatetime.h>
+
+extern AMCState*	g_pAMCState;
+extern HEATState* g_pHEATState;
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+AMCReportSocket::AMCReportSocket( QObject* parent )
+{
+	m_pParent = (ActiveMirrorControl*) parent;
+
+  m_qtComTime = QDateTime::currentDateTime();
+  m_qtComTime.setTime_t(0);
+	m_iComStatus = 0;
+
+	// create the command socket and connect to its signals
+	m_pReportSocket = new QSocket( this );
+	connect( m_pReportSocket, SIGNAL( hostFound() ), SLOT( hostFound() ) );
+	connect( m_pReportSocket, SIGNAL( connected() ), SLOT( connected() ) );
+	connect( m_pReportSocket, SIGNAL( connectionClosed() ), SLOT( connectionClosed() ) );
+  connect( m_pReportSocket, SIGNAL( delayedCloseFinished() ), SLOT( delayedCloseFinished() ) );
+  connect( m_pReportSocket, SIGNAL( readyRead() ), SLOT( readyRead() ) );
+  connect( m_pReportSocket, SIGNAL( bytesWritten( int ) ), SLOT( bytesWritten( int ) ) );
+  connect( m_pReportSocket, SIGNAL( error( int ) ), SLOT( error( int ) ) );
+	m_zConnected = false;
+
+	// create the timer and connect to its signals
+	// we ill start the timer when connected every second to send a report
+	m_pSecTimer = new QTimer( this );
+  connect( m_pSecTimer, SIGNAL(timeout()), SLOT(sendReport()) );
+	
+  m_pReportSocket->connectToHost( CC_HOST_ADDRESS, AMC_REP_PORT);
+}
+
+AMCReportSocket::~AMCReportSocket()
+{
+	delete m_pSecTimer;
+	delete m_pReportSocket;
+}
+
+void AMCReportSocket::connectToHost( const QString& m_qsHost, Q_UINT16 m_iPort )
+{
+  m_pReportSocket->connectToHost( m_qsHost, m_iPort);
+}
+
+void AMCReportSocket::hostFound()
+{
+//	qDebug("Found host");
+//	sendedMsgs->append("Found host");
+}
+
+void AMCReportSocket::connected()
+{
+	m_pSecTimer->start( 1000 );
+	m_zConnected = true;
+	qDebug("Connected to host");	
+	emit ccConnected();
+}
+
+void AMCReportSocket::connectionClosed()
+{
+	m_pSecTimer->stop();
+	m_zConnected = true;
+	qDebug("Other side closed connection");
+}
+
+void AMCReportSocket::delayedCloseFinished()
+{
+	qDebug("Remaining bytes written to socket");
+}
+
+void AMCReportSocket::readyRead()
+{
+	qDebug("Messages available on socket");
+}
+
+void AMCReportSocket::bytesWritten( int p_iNum )
+{
+	QString text;
+	text.sprintf("%d bytes written to socket", p_iNum );
+//	qDebug( text );
+}
+
+void AMCReportSocket::error( int p_iErrno )
+{
+	QString errText;
+	switch( p_iErrno )
+	{
+	case QSocket::ErrConnectionRefused:
+		errText.sprintf( "TCPIP error: ConnectionRefused" );
+		emit ccConnectionRefused();
+		break;
+	case QSocket::ErrHostNotFound :
+		errText.sprintf( "TCPIP error: HostNotFound " );
+		break;
+	case QSocket::ErrSocketRead :
+		errText.sprintf( "TCPIP error: SocketRead " );
+		break;
+	default:
+		errText.sprintf( "TCPIP error: Unknown" );
+		break;
+	}
+	qDebug( errText );
+	if( m_zConnected )
+		m_zConnected = false;
+}
+
+void AMCReportSocket::sendReport()
+{
+	QString cmd;
+	QDateTime amcTime = QDateTime::currentDateTime();
+	cmd.sprintf("AMC-REPORT %02d %04d %02d %02d %02d %02d %02d %03d %02d %04d %02d %02d %02d %02d %02d %03d %02d PANELS %03d %03d OVER\n",
+				 g_pAMCState->getState(),
+				 amcTime.date().year(), amcTime.date().month(), amcTime.date().day(),
+				 amcTime.time().hour(), amcTime.time().minute(), amcTime.time().second(), amcTime.time().msec(),
+				 m_iComStatus,
+				 m_qtComTime.date().year(), m_qtComTime.date().month(), m_qtComTime.date().day(),
+				 m_qtComTime.time().hour(), m_qtComTime.time().minute(), m_qtComTime.time().second(),
+         m_qtComTime.time().msec(),
+				 g_pHEATState->getState(),
+				 g_pAMCState->installedPanels(), g_pAMCState->errorPanels() );
+	emit reportDelivered( amcTime, cmd );
+	if( m_zConnected )
+	{
+		m_pReportSocket->writeBlock( cmd.latin1(), cmd.length() );
+	}
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcreportsocket.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcreportsocket.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcreportsocket.h	(revision 3401)
@@ -0,0 +1,52 @@
+// amcreportsocket.h: Schnittstelle für die Klasse ReportController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef AMCREPORTSOCKET_H
+#define AMCREPORTSOCKET_H
+
+#include <qobject.h>
+#include <qdatetime.h>
+
+class ActiveMirrorControl;
+class QSocket;
+class QTimer;
+
+class AMCReportSocket : public QObject
+{
+    Q_OBJECT
+
+public:
+	AMCReportSocket( QObject* parent );
+	virtual ~AMCReportSocket();
+
+public:
+	void connectToHost( const QString& m_qsHost, Q_UINT16 m_iPort );
+  void setComStatus( int p_iStatus ) { m_iComStatus = p_iStatus; }
+
+private slots:
+	void hostFound();
+	void connected();
+	void connectionClosed();
+	void delayedCloseFinished();
+	void readyRead();
+	void bytesWritten( int p_iNum );
+	void error( int p_iErrno );
+	void sendReport();
+
+private:
+	int m_iComStatus;
+	bool m_zConnected;
+	QSocket* m_pReportSocket;
+	QTimer* m_pSecTimer;
+	QDateTime m_qtComTime;
+	ActiveMirrorControl*	m_pParent;
+
+signals: // Signals
+  /** No descriptions */
+  void ccConnectionRefused();
+  void ccConnected();
+  void reportDelivered( QDateTime&, QString& );
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcreportsocket.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcreportsocket.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcreportsocket.moc.cpp	(revision 3401)
@@ -0,0 +1,213 @@
+/****************************************************************************
+** AMCReportSocket meta object code from reading C++ file 'amcreportsocket.h'
+**
+** Created: Thu Feb 5 20:13:24 2004
+**      by: The Qt MOC ($Id: amcreportsocket.moc.cpp,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "amcreportsocket.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *AMCReportSocket::className() const
+{
+    return "AMCReportSocket";
+}
+
+QMetaObject *AMCReportSocket::metaObj = 0;
+
+void AMCReportSocket::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QObject::className(), "QObject") != 0 )
+	badSuperclassWarning("AMCReportSocket","QObject");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString AMCReportSocket::tr(const char* s)
+{
+    return qApp->translate( "AMCReportSocket", s, 0 );
+}
+
+QString AMCReportSocket::tr(const char* s, const char * c)
+{
+    return qApp->translate( "AMCReportSocket", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* AMCReportSocket::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QObject::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (AMCReportSocket::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    typedef void (AMCReportSocket::*m1_t1)();
+    typedef void (QObject::*om1_t1)();
+    typedef void (AMCReportSocket::*m1_t2)();
+    typedef void (QObject::*om1_t2)();
+    typedef void (AMCReportSocket::*m1_t3)();
+    typedef void (QObject::*om1_t3)();
+    typedef void (AMCReportSocket::*m1_t4)();
+    typedef void (QObject::*om1_t4)();
+    typedef void (AMCReportSocket::*m1_t5)(int);
+    typedef void (QObject::*om1_t5)(int);
+    typedef void (AMCReportSocket::*m1_t6)(int);
+    typedef void (QObject::*om1_t6)(int);
+    typedef void (AMCReportSocket::*m1_t7)();
+    typedef void (QObject::*om1_t7)();
+    m1_t0 v1_0 = &AMCReportSocket::hostFound;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &AMCReportSocket::connected;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &AMCReportSocket::connectionClosed;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &AMCReportSocket::delayedCloseFinished;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    m1_t4 v1_4 = &AMCReportSocket::readyRead;
+    om1_t4 ov1_4 = (om1_t4)v1_4;
+    m1_t5 v1_5 = &AMCReportSocket::bytesWritten;
+    om1_t5 ov1_5 = (om1_t5)v1_5;
+    m1_t6 v1_6 = &AMCReportSocket::error;
+    om1_t6 ov1_6 = (om1_t6)v1_6;
+    m1_t7 v1_7 = &AMCReportSocket::sendReport;
+    om1_t7 ov1_7 = (om1_t7)v1_7;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(8);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(8);
+    slot_tbl[0].name = "hostFound()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Private;
+    slot_tbl[1].name = "connected()";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Private;
+    slot_tbl[2].name = "connectionClosed()";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Private;
+    slot_tbl[3].name = "delayedCloseFinished()";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Private;
+    slot_tbl[4].name = "readyRead()";
+    slot_tbl[4].ptr = (QMember)ov1_4;
+    slot_tbl_access[4] = QMetaData::Private;
+    slot_tbl[5].name = "bytesWritten(int)";
+    slot_tbl[5].ptr = (QMember)ov1_5;
+    slot_tbl_access[5] = QMetaData::Private;
+    slot_tbl[6].name = "error(int)";
+    slot_tbl[6].ptr = (QMember)ov1_6;
+    slot_tbl_access[6] = QMetaData::Private;
+    slot_tbl[7].name = "sendReport()";
+    slot_tbl[7].ptr = (QMember)ov1_7;
+    slot_tbl_access[7] = QMetaData::Private;
+    typedef void (AMCReportSocket::*m2_t0)();
+    typedef void (QObject::*om2_t0)();
+    typedef void (AMCReportSocket::*m2_t1)();
+    typedef void (QObject::*om2_t1)();
+    typedef void (AMCReportSocket::*m2_t2)(QDateTime&,QString&);
+    typedef void (QObject::*om2_t2)(QDateTime&,QString&);
+    m2_t0 v2_0 = &AMCReportSocket::ccConnectionRefused;
+    om2_t0 ov2_0 = (om2_t0)v2_0;
+    m2_t1 v2_1 = &AMCReportSocket::ccConnected;
+    om2_t1 ov2_1 = (om2_t1)v2_1;
+    m2_t2 v2_2 = &AMCReportSocket::reportDelivered;
+    om2_t2 ov2_2 = (om2_t2)v2_2;
+    QMetaData *signal_tbl = QMetaObject::new_metadata(3);
+    signal_tbl[0].name = "ccConnectionRefused()";
+    signal_tbl[0].ptr = (QMember)ov2_0;
+    signal_tbl[1].name = "ccConnected()";
+    signal_tbl[1].ptr = (QMember)ov2_1;
+    signal_tbl[2].name = "reportDelivered(QDateTime&,QString&)";
+    signal_tbl[2].ptr = (QMember)ov2_2;
+    metaObj = QMetaObject::new_metaobject(
+	"AMCReportSocket", "QObject",
+	slot_tbl, 8,
+	signal_tbl, 3,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
+
+// SIGNAL ccConnectionRefused
+void AMCReportSocket::ccConnectionRefused()
+{
+    activate_signal( "ccConnectionRefused()" );
+}
+
+// SIGNAL ccConnected
+void AMCReportSocket::ccConnected()
+{
+    activate_signal( "ccConnected()" );
+}
+
+#include <qobjectdefs.h>
+#include <qsignalslotimp.h>
+
+// SIGNAL reportDelivered
+void AMCReportSocket::reportDelivered( QDateTime& t0, QString& t1 )
+{
+    // No builtin function for signal parameter type QDateTime&,QString&
+    QConnectionList *clist = receivers("reportDelivered(QDateTime&,QString&)");
+    if ( !clist || signalsBlocked() )
+	return;
+    typedef void (QObject::*RT0)();
+    typedef void (QObject::*RT1)(QDateTime&);
+    typedef void (QObject::*RT2)(QDateTime&,QString&);
+    RT0 r0;
+    RT1 r1;
+    RT2 r2;
+    QConnectionListIt it(*clist);
+    QConnection   *c;
+    QSenderObject *object;
+    while ( (c=it.current()) ) {
+	++it;
+	object = (QSenderObject*)c->object();
+	object->setSender( this );
+	switch ( c->numArgs() ) {
+	    case 0:
+#ifdef Q_FP_CCAST_BROKEN
+		r0 = reinterpret_cast<RT0>(*(c->member()));
+#else
+		r0 = (RT0)*(c->member());
+#endif
+		(object->*r0)();
+		break;
+	    case 1:
+#ifdef Q_FP_CCAST_BROKEN
+		r1 = reinterpret_cast<RT1>(*(c->member()));
+#else
+		r1 = (RT1)*(c->member());
+#endif
+		(object->*r1)(t0);
+		break;
+	    case 2:
+#ifdef Q_FP_CCAST_BROKEN
+		r2 = reinterpret_cast<RT2>(*(c->member()));
+#else
+		r2 = (RT2)*(c->member());
+#endif
+		(object->*r2)(t0, t1);
+		break;
+	}
+    }
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcserialport.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcserialport.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcserialport.cpp	(revision 3401)
@@ -0,0 +1,118 @@
+/***************************************************************************
+                          amcserialport.cpp  -  description
+                             -------------------
+    begin                : Sun Nov 24 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#include <fcntl.h>
+#include <termios.h>
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+
+#include "amcserialport.h"
+#include "amcerrors.h"
+#include "amcerror.h"
+
+AMCSerialPort::AMCSerialPort(){
+}
+
+AMCSerialPort::~AMCSerialPort()
+{
+    // close the device if open
+    if( tcsetattr( m_fd, TCSANOW, &m_oldtio ) != 0)
+    	perror("AMCSerialPort::~AMCSerialPort --- ERROR calling tcsetattr()");
+    close( m_fd );
+}
+
+/** Open and initialize the serial port */
+void AMCSerialPort::init( const char* p_csDevice )
+{
+    struct termios newtio;
+
+    // open the device
+    m_fd = open( p_csDevice, O_RDWR | O_NOCTTY );
+    if( m_fd == -1 )
+    {
+    	perror( "AMCSerialPort::init() --- ERROR calling open()" );
+      AMCError aErr( IDS_ERROR_PORT_OPEN );
+      throw aErr;
+    }
+
+    // get old termio data structure so that we can
+    // reset the serial port when exiting.
+    if( tcgetattr( m_fd, &m_oldtio ) != 0)
+    {
+    	perror( "AMCSerialPort::init() --- ERROR calling tcgetattr()" );
+      AMCError aErr( IDS_ERROR_PORT_GET_ATTR );
+      throw aErr;
+    }
+
+    bzero( &newtio, sizeof( newtio ) );
+		qDebug("%s", p_csDevice);
+//    if( strcmp( p_csDevice, "/dev/ttyS4") == 0)
+//		{
+//			qDebug("Baudrate is 57600");
+//    	newtio.c_cflag = BAUDRATE2 | CS8 | CREAD | CLOCAL;
+//		}
+//		else
+//		{
+			qDebug("Baudrate is 115200");
+    	newtio.c_cflag = BAUDRATE | CS8 | CREAD | CLOCAL;
+//		}
+
+    newtio.c_iflag = IGNPAR | ICRNL;
+    newtio.c_oflag = 0;
+
+    /* set input mode (non-canonical, no echo, ...) */
+    newtio.c_lflag = 0;
+
+    newtio.c_cc[VTIME] = 1;   /* inter-character timer set to 1/10 of a second */
+    newtio.c_cc[VMIN]  = 0;    /* non-blocking read */
+
+    tcflush( m_fd, TCIFLUSH );
+   	if( tcsetattr( m_fd, TCSAFLUSH, &newtio ) != 0)
+    {
+    	perror( "AMCSerialPort::init() --- ERROR calling tcsetattr()" );
+      AMCError aErr( IDS_ERROR_PORT_SET_ATTR );
+      throw aErr;
+    }
+
+    return;
+}
+
+/** Write one charachter to the serial port */
+int AMCSerialPort::transmitChar( char ch )
+{
+	return write( m_fd, (const void*) &ch, 1);
+}
+
+/** Read maxlen characters from the serial port into the buffer */
+int AMCSerialPort::readBlock( char* p_pBuffer, int p_iMaxLen )
+{
+  int num, iTot = 0;
+  char* pBuf = p_pBuffer;
+//	for( int i=0; i<3; i++)
+//	{
+		num = read( m_fd, pBuf, p_iMaxLen );
+//    qDebug("Read %d Bytes", num);
+//    usleep(1000);
+//		if( num == 0)
+//			num = read( m_fd, p_pBuffer, p_iMaxLen );
+//      break;
+    pBuf += num;
+    iTot += num;
+
+//	}
+//  qDebug("Total read %d Bytes", iTot);
+	return iTot;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcserialport.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcserialport.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcserialport.h	(revision 3401)
@@ -0,0 +1,47 @@
+/***************************************************************************
+                          amcserialport.h  -  description
+                             -------------------
+    begin                : Sun Nov 24 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#ifndef AMCSERIALPORT_H
+#define AMCSERIALPORT_H
+
+#include <termios.h>
+
+#define BAUDRATE B115200
+#define BAUDRATE2 B57600
+#define MODEMDEVICE "/dev/ttyS%d"
+
+/**
+  *@author Martin Merck
+  */
+
+class AMCSerialPort {
+public: 
+  AMCSerialPort();
+  ~AMCSerialPort();
+  /** No descriptions */
+  void init( const char* p_pPort );
+  /** Write one charachter to the serial port */
+  int transmitChar( char ch );
+  /** No descriptions */
+  int readBlock( char* p_pBuffer, int p_iMaxLen );
+
+private: // Private attributes
+  /** File descripor representing the open serial port */
+  int m_fd;
+  /** Structure to hold the original terminal IO setup. We will restore it when leaving the program. */
+  struct termios m_oldtio;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcstate.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcstate.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcstate.cpp	(revision 3401)
@@ -0,0 +1,70 @@
+/***************************************************************************
+                          amcstate.cpp  -  description
+                             -------------------
+    begin                : Fri Apr 4 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "amcstate.h"
+
+AMCState::AMCState(QObject *parent, const char *name ) : QObject( parent, name )
+{
+	m_qsStateTxtTable[AMC_STATE_ERROR]         = new QString( "AMC error" );
+	m_qsStateTxtTable[AMC_STATE_PARKED]        = new QString( "AMC mirrors parked" );
+	m_qsStateTxtTable[AMC_STATE_INITIALIZED]   = new QString( "AMC is initialized" );
+	m_qsStateTxtTable[AMC_STATE_READJUST]      = new QString( "AMC neads readjustment" );
+	m_qsStateTxtTable[AMC_STATE_ADJUSTED]      = new QString( "AMC is adjusted" );
+	m_qsStateTxtTable[AMC_STATE_MOVING]        = new QString( "AMC is moving mirrors" );
+	m_qsStateTxtTable[AMC_STATE_LASERADJUSTED] = new QString( "AMC is laser-adjusted" );
+	m_qsStateTxtTable[AMC_STATE_UNDEFINED]     = new QString( "AMC is in undefined state" );
+	m_qsStateTxtTable[AMC_STATE_USER]          = new QString( "AMC is in user mode" );
+	m_qsStateTxtTable[AMC_STATE_NOT_AVAILABLE] = new QString( "AMC has no connection to CC" );
+	m_qsStateTxtTable[AMC_STATE_UNKNOWN]			 = new QString( "AMC is in an unknown state." );
+	m_iInstalledPanels = 0;
+	m_iErrorPanels = 0;
+}
+
+AMCState::~AMCState()
+{
+}
+
+/** Set the state. */
+void AMCState::setState( int p_iState )
+{
+  // if the new state is equal to the actual state we
+  // do nothing.
+	if( p_iState == m_iState )
+		return;
+
+	int iOldState = m_iState;
+	m_iState = p_iState;
+
+	emit stateChanged( iOldState, m_iState );
+}
+
+/** Return the actual state. */
+int AMCState::getState() const
+{
+	return m_iState;
+}
+
+/** Get a textual description of the state. */
+const QString& AMCState::getText( int p_iState ) const
+{
+	if ( ( p_iState < AMC_STATE_ERROR )
+				||
+			 ( p_iState > AMC_STATE_NOT_AVAILABLE ) )
+		return( *m_qsStateTxtTable[ AMC_STATE_UNKNOWN ] );
+	else
+		return( *m_qsStateTxtTable[ p_iState ] );
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcstate.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcstate.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcstate.h	(revision 3401)
@@ -0,0 +1,85 @@
+/***************************************************************************
+                          amcstate.h  -  description
+                             -------------------
+    begin                : Fri Apr 4 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef AMCSTATE_H
+#define AMCSTATE_H
+
+#include <qwidget.h>
+
+/**State of the AMC.
+  *@author Martin Merck
+  */
+
+#define AMC_STATE_ERROR					0
+#define AMC_STATE_PARKED				1
+#define AMC_STATE_INITIALIZED		2
+#define AMC_STATE_READJUST			3
+#define AMC_STATE_ADJUSTED			4
+#define AMC_STATE_LASERADJUSTED	5
+#define AMC_STATE_MOVING				6
+#define AMC_STATE_UNDEFINED			7
+#define AMC_STATE_USER					8
+#define AMC_STATE_NOT_AVAILABLE	9
+#define AMC_STATE_UNKNOWN				10
+
+class AMCState : public QObject  {
+   Q_OBJECT
+
+public:
+	AMCState( QObject *parent=0, const char* name=0 );
+	~AMCState();
+  /** Return the actual state. */
+  int getState() const;
+  /** Set the state. */
+  void setState( int p_iState );
+  /** Set the number of installed panels. */
+  void setZdAz( double p_dZd, double p_dAz ) { m_dZd = p_dZd; m_dAz = p_dAz; };
+  /** Set the number of installed panels. */
+  void setInstalledPanels( int p_iPanels ) { m_iInstalledPanels = p_iPanels; };
+  /** Set the number of installed panels. */
+  void setErrorPanels( int p_iPanels ) { m_iErrorPanels = p_iPanels; };
+  /** Set the number of installed panels. */
+  int installedPanels() { return m_iInstalledPanels; };
+  /** Set the number of installed panels. */
+  int errorPanels() { return m_iErrorPanels; };
+  /** Get a textual description of the state. */
+  const QString& getText( int p_iState ) const;
+
+private: // Private attributes
+  /** Variable holding the actual state. */
+  int m_iState;
+  /** Variable holding the Lid state. */
+  int m_iStateLid;
+  /** Variable holding the LED state. */
+  int m_iStateLEDs;
+  /** Variable holding the number of installed panels. */
+  int m_iInstalledPanels;
+  /** Variable holding the number of panels with errors. */
+  int m_iErrorPanels;
+  /** Zenith distance reported by the drive system */
+  double m_dZd;
+  /** Azimuth reported by the drive system */
+  double m_dAz;
+  /**  */
+  QString* m_qsStateTxtTable[11];
+
+signals: // Signals
+  /** Signal emitted when the state changes. */
+  void stateChanged( int p_iOldState, int p_iNewState );
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcstate.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcstate.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/amcstate.moc.cpp	(revision 3401)
@@ -0,0 +1,132 @@
+/****************************************************************************
+** AMCState meta object code from reading C++ file 'amcstate.h'
+**
+** Created: Thu Feb 5 20:56:37 2004
+**      by: The Qt MOC ($Id: amcstate.moc.cpp,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "amcstate.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *AMCState::className() const
+{
+    return "AMCState";
+}
+
+QMetaObject *AMCState::metaObj = 0;
+
+void AMCState::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QObject::className(), "QObject") != 0 )
+	badSuperclassWarning("AMCState","QObject");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString AMCState::tr(const char* s)
+{
+    return qApp->translate( "AMCState", s, 0 );
+}
+
+QString AMCState::tr(const char* s, const char * c)
+{
+    return qApp->translate( "AMCState", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* AMCState::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QObject::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    QMetaData::Access *slot_tbl_access = 0;
+    typedef void (AMCState::*m2_t0)(int,int);
+    typedef void (QObject::*om2_t0)(int,int);
+    m2_t0 v2_0 = &AMCState::stateChanged;
+    om2_t0 ov2_0 = (om2_t0)v2_0;
+    QMetaData *signal_tbl = QMetaObject::new_metadata(1);
+    signal_tbl[0].name = "stateChanged(int,int)";
+    signal_tbl[0].ptr = (QMember)ov2_0;
+    metaObj = QMetaObject::new_metaobject(
+	"AMCState", "QObject",
+	0, 0,
+	signal_tbl, 1,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
+
+#include <qobjectdefs.h>
+#include <qsignalslotimp.h>
+
+// SIGNAL stateChanged
+void AMCState::stateChanged( int t0, int t1 )
+{
+    // No builtin function for signal parameter type int,int
+    QConnectionList *clist = receivers("stateChanged(int,int)");
+    if ( !clist || signalsBlocked() )
+	return;
+    typedef void (QObject::*RT0)();
+    typedef void (QObject::*RT1)(int);
+    typedef void (QObject::*RT2)(int,int);
+    RT0 r0;
+    RT1 r1;
+    RT2 r2;
+    QConnectionListIt it(*clist);
+    QConnection   *c;
+    QSenderObject *object;
+    while ( (c=it.current()) ) {
+	++it;
+	object = (QSenderObject*)c->object();
+	object->setSender( this );
+	switch ( c->numArgs() ) {
+	    case 0:
+#ifdef Q_FP_CCAST_BROKEN
+		r0 = reinterpret_cast<RT0>(*(c->member()));
+#else
+		r0 = (RT0)*(c->member());
+#endif
+		(object->*r0)();
+		break;
+	    case 1:
+#ifdef Q_FP_CCAST_BROKEN
+		r1 = reinterpret_cast<RT1>(*(c->member()));
+#else
+		r1 = (RT1)*(c->member());
+#endif
+		(object->*r1)(t0);
+		break;
+	    case 2:
+#ifdef Q_FP_CCAST_BROKEN
+		r2 = reinterpret_cast<RT2>(*(c->member()));
+#else
+		r2 = (RT2)*(c->member());
+#endif
+		(object->*r2)(t0, t1);
+		break;
+	}
+    }
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialog.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialog.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialog.cpp	(revision 3401)
@@ -0,0 +1,514 @@
+#include "calibratelasermovementdialog.h"
+#include "amcerror.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcframegrabber.h"
+#include "amcprogdlg.h"
+#include "errorinfoevent.h"
+#include "eventdefs.h"
+#include "frameevent.h"
+#include "linearregression.h"
+#include "magicmirror.h"
+#include "progressinfoevent.h"
+#include "threadcontroller.h"
+#include "videospot.h"
+#include <qpushbutton.h>
+#include <qprogressbar.h>
+#include <qdatetime.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qlist.h>
+#include <qevent.h>
+#include <qthread.h>
+#include <qimage.h>
+#include <qnamespace.h>
+#include <qmultilineedit.h>
+#include <qlist.h>
+#include <math.h>
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern AMCSerialPort* g_pPort[];
+extern MagicMirror*		g_theMirror;
+extern AMCFrameGrabber* g_pFG;
+
+
+CalibrateLaserMovementDialog::CalibrateLaserMovementDialog( QWidget* parent, const char* name, bool modal, WFlags f )
+	: CalibrateLaserMovementDialogBase( parent, name, modal, f )
+{
+	// Add your code
+	TotalProgress->setTotalSteps( g_theMirror->getNumPanels() - 1 );
+	PanelProgress->setTotalSteps( 39 - 1 );
+
+  m_pFG = g_pFG;
+	m_pData = new uchar[ m_pFG->getBuffsize()];
+	m_pDark = new uchar[ m_pFG->getBuffsize()];
+	m_pXLinearRegression = new LinearRegression();
+	m_pYLinearRegression = new LinearRegression();
+
+	QDateTime theDT = QDateTime::currentDateTime();
+	QDate theDate = theDT.date();
+	QTime theTime = theDT.time();
+	QString qsFileName;
+	qsFileName.sprintf( "/home/amc/data/AMC_%04d_%02d_%02d_%02d_%02d_%02d.cal",
+                      theDate.year(), theDate.month(), theDate.day(),
+                      theTime.hour(), theTime.minute(), theTime.second() );
+	m_qfFile.setName( qsFileName );
+	if( ! m_qfFile.open( IO_WriteOnly ) )
+	{
+		qDebug( "ERROR: Can't open file: %s\n", qsFileName.latin1() );
+	}
+	m_qtsStream.setDevice( &m_qfFile );
+
+	m_qlSpotList.setAutoDelete( true );
+}
+
+CalibrateLaserMovementDialog::~CalibrateLaserMovementDialog()
+{
+	delete[]	m_pData;
+	delete[]	m_pDark;
+}
+
+void CalibrateLaserMovementDialog::startThread()
+{
+	TotalProgress->reset();
+	buttonStart->setEnabled( false );
+	buttonStop->setEnabled( true );
+	buttonOk->setEnabled( false );
+	m_zRun = true;
+	this->start();
+}
+
+void CalibrateLaserMovementDialog::outputProgress(QString qsMsg)
+{
+	QThread::postEvent( this, new ProgressInfoEvent( qsMsg ) );
+}
+
+void CalibrateLaserMovementDialog::outputError(QString qsMsg)
+{
+	QThread::postEvent( this, new ErrorInfoEvent( qsMsg ) );
+}
+
+void CalibrateLaserMovementDialog::run()
+{
+	QString qsMsg;
+
+//	buttonStart->setEnabled( false );
+  QTime t;
+  t.start();                          // start clock
+
+	for(int i=0; i<8; i++)
+	{
+		QList<AMCMirrorPanel> qlPanels = g_theMirror->panelForPort(i);
+		for( AMCMirrorPanel* pActualPanel = qlPanels.first();
+			 pActualPanel; pActualPanel = qlPanels.next() )
+		{
+			checkStop();
+
+			QCustomEvent* pEvent = new QCustomEvent( NEW_PANEL_EVENT );
+			pEvent->setData( (void*) pActualPanel );
+			QThread::postEvent( this, (QEvent*) pEvent );
+			m_pCurrentPanel = pActualPanel;
+			PanelProgress->reset();
+			qsMsg.sprintf( "Calibrating panel : (%d,%d)",
+										 m_pCurrentPanel->i(), m_pCurrentPanel->j());
+			m_qtsStream << "# " << endl << "# " <<qsMsg << endl;
+			outputProgress( qsMsg );
+		  m_pFG->grabFrame( m_pDark );
+//			m_aMutex.lock();
+//			m_aMutex.unlock();
+  	
+			AMCSerialPort* pPort = g_pPort[ m_pCurrentPanel->port()-1 ];
+			m_pMotor = new AMCMotor( pPort );
+
+			try
+			{
+	      m_pMotor->unselectBox();
+				int iBox = m_pCurrentPanel->box();
+				m_pMotor->selectBox( iBox );
+	 			int iDriver = m_pCurrentPanel->driver();
+				m_pMotor->selectDriver( iDriver );	
+				int iFrequency = m_pMotor->getFrequency();
+				m_pMotor->switchLaser( true );
+				m_pCurrentPanel->setLaserOn( true );
+
+				outputProgress("Centering Panel");
+				m_pMotor->centerMotors();
+				m_pMotor->waitForMotors( m_pMotor->calcTimeout( 17000 )+2 );
+				m_pCurrentPanel->setX( 0 );
+				m_pCurrentPanel->setY( 0 );
+
+				int iMinJ = -4000;
+				int iMaxJ = -4000;
+				double dMinX, dMinY;
+				double dMaxX, dMaxY;
+				m_pXLinearRegression->reset();
+				for( int j= -2700; j<=2700; j+=300)
+				{
+					checkStop();
+					processSpot( j, 0 );
+					m_pXLinearRegression->addPoint( m_iSpotX, m_iSpotY );
+					if( m_iSpotX != -1 )
+					{
+						if ( iMinJ < -3000 )
+						{
+							iMinJ = j;
+							dMinX = m_iSpotX;
+							dMinY = m_iSpotY;
+						}
+						else
+						{
+							iMaxJ = j;
+							dMaxX = m_iSpotX;
+							dMaxY = m_iSpotY;
+						}
+					}
+					m_qtsStream << j << " " << 0 << " " << m_iSpotX << " " << m_iSpotY << " ";
+					m_qtsStream << m_pXLinearRegression->getAxis() << " " << m_pXLinearRegression->getSlope() << endl;
+					QCustomEvent* pEvent = new QCustomEvent( X_SPOT_EVENT );
+					pEvent->setData( (void*) m_pXLinearRegression );
+					QThread::postEvent( this, (QEvent*) pEvent );
+				}
+				m_pCurrentPanel->setAxisX( m_pXLinearRegression->getAxis() );
+				m_pCurrentPanel->setSlopeX( m_pXLinearRegression->getSlope() );
+				if( iMinJ != -4000 )
+				{
+					double dSteps = (double) (iMaxJ - iMinJ);
+					if ( dSteps > 0)
+					{
+						double dDx = (dMaxX - dMinX);
+						double dDy = (dMaxY - dMinY);
+						double dPixels = sqrt( dDx * dDx + dDy * dDy );
+						m_qtsStream << "= " << dDx << "  " << dDy << "  " << dSteps << "  " << dPixels;
+						m_qtsStream << "  " << dSteps / dPixels << endl << endl;
+						m_pCurrentPanel->setConversionY( dSteps / dPixels );
+					}
+					else
+						m_pCurrentPanel->setConversionY( 0.0 );
+       	}
+
+				iMinJ = -4000;
+				iMaxJ = -4000;
+				m_pYLinearRegression->reset();
+				for( int j= -2700; j<=2700; j+=300)
+				{
+					checkStop();
+					processSpot( 0, j );
+					m_pYLinearRegression->addPoint( m_iSpotX, m_iSpotY );
+					if( m_iSpotX != -1 )
+					{
+						if ( iMinJ < -3000 )
+						{
+							iMinJ = j;
+							dMinX = m_iSpotX;
+							dMinY = m_iSpotY;
+						}
+						else
+						{
+							iMaxJ = j;
+							dMaxX = m_iSpotX;
+							dMaxY = m_iSpotY;
+						}
+					}
+					m_qtsStream << 0 << " " << j << " " << m_iSpotX << " " << m_iSpotY << " ";
+					m_qtsStream << m_pYLinearRegression->getAxis() << " " << m_pYLinearRegression->getSlope() << endl;
+					QCustomEvent* pEvent = new QCustomEvent( Y_SPOT_EVENT );
+					pEvent->setData( (void*) m_pYLinearRegression );
+					QThread::postEvent( this, (QEvent*) pEvent );
+				}
+				m_pCurrentPanel->setAxisY( m_pYLinearRegression->getAxis() );
+				m_pCurrentPanel->setSlopeY( m_pYLinearRegression->getSlope() );
+
+				if( iMinJ != -4000 )
+				{
+					double dSteps = (double) (iMaxJ - iMinJ);
+					if ( dSteps > 0)
+					{
+						double dDx = (dMaxX - dMinX);
+						double dDy = (dMaxY - dMinY);
+						double dPixels = sqrt( dDx * dDx + dDy * dDy );
+						m_qtsStream << "= " << dDx << "  " << dDy << "  " << dSteps << "  " << dPixels;
+						m_qtsStream << "  " << dSteps / dPixels << endl << endl;
+						m_pCurrentPanel->setConversionY( dSteps / dPixels );
+					}
+					else
+						m_pCurrentPanel->setConversionY( 0.0 );
+       	}
+				processSpot( 0, 0 );
+				m_pMotor->switchLaser( false );
+				m_pCurrentPanel->setLaserOn( false );
+
+			}
+			catch( AMCError& e)
+			{
+				qsMsg.sprintf( "Error while processing panel : (%d,%d)",
+											 m_pCurrentPanel->i(), m_pCurrentPanel->j());
+				qsMsg += e.formatError( 2 );
+				m_qtsStream << "! " <<qsMsg << endl;
+				outputError( qsMsg );
+				
+				/* If we had an error we will try 3 times to turn off the Laser.
+				 * This is necessary to be sure that the laser is off. Otherwise when
+				 * working with the next panel we have to spots and the calibartion
+				 * will fail. */
+				for( int i=0; i<3; i++)
+				{
+					try
+					{
+						m_pMotor->switchLaser( false );
+						i = 3;		// If we reach this point we succesfully switched of the laser
+											// so we can exit the loop.
+					}
+					catch( AMCError& e)
+					{				 		// Ignore errors in this case.
+					}
+				}
+			}
+			
+			qsMsg.sprintf( "Done with panel : (%d,%d)",
+											 m_pCurrentPanel->i(), m_pCurrentPanel->j());
+			outputError( qsMsg );
+			QThread::postEvent( this, new QCustomEvent( TOTAL_PROGRESS_EVENT ) );
+
+			delete m_pMotor;
+		}
+	}
+
+	qsMsg.sprintf( "Total Time: %dms", t.elapsed() );
+	outputProgress( qsMsg );
+	QThread::postEvent( this, new QCustomEvent( THREAD_END_EVENT ) );
+}
+
+void CalibrateLaserMovementDialog::customEvent(QCustomEvent* e)
+{
+  if ( e->type() == PROGRESS_INFO_EVENT )
+	{             
+		ProgressInfoEvent* pie = (ProgressInfoEvent*) e;
+		QString qsMsg = pie->getMessage();
+
+		ProgressField->append( qsMsg );
+		ProgressField->setCursorPosition( ProgressField->numLines()+1, 0 );
+	}
+  if ( e->type() == ERROR_INFO_EVENT )
+	{
+		ErrorInfoEvent* eie = (ErrorInfoEvent*) e;
+		QString qsMsg = eie->getMessage();
+
+		ErrorField->append( qsMsg );
+		ErrorField->setCursorPosition( ErrorField->numLines()+1, 0 );
+	}
+  if ( e->type() == NEW_PANEL_EVENT )
+	{
+		QString info;
+
+		AMCMirrorPanel* pPanel = (AMCMirrorPanel*) e->data();
+		PanelBox->setTitle( info.sprintf( "Panel: %d,%d", pPanel->i(), pPanel->j() ) );
+		PortLabel->setText( info.sprintf( "Device: /dev/ttyS%d", pPanel->port()+3 ) );
+		BoxLabel->setText( info.sprintf( "Box: %02d", pPanel->box() ) );
+		DriverLabel->setText( info.sprintf( "Driver: %d", pPanel->driver() ) );
+	}
+  if ( e->type() == X_SPOT_EVENT )
+	{
+		QString info;
+		LinearRegression* pRegress = (LinearRegression*) e->data();
+		XAxisEdit->setText( info.sprintf( "%8.2f", pRegress->getAxis() ) );
+		XSlopeEdit->setText( info.sprintf( "%8.2f", pRegress->getSlope() ) );
+	}
+  if ( e->type() == Y_SPOT_EVENT )
+	{
+		QString info;
+		LinearRegression* pRegress = (LinearRegression*) e->data();
+		YAxisEdit->setText( info.sprintf( "%8.2f", pRegress->getAxis() ) );
+		YSlopeEdit->setText( info.sprintf( "%8.2f", pRegress->getSlope() ) );
+	}
+  if ( e->type() == PANEL_PROGRESS_EVENT )
+		PanelProgress->setProgress( PanelProgress->progress()+1 );
+  if ( e->type() == TOTAL_PROGRESS_EVENT )
+		TotalProgress->setProgress( TotalProgress->progress()+1 );
+//  if ( e->type() == FRAME_EVENT )
+//		saveImage( (FrameEvent*) e );
+  if ( e->type() == THREAD_END_EVENT )
+		buttonStart->setEnabled( true );
+
+}
+
+/*
+void CalibrateLaserMovementDialog::saveImage( FrameEvent* p_pFrameEvent )
+{
+	int i,j,x,y;
+	QPixmap* pPixmap;
+
+  i = p_pFrameEvent->getI();
+  j = p_pFrameEvent->getJ();
+  x = p_pFrameEvent->getX();
+  y = p_pFrameEvent->getY();
+  pPixmap = p_pFrameEvent->getPixmap();
+
+	QString fileName;
+	fileName.sprintf( "/home/amc/data/image(%d,%d)at[%d,%d].bmp", i, j, x, y );
+//	qDebug("Saving "+fileName );
+//	fileName.sprintf( "/home/amc/data/image(%d,%d).png", i, j );
+
+	pPixmap->save( fileName, "BMP" );
+	delete pPixmap;
+}
+*/
+
+/** Find the Laser spot */
+void CalibrateLaserMovementDialog::findSpot( int& p_iX, int& p_iY )
+{
+  int threshold = getThreshold();
+
+	m_qlSpotList.clear();
+	int top = 0;
+	int bottom = MY_HEIGHT;
+	int left = 0;
+	int right = MY_WIDTH;
+
+  for (int i=top; i <bottom; i++)
+	{
+     for (int j=left; j < right ; j++)
+		{
+			int index= (j + i * MY_WIDTH) * MY_DEPTH;
+			bool zFound = false;
+			uchar data = m_pData[index];
+			if( data > threshold )
+	 		{
+				for( VideoSpot* pActualSpot = m_qlSpotList.first();
+		 				 pActualSpot; pActualSpot = m_qlSpotList.next() )
+				{
+					if( pActualSpot->contains( j, i ) )
+					{
+						pActualSpot->append( j, i, data );
+						zFound = true;
+						break;
+					}
+				}
+				if( zFound == false )
+				{
+					VideoSpot* pSpot = new VideoSpot();
+					pSpot->append( j, i, data );
+					m_qlSpotList.append( pSpot );
+				}
+
+	 		}
+		}
+	}
+	if( m_qlSpotList.count() == 1)
+	{
+		VideoSpot* pSpot = m_qlSpotList.first();
+		p_iX = pSpot->getX();
+		p_iY = pSpot->getY();
+	}
+	else
+	{
+		p_iX = -1;
+		p_iY = -1;
+	}
+}
+
+
+
+/** No descriptions */
+int CalibrateLaserMovementDialog::getThreshold()
+{
+	long sumx =0;
+	long sumx2 = 0;
+
+	long numPixel = MY_HEIGHT * MY_WIDTH;
+	for(int ind=0; ind < ( numPixel * MY_DEPTH); ind+=MY_DEPTH)
+	{
+		long data = (long) m_pData[ind];
+		sumx += data;
+		sumx2 += data * data;
+	}
+
+	double mean = ((double) sumx) / ((double) (numPixel));
+	double var = ((double) sumx2) / ((double) (numPixel)) - mean * mean;
+	double stddev = sqrt(var);
+
+  int threshold = (int) (mean + 15 * stddev);
+//	qDebug("Mean: %f StdDev: %f   Threshold %d", mean, stddev, threshold );
+	return threshold;
+}
+
+
+/** Process Spot */
+void CalibrateLaserMovementDialog::processSpot( int p_iX, int p_iY )
+{
+	QString qsMsg;
+
+	qsMsg.sprintf("Moving to position: (%d,%d)", p_iX, p_iY );
+	outputProgress( qsMsg );
+	int iX, iY;
+	iX = p_iX - m_pCurrentPanel->getX();
+	iY = p_iY - m_pCurrentPanel->getY();
+	m_pMotor->moveMotors( iX, iY );
+	m_pMotor->waitForMotors( m_pMotor->calcTimeout( MAX( abs(iX), abs(iY) ) ) + 1 );			
+	m_pCurrentPanel->setX( p_iX );
+	m_pCurrentPanel->setY( p_iY );
+	
+//	outputProgress( "Turning Laser on" );
+//	m_pMotor->switchLaser( true );
+//	m_pCurrentPanel->setLaserOn( true );
+
+//	msleep(20);
+	outputProgress( "Grabing Frame" );
+  m_pFG->grabFrame( m_pData );
+	QThread::postEvent( this, new FrameEvent( m_pCurrentPanel->i(),
+																						m_pCurrentPanel->j(),
+																						p_iX, p_iY ) );
+
+//	outputProgress( "Turning Laser off" );
+//	m_pMotor->switchLaser( false );
+//	m_pCurrentPanel->setLaserOn( false );
+
+	outputProgress( "Finding spot" );
+
+	substractDark();
+	findSpot( m_iSpotX, m_iSpotY );
+	qsMsg.sprintf("Spot at: (%d,%d)", m_iSpotX, m_iSpotY );
+	outputProgress( qsMsg );
+
+	QThread::postEvent( this, new QCustomEvent( PANEL_PROGRESS_EVENT ) );
+
+}
+
+void CalibrateLaserMovementDialog::stop()
+{
+	m_aMutex.lock();
+	m_zRun = false;
+	m_aMutex.unlock();
+	this->wait();
+	buttonStart->setEnabled( true );
+	buttonStop->setEnabled( false );
+	buttonOk->setEnabled( true );
+}
+
+void CalibrateLaserMovementDialog::checkStop()
+{
+	m_aMutex.lock();
+	if( ! m_zRun )
+	{
+		m_aMutex.unlock();
+		this->exit();
+	}	
+	m_aMutex.unlock();
+}
+
+/** No descriptions */
+void CalibrateLaserMovementDialog::substractDark()
+{
+	uchar* pData = m_pData;
+	uchar* pDark = m_pDark;
+	uchar* pEnd = m_pData + ( MY_HEIGHT * MY_WIDTH * MY_DEPTH);
+	for( ; pData < pEnd; pData++, pDark++ )
+	{
+		int help = (int) *pData - (int) *pDark;
+		if(help < 0)
+			help = 0;
+		*pData = (uchar) help;
+	}
+}
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialog.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialog.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialog.h	(revision 3401)
@@ -0,0 +1,56 @@
+#ifndef CALIBRATELASERMOVMENTDIALOG_H
+#define CALIBRATELASERMOVMENTDIALOG_H
+
+#include "calibratelasermovementdialogbase.h"
+#include <qthread.h>
+#include <qfile.h>
+#include <qtextstream.h>
+#include <qlist.h>
+
+class AMCFrameGrabber;
+class AMCMotor;
+class AMCMirrorPanel;
+class LinearRegression;
+class FrameEvent;
+class VideoSpot;
+
+class CalibrateLaserMovementDialog : public CalibrateLaserMovementDialogBase, public QThread
+{
+	Q_OBJECT
+
+public:
+	CalibrateLaserMovementDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0 );
+	virtual ~CalibrateLaserMovementDialog();
+	virtual void customEvent( QCustomEvent* e );
+	virtual void run();
+
+public slots:
+	virtual void startThread();
+  virtual void stop();
+
+private:
+	void processSpot( int p_iX, int p_iY );
+	void findSpot( int& p_iY, int& p_iY );
+	int getThreshold();
+	void checkStop();
+	void outputProgress( QString qsMsg );
+	void outputError( QString qsMsg );
+  /** No descriptions */
+  void substractDark();
+	AMCFrameGrabber*	m_pFG;
+	AMCMotor*					m_pMotor;
+	AMCMirrorPanel*		m_pCurrentPanel;
+	LinearRegression* m_pXLinearRegression;
+	LinearRegression* m_pYLinearRegression;
+	QList<VideoSpot>  m_qlSpotList;
+	QMutex						m_aMutex;
+	uchar*						m_pData;
+	uchar*						m_pDark;
+	bool 							m_zRun;
+	int								m_iSpotX;
+	int								m_iSpotY;
+	QFile							m_qfFile;
+	QTextStream				m_qtsStream;
+
+};
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialog.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialog.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialog.moc.cpp	(revision 3401)
@@ -0,0 +1,88 @@
+/****************************************************************************
+** CalibrateLaserMovementDialog meta object code from reading C++ file 'calibratelasermovementdialog.h'
+**
+** Created: Thu Jan 29 00:51:57 2004
+**      by: The Qt MOC ($Id: calibratelasermovementdialog.moc.cpp,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "calibratelasermovementdialog.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *CalibrateLaserMovementDialog::className() const
+{
+    return "CalibrateLaserMovementDialog";
+}
+
+QMetaObject *CalibrateLaserMovementDialog::metaObj = 0;
+
+void CalibrateLaserMovementDialog::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(CalibrateLaserMovementDialogBase::className(), "CalibrateLaserMovementDialogBase") != 0 )
+	badSuperclassWarning("CalibrateLaserMovementDialog","CalibrateLaserMovementDialogBase");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString CalibrateLaserMovementDialog::tr(const char* s)
+{
+    return qApp->translate( "CalibrateLaserMovementDialog", s, 0 );
+}
+
+QString CalibrateLaserMovementDialog::tr(const char* s, const char * c)
+{
+    return qApp->translate( "CalibrateLaserMovementDialog", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* CalibrateLaserMovementDialog::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) CalibrateLaserMovementDialogBase::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (CalibrateLaserMovementDialog::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    typedef void (CalibrateLaserMovementDialog::*m1_t1)();
+    typedef void (QObject::*om1_t1)();
+    m1_t0 v1_0 = &CalibrateLaserMovementDialog::startThread;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &CalibrateLaserMovementDialog::stop;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(2);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(2);
+    slot_tbl[0].name = "startThread()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "stop()";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"CalibrateLaserMovementDialog", "CalibrateLaserMovementDialogBase",
+	slot_tbl, 2,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.cpp	(revision 3401)
@@ -0,0 +1,335 @@
+#include <klocale.h>
+/****************************************************************************
+** Form implementation generated from reading ui file './calibratelasermovementdialogbase.ui'
+**
+** Created: Thu Jan 29 00:51:25 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "calibratelasermovementdialogbase.h"
+
+#include <qbuttongroup.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qmultilineedit.h>
+#include <qprogressbar.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/* 
+ *  Constructs a CalibrateLaserMovementDialogBase which is a child of 'parent', with the 
+ *  name 'name' and widget flags set to 'f' 
+ *
+ *  The dialog will by default be modeless, unless you set 'modal' to
+ *  TRUE to construct a modal dialog.
+ */
+CalibrateLaserMovementDialogBase::CalibrateLaserMovementDialogBase( QWidget* parent,  const char* name, bool modal, WFlags fl )
+    : QDialog( parent, name, modal, fl )
+{
+    if ( !name )
+	setName( "CalibrateLaserMovementDialogBase" );
+    resize( 594, 566 ); 
+    setCaption( i18n( "CalibrateLaserMovement" ) );
+    setSizeGripEnabled( TRUE );
+    CalibrateLaserMovementDialogBaseLayout = new QVBoxLayout( this ); 
+    CalibrateLaserMovementDialogBaseLayout->setSpacing( 6 );
+    CalibrateLaserMovementDialogBaseLayout->setMargin( 11 );
+
+    GroupBox1 = new QGroupBox( this, "GroupBox1" );
+    GroupBox1->setTitle( i18n( "Progress" ) );
+    GroupBox1->setColumnLayout(0, Qt::Vertical );
+    GroupBox1->layout()->setSpacing( 0 );
+    GroupBox1->layout()->setMargin( 0 );
+    GroupBox1Layout = new QVBoxLayout( GroupBox1->layout() );
+    GroupBox1Layout->setAlignment( Qt::AlignTop );
+    GroupBox1Layout->setSpacing( 6 );
+    GroupBox1Layout->setMargin( 11 );
+
+    ProgressField = new QMultiLineEdit( GroupBox1, "ProgressField" );
+    QPalette pal;
+    QColorGroup cg;
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 0, 170, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setActive( cg );
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 0, 170, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setInactive( cg );
+    cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 0, 170, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setDisabled( cg );
+    ProgressField->setPalette( pal );
+    GroupBox1Layout->addWidget( ProgressField );
+
+    ButtonGroup1 = new QButtonGroup( GroupBox1, "ButtonGroup1" );
+    ButtonGroup1->setFrameShape( QButtonGroup::NoFrame );
+    ButtonGroup1->setTitle( QString::null );
+    ButtonGroup1->setColumnLayout(0, Qt::Vertical );
+    ButtonGroup1->layout()->setSpacing( 0 );
+    ButtonGroup1->layout()->setMargin( 0 );
+    ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
+    ButtonGroup1Layout->setAlignment( Qt::AlignTop );
+    ButtonGroup1Layout->setSpacing( 6 );
+    ButtonGroup1Layout->setMargin( 11 );
+
+    PanelProgress = new QProgressBar( ButtonGroup1, "PanelProgress" );
+
+    ButtonGroup1Layout->addWidget( PanelProgress, 0, 1 );
+
+    TotalProgress = new QProgressBar( ButtonGroup1, "TotalProgress" );
+
+    ButtonGroup1Layout->addWidget( TotalProgress, 1, 1 );
+
+    TextLabel1_2 = new QLabel( ButtonGroup1, "TextLabel1_2" );
+    TextLabel1_2->setText( i18n( "Overall progress" ) );
+
+    ButtonGroup1Layout->addWidget( TextLabel1_2, 1, 0 );
+
+    TextLabel1 = new QLabel( ButtonGroup1, "TextLabel1" );
+    TextLabel1->setText( i18n( "Panel progress" ) );
+
+    ButtonGroup1Layout->addWidget( TextLabel1, 0, 0 );
+    GroupBox1Layout->addWidget( ButtonGroup1 );
+
+    PanelBox = new QGroupBox( GroupBox1, "PanelBox" );
+    PanelBox->setTitle( i18n( "Panel" ) );
+    PanelBox->setColumnLayout(0, Qt::Vertical );
+    PanelBox->layout()->setSpacing( 0 );
+    PanelBox->layout()->setMargin( 0 );
+    PanelBoxLayout = new QHBoxLayout( PanelBox->layout() );
+    PanelBoxLayout->setAlignment( Qt::AlignTop );
+    PanelBoxLayout->setSpacing( 6 );
+    PanelBoxLayout->setMargin( 11 );
+
+    PortLabel = new QLabel( PanelBox, "PortLabel" );
+    PortLabel->setText( i18n( "Port: --" ) );
+    PanelBoxLayout->addWidget( PortLabel );
+    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    PanelBoxLayout->addItem( spacer );
+
+    BoxLabel = new QLabel( PanelBox, "BoxLabel" );
+    BoxLabel->setText( i18n( "Box: --" ) );
+    PanelBoxLayout->addWidget( BoxLabel );
+    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    PanelBoxLayout->addItem( spacer_2 );
+
+    DriverLabel = new QLabel( PanelBox, "DriverLabel" );
+    DriverLabel->setText( i18n( "Driver: --" ) );
+    PanelBoxLayout->addWidget( DriverLabel );
+    GroupBox1Layout->addWidget( PanelBox );
+
+    Layout2 = new QHBoxLayout; 
+    Layout2->setSpacing( 6 );
+    Layout2->setMargin( 0 );
+
+    GroupBox3 = new QGroupBox( GroupBox1, "GroupBox3" );
+    GroupBox3->setTitle( i18n( "X Motor" ) );
+    GroupBox3->setColumnLayout(0, Qt::Vertical );
+    GroupBox3->layout()->setSpacing( 0 );
+    GroupBox3->layout()->setMargin( 0 );
+    GroupBox3Layout = new QHBoxLayout( GroupBox3->layout() );
+    GroupBox3Layout->setAlignment( Qt::AlignTop );
+    GroupBox3Layout->setSpacing( 6 );
+    GroupBox3Layout->setMargin( 11 );
+
+    XAxisLabel = new QLabel( GroupBox3, "XAxisLabel" );
+    XAxisLabel->setText( i18n( "Axis :" ) );
+    GroupBox3Layout->addWidget( XAxisLabel );
+
+    XAxisEdit = new QLineEdit( GroupBox3, "XAxisEdit" );
+    XAxisEdit->setEnabled( FALSE );
+    GroupBox3Layout->addWidget( XAxisEdit );
+    QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    GroupBox3Layout->addItem( spacer_3 );
+
+    XSlopeLabel = new QLabel( GroupBox3, "XSlopeLabel" );
+    XSlopeLabel->setText( i18n( "Slope :" ) );
+    GroupBox3Layout->addWidget( XSlopeLabel );
+
+    XSlopeEdit = new QLineEdit( GroupBox3, "XSlopeEdit" );
+    XSlopeEdit->setEnabled( FALSE );
+    GroupBox3Layout->addWidget( XSlopeEdit );
+    Layout2->addWidget( GroupBox3 );
+
+    YMotorBox = new QGroupBox( GroupBox1, "YMotorBox" );
+    YMotorBox->setTitle( i18n( "Y Motor" ) );
+    YMotorBox->setColumnLayout(0, Qt::Vertical );
+    YMotorBox->layout()->setSpacing( 0 );
+    YMotorBox->layout()->setMargin( 0 );
+    YMotorBoxLayout = new QHBoxLayout( YMotorBox->layout() );
+    YMotorBoxLayout->setAlignment( Qt::AlignTop );
+    YMotorBoxLayout->setSpacing( 6 );
+    YMotorBoxLayout->setMargin( 11 );
+
+    YAxisLabel = new QLabel( YMotorBox, "YAxisLabel" );
+    YAxisLabel->setText( i18n( "Axis :" ) );
+    YMotorBoxLayout->addWidget( YAxisLabel );
+
+    YAxisEdit = new QLineEdit( YMotorBox, "YAxisEdit" );
+    YAxisEdit->setEnabled( FALSE );
+    YMotorBoxLayout->addWidget( YAxisEdit );
+    QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    YMotorBoxLayout->addItem( spacer_4 );
+
+    YSlopeLabel = new QLabel( YMotorBox, "YSlopeLabel" );
+    YSlopeLabel->setText( i18n( "Slope :" ) );
+    YMotorBoxLayout->addWidget( YSlopeLabel );
+
+    YSlopeEdit = new QLineEdit( YMotorBox, "YSlopeEdit" );
+    YSlopeEdit->setEnabled( FALSE );
+    YMotorBoxLayout->addWidget( YSlopeEdit );
+    Layout2->addWidget( YMotorBox );
+    GroupBox1Layout->addLayout( Layout2 );
+    CalibrateLaserMovementDialogBaseLayout->addWidget( GroupBox1 );
+
+    GroupBox2 = new QGroupBox( this, "GroupBox2" );
+    GroupBox2->setTitle( i18n( "Errors" ) );
+    GroupBox2->setColumnLayout(0, Qt::Vertical );
+    GroupBox2->layout()->setSpacing( 0 );
+    GroupBox2->layout()->setMargin( 0 );
+    GroupBox2Layout = new QGridLayout( GroupBox2->layout() );
+    GroupBox2Layout->setAlignment( Qt::AlignTop );
+    GroupBox2Layout->setSpacing( 6 );
+    GroupBox2Layout->setMargin( 11 );
+
+    ErrorField = new QMultiLineEdit( GroupBox2, "ErrorField" );
+    ErrorField->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, ErrorField->sizePolicy().hasHeightForWidth() ) );
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 255, 0, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, white );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setActive( cg );
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 255, 0, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, white );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setInactive( cg );
+    cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 255, 0, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Base, white );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setDisabled( cg );
+    ErrorField->setPalette( pal );
+
+    GroupBox2Layout->addWidget( ErrorField, 0, 0 );
+    CalibrateLaserMovementDialogBaseLayout->addWidget( GroupBox2 );
+
+    Layout3 = new QHBoxLayout; 
+    Layout3->setSpacing( 6 );
+    Layout3->setMargin( 0 );
+
+    buttonStart = new QPushButton( this, "buttonStart" );
+    buttonStart->setText( i18n( "&Start" ) );
+    buttonStart->setAutoDefault( TRUE );
+    Layout3->addWidget( buttonStart );
+
+    buttonStop = new QPushButton( this, "buttonStop" );
+    buttonStop->setEnabled( FALSE );
+    buttonStop->setText( i18n( "Stop" ) );
+    Layout3->addWidget( buttonStop );
+    QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout3->addItem( spacer_5 );
+
+    buttonOk = new QPushButton( this, "buttonOk" );
+    buttonOk->setCaption( QString::null );
+    buttonOk->setText( i18n( "&OK" ) );
+    buttonOk->setAutoDefault( TRUE );
+    buttonOk->setDefault( TRUE );
+    Layout3->addWidget( buttonOk );
+    CalibrateLaserMovementDialogBaseLayout->addLayout( Layout3 );
+
+    // signals and slots connections
+    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
+    connect( buttonStart, SIGNAL( clicked() ), this, SLOT( startThread() ) );
+    connect( buttonStop, SIGNAL( clicked() ), this, SLOT( stop() ) );
+}
+
+/*  
+ *  Destroys the object and frees any allocated resources
+ */
+CalibrateLaserMovementDialogBase::~CalibrateLaserMovementDialogBase()
+{
+    // no need to delete child widgets, Qt does it all for us
+}
+
+void CalibrateLaserMovementDialogBase::stop()
+{
+    qWarning( "CalibrateLaserMovementDialogBase::stop(): Not implemented yet!" );
+}
+
+void CalibrateLaserMovementDialogBase::startThread()
+{
+    qWarning( "CalibrateLaserMovementDialogBase::startThread(): Not implemented yet!" );
+}
+
+#include "calibratelasermovementdialogbase.moc"
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.h	(revision 3401)
@@ -0,0 +1,76 @@
+/****************************************************************************
+** Form interface generated from reading ui file './calibratelasermovementdialogbase.ui'
+**
+** Created: Thu Jan 29 00:50:28 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef CALIBRATELASERMOVEMENTDIALOGBASE_H
+#define CALIBRATELASERMOVEMENTDIALOGBASE_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+class QVBoxLayout; 
+class QHBoxLayout; 
+class QGridLayout; 
+class QButtonGroup;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QMultiLineEdit;
+class QProgressBar;
+class QPushButton;
+
+class CalibrateLaserMovementDialogBase : public QDialog
+{ 
+    Q_OBJECT
+
+public:
+    CalibrateLaserMovementDialogBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+    ~CalibrateLaserMovementDialogBase();
+
+    QGroupBox* GroupBox1;
+    QMultiLineEdit* ProgressField;
+    QButtonGroup* ButtonGroup1;
+    QProgressBar* PanelProgress;
+    QProgressBar* TotalProgress;
+    QLabel* TextLabel1_2;
+    QLabel* TextLabel1;
+    QGroupBox* PanelBox;
+    QLabel* PortLabel;
+    QLabel* BoxLabel;
+    QLabel* DriverLabel;
+    QGroupBox* GroupBox3;
+    QLabel* XAxisLabel;
+    QLineEdit* XAxisEdit;
+    QLabel* XSlopeLabel;
+    QLineEdit* XSlopeEdit;
+    QGroupBox* YMotorBox;
+    QLabel* YAxisLabel;
+    QLineEdit* YAxisEdit;
+    QLabel* YSlopeLabel;
+    QLineEdit* YSlopeEdit;
+    QGroupBox* GroupBox2;
+    QMultiLineEdit* ErrorField;
+    QPushButton* buttonStart;
+    QPushButton* buttonStop;
+    QPushButton* buttonOk;
+
+public slots:
+    virtual void stop();
+    virtual void startThread();
+
+protected:
+    QVBoxLayout* CalibrateLaserMovementDialogBaseLayout;
+    QVBoxLayout* GroupBox1Layout;
+    QGridLayout* ButtonGroup1Layout;
+    QHBoxLayout* PanelBoxLayout;
+    QHBoxLayout* Layout2;
+    QHBoxLayout* GroupBox3Layout;
+    QHBoxLayout* YMotorBoxLayout;
+    QGridLayout* GroupBox2Layout;
+    QHBoxLayout* Layout3;
+};
+
+#endif // CALIBRATELASERMOVEMENTDIALOGBASE_H
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.moc
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.moc	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.moc	(revision 3401)
@@ -0,0 +1,88 @@
+/****************************************************************************
+** CalibrateLaserMovementDialogBase meta object code from reading C++ file 'calibratelasermovementdialogbase.h'
+**
+** Created: Thu Jan 29 00:51:25 2004
+**      by: The Qt MOC ($Id: calibratelasermovementdialogbase.moc,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "calibratelasermovementdialogbase.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *CalibrateLaserMovementDialogBase::className() const
+{
+    return "CalibrateLaserMovementDialogBase";
+}
+
+QMetaObject *CalibrateLaserMovementDialogBase::metaObj = 0;
+
+void CalibrateLaserMovementDialogBase::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QDialog::className(), "QDialog") != 0 )
+	badSuperclassWarning("CalibrateLaserMovementDialogBase","QDialog");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString CalibrateLaserMovementDialogBase::tr(const char* s)
+{
+    return qApp->translate( "CalibrateLaserMovementDialogBase", s, 0 );
+}
+
+QString CalibrateLaserMovementDialogBase::tr(const char* s, const char * c)
+{
+    return qApp->translate( "CalibrateLaserMovementDialogBase", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* CalibrateLaserMovementDialogBase::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QDialog::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (CalibrateLaserMovementDialogBase::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    typedef void (CalibrateLaserMovementDialogBase::*m1_t1)();
+    typedef void (QObject::*om1_t1)();
+    m1_t0 v1_0 = &CalibrateLaserMovementDialogBase::stop;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &CalibrateLaserMovementDialogBase::startThread;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(2);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(2);
+    slot_tbl[0].name = "stop()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "startThread()";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"CalibrateLaserMovementDialogBase", "QDialog",
+	slot_tbl, 2,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.ui
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.ui	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratelasermovementdialogbase.ui	(revision 3401)
@@ -0,0 +1,1001 @@
+<!DOCTYPE UI><UI>
+<class>CalibrateLaserMovementDialogBase</class>
+<widget>
+    <class>QDialog</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>CalibrateLaserMovementDialogBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>594</width>
+            <height>566</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>CalibrateLaserMovement</string>
+    </property>
+    <property stdset="1">
+        <name>sizeGripEnabled</name>
+        <bool>true</bool>
+    </property>
+    <vbox>
+        <property stdset="1">
+            <name>margin</name>
+            <number>11</number>
+        </property>
+        <property stdset="1">
+            <name>spacing</name>
+            <number>6</number>
+        </property>
+        <widget>
+            <class>QGroupBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>GroupBox1</cstring>
+            </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>Progress</string>
+            </property>
+            <vbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>11</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QMultiLineEdit</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ProgressField</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>palette</name>
+                        <palette>
+                            <active>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>223</red>
+                                    <green>223</green>
+                                    <blue>223</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>170</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </active>
+                            <disabled>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>220</red>
+                                    <green>220</green>
+                                    <blue>220</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>170</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </disabled>
+                            <inactive>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>220</red>
+                                    <green>220</green>
+                                    <blue>220</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>170</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </inactive>
+                        </palette>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QButtonGroup</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ButtonGroup1</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>frameShape</name>
+                        <enum>NoFrame</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>title</name>
+                        <string></string>
+                    </property>
+                    <grid>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>11</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget row="0"  column="1" >
+                            <class>QProgressBar</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>PanelProgress</cstring>
+                            </property>
+                        </widget>
+                        <widget row="1"  column="1" >
+                            <class>QProgressBar</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>TotalProgress</cstring>
+                            </property>
+                        </widget>
+                        <widget row="1"  column="0" >
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>TextLabel1_2</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Overall progress</string>
+                            </property>
+                        </widget>
+                        <widget row="0"  column="0" >
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>TextLabel1</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Panel progress</string>
+                            </property>
+                        </widget>
+                    </grid>
+                </widget>
+                <widget>
+                    <class>QGroupBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>PanelBox</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>title</name>
+                        <string>Panel</string>
+                    </property>
+                    <hbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>11</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>PortLabel</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Port: --</string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property>
+                                <name>name</name>
+                                <cstring>Spacer4</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>sizeType</name>
+                                <enum>Expanding</enum>
+                            </property>
+                            <property>
+                                <name>sizeHint</name>
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget>
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>BoxLabel</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Box: --</string>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property>
+                                <name>name</name>
+                                <cstring>Spacer5</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>sizeType</name>
+                                <enum>Expanding</enum>
+                            </property>
+                            <property>
+                                <name>sizeHint</name>
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget>
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>DriverLabel</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Driver: --</string>
+                            </property>
+                        </widget>
+                    </hbox>
+                </widget>
+                <widget>
+                    <class>QLayoutWidget</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Layout2</cstring>
+                    </property>
+                    <hbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>0</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>GroupBox3</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>X Motor</string>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XAxisLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Axis :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XAxisEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XSlopeLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Slope :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XSlopeEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>YMotorBox</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Y Motor</string>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YAxisLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Axis :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YAxisEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer2_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YSlopeLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Slope :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YSlopeEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                    </hbox>
+                </widget>
+            </vbox>
+        </widget>
+        <widget>
+            <class>QGroupBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>GroupBox2</cstring>
+            </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>Errors</string>
+            </property>
+            <grid>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>11</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget row="0"  column="0" >
+                    <class>QMultiLineEdit</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ErrorField</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>sizePolicy</name>
+                        <sizepolicy>
+                            <hsizetype>7</hsizetype>
+                            <vsizetype>5</vsizetype>
+                        </sizepolicy>
+                    </property>
+                    <property stdset="1">
+                        <name>palette</name>
+                        <palette>
+                            <active>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>223</red>
+                                    <green>223</green>
+                                    <blue>223</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </active>
+                            <disabled>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>220</red>
+                                    <green>220</green>
+                                    <blue>220</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </disabled>
+                            <inactive>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>220</red>
+                                    <green>220</green>
+                                    <blue>220</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </inactive>
+                        </palette>
+                    </property>
+                </widget>
+            </grid>
+        </widget>
+        <widget>
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout3</cstring>
+            </property>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>buttonStart</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Start</string>
+                    </property>
+                    <property stdset="1">
+                        <name>autoDefault</name>
+                        <bool>true</bool>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>buttonStop</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>enabled</name>
+                        <bool>false</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Stop</string>
+                    </property>
+                </widget>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Horizontal Spacing2</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>buttonOk</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>caption</name>
+                        <string></string>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;OK</string>
+                    </property>
+                    <property stdset="1">
+                        <name>autoDefault</name>
+                        <bool>true</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>default</name>
+                        <bool>true</bool>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+    </vbox>
+</widget>
+<connections>
+    <connection>
+        <sender>buttonOk</sender>
+        <signal>clicked()</signal>
+        <receiver>CalibrateLaserMovementDialogBase</receiver>
+        <slot>accept()</slot>
+    </connection>
+    <connection>
+        <sender>buttonStart</sender>
+        <signal>clicked()</signal>
+        <receiver>CalibrateLaserMovementDialogBase</receiver>
+        <slot>startThread()</slot>
+    </connection>
+    <connection>
+        <sender>buttonStop</sender>
+        <signal>clicked()</signal>
+        <receiver>CalibrateLaserMovementDialogBase</receiver>
+        <slot>stop()</slot>
+    </connection>
+    <slot access="public">stop()</slot>
+    <slot access="public">startThread()</slot>
+</connections>
+</UI>
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialog.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialog.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialog.cpp	(revision 3401)
@@ -0,0 +1,591 @@
+/***************************************************************************
+                          calibratepaneldialog.cpp  -  description
+                             -------------------
+    begin                : Tue Sep 2 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include <qcheckbox.h>
+#include <qgroupbox.h>
+#include <qlayout.h>
+#include <qlineedit.h>
+#include <qlabel.h>
+#include <qlist.h>
+#include <qmessagebox.h>
+#include <qmultilineedit.h>
+#include <qprogressbar.h>
+#include <qpushbutton.h>
+#include <qstring.h>
+#include "amcerror.h"
+#include "amcframegrabber.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcserialport.h"
+#include "calibratepaneldialog.h"
+#include "errorinfoevent.h"
+#include "linearregression.h"
+#include "magicmirror.h"
+#include "progressinfoevent.h"
+#include "videoframe.h"
+#include "videospot.h"
+#include <math.h>
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern int						g_iRefX, g_iRefY;
+extern AMCSerialPort* g_pPort[];
+extern MagicMirror*		g_theMirror;
+
+CalibratePanelDialog::CalibratePanelDialog(QWidget *parent, const char *name, AMCFrameGrabber* p_pFG )
+	: CalibratePanelDialogBase(parent, name, true), m_pFG( p_pFG )
+{
+	PanelProgress->setTotalSteps( 39 - 1 );
+	m_pData = new uchar[ m_pFG->getBuffsize()];
+	m_pDark = new uchar[ m_pFG->getBuffsize()];
+	m_pXLinearRegression = new LinearRegression();
+	m_pYLinearRegression = new LinearRegression();
+
+	m_pVideoFrame = new VideoFrame( this, "Video", m_pFG );
+  m_pVideoFrame->setMinimumSize( QSize( MY_WIDTH, MY_HEIGHT ) );
+  m_pVideoFrame->setMaximumSize( QSize( MY_WIDTH, MY_HEIGHT ) );
+  m_pVideoFrame->setFrameShape( QFrame::NoFrame );
+	m_pVideoFrame->setCalibDlg( this );
+	((QGridLayout*) this->layout())->addWidget( m_pVideoFrame, 0, 0 );
+	connect( m_pVideoFrame, SIGNAL( spot(int, int ) ), this ,SLOT( setSpotInfoSlot( int, int ) ) );
+	connect( m_pVideoFrame, SIGNAL( gref(int, int ) ), this ,SLOT( setGRefInfoSlot( int, int ) ) );
+
+	m_qlSpotList.setAutoDelete( true );
+	m_qlLineList.setAutoDelete( true );
+
+	if( (g_iRefX != -1) && (g_iRefY != -1) )
+		buttonGoto->setEnabled( true );
+	
+	m_iSpotX = -1;
+	m_iSpotY = -1;
+	m_iVSpotX = -1;
+	m_iVSpotY = -1;
+	setGRefInfoSlot( g_iRefX, g_iRefY );
+}
+
+CalibratePanelDialog::~CalibratePanelDialog()
+{
+	// If laser was on we will turn it on again.
+	if( m_zLaser )
+	{
+  	try
+  	{
+  		m_pMotor->switchLaser( true );
+  		m_pPanel->setLaserOn( true );
+  	}
+  	catch( AMCError e )
+  	{
+  	}
+	}
+
+	qDebug("Deleting video frame");
+	delete m_pVideoFrame;
+	qDebug("Deleting regression objects");
+	delete m_pXLinearRegression;
+	delete m_pYLinearRegression;
+	qDebug("Deleting image buffers");
+	delete[] m_pData;
+	delete[] m_pDark;
+	qDebug("Deleting motor");
+	delete m_pMotor;
+	qDebug("Destructing CalibaratePanelDialog");
+}
+
+/** No descriptions */
+void CalibratePanelDialog::setPanel( AMCMirrorPanel* p_pPanel )
+{
+	m_pPanel = p_pPanel;
+
+	QString info;
+	PanelBox->setTitle( info.sprintf( "Panel: %d,%d", m_pPanel->i(), m_pPanel->j() ) );
+	PortLabel->setText( info.sprintf( "Device: /dev/ttyS%d", m_pPanel->port()+3 ) );
+	BoxLabel->setText( info.sprintf( "Box: %02d", m_pPanel->box() ) );
+	DriverLabel->setText( info.sprintf( "Driver: %d", m_pPanel->driver() ) );
+
+	AMCSerialPort* pPort = g_pPort[ m_pPanel->port()-1 ];
+	m_pMotor = new AMCMotor( pPort );
+
+	m_zLaser = m_pPanel->isLaserOn();
+}
+
+/** No descriptions */
+void CalibratePanelDialog::setSpotInfoSlot( int p_iX, int p_iY )
+{
+	XSpotEdit->setText( QString::number(p_iX) );
+	YSpotEdit->setText( QString::number(p_iY) );
+	m_iVSpotX = p_iX;
+	m_iVSpotY = p_iY;
+}
+
+/** No descriptions */
+void CalibratePanelDialog::setGRefInfoSlot( int p_iX, int p_iY )
+{
+	XGRefEdit->setText( QString::number(p_iX) );
+	YGRefEdit->setText( QString::number(p_iY) );
+	buttonGoto->setEnabled( true );
+}
+
+/** No descriptions */
+void CalibratePanelDialog::startSlot()
+{
+	m_qlLineList.clear();
+	PanelProgress->reset();
+	buttonStart->setEnabled( false );
+	buttonGoto->setEnabled( false );
+	buttonOk->setEnabled( false );
+	this->start();
+}
+
+/** No descriptions */
+void CalibratePanelDialog::run()
+{
+	QString info, qsMsg;
+  	
+	try
+	{
+	  m_pFG->grabFrame( m_pDark );
+		msleep(400);
+
+	  m_pMotor->unselectBox();
+		int iBox = m_pPanel->box();
+		m_pMotor->selectBox( iBox );
+	 	int iDriver = m_pPanel->driver();
+		m_pMotor->selectDriver( iDriver );	
+		int iFrequency = m_pMotor->getFrequency();
+
+		outputProgress("Centering Panel");
+		m_pMotor->centerMotors();
+		m_pMotor->waitForMotors( m_pMotor->calcTimeout( 17000 )+2 );
+		m_pPanel->setX( 0 );
+		m_pPanel->setY( 0 );
+		m_pMotor->switchLaser( true );
+ 		m_pPanel->setLaserOn( true );
+
+		int iMinJ = -4000;
+		int iMaxJ = -4000;
+		double dMinX, dMinY;
+		double dMaxX, dMaxY;
+		m_pXLinearRegression->reset();
+		for( int j= -2700; j<=2700; j+=300)
+		{
+			processSpot( j, 0 );
+			if( m_qlSpotList.count() == 1)
+				m_qlLineList.append( new VideoSpot( m_iSpotX, m_iSpotY ) );
+			m_pXLinearRegression->addPoint( m_iSpotX, m_iSpotY );
+			if( m_iSpotX != -1 )
+			{
+				if ( iMinJ < -3000 )
+				{
+					iMinJ = j;
+					dMinX = m_iSpotX;
+					dMinY = m_iSpotY;
+				}
+				else
+				{
+					iMaxJ = j;
+					dMaxX = m_iSpotX;
+					dMaxY = m_iSpotY;
+				}
+			}
+			QCustomEvent* pEvent = new QCustomEvent( X_SPOT_EVENT );
+			pEvent->setData( (void*) m_pXLinearRegression );
+			QThread::postEvent( this, (QEvent*) pEvent );
+		}
+		m_pPanel->setAxisX( m_pXLinearRegression->getAxis() );
+		m_pPanel->setSlopeX( m_pXLinearRegression->getSlope() );
+		if( iMinJ != -4000 )
+		{
+			double dSteps = (double) (iMaxJ - iMinJ);
+			if ( dSteps > 0)
+			{
+				double dDx = (dMaxX - dMinX);
+				double dDy = (dMaxY - dMinY);
+				double dPixels = sqrt( dDx * dDx + dDy * dDy );
+				if( dDx >= 0.0)
+					m_pPanel->setConversionX( dSteps / dPixels );
+				else
+					m_pPanel->setConversionX( -1.0 * dSteps / dPixels );
+				qDebug("Conversion X: %f %f %f", dDx, dDy, m_pPanel->getConversionX());
+			}
+			else
+			{
+				m_pPanel->setConversionX( 0.0 );
+			}
+
+			m_dXConversion = m_pPanel->getConversionX();
+			QCustomEvent* pEvent = new QCustomEvent( X_CONV_EVENT );
+			QThread::postEvent( this, (QEvent*) pEvent );
+    }
+
+		iMinJ = -4000;
+		iMaxJ = -4000;
+		m_pYLinearRegression->reset();
+		for( int j= -2700; j<=2700; j+=300)
+		{
+			processSpot( 0, j );
+			if( m_qlSpotList.count() == 1)
+				m_qlLineList.append( new VideoSpot( m_iSpotX, m_iSpotY ) );
+			m_pYLinearRegression->addPoint( m_iSpotX, m_iSpotY );
+			if( m_iSpotX != -1 )
+			{
+				if ( iMinJ < -3000 )
+				{
+					iMinJ = j;
+					dMinX = m_iSpotX;
+					dMinY = m_iSpotY;
+				}
+				else
+				{
+					iMaxJ = j;
+					dMaxX = m_iSpotX;
+					dMaxY = m_iSpotY;
+				}
+			}
+			QCustomEvent* pEvent = new QCustomEvent( Y_SPOT_EVENT );
+			pEvent->setData( (void*) m_pYLinearRegression );
+			QThread::postEvent( this, (QEvent*) pEvent );
+		}
+		m_pPanel->setAxisY( m_pYLinearRegression->getAxis() );
+		m_pPanel->setSlopeY( m_pYLinearRegression->getSlope() );
+
+		if( iMinJ != -4000 )
+		{
+			double dSteps = (double) (iMaxJ - iMinJ);
+			if ( dSteps > 0)
+			{
+				double dDx = (dMaxX - dMinX);
+				double dDy = (dMaxY - dMinY);
+				double dPixels = sqrt( dDx * dDx + dDy * dDy );
+				if( dDx >= 0.0)
+					m_pPanel->setConversionY( dSteps / dPixels );
+				else
+					m_pPanel->setConversionY( -1.0 * dSteps / dPixels );
+				qDebug("Conversion Y: %f %f %f", dDx, dDy, m_pPanel->getConversionY());
+			}
+			else
+				m_pPanel->setConversionY( 0.0 );
+
+			m_dYConversion = m_pPanel->getConversionY();
+			QCustomEvent* pEvent = new QCustomEvent( Y_CONV_EVENT );
+			QThread::postEvent( this, (QEvent*) pEvent );
+   	}
+
+		processSpot( 0, 0 );
+
+	}
+	catch( AMCError& e)
+	{
+		qsMsg.sprintf( "Error while processing panel : (%d,%d)",
+									 m_pPanel->i(), m_pPanel->j());
+		qsMsg += e.formatError( 2 );
+		outputError( qsMsg );
+				
+		/* If we had an error we will try 3 times to turn off the Laser.
+		 * This is necessary to be sure that the laser is off. Otherwise when
+		 * working with the next panel we have to spots and the calibartion
+		 * will fail. */
+		for( int i=0; i<3; i++)
+		{
+			try
+			{
+				m_pMotor->switchLaser( false );
+		 		m_pPanel->setLaserOn( false );
+				i = 3;		// If we reach this point we succesfully switched of the laser
+									// so we can exit the loop.
+			}
+			catch( AMCError& e)
+			{				 		// Ignore errors in this case.
+			}
+		}
+	}
+			
+	QThread::postEvent( this, new QCustomEvent( THREAD_END_EVENT ) );
+}
+
+
+/** Process Spot */
+void CalibratePanelDialog::processSpot( int p_iX, int p_iY )
+{
+	QString qsMsg;
+
+	qsMsg.sprintf("Moving to position: (%d,%d)", p_iX, p_iY );
+	outputProgress( qsMsg );
+
+	int iX, iY;
+	iX = p_iX - m_pPanel->getX();
+	iY = p_iY - m_pPanel->getY();
+	m_pMotor->moveMotors( iX, iY );
+	m_pMotor->waitForMotors( m_pMotor->calcTimeout( MAX( abs(iX), abs(iY) ) ) + 1 );			
+	m_pPanel->setX( p_iX );
+	m_pPanel->setY( p_iY );
+	
+//	m_pMotor->switchLaser( true );
+//	m_pPanel->setLaserOn( true );
+
+  m_pVideoFrame->halt( true );
+	msleep(100);
+  int iRes = m_pFG->grabFrame( m_pData );
+  m_pVideoFrame->halt( false );
+
+//	m_pMotor->switchLaser( false );
+//	m_pPanel->setLaserOn( false );
+
+	outputProgress( "Finding spot" );
+
+	subtractDark();
+	findSpot( m_iSpotX, m_iSpotY );
+	qsMsg.sprintf("Spot at: (%d,%d)", m_iSpotX, m_iSpotY );
+	outputProgress( qsMsg );
+
+	PanelProgress->setProgress( PanelProgress->progress()+1 );
+
+}
+
+/** No descriptions */
+void CalibratePanelDialog::subtractDark()
+{
+	uchar* pData = m_pData;
+	uchar* pDark = m_pDark;
+	uchar* pEnd = m_pData + ( MY_HEIGHT * MY_WIDTH * MY_DEPTH);
+	for( ; pData < pEnd; pData++, pDark++ )
+	{
+		int help = (int) *pData - (int) *pDark;
+		if(help < 0)
+			help = 0;
+		*pData = (uchar) help;
+	}
+}
+
+/** Find the Laser spot */
+void CalibratePanelDialog::findSpot( int& p_iX, int& p_iY )
+{
+  int threshold = getThreshold();
+
+	m_qlSpotList.clear();
+	int top = 0;
+	int bottom = MY_HEIGHT;
+	int left = 0;
+	int right = MY_WIDTH;
+
+  for (int i=top; i <bottom; i++)
+	{
+     for (int j=left; j < right ; j++)
+		{
+			int index= (j + i * MY_WIDTH) * MY_DEPTH;
+			bool zFound = false;
+			uchar data = m_pData[index];
+			if( data > threshold )
+	 		{
+				for( VideoSpot* pActualSpot = m_qlSpotList.first();
+		 				 pActualSpot; pActualSpot = m_qlSpotList.next() )
+				{
+					if( pActualSpot->contains( j, i ) )
+					{
+						pActualSpot->append( j, i, data );
+						zFound = true;
+						break;
+					}
+				}
+				if( zFound == false )
+				{
+					VideoSpot* pSpot = new VideoSpot();
+					pSpot->append( j, i, data );
+					m_qlSpotList.append( pSpot );
+				}
+
+	 		}
+		}
+	}
+	if( m_qlSpotList.count() == 1)
+	{
+		VideoSpot* pSpot = m_qlSpotList.first();
+		p_iX = pSpot->getX();
+		p_iY = pSpot->getY();
+		QThread::postEvent( this, new QCustomEvent( FRAME_EVENT ) );
+	}
+	else
+	{
+		p_iX = -1;
+		p_iY = -1;
+	}
+}
+
+/** No descriptions */
+int CalibratePanelDialog::getThreshold()
+{
+	long sumx =0;
+	long sumx2 = 0;
+
+	long numPixel = MY_HEIGHT * MY_WIDTH;
+	for(int ind=0; ind < ( numPixel * MY_DEPTH); ind+=MY_DEPTH)
+	{
+		long data = (long) m_pData[ind];
+		sumx += data;
+		sumx2 += data * data;
+	}
+
+	double mean = ((double) sumx) / ((double) (numPixel));
+	double var = ((double) sumx2) / ((double) (numPixel)) - mean * mean;
+	double stddev = sqrt(var);
+
+  int threshold = (int) (mean + m_dTSigmas * stddev);
+//	qDebug("Mean: %f StdDev: %f   Threshold %d", mean, stddev, threshold );
+	return threshold;
+}
+
+void CalibratePanelDialog::outputProgress(QString qsMsg)
+{
+	QThread::postEvent( this, new ProgressInfoEvent( qsMsg ) );
+}
+
+void CalibratePanelDialog::outputError(QString qsMsg)
+{
+	QThread::postEvent( this, new ErrorInfoEvent( qsMsg ) );
+}
+
+void CalibratePanelDialog::customEvent( QCustomEvent* e )
+{
+  if ( e->type() == PROGRESS_INFO_EVENT )
+	{
+		ProgressInfoEvent* pie = (ProgressInfoEvent*) e;
+		QString qsMsg = pie->getMessage();
+
+		ProgressField->append( qsMsg );
+		ProgressField->setCursorPosition( ProgressField->numLines()+1, 0 );
+	}
+
+  if ( e->type() == ERROR_INFO_EVENT )
+	{
+		ErrorInfoEvent* eie = (ErrorInfoEvent*) e;
+		QString qsMsg = eie->getMessage();
+
+		ErrorField->append( qsMsg );
+		ErrorField->setCursorPosition( ErrorField->numLines()+1, 0 );
+	}
+
+  if ( e->type() == X_SPOT_EVENT )
+	{
+		QString info;
+		LinearRegression* pRegress = (LinearRegression*) e->data();
+		XAxisEdit->setText( info.sprintf( "%7.2f", pRegress->getAxis() ) );
+		XSlopeEdit->setText( info.sprintf( "%7.2f", pRegress->getSlope() ) );
+	}
+
+  if ( e->type() == Y_SPOT_EVENT )
+	{
+		QString info;
+		LinearRegression* pRegress = (LinearRegression*) e->data();
+		YAxisEdit->setText( info.sprintf( "%7.2f", pRegress->getAxis() ) );
+		YSlopeEdit->setText( info.sprintf( "%7.2f", pRegress->getSlope() ) );
+	}
+
+  if ( e->type() == X_CONV_EVENT )
+	{
+		QString info;
+		XConvEdit->setText( info.sprintf( "%7.3f", m_dXConversion ) );
+	}
+
+  if ( e->type() == Y_CONV_EVENT )
+	{
+		QString info;
+		YConvEdit->setText( info.sprintf( "%7.3f", m_dYConversion ) );
+	}
+
+  if ( e->type() == PANEL_PROGRESS_EVENT )
+		PanelProgress->setProgress( PanelProgress->progress()+1 );
+
+  if ( e->type() == FRAME_EVENT )
+		setSpotInfoSlot( m_iSpotX, m_iSpotY );
+
+  if ( e->type() == THREAD_END_EVENT )
+	{
+		buttonStart->setEnabled( true );
+		if( (g_iRefX != -1) && (g_iRefY != -1) )
+		buttonGoto->setEnabled( true );
+		buttonOk->setEnabled( true );
+	}
+}
+
+/** No descriptions */
+void CalibratePanelDialog::gotoRefSlot()
+{
+	if( ( g_iRefX == -1 ) && ( g_iRefY == -1 ) )
+		return;
+	if( ( m_iVSpotX == -1 ) && ( m_iVSpotY == -1 ) )
+		return;
+	qDebug("Spot at x,y: %4d %4d", m_iVSpotX, m_iVSpotY );	
+	qDebug("Ref  at x,y: %4d %4d", g_iRefX, g_iRefY );	
+	double dX = g_iRefX - m_iVSpotX;
+	double dY = g_iRefY - m_iVSpotY;
+	qDebug("Dx Dy: %4.0f %4.0f", dX, dY );	
+	double dAlpha1 = atan( m_pPanel->getSlopeX() );
+//	if( m_pPanel->getSlopeX() < 0.0)
+//		dAlpha1 *= -1;
+	double dAlpha2 = atan( m_pPanel->getSlopeY() );
+//	if( m_pPanel->getSlopeY() < 0.0)
+//		dAlpha2 *= -1;
+	qDebug("alpha1, alpha2: %7.2f %7.2f", dAlpha1 * 180.0 / 3.1415, dAlpha2 * 180.0 / 3.1415 );	
+	double dSinA1 = sin( dAlpha1 );
+	double dSinA2 = sin( dAlpha2 );
+	double dCosA1 = cos( dAlpha1 );
+	double dCosA2 = cos( dAlpha2 );
+
+	double dFacX = dX - ( dY * dCosA2 / dSinA2 );
+	dFacX /= ( dCosA1 - dSinA1 * dCosA2 / dSinA2 );
+	double dFacY = (dY - dFacX * dSinA1) / dSinA2;
+	qDebug("Factor x,y: %8.2f %8.2f", dFacX, dFacY );	
+
+	int iStepX = (int) ( dFacX * m_pPanel->getConversionX() );
+	int iStepY = (int) ( dFacY * m_pPanel->getConversionY() );
+
+	qDebug("Steps till reference: %4d %4d", iStepX, iStepY );	
+	gotoPosition( iStepX, iStepY );
+}
+
+/** No descriptions */
+void CalibratePanelDialog::gotoPosition( int p_iX, int p_iY ){
+	QString qsMsg;
+  	
+	try
+	{
+	  m_pMotor->unselectBox();
+		int iBox = m_pPanel->box();
+		m_pMotor->selectBox( iBox );
+	 	int iDriver = m_pPanel->driver();
+		m_pMotor->selectDriver( iDriver );	
+		int iFrequency = m_pMotor->getFrequency();
+
+		m_pMotor->moveMotors( p_iX, p_iY );
+		m_pMotor->waitForMotors( m_pMotor->calcTimeout( MAX( abs(p_iX), abs(p_iY) ) ) + 1 );			
+		m_pPanel->setX( m_pPanel->getX() + p_iX );
+		m_pPanel->setY( m_pPanel->getY() + p_iY );
+	}
+	catch( AMCError& e)
+	{
+		qsMsg.sprintf( "Error while processing panel : (%d,%d)",
+									 m_pPanel->i(), m_pPanel->j());
+		qsMsg += e.formatError( 2 );
+		outputError( qsMsg );
+	}
+			
+}
+
+void CalibratePanelDialog::setTSigmas( double p_dTSigmas )
+{
+	m_dTSigmas = p_dTSigmas;
+	m_pVideoFrame->threshold( p_dTSigmas );
+};
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialog.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialog.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialog.h	(revision 3401)
@@ -0,0 +1,116 @@
+/***************************************************************************
+                          calibratepaneldialog.h  -  description
+                             -------------------
+    begin                : Tue Sep 2 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef CALIBRATEPANELDIALOG_H
+#define CALIBRATEPANELDIALOG_H
+
+#include <qlist.h>
+#include <qstring.h>
+#include <qthread.h>
+#include <qwidget.h>
+#include <calibratepaneldialogbase.h>
+
+/**
+  *@author Martin Merck
+  */
+class	AMCFrameGrabber;
+class	AMCMirrorPanel;
+class	AMCMotor;
+class LinearRegression;
+class	VideoFrame;
+class	VideoSpot;
+
+class CalibratePanelDialog : public CalibratePanelDialogBase, public QThread
+{
+   Q_OBJECT
+public: 
+	CalibratePanelDialog( QWidget *parent=0, const char *name=0, AMCFrameGrabber* p_pFG=0 );
+	virtual ~CalibratePanelDialog();
+  /** Handle events from the spot finder thread. */
+	virtual void setPanel( AMCMirrorPanel* p_pPanel );
+	virtual void setTSigmas( double p_dTSigmas );
+	virtual void customEvent( QCustomEvent* e );
+	virtual void run();
+	virtual QList<VideoSpot>* getLineList() { return &m_qlLineList;};
+	virtual LinearRegression* getXRegression() { return m_pXLinearRegression; };
+	virtual LinearRegression* getYRegression() { return m_pYLinearRegression; };
+  /** No descriptions */
+  void gotoPosition( int p_iX, int p_iY );
+
+private: // Private utility methods
+	/** Output progress information to QMultiLineEdit widget */
+	void outputProgress( QString p_qsMsg );
+	/** Output error information to QMultiLineEdit widget */
+	void outputError( QString p_qsMsg );
+	/** Process Spot */
+	void processSpot( int p_iX, int p_iY );
+	/** Substract dark frame */
+	void subtractDark();
+	/** Find the Spot in the cideo frame */
+	void findSpot( int& p_iY, int& p_iY );
+	/** Get the threshold for identifying the spot */
+	int getThreshold();
+
+private: // Private attributes
+  /** No descriptions */
+  AMCFrameGrabber*	m_pFG;
+  /** No descriptions */
+  VideoFrame*				m_pVideoFrame;
+  /** No descriptions */
+  AMCMirrorPanel*		m_pPanel;
+  /** No descriptions */
+	AMCMotor*					m_pMotor;
+  /** No descriptions */
+	LinearRegression* m_pXLinearRegression;
+  /** No descriptions */
+	LinearRegression* m_pYLinearRegression;
+  /** No descriptions */
+	QList<VideoSpot>  m_qlSpotList;
+  /** No descriptions */
+	QList<VideoSpot>  m_qlLineList;
+	/** Array to store the grabbed videoframe */
+	uchar*						m_pData;
+	/** Array to store the grabbed dark frame */
+	uchar*						m_pDark;
+	/** Spot position in videocamera pixels */
+	int m_iSpotX;
+	/** Spot position in videocamera pixels */
+	int m_iSpotY;
+	/** Spot position in videocamera pixels */
+	int m_iVSpotX;
+	/** Spot position in videocamera pixels */
+	int m_iVSpotY;
+	/**  */
+	double m_dXConversion;
+	/**  */
+	double m_dYConversion;
+	/**  */
+	double m_dTSigmas;
+	bool m_zLaser;
+
+public slots: // Public slots
+  /** No descriptions */
+  void setSpotInfoSlot( int p_iX, int p_iY );
+  /** No descriptions */
+  void setGRefInfoSlot( int p_iX, int p_iY );
+  /** No descriptions */
+  void startSlot();
+  /** No descriptions */
+  void gotoRefSlot();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialog.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialog.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialog.moc.cpp	(revision 3401)
@@ -0,0 +1,102 @@
+/****************************************************************************
+** CalibratePanelDialog meta object code from reading C++ file 'calibratepaneldialog.h'
+**
+** Created: Thu Jan 29 00:51:39 2004
+**      by: The Qt MOC ($Id: calibratepaneldialog.moc.cpp,v 1.1 2004-03-04 16:31:17 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "calibratepaneldialog.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *CalibratePanelDialog::className() const
+{
+    return "CalibratePanelDialog";
+}
+
+QMetaObject *CalibratePanelDialog::metaObj = 0;
+
+void CalibratePanelDialog::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(CalibratePanelDialogBase::className(), "CalibratePanelDialogBase") != 0 )
+	badSuperclassWarning("CalibratePanelDialog","CalibratePanelDialogBase");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString CalibratePanelDialog::tr(const char* s)
+{
+    return qApp->translate( "CalibratePanelDialog", s, 0 );
+}
+
+QString CalibratePanelDialog::tr(const char* s, const char * c)
+{
+    return qApp->translate( "CalibratePanelDialog", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* CalibratePanelDialog::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) CalibratePanelDialogBase::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (CalibratePanelDialog::*m1_t0)(int,int);
+    typedef void (QObject::*om1_t0)(int,int);
+    typedef void (CalibratePanelDialog::*m1_t1)(int,int);
+    typedef void (QObject::*om1_t1)(int,int);
+    typedef void (CalibratePanelDialog::*m1_t2)();
+    typedef void (QObject::*om1_t2)();
+    typedef void (CalibratePanelDialog::*m1_t3)();
+    typedef void (QObject::*om1_t3)();
+    m1_t0 v1_0 = &CalibratePanelDialog::setSpotInfoSlot;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &CalibratePanelDialog::setGRefInfoSlot;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &CalibratePanelDialog::startSlot;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &CalibratePanelDialog::gotoRefSlot;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(4);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(4);
+    slot_tbl[0].name = "setSpotInfoSlot(int,int)";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "setGRefInfoSlot(int,int)";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    slot_tbl[2].name = "startSlot()";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Public;
+    slot_tbl[3].name = "gotoRefSlot()";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"CalibratePanelDialog", "CalibratePanelDialogBase",
+	slot_tbl, 4,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.cpp	(revision 3401)
@@ -0,0 +1,468 @@
+#include <klocale.h>
+/****************************************************************************
+** Form implementation generated from reading ui file './calibratepaneldialogbase.ui'
+**
+** Created: Thu Jan 29 00:51:22 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "calibratepaneldialogbase.h"
+
+#include <qbuttongroup.h>
+#include <qframe.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlineedit.h>
+#include <qmultilineedit.h>
+#include <qprogressbar.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/* 
+ *  Constructs a CalibratePanelDialogBase which is a child of 'parent', with the 
+ *  name 'name' and widget flags set to 'f' 
+ *
+ *  The dialog will by default be modeless, unless you set 'modal' to
+ *  TRUE to construct a modal dialog.
+ */
+CalibratePanelDialogBase::CalibratePanelDialogBase( QWidget* parent,  const char* name, bool modal, WFlags fl )
+    : QDialog( parent, name, modal, fl )
+{
+    if ( !name )
+	setName( "CalibratePanelDialogBase" );
+    resize( 918, 617 ); 
+    setCaption( i18n( "CalibratePanel" ) );
+    setSizeGripEnabled( TRUE );
+    CalibratePanelDialogBaseLayout = new QGridLayout( this ); 
+    CalibratePanelDialogBaseLayout->setSpacing( 6 );
+    CalibratePanelDialogBaseLayout->setMargin( 11 );
+
+    Video_Frame = new QFrame( this, "Video_Frame" );
+    Video_Frame->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, Video_Frame->sizePolicy().hasHeightForWidth() ) );
+    Video_Frame->setMinimumSize( QSize( 640, 480 ) );
+    Video_Frame->setMaximumSize( QSize( 640, 480 ) );
+    Video_Frame->setFrameShape( QFrame::StyledPanel );
+    Video_Frame->setFrameShadow( QFrame::Raised );
+
+    CalibratePanelDialogBaseLayout->addWidget( Video_Frame, 0, 0 );
+
+    InfoBox = new QGroupBox( this, "InfoBox" );
+    InfoBox->setTitle( i18n( "Progress Info" ) );
+    InfoBox->setColumnLayout(0, Qt::Vertical );
+    InfoBox->layout()->setSpacing( 0 );
+    InfoBox->layout()->setMargin( 0 );
+    InfoBoxLayout = new QHBoxLayout( InfoBox->layout() );
+    InfoBoxLayout->setAlignment( Qt::AlignTop );
+    InfoBoxLayout->setSpacing( 6 );
+    InfoBoxLayout->setMargin( 11 );
+
+    ProgressField = new QMultiLineEdit( InfoBox, "ProgressField" );
+    QPalette pal;
+    QColorGroup cg;
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 0, 170, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setActive( cg );
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 0, 170, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setInactive( cg );
+    cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 0, 170, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setDisabled( cg );
+    ProgressField->setPalette( pal );
+    InfoBoxLayout->addWidget( ProgressField );
+
+    ErrorField = new QMultiLineEdit( InfoBox, "ErrorField" );
+    ErrorField->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, ErrorField->sizePolicy().hasHeightForWidth() ) );
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 255, 0, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, white );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setActive( cg );
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 255, 0, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, white );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setInactive( cg );
+    cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 255, 0, 0) );
+    cg.setColor( QColorGroup::BrightText, white );
+    cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Base, white );
+    cg.setColor( QColorGroup::Background, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setDisabled( cg );
+    ErrorField->setPalette( pal );
+    InfoBoxLayout->addWidget( ErrorField );
+
+    CalibratePanelDialogBaseLayout->addWidget( InfoBox, 1, 0 );
+
+    Layout5 = new QVBoxLayout; 
+    Layout5->setSpacing( 6 );
+    Layout5->setMargin( 0 );
+    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+    Layout5->addItem( spacer );
+
+    Layout3 = new QHBoxLayout; 
+    Layout3->setSpacing( 6 );
+    Layout3->setMargin( 0 );
+
+    buttonStart = new QPushButton( this, "buttonStart" );
+    buttonStart->setText( i18n( "&Start" ) );
+    buttonStart->setAutoDefault( TRUE );
+    Layout3->addWidget( buttonStart );
+    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout3->addItem( spacer_2 );
+
+    buttonOk = new QPushButton( this, "buttonOk" );
+    buttonOk->setCaption( QString::null );
+    buttonOk->setText( i18n( "Exit" ) );
+    buttonOk->setAutoDefault( TRUE );
+    buttonOk->setDefault( TRUE );
+    Layout3->addWidget( buttonOk );
+    Layout5->addLayout( Layout3 );
+
+    CalibratePanelDialogBaseLayout->addLayout( Layout5, 1, 1 );
+
+    Layout6 = new QVBoxLayout; 
+    Layout6->setSpacing( 6 );
+    Layout6->setMargin( 0 );
+
+    GroupBox1 = new QGroupBox( this, "GroupBox1" );
+    GroupBox1->setTitle( i18n( "Panel Info" ) );
+    GroupBox1->setColumnLayout(0, Qt::Vertical );
+    GroupBox1->layout()->setSpacing( 0 );
+    GroupBox1->layout()->setMargin( 0 );
+    GroupBox1Layout = new QVBoxLayout( GroupBox1->layout() );
+    GroupBox1Layout->setAlignment( Qt::AlignTop );
+    GroupBox1Layout->setSpacing( 6 );
+    GroupBox1Layout->setMargin( 11 );
+
+    ButtonGroup1 = new QButtonGroup( GroupBox1, "ButtonGroup1" );
+    ButtonGroup1->setFrameShape( QButtonGroup::NoFrame );
+    ButtonGroup1->setTitle( QString::null );
+    ButtonGroup1->setColumnLayout(0, Qt::Vertical );
+    ButtonGroup1->layout()->setSpacing( 0 );
+    ButtonGroup1->layout()->setMargin( 0 );
+    ButtonGroup1Layout = new QGridLayout( ButtonGroup1->layout() );
+    ButtonGroup1Layout->setAlignment( Qt::AlignTop );
+    ButtonGroup1Layout->setSpacing( 6 );
+    ButtonGroup1Layout->setMargin( 11 );
+
+    PanelProgress = new QProgressBar( ButtonGroup1, "PanelProgress" );
+    PanelProgress->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)3, PanelProgress->sizePolicy().hasHeightForWidth() ) );
+    PanelProgress->setMinimumSize( QSize( 10, 0 ) );
+    PanelProgress->setFrameShape( QProgressBar::WinPanel );
+
+    ButtonGroup1Layout->addWidget( PanelProgress, 0, 1 );
+
+    TextLabel1 = new QLabel( ButtonGroup1, "TextLabel1" );
+    TextLabel1->setText( i18n( "Progress" ) );
+
+    ButtonGroup1Layout->addWidget( TextLabel1, 0, 0 );
+    GroupBox1Layout->addWidget( ButtonGroup1 );
+
+    PanelBox = new QGroupBox( GroupBox1, "PanelBox" );
+    PanelBox->setTitle( i18n( "Panel" ) );
+    PanelBox->setColumnLayout(0, Qt::Vertical );
+    PanelBox->layout()->setSpacing( 0 );
+    PanelBox->layout()->setMargin( 0 );
+    PanelBoxLayout = new QHBoxLayout( PanelBox->layout() );
+    PanelBoxLayout->setAlignment( Qt::AlignTop );
+    PanelBoxLayout->setSpacing( 6 );
+    PanelBoxLayout->setMargin( 11 );
+
+    PortLabel = new QLabel( PanelBox, "PortLabel" );
+    PortLabel->setText( i18n( "Port: --" ) );
+    PanelBoxLayout->addWidget( PortLabel );
+    QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    PanelBoxLayout->addItem( spacer_3 );
+
+    BoxLabel = new QLabel( PanelBox, "BoxLabel" );
+    BoxLabel->setText( i18n( "Box: --" ) );
+    PanelBoxLayout->addWidget( BoxLabel );
+    QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    PanelBoxLayout->addItem( spacer_4 );
+
+    DriverLabel = new QLabel( PanelBox, "DriverLabel" );
+    DriverLabel->setText( i18n( "Driver: --" ) );
+    PanelBoxLayout->addWidget( DriverLabel );
+    GroupBox1Layout->addWidget( PanelBox );
+
+    GroupBox3_3 = new QGroupBox( GroupBox1, "GroupBox3_3" );
+    GroupBox3_3->setTitle( i18n( "Spot" ) );
+    GroupBox3_3->setColumnLayout(0, Qt::Vertical );
+    GroupBox3_3->layout()->setSpacing( 0 );
+    GroupBox3_3->layout()->setMargin( 0 );
+    GroupBox3_3Layout = new QHBoxLayout( GroupBox3_3->layout() );
+    GroupBox3_3Layout->setAlignment( Qt::AlignTop );
+    GroupBox3_3Layout->setSpacing( 6 );
+    GroupBox3_3Layout->setMargin( 11 );
+
+    XSpotLabel = new QLabel( GroupBox3_3, "XSpotLabel" );
+    XSpotLabel->setText( i18n( "X :" ) );
+    GroupBox3_3Layout->addWidget( XSpotLabel );
+
+    XSpotEdit = new QLineEdit( GroupBox3_3, "XSpotEdit" );
+    XSpotEdit->setEnabled( FALSE );
+    XSpotEdit->setMaxLength( 3 );
+    GroupBox3_3Layout->addWidget( XSpotEdit );
+    QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    GroupBox3_3Layout->addItem( spacer_5 );
+
+    YSpotLabel = new QLabel( GroupBox3_3, "YSpotLabel" );
+    YSpotLabel->setText( i18n( "Y :" ) );
+    GroupBox3_3Layout->addWidget( YSpotLabel );
+
+    YSpotEdit = new QLineEdit( GroupBox3_3, "YSpotEdit" );
+    YSpotEdit->setEnabled( FALSE );
+    YSpotEdit->setMaxLength( 3 );
+    GroupBox3_3Layout->addWidget( YSpotEdit );
+    GroupBox1Layout->addWidget( GroupBox3_3 );
+
+    GroupBox3 = new QGroupBox( GroupBox1, "GroupBox3" );
+    GroupBox3->setTitle( i18n( "X Motor" ) );
+    GroupBox3->setColumnLayout(0, Qt::Vertical );
+    GroupBox3->layout()->setSpacing( 0 );
+    GroupBox3->layout()->setMargin( 0 );
+    GroupBox3Layout = new QHBoxLayout( GroupBox3->layout() );
+    GroupBox3Layout->setAlignment( Qt::AlignTop );
+    GroupBox3Layout->setSpacing( 6 );
+    GroupBox3Layout->setMargin( 11 );
+
+    XAxisLabel = new QLabel( GroupBox3, "XAxisLabel" );
+    XAxisLabel->setText( i18n( "Axis :" ) );
+    GroupBox3Layout->addWidget( XAxisLabel );
+
+    XAxisEdit = new QLineEdit( GroupBox3, "XAxisEdit" );
+    XAxisEdit->setEnabled( FALSE );
+    XAxisEdit->setMaxLength( 10 );
+    GroupBox3Layout->addWidget( XAxisEdit );
+    QSpacerItem* spacer_6 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    GroupBox3Layout->addItem( spacer_6 );
+
+    XSlopeLabel = new QLabel( GroupBox3, "XSlopeLabel" );
+    XSlopeLabel->setText( i18n( "Slope :" ) );
+    GroupBox3Layout->addWidget( XSlopeLabel );
+
+    XSlopeEdit = new QLineEdit( GroupBox3, "XSlopeEdit" );
+    XSlopeEdit->setEnabled( FALSE );
+    XSlopeEdit->setMaxLength( 10 );
+    GroupBox3Layout->addWidget( XSlopeEdit );
+    GroupBox1Layout->addWidget( GroupBox3 );
+
+    YMotorBox = new QGroupBox( GroupBox1, "YMotorBox" );
+    YMotorBox->setTitle( i18n( "Y Motor" ) );
+    YMotorBox->setColumnLayout(0, Qt::Vertical );
+    YMotorBox->layout()->setSpacing( 0 );
+    YMotorBox->layout()->setMargin( 0 );
+    YMotorBoxLayout = new QHBoxLayout( YMotorBox->layout() );
+    YMotorBoxLayout->setAlignment( Qt::AlignTop );
+    YMotorBoxLayout->setSpacing( 6 );
+    YMotorBoxLayout->setMargin( 11 );
+
+    YAxisLabel = new QLabel( YMotorBox, "YAxisLabel" );
+    YAxisLabel->setText( i18n( "Axis :" ) );
+    YMotorBoxLayout->addWidget( YAxisLabel );
+
+    YAxisEdit = new QLineEdit( YMotorBox, "YAxisEdit" );
+    YAxisEdit->setEnabled( FALSE );
+    YAxisEdit->setMaxLength( 10 );
+    YMotorBoxLayout->addWidget( YAxisEdit );
+    QSpacerItem* spacer_7 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    YMotorBoxLayout->addItem( spacer_7 );
+
+    YSlopeLabel = new QLabel( YMotorBox, "YSlopeLabel" );
+    YSlopeLabel->setText( i18n( "Slope :" ) );
+    YMotorBoxLayout->addWidget( YSlopeLabel );
+
+    YSlopeEdit = new QLineEdit( YMotorBox, "YSlopeEdit" );
+    YSlopeEdit->setEnabled( FALSE );
+    YSlopeEdit->setMaxLength( 10 );
+    YMotorBoxLayout->addWidget( YSlopeEdit );
+    GroupBox1Layout->addWidget( YMotorBox );
+
+    ConversionGroup = new QGroupBox( GroupBox1, "ConversionGroup" );
+    ConversionGroup->setTitle( i18n( "Conversion (Steps / Pixel)" ) );
+    ConversionGroup->setColumnLayout(0, Qt::Vertical );
+    ConversionGroup->layout()->setSpacing( 0 );
+    ConversionGroup->layout()->setMargin( 0 );
+    ConversionGroupLayout = new QHBoxLayout( ConversionGroup->layout() );
+    ConversionGroupLayout->setAlignment( Qt::AlignTop );
+    ConversionGroupLayout->setSpacing( 6 );
+    ConversionGroupLayout->setMargin( 11 );
+
+    XConvLabel = new QLabel( ConversionGroup, "XConvLabel" );
+    XConvLabel->setText( i18n( "X :" ) );
+    ConversionGroupLayout->addWidget( XConvLabel );
+
+    XConvEdit = new QLineEdit( ConversionGroup, "XConvEdit" );
+    XConvEdit->setEnabled( FALSE );
+    XConvEdit->setMaxLength( 10 );
+    ConversionGroupLayout->addWidget( XConvEdit );
+    QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    ConversionGroupLayout->addItem( spacer_8 );
+
+    YConvLabel = new QLabel( ConversionGroup, "YConvLabel" );
+    YConvLabel->setText( i18n( "Y :" ) );
+    ConversionGroupLayout->addWidget( YConvLabel );
+
+    YConvEdit = new QLineEdit( ConversionGroup, "YConvEdit" );
+    YConvEdit->setEnabled( FALSE );
+    YConvEdit->setMaxLength( 10 );
+    ConversionGroupLayout->addWidget( YConvEdit );
+    GroupBox1Layout->addWidget( ConversionGroup );
+    Layout6->addWidget( GroupBox1 );
+
+    GlobalGroup = new QGroupBox( this, "GlobalGroup" );
+    GlobalGroup->setTitle( i18n( "Global Reference" ) );
+    GlobalGroup->setColumnLayout(0, Qt::Vertical );
+    GlobalGroup->layout()->setSpacing( 0 );
+    GlobalGroup->layout()->setMargin( 0 );
+    GlobalGroupLayout = new QVBoxLayout( GlobalGroup->layout() );
+    GlobalGroupLayout->setAlignment( Qt::AlignTop );
+    GlobalGroupLayout->setSpacing( 6 );
+    GlobalGroupLayout->setMargin( 11 );
+
+    Layout4 = new QHBoxLayout; 
+    Layout4->setSpacing( 6 );
+    Layout4->setMargin( 0 );
+
+    XSpotLabel_2 = new QLabel( GlobalGroup, "XSpotLabel_2" );
+    XSpotLabel_2->setText( i18n( "X :" ) );
+    Layout4->addWidget( XSpotLabel_2 );
+
+    XGRefEdit = new QLineEdit( GlobalGroup, "XGRefEdit" );
+    XGRefEdit->setEnabled( FALSE );
+    XGRefEdit->setText( i18n( "-1" ) );
+    XGRefEdit->setMaxLength( 3 );
+    Layout4->addWidget( XGRefEdit );
+    QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout4->addItem( spacer_9 );
+
+    YSpotLabel_2 = new QLabel( GlobalGroup, "YSpotLabel_2" );
+    YSpotLabel_2->setText( i18n( "Y :" ) );
+    Layout4->addWidget( YSpotLabel_2 );
+
+    YGRefEdit = new QLineEdit( GlobalGroup, "YGRefEdit" );
+    YGRefEdit->setEnabled( FALSE );
+    YGRefEdit->setText( i18n( "-1" ) );
+    YGRefEdit->setMaxLength( 3 );
+    Layout4->addWidget( YGRefEdit );
+    GlobalGroupLayout->addLayout( Layout4 );
+
+    Layout5_2 = new QHBoxLayout; 
+    Layout5_2->setSpacing( 6 );
+    Layout5_2->setMargin( 0 );
+    QSpacerItem* spacer_10 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout5_2->addItem( spacer_10 );
+
+    buttonGoto = new QPushButton( GlobalGroup, "buttonGoto" );
+    buttonGoto->setEnabled( FALSE );
+    buttonGoto->setText( i18n( "Goto Reference" ) );
+    Layout5_2->addWidget( buttonGoto );
+    QSpacerItem* spacer_11 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout5_2->addItem( spacer_11 );
+    GlobalGroupLayout->addLayout( Layout5_2 );
+    Layout6->addWidget( GlobalGroup );
+    QSpacerItem* spacer_12 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+    Layout6->addItem( spacer_12 );
+
+    CalibratePanelDialogBaseLayout->addLayout( Layout6, 0, 1 );
+
+    // signals and slots connections
+    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
+    connect( buttonStart, SIGNAL( clicked() ), this, SLOT( startSlot() ) );
+    connect( buttonGoto, SIGNAL( clicked() ), this, SLOT( gotoRefSlot() ) );
+}
+
+/*  
+ *  Destroys the object and frees any allocated resources
+ */
+CalibratePanelDialogBase::~CalibratePanelDialogBase()
+{
+    // no need to delete child widgets, Qt does it all for us
+}
+
+void CalibratePanelDialogBase::gotoRefSlot()
+{
+    qWarning( "CalibratePanelDialogBase::gotoRefSlot(): Not implemented yet!" );
+}
+
+void CalibratePanelDialogBase::startSlot()
+{
+    qWarning( "CalibratePanelDialogBase::startSlot(): Not implemented yet!" );
+}
+
+void CalibratePanelDialogBase::stop()
+{
+    qWarning( "CalibratePanelDialogBase::stop(): Not implemented yet!" );
+}
+
+#include "calibratepaneldialogbase.moc"
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.h	(revision 3401)
@@ -0,0 +1,98 @@
+/****************************************************************************
+** Form interface generated from reading ui file './calibratepaneldialogbase.ui'
+**
+** Created: Thu Jan 29 00:50:28 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef CALIBRATEPANELDIALOGBASE_H
+#define CALIBRATEPANELDIALOGBASE_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+class QVBoxLayout; 
+class QHBoxLayout; 
+class QGridLayout; 
+class QButtonGroup;
+class QFrame;
+class QGroupBox;
+class QLabel;
+class QLineEdit;
+class QMultiLineEdit;
+class QProgressBar;
+class QPushButton;
+
+class CalibratePanelDialogBase : public QDialog
+{ 
+    Q_OBJECT
+
+public:
+    CalibratePanelDialogBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+    ~CalibratePanelDialogBase();
+
+    QFrame* Video_Frame;
+    QGroupBox* InfoBox;
+    QMultiLineEdit* ProgressField;
+    QMultiLineEdit* ErrorField;
+    QPushButton* buttonStart;
+    QPushButton* buttonOk;
+    QGroupBox* GroupBox1;
+    QButtonGroup* ButtonGroup1;
+    QProgressBar* PanelProgress;
+    QLabel* TextLabel1;
+    QGroupBox* PanelBox;
+    QLabel* PortLabel;
+    QLabel* BoxLabel;
+    QLabel* DriverLabel;
+    QGroupBox* GroupBox3_3;
+    QLabel* XSpotLabel;
+    QLineEdit* XSpotEdit;
+    QLabel* YSpotLabel;
+    QLineEdit* YSpotEdit;
+    QGroupBox* GroupBox3;
+    QLabel* XAxisLabel;
+    QLineEdit* XAxisEdit;
+    QLabel* XSlopeLabel;
+    QLineEdit* XSlopeEdit;
+    QGroupBox* YMotorBox;
+    QLabel* YAxisLabel;
+    QLineEdit* YAxisEdit;
+    QLabel* YSlopeLabel;
+    QLineEdit* YSlopeEdit;
+    QGroupBox* ConversionGroup;
+    QLabel* XConvLabel;
+    QLineEdit* XConvEdit;
+    QLabel* YConvLabel;
+    QLineEdit* YConvEdit;
+    QGroupBox* GlobalGroup;
+    QLabel* XSpotLabel_2;
+    QLineEdit* XGRefEdit;
+    QLabel* YSpotLabel_2;
+    QLineEdit* YGRefEdit;
+    QPushButton* buttonGoto;
+
+public slots:
+    virtual void gotoRefSlot();
+    virtual void startSlot();
+    virtual void stop();
+
+protected:
+    QGridLayout* CalibratePanelDialogBaseLayout;
+    QHBoxLayout* InfoBoxLayout;
+    QVBoxLayout* Layout5;
+    QHBoxLayout* Layout3;
+    QVBoxLayout* Layout6;
+    QVBoxLayout* GroupBox1Layout;
+    QGridLayout* ButtonGroup1Layout;
+    QHBoxLayout* PanelBoxLayout;
+    QHBoxLayout* GroupBox3_3Layout;
+    QHBoxLayout* GroupBox3Layout;
+    QHBoxLayout* YMotorBoxLayout;
+    QHBoxLayout* ConversionGroupLayout;
+    QVBoxLayout* GlobalGroupLayout;
+    QHBoxLayout* Layout4;
+    QHBoxLayout* Layout5_2;
+};
+
+#endif // CALIBRATEPANELDIALOGBASE_H
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.moc
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.moc	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.moc	(revision 3401)
@@ -0,0 +1,95 @@
+/****************************************************************************
+** CalibratePanelDialogBase meta object code from reading C++ file 'calibratepaneldialogbase.h'
+**
+** Created: Thu Jan 29 00:51:22 2004
+**      by: The Qt MOC ($Id: calibratepaneldialogbase.moc,v 1.1 2004-03-04 16:31:18 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "calibratepaneldialogbase.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *CalibratePanelDialogBase::className() const
+{
+    return "CalibratePanelDialogBase";
+}
+
+QMetaObject *CalibratePanelDialogBase::metaObj = 0;
+
+void CalibratePanelDialogBase::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QDialog::className(), "QDialog") != 0 )
+	badSuperclassWarning("CalibratePanelDialogBase","QDialog");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString CalibratePanelDialogBase::tr(const char* s)
+{
+    return qApp->translate( "CalibratePanelDialogBase", s, 0 );
+}
+
+QString CalibratePanelDialogBase::tr(const char* s, const char * c)
+{
+    return qApp->translate( "CalibratePanelDialogBase", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* CalibratePanelDialogBase::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QDialog::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (CalibratePanelDialogBase::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    typedef void (CalibratePanelDialogBase::*m1_t1)();
+    typedef void (QObject::*om1_t1)();
+    typedef void (CalibratePanelDialogBase::*m1_t2)();
+    typedef void (QObject::*om1_t2)();
+    m1_t0 v1_0 = &CalibratePanelDialogBase::gotoRefSlot;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &CalibratePanelDialogBase::startSlot;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &CalibratePanelDialogBase::stop;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(3);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(3);
+    slot_tbl[0].name = "gotoRefSlot()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "startSlot()";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    slot_tbl[2].name = "stop()";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"CalibratePanelDialogBase", "QDialog",
+	slot_tbl, 3,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.ui
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.ui	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/calibratepaneldialogbase.ui	(revision 3401)
@@ -0,0 +1,1479 @@
+<!DOCTYPE UI><UI>
+<class>CalibratePanelDialogBase</class>
+<widget>
+    <class>QDialog</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>CalibratePanelDialogBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>918</width>
+            <height>617</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>CalibratePanel</string>
+    </property>
+    <property stdset="1">
+        <name>sizeGripEnabled</name>
+        <bool>true</bool>
+    </property>
+    <grid>
+        <property stdset="1">
+            <name>margin</name>
+            <number>11</number>
+        </property>
+        <property stdset="1">
+            <name>spacing</name>
+            <number>6</number>
+        </property>
+        <widget row="0"  column="0" >
+            <class>QFrame</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Video_Frame</cstring>
+            </property>
+            <property stdset="1">
+                <name>sizePolicy</name>
+                <sizepolicy>
+                    <hsizetype>5</hsizetype>
+                    <vsizetype>5</vsizetype>
+                </sizepolicy>
+            </property>
+            <property stdset="1">
+                <name>minimumSize</name>
+                <size>
+                    <width>640</width>
+                    <height>480</height>
+                </size>
+            </property>
+            <property stdset="1">
+                <name>maximumSize</name>
+                <size>
+                    <width>640</width>
+                    <height>480</height>
+                </size>
+            </property>
+            <property stdset="1">
+                <name>frameShape</name>
+                <enum>StyledPanel</enum>
+            </property>
+            <property stdset="1">
+                <name>frameShadow</name>
+                <enum>Raised</enum>
+            </property>
+        </widget>
+        <widget row="1"  column="0" >
+            <class>QGroupBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>InfoBox</cstring>
+            </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>Progress Info</string>
+            </property>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>11</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QMultiLineEdit</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ProgressField</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>palette</name>
+                        <palette>
+                            <active>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>223</red>
+                                    <green>223</green>
+                                    <blue>223</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>170</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </active>
+                            <disabled>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>220</red>
+                                    <green>220</green>
+                                    <blue>220</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>170</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </disabled>
+                            <inactive>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>220</red>
+                                    <green>220</green>
+                                    <blue>220</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>170</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </inactive>
+                        </palette>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QMultiLineEdit</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ErrorField</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>sizePolicy</name>
+                        <sizepolicy>
+                            <hsizetype>7</hsizetype>
+                            <vsizetype>5</vsizetype>
+                        </sizepolicy>
+                    </property>
+                    <property stdset="1">
+                        <name>palette</name>
+                        <palette>
+                            <active>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>223</red>
+                                    <green>223</green>
+                                    <blue>223</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </active>
+                            <disabled>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>220</red>
+                                    <green>220</green>
+                                    <blue>220</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </disabled>
+                            <inactive>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>220</red>
+                                    <green>220</green>
+                                    <blue>220</blue>
+                                </color>
+                                <color>
+                                    <red>96</red>
+                                    <green>96</green>
+                                    <blue>96</blue>
+                                </color>
+                                <color>
+                                    <red>128</red>
+                                    <green>128</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                                <color>
+                                    <red>192</red>
+                                    <green>192</green>
+                                    <blue>192</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>0</blue>
+                                </color>
+                                <color>
+                                    <red>0</red>
+                                    <green>0</green>
+                                    <blue>128</blue>
+                                </color>
+                                <color>
+                                    <red>255</red>
+                                    <green>255</green>
+                                    <blue>255</blue>
+                                </color>
+                            </inactive>
+                        </palette>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <widget row="1"  column="1" >
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout5</cstring>
+            </property>
+            <vbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer12</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Vertical</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QLayoutWidget</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Layout3</cstring>
+                    </property>
+                    <hbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>0</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QPushButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>buttonStart</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>&amp;Start</string>
+                            </property>
+                            <property stdset="1">
+                                <name>autoDefault</name>
+                                <bool>true</bool>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property>
+                                <name>name</name>
+                                <cstring>Horizontal Spacing2</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>sizeType</name>
+                                <enum>Expanding</enum>
+                            </property>
+                            <property>
+                                <name>sizeHint</name>
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget>
+                            <class>QPushButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>buttonOk</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>caption</name>
+                                <string></string>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Exit</string>
+                            </property>
+                            <property stdset="1">
+                                <name>autoDefault</name>
+                                <bool>true</bool>
+                            </property>
+                            <property stdset="1">
+                                <name>default</name>
+                                <bool>true</bool>
+                            </property>
+                        </widget>
+                    </hbox>
+                </widget>
+            </vbox>
+        </widget>
+        <widget row="0"  column="1" >
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout6</cstring>
+            </property>
+            <vbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QGroupBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>GroupBox1</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>title</name>
+                        <string>Panel Info</string>
+                    </property>
+                    <vbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>11</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QButtonGroup</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>ButtonGroup1</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>frameShape</name>
+                                <enum>NoFrame</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string></string>
+                            </property>
+                            <grid>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget row="0"  column="1" >
+                                    <class>QProgressBar</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>PanelProgress</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizePolicy</name>
+                                        <sizepolicy>
+                                            <hsizetype>7</hsizetype>
+                                            <vsizetype>3</vsizetype>
+                                        </sizepolicy>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>10</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>frameShape</name>
+                                        <enum>WinPanel</enum>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>TextLabel1</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Progress</string>
+                                    </property>
+                                </widget>
+                            </grid>
+                        </widget>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>PanelBox</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Panel</string>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>PortLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Port: --</string>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer4</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>BoxLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Box: --</string>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer5</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>DriverLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Driver: --</string>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>GroupBox3_3</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Spot</string>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XSpotLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>X :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XSpotEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>3</number>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer2_4</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YSpotLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Y :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YSpotEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>3</number>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>GroupBox3</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>X Motor</string>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XAxisLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Axis :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XAxisEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>10</number>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XSlopeLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Slope :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XSlopeEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>10</number>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>YMotorBox</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Y Motor</string>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YAxisLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Axis :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YAxisEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>10</number>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer2_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YSlopeLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Slope :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YSlopeEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>10</number>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>ConversionGroup</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Conversion (Steps / Pixel)</string>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XConvLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>X :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XConvEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>10</number>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer2_4_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YConvLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Y :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YConvEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>10</number>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                    </vbox>
+                </widget>
+                <widget>
+                    <class>QGroupBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>GlobalGroup</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>title</name>
+                        <string>Global Reference</string>
+                    </property>
+                    <vbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>11</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QLayoutWidget</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Layout4</cstring>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>0</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XSpotLabel_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>X :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>XGRefEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>-1</string>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>3</number>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer2_4_3</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YSpotLabel_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Y :</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>YGRefEdit</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>-1</string>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>3</number>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <widget>
+                            <class>QLayoutWidget</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Layout5</cstring>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>0</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer11_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>buttonGoto</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Goto Reference</string>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer12_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                            </hbox>
+                        </widget>
+                    </vbox>
+                </widget>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer11</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Vertical</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+            </vbox>
+        </widget>
+    </grid>
+</widget>
+<connections>
+    <connection>
+        <sender>buttonOk</sender>
+        <signal>clicked()</signal>
+        <receiver>CalibratePanelDialogBase</receiver>
+        <slot>accept()</slot>
+    </connection>
+    <connection>
+        <sender>buttonStart</sender>
+        <signal>clicked()</signal>
+        <receiver>CalibratePanelDialogBase</receiver>
+        <slot>startSlot()</slot>
+    </connection>
+    <connection>
+        <sender>buttonGoto</sender>
+        <signal>clicked()</signal>
+        <receiver>CalibratePanelDialogBase</receiver>
+        <slot>gotoRefSlot()</slot>
+    </connection>
+    <slot access="public">gotoRefSlot()</slot>
+    <slot access="public">startSlot()</slot>
+    <slot access="public">stop()</slot>
+</connections>
+</UI>
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/cc_defs.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/cc_defs.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/cc_defs.h	(revision 3401)
@@ -0,0 +1,25 @@
+/***************************************************************************
+                          CCDefs.h  -  description
+                             -------------------
+    begin                : Wed Mar 26 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#define CC_HOST_ADDRESS		"161.72.130.1"
+#define AMC_HOST_ADDRESS	"161.72.130.7"
+
+#define AMC_CMD_PORT	7407
+#define AMC_REP_PORT	7307
+
+#define AMC_REPORT_TIMEOUT	3000
+#define CC_REPORT_TIMEOUT		50000
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/centerthread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/centerthread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/centerthread.h	(revision 3401)
@@ -0,0 +1,29 @@
+// centerthread.h: Schnittstelle für die Klasse MotorThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef CENTERTHREAD_H
+#define CENTERTHREAD_H
+
+
+#include <qthread.h>
+
+class AMCMirrorPanel;
+
+class CenterThread : public QThread
+{
+
+public:
+	void setPanel( AMCMirrorPanel* p_pPanel );
+	AMCMirrorPanel* getPanel() { return m_pPanel; };
+	CenterThread( QObject* p_pReceiver );
+	virtual ~CenterThread();
+
+protected:
+	virtual void run();
+private:
+	AMCMirrorPanel* m_pPanel;
+	QObject*				m_pReceiver;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/centertread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/centertread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/centertread.cpp	(revision 3401)
@@ -0,0 +1,78 @@
+// centerthread.cpp: Implementierung der Klasse CenterThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "centerthread.h"
+#include "motorthreaddialog.h"
+#include "threadevent.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcserialport.h"
+#include "amcerror.h"
+#include <qmessagebox.h>
+#include <qevent.h>
+#include <qthread.h>
+#include <qstring.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern AMCSerialPort* g_pPort[];
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+CenterThread::CenterThread( QObject* p_pReceiver )
+	: m_pPanel( NULL ), m_pReceiver( p_pReceiver )
+{
+}
+
+CenterThread::~CenterThread()
+{
+}
+
+void CenterThread::run()
+{
+	QString qsMsg;
+	qsMsg.sprintf( "Panel (%d,%d)  Port: %d, Box:%d, Driver:%d",
+			       m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+
+	// We use only one motor instance and reuse it for each panel
+	AMCSerialPort* pPort = g_pPort[ m_pPanel->port()-1 ];
+	AMCMotor* pMotor = new AMCMotor( pPort );
+
+	try
+	{
+		pMotor->unselectBox();
+		pMotor->selectBox( m_pPanel->box() );
+		pMotor->selectDriver( m_pPanel->driver() );
+		pMotor->getFrequency();
+
+		pMotor->centerMotors();
+		pMotor->waitForMotors( pMotor->calcTimeout( 17000 )+2 );
+		m_pPanel->setX( 0 );
+		m_pPanel->setY( 0 );
+	}
+	catch( AMCError& e )
+	{
+		qsMsg.sprintf( "AMCError: Panel (%d,%d)  Port: %d, Box:%d, Driver:%d -- ",
+			       				m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+		qsMsg.append( e.getErrorText() );
+		qDebug("Posted error event");
+		QThread::postEvent( m_pReceiver, new ThreadErrorEvent( qsMsg, e ) );
+		pMotor->resetBox();
+	}
+
+	delete pMotor;
+	QThread::postEvent( m_pReceiver, new QCustomEvent( THREAD_END_EVENT ) );
+
+}
+
+void CenterThread::setPanel(AMCMirrorPanel* p_pPanel)
+{
+	m_pPanel = p_pPanel;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthread.cpp	(revision 3401)
@@ -0,0 +1,100 @@
+// DefocusThread.cpp: Implementierung der Klasse DefocusThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "defocusthread.h"
+#include "motorthreaddialog.h"
+#include "threadevent.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcserialport.h"
+#include "amcerror.h"
+#include <qmessagebox.h>
+#include <qevent.h>
+#include <qthread.h>
+#include <qstring.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern AMCSerialPort* g_pPort[];
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+DefocusThread::DefocusThread( QObject* p_pReceiver )
+	: m_pPanel( NULL ), m_pReceiver( p_pReceiver )
+{
+}
+
+DefocusThread::~DefocusThread()
+{
+}
+
+void DefocusThread::run()
+{
+	QString qsMsg;
+	qsMsg.sprintf( "Panel (%d,%d)  Port: %d, Box:%d, Driver:%d",
+			       m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+
+	QTime t;
+	t.start();                          // start clock
+
+	
+	// We use only one motor instance and reuse it for each panel
+	AMCSerialPort* pPort = g_pPort[ m_pPanel->port()-1 ];
+	AMCMotor* pMotor = new AMCMotor( pPort );
+
+	try
+	{
+		int x = m_pPanel->getRefX();
+		int y = m_pPanel->getRefY();
+		if( x >= 0 )
+			x -= 1500;
+		else
+			x += 1500;
+		if( y >= 0 )
+			y -= 1500;
+		else
+			y += 1500;
+	  x -= m_pPanel->getX();
+	  y -= m_pPanel->getY();
+
+		int steps = MAX( abs(x), abs(y) );
+		if( ! ((x == 0) && (y == 0)) )			// only move is necesary
+		{
+			pMotor->unselectBox();
+			pMotor->selectBox( m_pPanel->box() );
+			pMotor->selectDriver( m_pPanel->driver() );
+			pMotor->getFrequency();
+			pMotor->moveMotors(x,y);
+			pMotor->waitForMotors( pMotor->calcTimeout(steps) );
+			m_pPanel->setX( m_pPanel->getX() + x );
+			m_pPanel->setY( m_pPanel->getY() + y );
+		}
+	}
+	catch( AMCError& e )
+	{
+		qsMsg.sprintf( "AMCError: Panel (%d,%d)  Port: %d, Box:%d, Driver:%d -- ",
+			       				m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+		qsMsg.append( e.getErrorText() );
+		QThread::postEvent( m_pReceiver, new ThreadErrorEvent( qsMsg, e ) );
+		pMotor->resetBox();
+		
+	}
+	delete pMotor;
+
+	qsMsg.sprintf( "Time: %dms", t.elapsed() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+	QThread::postEvent( m_pReceiver, new QCustomEvent( PROGRESS_EVENT ) );
+
+}
+
+void DefocusThread::setPanel(AMCMirrorPanel* p_pPanel)
+{
+	m_pPanel = p_pPanel;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthread.h	(revision 3401)
@@ -0,0 +1,29 @@
+// defocusthread.h: Schnittstelle für die Klasse DefocusThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef DEFOCUSTHREAD_H
+#define DEFOCUSTHREAD_H
+
+
+#include <qthread.h>
+
+class AMCMirrorPanel;
+
+class DefocusThread : public QThread
+{
+
+public:
+	void setPanel( AMCMirrorPanel* p_pPanel );
+	AMCMirrorPanel* getPanel() { return m_pPanel; };
+	DefocusThread( QObject* p_pReceiver );
+	virtual ~DefocusThread();
+
+protected:
+	virtual void run();
+private:
+	AMCMirrorPanel* m_pPanel;
+	QObject*				m_pReceiver;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthreadcontroller.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthreadcontroller.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthreadcontroller.cpp	(revision 3401)
@@ -0,0 +1,39 @@
+// MotorThreadController.cpp: Implementierung der Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "defocusthreadcontroller.h"
+#include "defocusthread.h"
+#include "amcmirrorpanel.h"
+#include <qthread.h>
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+DefocusThreadController::DefocusThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver )
+: ThreadController( p_qlPanels, p_pReceiver )
+{
+}
+
+DefocusThreadController::~DefocusThreadController()
+{
+
+}
+
+void DefocusThreadController::run()
+{
+	for( AMCMirrorPanel* pActualPanel = m_qlPanels.first();
+		 pActualPanel; pActualPanel = m_qlPanels.next() )
+	{
+		if( m_zStop )
+			return;
+		DefocusThread* pThread = new DefocusThread( m_pReceiver );
+		pThread->setPanel( pActualPanel );
+		pThread->start();
+		pThread->wait();
+		delete pThread;
+	}
+
+	return;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthreadcontroller.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthreadcontroller.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/defocusthreadcontroller.h	(revision 3401)
@@ -0,0 +1,21 @@
+// MotorThreadController.h: Schnittstelle für die Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef DEFOCUSTHREADCONTROLLER_H
+#define DEFOCUSTHREADCONTROLLER_H
+
+
+#include "threadcontroller.h"
+
+class DefocusThreadController : public ThreadController
+{
+public:
+	DefocusThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver  );
+	virtual ~DefocusThreadController();
+
+protected:
+	void run();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errorinfoevent.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errorinfoevent.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errorinfoevent.cpp	(revision 3401)
@@ -0,0 +1,19 @@
+// ErrorInfoEvent.cpp: Implementierung der Klasse ErrorInfoEvent.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "errorinfoevent.h"
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+ErrorInfoEvent::ErrorInfoEvent( QString p_qsMsg )
+	: QCustomEvent( ERROR_INFO_EVENT ), m_qsMsg( p_qsMsg )
+{
+}
+
+ErrorInfoEvent::~ErrorInfoEvent()
+{
+
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errorinfoevent.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errorinfoevent.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errorinfoevent.h	(revision 3401)
@@ -0,0 +1,22 @@
+// errorinfoevent.h: Schnittstelle für die Klasse ErrorInfoEvent.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef ERRORINFOEVENT_H
+#define ERRORINFOEVENT_H
+
+#include "eventdefs.h"
+
+class ErrorInfoEvent : public QCustomEvent  
+{
+public:
+	ErrorInfoEvent( QString p_qsMsg );
+	virtual ~ErrorInfoEvent();
+	QString getMessage() { return m_qsMsg; };
+
+private:
+	QString m_qsMsg;
+
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthread.cpp	(revision 3401)
@@ -0,0 +1,101 @@
+// errortestthread.cpp: Implementierung der Klasse ErrorTestThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "errortestthread.h"
+#include "motorthreaddialog.h"
+#include "threadevent.h"
+#include "amcdefs.h"
+#include "amcframegrabber.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcserialport.h"
+#include "amcerror.h"
+#include "amcerrors.h"
+#include "videospot.h"
+#include <qmessagebox.h>
+#include <qevent.h>
+#include <qthread.h>
+#include <qstring.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern AMCSerialPort* g_pPort[];
+extern AMCFrameGrabber* g_pFG;
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+ErrorTestThread::ErrorTestThread( QObject* p_pReceiver )
+	: m_pPanel( NULL ), m_pReceiver( p_pReceiver ), m_zOn( false )
+{
+}
+
+ErrorTestThread::~ErrorTestThread()
+{
+}
+
+void ErrorTestThread::run()
+{
+	QString qsMsg;
+	qsMsg.sprintf( "Panel (%d,%d) at Port: %d, Box:%d, Driver:%d",
+			           m_pPanel->i(), m_pPanel->j(),
+                 m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+
+	QTime t;
+	t.start();                          // start clock
+
+	// We use only one motor instance and reuse it for each panel
+	AMCSerialPort* pPort = g_pPort[ m_pPanel->port()-1 ];
+	AMCMotor* pMotor = new AMCMotor( pPort );
+  pMotor->setPortNum( m_pPanel->port() );
+
+  int iTemp, iHum, iPowerI, iPowerV, iSecondV, iLogicV;
+	try
+	{
+		pMotor->unselectBox();
+		pMotor->selectBox( m_pPanel->box() );
+		pMotor->getInfo( &iTemp, &iHum, &iPowerI, &iPowerV, &iSecondV, &iLogicV );
+		pMotor->selectDriver( m_pPanel->driver() );
+		pMotor->getFrequency();
+		pMotor->switchLaser( true );
+		m_pPanel->setLaserOn( true );
+		pMotor->switchLaser( false );
+		m_pPanel->setLaserOn( false );
+	}
+	catch( AMCError& e )
+  {
+    e.setPanel( m_pPanel->i(), m_pPanel->j() );
+		qsMsg.sprintf( "AMCError: Panel (%d,%d) Port: %d, Box:%d, Driver:%d -- ",
+			       				m_pPanel->i(), m_pPanel->j(),
+										m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+		QThread::postEvent( m_pReceiver, new ThreadErrorEvent( qsMsg, e ) );
+
+    try
+		{
+			pMotor->resetBox();
+			pMotor->unselectBox();
+			pMotor->selectBox( m_pPanel->box() );
+			pMotor->selectDriver( m_pPanel->driver() );
+			pMotor->switchLaser( false );
+			m_pPanel->setLaserOn( false );
+		}
+    catch( AMCError& e2 ){}
+	}
+	delete pMotor;
+
+
+//	qsMsg.sprintf( "Time: %dms", t.elapsed() );
+//	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+}
+
+void ErrorTestThread::setPanel(AMCMirrorPanel* p_pPanel)
+{
+	m_pPanel = p_pPanel;
+}
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthread.h	(revision 3401)
@@ -0,0 +1,37 @@
+// errortestthread.h: Schnittstelle für die Klasse ErrorTestThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef ERRORTESTTHREAD_H
+#define ERRORTESTTHREAD_H
+
+
+#include <qthread.h>
+#include <qlist.h>
+
+class AMCMirrorPanel;
+class	VideoSpot;
+
+
+class ErrorTestThread : public QThread
+{
+
+public:
+	ErrorTestThread( QObject* p_pReceiver );
+	virtual ~ErrorTestThread();
+
+	void setPanel( AMCMirrorPanel* p_pPanel );
+	void setLaser( bool p_zOn ) { m_zOn = p_zOn; };
+	void setData( uchar* p_pData ) { m_pData = p_pData; };
+	AMCMirrorPanel* getPanel() { return m_pPanel; };
+
+protected:
+	virtual void run();
+private:
+	AMCMirrorPanel* 	m_pPanel;
+	QObject*					m_pReceiver;
+	uchar*						m_pData;
+	bool							m_zOn;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthreadcontroller.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthreadcontroller.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthreadcontroller.cpp	(revision 3401)
@@ -0,0 +1,49 @@
+// errortestthreadcontroller.cpp: Implementierung der Klasse ErrorTestThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "errortestthreadcontroller.h"
+#include "errortestthread.h"
+#include "amcmirrorpanel.h"
+#include "amcframegrabber.h"
+#include <qthread.h>
+
+extern AMCFrameGrabber* g_pFG;
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+ErrorTestThreadController::ErrorTestThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver )
+	: ThreadController( p_qlPanels, p_pReceiver )
+{
+	m_pData = new uchar[ g_pFG->getBuffsize()];
+  m_iLoops = 0;
+}
+
+ErrorTestThreadController::~ErrorTestThreadController()
+{
+	delete[] m_pData;
+}
+
+void ErrorTestThreadController::run()
+{
+  for( int i=0; i<m_iLoops; i++ )
+  {
+		for( AMCMirrorPanel* pActualPanel = m_qlPanels.first();
+			 pActualPanel; pActualPanel = m_qlPanels.next() )
+		{
+			if( m_zStop )
+				return;
+			ErrorTestThread* pThread = new ErrorTestThread( m_pReceiver );
+			pThread->setPanel( pActualPanel );
+			pThread->setData( m_pData );
+			pThread->start();
+			pThread->wait();
+			delete pThread;
+		}
+		QThread::postEvent( m_pReceiver, new QCustomEvent( PROGRESS_EVENT ) );
+  }
+
+	return;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthreadcontroller.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthreadcontroller.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/errortestthreadcontroller.h	(revision 3401)
@@ -0,0 +1,27 @@
+// errortestthreadcontroller.h: Schnittstelle für die Klasse ErrorTestThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef ERRORTESTTHREADCONTROLLER_H
+#define ERRORTESTTHREADCONTROLLER_H
+
+#include "threadcontroller.h"
+#include "threadevent.h"
+
+class ErrorTestThreadController : public ThreadController
+{
+public:
+	ErrorTestThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver );
+	virtual ~ErrorTestThreadController();
+
+  void setNumLoops( int p_iLoops ) { m_iLoops = p_iLoops; }
+
+protected:
+	virtual void run();
+
+private:
+	uchar*	m_pData;
+  int			m_iLoops;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/eventdefs.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/eventdefs.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/eventdefs.h	(revision 3401)
@@ -0,0 +1,15 @@
+// Event Type definitions
+#include <qevent.h>
+
+#define PROGRESS_INFO_EVENT		(QEvent::User + 1)
+#define ERROR_INFO_EVENT		(QEvent::User + 2)
+#define PANEL_PROGRESS_EVENT	(QEvent::User + 3)
+#define TOTAL_PROGRESS_EVENT	(QEvent::User + 4)
+#define FRAME_EVENT	(QEvent::User + 5)
+#define X_SPOT_EVENT	(QEvent::User + 6)
+#define Y_SPOT_EVENT	(QEvent::User + 7)
+#define NEW_PANEL_EVENT	(QEvent::User + 8)
+#define X_CONV_EVENT	(QEvent::User + 9)
+#define Y_CONV_EVENT	(QEvent::User + 10)
+#define THREAD_END_EVENT	(QEvent::User + 11)
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/focusthread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/focusthread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/focusthread.cpp	(revision 3401)
@@ -0,0 +1,99 @@
+// focusthread.cpp: Implementierung der Klasse DefocusThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "focusthread.h"
+#include "motorthreaddialog.h"
+#include "threadevent.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcserialport.h"
+#include "amcerror.h"
+#include <qmessagebox.h>
+#include <qevent.h>
+#include <qthread.h>
+#include <qstring.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern AMCSerialPort* g_pPort[];
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+FocusThread::FocusThread( QObject* p_pReceiver )
+	: m_pPanel( NULL ), m_pReceiver( p_pReceiver )
+{
+}
+
+FocusThread::~FocusThread()
+{
+}
+
+void FocusThread::run()
+{
+	QString qsMsg;
+	qsMsg.sprintf( "Panel (%d,%d)  Port: %d, Box:%d, Driver:%d",
+			       m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+
+	QTime t;
+	t.start();                          // start clock
+
+	
+	// We use only one motor instance and reuse it for each panel
+	AMCSerialPort* pPort = g_pPort[ m_pPanel->port()-1 ];
+	AMCMotor* pMotor = new AMCMotor( pPort );
+
+	try
+	{
+		int x = m_pPanel->getRefX();
+		int y = m_pPanel->getRefY();
+		if( x >= 0 )
+			x -= 1500;
+		else
+			x += 1500;
+		if( y >= 0 )
+			y -= 1500;
+		else
+			y += 1500;
+	  x -= m_pPanel->getX();
+	  y -= m_pPanel->getY();
+
+		int steps = MAX( abs(x), abs(y) );
+		if( ! ((x == 0) && (y == 0)) )			// only move is necesary
+		{
+			pMotor->unselectBox();
+			pMotor->selectBox( m_pPanel->box() );
+			pMotor->selectDriver( m_pPanel->driver() );
+			pMotor->getFrequency();
+			pMotor->moveMotors(x,y);
+			pMotor->waitForMotors( pMotor->calcTimeout(steps) );
+			m_pPanel->setX( m_pPanel->getX() + x );
+			m_pPanel->setY( m_pPanel->getY() + y );
+		}
+	}
+	catch( AMCError& e )
+	{
+		qsMsg.sprintf( "AMCError: Panel (%d,%d)  Port: %d, Box:%d, Driver:%d -- ",
+			       				m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+		qsMsg.append( e.getErrorText() );
+		QThread::postEvent( m_pReceiver, new ThreadErrorEvent( qsMsg, e ) );
+		
+	}
+	delete pMotor;
+
+	qsMsg.sprintf( "Time: %dms", t.elapsed() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+	QThread::postEvent( m_pReceiver, new QCustomEvent( PROGRESS_EVENT ) );
+
+}
+
+void FocusThread::setPanel(AMCMirrorPanel* p_pPanel)
+{
+	m_pPanel = p_pPanel;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/focusthread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/focusthread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/focusthread.h	(revision 3401)
@@ -0,0 +1,29 @@
+// focusthread.h: Schnittstelle für die Klasse DefocusThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef FOCUSTHREAD_H
+#define FOCUSTHREAD_H
+
+
+#include <qthread.h>
+
+class AMCMirrorPanel;
+
+class FocusThread : public QThread
+{
+
+public:
+	void setPanel( AMCMirrorPanel* p_pPanel );
+	AMCMirrorPanel* getPanel() { return m_pPanel; };
+	FocusThread( QObject* p_pReceiver );
+	virtual ~FocusThread();
+
+protected:
+	virtual void run();
+private:
+	AMCMirrorPanel* m_pPanel;
+	QObject*				m_pReceiver;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/frameevent.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/frameevent.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/frameevent.cpp	(revision 3401)
@@ -0,0 +1,20 @@
+// frameevent.cpp: Implementierung der Klasse FrameEvent.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "frameevent.h"
+#include <qpixmap.h>
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+FrameEvent::FrameEvent( int p_iI, int p_iJ, int p_iX, int p_iY )
+	: QCustomEvent( FRAME_EVENT ),
+		m_iI( p_iI ), m_iJ( p_iJ ), m_iX( p_iX ), m_iY( p_iY )
+{
+}
+
+FrameEvent::~FrameEvent()
+{
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/frameevent.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/frameevent.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/frameevent.h	(revision 3401)
@@ -0,0 +1,32 @@
+// frameevent.h: Schnittstelle für die Klasse FrameEvent.
+//
+//////////////////////////////////////////////////////////////////////
+
+
+#ifndef FRAMEEVENT_H
+#define FRAMEEVENT_H
+
+#include "eventdefs.h"
+
+class QPixmap;
+
+
+class FrameEvent : public QCustomEvent
+{
+public:
+	FrameEvent( int p_iI, int p_iJ, int p_iX, int p_iJ );
+	virtual ~FrameEvent();
+	int getI() { return m_iI; };
+	int getJ() { return m_iJ; };
+	int getX() { return m_iX; };
+	int getY() { return m_iY; };
+
+private:
+	int				m_iI;
+	int				m_iJ;
+	int				m_iX;
+	int				m_iY;
+
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/heatstate.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/heatstate.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/heatstate.cpp	(revision 3401)
@@ -0,0 +1,62 @@
+/***************************************************************************
+                          heatstate.cpp  -  description
+                             -------------------
+    begin                : Sat Aug 23 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "heatstate.h"
+
+HEATState::HEATState(QWidget *parent, const char *name ) : QWidget(parent,name)
+{
+	m_qsStateTxtTable[HEAT_STATE_ERROR]         = new QString( "Heating error" );
+	m_qsStateTxtTable[HEAT_STATE_ON]            = new QString( "Heating is on" );
+	m_qsStateTxtTable[HEAT_STATE_OFF]           = new QString( "Heating is off" );
+	m_qsStateTxtTable[HEAT_STATE_DEICING]       = new QString( "Deicinng" );
+	m_qsStateTxtTable[HEAT_STATE_NOT_AVAILABLE] = new QString( "Heating has no connection to CC" );
+	m_qsStateTxtTable[HEAT_STATE_UNKNOWN]		    = new QString( "Heating is in an unknown state." );
+}
+
+HEATState::~HEATState(){
+}
+
+/** Set the state. */
+void HEATState::setState( int p_iState )
+{
+  // if the new state is equal to the actual state we
+  // do nothing.
+	if( p_iState == m_iState )
+		return;
+
+	int iOldState = m_iState;
+	m_iState = p_iState;
+
+	emit stateChanged( iOldState, m_iState );
+}
+
+/** Return the actual state. */
+int HEATState::getState() const
+{
+	return m_iState;
+}
+
+/** Get a textual description of the state. */
+const QString& HEATState::getText( int p_iState ) const
+{
+	if ( ( p_iState < HEAT_STATE_ERROR )
+				||
+			 ( p_iState > HEAT_STATE_NOT_AVAILABLE ) )
+		return( *m_qsStateTxtTable[ HEAT_STATE_UNKNOWN ] );
+	else
+		return( *m_qsStateTxtTable[ p_iState ] );
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/heatstate.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/heatstate.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/heatstate.h	(revision 3401)
@@ -0,0 +1,57 @@
+/***************************************************************************
+                          heatstate.h  -  description
+                             -------------------
+    begin                : Sat Aug 23 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef HEATSTATE_H
+#define HEATSTATE_H
+
+#include <qwidget.h>
+
+#define HEAT_STATE_ERROR		      	       0
+#define HEAT_STATE_OFF  	                 1
+#define HEAT_STATE_ON                		   3
+#define HEAT_STATE_DEICING                 4
+#define HEAT_STATE_NOT_AVAILABLE           9
+#define HEAT_STATE_UNKNOWN								10
+
+/**
+  *@author Martin Merck
+  */
+
+class HEATState : public QWidget  {
+   Q_OBJECT
+public: 
+	HEATState(QWidget *parent=0, const char *name=0);
+	~HEATState();
+  /** Return the actual state. */
+  int getState() const;
+  /** Set the state. */
+  void setState( int p_iState );
+  /** Get a textual description of the state. */
+  const QString& getText( int p_iState ) const;
+
+private: // Private attributes
+  /** Variable holding the actual state. */
+  int m_iState;
+  /**  */
+  QString* m_qsStateTxtTable[11];
+
+signals: // Signals
+  /** Signal emitted when the state changes. */
+  void stateChanged( int p_iOldState, int p_iNewState );
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/heatstate.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/heatstate.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/heatstate.moc.cpp	(revision 3401)
@@ -0,0 +1,132 @@
+/****************************************************************************
+** HEATState meta object code from reading C++ file 'heatstate.h'
+**
+** Created: Fri Feb 6 01:34:45 2004
+**      by: The Qt MOC ($Id: heatstate.moc.cpp,v 1.1 2004-03-04 16:31:18 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "heatstate.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *HEATState::className() const
+{
+    return "HEATState";
+}
+
+QMetaObject *HEATState::metaObj = 0;
+
+void HEATState::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QWidget::className(), "QWidget") != 0 )
+	badSuperclassWarning("HEATState","QWidget");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString HEATState::tr(const char* s)
+{
+    return qApp->translate( "HEATState", s, 0 );
+}
+
+QString HEATState::tr(const char* s, const char * c)
+{
+    return qApp->translate( "HEATState", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* HEATState::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QWidget::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    QMetaData::Access *slot_tbl_access = 0;
+    typedef void (HEATState::*m2_t0)(int,int);
+    typedef void (QObject::*om2_t0)(int,int);
+    m2_t0 v2_0 = &HEATState::stateChanged;
+    om2_t0 ov2_0 = (om2_t0)v2_0;
+    QMetaData *signal_tbl = QMetaObject::new_metadata(1);
+    signal_tbl[0].name = "stateChanged(int,int)";
+    signal_tbl[0].ptr = (QMember)ov2_0;
+    metaObj = QMetaObject::new_metaobject(
+	"HEATState", "QWidget",
+	0, 0,
+	signal_tbl, 1,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
+
+#include <qobjectdefs.h>
+#include <qsignalslotimp.h>
+
+// SIGNAL stateChanged
+void HEATState::stateChanged( int t0, int t1 )
+{
+    // No builtin function for signal parameter type int,int
+    QConnectionList *clist = receivers("stateChanged(int,int)");
+    if ( !clist || signalsBlocked() )
+	return;
+    typedef void (QObject::*RT0)();
+    typedef void (QObject::*RT1)(int);
+    typedef void (QObject::*RT2)(int,int);
+    RT0 r0;
+    RT1 r1;
+    RT2 r2;
+    QConnectionListIt it(*clist);
+    QConnection   *c;
+    QSenderObject *object;
+    while ( (c=it.current()) ) {
+	++it;
+	object = (QSenderObject*)c->object();
+	object->setSender( this );
+	switch ( c->numArgs() ) {
+	    case 0:
+#ifdef Q_FP_CCAST_BROKEN
+		r0 = reinterpret_cast<RT0>(*(c->member()));
+#else
+		r0 = (RT0)*(c->member());
+#endif
+		(object->*r0)();
+		break;
+	    case 1:
+#ifdef Q_FP_CCAST_BROKEN
+		r1 = reinterpret_cast<RT1>(*(c->member()));
+#else
+		r1 = (RT1)*(c->member());
+#endif
+		(object->*r1)(t0);
+		break;
+	    case 2:
+#ifdef Q_FP_CCAST_BROKEN
+		r2 = reinterpret_cast<RT2>(*(c->member()));
+#else
+		r2 = (RT2)*(c->member());
+#endif
+		(object->*r2)(t0, t1);
+		break;
+	}
+    }
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.cpp	(revision 3401)
@@ -0,0 +1,354 @@
+// laseradjustthread.cpp: Implementierung der Klasse LaserThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "laseradjustthread.h"
+#include "motorthreaddialog.h"
+#include "threadevent.h"
+#include "amcdefs.h"
+#include "amcframegrabber.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcserialport.h"
+#include "amcerror.h"
+#include "amcerrors.h"
+#include "videospot.h"
+#include <qmessagebox.h>
+#include <qevent.h>
+#include <qthread.h>
+#include <qstring.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern AMCSerialPort* g_pPort[];
+extern AMCFrameGrabber* g_pFG;
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+LaserAdjustThread::LaserAdjustThread( QObject* p_pReceiver )
+	: m_pPanel( NULL ), m_pReceiver( p_pReceiver ), m_zOn( false )
+{
+	m_qlSpotList.setAutoDelete( true );
+	m_qlSpots.setAutoDelete( true );
+}
+
+LaserAdjustThread::~LaserAdjustThread()
+{
+}
+
+void LaserAdjustThread::run()
+{
+	QString qsMsg;
+	qsMsg.sprintf( "Panel (%d,%d) at Port: %d, Box:%d, Driver:%d",
+			           m_pPanel->i(), m_pPanel->j(),
+                 m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+
+	QTime t;
+	t.start();                          // start clock
+
+	// We use only one motor instance and reuse it for each panel
+	AMCSerialPort* pPort = g_pPort[ m_pPanel->port()-1 ];
+	AMCMotor* pMotor = new AMCMotor( pPort );
+
+	try
+	{
+		pMotor->unselectBox();
+    usleep(1000);
+		pMotor->selectBox( m_pPanel->box() );
+		pMotor->selectDriver( m_pPanel->driver() );
+		pMotor->getFrequency();
+		pMotor->switchLaser( true );
+		m_pPanel->setLaserOn( true );
+
+		for( int i=0; i<2; i++ )
+		{
+			getSpot();
+
+//			qsMsg.sprintf( "Spot at: %d,%d",
+//				       		   m_iSpotX, m_iSpotY );
+//			QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+
+    	if( m_iSpotX != -1 )
+    	{
+				int x,y;
+				calcSteps( x, y );
+
+				int steps = MAX( abs(x), abs(y) );
+				if( ! ((x == 0) && (y == 0)) )			// only move is necesary
+				{
+					// check that the movement is in the allowed range
+          // of the motors (-2500 - 2500)
+					if( ( abs(x + m_pPanel->getX()) > 2500 )
+							||
+						  ( abs(y + m_pPanel->getY()) > 2500 ) )
+            break;
+
+					pMotor->moveMotors(x,y);
+					pMotor->waitForMotors( pMotor->calcTimeout(steps) );
+
+					m_pPanel->setX( m_pPanel->getX() + x );
+					m_pPanel->setY( m_pPanel->getY() + y );
+				}
+			}
+    }
+
+		// check if the laser adjustment converged
+ 		double dX,dY;
+		getSpot();
+		getDistToRef(dX, dY);
+
+		pMotor->switchLaser( false );
+		m_pPanel->setLaserOn( false );
+
+		if( (dX > 1.5) || (dY > 1.5) )
+		{
+			AMCError aErr( IDS_ERROR_NO_CONVERGENCE );
+			throw aErr;
+		}
+	}
+	catch( AMCError& e )
+  {
+
+		qsMsg.sprintf( "AMCError: Panel (%d,%d) Port: %d, Box:%d, Driver:%d -- ",
+			       				m_pPanel->i(), m_pPanel->j(),
+										m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+		QThread::postEvent( m_pReceiver, new ThreadErrorEvent( qsMsg, e ) );
+
+    try
+		{
+			pMotor->resetBox();
+//			pMotor->unselectBox();
+			pMotor->selectBox( m_pPanel->box() );
+			pMotor->selectDriver( m_pPanel->driver() );
+			pMotor->switchLaser( false );
+			m_pPanel->setLaserOn( false );
+			pMotor->unselectBox();
+		}
+    catch( AMCError& e2 ){}
+	}
+	delete pMotor;
+
+
+//	qsMsg.sprintf( "Time: %dms", t.elapsed() );
+//	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+	QThread::postEvent( m_pReceiver, new QCustomEvent( PROGRESS_EVENT ) );
+}
+
+void LaserAdjustThread::setPanel(AMCMirrorPanel* p_pPanel)
+{
+	m_pPanel = p_pPanel;
+}
+
+/** Calculate the location of the central pixel. We do this by identifiying the
+    position of the camera LEDs and getting the relative offsets. */
+void LaserAdjustThread::calcCenter()
+{
+  double dX = 0.0, dX1 = 0.0, dX2 = 0.0, dX3 = 0.0, dX4 = 0.0;
+  double dY = 0.0, dY1 = 0.0, dY2 = 0.0, dY3 = 0.0, dY4 = 0.0;
+  int iNumLEDs = 0;
+
+  m_iCenterX = m_iCenterY = 1;
+  m_qlSpots.clear();
+
+	for( VideoSpot* pActualSpot = m_qlSpotList.first();
+	  	 pActualSpot; pActualSpot = m_qlSpotList.next() )
+	{
+    // Check if this spot is compatible with the spot of the
+		// upper left LED
+    if ( pActualSpot->contains( LED1_X, LED1_Y ) )
+		{
+			dX1 = pActualSpot->getX() + (CAMERA_X - LED1_X);	
+			dY1 = pActualSpot->getY() + (CAMERA_Y - LED1_Y);
+			dX += dX1; dY += dY1;
+      iNumLEDs++;
+		}	
+    // Check if this spot is compatible with the spot of the
+		// upper right LED
+    else if ( pActualSpot->contains( LED2_X, LED2_Y ) )
+		{
+			dX2 = pActualSpot->getX() + (CAMERA_X - LED2_X);	
+			dY2 = pActualSpot->getY() + (CAMERA_Y - LED2_Y);
+			dX += dX2; dY += dY2;
+      iNumLEDs++;
+		}	
+    // Check if this spot is compatible with the spot of the
+		// lower left LED
+    else if ( pActualSpot->contains( LED3_X, LED3_Y ) )
+		{
+			dX3 = pActualSpot->getX() + (CAMERA_X - LED3_X);	
+			dY3 = pActualSpot->getY() + (CAMERA_Y - LED3_Y);
+			dX += dX3; dY += dY3;
+      iNumLEDs++;
+		}	
+    // Check if this spot is compatible with the spot of the
+		// lower right LED
+    else if ( pActualSpot->contains( LED4_X, LED4_Y ) )
+		{
+			dX4 = pActualSpot->getX() + (CAMERA_X - LED4_X);	
+			dY4 = pActualSpot->getY() + (CAMERA_Y - LED4_Y);
+			dX += dX4; dY += dY4;
+      iNumLEDs++;
+		}
+    else
+			m_qlSpots.append( new VideoSpot( pActualSpot->getX(), pActualSpot->getY()) );
+  }
+  if( iNumLEDs != 0)
+	{
+		m_iCenterX = (int) rint(dX / iNumLEDs);	
+		m_iCenterY = (int) rint(dY / iNumLEDs);	
+	}
+//  qDebug("Center at: %d %d -- with %d LEDs",m_iCenterX, m_iCenterY, iNumLEDs );
+}
+
+/** No descriptions */
+void LaserAdjustThread::getDistToRef( double& p_dX, double& p_dY )
+{
+	int iRefX = m_pPanel->getLaserX();
+	int iRefY = m_pPanel->getLaserY();
+
+	// Adapt spot for shift of camera center.
+	int iDx, iDy;
+  iDx = m_iCenterX - CAMERA_X;
+  iDy = m_iCenterY - CAMERA_Y;
+  m_iSpotX -= iDx;
+  m_iSpotY -= iDy;
+//	qDebug("Spot at x,y: %4d %4d", m_iSpotX, m_iSpotY );	
+
+	// Now we calculate the distance of the real spot to the stored reference position
+	p_dX = (double) (iRefX - m_iSpotX);
+	p_dY = (double) (iRefY - m_iSpotY);
+//	qDebug("Dx Dy: %4.0f %4.0f", dX, dY );	
+}
+
+/** No descriptions */
+void LaserAdjustThread::calcSteps( int& p_iX, int& p_iY )
+{
+  double dX, dY;
+	getDistToRef(dX, dY );
+
+	double dAlpha1 = atan( m_pPanel->getSlopeX() );
+	double dAlpha2 = atan( m_pPanel->getSlopeY() );
+//	qDebug("alpha1, alpha2: %7.2f %7.2f", dAlpha1 * 180.0 / 3.1415, dAlpha2 * 180.0 / 3.1415 );	
+	double dSinA1 = sin( dAlpha1 );
+	double dSinA2 = sin( dAlpha2 );
+	double dCosA1 = cos( dAlpha1 );
+	double dCosA2 = cos( dAlpha2 );
+
+	double dFacX = dX - ( dY * dCosA2 / dSinA2 );
+	dFacX /= ( dCosA1 - dSinA1 * dCosA2 / dSinA2 );
+	double dFacY = (dY - dFacX * dSinA1) / dSinA2;
+//	qDebug("Factor x,y: %8.2f %8.2f", dFacX, dFacY );	
+
+	p_iX = (int) ( dFacX * m_pPanel->getConversionX() );
+	p_iY = (int) ( dFacY * m_pPanel->getConversionY() );
+
+  // convert number of steps to an even number
+	p_iX = (p_iX >> 1) << 1;
+	p_iY = (p_iY >> 1) << 1;
+
+	qDebug("Steps till reference: %4d %4d", p_iX, p_iY );	
+  QCString qsMsg;
+	qsMsg.sprintf( "%3d %3d %3d %3d %3d %3d %3d %3d %3d %3d %5d %5d",
+				 				 m_pPanel->i(), m_pPanel->j(),
+								 m_iCenterX, m_iCenterY,
+								 m_iSpotX, m_iSpotY,
+				  			 m_pPanel->getLaserX(), m_pPanel->getLaserY(),
+								 (int) rint(dX), (int) rint(dY),
+								 p_iX, p_iY );	
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+}
+
+/** Find the Laser spot */
+void LaserAdjustThread::getSpot()
+{
+	g_pFG->grabFrame( m_pData );
+  int threshold = getThreshold();
+
+	m_qlSpotList.clear();
+	int top = LED2_Y - 10;
+	int bottom = LED3_Y + 10;
+	int left = LED1_X - 10;
+	int right = LED4_X + 10;
+
+  for (int i=top; i <bottom; i++)
+	{
+     for (int j=left; j < right ; j++)
+		{
+			int index= (j + i * MY_WIDTH) * MY_DEPTH;
+			bool zFound = false;
+			uchar data = m_pData[index];
+			if( data > threshold )
+	 		{
+				for( VideoSpot* pActualSpot = m_qlSpotList.first();
+		 				 pActualSpot; pActualSpot = m_qlSpotList.next() )
+				{
+					if( pActualSpot->contains( j, i ) )
+					{
+						pActualSpot->append( j, i, data );
+						zFound = true;
+						break;
+					}
+				}
+				if( zFound == false )
+				{
+					VideoSpot* pSpot = new VideoSpot();
+					pSpot->append( j, i, data );
+					m_qlSpotList.append( pSpot );
+				}
+
+	 		}
+		}
+	}
+  calcCenter();
+	if( m_qlSpots.count() == 1)
+	{
+		VideoSpot* pSpot = m_qlSpots.first();
+		m_iSpotX = pSpot->getX();
+		m_iSpotY = pSpot->getY();
+	}
+	else
+	{
+		m_iSpotX = -1;
+		m_iSpotY = -1;
+		if( m_qlSpots.count() == 0)
+		{
+			AMCError aErr( IDS_ERROR_NO_SPOT );
+			throw aErr;
+		}
+		else
+		{
+			AMCError aErr( IDS_ERROR_MULTI_SPOT );
+			throw aErr;
+		}
+	}
+}
+
+/** No descriptions */
+int LaserAdjustThread::getThreshold()
+{
+	double sumx =0;
+	double sumx2 = 0;
+
+	long numPixel = MY_HEIGHT * MY_WIDTH;
+	for(int ind=0; ind < ( numPixel * MY_DEPTH); ind+=MY_DEPTH)
+	{
+		double data = (double) m_pData[ind];
+		sumx += data;
+		sumx2 += data * data;
+	}
+
+	double mean = sumx / ((double) (numPixel));
+	double var = sumx2 / ((double) (numPixel)) - mean * mean;
+	double stddev = sqrt(var);
+
+  int threshold = (int) (mean + 20 * stddev);
+//	qDebug("Mean: %f StdDev: %f   Threshold %d", mean, stddev, threshold );
+	return threshold;
+}
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthread.h	(revision 3401)
@@ -0,0 +1,58 @@
+// laseradjustthread.h: Schnittstelle für die Klasse MotorThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef LASERADJUSTTHREAD_H
+#define LASERADJUSTTHREAD_H
+
+
+#include <qthread.h>
+#include <qlist.h>
+
+class AMCMirrorPanel;
+class	VideoSpot;
+
+class LaserAdjustThread : public QThread
+{
+
+public:
+	LaserAdjustThread( QObject* p_pReceiver );
+	virtual ~LaserAdjustThread();
+
+	void setPanel( AMCMirrorPanel* p_pPanel );
+	void setLaser( bool p_zOn ) { m_zOn = p_zOn; };
+	void setData( uchar* p_pData ) { m_pData = p_pData; };
+	AMCMirrorPanel* getPanel() { return m_pPanel; };
+  /** No descriptions */
+  void calcCenter();
+  /** No descriptions */
+  void calcSteps( int& p_iX, int& p_iY );
+  /** No descriptions */
+  void getDistToRef( double& p_dX, double& p_dY );
+  /** No descriptions */
+  void getSpot();
+  /** No descriptions */
+  int getThreshold();
+
+protected:
+	virtual void run();
+private:
+	AMCMirrorPanel* 	m_pPanel;
+	QObject*					m_pReceiver;
+	uchar*						m_pData;
+	bool							m_zOn;
+  /**  */
+  int								m_iCenterX;
+  /**  */
+  int								m_iCenterY;
+  /**  */
+  int								m_iSpotX;
+  /**  */
+  int								m_iSpotY;
+  /** No descriptions */
+	QList<VideoSpot>  m_qlSpotList;
+  /** No descriptions */
+	QList<VideoSpot>  m_qlSpots;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthreadcontroller.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthreadcontroller.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthreadcontroller.cpp	(revision 3401)
@@ -0,0 +1,44 @@
+// laseradjustthreadcontroller.cpp: Implementierung der Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "laseradjustthreadcontroller.h"
+#include "laseradjustthread.h"
+#include "amcmirrorpanel.h"
+#include "amcframegrabber.h"
+#include <qthread.h>
+
+extern AMCFrameGrabber* g_pFG;
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+LaserAdjustThreadController::LaserAdjustThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver )
+	: ThreadController( p_qlPanels, p_pReceiver )
+{
+	m_pData = new uchar[ g_pFG->getBuffsize()];
+}
+
+LaserAdjustThreadController::~LaserAdjustThreadController()
+{
+	delete[] m_pData;
+}
+
+void LaserAdjustThreadController::run()
+{
+	for( AMCMirrorPanel* pActualPanel = m_qlPanels.first();
+		 pActualPanel; pActualPanel = m_qlPanels.next() )
+	{
+		if( m_zStop )
+			return;
+		LaserAdjustThread* pThread = new LaserAdjustThread( m_pReceiver );
+		pThread->setPanel( pActualPanel );
+		pThread->setData( m_pData );
+		pThread->start();
+		pThread->wait();
+		delete pThread;
+	}
+
+	return;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthreadcontroller.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthreadcontroller.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laseradjustthreadcontroller.h	(revision 3401)
@@ -0,0 +1,23 @@
+// laseradjustthreadcontroller.h: Schnittstelle für die Klasse LaserThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef LASERADJUSTTHREADCONTROLLER_H
+#define LASERADJUSTTHREADCONTROLLER_H
+
+#include "threadcontroller.h"
+
+class LaserAdjustThreadController : public ThreadController
+{
+public:
+	LaserAdjustThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver );
+	virtual ~LaserAdjustThreadController();
+
+protected:
+	virtual void run();
+
+private:
+	uchar*	m_pData;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthread.cpp	(revision 3401)
@@ -0,0 +1,80 @@
+// LaserThread.cpp: Implementierung der Klasse LaserThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "laserthread.h"
+#include "motorthreaddialog.h"
+#include "threadevent.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcserialport.h"
+#include "amcerror.h"
+#include <qmessagebox.h>
+#include <qevent.h>
+#include <qthread.h>
+#include <qstring.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+extern AMCSerialPort* g_pPort[];
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+LaserThread::LaserThread( QObject* p_pReceiver )
+	: m_pPanel( NULL ), m_pReceiver( p_pReceiver ), m_zOn( false )
+{
+}
+
+LaserThread::~LaserThread()
+{
+}
+
+void LaserThread::run()
+{
+	QString qsMsg;
+	qsMsg.sprintf( "Panel (%d,%d)  Port: %d, Box:%d, Driver:%d",
+			       m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+
+	QTime t;
+	t.start();                          // start clock
+
+	
+	// We use only one motor instance and reuse it for each panel
+	AMCSerialPort* pPort = g_pPort[ m_pPanel->port()-1 ];
+	AMCMotor* pMotor = new AMCMotor( pPort );
+
+	try
+	{
+		msleep(30);
+		pMotor->unselectBox();
+		pMotor->selectBox( m_pPanel->box() );
+		pMotor->selectDriver( m_pPanel->driver() );
+		msleep(10);
+		pMotor->switchLaser( m_zOn );
+		m_pPanel->setLaserOn( m_zOn );		
+	}
+	catch( AMCError& e )
+	{
+		qsMsg.sprintf( "AMCError: Panel (%d,%d)  Port: %d, Box:%d, Driver:%d -- ",
+			       				m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+		qsMsg.append( e.getErrorText() );
+		QThread::postEvent( m_pReceiver, new ThreadErrorEvent( qsMsg, e ) );
+		pMotor->resetBox();
+	}
+	delete pMotor;
+
+	qsMsg.sprintf( "Time: %dms", t.elapsed() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+	QThread::postEvent( m_pReceiver, new QCustomEvent( PROGRESS_EVENT ) );
+
+}
+
+void LaserThread::setPanel(AMCMirrorPanel* p_pPanel)
+{
+	m_pPanel = p_pPanel;
+}
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthread.h	(revision 3401)
@@ -0,0 +1,32 @@
+// laserthread.h: Schnittstelle für die Klasse MotorThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef LASERTHREAD_H
+#define LASERTHREAD_H
+
+
+#include <qthread.h>
+
+class AMCMirrorPanel;
+
+class LaserThread : public QThread
+{
+
+public:
+	LaserThread( QObject* p_pReceiver );
+	virtual ~LaserThread();
+
+	void setPanel( AMCMirrorPanel* p_pPanel );
+	void setLaser( bool p_zOn ) { m_zOn = p_zOn; };
+	AMCMirrorPanel* getPanel() { return m_pPanel; };
+
+protected:
+	virtual void run();
+private:
+	AMCMirrorPanel* m_pPanel;
+	QObject*				m_pReceiver;
+	bool						m_zOn;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthreadcontroller.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthreadcontroller.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthreadcontroller.cpp	(revision 3401)
@@ -0,0 +1,39 @@
+// laserthreadcontroller.cpp: Implementierung der Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "laserthreadcontroller.h"
+#include "laserthread.h"
+#include "amcmirrorpanel.h"
+#include <qthread.h>
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+LaserThreadController::LaserThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver )
+	: ThreadController( p_qlPanels, p_pReceiver )
+{
+}
+
+LaserThreadController::~LaserThreadController()
+{
+}
+
+void LaserThreadController::run()
+{
+	for( AMCMirrorPanel* pActualPanel = m_qlPanels.first();
+		 pActualPanel; pActualPanel = m_qlPanels.next() )
+	{
+		if( m_zStop )
+			return;
+		LaserThread* pThread = new LaserThread( m_pReceiver );
+		pThread->setPanel( pActualPanel );
+		pThread->setLaser( m_zTrue );
+		pThread->start();
+		pThread->wait();
+		delete pThread;
+	}
+
+	return;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthreadcontroller.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthreadcontroller.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/laserthreadcontroller.h	(revision 3401)
@@ -0,0 +1,20 @@
+// LaserThreadController.h: Schnittstelle für die Klasse LaserThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef LASERTHREADCONTROLLER_H
+#define LASERTHREADCONTROLLER_H
+
+#include "threadcontroller.h"
+
+class LaserThreadController : public ThreadController
+{
+public:
+	LaserThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver );
+	virtual ~LaserThreadController();
+
+protected:
+	virtual void run();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/linearregression.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/linearregression.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/linearregression.cpp	(revision 3401)
@@ -0,0 +1,73 @@
+/***************************************************************************
+                          linearregression.cpp  -  description
+                             -------------------
+    begin                : Tue Apr 8 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "linearregression.h"
+#include <math.h>
+
+LinearRegression::LinearRegression()
+{
+	reset();
+}
+
+LinearRegression::~LinearRegression()
+{
+}
+
+void LinearRegression::reset()
+{
+	m_dSX  = 0.0;
+	m_dSXX = 0.0;
+	m_dSY  = 0.0;
+	m_dSXY = 0.0;
+	m_iNum = 0;
+}
+
+void LinearRegression::addPoint( int p_iX, int p_iY )
+{
+	if( p_iX != -1 && p_iY != -1 )
+		addPoint( (double) p_iX, (double) p_iY);
+}
+
+void LinearRegression::addPoint( double p_dX, double p_dY )
+{
+	m_dSX += p_dX;
+	m_dSXX += ( p_dX * p_dX );
+	m_dSY += p_dY;
+	m_dSXY += ( p_dX * p_dY );
+	m_iNum++;
+}
+
+double LinearRegression::getAxis()
+{
+	if( m_iNum > 0 )
+		return ( (m_dSY / m_iNum) - getSlope() * (m_dSX / m_iNum) );
+	else
+		return 0.0;
+}
+
+double LinearRegression::getSlope()
+{
+	double dSlope;
+	if( m_iNum > 0 )
+	{
+		dSlope = m_dSXY - ( m_dSX * m_dSY ) / m_iNum;
+		dSlope /= m_dSXX - ( m_dSX * m_dSX / m_iNum );
+	}
+	else
+		dSlope = 0.0;
+	return dSlope;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/linearregression.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/linearregression.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/linearregression.h	(revision 3401)
@@ -0,0 +1,46 @@
+/***************************************************************************
+                          linearregression.h  -  description
+                             -------------------
+    begin                : Tue Apr 8 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef LINEARREGRESSION_H
+#define LINEARREGRESSION_H
+
+
+/**Performs a linear regression through the points given.
+  *@author Martin Merck
+  */
+
+class LinearRegression
+{
+public: 
+	LinearRegression();
+	~LinearRegression();
+	void reset();
+	void addPoint( int p_iX, int p_iY );
+	void addPoint( double p_dX, double p_dY );
+	bool isValid() { return( ( m_iNum > 1 ) ? true : false ); };
+	double getAxis();
+	double getSlope();
+
+private:
+	double m_dSX;					// Sum over all X
+	double m_dSY; 				// Sum over all Y
+	double m_dSXY;				// Sum over all X * Y
+	double m_dSXX;				// Sum over all X^2
+	int m_iNum;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/magicmirror.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/magicmirror.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/magicmirror.cpp	(revision 3401)
@@ -0,0 +1,200 @@
+// MagicMirror.cpp: Implementierung der Klasse MagicMirror.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "amcmirrorpanel.h"
+#include "amcstate.h"
+#include "magicmirror.h"
+#include <qfile.h>
+#include <qmessagebox.h>
+#include <qtextstream.h>
+
+#define PANELFILENAME "/home/amc/Panels.txt"
+#define POSFILENAME   "/home/amc/PanelPos.txt"
+
+extern AMCState*	g_pAMCState;
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+MagicMirror::MagicMirror()
+{
+	readPanelDescription();
+	readPanelPositions();
+}
+
+MagicMirror::~MagicMirror()
+{
+	/* Make sure that when the list is deleted all AMCMirrorPanels
+	 * are also deleted.
+   */
+  for (int i=0; i<8; i++)
+		m_panelList[i].setAutoDelete( true );
+}
+
+/** Read he panel descriptions from the file "Panels.txt".
+	This file contains for each panel a line with the following contents:
+	i	j	type	port	box		driver	installed
+	
+	i: is the first panel index (counting from left to right)
+	j: is the second panel index (counting from bottom to top)
+	type: the panel type (see the file for a description of types)
+	port: the serial port this box is connected to.
+		  (The numbering corresponds to the numbers on the cables.
+		   If only 1 Meilhaus ME9100 card is installed on linux boxes
+		   we have the following correspondance to device files
+		   port 1 == /dev/ttyS4 ... port 8 = /dev/ttyS11)
+	box: the number of the AMC box.
+	driver: The internal AMC driver to which this panel is connected.
+	installed: Flag indicating if this panel is installed (0=no, 1=yes)
+*/
+
+void MagicMirror::readPanelDescription()
+{
+	
+	m_iNumPanels = 0;
+	QFile file( "/home/amc/Panels.txt" );
+	if( file.open( IO_ReadOnly ) )
+	{
+		QTextStream stream( &file );
+		QString line;
+		while( !stream.eof() )
+		{
+			line = stream.readLine();
+			if( line[0] == '#')
+				continue;
+			int ii, ij, iType, iPort, iBox, iDriver, iInst;
+			sscanf( line.data(),"%d %d %d %d %d %d %d",
+								&ii, &ij, &iType, &iPort,
+								&iBox, &iDriver, &iInst );
+			AMCMirrorPanel* pPanel = new AMCMirrorPanel( ii, ij, iType, iPort, iBox, iDriver );
+			pPanel->setInstalled(iInst != 0);
+			m_arrPanels[ii+8][ij+8] = pPanel;
+			if(iInst != 0)
+			{
+				m_iNumPanels++;
+				m_panelList[iPort-1].append( pPanel );
+				m_allPanelList.append( pPanel );
+			}
+		}
+		g_pAMCState->setInstalledPanels(m_iNumPanels);
+	}
+	else
+		qDebug("Can't open file Panels.txt");
+	file.close();
+}
+
+/** Read the stored panel positions from the file "PanelPos.txt"
+	This file contains for each panel a line with the following contents:
+	i	j	X	Y
+	
+	i: is the first panel index (counting from left to right)
+	j: is the second panel index (counting from bottom to top)
+	X: position of the X motor relative to the center position
+	Y: position of the Y motor relative to the center position
+ */
+void MagicMirror::readPanelPositions()
+{
+	QFile file( "/home/amc/PanelPos.txt" );
+	if( file.open( IO_ReadOnly ) )
+	{
+		QTextStream stream( &file );
+		QString line;
+		while( !stream.eof() )
+		{
+			line = stream.readLine();
+			
+			// Skip comment lines
+			if( line[0] == '#')
+				continue;
+				
+			int ii, ij, iX, iY, iLaserX, iLaserY;
+			double dAxisX, dSlopeX, dConvX;
+			double dAxisY, dSlopeY, dConvY;
+			sscanf( line.data(),"%d %d %d %d %d %d %lf %lf %lf %lf %lf %lf",
+								&ii, &ij, &iX, &iY, &iLaserX, &iLaserY,
+								&dAxisX, &dSlopeX, &dConvX, &dAxisY, &dSlopeY, &dConvY );
+      if( dAxisX == 0.0)
+			{
+        dSlopeX = 0.0;
+        dConvX = 0.0;
+				dAxisY = 0.0;
+        dSlopeY = 0.0;
+        dConvY = 0.0;
+ 			}
+			m_arrPanels[ii+8][ij+8]->setRefX( iX );
+			m_arrPanels[ii+8][ij+8]->setRefY( iY );
+			m_arrPanels[ii+8][ij+8]->setLaserX( iLaserX );
+			m_arrPanels[ii+8][ij+8]->setLaserY( iLaserY );
+			m_arrPanels[ii+8][ij+8]->setAxisX( dAxisX );
+			m_arrPanels[ii+8][ij+8]->setSlopeX( dSlopeX );
+			m_arrPanels[ii+8][ij+8]->setConversionX( dConvX );
+			m_arrPanels[ii+8][ij+8]->setAxisY( dAxisY );
+			m_arrPanels[ii+8][ij+8]->setSlopeY( dSlopeY );
+			m_arrPanels[ii+8][ij+8]->setConversionY( dConvY );
+		}
+	}
+	else
+		qDebug("Can't open file PanelsPos.txt");
+
+	file.close();
+	
+	return;
+}
+
+/** Save the actual panel positions to the file "PanelPos.txt"
+	This file contains for each panel a line with the following contents:
+	i	j	X	Y
+	
+	i: is the first panel index (counting from left to right)
+	j: is the second panel index (counting from bottom to top)
+	X: position of the X motor relative to the center position
+	Y: position of the Y motor relative to the center position
+ */
+void MagicMirror::saveMirrorPanels()
+{
+	QCString line;
+	
+	QFile file( POSFILENAME );
+	if( file.open( IO_WriteOnly ) )
+	{
+		QTextStream stream( &file );
+		for(int j=0; j<17; j++)
+		{
+			line.sprintf("# Column %d\n",j-8);
+			stream << line;
+			for(int i=0; i<17; i++)
+			{
+				AMCMirrorPanel* pPanel = m_arrPanels[i][j];
+				line.sprintf( " %2d %2d\t%5d\t%5d\t%5d\t%5d\t%9.2f\t%7.2f\t%10.5f\t%9.2f\t%7.2f\t%10.5f\n",
+											pPanel->i(),
+											pPanel->j(),
+											pPanel->getRefX(),
+											pPanel->getRefY(),
+											pPanel->getLaserX(),
+											pPanel->getLaserY(),
+											pPanel->getAxisX(),
+											pPanel->getSlopeX(),
+											pPanel->getConversionX(),
+											pPanel->getAxisY(),
+											pPanel->getSlopeY(),
+											pPanel->getConversionY() );
+				stream << line;
+			}
+		}
+					
+	}
+	else
+	{
+  	int iRes = QMessageBox::critical( 0,
+ 										 "Can't open panel position description file",
+										 "The programm tried to open the file \'PanelPos.txt\'\n"
+										 "in the directory \'/home/amc/\'.\n"
+										 "The file may not have the right permissions.\n",
+										 "Continue" );
+	}
+	file.close();
+					
+}
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/magicmirror.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/magicmirror.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/magicmirror.h	(revision 3401)
@@ -0,0 +1,33 @@
+// MagicMirror.h: Schnittstelle für die Klasse MagicMirror.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef MAGICMIRROR_H
+#define MAGICMIRROR_H
+
+
+#include <qlist.h>
+
+class AMCMirrorPanel;
+
+class MagicMirror  
+{
+public:
+	MagicMirror();
+	virtual ~MagicMirror();
+	AMCMirrorPanel* panelAt( int i, int j ) { return m_arrPanels[i][j]; };
+	QList<AMCMirrorPanel>& panelForPort( int iPort ) { return m_panelList[iPort]; };
+	QList<AMCMirrorPanel>& panelList( ) { return m_allPanelList; };
+	int getNumPanels() { return m_iNumPanels; };
+	void saveMirrorPanels();
+
+private:
+	int m_iNumPanels;
+	AMCMirrorPanel* m_arrPanels[17][17];
+	QList<AMCMirrorPanel> m_panelList[8];
+	QList<AMCMirrorPanel> m_allPanelList;
+	void readPanelDescription();
+	void readPanelPositions();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/main.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/main.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/main.cpp	(revision 3401)
@@ -0,0 +1,123 @@
+/***************************************************************************
+                          main.cpp  -  description
+                             -------------------
+    begin                : Wed Mar 26 14:23:48 UTC 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include <kcmdlineargs.h>
+#include <kaboutdata.h>
+#include <klocale.h>
+#include <kapp.h>
+#include <stdio.h>
+
+#include "activemirrorcontrol.h"
+#include "amcframegrabber.h"
+#include "amclog.h"
+#include "amcserialport.h"
+#include "amcstate.h"
+#include "heatstate.h"
+#include "magicmirror.h"
+
+KApplication*			g_theApp = 0;
+AMCSerialPort*		g_pPort[8];
+AMCLog*						g_pLog;
+AMCFrameGrabber*	g_pFG;
+MagicMirror*			g_theMirror;
+AMCState* 				g_pAMCState;
+HEATState* 				g_pHEATState;
+int								g_iRefX, g_iRefY;
+
+static const char *description =
+	I18N_NOOP("ActiveMirrorControl");
+// INSERT A DESCRIPTION FOR YOUR APPLICATION HERE
+	
+	
+static KCmdLineOptions options[] =
+{
+  { 0, 0, 0 }
+  // INSERT YOUR COMMANDLINE OPTIONS HERE
+};
+
+int main(int argc, char *argv[])
+{
+
+  KAboutData aboutData( "activemirrorcontrol", I18N_NOOP("ActiveMirrorControl"),
+    VERSION, description, KAboutData::License_GPL,
+    "(c) 2003, Martin Merck", 0, 0, "merck@astro.uni-wuerzburg.de");
+  aboutData.addAuthor("Martin Merck",0, "merck@astro.uni-wuerzburg.de");
+  KCmdLineArgs::init( argc, argv, &aboutData );
+  KCmdLineArgs::addCmdLineOptions( options ); // Add our own options.
+
+  KApplication a;
+	g_theApp = &a;
+	qDebug("Creating AMCLog");
+	g_pLog = new AMCLog();
+	qDebug("Creating AMCFrameGrabber");
+	g_pFG = new AMCFrameGrabber();
+	qDebug("Creating AMCState");
+	g_pAMCState = new AMCState( 0 );
+	qDebug("Creating HEATState");
+	g_pHEATState = new HEATState( 0 );
+
+	// First we open and initialize the 8 serial ports
+	char	portName[256];
+	
+	for(int i=0; i<8; i++)
+	{
+		AMCSerialPort* pPort = new AMCSerialPort();
+		// The serial ports of the Meilhaus ME9100 card
+		// begin at /dev/ttyS4 and go to /dev/ttyS11
+		sprintf( portName, "/dev/ttyS%d", i+4);
+		try
+		{
+			pPort->init( portName );
+			g_pPort[i] = pPort;
+		}
+		catch( AMCError& e )
+		{
+			QString qMsg(portName);
+			g_pLog->logError( qMsg, e );
+		}
+	}	
+	qDebug("Creating MagicMirror");
+	g_theMirror = new MagicMirror();
+	g_iRefX = -1;
+	g_iRefY = -1;
+
+	qDebug("Creating ActiveMirrorControl");
+  ActiveMirrorControl *activemirrorcontrol = new ActiveMirrorControl();
+  a.setMainWidget(activemirrorcontrol);
+  activemirrorcontrol->show();
+
+	int rc = a.exec();
+
+	qDebug("Deleting ActiveMirrorControl");
+  delete activemirrorcontrol;
+	qDebug("Deleting SerialPorts");
+	for(int i=0; i<8; i++)
+		delete g_pPort[i];
+
+	qDebug("Deleting MagicMirror");
+  delete g_theMirror;
+	qDebug("Deleting AMCState");
+	delete g_pAMCState;
+	qDebug("Deleting HeatState");
+	delete g_pHEATState;
+	qDebug("Deleting FrameGrabber");
+	delete g_pFG;
+	qDebug("Deleting AMCLog");
+  delete g_pLog;
+
+  return rc;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mainthreadcontroller.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mainthreadcontroller.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mainthreadcontroller.cpp	(revision 3401)
@@ -0,0 +1,37 @@
+// MotorThreadController.cpp: Implementierung der Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "motorthreadcontroller.h"
+#include "motorthread.h"
+#include "amcmirrorpanel.h"
+#include <qthread.h>
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+MotorThreadController::MotorThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver )
+: m_qlPanels( p_qlPanels ), m_pReceiver( p_pReceiver )
+{
+}
+
+MotorThreadController::~MotorThreadController()
+{
+
+}
+
+void MotorThreadController::run()
+{
+	for( AMCMirrorPanel* pActualPanel = m_qlPanels.first();
+		 pActualPanel; pActualPanel = m_qlPanels.next() )
+	{
+		MotorThread* pThread = new MotorThread( m_pReceiver );
+		pThread->setPanel( pActualPanel );
+		pThread->start();
+		pThread->wait();
+		delete pThread;
+	}
+
+	return;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mainthreadcontroller.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mainthreadcontroller.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mainthreadcontroller.h	(revision 3401)
@@ -0,0 +1,26 @@
+// MotorThreadController.h: Schnittstelle für die Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef MOTORTHREADCONTROLLER_H
+#define MOTORTHREADCONTROLLER_H
+
+
+#include <qthread.h>
+#include <qlist.h>
+class AMCMirrorPanel;
+
+class MotorThreadController : public QThread
+{
+public:
+	MotorThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver  );
+	virtual ~MotorThreadController();
+
+protected:
+	void run();
+private:
+	QList<AMCMirrorPanel> m_qlPanels;
+	QObject*							m_pReceiver;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mirrorselector.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mirrorselector.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mirrorselector.cpp	(revision 3401)
@@ -0,0 +1,354 @@
+/***************************************************************************
+                          mirrorselector.cpp  -  description
+                             -------------------
+    begin                : Sat Nov 23 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#include "mirrorselector.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <klocale.h>
+#include <qfile.h>
+#include <qbitmap.h>
+#include <qtextstream.h>
+#include <qpopupmenu.h>
+#include <qmessagebox.h>
+#include <qlayout.h>
+#include <qlist.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+#include "amcpushbutton.h"
+#include "amcmirrorpanel.h"
+#include "amcserialport.h"
+#include "amcprogdlg.h"
+#include "adjustmirrordlg.h"
+#include "magicmirror.h"
+#include "threadcontroller.h"
+
+#define MASKFILENAME  "/home/amc/share/amc/TypeMask.xbm"
+#define TYPE0FILENAME "/home/amc/share/amc/Type0Mirror.xbm"
+#define TYPE1FILENAME "/home/amc/share/amc/Type1Mirror.xbm"
+#define TYPE2FILENAME "/home/amc/share/amc/Type2Mirror.xbm"
+#define TYPE3FILENAME "/home/amc/share/amc/Type3Mirror.xbm"
+#define TYPE4FILENAME "/home/amc/share/amc/Type4Mirror.xbm"
+#define TYPE5FILENAME "/home/amc/share/amc/Type5Mirror.xbm"
+#define TYPE6FILENAME "/home/amc/share/amc/Type6Mirror.xbm"
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern AMCSerialPort*	g_pPort[];
+extern MagicMirror*		g_theMirror;
+
+MirrorSelector::MirrorSelector(QWidget *parent, const char *name ) : QButtonGroup(parent,name)
+{
+
+	QBitmap theMask( MASKFILENAME );
+	
+	QPixmap* pixType[7];
+	pixType[0] = new QPixmap( TYPE0FILENAME );
+	pixType[1] = new QPixmap( TYPE1FILENAME );
+	pixType[2] = new QPixmap( TYPE2FILENAME );
+	pixType[3] = new QPixmap( TYPE3FILENAME );
+	pixType[4] = new QPixmap( TYPE4FILENAME );
+	pixType[5] = new QPixmap( TYPE5FILENAME );
+	pixType[6] = new QPixmap( TYPE6FILENAME );
+	// Check if we found the files with the pixmaps
+	for(int i=0; i<7; i++)
+	{
+		if( pixType[i]->isNull() )
+		{
+	
+	   	QMessageBox::critical( this,
+   		   				"Can't open PIXMAP files for buttons",
+								"The programm didn't find the files \'Type?Mirror.xbm\'\n"
+								"We expect this file in the directory \'/home/amc/share/amc\'\n",
+								"Quit" );
+			exit(-1);									
+		}
+	}	
+	
+//	readPanelDescription();	
+//	initPanelPositions();					
+	
+  resize( 500, 500 );
+  setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1,
+   							(QSizePolicy::SizeType)1,
+   							sizePolicy().hasHeightForWidth() ) );
+  setSizeIncrement( QSize( 0, 0 ) );
+
+	
+	// create the context menu.
+	m_contextMenu = new QPopupMenu( this );
+	m_contextMenu->insertItem( "Save positions", this, SLOT( savePositionsSlot() ) );
+
+  this->setTitle( i18n( "Select a panel" ) );
+  this->setColumnLayout(0, Qt::Vertical );
+  this->layout()->setSpacing( 0 );
+  this->layout()->setMargin( 6 );
+	
+	m_mirrorGroupLayout = new QGridLayout( this->layout() );
+  m_mirrorGroupLayout->setAlignment( Qt::AlignTop );
+  m_mirrorGroupLayout->setSpacing( 0 );
+	m_mirrorGroupLayout->setMargin( 4 );
+
+	QString str;
+  int i,j;
+  for( i=8; i>=-8; i--)
+  {
+	  for( j=-8; j<=8; j++)
+	  {
+	  	if( i<0 && j>=0)
+	  		str.sprintf("Mirror_p%dn%d_Button",j,-i);
+	   	if( i>=0 && j>=0)
+	   		str.sprintf("Mirror_p%dp%d_Button",j,i);
+	   	if( i<0 && j<0)
+	   		str.sprintf("Mirror_n%dn%d_Button",-j,-i);
+	   	if( i>=0 && j<0)
+	   		str.sprintf("Mirror_n%dp%d_Button",-j,i);
+																	
+	    AMCPushButton* pButton = new AMCPushButton( this, str );
+	    m_mirrorButton[i+8][j+8] = pButton;
+	    pButton->setFlat( true );
+	    pButton->setFlat( true );
+	    pButton->setMinimumSize( QSize( 30, 30 ) );
+	    pButton->setMaximumSize( QSize( 50, 50 ) );
+	    pButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0,
+	                                         (QSizePolicy::SizeType)0,
+	                                         true ) );
+//   	pButton->setText( str.sprintf("%d,%d",j,i) );
+ 		  AMCMirrorPanel* thePanel = g_theMirror->panelAt( j+8, i+8 );
+ 		  int type = thePanel->type();
+	 		pButton->setPixmap( *pixType[type] );
+	 		if( type == 0)
+ 	   		pButton->setEnabled( false );
+			else
+			{
+			  QToolTip::add( pButton, str.sprintf("%d,%d",j,i) );
+		 		QWhatsThis::add( pButton,
+		 										 str.sprintf( "This panel is connected to port:"
+		 							 			 " %d box: %02d driver %d",
+		     							      thePanel->port(),
+		     							      thePanel->box(),
+		     							      thePanel->driver() )
+		    );
+				if( ! thePanel->isInstalled() )
+ 		   		pButton->setEnabled( false );
+			}
+			m_mirrorGroupLayout->addWidget( pButton, 16 -(i+8), j+8 );
+
+		}
+	}		
+	connect( this, SIGNAL(clicked(int)), SLOT(buttonSelectedSlot(int)) );
+
+}
+
+MirrorSelector::~MirrorSelector()
+{
+}
+
+/** No descriptions */
+void MirrorSelector::buttonSelectedSlot( int index ){
+	
+	int i = (index % 17) - 8;
+	int j = -1 * ((index / 17) - 8);
+	AMCMirrorPanel* pPanel = g_theMirror->panelAt( i+8, j+8 );
+	emit panelSelectedSignal( pPanel );
+
+}
+/** No descriptions */
+/*
+void MirrorSelector::saveMirrorPanels()
+{
+	QCString line;
+	
+	QFile file( POSFILENAME );
+	if( file.open( IO_WriteOnly ) )
+	{
+		QTextStream stream( &file );
+		for(int j=0; j<17; j++)
+		{
+			line.sprintf("# Column %d\n",j-8);
+			stream << line;
+			for(int i=0; i<17; i++)
+			{
+				line.sprintf(" %2d %2d\t%4d\t%4d\n",
+				m_Panel[i][j]->i(),
+				m_Panel[i][j]->j(),
+				m_Panel[i][j]->getX(),
+				m_Panel[i][j]->getY() );
+				stream << line;
+			}
+		}
+					
+	}
+	else
+	{
+	   	int iRes = QMessageBox::critical( this,
+   										 "Can't open panel position description file",
+										 "The programm tried to open the file \'PanelPos.txt\'\n"
+										 "in the directory \'/home/amc/\'.\n"
+										 "The file may not have the right permissions.\n",
+										 "Continue" );
+	}
+	file.close();
+					
+}
+*/
+/** Read he panel descriptions from the file "Panels.txt".
+	This file contains for each panel a line with the following contents:
+	i	j	type	port	box		driver	installed
+	
+	i: is the first panel index (counting from left to right)
+	j: is the second panel index (counting from bottom to top)
+	type: the panel type (see the file for a description of types)
+	port: the serial port this box is connected to.
+		  (The numbering corresponds to the numbers on the cables.
+		   If only 1 Meilhaus ME8100 card is installed on linux boxes
+		   we have the following correspondance to device files
+		   port 1 == /dev/ttyS4 ... port 8 = /dev/ttyS11)
+	box: the number of the AMC box.
+	driver: The internal AMC driver to which this panel is connected.
+	installed: Flag indicating if this panel is installed (0=no, 1=yes)
+*/
+/*
+void MirrorSelector::readPanelDescription(){
+	
+	m_iNumPanels = 0;
+	QFile file( PANELFILENAME );
+	if( file.open( IO_ReadOnly ) )
+	{
+		QTextStream stream( &file );
+		QString line;
+		while( !stream.eof() )
+		{
+			line = stream.readLine();
+			if( line[0] == '#')
+				continue;
+			int ii, ij, iType, iPort, iBox, iDriver, iInst;
+			sscanf( line.data(),"%d %d %d %d %d %d %d",
+								&ii, &ij, &iType, &iPort,
+								&iBox, &iDriver, &iInst );
+			m_Panel[ii+8][ij+8] = new AMCMirrorPanel( ii, ij, iType, iPort, iBox, iDriver );
+			m_Panel[ii+8][ij+8]->setInstalled(iInst != 0);
+			if(iInst != 0)
+				m_iNumPanels++;
+		}
+	}
+	else
+	{
+	   	int iRes = QMessageBox::critical( this,
+   										 "Can't open panel description file",
+										 "The programm didn't find the file \'Panels.txt\'\n"
+										 "We expect this file in the directory \'/home/amc/\'\n",
+										 "Quit" );
+		exit(-1);									
+	}
+
+	file.close();
+}
+*/
+/** Here we read the stored panel positions from the file PanelPos.txt
+	We then go through all panels, center them and go to the stored position.
+ */
+void MirrorSelector::initPanelPositions()
+{
+//	readPanelPositions();
+	
+   	int iRes = QMessageBox::warning( this,
+   									 "Lengthy operation ahead !!!",
+									 "We will now center all mirror panels and realign them\n"
+									 "to the stored positions. This operation is sequential\n"
+									 "through all mirrors and will take 15 minutes!\n"
+									 "You may choose not to center now, but this is only\n"
+									 "advisable if you now the positions are correct!\n"
+									 "Do you want to center?",
+									 "Yes",
+									 "No" );
+	if (iRes == 1)
+		return;
+	
+	QString qsMsg1("Initializing mirror panels");
+	QString qsMsg2("Centering and setting stored position.");
+	AMCProgDlg* pDialog = new AMCProgDlg( MOTOR_THREAD_CTRL, this, qsMsg1, true );
+	pDialog->setText( qsMsg2 );
+	pDialog->start();
+	pDialog->exec();
+	delete pDialog;
+
+	return;
+	
+}
+
+
+/** Read the stored panel positions from the file "PanelPos.txt"
+	This file contains for each panel a line with the following contents:
+	i	j	X	Y
+	
+	i: is the first panel index (counting from left to right)
+	j: is the second panel index (counting from bottom to top)
+	X: position of the X motor relative to the center position
+	Y: position of the Y motor relative to the center position
+ */
+/*
+void MirrorSelector::readPanelPositions()
+{
+	QFile file( POSFILENAME );
+	if( file.open( IO_ReadOnly ) )
+	{
+		QTextStream stream( &file );
+		QString line;
+		while( !stream.eof() )
+		{
+			line = stream.readLine();
+			
+			// Skip comment lines
+			if( line[0] == '#')
+				continue;
+				
+			int ii, ij, iX, iY;
+			sscanf( line.data(),"%d %d %d %d",
+								&ii, &ij, &iX, &iY );
+			m_Panel[ii+8][ij+8]->setX(iX);
+			m_Panel[ii+8][ij+8]->setY(iY);
+		}
+	}
+	else
+	{
+	   	int iRes = QMessageBox::critical( this,
+   										 "Can't open panel position description file",
+										 "The programm didn't find the file \'PanelPos.txt\'\n"
+										 "We expect this file in the directory \'/home/amc/\'\n",
+										 "Quit" );
+		exit(-1);									
+	}
+	file.close();
+	
+	return;
+}
+*/
+
+/** Save the positions to the file. */
+void MirrorSelector::savePositionsSlot()
+{
+	qDebug("MirrorSelector::savePositionsSlot");
+	g_theMirror->saveMirrorPanels();
+}
+
+/** Check to see if the right mouse button was pressed and
+	show the context menu in this case.
+  */
+void MirrorSelector::mousePressEvent( QMouseEvent* p_pEvent )
+{
+	if( p_pEvent->button() == RightButton )
+		m_contextMenu->exec( QCursor::pos() );
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mirrorselector.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mirrorselector.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mirrorselector.h	(revision 3401)
@@ -0,0 +1,108 @@
+/***************************************************************************
+                          mirrorselector.h  -  description
+                             -------------------
+    begin                : Sat Nov 23 2002
+    copyright            : (C) 2002 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.de
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   This program is part of the MAGIC control software for the AMC.       *
+ *   The software is only intended for use in the MAGIC telescope project  *
+ *   All rights remain with the author.					   *
+ ***************************************************************************/
+
+#ifndef MIRRORSELECTOR_H
+#define MIRRORSELECTOR_H
+
+#include <qbuttongroup.h>
+
+class AMCPushButton;
+class AMCMirrorPanel;
+class QGridLayout;
+
+/**This widget contains a Buttongroup for all 
+  * the mirror panels.
+  *@author Martin Merck
+  */
+
+class MirrorSelector : public QButtonGroup {
+   Q_OBJECT
+public: 
+	MirrorSelector(QWidget *parent=0, const char *name=0);
+	~MirrorSelector();
+	
+	/** No descriptions */
+//	void saveMirrorPanels();
+	/** Check to see if the right mouse button was pressed and show the context menu in this case. */
+	void mousePressEvent( QMouseEvent* p_pEvent );
+	
+public: // Public attributes
+
+	/** Array containing the buttons for the individual mirror panels */
+	AMCPushButton* m_mirrorButton[17][17];
+	/** Our own widget for selecting individual mirror panels */
+	QGridLayout* m_mirrorGroupLayout;
+	
+protected slots: // Protected slots
+
+	/** Hanling a selection of a panel by the user */
+	virtual void buttonSelectedSlot( int );
+	/** Save the positions to the file. */
+	void savePositionsSlot();
+	
+private: // Private attributes
+
+	/** Array containing the abstraction of the mirror definitions */
+	AMCMirrorPanel* m_Panel[17][17];
+	/** Number of panels really installed */
+	int m_iNumPanels;
+	/** Context menu, shown when the user hits the right mouse button.  */
+	QPopupMenu* m_contextMenu;
+	
+signals: // Signals
+
+	/** We propagate the selection with the pointer to the AMCMirrorPanel
+		datastructure as a parameter.
+	 */
+	void panelSelectedSignal( AMCMirrorPanel* );
+	
+private: // Private methods
+
+	/** Read he panel descriptions from the file "Panels.txt".
+		This file contains for each panel a line with the following contents:
+		i	j	type	port	box		driver	installed
+	
+		i: is the first panel index (counting from left to right)
+		j: is the second panel index (counting from bottom to top)
+		type: the panel type (see the file for a description of types)
+		port: the serial port this box is connected to.
+			  (The numbering corresponds to the numbers on the cables.
+			   If only 1 Meilhaus ME8100 card is installed on linux boxes
+			   we have the following correspondance to device files
+			   port 1 == /dev/ttyS4 ... port 8 = /dev/ttyS11)
+		box: the number of the AMC box.
+		driver: The internal AMC driver to which this panel is connected.
+		installed: Flag indicating if this panel is installed (0=no, 1=yes)
+	*/
+//	void readPanelDescription();
+	
+	/** Here we read the stored panel positions from the file PanelPos.txt
+		We then go through all panels, center them and go to the stored position.
+	 */
+	void initPanelPositions();
+
+	/** Read the stored panel positions from the file "PanelPos.txt"
+	    This file contains for each panel a line with the following contents:
+	    i	j	X	Y
+	
+	    i: is the first panel index (counting from left to right)
+	    j: is the second panel index (counting from bottom to top)
+	    X: position of the X motor relative to the center position
+	    Y: position of the Y motor relative to the center position
+     */
+//  void readPanelPositions();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mirrorselector.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mirrorselector.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/mirrorselector.moc.cpp	(revision 3401)
@@ -0,0 +1,137 @@
+/****************************************************************************
+** MirrorSelector meta object code from reading C++ file 'mirrorselector.h'
+**
+** Created: Thu Jan 29 00:51:40 2004
+**      by: The Qt MOC ($Id: mirrorselector.moc.cpp,v 1.1 2004-03-04 16:31:18 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "mirrorselector.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *MirrorSelector::className() const
+{
+    return "MirrorSelector";
+}
+
+QMetaObject *MirrorSelector::metaObj = 0;
+
+void MirrorSelector::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QButtonGroup::className(), "QButtonGroup") != 0 )
+	badSuperclassWarning("MirrorSelector","QButtonGroup");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString MirrorSelector::tr(const char* s)
+{
+    return qApp->translate( "MirrorSelector", s, 0 );
+}
+
+QString MirrorSelector::tr(const char* s, const char * c)
+{
+    return qApp->translate( "MirrorSelector", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* MirrorSelector::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QButtonGroup::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (MirrorSelector::*m1_t0)(int);
+    typedef void (QObject::*om1_t0)(int);
+    typedef void (MirrorSelector::*m1_t1)();
+    typedef void (QObject::*om1_t1)();
+    m1_t0 v1_0 = &MirrorSelector::buttonSelectedSlot;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &MirrorSelector::savePositionsSlot;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(2);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(2);
+    slot_tbl[0].name = "buttonSelectedSlot(int)";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Protected;
+    slot_tbl[1].name = "savePositionsSlot()";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Protected;
+    typedef void (MirrorSelector::*m2_t0)(AMCMirrorPanel*);
+    typedef void (QObject::*om2_t0)(AMCMirrorPanel*);
+    m2_t0 v2_0 = &MirrorSelector::panelSelectedSignal;
+    om2_t0 ov2_0 = (om2_t0)v2_0;
+    QMetaData *signal_tbl = QMetaObject::new_metadata(1);
+    signal_tbl[0].name = "panelSelectedSignal(AMCMirrorPanel*)";
+    signal_tbl[0].ptr = (QMember)ov2_0;
+    metaObj = QMetaObject::new_metaobject(
+	"MirrorSelector", "QButtonGroup",
+	slot_tbl, 2,
+	signal_tbl, 1,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
+
+#include <qobjectdefs.h>
+#include <qsignalslotimp.h>
+
+// SIGNAL panelSelectedSignal
+void MirrorSelector::panelSelectedSignal( AMCMirrorPanel* t0 )
+{
+    // No builtin function for signal parameter type AMCMirrorPanel*
+    QConnectionList *clist = receivers("panelSelectedSignal(AMCMirrorPanel*)");
+    if ( !clist || signalsBlocked() )
+	return;
+    typedef void (QObject::*RT0)();
+    typedef void (QObject::*RT1)(AMCMirrorPanel*);
+    RT0 r0;
+    RT1 r1;
+    QConnectionListIt it(*clist);
+    QConnection   *c;
+    QSenderObject *object;
+    while ( (c=it.current()) ) {
+	++it;
+	object = (QSenderObject*)c->object();
+	object->setSender( this );
+	switch ( c->numArgs() ) {
+	    case 0:
+#ifdef Q_FP_CCAST_BROKEN
+		r0 = reinterpret_cast<RT0>(*(c->member()));
+#else
+		r0 = (RT0)*(c->member());
+#endif
+		(object->*r0)();
+		break;
+	    case 1:
+#ifdef Q_FP_CCAST_BROKEN
+		r1 = reinterpret_cast<RT1>(*(c->member()));
+#else
+		r1 = (RT1)*(c->member());
+#endif
+		(object->*r1)(t0);
+		break;
+	}
+    }
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthread.cpp	(revision 3401)
@@ -0,0 +1,115 @@
+// MotorThread.cpp: Implementierung der Klasse MotorThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "motorthread.h"
+#include "motorthreaddialog.h"
+#include "threadevent.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcserialport.h"
+#include "amcerror.h"
+#include <qmessagebox.h>
+#include <qevent.h>
+#include <qthread.h>
+#include <qstring.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern AMCSerialPort* g_pPort[];
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+MotorThread::MotorThread( QObject* p_pReceiver )
+	: m_pPanel( NULL ), m_pReceiver( p_pReceiver )
+{
+}
+
+MotorThread::~MotorThread()
+{
+}
+
+void MotorThread::run()
+{
+	QString qsMsg;
+	qsMsg.sprintf( "Panel (%d,%d)  Port: %d, Box:%d, Driver:%d",
+			       m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+
+	QTime t;
+	t.start();                          // start clock
+
+	
+	// We use only one motor instance and reuse it for each panel
+	AMCSerialPort* pPort = g_pPort[ m_pPanel->port()-1 ];
+	AMCMotor* pMotor = new AMCMotor( pPort );
+
+	bool zLaser = false;
+	for( int iRetry = 0; iRetry < 2; iRetry++ )
+	{
+		try
+		{
+			pMotor->unselectBox();
+			pMotor->selectBox( m_pPanel->box() );
+			pMotor->selectDriver( m_pPanel->driver() );
+			pMotor->switchLaser( true );			// only for show
+			zLaser = true;
+			pMotor->getFrequency();
+   	
+			pMotor->centerMotors();
+			pMotor->waitForMotors( pMotor->calcTimeout( 17000 )+2 );
+			int x = m_pPanel->getRefX();
+			int y = m_pPanel->getRefY();
+			int steps = MAX( abs(x), abs(y) );
+			if( ! ((x == 0) && (y == 0)) )			// only move is necesary
+			{
+				pMotor->moveMotors(x,y);
+				pMotor->waitForMotors( pMotor->calcTimeout(steps) );
+				m_pPanel->setX( x );
+				m_pPanel->setY( y );
+			}
+			pMotor->switchLaser( false );			// only for show
+		}
+		catch( AMCError& e )
+		{
+			if( iRetry >= 1 )
+			{
+				qsMsg.sprintf( "AMCError: Panel (%d,%d)  Port: %d, Box:%d, Driver:%d -- ",
+					       				m_pPanel->i(), m_pPanel->j(), m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+				qsMsg.append( e.getErrorText() );
+				QThread::postEvent( m_pReceiver, new ThreadErrorEvent( qsMsg, e ) );
+			}
+
+			// try to switch of laser if we switched it on.
+			if( zLaser )
+			{
+				try
+				{
+					pMotor->switchLaser( false );			// only for show
+				}
+				catch( AMCError& e )
+				{
+				}
+			}
+      continue;
+		}
+    break;
+			
+	}
+	delete pMotor;
+
+	qsMsg.sprintf( "Time: %dms", t.elapsed() );
+	QThread::postEvent( m_pReceiver, new ThreadEvent( qsMsg ) );
+	QThread::postEvent( m_pReceiver, new QCustomEvent( PROGRESS_EVENT ) );
+
+}
+
+void MotorThread::setPanel(AMCMirrorPanel* p_pPanel)
+{
+	m_pPanel = p_pPanel;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthread.h	(revision 3401)
@@ -0,0 +1,29 @@
+// motorthread.h: Schnittstelle für die Klasse MotorThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef MOTORTHREAD_H
+#define MOTORTHREAD_H
+
+
+#include <qthread.h>
+
+class AMCMirrorPanel;
+
+class MotorThread : public QThread  
+{
+
+public:
+	void setPanel( AMCMirrorPanel* p_pPanel );
+	AMCMirrorPanel* getPanel() { return m_pPanel; };
+	MotorThread( QObject* p_pReceiver );
+	virtual ~MotorThread();
+
+protected:
+	virtual void run();
+private:
+	AMCMirrorPanel* m_pPanel;
+	QObject*				m_pReceiver;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreadcontroller.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreadcontroller.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreadcontroller.cpp	(revision 3401)
@@ -0,0 +1,39 @@
+// MotorThreadController.cpp: Implementierung der Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "motorthreadcontroller.h"
+#include "motorthread.h"
+#include "amcmirrorpanel.h"
+#include <qthread.h>
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+MotorThreadController::MotorThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver )
+: ThreadController( p_qlPanels, p_pReceiver )
+{
+}
+
+MotorThreadController::~MotorThreadController()
+{
+
+}
+
+void MotorThreadController::run()
+{
+	for( AMCMirrorPanel* pActualPanel = m_qlPanels.first();
+		 pActualPanel; pActualPanel = m_qlPanels.next() )
+	{
+		if( m_zStop )
+			return;
+		MotorThread* pThread = new MotorThread( m_pReceiver );
+		pThread->setPanel( pActualPanel );
+		pThread->start();
+		pThread->wait();
+		delete pThread;
+	}
+
+	return;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreadcontroller.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreadcontroller.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreadcontroller.h	(revision 3401)
@@ -0,0 +1,21 @@
+// MotorThreadController.h: Schnittstelle für die Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef MOTORTHREADCONTROLLER_H
+#define MOTORTHREADCONTROLLER_H
+
+
+#include "threadcontroller.h"
+
+class MotorThreadController : public ThreadController
+{
+public:
+	MotorThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver  );
+	virtual ~MotorThreadController();
+
+protected:
+	void run();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialog.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialog.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialog.cpp	(revision 3401)
@@ -0,0 +1,95 @@
+#include "motorthreaddialog.h"
+#include "amclog.h"
+#include "amcmirrorpanel.h"
+#include "magicmirror.h"	
+#include "motorthread.h"
+#include "motorthreadcontroller.h"
+#include "laserthread.h"
+#include "laserthreadcontroller.h"
+#include "threadevent.h"
+#include <stdlib.h>
+#include <time.h>
+#include <qpushbutton.h>
+#include <qprogressbar.h>
+#include <qdatetime.h>
+#include <qthread.h>
+#include <qmultilineedit.h>
+#include <qapplication.h>
+
+extern AMCLog* g_pLog;
+extern MagicMirror* g_theMirror;
+
+MotorThreadDialog::MotorThreadDialog( QWidget* parent, const char* name, bool modal, WFlags f )
+	: MotorThreadDlgBase( parent, name, modal, f )
+{
+	// Add your code
+	m_zOn = false;
+	ProgressBar1->setTotalSteps( g_theMirror->getNumPanels()-1 );
+	m_pThreadSemaphore = new QSemaphore( 1 );
+}
+
+MotorThreadDialog::~MotorThreadDialog()
+{
+	delete m_pThreadSemaphore;
+}
+
+void MotorThreadDialog::startThread()
+{
+	ProgressBar1->reset();
+	(*m_pThreadSemaphore)++;
+	this->start();
+
+	return;
+}
+
+void MotorThreadDialog::outputMessage(QString p_qsMsg)
+{
+	InfoField->append( p_qsMsg );
+	InfoField->setCursorPosition( InfoField->numLines()+1, 0 );
+}
+
+void MotorThreadDialog::run()
+{
+	buttonApply->setEnabled( false );
+  QTime t;
+  t.start();                          // start clock
+
+	MotorThreadController* pTController[8];
+	for(int i=0; i<8; i++)
+	{
+		pTController[i] = new MotorThreadController( g_theMirror->panelForPort(i), this );
+		pTController[i]->start();
+	}
+
+	for(int i=0; i<8; i++) {
+		pTController[i]->wait();
+		delete pTController[i];
+	}
+
+	QString qsMsg;
+	qsMsg.sprintf( "Total Time: %dms", t.elapsed() );
+	QThread::postEvent( this, new ThreadEvent( qsMsg ) );
+
+	buttonApply->setEnabled( true );
+	(*m_pThreadSemaphore)--;
+
+}
+
+void MotorThreadDialog::customEvent(QCustomEvent *e)
+{
+  if ( e->type() == THREAD_EVENT )
+	{
+		ThreadEvent* te = (ThreadEvent*)e;
+		outputMessage( te->getMessage() );
+
+	}
+  if ( e->type() == THREAD_ERROR_EVENT )
+	{
+		ThreadErrorEvent* tee = (ThreadErrorEvent*)e;
+		outputMessage( tee->getMessage() );
+		g_pLog->logError( tee->getMessage(), tee->getError() );
+	}
+  if ( e->type() == PROGRESS_EVENT )
+		ProgressBar1->setProgress( ProgressBar1->progress()+1 );
+
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialog.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialog.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialog.h	(revision 3401)
@@ -0,0 +1,40 @@
+// MotorThreadDialog.h: Schnittstelle für die Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef MOTORTHREADDIALOG_H
+#define MOTORTHREADDIALOG_H
+
+
+#include "motorthreaddialogbase.h"
+#include <qlist.h>
+#include <qthread.h>
+
+#define MAX_THREADS 8
+
+//class MagicMirror;
+class MotorThreadController;
+class QSemaphore;
+
+class MotorThreadDialog : public MotorThreadDlgBase, public QThread
+{
+	Q_OBJECT
+public:
+	MotorThreadDialog( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags f = 0 );
+	~MotorThreadDialog();
+
+public slots:
+    void startThread();
+
+public:
+	void customEvent( QCustomEvent* e );
+	void outputMessage( QString p_qsMsg );
+
+private:
+	QSemaphore* m_pThreadSemaphore;
+	bool m_zOn;
+protected:
+	virtual void run();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialog.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialog.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialog.moc.cpp	(revision 3401)
@@ -0,0 +1,81 @@
+/****************************************************************************
+** MotorThreadDialog meta object code from reading C++ file 'motorthreaddialog.h'
+**
+** Created: Thu Jan 29 00:51:44 2004
+**      by: The Qt MOC ($Id: motorthreaddialog.moc.cpp,v 1.1 2004-03-04 16:31:18 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "motorthreaddialog.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *MotorThreadDialog::className() const
+{
+    return "MotorThreadDialog";
+}
+
+QMetaObject *MotorThreadDialog::metaObj = 0;
+
+void MotorThreadDialog::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(MotorThreadDlgBase::className(), "MotorThreadDlgBase") != 0 )
+	badSuperclassWarning("MotorThreadDialog","MotorThreadDlgBase");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString MotorThreadDialog::tr(const char* s)
+{
+    return qApp->translate( "MotorThreadDialog", s, 0 );
+}
+
+QString MotorThreadDialog::tr(const char* s, const char * c)
+{
+    return qApp->translate( "MotorThreadDialog", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* MotorThreadDialog::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) MotorThreadDlgBase::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (MotorThreadDialog::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    m1_t0 v1_0 = &MotorThreadDialog::startThread;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(1);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(1);
+    slot_tbl[0].name = "startThread()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"MotorThreadDialog", "MotorThreadDlgBase",
+	slot_tbl, 1,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.cpp	(revision 3401)
@@ -0,0 +1,151 @@
+#include <klocale.h>
+/****************************************************************************
+** Form implementation generated from reading ui file './motorthreaddialogbase.ui'
+**
+** Created: Fri Feb 6 20:39:15 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "motorthreaddialogbase.h"
+
+#include <qlabel.h>
+#include <qmultilineedit.h>
+#include <qprogressbar.h>
+#include <qpushbutton.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/* 
+ *  Constructs a MotorThreadDlgBase which is a child of 'parent', with the 
+ *  name 'name' and widget flags set to 'f' 
+ *
+ *  The dialog will by default be modeless, unless you set 'modal' to
+ *  TRUE to construct a modal dialog.
+ */
+MotorThreadDlgBase::MotorThreadDlgBase( QWidget* parent,  const char* name, bool modal, WFlags fl )
+    : QDialog( parent, name, modal, fl )
+{
+    if ( !name )
+	setName( "MotorThreadDlgBase" );
+    resize( 602, 483 ); 
+    setCaption( i18n( "MotorThread" ) );
+    setSizeGripEnabled( TRUE );
+    MotorThreadDlgBaseLayout = new QVBoxLayout( this ); 
+    MotorThreadDlgBaseLayout->setSpacing( 6 );
+    MotorThreadDlgBaseLayout->setMargin( 11 );
+
+    InfoField = new QMultiLineEdit( this, "InfoField" );
+    QPalette pal;
+    QColorGroup cg;
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 223, 223, 223) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 0, 170, 0) );
+    cg.setColor( QColorGroup::BrightText, QColor( 0, 255, 0) );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 190, 190, 190) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setActive( cg );
+    cg.setColor( QColorGroup::Foreground, black );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 0, 170, 0) );
+    cg.setColor( QColorGroup::BrightText, QColor( 0, 255, 0) );
+    cg.setColor( QColorGroup::ButtonText, black );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 190, 190, 190) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setInactive( cg );
+    cg.setColor( QColorGroup::Foreground, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Button, QColor( 192, 192, 192) );
+    cg.setColor( QColorGroup::Light, white );
+    cg.setColor( QColorGroup::Midlight, QColor( 220, 220, 220) );
+    cg.setColor( QColorGroup::Dark, QColor( 96, 96, 96) );
+    cg.setColor( QColorGroup::Mid, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Text, QColor( 0, 170, 0) );
+    cg.setColor( QColorGroup::BrightText, QColor( 0, 255, 0) );
+    cg.setColor( QColorGroup::ButtonText, QColor( 128, 128, 128) );
+    cg.setColor( QColorGroup::Base, black );
+    cg.setColor( QColorGroup::Background, QColor( 190, 190, 190) );
+    cg.setColor( QColorGroup::Shadow, black );
+    cg.setColor( QColorGroup::Highlight, QColor( 0, 0, 128) );
+    cg.setColor( QColorGroup::HighlightedText, white );
+    pal.setDisabled( cg );
+    InfoField->setPalette( pal );
+    InfoField->setCursor( QCursor( 0 ) );
+    InfoField->setAcceptDrops( FALSE );
+    InfoField->setFrameShape( QMultiLineEdit::WinPanel );
+    InfoField->setFrameShadow( QMultiLineEdit::Sunken );
+    InfoField->setReadOnly( TRUE );
+    QToolTip::add(  InfoField, i18n( "Task Information" ) );
+    MotorThreadDlgBaseLayout->addWidget( InfoField );
+
+    Layout2 = new QHBoxLayout; 
+    Layout2->setSpacing( 6 );
+    Layout2->setMargin( 0 );
+
+    TextLabel1 = new QLabel( this, "TextLabel1" );
+    TextLabel1->setText( i18n( "Progress:" ) );
+    Layout2->addWidget( TextLabel1 );
+
+    ProgressBar1 = new QProgressBar( this, "ProgressBar1" );
+    Layout2->addWidget( ProgressBar1 );
+    MotorThreadDlgBaseLayout->addLayout( Layout2 );
+
+    Layout3 = new QHBoxLayout; 
+    Layout3->setSpacing( 6 );
+    Layout3->setMargin( 0 );
+
+    buttonApply = new QPushButton( this, "buttonApply" );
+    buttonApply->setText( i18n( "&Apply" ) );
+    buttonApply->setAutoDefault( TRUE );
+    Layout3->addWidget( buttonApply );
+    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout3->addItem( spacer );
+
+    buttonOk = new QPushButton( this, "buttonOk" );
+    buttonOk->setText( i18n( "&OK" ) );
+    buttonOk->setAutoDefault( TRUE );
+    buttonOk->setDefault( TRUE );
+    Layout3->addWidget( buttonOk );
+
+    buttonCancel = new QPushButton( this, "buttonCancel" );
+    buttonCancel->setText( i18n( "&Cancel" ) );
+    buttonCancel->setAutoDefault( TRUE );
+    Layout3->addWidget( buttonCancel );
+    MotorThreadDlgBaseLayout->addLayout( Layout3 );
+
+    // signals and slots connections
+    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
+    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
+    connect( buttonApply, SIGNAL( clicked() ), this, SLOT( startThread() ) );
+}
+
+/*  
+ *  Destroys the object and frees any allocated resources
+ */
+MotorThreadDlgBase::~MotorThreadDlgBase()
+{
+    // no need to delete child widgets, Qt does it all for us
+}
+
+void MotorThreadDlgBase::startThread()
+{
+    qWarning( "MotorThreadDlgBase::startThread(): Not implemented yet!" );
+}
+
+#include "motorthreaddialogbase.moc"
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.h	(revision 3401)
@@ -0,0 +1,46 @@
+/****************************************************************************
+** Form interface generated from reading ui file './motorthreaddialogbase.ui'
+**
+** Created: Fri Feb 6 20:39:00 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef MOTORTHREADDLGBASE_H
+#define MOTORTHREADDLGBASE_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+class QVBoxLayout; 
+class QHBoxLayout; 
+class QGridLayout; 
+class QLabel;
+class QMultiLineEdit;
+class QProgressBar;
+class QPushButton;
+
+class MotorThreadDlgBase : public QDialog
+{ 
+    Q_OBJECT
+
+public:
+    MotorThreadDlgBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+    ~MotorThreadDlgBase();
+
+    QMultiLineEdit* InfoField;
+    QLabel* TextLabel1;
+    QProgressBar* ProgressBar1;
+    QPushButton* buttonApply;
+    QPushButton* buttonOk;
+    QPushButton* buttonCancel;
+
+public slots:
+    virtual void startThread();
+
+protected:
+    QVBoxLayout* MotorThreadDlgBaseLayout;
+    QHBoxLayout* Layout2;
+    QHBoxLayout* Layout3;
+};
+
+#endif // MOTORTHREADDLGBASE_H
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.moc
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.moc	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.moc	(revision 3401)
@@ -0,0 +1,81 @@
+/****************************************************************************
+** MotorThreadDlgBase meta object code from reading C++ file 'motorthreaddialogbase.h'
+**
+** Created: Fri Feb 6 20:39:15 2004
+**      by: The Qt MOC ($Id: motorthreaddialogbase.moc,v 1.1 2004-03-04 16:31:18 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "motorthreaddialogbase.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *MotorThreadDlgBase::className() const
+{
+    return "MotorThreadDlgBase";
+}
+
+QMetaObject *MotorThreadDlgBase::metaObj = 0;
+
+void MotorThreadDlgBase::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QDialog::className(), "QDialog") != 0 )
+	badSuperclassWarning("MotorThreadDlgBase","QDialog");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString MotorThreadDlgBase::tr(const char* s)
+{
+    return qApp->translate( "MotorThreadDlgBase", s, 0 );
+}
+
+QString MotorThreadDlgBase::tr(const char* s, const char * c)
+{
+    return qApp->translate( "MotorThreadDlgBase", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* MotorThreadDlgBase::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QDialog::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (MotorThreadDlgBase::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    m1_t0 v1_0 = &MotorThreadDlgBase::startThread;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(1);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(1);
+    slot_tbl[0].name = "startThread()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"MotorThreadDlgBase", "QDialog",
+	slot_tbl, 1,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.ui
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.ui	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/motorthreaddialogbase.ui	(revision 3401)
@@ -0,0 +1,432 @@
+<!DOCTYPE UI><UI>
+<class>MotorThreadDlgBase</class>
+<widget>
+    <class>QDialog</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>MotorThreadDlgBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>602</width>
+            <height>483</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>MotorThread</string>
+    </property>
+    <property stdset="1">
+        <name>sizeGripEnabled</name>
+        <bool>true</bool>
+    </property>
+    <vbox>
+        <property stdset="1">
+            <name>margin</name>
+            <number>11</number>
+        </property>
+        <property stdset="1">
+            <name>spacing</name>
+            <number>6</number>
+        </property>
+        <widget>
+            <class>QMultiLineEdit</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>InfoField</cstring>
+            </property>
+            <property stdset="1">
+                <name>palette</name>
+                <palette>
+                    <active>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>192</red>
+                            <green>192</green>
+                            <blue>192</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                        <color>
+                            <red>223</red>
+                            <green>223</green>
+                            <blue>223</blue>
+                        </color>
+                        <color>
+                            <red>96</red>
+                            <green>96</green>
+                            <blue>96</blue>
+                        </color>
+                        <color>
+                            <red>128</red>
+                            <green>128</green>
+                            <blue>128</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>170</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>255</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>190</red>
+                            <green>190</green>
+                            <blue>190</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>128</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                    </active>
+                    <disabled>
+                        <color>
+                            <red>128</red>
+                            <green>128</green>
+                            <blue>128</blue>
+                        </color>
+                        <color>
+                            <red>192</red>
+                            <green>192</green>
+                            <blue>192</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                        <color>
+                            <red>220</red>
+                            <green>220</green>
+                            <blue>220</blue>
+                        </color>
+                        <color>
+                            <red>96</red>
+                            <green>96</green>
+                            <blue>96</blue>
+                        </color>
+                        <color>
+                            <red>128</red>
+                            <green>128</green>
+                            <blue>128</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>170</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>255</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>128</red>
+                            <green>128</green>
+                            <blue>128</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>190</red>
+                            <green>190</green>
+                            <blue>190</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>128</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                    </disabled>
+                    <inactive>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>192</red>
+                            <green>192</green>
+                            <blue>192</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                        <color>
+                            <red>220</red>
+                            <green>220</green>
+                            <blue>220</blue>
+                        </color>
+                        <color>
+                            <red>96</red>
+                            <green>96</green>
+                            <blue>96</blue>
+                        </color>
+                        <color>
+                            <red>128</red>
+                            <green>128</green>
+                            <blue>128</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>170</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>255</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>190</red>
+                            <green>190</green>
+                            <blue>190</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>0</blue>
+                        </color>
+                        <color>
+                            <red>0</red>
+                            <green>0</green>
+                            <blue>128</blue>
+                        </color>
+                        <color>
+                            <red>255</red>
+                            <green>255</green>
+                            <blue>255</blue>
+                        </color>
+                    </inactive>
+                </palette>
+            </property>
+            <property stdset="1">
+                <name>cursor</name>
+                <cursor>0</cursor>
+            </property>
+            <property stdset="1">
+                <name>acceptDrops</name>
+                <bool>false</bool>
+            </property>
+            <property stdset="1">
+                <name>frameShape</name>
+                <enum>WinPanel</enum>
+            </property>
+            <property stdset="1">
+                <name>frameShadow</name>
+                <enum>Sunken</enum>
+            </property>
+            <property stdset="1">
+                <name>readOnly</name>
+                <bool>true</bool>
+            </property>
+            <property>
+                <name>toolTip</name>
+                <string>Task Information</string>
+            </property>
+        </widget>
+        <widget>
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout2</cstring>
+            </property>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QLabel</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>TextLabel1</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>Progress:</string>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QProgressBar</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>ProgressBar1</cstring>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+        <widget>
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout3</cstring>
+            </property>
+            <hbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>buttonApply</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Apply</string>
+                    </property>
+                    <property stdset="1">
+                        <name>autoDefault</name>
+                        <bool>true</bool>
+                    </property>
+                </widget>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Horizontal Spacing2</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Horizontal</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>buttonOk</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;OK</string>
+                    </property>
+                    <property stdset="1">
+                        <name>autoDefault</name>
+                        <bool>true</bool>
+                    </property>
+                    <property stdset="1">
+                        <name>default</name>
+                        <bool>true</bool>
+                    </property>
+                </widget>
+                <widget>
+                    <class>QPushButton</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>buttonCancel</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>text</name>
+                        <string>&amp;Cancel</string>
+                    </property>
+                    <property stdset="1">
+                        <name>autoDefault</name>
+                        <bool>true</bool>
+                    </property>
+                </widget>
+            </hbox>
+        </widget>
+    </vbox>
+</widget>
+<connections>
+    <connection>
+        <sender>buttonOk</sender>
+        <signal>clicked()</signal>
+        <receiver>MotorThreadDlgBase</receiver>
+        <slot>accept()</slot>
+    </connection>
+    <connection>
+        <sender>buttonCancel</sender>
+        <signal>clicked()</signal>
+        <receiver>MotorThreadDlgBase</receiver>
+        <slot>reject()</slot>
+    </connection>
+    <connection>
+        <sender>buttonApply</sender>
+        <signal>clicked()</signal>
+        <receiver>MotorThreadDlgBase</receiver>
+        <slot>startThread()</slot>
+    </connection>
+    <slot access="public">startThread()</slot>
+</connections>
+</UI>
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/movethread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/movethread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/movethread.cpp	(revision 3401)
@@ -0,0 +1,74 @@
+// movethread.cpp: Implementierung der Klasse MoveThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "movethread.h"
+#include "threadevent.h"
+#include "amcmirrorpanel.h"
+#include "amcmotor.h"
+#include "amcserialport.h"
+#include "amcerror.h"
+#include <qevent.h>
+#include <qthread.h>
+#include <qstring.h>
+#include "stdlib.h"
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern AMCSerialPort* g_pPort[];
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+MoveThread::MoveThread( QObject* p_pReceiver )
+	: m_pPanel( NULL ), m_pReceiver( p_pReceiver )
+{
+}
+
+MoveThread::~MoveThread()
+{
+}
+
+void MoveThread::run()
+{
+	QString qsMsg;
+
+	// We use only one motor instance and reuse it for each panel
+	AMCSerialPort* pPort = g_pPort[ m_pPanel->port()-1 ];
+	AMCMotor* pMotor = new AMCMotor( pPort );
+
+	bool zLaser = false;
+	try
+	{
+		pMotor->unselectBox();
+		pMotor->selectBox( m_pPanel->box() );
+		pMotor->selectDriver( m_pPanel->driver() );
+		pMotor->getFrequency();
+
+		int x = m_pPanel->getRefX();
+		int y = m_pPanel->getRefY();
+		int steps = MAX( abs(x), abs(y) );
+		if( ! ((x == 0) && (y == 0)) )			// only move is necesary
+		{
+			pMotor->moveMotors(x,y);
+			pMotor->waitForMotors( pMotor->calcTimeout(steps) );
+		}
+	}
+	catch( AMCError& e )
+	{
+		qsMsg.sprintf( "AMCError: Port: %d, Box:%d, Driver:%d -- ",
+			       				m_pPanel->port(), m_pPanel->box(), m_pPanel->driver() );
+		qsMsg.append( e.getErrorText() );
+		QThread::postEvent( m_pReceiver, new ThreadErrorEvent( qsMsg, e ) );
+	}
+	delete pMotor;
+
+	QThread::postEvent( m_pReceiver, new QCustomEvent( THREAD_END_EVENT ) );
+
+}
+
+void MoveThread::setPanel(AMCMirrorPanel* p_pPanel)
+{
+	m_pPanel = p_pPanel;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/movethread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/movethread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/movethread.h	(revision 3401)
@@ -0,0 +1,29 @@
+// movethread.h: Schnittstelle für die Klasse MoveThread.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef MOVETHREAD_H
+#define MOVETHREAD_H
+
+
+#include <qthread.h>
+
+class AMCMirrorPanel;
+
+class MoveThread : public QThread
+{
+
+public:
+	void setPanel( AMCMirrorPanel* p_pPanel );
+	AMCMirrorPanel* getPanel() { return m_pPanel; };
+	MoveThread( QObject* p_pReceiver );
+	virtual ~MoveThread();
+
+protected:
+	virtual void run();
+private:
+	AMCMirrorPanel* m_pPanel;
+	QObject*				m_pReceiver;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/progressinfoevent.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/progressinfoevent.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/progressinfoevent.cpp	(revision 3401)
@@ -0,0 +1,18 @@
+// progressinfoevent.cpp: Implementierung der Klasse ProgressInfoEvent.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "progressinfoevent.h"
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+ProgressInfoEvent::ProgressInfoEvent( QString p_qsMsg ) 
+	: QCustomEvent( PROGRESS_INFO_EVENT ), m_qsMsg( p_qsMsg )
+{
+}
+
+ProgressInfoEvent::~ProgressInfoEvent()
+{
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/progressinfoevent.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/progressinfoevent.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/progressinfoevent.h	(revision 3401)
@@ -0,0 +1,23 @@
+// ProgressInfoEvent.h: Schnittstelle für die Klasse ProgressInfoEvent.
+//
+//////////////////////////////////////////////////////////////////////
+
+
+#ifndef PROGRESSINFOEVENT_H
+#define PROGRESSINFOEVENT_H
+
+#include "eventdefs.h"
+
+class ProgressInfoEvent : public QCustomEvent  
+{
+public:
+	ProgressInfoEvent( QString p_qsMsg );
+	virtual ~ProgressInfoEvent();
+	QString getMessage() { return m_qsMsg; };
+
+private:
+	QString m_qsMsg;
+
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadcontroller.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadcontroller.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadcontroller.cpp	(revision 3401)
@@ -0,0 +1,54 @@
+// threadcontroller.cpp: Implementierung der Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "threadcontroller.h"
+#include "laserthreadcontroller.h"
+#include "motorthreadcontroller.h"
+#include "defocusthreadcontroller.h"
+#include "adjustthreadcontroller.h"
+#include "laseradjustthreadcontroller.h"
+#include "errortestthreadcontroller.h"
+#include "amcmirrorpanel.h"
+#include <qthread.h>
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+ThreadController::ThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver )
+  : m_qlPanels( p_qlPanels ), m_pReceiver( p_pReceiver ), m_zTrue( false ), m_zStop( false )
+{
+}
+
+ThreadController::~ThreadController()
+{
+
+}
+
+/** Static factory method to build the different controllers */
+static ThreadController* ThreadController::getController( int p_iType, QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver )
+{
+	switch( p_iType)
+	{
+		case LASER_THREAD_CTRL:
+			return new LaserThreadController( p_qlPanels, p_pReceiver );
+		case MOTOR_THREAD_CTRL:
+			return new MotorThreadController( p_qlPanels, p_pReceiver );
+		case DEFOCUS_THREAD_CTRL:
+			return new DefocusThreadController( p_qlPanels, p_pReceiver );
+		case ADJUST_THREAD_CTRL:
+			return new AdjustThreadController( p_qlPanels, p_pReceiver );
+		case LASER_ADJUST_THREAD_CTRL:
+			return new LaserAdjustThreadController( p_qlPanels, p_pReceiver );
+		case ERROR_TEST_THREAD_CTRL:
+			return new ErrorTestThreadController( p_qlPanels, p_pReceiver );
+		default:
+			return 0;
+	}
+}
+/** No descriptions */
+void ThreadController::stop()
+{
+	m_zStop = true;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadcontroller.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadcontroller.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadcontroller.h	(revision 3401)
@@ -0,0 +1,45 @@
+// threadcontroller.h: Schnittstelle für die Klasse MotorThreadController.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef THREADCONTROLLER_H
+#define THREADCONTROLLER_H
+
+#define LASER_THREAD_CTRL	1
+#define MOTOR_THREAD_CTRL	2
+#define DEFOCUS_THREAD_CTRL 3
+#define ADJUST_THREAD_CTRL 4
+#define LASER_ADJUST_THREAD_CTRL 5
+#define ERROR_TEST_THREAD_CTRL 6
+
+#include <qthread.h>
+#include <qlist.h>
+
+class AMCMirrorPanel;
+class LaserThreadController;
+class MotorThreadController;
+
+class ThreadController : public QThread
+{
+public:
+	ThreadController( QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver );
+	virtual ~ThreadController();
+	virtual void setBool( bool p_zTrue ) { m_zTrue = p_zTrue; };
+  /** No descriptions */
+  static ThreadController* getController( int p_iType, QList<AMCMirrorPanel>& p_qlPanels, QObject* p_pReceiver );
+  /** No descriptions */
+  void stop();
+
+protected:
+	QList<AMCMirrorPanel> m_qlPanels;     // List of mirror panels to start workers for.
+	QObject*							m_pReceiver;    // Reciever of the Events posted by the worker thraeads.
+	bool									m_zTrue;        // Flag used by the controller to pass to worker threads
+																				// Used to indicate if lasers should be turned on or off
+																				// or if we should defocus or focus the mirror.
+protected: // Public attributes
+  /**  */
+  bool m_zStop;
+};
+
+#endif
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadevent.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadevent.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadevent.cpp	(revision 3401)
@@ -0,0 +1,27 @@
+// ThreadEvent.cpp: Implementierung der Klasse ThreadEvent.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "threadevent.h"
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+ThreadEvent::ThreadEvent( QString p_qsMsg )
+	: QCustomEvent( THREAD_EVENT ), m_qsMsg( p_qsMsg )
+{
+}
+
+ThreadEvent::~ThreadEvent()
+{
+}
+
+ThreadErrorEvent::ThreadErrorEvent( QString p_qsMsg, AMCError& p_theError )
+	: QCustomEvent( THREAD_ERROR_EVENT ), m_theErr( p_theError ), m_qsMsg( p_qsMsg )
+{
+}
+
+ThreadErrorEvent::~ThreadErrorEvent()
+{
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadevent.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadevent.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadevent.h	(revision 3401)
@@ -0,0 +1,41 @@
+// ThreadEvent.h: Schnittstelle für die Klasse ThreadEvent.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef THREADEVENT_H
+#define THREADEVENT_H
+
+
+#include <qevent.h>
+#include <amcerror.h>
+#define THREAD_EVENT (QEvent::User + 1)
+#define PROGRESS_EVENT (QEvent::User + 2)
+#define THREAD_ERROR_EVENT (QEvent::User + 3)
+#define THREAD_END_EVENT (QEvent::User + 4)
+#define THREAD_FRAME_EVENT (QEvent::User + 5)
+
+class ThreadEvent : public QCustomEvent
+{
+public:
+	ThreadEvent( QString p_qsMsg );
+	virtual ~ThreadEvent();
+	QString getMessage() { return m_qsMsg; };
+
+private:
+	QString m_qsMsg;
+};
+
+class ThreadErrorEvent : public QCustomEvent
+{
+public:
+	ThreadErrorEvent( QString p_qsMsg, AMCError& p_theError );
+	virtual ~ThreadErrorEvent();
+	QString getMessage() { return m_qsMsg; };
+	AMCError& getError() { return m_theErr; };
+
+private:
+	AMCError	m_theErr;
+	QString 	m_qsMsg;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadinfo.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadinfo.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadinfo.cpp	(revision 3401)
@@ -0,0 +1,23 @@
+// ThreadInfo.cpp: Implementierung der Klasse ThreadInfo.
+//
+//////////////////////////////////////////////////////////////////////
+
+#include "threadinfo.h"
+#include <qthread.h>
+
+#include "motorthread.h"
+
+//////////////////////////////////////////////////////////////////////
+// Konstruktion/Destruktion
+//////////////////////////////////////////////////////////////////////
+
+ThreadInfo::ThreadInfo( MotorThread* p_pThread ) : m_pThread( p_pThread )
+{
+}
+
+ThreadInfo::~ThreadInfo()
+{
+	// clean up help datastructures 
+	if( m_pThread != NULL )
+		delete m_pThread;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadinfo.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadinfo.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/threadinfo.h	(revision 3401)
@@ -0,0 +1,26 @@
+// ThreadInfo.h: Schnittstelle für die Klasse ThreadInfo.
+//
+//////////////////////////////////////////////////////////////////////
+
+#ifndef THREADINFO_H
+#define THREADINFO_H
+
+class AMCMirrorPanel;
+class MotorThread;
+class ThreadInfo;
+
+class ThreadInfo  
+{
+public:
+	void setPanel(AMCMirrorPanel* p_pPanel ) { m_pPanel = p_pPanel; };
+	AMCMirrorPanel* getPanel() { return m_pPanel; };
+	MotorThread* getThread() { return m_pThread; };
+	ThreadInfo(  MotorThread* p_pThread  );
+	virtual ~ThreadInfo();
+
+private:
+	MotorThread* m_pThread;
+	AMCMirrorPanel* m_pPanel;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplay.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplay.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplay.cpp	(revision 3401)
@@ -0,0 +1,546 @@
+/***************************************************************************
+                          videodisplay.cpp  -  description
+                             -------------------
+    begin                : Sat Apr 5 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "amcerror.h"
+#include "amclog.h"
+#include "amcmotor.h"
+#include "amcmirrorpanel.h"
+#include "amcprogdlg.h"
+#include "amcframegrabber.h"
+#include "calibratepaneldialog.h"
+#include "centerthread.h"
+#include "magicmirror.h"
+#include "threadcontroller.h"	// needed for the definition of DEFOCUS_THREAD_CTRL
+#include "threadevent.h"			// needed for the definition of thread events
+#include "videodisplay.h"
+#include "videoframe.h"
+#include <qlayout.h>
+#include <qtimer.h>
+#include <qslider.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qcheckbox.h>
+#include <qmessagebox.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <kapp.h>
+#include <math.h>
+#include <unistd.h>
+
+#define MAX(a,b) ((a>b) ? a : b )
+
+extern KApplication*			g_theApp;
+extern AMCLog*						g_pLog;
+extern AMCFrameGrabber*		g_pFG;
+extern MagicMirror*				g_theMirror;
+extern int								g_iRefX, g_iRefY;
+
+VideoDisplay::VideoDisplay(QWidget *parent, const char *name, bool modal )
+		: VideoDisplayBase(parent, name, modal)
+{
+//	m_theFG = new AMCFrameGrabber();
+
+  qDebug("Thread for VideoDisplay PID: %d - PPID: %d", getpid(), getppid() );
+
+	Brightness->setValue( g_pFG->getBrightness() );
+	Contrast->setValue( g_pFG->getContrast() );
+	connect( Brightness, SIGNAL( valueChanged(int) ), g_pFG ,SLOT( setBrightness( int ) ) );
+	connect( Contrast, SIGNAL( valueChanged(int) ), g_pFG ,SLOT( setContrast( int ) ) );
+
+  qDebug("Creating Videoframe");
+	m_videoFrame = new VideoFrame( this, "Video", g_pFG );
+  m_videoFrame->setMinimumSize( QSize( MY_WIDTH, MY_HEIGHT ) );
+  m_videoFrame->setMaximumSize( QSize( MY_WIDTH, MY_HEIGHT ) );
+  m_videoFrame->setFrameShape( QFrame::NoFrame );
+  qDebug("Adding Videoframe as widget");
+	((QGridLayout*) this->layout())->addWidget( m_videoFrame, 0, 0 );
+	connect( m_videoFrame, SIGNAL( gref(int, int ) ), this ,SLOT( setGRefInfoSlot( int, int ) ) );
+	connect( m_videoFrame, SIGNAL( spot(int, int ) ), this ,SLOT( setSpotInfoSlot( int, int ) ) );
+	connect( m_videoFrame, SIGNAL( framesGrabbed(int) ), (QObject*) GrabbedLCD ,SLOT( display( int ) ) );
+	connect( m_videoFrame, SIGNAL( framesProcessed(int) ), (QObject*) ProcessedLCD ,SLOT( display( int ) ) );
+	connect( thresholdSlider, SIGNAL( valueChanged(int) ), m_videoFrame ,SLOT( threshold(int) ) );
+  thresholdSlider->setValue(15);
+	connect( scaleBox, SIGNAL( toggled(bool) ), m_videoFrame ,SLOT( scaleImage(bool) ) );
+	connect( scaleValSlider, SIGNAL( valueChanged(int) ), m_videoFrame ,SLOT( scaleValue(int) ) );
+  scaleValSlider->setValue(200);
+	connect( darksBox, SIGNAL( toggled(bool) ), m_videoFrame ,SLOT( substractDarks(bool) ) );
+	connect( Take_Dark_Button, SIGNAL( clicked() ), m_videoFrame ,SLOT( takeDark() ) );
+	connect( Clear_Darks_Button, SIGNAL( clicked() ), m_videoFrame ,SLOT( clearDarks() ) );
+
+	// Constructing a timer. The destructor of the parent of the timer, in this case "this"
+	// VideoDisplay will automatically destroy the timer so we do not need to delete it
+	// ourselves.
+  qDebug("Creating and starting timer");
+	m_pTimer = new QTimer( this );
+	connect( m_pTimer, SIGNAL( timeout() ), m_videoFrame, SLOT( timerDone() ) );
+	m_pTimer->start( 1000 );        	// start 1 seconds timer
+
+}
+
+VideoDisplay::~VideoDisplay()
+{
+	disconnect( Brightness, SIGNAL( valueChanged(int) ), g_pFG ,SLOT( setBrightness( int ) ) );
+	disconnect( Contrast, SIGNAL( valueChanged(int) ), g_pFG ,SLOT( setContrast( int ) ) );
+	disconnect( m_pTimer, SIGNAL( timeout() ), m_videoFrame, SLOT( timerDone() ) );
+	delete m_pTimer;
+	qDebug("Deleting VideoFrame");
+	delete m_videoFrame;
+	qDebug("Deleting VideoDisplay");
+}
+
+void VideoDisplay::storeSlot(){
+	m_videoFrame->saveFrame();
+}
+
+/** No descriptions */
+void VideoDisplay::setSpotInfoSlot( int p_iX, int p_iY )
+{
+	SpotX->setText( QString::number(p_iX) );
+	SpotY->setText( QString::number(p_iY) );
+}
+
+/** No descriptions */
+void VideoDisplay::setGRefInfoSlot( int p_iX, int p_iY )
+{
+	GRefX->setText( QString::number( p_iX ) );
+	GRefY->setText( QString::number( p_iY ) );
+}
+
+/** Set the motor of the panel to use.
+ */
+void VideoDisplay::setMotor( AMCMotor* p_pMotor )
+{
+	m_pMotor = p_pMotor;
+}
+
+/** Set the motor of the panel to use.
+ */
+void VideoDisplay::setPanel( AMCMirrorPanel* p_pPanel )
+{
+	m_pPanel = p_pPanel;
+	QString info;
+	Panel_Info->setTitle( info.sprintf( "Panel: %d,%d", m_pPanel->i(), m_pPanel->j() ) );
+	Device_Label->setText( info.sprintf( "Device: /dev/ttyS%d", m_pPanel->port()+3 ) );
+	Box_Label->setText( info.sprintf( "Box: %02d", m_pPanel->box() ) );
+	Driver_Label->setText( info.sprintf( "Driver: %d", m_pPanel->driver() ) );
+	Laser_Check->setChecked( m_pPanel->isLaserOn() );
+
+	RefX->setText( QString::number(	m_pPanel->getLaserX() ) );
+	RefY->setText( QString::number( m_pPanel->getLaserY() ) );
+	m_videoFrame->setRef( m_pPanel->getLaserX(), m_pPanel->getLaserY() );
+	GRefX->setText( QString::number( g_iRefX ) );
+	GRefY->setText( QString::number( g_iRefY ) );
+
+  enableButtons( true );
+}
+
+/** Switch the laser on. */
+void VideoDisplay::switchLaserSlot( bool p_zOn )
+{
+	try
+	{
+		m_pMotor->switchLaser( p_zOn );
+		m_pPanel->setLaserOn( p_zOn );
+	}
+	catch( AMCError& e )
+	{
+		QMessageBox::information( this,
+								  "AMCError",
+  							  	  e.getErrorText(),
+  							  	  QMessageBox::Ok | QMessageBox:: Default );
+	}		
+}
+
+/** Center the motors. */
+void VideoDisplay::centerSlot()
+{
+//	m_videoFrame->halt( true );
+	enableButtons( false );
+	g_theApp->processEvents();
+	qDebug("Creating center thread");
+	m_pCenterThread = new CenterThread( this );
+	m_pCenterThread->setPanel( m_pPanel );
+	qDebug("Starting center thread");
+	m_pCenterThread->start();
+/*	try
+	{
+		m_pMotor->centerMotors();
+		m_pMotor->waitForMotors( m_pMotor->calcTimeout( 17000 )+2 );
+	}
+	catch( AMCError& e )
+	{
+		QMessageBox::information( this,
+								  "AMCError",
+  							  	  e.getErrorText(),
+  							  	  QMessageBox::Ok | QMessageBox:: Default );
+		enableButtons( true );
+		m_videoFrame->halt( false );
+		return;
+	}
+	m_pPanel->setX( 0 );
+	m_pPanel->setY( 0 );
+	enableButtons( true );
+	m_videoFrame->halt( false );
+//	g_theApp->processEvents();
+*/
+}
+
+/** Goto the position given by X. */
+void VideoDisplay::goXSlot()
+{
+  bool zOk;
+	int iX = X_Goto_Value->text().toInt( &zOk );
+	moveMotors( iX - m_pPanel->getX(), 0 );
+}
+
+/** Goto the position given by Y. */
+void VideoDisplay::goYSlot()
+{
+  bool zOk;
+	int iY = Y_Goto_Value->text().toInt( &zOk );
+	moveMotors( 0, iY - m_pPanel->getY() );
+}
+
+/** Move motors relative by the given amount of steps. */
+void VideoDisplay::moveMotors( int p_iX, int p_iY )
+{
+	if( (p_iX == 0) && (p_iY == 0) )
+		return;
+	
+	enableButtons( false );
+	m_videoFrame->halt( true );
+	g_theApp->processEvents();
+	try
+	{
+		m_pMotor->moveMotors( p_iX, p_iY );
+		m_pMotor->waitForMotors( m_pMotor->calcTimeout( MAX( abs(p_iX), abs(p_iY) ) ) );			
+	
+		int x = m_pPanel->getX() + p_iX;
+		int y = m_pPanel->getY() + p_iY;
+		m_pPanel->setX( x );
+		m_pPanel->setY( y );
+	}
+	catch( AMCError& e )
+	{
+		QMessageBox::information( this,
+								  "AMCError",
+  							  	  e.formatError(),
+  							  	  QMessageBox::Ok | QMessageBox:: Default );
+	}
+	m_videoFrame->halt( false );
+	enableButtons( true );
+	return;
+	
+}
+
+
+/** No descriptions */
+void VideoDisplay::enableButtons( bool p_zEnable ) const
+{
+	Laser_Check->setEnabled( p_zEnable );
+	Calibrate_Button->setEnabled( p_zEnable );
+	DefocusButton->setEnabled( p_zEnable );
+	FocusButton->setEnabled( p_zEnable );
+	DefocusAllButton->setEnabled( p_zEnable );
+	
+	X_Inc_100_Button->setEnabled( p_zEnable );
+	X_Inc_10_Button->setEnabled( p_zEnable );
+	X_Goto_Value->setEnabled( p_zEnable );
+	X_Go_Button->setEnabled( p_zEnable );
+	X_Dec_10_Button->setEnabled( p_zEnable );
+	X_Dec_100_Button->setEnabled( p_zEnable );
+	
+	Y_Inc_100_Button->setEnabled( p_zEnable );
+	Y_Inc_10_Button->setEnabled( p_zEnable );
+	Y_Goto_Value->setEnabled( p_zEnable );
+	Y_Go_Button->setEnabled( p_zEnable );
+	Y_Dec_10_Button->setEnabled( p_zEnable );
+	Y_Dec_100_Button->setEnabled( p_zEnable );
+		
+	if( p_zEnable )
+	{
+		int x = m_pPanel->getX();
+		int y = m_pPanel->getY();
+		
+		QString str;
+		X_Mot_Box->setTitle( str.sprintf("X=%d",x ) );
+		Y_Mot_Box->setTitle( str.sprintf("Y=%d",y ) );
+		X_Inc_100_Button->setEnabled( (x > 2400) ? false : true );
+		X_Inc_10_Button->setEnabled( (x > 2490) ? false : true );
+		X_Dec_10_Button->setEnabled( (x < -2490) ? false : true );
+		X_Dec_100_Button->setEnabled( (x < -2400) ? false : true );
+		
+		Y_Inc_100_Button->setEnabled( (y > 2400) ? false : true );
+		Y_Inc_10_Button->setEnabled( (y > 2490) ? false : true );
+		Y_Dec_10_Button->setEnabled( (y < -2490) ? false : true );
+		Y_Dec_100_Button->setEnabled( (y < -2400) ? false : true );
+
+	}
+	
+	Center_Button->setEnabled( p_zEnable );
+}
+
+
+/** Save actual laser position as reference. */
+void VideoDisplay::saveRefSlot()
+{
+	int x = SpotX->text().toInt();
+	int y = SpotY->text().toInt();
+
+	if( x != -1)
+	{
+		m_pPanel->setLaserX( x );
+		m_pPanel->setLaserY( y );
+		m_pPanel->setRefX( m_pPanel->getX() );
+		m_pPanel->setRefY( m_pPanel->getY() );
+		RefX->setText( QString::number( x ) );
+		RefY->setText( QString::number( y ) );
+		m_videoFrame->setRef( x, y );
+	}
+}
+
+/** Save laser position as global reference. */
+void VideoDisplay::saveGRefSlot()
+{
+	int x = SpotX->text().toInt();
+	int y = SpotY->text().toInt();
+
+	if( x != -1)
+	{
+		g_iRefX = x;
+		g_iRefY = y;
+		GRefX->setText( QString::number( x ) );
+		GRefY->setText( QString::number( y ) );
+	}
+}
+
+/** Adjust laser spot to the reference position of this panel */
+void VideoDisplay::adjustRefSlot()
+{
+	int iRefX = m_pPanel->getLaserX();
+	int iRefY = m_pPanel->getLaserY();
+  qDebug("Reference: %d %d", iRefX, iRefY );
+	if( ( iRefX == -1 ) && ( iRefY == -1 ) )
+		return;
+	int iStepX, iStepY;
+	calcSteps( iRefX, iRefY, iStepX, iStepY );
+	moveMotors( iStepX, iStepY );
+}
+
+/** Adjust laser spot to the global reference position */
+void VideoDisplay::adjustGRefSlot()
+{
+	if( ( g_iRefX == -1 ) && ( g_iRefY == -1 ) )
+		return;
+	int iStepX, iStepY;
+	calcSteps( g_iRefX, g_iRefY, iStepX, iStepY );
+	moveMotors( iStepX, iStepY );
+}
+
+void VideoDisplay::calcSteps( int p_iRefX, int p_iRefY, int& p_iStepX, int& p_iStepY )
+{
+	p_iStepX = p_iStepY = 0;
+	int iVSpotX = SpotX->text().toInt();
+	int iVSpotY = SpotY->text().toInt();
+	if( ( iVSpotX == -1 ) && ( iVSpotY == -1 ) )
+		return;
+	qDebug("Spot at x,y: %4d %4d", iVSpotX, iVSpotY );	
+	qDebug("Ref  at x,y: %4d %4d", p_iRefX, p_iRefY );	
+
+	double dX = p_iRefX - iVSpotX;
+	double dY = p_iRefY - iVSpotY;
+	double dAlpha1 = atan( m_pPanel->getSlopeX() );
+	double dAlpha2 = atan( m_pPanel->getSlopeY() );
+	double dSinA1 = sin( dAlpha1 );
+	double dSinA2 = sin( dAlpha2 );
+	double dCosA1 = cos( dAlpha1 );
+	double dCosA2 = cos( dAlpha2 );
+
+	double dFacX = dX - ( dY * dCosA2 / dSinA2 );
+	dFacX /= ( dCosA1 - dSinA1 * dCosA2 / dSinA2 );
+	double dFacY = (dY - dFacX * dSinA1) / dSinA2;
+
+	p_iStepX = (int) ( dFacX * m_pPanel->getConversionX() );
+	p_iStepY = (int) ( dFacY * m_pPanel->getConversionY() );
+
+	qDebug("Steps till reference: %4d %4d", p_iStepX, p_iStepY );	
+}
+
+/** No descriptions */
+void VideoDisplay::defocusAllSlot()
+{
+	enableButtons( false );
+  QString qsMsg("Defocusing all mirrors");
+	AMCProgDlg* pDialog = new AMCProgDlg( DEFOCUS_THREAD_CTRL, this, qsMsg, true );
+	pDialog->setText( qsMsg );
+	pDialog->start();
+	pDialog->exec();
+	delete pDialog;
+
+	try
+	{
+		// reselect the currently selected panel
+		m_pMotor->unselectBox();
+		int iBox = m_pPanel->box();
+		m_pMotor->selectBox( iBox );
+		int iDriver = m_pPanel->driver();
+		m_pMotor->selectDriver( iDriver );
+	}
+	catch( AMCError& e )
+	{
+		QMessageBox::information( this,
+								  "AMCError",
+ 						  	  e.formatError(),
+ 						  	  QMessageBox::Ok | QMessageBox:: Default );
+	}
+	enableButtons( true );
+	return;
+}
+
+/** No descriptions */
+void VideoDisplay::defocusSlot()
+{
+	int x = m_pPanel->getRefX();
+	int y = m_pPanel->getRefY();
+
+	if( x >= 0 )
+		x -= 1500;
+	else
+		x += 1500;
+
+	if( y >= 0 )
+		y -= 1500;
+	else
+		y += 1500;
+
+	x -= m_pPanel->getX();
+	y -= m_pPanel->getY();
+	moveMotors( x, y );
+
+  return;
+}
+
+/** No descriptions */
+void VideoDisplay::focusAllSlot()
+{
+	enableButtons( false );
+
+  QString qsMsg("Focusing all mirrors");
+	AMCProgDlg* pDialog = new AMCProgDlg( DEFOCUS_THREAD_CTRL, this, qsMsg, true );
+	pDialog->setText( qsMsg );
+	pDialog->start();
+	pDialog->exec();
+	delete pDialog;
+
+	try
+	{
+		// reselect the currently selected panel
+		m_pMotor->unselectBox();
+		int iBox = m_pPanel->box();
+		m_pMotor->selectBox( iBox );
+		int iDriver = m_pPanel->driver();
+		m_pMotor->selectDriver( iDriver );
+	}
+	catch( AMCError& e )
+	{
+		QMessageBox::information( this,
+								  "AMCError",
+ 						  	  e.formatError(),
+ 						  	  QMessageBox::Ok | QMessageBox:: Default );
+	}
+	enableButtons( true );
+	return;
+}
+
+/** No descriptions */
+void VideoDisplay::focusSlot()
+{
+	int x = m_pPanel->getRefX();
+	int y = m_pPanel->getRefY();
+
+	x -= m_pPanel->getX();
+	y -= m_pPanel->getY();
+	moveMotors( x, y );
+
+  return;
+}
+
+/** No descriptions */
+void VideoDisplay::takeDarkSlot()
+{
+//	m_videoFrame->m_zTakeDark = true;
+}
+
+/** No descriptions */
+void VideoDisplay::clearDarksSlot(){
+	m_videoFrame->clearDarks();
+}
+
+void VideoDisplay::customEvent(QCustomEvent *e)
+{
+  if ( e->type() == THREAD_EVENT )
+	{
+		ThreadEvent* te = (ThreadEvent*)e;
+	}
+
+  if ( e->type() == THREAD_ERROR_EVENT )
+	{
+		ThreadErrorEvent* tee = (ThreadErrorEvent*)e;
+		QMessageBox::information( this,
+								  "AMCError",
+  							  tee->getMessage(),
+  							  QMessageBox::Ok | QMessageBox:: Default );
+		m_pCenterThread->wait();		
+		qDebug("Deleting center thread");
+		delete m_pCenterThread;
+		enableButtons( true );
+		g_pLog->logError( tee->getMessage(), tee->getError() );
+	}
+
+  if ( e->type() == THREAD_END_EVENT )
+	{
+		m_pCenterThread->wait();		
+		delete m_pCenterThread;
+		enableButtons( true );
+	}
+
+}
+/** No descriptions */
+void VideoDisplay::calibrateSlot()
+{
+  qDebug("Stoping VideoFrame");
+	m_videoFrame->halt( true );
+  qDebug("Disabling buttons");
+	enableButtons( false );
+	CalibratePanelDialog* pDlg = new CalibratePanelDialog( this, "Calibrate Panel", g_pFG );
+	pDlg->setPanel( m_pPanel );
+	pDlg->setTSigmas( thresholdSlider->value() );
+	int iRet = pDlg->exec();
+	Laser_Check->setChecked( m_pPanel->isLaserOn() );
+	delete pDlg;
+  qDebug("Enabling buttons");
+	enableButtons( true );
+  qDebug("Restarting VideoFrame");
+	m_videoFrame->halt( false );
+}
+
+/** No descriptions */
+void VideoDisplay::accept()
+{
+	g_theMirror->saveMirrorPanels();
+	VideoDisplayBase::accept();
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplay.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplay.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplay.h	(revision 3401)
@@ -0,0 +1,127 @@
+/***************************************************************************
+                          videodisplay.h  -  description
+                             -------------------
+    begin                : Sat Apr 5 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef VIDEODISPLAY_H
+#define VIDEODISPLAY_H
+
+#include <qwidget.h>
+#include <videodisplaybase.h>
+#include <qlist.h>
+#include "amcframegrabber.h"
+
+/**
+  *@author Martin Merck
+  */
+class QTimer;
+class AMCMotor;
+class AMCMirrorPanel;
+class CenterThread;
+class VideoFrame;
+
+class VideoDisplay : public VideoDisplayBase  {
+   Q_OBJECT
+public: 
+	VideoDisplay(QWidget *parent=0, const char *name=0, bool modal = FALSE);
+	~VideoDisplay();
+  /** Set the motor of the panel to use. */
+  void setMotor( AMCMotor* p_pMotor );
+  /** Set the motor of the panel to use. */
+  void setPanel( AMCMirrorPanel* p_pPanel );
+  /** Handle events from the motor threads. */
+	void customEvent( QCustomEvent* e );
+
+private: // Private attributes
+  /** The framegrabber instance we use in this dialog. */
+//  AMCFrameGrabber* m_theFG;
+  /**  */
+  VideoFrame* m_videoFrame;
+  /** pointer to the currently used motor class. */
+  AMCMotor* m_pMotor;
+  /** pointer to the currently used motor class. */
+  AMCMirrorPanel* m_pPanel;
+  /** pointer to the thread used to center a panel. */
+	CenterThread* m_pCenterThread;
+  /** pointer to a timer we use to calculate the frame grabbing rate. */
+  QTimer* m_pTimer;
+
+public slots: // Public slots
+  /** Store the actual image in a fie
+ */
+  virtual void storeSlot();
+  /** No descriptions */
+  virtual void setSpotInfoSlot( int p_iX, int p_iY );
+  /** No descriptions */
+  virtual void setGRefInfoSlot( int p_iX, int p_iY );
+  /** Move the X motor 10 steps forward. */
+  virtual void incX10Slot() { moveMotors( 10, 0 ); };
+  /** Move the X motor 100 steps forward. */
+  virtual void incX100Slot() { moveMotors( 100, 0 ); };
+  /** Move the X motor 10 steps downward. */
+  virtual void decX10Slot() { moveMotors( -10, 0 ); };
+  /** Move the X motor 100 steps downward. */
+  virtual void decX100Slot() { moveMotors( -100, 0 ); };
+  /** Move the Y motor 10 steps forward. */
+  virtual void incY10Slot() { moveMotors( 0, 10 ); };
+  /** Move the Y motor 100 steps forward. */
+  virtual void incY100Slot() { moveMotors( 0, 100 ); };
+  /** Move the Y motor 10 steps downward. */
+  virtual void decY10Slot() { moveMotors( 0, -10 ); };
+  /** Move the Y motor 100 steps downward. */
+  virtual void decY100Slot() { moveMotors( 0, -100 ); };
+  /** Center the motors. */
+  virtual void centerSlot();
+  /** Goto the position given by X. */
+  virtual void goXSlot();
+  /** Goto the position given by Y. */
+  virtual void goYSlot();
+  /** Switch the laser on. */
+  virtual void switchLaserSlot( bool p_zOn );
+  /** Move motors relative by the given amount of steps. */
+  virtual void moveMotors( int x, int y );
+private:
+  /** No descriptions */
+  void enableButtons( bool p_zEnable ) const;
+	void calcSteps( int p_iRefX, int p_iRefY, int& p_iStepX, int& p_iStepY );
+	
+public slots: // Public slots
+  /** Save laser position as global reference. */
+  void saveGRefSlot();
+  /** Save actual laser position as reference. */
+  void saveRefSlot();
+  /** No descriptions */
+  void adjustGRefSlot();
+  /** No descriptions */
+  void adjustRefSlot();
+  /** No descriptions */
+  void defocusAllSlot();
+  /** No descriptions */
+  void focusAllSlot();
+  /** No descriptions */
+  void defocusSlot();
+  /** No descriptions */
+  void focusSlot();
+  /** No descriptions */
+  void clearDarksSlot();
+  /** No descriptions */
+  void takeDarkSlot();
+  /** No descriptions */
+  void calibrateSlot();
+  /** No descriptions */
+  void accept();
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplay.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplay.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplay.moc.cpp	(revision 3401)
@@ -0,0 +1,270 @@
+/****************************************************************************
+** VideoDisplay meta object code from reading C++ file 'videodisplay.h'
+**
+** Created: Thu Jan 29 00:51:48 2004
+**      by: The Qt MOC ($Id: videodisplay.moc.cpp,v 1.1 2004-03-04 16:31:18 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "videodisplay.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *VideoDisplay::className() const
+{
+    return "VideoDisplay";
+}
+
+QMetaObject *VideoDisplay::metaObj = 0;
+
+void VideoDisplay::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(VideoDisplayBase::className(), "VideoDisplayBase") != 0 )
+	badSuperclassWarning("VideoDisplay","VideoDisplayBase");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString VideoDisplay::tr(const char* s)
+{
+    return qApp->translate( "VideoDisplay", s, 0 );
+}
+
+QString VideoDisplay::tr(const char* s, const char * c)
+{
+    return qApp->translate( "VideoDisplay", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* VideoDisplay::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) VideoDisplayBase::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (VideoDisplay::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    typedef void (VideoDisplay::*m1_t1)(int,int);
+    typedef void (QObject::*om1_t1)(int,int);
+    typedef void (VideoDisplay::*m1_t2)(int,int);
+    typedef void (QObject::*om1_t2)(int,int);
+    typedef void (VideoDisplay::*m1_t3)();
+    typedef void (QObject::*om1_t3)();
+    typedef void (VideoDisplay::*m1_t4)();
+    typedef void (QObject::*om1_t4)();
+    typedef void (VideoDisplay::*m1_t5)();
+    typedef void (QObject::*om1_t5)();
+    typedef void (VideoDisplay::*m1_t6)();
+    typedef void (QObject::*om1_t6)();
+    typedef void (VideoDisplay::*m1_t7)();
+    typedef void (QObject::*om1_t7)();
+    typedef void (VideoDisplay::*m1_t8)();
+    typedef void (QObject::*om1_t8)();
+    typedef void (VideoDisplay::*m1_t9)();
+    typedef void (QObject::*om1_t9)();
+    typedef void (VideoDisplay::*m1_t10)();
+    typedef void (QObject::*om1_t10)();
+    typedef void (VideoDisplay::*m1_t11)();
+    typedef void (QObject::*om1_t11)();
+    typedef void (VideoDisplay::*m1_t12)();
+    typedef void (QObject::*om1_t12)();
+    typedef void (VideoDisplay::*m1_t13)();
+    typedef void (QObject::*om1_t13)();
+    typedef void (VideoDisplay::*m1_t14)(bool);
+    typedef void (QObject::*om1_t14)(bool);
+    typedef void (VideoDisplay::*m1_t15)(int,int);
+    typedef void (QObject::*om1_t15)(int,int);
+    typedef void (VideoDisplay::*m1_t16)();
+    typedef void (QObject::*om1_t16)();
+    typedef void (VideoDisplay::*m1_t17)();
+    typedef void (QObject::*om1_t17)();
+    typedef void (VideoDisplay::*m1_t18)();
+    typedef void (QObject::*om1_t18)();
+    typedef void (VideoDisplay::*m1_t19)();
+    typedef void (QObject::*om1_t19)();
+    typedef void (VideoDisplay::*m1_t20)();
+    typedef void (QObject::*om1_t20)();
+    typedef void (VideoDisplay::*m1_t21)();
+    typedef void (QObject::*om1_t21)();
+    typedef void (VideoDisplay::*m1_t22)();
+    typedef void (QObject::*om1_t22)();
+    typedef void (VideoDisplay::*m1_t23)();
+    typedef void (QObject::*om1_t23)();
+    typedef void (VideoDisplay::*m1_t24)();
+    typedef void (QObject::*om1_t24)();
+    typedef void (VideoDisplay::*m1_t25)();
+    typedef void (QObject::*om1_t25)();
+    typedef void (VideoDisplay::*m1_t26)();
+    typedef void (QObject::*om1_t26)();
+    typedef void (VideoDisplay::*m1_t27)();
+    typedef void (QObject::*om1_t27)();
+    m1_t0 v1_0 = &VideoDisplay::storeSlot;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &VideoDisplay::setSpotInfoSlot;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &VideoDisplay::setGRefInfoSlot;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &VideoDisplay::incX10Slot;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    m1_t4 v1_4 = &VideoDisplay::incX100Slot;
+    om1_t4 ov1_4 = (om1_t4)v1_4;
+    m1_t5 v1_5 = &VideoDisplay::decX10Slot;
+    om1_t5 ov1_5 = (om1_t5)v1_5;
+    m1_t6 v1_6 = &VideoDisplay::decX100Slot;
+    om1_t6 ov1_6 = (om1_t6)v1_6;
+    m1_t7 v1_7 = &VideoDisplay::incY10Slot;
+    om1_t7 ov1_7 = (om1_t7)v1_7;
+    m1_t8 v1_8 = &VideoDisplay::incY100Slot;
+    om1_t8 ov1_8 = (om1_t8)v1_8;
+    m1_t9 v1_9 = &VideoDisplay::decY10Slot;
+    om1_t9 ov1_9 = (om1_t9)v1_9;
+    m1_t10 v1_10 = &VideoDisplay::decY100Slot;
+    om1_t10 ov1_10 = (om1_t10)v1_10;
+    m1_t11 v1_11 = &VideoDisplay::centerSlot;
+    om1_t11 ov1_11 = (om1_t11)v1_11;
+    m1_t12 v1_12 = &VideoDisplay::goXSlot;
+    om1_t12 ov1_12 = (om1_t12)v1_12;
+    m1_t13 v1_13 = &VideoDisplay::goYSlot;
+    om1_t13 ov1_13 = (om1_t13)v1_13;
+    m1_t14 v1_14 = &VideoDisplay::switchLaserSlot;
+    om1_t14 ov1_14 = (om1_t14)v1_14;
+    m1_t15 v1_15 = &VideoDisplay::moveMotors;
+    om1_t15 ov1_15 = (om1_t15)v1_15;
+    m1_t16 v1_16 = &VideoDisplay::saveGRefSlot;
+    om1_t16 ov1_16 = (om1_t16)v1_16;
+    m1_t17 v1_17 = &VideoDisplay::saveRefSlot;
+    om1_t17 ov1_17 = (om1_t17)v1_17;
+    m1_t18 v1_18 = &VideoDisplay::adjustGRefSlot;
+    om1_t18 ov1_18 = (om1_t18)v1_18;
+    m1_t19 v1_19 = &VideoDisplay::adjustRefSlot;
+    om1_t19 ov1_19 = (om1_t19)v1_19;
+    m1_t20 v1_20 = &VideoDisplay::defocusAllSlot;
+    om1_t20 ov1_20 = (om1_t20)v1_20;
+    m1_t21 v1_21 = &VideoDisplay::focusAllSlot;
+    om1_t21 ov1_21 = (om1_t21)v1_21;
+    m1_t22 v1_22 = &VideoDisplay::defocusSlot;
+    om1_t22 ov1_22 = (om1_t22)v1_22;
+    m1_t23 v1_23 = &VideoDisplay::focusSlot;
+    om1_t23 ov1_23 = (om1_t23)v1_23;
+    m1_t24 v1_24 = &VideoDisplay::clearDarksSlot;
+    om1_t24 ov1_24 = (om1_t24)v1_24;
+    m1_t25 v1_25 = &VideoDisplay::takeDarkSlot;
+    om1_t25 ov1_25 = (om1_t25)v1_25;
+    m1_t26 v1_26 = &VideoDisplay::calibrateSlot;
+    om1_t26 ov1_26 = (om1_t26)v1_26;
+    m1_t27 v1_27 = &VideoDisplay::accept;
+    om1_t27 ov1_27 = (om1_t27)v1_27;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(28);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(28);
+    slot_tbl[0].name = "storeSlot()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "setSpotInfoSlot(int,int)";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    slot_tbl[2].name = "setGRefInfoSlot(int,int)";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Public;
+    slot_tbl[3].name = "incX10Slot()";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Public;
+    slot_tbl[4].name = "incX100Slot()";
+    slot_tbl[4].ptr = (QMember)ov1_4;
+    slot_tbl_access[4] = QMetaData::Public;
+    slot_tbl[5].name = "decX10Slot()";
+    slot_tbl[5].ptr = (QMember)ov1_5;
+    slot_tbl_access[5] = QMetaData::Public;
+    slot_tbl[6].name = "decX100Slot()";
+    slot_tbl[6].ptr = (QMember)ov1_6;
+    slot_tbl_access[6] = QMetaData::Public;
+    slot_tbl[7].name = "incY10Slot()";
+    slot_tbl[7].ptr = (QMember)ov1_7;
+    slot_tbl_access[7] = QMetaData::Public;
+    slot_tbl[8].name = "incY100Slot()";
+    slot_tbl[8].ptr = (QMember)ov1_8;
+    slot_tbl_access[8] = QMetaData::Public;
+    slot_tbl[9].name = "decY10Slot()";
+    slot_tbl[9].ptr = (QMember)ov1_9;
+    slot_tbl_access[9] = QMetaData::Public;
+    slot_tbl[10].name = "decY100Slot()";
+    slot_tbl[10].ptr = (QMember)ov1_10;
+    slot_tbl_access[10] = QMetaData::Public;
+    slot_tbl[11].name = "centerSlot()";
+    slot_tbl[11].ptr = (QMember)ov1_11;
+    slot_tbl_access[11] = QMetaData::Public;
+    slot_tbl[12].name = "goXSlot()";
+    slot_tbl[12].ptr = (QMember)ov1_12;
+    slot_tbl_access[12] = QMetaData::Public;
+    slot_tbl[13].name = "goYSlot()";
+    slot_tbl[13].ptr = (QMember)ov1_13;
+    slot_tbl_access[13] = QMetaData::Public;
+    slot_tbl[14].name = "switchLaserSlot(bool)";
+    slot_tbl[14].ptr = (QMember)ov1_14;
+    slot_tbl_access[14] = QMetaData::Public;
+    slot_tbl[15].name = "moveMotors(int,int)";
+    slot_tbl[15].ptr = (QMember)ov1_15;
+    slot_tbl_access[15] = QMetaData::Public;
+    slot_tbl[16].name = "saveGRefSlot()";
+    slot_tbl[16].ptr = (QMember)ov1_16;
+    slot_tbl_access[16] = QMetaData::Public;
+    slot_tbl[17].name = "saveRefSlot()";
+    slot_tbl[17].ptr = (QMember)ov1_17;
+    slot_tbl_access[17] = QMetaData::Public;
+    slot_tbl[18].name = "adjustGRefSlot()";
+    slot_tbl[18].ptr = (QMember)ov1_18;
+    slot_tbl_access[18] = QMetaData::Public;
+    slot_tbl[19].name = "adjustRefSlot()";
+    slot_tbl[19].ptr = (QMember)ov1_19;
+    slot_tbl_access[19] = QMetaData::Public;
+    slot_tbl[20].name = "defocusAllSlot()";
+    slot_tbl[20].ptr = (QMember)ov1_20;
+    slot_tbl_access[20] = QMetaData::Public;
+    slot_tbl[21].name = "focusAllSlot()";
+    slot_tbl[21].ptr = (QMember)ov1_21;
+    slot_tbl_access[21] = QMetaData::Public;
+    slot_tbl[22].name = "defocusSlot()";
+    slot_tbl[22].ptr = (QMember)ov1_22;
+    slot_tbl_access[22] = QMetaData::Public;
+    slot_tbl[23].name = "focusSlot()";
+    slot_tbl[23].ptr = (QMember)ov1_23;
+    slot_tbl_access[23] = QMetaData::Public;
+    slot_tbl[24].name = "clearDarksSlot()";
+    slot_tbl[24].ptr = (QMember)ov1_24;
+    slot_tbl_access[24] = QMetaData::Public;
+    slot_tbl[25].name = "takeDarkSlot()";
+    slot_tbl[25].ptr = (QMember)ov1_25;
+    slot_tbl_access[25] = QMetaData::Public;
+    slot_tbl[26].name = "calibrateSlot()";
+    slot_tbl[26].ptr = (QMember)ov1_26;
+    slot_tbl_access[26] = QMetaData::Public;
+    slot_tbl[27].name = "accept()";
+    slot_tbl[27].ptr = (QMember)ov1_27;
+    slot_tbl_access[27] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"VideoDisplay", "VideoDisplayBase",
+	slot_tbl, 28,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.cpp	(revision 3401)
@@ -0,0 +1,770 @@
+#include <klocale.h>
+/****************************************************************************
+** Form implementation generated from reading ui file './videodisplaybase.ui'
+**
+** Created: Thu Jan 29 00:51:31 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#include "videodisplaybase.h"
+
+#include <qcheckbox.h>
+#include <qframe.h>
+#include <qgroupbox.h>
+#include <qlabel.h>
+#include <qlcdnumber.h>
+#include <qlineedit.h>
+#include <qpushbutton.h>
+#include <qslider.h>
+#include <qlayout.h>
+#include <qvariant.h>
+#include <qtooltip.h>
+#include <qwhatsthis.h>
+
+/* 
+ *  Constructs a VideoDisplayBase which is a child of 'parent', with the 
+ *  name 'name' and widget flags set to 'f' 
+ *
+ *  The dialog will by default be modeless, unless you set 'modal' to
+ *  TRUE to construct a modal dialog.
+ */
+VideoDisplayBase::VideoDisplayBase( QWidget* parent,  const char* name, bool modal, WFlags fl )
+    : QDialog( parent, name, modal, fl )
+{
+    if ( !name )
+	setName( "VideoDisplayBase" );
+    resize( 911, 652 ); 
+    setMaximumSize( QSize( 2000, 2000 ) );
+    setCaption( i18n( "VideoDisplay" ) );
+    VideoDisplayBaseLayout = new QGridLayout( this ); 
+    VideoDisplayBaseLayout->setSpacing( 6 );
+    VideoDisplayBaseLayout->setMargin( 11 );
+
+    Adjustment_Info = new QGroupBox( this, "Adjustment_Info" );
+    Adjustment_Info->setTitle( i18n( "Adjustment" ) );
+    Adjustment_Info->setColumnLayout(0, Qt::Vertical );
+    Adjustment_Info->layout()->setSpacing( 0 );
+    Adjustment_Info->layout()->setMargin( 0 );
+    Adjustment_InfoLayout = new QGridLayout( Adjustment_Info->layout() );
+    Adjustment_InfoLayout->setAlignment( Qt::AlignTop );
+    Adjustment_InfoLayout->setSpacing( 6 );
+    Adjustment_InfoLayout->setMargin( 4 );
+
+    Layout22 = new QHBoxLayout; 
+    Layout22->setSpacing( 0 );
+    Layout22->setMargin( 0 );
+
+    Spot = new QGroupBox( Adjustment_Info, "Spot" );
+    Spot->setTitle( i18n( "Spot" ) );
+    Spot->setColumnLayout(0, Qt::Vertical );
+    Spot->layout()->setSpacing( 0 );
+    Spot->layout()->setMargin( 0 );
+    SpotLayout = new QGridLayout( Spot->layout() );
+    SpotLayout->setAlignment( Qt::AlignTop );
+    SpotLayout->setSpacing( 6 );
+    SpotLayout->setMargin( 11 );
+
+    SpotYLabel = new QLabel( Spot, "SpotYLabel" );
+    SpotYLabel->setText( i18n( "X:" ) );
+
+    SpotLayout->addWidget( SpotYLabel, 0, 0 );
+
+    SpotXLabel = new QLabel( Spot, "SpotXLabel" );
+    SpotXLabel->setText( i18n( "Y:" ) );
+
+    SpotLayout->addWidget( SpotXLabel, 1, 0 );
+
+    SpotY = new QLineEdit( Spot, "SpotY" );
+    SpotY->setEnabled( FALSE );
+    SpotY->setMinimumSize( QSize( 30, 0 ) );
+    SpotY->setMaxLength( 4 );
+
+    SpotLayout->addWidget( SpotY, 1, 1 );
+
+    SpotX = new QLineEdit( Spot, "SpotX" );
+    SpotX->setEnabled( FALSE );
+    SpotX->setMinimumSize( QSize( 30, 0 ) );
+    SpotX->setMaxLength( 4 );
+
+    SpotLayout->addWidget( SpotX, 0, 1 );
+    Layout22->addWidget( Spot );
+
+    ReferenceGroup = new QGroupBox( Adjustment_Info, "ReferenceGroup" );
+    ReferenceGroup->setTitle( i18n( "Ref." ) );
+    ReferenceGroup->setColumnLayout(0, Qt::Vertical );
+    ReferenceGroup->layout()->setSpacing( 0 );
+    ReferenceGroup->layout()->setMargin( 0 );
+    ReferenceGroupLayout = new QGridLayout( ReferenceGroup->layout() );
+    ReferenceGroupLayout->setAlignment( Qt::AlignTop );
+    ReferenceGroupLayout->setSpacing( 6 );
+    ReferenceGroupLayout->setMargin( 11 );
+
+    RefXLabel = new QLabel( ReferenceGroup, "RefXLabel" );
+    RefXLabel->setText( i18n( "X:" ) );
+
+    ReferenceGroupLayout->addWidget( RefXLabel, 0, 0 );
+
+    RefYLabel = new QLabel( ReferenceGroup, "RefYLabel" );
+    RefYLabel->setText( i18n( "Y:" ) );
+
+    ReferenceGroupLayout->addWidget( RefYLabel, 1, 0 );
+
+    RefX = new QLineEdit( ReferenceGroup, "RefX" );
+    RefX->setEnabled( FALSE );
+    RefX->setMinimumSize( QSize( 30, 0 ) );
+    RefX->setText( QString::null );
+    RefX->setMaxLength( 4 );
+
+    ReferenceGroupLayout->addWidget( RefX, 0, 1 );
+
+    RefY = new QLineEdit( ReferenceGroup, "RefY" );
+    RefY->setEnabled( FALSE );
+    RefY->setMinimumSize( QSize( 30, 0 ) );
+    RefY->setMaxLength( 4 );
+
+    ReferenceGroupLayout->addWidget( RefY, 1, 1 );
+    Layout22->addWidget( ReferenceGroup );
+
+    GlobalRefGroup = new QGroupBox( Adjustment_Info, "GlobalRefGroup" );
+    GlobalRefGroup->setTitle( i18n( "Global" ) );
+    GlobalRefGroup->setColumnLayout(0, Qt::Vertical );
+    GlobalRefGroup->layout()->setSpacing( 0 );
+    GlobalRefGroup->layout()->setMargin( 0 );
+    GlobalRefGroupLayout = new QGridLayout( GlobalRefGroup->layout() );
+    GlobalRefGroupLayout->setAlignment( Qt::AlignTop );
+    GlobalRefGroupLayout->setSpacing( 6 );
+    GlobalRefGroupLayout->setMargin( 11 );
+
+    GRefXLabel = new QLabel( GlobalRefGroup, "GRefXLabel" );
+    GRefXLabel->setText( i18n( "X:" ) );
+
+    GlobalRefGroupLayout->addWidget( GRefXLabel, 0, 0 );
+
+    GRefX = new QLineEdit( GlobalRefGroup, "GRefX" );
+    GRefX->setEnabled( FALSE );
+    GRefX->setMinimumSize( QSize( 30, 0 ) );
+    GRefX->setMaxLength( 3 );
+
+    GlobalRefGroupLayout->addWidget( GRefX, 0, 1 );
+
+    GRefYLabel = new QLabel( GlobalRefGroup, "GRefYLabel" );
+    GRefYLabel->setText( i18n( "Y:" ) );
+
+    GlobalRefGroupLayout->addWidget( GRefYLabel, 1, 0 );
+
+    GRefY = new QLineEdit( GlobalRefGroup, "GRefY" );
+    GRefY->setEnabled( FALSE );
+    GRefY->setMinimumSize( QSize( 30, 0 ) );
+    GRefY->setMaxLength( 3 );
+
+    GlobalRefGroupLayout->addWidget( GRefY, 1, 1 );
+    Layout22->addWidget( GlobalRefGroup );
+
+    Adjustment_InfoLayout->addLayout( Layout22, 0, 0 );
+
+    Layout7 = new QGridLayout; 
+    Layout7->setSpacing( 6 );
+    Layout7->setMargin( 0 );
+
+    SaveRefButton = new QPushButton( Adjustment_Info, "SaveRefButton" );
+    SaveRefButton->setText( i18n( "Save as Ref." ) );
+
+    Layout7->addWidget( SaveRefButton, 0, 0 );
+
+    AdjustButton = new QPushButton( Adjustment_Info, "AdjustButton" );
+    AdjustButton->setEnabled( TRUE );
+    AdjustButton->setText( i18n( "Adjust to Ref." ) );
+
+    Layout7->addWidget( AdjustButton, 1, 0 );
+
+    SaveGRefButton = new QPushButton( Adjustment_Info, "SaveGRefButton" );
+    SaveGRefButton->setText( i18n( "Save as Global" ) );
+
+    Layout7->addWidget( SaveGRefButton, 0, 1 );
+
+    GAdjustButton = new QPushButton( Adjustment_Info, "GAdjustButton" );
+    GAdjustButton->setEnabled( TRUE );
+    GAdjustButton->setText( i18n( "Adjust to Global" ) );
+
+    Layout7->addWidget( GAdjustButton, 1, 1 );
+
+    Adjustment_InfoLayout->addLayout( Layout7, 1, 0 );
+
+    VideoDisplayBaseLayout->addWidget( Adjustment_Info, 1, 1 );
+
+    m_videoFrame = new QFrame( this, "m_videoFrame" );
+    m_videoFrame->setMinimumSize( QSize( 640, 480 ) );
+    m_videoFrame->setMaximumSize( QSize( 768, 576 ) );
+    m_videoFrame->setFrameShape( QFrame::NoFrame );
+    m_videoFrame->setFrameShadow( QFrame::Raised );
+
+    VideoDisplayBaseLayout->addWidget( m_videoFrame, 0, 0 );
+
+    Layout13 = new QVBoxLayout; 
+    Layout13->setSpacing( 6 );
+    Layout13->setMargin( 0 );
+
+    Layout11 = new QHBoxLayout; 
+    Layout11->setSpacing( 6 );
+    Layout11->setMargin( 0 );
+
+    Panel_Info = new QGroupBox( this, "Panel_Info" );
+    Panel_Info->setTitle( i18n( "Panel" ) );
+    Panel_Info->setColumnLayout(0, Qt::Vertical );
+    Panel_Info->layout()->setSpacing( 0 );
+    Panel_Info->layout()->setMargin( 0 );
+    Panel_InfoLayout = new QHBoxLayout( Panel_Info->layout() );
+    Panel_InfoLayout->setAlignment( Qt::AlignTop );
+    Panel_InfoLayout->setSpacing( 6 );
+    Panel_InfoLayout->setMargin( 11 );
+
+    Device_Label = new QLabel( Panel_Info, "Device_Label" );
+    Device_Label->setText( i18n( "Device: -" ) );
+    Panel_InfoLayout->addWidget( Device_Label );
+    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Panel_InfoLayout->addItem( spacer );
+
+    Box_Label = new QLabel( Panel_Info, "Box_Label" );
+    Box_Label->setText( i18n( "Box: --" ) );
+    Panel_InfoLayout->addWidget( Box_Label );
+    QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Panel_InfoLayout->addItem( spacer_2 );
+
+    Driver_Label = new QLabel( Panel_Info, "Driver_Label" );
+    Driver_Label->setText( i18n( "Driver: -" ) );
+    Panel_InfoLayout->addWidget( Driver_Label );
+    Layout11->addWidget( Panel_Info );
+    QSpacerItem* spacer_3 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout11->addItem( spacer_3 );
+
+    SpotFindingBox = new QGroupBox( this, "SpotFindingBox" );
+    SpotFindingBox->setTitle( i18n( "Spot finding" ) );
+    SpotFindingBox->setColumnLayout(0, Qt::Vertical );
+    SpotFindingBox->layout()->setSpacing( 0 );
+    SpotFindingBox->layout()->setMargin( 0 );
+    SpotFindingBoxLayout = new QHBoxLayout( SpotFindingBox->layout() );
+    SpotFindingBoxLayout->setAlignment( Qt::AlignTop );
+    SpotFindingBoxLayout->setSpacing( 6 );
+    SpotFindingBoxLayout->setMargin( 11 );
+
+    ThresholdValLabel = new QLabel( SpotFindingBox, "ThresholdValLabel" );
+    ThresholdValLabel->setText( i18n( "Threshold" ) );
+    SpotFindingBoxLayout->addWidget( ThresholdValLabel );
+
+    thresholdSlider = new QSlider( SpotFindingBox, "thresholdSlider" );
+    thresholdSlider->setMinValue( 2 );
+    thresholdSlider->setOrientation( QSlider::Horizontal );
+    SpotFindingBoxLayout->addWidget( thresholdSlider );
+
+    thresholdLCD = new QLCDNumber( SpotFindingBox, "thresholdLCD" );
+    thresholdLCD->setNumDigits( 2 );
+    SpotFindingBoxLayout->addWidget( thresholdLCD );
+    Layout11->addWidget( SpotFindingBox );
+    Layout13->addLayout( Layout11 );
+    QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
+    Layout13->addItem( spacer_4 );
+
+    Layout12 = new QGridLayout; 
+    Layout12->setSpacing( 6 );
+    Layout12->setMargin( 0 );
+
+    ImageControlBox = new QGroupBox( this, "ImageControlBox" );
+    ImageControlBox->setTitle( i18n( "ImageControl" ) );
+    ImageControlBox->setColumnLayout(0, Qt::Vertical );
+    ImageControlBox->layout()->setSpacing( 0 );
+    ImageControlBox->layout()->setMargin( 0 );
+    ImageControlBoxLayout = new QGridLayout( ImageControlBox->layout() );
+    ImageControlBoxLayout->setAlignment( Qt::AlignTop );
+    ImageControlBoxLayout->setSpacing( 6 );
+    ImageControlBoxLayout->setMargin( 11 );
+
+    darksBox = new QCheckBox( ImageControlBox, "darksBox" );
+    darksBox->setText( i18n( "Substract darks" ) );
+
+    ImageControlBoxLayout->addWidget( darksBox, 1, 0 );
+
+    Clear_Darks_Button = new QPushButton( ImageControlBox, "Clear_Darks_Button" );
+    Clear_Darks_Button->setText( i18n( "Clear Darks" ) );
+
+    ImageControlBoxLayout->addMultiCellWidget( Clear_Darks_Button, 1, 1, 3, 4 );
+
+    MaxValLabel = new QLabel( ImageControlBox, "MaxValLabel" );
+    MaxValLabel->setText( i18n( "Max. Val." ) );
+
+    ImageControlBoxLayout->addWidget( MaxValLabel, 0, 1 );
+    QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    ImageControlBoxLayout->addItem( spacer_5, 1, 5 );
+
+    Contrast = new QSlider( ImageControlBox, "Contrast" );
+    Contrast->setMaxValue( 127 );
+    Contrast->setValue( 64 );
+    Contrast->setOrientation( QSlider::Horizontal );
+
+    ImageControlBoxLayout->addWidget( Contrast, 1, 7 );
+
+    Brightness = new QSlider( ImageControlBox, "Brightness" );
+    Brightness->setMaxValue( 255 );
+    Brightness->setValue( 128 );
+    Brightness->setOrientation( QSlider::Horizontal );
+
+    ImageControlBoxLayout->addWidget( Brightness, 0, 7 );
+
+    BrightnessLabel = new QLabel( ImageControlBox, "BrightnessLabel" );
+    BrightnessLabel->setText( i18n( "Brightness:" ) );
+
+    ImageControlBoxLayout->addWidget( BrightnessLabel, 0, 6 );
+
+    Contrast_LCD = new QLCDNumber( ImageControlBox, "Contrast_LCD" );
+    Contrast_LCD->setNumDigits( 3 );
+
+    ImageControlBoxLayout->addWidget( Contrast_LCD, 1, 8 );
+
+    Brightness_LCD = new QLCDNumber( ImageControlBox, "Brightness_LCD" );
+    Brightness_LCD->setNumDigits( 3 );
+
+    ImageControlBoxLayout->addWidget( Brightness_LCD, 0, 8 );
+
+    Take_Dark_Button = new QPushButton( ImageControlBox, "Take_Dark_Button" );
+    Take_Dark_Button->setText( i18n( "Take Dark" ) );
+
+    ImageControlBoxLayout->addMultiCellWidget( Take_Dark_Button, 1, 1, 1, 2 );
+
+    scaleBox = new QCheckBox( ImageControlBox, "scaleBox" );
+    scaleBox->setText( i18n( "Rescale image" ) );
+
+    ImageControlBoxLayout->addWidget( scaleBox, 0, 0 );
+    QSpacerItem* spacer_6 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    ImageControlBoxLayout->addItem( spacer_6, 0, 5 );
+
+    ContrastLabel = new QLabel( ImageControlBox, "ContrastLabel" );
+    ContrastLabel->setText( i18n( "Contrast:" ) );
+
+    ImageControlBoxLayout->addWidget( ContrastLabel, 1, 6 );
+
+    scaleValLCD = new QLCDNumber( ImageControlBox, "scaleValLCD" );
+    scaleValLCD->setNumDigits( 3 );
+
+    ImageControlBoxLayout->addWidget( scaleValLCD, 0, 4 );
+
+    scaleValSlider = new QSlider( ImageControlBox, "scaleValSlider" );
+    scaleValSlider->setMinValue( 10 );
+    scaleValSlider->setMaxValue( 250 );
+    scaleValSlider->setOrientation( QSlider::Horizontal );
+
+    ImageControlBoxLayout->addMultiCellWidget( scaleValSlider, 0, 0, 2, 3 );
+
+    Layout12->addMultiCellWidget( ImageControlBox, 0, 1, 0, 0 );
+
+    m_exitButton = new QPushButton( this, "m_exitButton" );
+    m_exitButton->setText( i18n( "Exit" ) );
+    m_exitButton->setDefault( TRUE );
+
+    Layout12->addWidget( m_exitButton, 1, 1 );
+
+    StoreButton = new QPushButton( this, "StoreButton" );
+    StoreButton->setText( i18n( "Store" ) );
+
+    Layout12->addWidget( StoreButton, 0, 1 );
+    Layout13->addLayout( Layout12 );
+
+    VideoDisplayBaseLayout->addLayout( Layout13, 1, 0 );
+
+    Layout8 = new QVBoxLayout; 
+    Layout8->setSpacing( 6 );
+    Layout8->setMargin( 0 );
+
+    Grabber_Info = new QGroupBox( this, "Grabber_Info" );
+    Grabber_Info->setTitle( i18n( "Frames" ) );
+    Grabber_Info->setColumnLayout(0, Qt::Vertical );
+    Grabber_Info->layout()->setSpacing( 0 );
+    Grabber_Info->layout()->setMargin( 0 );
+    Grabber_InfoLayout = new QHBoxLayout( Grabber_Info->layout() );
+    Grabber_InfoLayout->setAlignment( Qt::AlignTop );
+    Grabber_InfoLayout->setSpacing( 6 );
+    Grabber_InfoLayout->setMargin( 11 );
+
+    GrabbedLabel = new QLabel( Grabber_Info, "GrabbedLabel" );
+    GrabbedLabel->setText( i18n( "Grabbed" ) );
+    Grabber_InfoLayout->addWidget( GrabbedLabel );
+
+    GrabbedLCD = new QLCDNumber( Grabber_Info, "GrabbedLCD" );
+    GrabbedLCD->setNumDigits( 2 );
+    Grabber_InfoLayout->addWidget( GrabbedLCD );
+    QSpacerItem* spacer_7 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Grabber_InfoLayout->addItem( spacer_7 );
+
+    ProcessedLabel = new QLabel( Grabber_Info, "ProcessedLabel" );
+    ProcessedLabel->setText( i18n( "Processed" ) );
+    Grabber_InfoLayout->addWidget( ProcessedLabel );
+
+    ProcessedLCD = new QLCDNumber( Grabber_Info, "ProcessedLCD" );
+    ProcessedLCD->setNumDigits( 2 );
+    Grabber_InfoLayout->addWidget( ProcessedLCD );
+    Layout8->addWidget( Grabber_Info );
+
+    Motors_Box = new QGroupBox( this, "Motors_Box" );
+    Motors_Box->setTitle( i18n( "Motors" ) );
+    Motors_Box->setColumnLayout(0, Qt::Vertical );
+    Motors_Box->layout()->setSpacing( 0 );
+    Motors_Box->layout()->setMargin( 0 );
+    Motors_BoxLayout = new QVBoxLayout( Motors_Box->layout() );
+    Motors_BoxLayout->setAlignment( Qt::AlignTop );
+    Motors_BoxLayout->setSpacing( 6 );
+    Motors_BoxLayout->setMargin( 11 );
+
+    X_Mot_Box = new QGroupBox( Motors_Box, "X_Mot_Box" );
+    QFont X_Mot_Box_font(  X_Mot_Box->font() );
+    X_Mot_Box_font.setFamily( "adobe-helvetica" );
+    X_Mot_Box->setFont( X_Mot_Box_font ); 
+    X_Mot_Box->setTitle( i18n( "X=0" ) );
+    X_Mot_Box->setColumnLayout(0, Qt::Vertical );
+    X_Mot_Box->layout()->setSpacing( 0 );
+    X_Mot_Box->layout()->setMargin( 0 );
+    X_Mot_BoxLayout = new QGridLayout( X_Mot_Box->layout() );
+    X_Mot_BoxLayout->setAlignment( Qt::AlignTop );
+    X_Mot_BoxLayout->setSpacing( 0 );
+    X_Mot_BoxLayout->setMargin( 11 );
+    QSpacerItem* spacer_8 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    X_Mot_BoxLayout->addItem( spacer_8, 1, 1 );
+    QSpacerItem* spacer_9 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    X_Mot_BoxLayout->addItem( spacer_9, 4, 1 );
+
+    X_Go_Button = new QPushButton( X_Mot_Box, "X_Go_Button" );
+    X_Go_Button->setEnabled( TRUE );
+    X_Go_Button->setMinimumSize( QSize( 50, 0 ) );
+    X_Go_Button->setText( i18n( "Go" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Go_Button, 2, 1 );
+
+    X_Dec_10_Button = new QPushButton( X_Mot_Box, "X_Dec_10_Button" );
+    X_Dec_10_Button->setEnabled( TRUE );
+    X_Dec_10_Button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, X_Dec_10_Button->sizePolicy().hasHeightForWidth() ) );
+    X_Dec_10_Button->setMinimumSize( QSize( 0, 0 ) );
+    X_Dec_10_Button->setText( i18n( "-10" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Dec_10_Button, 3, 0 );
+
+    X_Dec_100_Button = new QPushButton( X_Mot_Box, "X_Dec_100_Button" );
+    X_Dec_100_Button->setEnabled( TRUE );
+    X_Dec_100_Button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, X_Dec_100_Button->sizePolicy().hasHeightForWidth() ) );
+    X_Dec_100_Button->setMinimumSize( QSize( 0, 0 ) );
+    X_Dec_100_Button->setText( i18n( "-100" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Dec_100_Button, 4, 0 );
+    QSpacerItem* spacer_10 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    X_Mot_BoxLayout->addItem( spacer_10, 0, 1 );
+    QSpacerItem* spacer_11 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    X_Mot_BoxLayout->addItem( spacer_11, 3, 1 );
+
+    X_Inc_100_Button = new QPushButton( X_Mot_Box, "X_Inc_100_Button" );
+    X_Inc_100_Button->setEnabled( TRUE );
+    X_Inc_100_Button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, X_Inc_100_Button->sizePolicy().hasHeightForWidth() ) );
+    X_Inc_100_Button->setMinimumSize( QSize( 0, 0 ) );
+    QFont X_Inc_100_Button_font(  X_Inc_100_Button->font() );
+    X_Inc_100_Button->setFont( X_Inc_100_Button_font ); 
+    X_Inc_100_Button->setText( i18n( "+100" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Inc_100_Button, 0, 0 );
+
+    X_Goto_Value = new QLineEdit( X_Mot_Box, "X_Goto_Value" );
+    X_Goto_Value->setEnabled( TRUE );
+    X_Goto_Value->setMinimumSize( QSize( 50, 0 ) );
+    X_Goto_Value->setText( i18n( "0" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Goto_Value, 2, 0 );
+
+    X_Inc_10_Button = new QPushButton( X_Mot_Box, "X_Inc_10_Button" );
+    X_Inc_10_Button->setEnabled( TRUE );
+    X_Inc_10_Button->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)0, X_Inc_10_Button->sizePolicy().hasHeightForWidth() ) );
+    X_Inc_10_Button->setMinimumSize( QSize( 0, 0 ) );
+    X_Inc_10_Button->setText( i18n( "+10" ) );
+
+    X_Mot_BoxLayout->addWidget( X_Inc_10_Button, 1, 0 );
+    Motors_BoxLayout->addWidget( X_Mot_Box );
+
+    Y_Mot_Box = new QGroupBox( Motors_Box, "Y_Mot_Box" );
+    QFont Y_Mot_Box_font(  Y_Mot_Box->font() );
+    Y_Mot_Box_font.setFamily( "adobe-helvetica" );
+    Y_Mot_Box->setFont( Y_Mot_Box_font ); 
+    Y_Mot_Box->setTitle( i18n( "Y=0" ) );
+    Y_Mot_Box->setColumnLayout(0, Qt::Vertical );
+    Y_Mot_Box->layout()->setSpacing( 0 );
+    Y_Mot_Box->layout()->setMargin( 0 );
+    Y_Mot_BoxLayout = new QGridLayout( Y_Mot_Box->layout() );
+    Y_Mot_BoxLayout->setAlignment( Qt::AlignTop );
+    Y_Mot_BoxLayout->setSpacing( 0 );
+    Y_Mot_BoxLayout->setMargin( 11 );
+
+    Y_Dec_100_Button = new QPushButton( Y_Mot_Box, "Y_Dec_100_Button" );
+    Y_Dec_100_Button->setEnabled( TRUE );
+    Y_Dec_100_Button->setText( i18n( "-100" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Dec_100_Button, 4, 0 );
+
+    Y_Dec_10_Button = new QPushButton( Y_Mot_Box, "Y_Dec_10_Button" );
+    Y_Dec_10_Button->setEnabled( TRUE );
+    Y_Dec_10_Button->setText( i18n( "-10" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Dec_10_Button, 3, 0 );
+
+    Y_Inc_100_Button = new QPushButton( Y_Mot_Box, "Y_Inc_100_Button" );
+    Y_Inc_100_Button->setEnabled( TRUE );
+    Y_Inc_100_Button->setText( i18n( "+100" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Inc_100_Button, 0, 0 );
+
+    Y_Inc_10_Button = new QPushButton( Y_Mot_Box, "Y_Inc_10_Button" );
+    Y_Inc_10_Button->setEnabled( TRUE );
+    Y_Inc_10_Button->setText( i18n( "+10" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Inc_10_Button, 1, 0 );
+    QSpacerItem* spacer_12 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Y_Mot_BoxLayout->addItem( spacer_12, 0, 1 );
+    QSpacerItem* spacer_13 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Y_Mot_BoxLayout->addItem( spacer_13, 3, 1 );
+    QSpacerItem* spacer_14 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Y_Mot_BoxLayout->addItem( spacer_14, 4, 1 );
+
+    Y_Goto_Value = new QLineEdit( Y_Mot_Box, "Y_Goto_Value" );
+    Y_Goto_Value->setEnabled( TRUE );
+    Y_Goto_Value->setMinimumSize( QSize( 50, 0 ) );
+    Y_Goto_Value->setText( i18n( "0" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Goto_Value, 2, 0 );
+    QSpacerItem* spacer_15 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Y_Mot_BoxLayout->addItem( spacer_15, 1, 1 );
+
+    Y_Go_Button = new QPushButton( Y_Mot_Box, "Y_Go_Button" );
+    Y_Go_Button->setEnabled( TRUE );
+    Y_Go_Button->setMinimumSize( QSize( 50, 0 ) );
+    Y_Go_Button->setText( i18n( "Go" ) );
+
+    Y_Mot_BoxLayout->addWidget( Y_Go_Button, 2, 1 );
+    Motors_BoxLayout->addWidget( Y_Mot_Box );
+
+    Layout9 = new QHBoxLayout; 
+    Layout9->setSpacing( 6 );
+    Layout9->setMargin( 0 );
+
+    FocusButton = new QPushButton( Motors_Box, "FocusButton" );
+    FocusButton->setText( i18n( "Focus" ) );
+    Layout9->addWidget( FocusButton );
+    QSpacerItem* spacer_16 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout9->addItem( spacer_16 );
+
+    DefocusButton = new QPushButton( Motors_Box, "DefocusButton" );
+    DefocusButton->setText( i18n( "Defocus" ) );
+    Layout9->addWidget( DefocusButton );
+    Motors_BoxLayout->addLayout( Layout9 );
+
+    Layout9_2 = new QHBoxLayout; 
+    Layout9_2->setSpacing( 6 );
+    Layout9_2->setMargin( 0 );
+
+    Laser_Check = new QCheckBox( Motors_Box, "Laser_Check" );
+    Laser_Check->setText( i18n( "Laser" ) );
+    Layout9_2->addWidget( Laser_Check );
+    QSpacerItem* spacer_17 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout9_2->addItem( spacer_17 );
+
+    Center_Button = new QPushButton( Motors_Box, "Center_Button" );
+    Center_Button->setEnabled( TRUE );
+    Center_Button->setText( i18n( "Center" ) );
+    Layout9_2->addWidget( Center_Button );
+    Motors_BoxLayout->addLayout( Layout9_2 );
+
+    Layout10 = new QHBoxLayout; 
+    Layout10->setSpacing( 6 );
+    Layout10->setMargin( 0 );
+
+    Calibrate_Button = new QPushButton( Motors_Box, "Calibrate_Button" );
+    Calibrate_Button->setText( i18n( "Calibrate" ) );
+    Layout10->addWidget( Calibrate_Button );
+    QSpacerItem* spacer_18 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
+    Layout10->addItem( spacer_18 );
+
+    DefocusAllButton = new QPushButton( Motors_Box, "DefocusAllButton" );
+    DefocusAllButton->setEnabled( TRUE );
+    DefocusAllButton->setText( i18n( "Defocus all" ) );
+    Layout10->addWidget( DefocusAllButton );
+    Motors_BoxLayout->addLayout( Layout10 );
+    Layout8->addWidget( Motors_Box );
+
+    VideoDisplayBaseLayout->addLayout( Layout8, 0, 1 );
+
+    // signals and slots connections
+    connect( m_exitButton, SIGNAL( clicked() ), this, SLOT( accept() ) );
+    connect( StoreButton, SIGNAL( clicked() ), this, SLOT( storeSlot() ) );
+    connect( X_Inc_100_Button, SIGNAL( clicked() ), this, SLOT( incX100Slot() ) );
+    connect( X_Inc_10_Button, SIGNAL( clicked() ), this, SLOT( incX10Slot() ) );
+    connect( X_Dec_10_Button, SIGNAL( clicked() ), this, SLOT( decX10Slot() ) );
+    connect( X_Dec_100_Button, SIGNAL( clicked() ), this, SLOT( decX100Slot() ) );
+    connect( Y_Inc_100_Button, SIGNAL( clicked() ), this, SLOT( incY100Slot() ) );
+    connect( Y_Inc_10_Button, SIGNAL( clicked() ), this, SLOT( incY10Slot() ) );
+    connect( Y_Dec_10_Button, SIGNAL( clicked() ), this, SLOT( decY10Slot() ) );
+    connect( Y_Dec_100_Button, SIGNAL( clicked() ), this, SLOT( decY100Slot() ) );
+    connect( Laser_Check, SIGNAL( toggled(bool) ), this, SLOT( switchLaserSlot( bool ) ) );
+    connect( X_Go_Button, SIGNAL( clicked() ), this, SLOT( goXSlot() ) );
+    connect( Y_Go_Button, SIGNAL( clicked() ), this, SLOT( goYSlot() ) );
+    connect( SaveRefButton, SIGNAL( clicked() ), this, SLOT( saveRefSlot() ) );
+    connect( SaveGRefButton, SIGNAL( clicked() ), this, SLOT( saveGRefSlot() ) );
+    connect( AdjustButton, SIGNAL( clicked() ), this, SLOT( adjustRefSlot() ) );
+    connect( Center_Button, SIGNAL( clicked() ), this, SLOT( centerSlot() ) );
+    connect( Brightness, SIGNAL( valueChanged(int) ), Brightness_LCD, SLOT( display(int) ) );
+    connect( Contrast, SIGNAL( valueChanged(int) ), Contrast_LCD, SLOT( display(int) ) );
+    connect( Take_Dark_Button, SIGNAL( clicked() ), this, SLOT( takeDarkSlot() ) );
+    connect( Clear_Darks_Button, SIGNAL( clicked() ), this, SLOT( clearDarksSlot() ) );
+    connect( scaleValSlider, SIGNAL( valueChanged(int) ), scaleValLCD, SLOT( display(int) ) );
+    connect( thresholdSlider, SIGNAL( valueChanged(int) ), thresholdLCD, SLOT( display(int) ) );
+    connect( Calibrate_Button, SIGNAL( clicked() ), this, SLOT( calibrateSlot() ) );
+    connect( GAdjustButton, SIGNAL( clicked() ), this, SLOT( adjustGRefSlot() ) );
+    connect( DefocusAllButton, SIGNAL( clicked() ), this, SLOT( defocusAllSlot() ) );
+    connect( FocusButton, SIGNAL( clicked() ), this, SLOT( focusSlot() ) );
+    connect( DefocusButton, SIGNAL( clicked() ), this, SLOT( defocusSlot() ) );
+}
+
+/*  
+ *  Destroys the object and frees any allocated resources
+ */
+VideoDisplayBase::~VideoDisplayBase()
+{
+    // no need to delete child widgets, Qt does it all for us
+}
+
+/*  
+ *  Main event handler. Reimplemented to handle application
+ *  font changes
+ */
+bool VideoDisplayBase::event( QEvent* ev )
+{
+    bool ret = QDialog::event( ev ); 
+    if ( ev->type() == QEvent::ApplicationFontChange ) {
+	QFont X_Mot_Box_font(  X_Mot_Box->font() );
+	X_Mot_Box_font.setFamily( "adobe-helvetica" );
+	X_Mot_Box->setFont( X_Mot_Box_font ); 
+	QFont X_Inc_100_Button_font(  X_Inc_100_Button->font() );
+	X_Inc_100_Button->setFont( X_Inc_100_Button_font ); 
+	QFont Y_Mot_Box_font(  Y_Mot_Box->font() );
+	Y_Mot_Box_font.setFamily( "adobe-helvetica" );
+	Y_Mot_Box->setFont( Y_Mot_Box_font ); 
+    }
+    return ret;
+}
+
+void VideoDisplayBase::adjustGRefSlot()
+{
+    qWarning( "VideoDisplayBase::adjustGRefSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::adjustRefSlot()
+{
+    qWarning( "VideoDisplayBase::adjustRefSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::calibrateSlot()
+{
+    qWarning( "VideoDisplayBase::calibrateSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::centerSlot()
+{
+    qWarning( "VideoDisplayBase::centerSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::clearDarksSlot()
+{
+    qWarning( "VideoDisplayBase::clearDarksSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::decX100Slot()
+{
+    qWarning( "VideoDisplayBase::decX100Slot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::decX10Slot()
+{
+    qWarning( "VideoDisplayBase::decX10Slot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::decY100Slot()
+{
+    qWarning( "VideoDisplayBase::decY100Slot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::decY10Slot()
+{
+    qWarning( "VideoDisplayBase::decY10Slot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::defocusAllSlot()
+{
+    qWarning( "VideoDisplayBase::defocusAllSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::defocusSlot()
+{
+    qWarning( "VideoDisplayBase::defocusSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::goXSlot()
+{
+    qWarning( "VideoDisplayBase::goXSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::goYSlot()
+{
+    qWarning( "VideoDisplayBase::goYSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::incX100Slot()
+{
+    qWarning( "VideoDisplayBase::incX100Slot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::incX10Slot()
+{
+    qWarning( "VideoDisplayBase::incX10Slot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::incY100Slot()
+{
+    qWarning( "VideoDisplayBase::incY100Slot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::incY10Slot()
+{
+    qWarning( "VideoDisplayBase::incY10Slot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::focusSlot()
+{
+    qWarning( "VideoDisplayBase::focusSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::saveGRefSlot()
+{
+    qWarning( "VideoDisplayBase::saveGRefSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::saveRefSlot()
+{
+    qWarning( "VideoDisplayBase::saveRefSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::storeSlot()
+{
+    qWarning( "VideoDisplayBase::storeSlot(): Not implemented yet!" );
+}
+
+void VideoDisplayBase::switchLaserSlot( bool )
+{
+    qWarning( "VideoDisplayBase::switchLaserSlot( bool ): Not implemented yet!" );
+}
+
+void VideoDisplayBase::takeDarkSlot()
+{
+    qWarning( "VideoDisplayBase::takeDarkSlot(): Not implemented yet!" );
+}
+
+#include "videodisplaybase.moc"
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.h	(revision 3401)
@@ -0,0 +1,156 @@
+/****************************************************************************
+** Form interface generated from reading ui file './videodisplaybase.ui'
+**
+** Created: Thu Jan 29 00:50:29 2004
+**      by:  The User Interface Compiler (uic)
+**
+** WARNING! All changes made in this file will be lost!
+****************************************************************************/
+#ifndef VIDEODISPLAYBASE_H
+#define VIDEODISPLAYBASE_H
+
+#include <qvariant.h>
+#include <qdialog.h>
+class QVBoxLayout; 
+class QHBoxLayout; 
+class QGridLayout; 
+class QCheckBox;
+class QFrame;
+class QGroupBox;
+class QLCDNumber;
+class QLabel;
+class QLineEdit;
+class QPushButton;
+class QSlider;
+
+class VideoDisplayBase : public QDialog
+{ 
+    Q_OBJECT
+
+public:
+    VideoDisplayBase( QWidget* parent = 0, const char* name = 0, bool modal = FALSE, WFlags fl = 0 );
+    ~VideoDisplayBase();
+
+    QGroupBox* Adjustment_Info;
+    QGroupBox* Spot;
+    QLabel* SpotYLabel;
+    QLabel* SpotXLabel;
+    QLineEdit* SpotY;
+    QLineEdit* SpotX;
+    QGroupBox* ReferenceGroup;
+    QLabel* RefXLabel;
+    QLabel* RefYLabel;
+    QLineEdit* RefX;
+    QLineEdit* RefY;
+    QGroupBox* GlobalRefGroup;
+    QLabel* GRefXLabel;
+    QLineEdit* GRefX;
+    QLabel* GRefYLabel;
+    QLineEdit* GRefY;
+    QPushButton* SaveRefButton;
+    QPushButton* AdjustButton;
+    QPushButton* SaveGRefButton;
+    QPushButton* GAdjustButton;
+    QFrame* m_videoFrame;
+    QGroupBox* Panel_Info;
+    QLabel* Device_Label;
+    QLabel* Box_Label;
+    QLabel* Driver_Label;
+    QGroupBox* SpotFindingBox;
+    QLabel* ThresholdValLabel;
+    QSlider* thresholdSlider;
+    QLCDNumber* thresholdLCD;
+    QGroupBox* ImageControlBox;
+    QCheckBox* darksBox;
+    QPushButton* Clear_Darks_Button;
+    QLabel* MaxValLabel;
+    QSlider* Contrast;
+    QSlider* Brightness;
+    QLabel* BrightnessLabel;
+    QLCDNumber* Contrast_LCD;
+    QLCDNumber* Brightness_LCD;
+    QPushButton* Take_Dark_Button;
+    QCheckBox* scaleBox;
+    QLabel* ContrastLabel;
+    QLCDNumber* scaleValLCD;
+    QSlider* scaleValSlider;
+    QPushButton* m_exitButton;
+    QPushButton* StoreButton;
+    QGroupBox* Grabber_Info;
+    QLabel* GrabbedLabel;
+    QLCDNumber* GrabbedLCD;
+    QLabel* ProcessedLabel;
+    QLCDNumber* ProcessedLCD;
+    QGroupBox* Motors_Box;
+    QGroupBox* X_Mot_Box;
+    QPushButton* X_Go_Button;
+    QPushButton* X_Dec_10_Button;
+    QPushButton* X_Dec_100_Button;
+    QPushButton* X_Inc_100_Button;
+    QLineEdit* X_Goto_Value;
+    QPushButton* X_Inc_10_Button;
+    QGroupBox* Y_Mot_Box;
+    QPushButton* Y_Dec_100_Button;
+    QPushButton* Y_Dec_10_Button;
+    QPushButton* Y_Inc_100_Button;
+    QPushButton* Y_Inc_10_Button;
+    QLineEdit* Y_Goto_Value;
+    QPushButton* Y_Go_Button;
+    QPushButton* FocusButton;
+    QPushButton* DefocusButton;
+    QCheckBox* Laser_Check;
+    QPushButton* Center_Button;
+    QPushButton* Calibrate_Button;
+    QPushButton* DefocusAllButton;
+
+public slots:
+    virtual void adjustGRefSlot();
+    virtual void adjustRefSlot();
+    virtual void calibrateSlot();
+    virtual void centerSlot();
+    virtual void clearDarksSlot();
+    virtual void decX100Slot();
+    virtual void decX10Slot();
+    virtual void decY100Slot();
+    virtual void decY10Slot();
+    virtual void defocusAllSlot();
+    virtual void defocusSlot();
+    virtual void goXSlot();
+    virtual void goYSlot();
+    virtual void incX100Slot();
+    virtual void incX10Slot();
+    virtual void incY100Slot();
+    virtual void incY10Slot();
+    virtual void focusSlot();
+    virtual void saveGRefSlot();
+    virtual void saveRefSlot();
+    virtual void storeSlot();
+    virtual void switchLaserSlot( bool );
+    virtual void takeDarkSlot();
+
+protected:
+    QGridLayout* VideoDisplayBaseLayout;
+    QGridLayout* Adjustment_InfoLayout;
+    QHBoxLayout* Layout22;
+    QGridLayout* SpotLayout;
+    QGridLayout* ReferenceGroupLayout;
+    QGridLayout* GlobalRefGroupLayout;
+    QGridLayout* Layout7;
+    QVBoxLayout* Layout13;
+    QHBoxLayout* Layout11;
+    QHBoxLayout* Panel_InfoLayout;
+    QHBoxLayout* SpotFindingBoxLayout;
+    QGridLayout* Layout12;
+    QGridLayout* ImageControlBoxLayout;
+    QVBoxLayout* Layout8;
+    QHBoxLayout* Grabber_InfoLayout;
+    QVBoxLayout* Motors_BoxLayout;
+    QGridLayout* X_Mot_BoxLayout;
+    QGridLayout* Y_Mot_BoxLayout;
+    QHBoxLayout* Layout9;
+    QHBoxLayout* Layout9_2;
+    QHBoxLayout* Layout10;
+    bool event( QEvent* );
+};
+
+#endif // VIDEODISPLAYBASE_H
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.moc
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.moc	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.moc	(revision 3401)
@@ -0,0 +1,235 @@
+/****************************************************************************
+** VideoDisplayBase meta object code from reading C++ file 'videodisplaybase.h'
+**
+** Created: Thu Jan 29 00:51:31 2004
+**      by: The Qt MOC ($Id: videodisplaybase.moc,v 1.1 2004-03-04 16:31:19 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "videodisplaybase.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *VideoDisplayBase::className() const
+{
+    return "VideoDisplayBase";
+}
+
+QMetaObject *VideoDisplayBase::metaObj = 0;
+
+void VideoDisplayBase::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QDialog::className(), "QDialog") != 0 )
+	badSuperclassWarning("VideoDisplayBase","QDialog");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString VideoDisplayBase::tr(const char* s)
+{
+    return qApp->translate( "VideoDisplayBase", s, 0 );
+}
+
+QString VideoDisplayBase::tr(const char* s, const char * c)
+{
+    return qApp->translate( "VideoDisplayBase", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* VideoDisplayBase::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QDialog::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (VideoDisplayBase::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    typedef void (VideoDisplayBase::*m1_t1)();
+    typedef void (QObject::*om1_t1)();
+    typedef void (VideoDisplayBase::*m1_t2)();
+    typedef void (QObject::*om1_t2)();
+    typedef void (VideoDisplayBase::*m1_t3)();
+    typedef void (QObject::*om1_t3)();
+    typedef void (VideoDisplayBase::*m1_t4)();
+    typedef void (QObject::*om1_t4)();
+    typedef void (VideoDisplayBase::*m1_t5)();
+    typedef void (QObject::*om1_t5)();
+    typedef void (VideoDisplayBase::*m1_t6)();
+    typedef void (QObject::*om1_t6)();
+    typedef void (VideoDisplayBase::*m1_t7)();
+    typedef void (QObject::*om1_t7)();
+    typedef void (VideoDisplayBase::*m1_t8)();
+    typedef void (QObject::*om1_t8)();
+    typedef void (VideoDisplayBase::*m1_t9)();
+    typedef void (QObject::*om1_t9)();
+    typedef void (VideoDisplayBase::*m1_t10)();
+    typedef void (QObject::*om1_t10)();
+    typedef void (VideoDisplayBase::*m1_t11)();
+    typedef void (QObject::*om1_t11)();
+    typedef void (VideoDisplayBase::*m1_t12)();
+    typedef void (QObject::*om1_t12)();
+    typedef void (VideoDisplayBase::*m1_t13)();
+    typedef void (QObject::*om1_t13)();
+    typedef void (VideoDisplayBase::*m1_t14)();
+    typedef void (QObject::*om1_t14)();
+    typedef void (VideoDisplayBase::*m1_t15)();
+    typedef void (QObject::*om1_t15)();
+    typedef void (VideoDisplayBase::*m1_t16)();
+    typedef void (QObject::*om1_t16)();
+    typedef void (VideoDisplayBase::*m1_t17)();
+    typedef void (QObject::*om1_t17)();
+    typedef void (VideoDisplayBase::*m1_t18)();
+    typedef void (QObject::*om1_t18)();
+    typedef void (VideoDisplayBase::*m1_t19)();
+    typedef void (QObject::*om1_t19)();
+    typedef void (VideoDisplayBase::*m1_t20)();
+    typedef void (QObject::*om1_t20)();
+    typedef void (VideoDisplayBase::*m1_t21)(bool);
+    typedef void (QObject::*om1_t21)(bool);
+    typedef void (VideoDisplayBase::*m1_t22)();
+    typedef void (QObject::*om1_t22)();
+    m1_t0 v1_0 = &VideoDisplayBase::adjustGRefSlot;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &VideoDisplayBase::adjustRefSlot;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &VideoDisplayBase::calibrateSlot;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &VideoDisplayBase::centerSlot;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    m1_t4 v1_4 = &VideoDisplayBase::clearDarksSlot;
+    om1_t4 ov1_4 = (om1_t4)v1_4;
+    m1_t5 v1_5 = &VideoDisplayBase::decX100Slot;
+    om1_t5 ov1_5 = (om1_t5)v1_5;
+    m1_t6 v1_6 = &VideoDisplayBase::decX10Slot;
+    om1_t6 ov1_6 = (om1_t6)v1_6;
+    m1_t7 v1_7 = &VideoDisplayBase::decY100Slot;
+    om1_t7 ov1_7 = (om1_t7)v1_7;
+    m1_t8 v1_8 = &VideoDisplayBase::decY10Slot;
+    om1_t8 ov1_8 = (om1_t8)v1_8;
+    m1_t9 v1_9 = &VideoDisplayBase::defocusAllSlot;
+    om1_t9 ov1_9 = (om1_t9)v1_9;
+    m1_t10 v1_10 = &VideoDisplayBase::defocusSlot;
+    om1_t10 ov1_10 = (om1_t10)v1_10;
+    m1_t11 v1_11 = &VideoDisplayBase::goXSlot;
+    om1_t11 ov1_11 = (om1_t11)v1_11;
+    m1_t12 v1_12 = &VideoDisplayBase::goYSlot;
+    om1_t12 ov1_12 = (om1_t12)v1_12;
+    m1_t13 v1_13 = &VideoDisplayBase::incX100Slot;
+    om1_t13 ov1_13 = (om1_t13)v1_13;
+    m1_t14 v1_14 = &VideoDisplayBase::incX10Slot;
+    om1_t14 ov1_14 = (om1_t14)v1_14;
+    m1_t15 v1_15 = &VideoDisplayBase::incY100Slot;
+    om1_t15 ov1_15 = (om1_t15)v1_15;
+    m1_t16 v1_16 = &VideoDisplayBase::incY10Slot;
+    om1_t16 ov1_16 = (om1_t16)v1_16;
+    m1_t17 v1_17 = &VideoDisplayBase::focusSlot;
+    om1_t17 ov1_17 = (om1_t17)v1_17;
+    m1_t18 v1_18 = &VideoDisplayBase::saveGRefSlot;
+    om1_t18 ov1_18 = (om1_t18)v1_18;
+    m1_t19 v1_19 = &VideoDisplayBase::saveRefSlot;
+    om1_t19 ov1_19 = (om1_t19)v1_19;
+    m1_t20 v1_20 = &VideoDisplayBase::storeSlot;
+    om1_t20 ov1_20 = (om1_t20)v1_20;
+    m1_t21 v1_21 = &VideoDisplayBase::switchLaserSlot;
+    om1_t21 ov1_21 = (om1_t21)v1_21;
+    m1_t22 v1_22 = &VideoDisplayBase::takeDarkSlot;
+    om1_t22 ov1_22 = (om1_t22)v1_22;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(23);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(23);
+    slot_tbl[0].name = "adjustGRefSlot()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "adjustRefSlot()";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    slot_tbl[2].name = "calibrateSlot()";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Public;
+    slot_tbl[3].name = "centerSlot()";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Public;
+    slot_tbl[4].name = "clearDarksSlot()";
+    slot_tbl[4].ptr = (QMember)ov1_4;
+    slot_tbl_access[4] = QMetaData::Public;
+    slot_tbl[5].name = "decX100Slot()";
+    slot_tbl[5].ptr = (QMember)ov1_5;
+    slot_tbl_access[5] = QMetaData::Public;
+    slot_tbl[6].name = "decX10Slot()";
+    slot_tbl[6].ptr = (QMember)ov1_6;
+    slot_tbl_access[6] = QMetaData::Public;
+    slot_tbl[7].name = "decY100Slot()";
+    slot_tbl[7].ptr = (QMember)ov1_7;
+    slot_tbl_access[7] = QMetaData::Public;
+    slot_tbl[8].name = "decY10Slot()";
+    slot_tbl[8].ptr = (QMember)ov1_8;
+    slot_tbl_access[8] = QMetaData::Public;
+    slot_tbl[9].name = "defocusAllSlot()";
+    slot_tbl[9].ptr = (QMember)ov1_9;
+    slot_tbl_access[9] = QMetaData::Public;
+    slot_tbl[10].name = "defocusSlot()";
+    slot_tbl[10].ptr = (QMember)ov1_10;
+    slot_tbl_access[10] = QMetaData::Public;
+    slot_tbl[11].name = "goXSlot()";
+    slot_tbl[11].ptr = (QMember)ov1_11;
+    slot_tbl_access[11] = QMetaData::Public;
+    slot_tbl[12].name = "goYSlot()";
+    slot_tbl[12].ptr = (QMember)ov1_12;
+    slot_tbl_access[12] = QMetaData::Public;
+    slot_tbl[13].name = "incX100Slot()";
+    slot_tbl[13].ptr = (QMember)ov1_13;
+    slot_tbl_access[13] = QMetaData::Public;
+    slot_tbl[14].name = "incX10Slot()";
+    slot_tbl[14].ptr = (QMember)ov1_14;
+    slot_tbl_access[14] = QMetaData::Public;
+    slot_tbl[15].name = "incY100Slot()";
+    slot_tbl[15].ptr = (QMember)ov1_15;
+    slot_tbl_access[15] = QMetaData::Public;
+    slot_tbl[16].name = "incY10Slot()";
+    slot_tbl[16].ptr = (QMember)ov1_16;
+    slot_tbl_access[16] = QMetaData::Public;
+    slot_tbl[17].name = "focusSlot()";
+    slot_tbl[17].ptr = (QMember)ov1_17;
+    slot_tbl_access[17] = QMetaData::Public;
+    slot_tbl[18].name = "saveGRefSlot()";
+    slot_tbl[18].ptr = (QMember)ov1_18;
+    slot_tbl_access[18] = QMetaData::Public;
+    slot_tbl[19].name = "saveRefSlot()";
+    slot_tbl[19].ptr = (QMember)ov1_19;
+    slot_tbl_access[19] = QMetaData::Public;
+    slot_tbl[20].name = "storeSlot()";
+    slot_tbl[20].ptr = (QMember)ov1_20;
+    slot_tbl_access[20] = QMetaData::Public;
+    slot_tbl[21].name = "switchLaserSlot(bool)";
+    slot_tbl[21].ptr = (QMember)ov1_21;
+    slot_tbl_access[21] = QMetaData::Public;
+    slot_tbl[22].name = "takeDarkSlot()";
+    slot_tbl[22].ptr = (QMember)ov1_22;
+    slot_tbl_access[22] = QMetaData::Public;
+    metaObj = QMetaObject::new_metaobject(
+	"VideoDisplayBase", "QDialog",
+	slot_tbl, 23,
+	0, 0,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.ui
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.ui	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videodisplaybase.ui	(revision 3401)
@@ -0,0 +1,1979 @@
+<!DOCTYPE UI><UI>
+<class>VideoDisplayBase</class>
+<widget>
+    <class>QDialog</class>
+    <property stdset="1">
+        <name>name</name>
+        <cstring>VideoDisplayBase</cstring>
+    </property>
+    <property stdset="1">
+        <name>geometry</name>
+        <rect>
+            <x>0</x>
+            <y>0</y>
+            <width>911</width>
+            <height>652</height>
+        </rect>
+    </property>
+    <property stdset="1">
+        <name>maximumSize</name>
+        <size>
+            <width>2000</width>
+            <height>2000</height>
+        </size>
+    </property>
+    <property stdset="1">
+        <name>caption</name>
+        <string>VideoDisplay</string>
+    </property>
+    <property>
+        <name>layoutMargin</name>
+    </property>
+    <property>
+        <name>layoutSpacing</name>
+    </property>
+    <grid>
+        <property stdset="1">
+            <name>margin</name>
+            <number>11</number>
+        </property>
+        <property stdset="1">
+            <name>spacing</name>
+            <number>6</number>
+        </property>
+        <widget row="1"  column="1" >
+            <class>QGroupBox</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Adjustment_Info</cstring>
+            </property>
+            <property stdset="1">
+                <name>title</name>
+                <string>Adjustment</string>
+            </property>
+            <property>
+                <name>layoutMargin</name>
+            </property>
+            <grid>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>4</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget row="0"  column="0" >
+                    <class>QLayoutWidget</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Layout22</cstring>
+                    </property>
+                    <property>
+                        <name>layoutSpacing</name>
+                    </property>
+                    <hbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>0</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>0</number>
+                        </property>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Spot</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Spot</string>
+                            </property>
+                            <property>
+                                <name>layoutMargin</name>
+                            </property>
+                            <property>
+                                <name>layoutSpacing</name>
+                            </property>
+                            <grid>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget row="0"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>SpotYLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>X:</string>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>SpotXLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Y:</string>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>SpotY</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>30</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>4</number>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>SpotX</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>30</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>4</number>
+                                    </property>
+                                </widget>
+                            </grid>
+                        </widget>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>ReferenceGroup</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Ref.</string>
+                            </property>
+                            <property>
+                                <name>layoutMargin</name>
+                            </property>
+                            <property>
+                                <name>layoutSpacing</name>
+                            </property>
+                            <grid>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget row="0"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>RefXLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>X:</string>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>RefYLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Y:</string>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>RefX</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>30</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string></string>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>4</number>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>RefY</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>30</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>4</number>
+                                    </property>
+                                </widget>
+                            </grid>
+                        </widget>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>GlobalRefGroup</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Global</string>
+                            </property>
+                            <property>
+                                <name>layoutMargin</name>
+                            </property>
+                            <property>
+                                <name>layoutSpacing</name>
+                            </property>
+                            <grid>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget row="0"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>GRefXLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>X:</string>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>GRefX</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>30</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>3</number>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="0" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>GRefYLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Y:</string>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="1" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>GRefY</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>false</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>30</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxLength</name>
+                                        <number>3</number>
+                                    </property>
+                                </widget>
+                            </grid>
+                        </widget>
+                    </hbox>
+                </widget>
+                <widget row="1"  column="0" >
+                    <class>QLayoutWidget</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Layout7</cstring>
+                    </property>
+                    <grid>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>0</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget row="0"  column="0" >
+                            <class>QPushButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>SaveRefButton</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Save as Ref.</string>
+                            </property>
+                        </widget>
+                        <widget row="1"  column="0" >
+                            <class>QPushButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>AdjustButton</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>enabled</name>
+                                <bool>true</bool>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Adjust to Ref.</string>
+                            </property>
+                        </widget>
+                        <widget row="0"  column="1" >
+                            <class>QPushButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>SaveGRefButton</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Save as Global</string>
+                            </property>
+                        </widget>
+                        <widget row="1"  column="1" >
+                            <class>QPushButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>GAdjustButton</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>enabled</name>
+                                <bool>true</bool>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Adjust to Global</string>
+                            </property>
+                        </widget>
+                    </grid>
+                </widget>
+            </grid>
+        </widget>
+        <widget row="0"  column="0" >
+            <class>QFrame</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>m_videoFrame</cstring>
+            </property>
+            <property stdset="1">
+                <name>minimumSize</name>
+                <size>
+                    <width>640</width>
+                    <height>480</height>
+                </size>
+            </property>
+            <property stdset="1">
+                <name>maximumSize</name>
+                <size>
+                    <width>768</width>
+                    <height>576</height>
+                </size>
+            </property>
+            <property stdset="1">
+                <name>frameShape</name>
+                <enum>NoFrame</enum>
+            </property>
+            <property stdset="1">
+                <name>frameShadow</name>
+                <enum>Raised</enum>
+            </property>
+        </widget>
+        <widget row="1"  column="0" >
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout13</cstring>
+            </property>
+            <vbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QLayoutWidget</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Layout11</cstring>
+                    </property>
+                    <hbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>0</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Panel_Info</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Panel</string>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Device_Label</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Device: -</string>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer17_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Box_Label</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Box: --</string>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer18_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Driver_Label</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Driver: -</string>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <spacer>
+                            <property>
+                                <name>name</name>
+                                <cstring>Spacer37</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>sizeType</name>
+                                <enum>Expanding</enum>
+                            </property>
+                            <property>
+                                <name>sizeHint</name>
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>SpotFindingBox</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Spot finding</string>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>ThresholdValLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Threshold</string>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QSlider</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>thresholdSlider</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minValue</name>
+                                        <number>2</number>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                </widget>
+                                <widget>
+                                    <class>QLCDNumber</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>thresholdLCD</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>numDigits</name>
+                                        <number>2</number>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                    </hbox>
+                </widget>
+                <spacer>
+                    <property>
+                        <name>name</name>
+                        <cstring>Spacer93</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>orientation</name>
+                        <enum>Vertical</enum>
+                    </property>
+                    <property stdset="1">
+                        <name>sizeType</name>
+                        <enum>Expanding</enum>
+                    </property>
+                    <property>
+                        <name>sizeHint</name>
+                        <size>
+                            <width>20</width>
+                            <height>20</height>
+                        </size>
+                    </property>
+                </spacer>
+                <widget>
+                    <class>QLayoutWidget</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Layout12</cstring>
+                    </property>
+                    <grid>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>0</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget row="0"  column="0"  rowspan="2"  colspan="1" >
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>ImageControlBox</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>ImageControl</string>
+                            </property>
+                            <grid>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget row="1"  column="0" >
+                                    <class>QCheckBox</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>darksBox</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Substract darks</string>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="3"  rowspan="1"  colspan="2" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Clear_Darks_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Clear Darks</string>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="1" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>MaxValLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Max. Val.</string>
+                                    </property>
+                                </widget>
+                                <spacer row="1"  column="5" >
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer1_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget row="1"  column="7" >
+                                    <class>QSlider</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Contrast</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxValue</name>
+                                        <number>127</number>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>value</name>
+                                        <number>64</number>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="7" >
+                                    <class>QSlider</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Brightness</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxValue</name>
+                                        <number>255</number>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>value</name>
+                                        <number>128</number>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="6" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>BrightnessLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Brightness:</string>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="8" >
+                                    <class>QLCDNumber</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Contrast_LCD</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>numDigits</name>
+                                        <number>3</number>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="8" >
+                                    <class>QLCDNumber</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Brightness_LCD</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>numDigits</name>
+                                        <number>3</number>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="1"  rowspan="1"  colspan="2" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Take_Dark_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Take Dark</string>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="0" >
+                                    <class>QCheckBox</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>scaleBox</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Rescale image</string>
+                                    </property>
+                                </widget>
+                                <spacer row="0"  column="5" >
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer1</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget row="1"  column="6" >
+                                    <class>QLabel</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>ContrastLabel</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Contrast:</string>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="4" >
+                                    <class>QLCDNumber</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>scaleValLCD</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>numDigits</name>
+                                        <number>3</number>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="2"  rowspan="1"  colspan="2" >
+                                    <class>QSlider</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>scaleValSlider</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minValue</name>
+                                        <number>10</number>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>maxValue</name>
+                                        <number>250</number>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                </widget>
+                            </grid>
+                        </widget>
+                        <widget row="1"  column="1" >
+                            <class>QPushButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>m_exitButton</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Exit</string>
+                            </property>
+                            <property stdset="1">
+                                <name>default</name>
+                                <bool>true</bool>
+                            </property>
+                        </widget>
+                        <widget row="0"  column="1" >
+                            <class>QPushButton</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>StoreButton</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Store</string>
+                            </property>
+                        </widget>
+                    </grid>
+                </widget>
+            </vbox>
+        </widget>
+        <widget row="0"  column="1" >
+            <class>QLayoutWidget</class>
+            <property stdset="1">
+                <name>name</name>
+                <cstring>Layout8</cstring>
+            </property>
+            <vbox>
+                <property stdset="1">
+                    <name>margin</name>
+                    <number>0</number>
+                </property>
+                <property stdset="1">
+                    <name>spacing</name>
+                    <number>6</number>
+                </property>
+                <widget>
+                    <class>QGroupBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Grabber_Info</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>title</name>
+                        <string>Frames</string>
+                    </property>
+                    <hbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>11</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>GrabbedLabel</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Grabbed</string>
+                            </property>
+                        </widget>
+                        <widget>
+                            <class>QLCDNumber</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>GrabbedLCD</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>numDigits</name>
+                                <number>2</number>
+                            </property>
+                        </widget>
+                        <spacer>
+                            <property>
+                                <name>name</name>
+                                <cstring>Spacer18_4_2_2</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>orientation</name>
+                                <enum>Horizontal</enum>
+                            </property>
+                            <property stdset="1">
+                                <name>sizeType</name>
+                                <enum>Expanding</enum>
+                            </property>
+                            <property>
+                                <name>sizeHint</name>
+                                <size>
+                                    <width>20</width>
+                                    <height>20</height>
+                                </size>
+                            </property>
+                        </spacer>
+                        <widget>
+                            <class>QLabel</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>ProcessedLabel</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>text</name>
+                                <string>Processed</string>
+                            </property>
+                        </widget>
+                        <widget>
+                            <class>QLCDNumber</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>ProcessedLCD</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>numDigits</name>
+                                <number>2</number>
+                            </property>
+                        </widget>
+                    </hbox>
+                </widget>
+                <widget>
+                    <class>QGroupBox</class>
+                    <property stdset="1">
+                        <name>name</name>
+                        <cstring>Motors_Box</cstring>
+                    </property>
+                    <property stdset="1">
+                        <name>title</name>
+                        <string>Motors</string>
+                    </property>
+                    <vbox>
+                        <property stdset="1">
+                            <name>margin</name>
+                            <number>11</number>
+                        </property>
+                        <property stdset="1">
+                            <name>spacing</name>
+                            <number>6</number>
+                        </property>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>X_Mot_Box</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>font</name>
+                                <font>
+                                    <family>adobe-helvetica</family>
+                                </font>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>X=0</string>
+                            </property>
+                            <property>
+                                <name>layoutMargin</name>
+                            </property>
+                            <property>
+                                <name>layoutSpacing</name>
+                            </property>
+                            <grid>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>0</number>
+                                </property>
+                                <spacer row="1"  column="1" >
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer4</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <spacer row="4"  column="1" >
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer4_2_2_3</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget row="2"  column="1" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>X_Go_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>50</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Go</string>
+                                    </property>
+                                </widget>
+                                <widget row="3"  column="0" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>X_Dec_10_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizePolicy</name>
+                                        <sizepolicy>
+                                            <hsizetype>1</hsizetype>
+                                            <vsizetype>0</vsizetype>
+                                        </sizepolicy>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>0</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>-10</string>
+                                    </property>
+                                </widget>
+                                <widget row="4"  column="0" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>X_Dec_100_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizePolicy</name>
+                                        <sizepolicy>
+                                            <hsizetype>1</hsizetype>
+                                            <vsizetype>0</vsizetype>
+                                        </sizepolicy>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>0</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>-100</string>
+                                    </property>
+                                </widget>
+                                <spacer row="0"  column="1" >
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer3</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <spacer row="3"  column="1" >
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer4_2_2_2</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget row="0"  column="0" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>X_Inc_100_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizePolicy</name>
+                                        <sizepolicy>
+                                            <hsizetype>1</hsizetype>
+                                            <vsizetype>0</vsizetype>
+                                        </sizepolicy>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>0</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>font</name>
+                                        <font>
+                                        </font>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>+100</string>
+                                    </property>
+                                </widget>
+                                <widget row="2"  column="0" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>X_Goto_Value</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>50</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>0</string>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="0" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>X_Inc_10_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizePolicy</name>
+                                        <sizepolicy>
+                                            <hsizetype>1</hsizetype>
+                                            <vsizetype>0</vsizetype>
+                                        </sizepolicy>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>0</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>+10</string>
+                                    </property>
+                                </widget>
+                            </grid>
+                        </widget>
+                        <widget>
+                            <class>QGroupBox</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Y_Mot_Box</cstring>
+                            </property>
+                            <property stdset="1">
+                                <name>font</name>
+                                <font>
+                                    <family>adobe-helvetica</family>
+                                </font>
+                            </property>
+                            <property stdset="1">
+                                <name>title</name>
+                                <string>Y=0</string>
+                            </property>
+                            <property>
+                                <name>layoutSpacing</name>
+                            </property>
+                            <grid>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>11</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>0</number>
+                                </property>
+                                <widget row="4"  column="0" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Y_Dec_100_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>-100</string>
+                                    </property>
+                                </widget>
+                                <widget row="3"  column="0" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Y_Dec_10_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>-10</string>
+                                    </property>
+                                </widget>
+                                <widget row="0"  column="0" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Y_Inc_100_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>+100</string>
+                                    </property>
+                                </widget>
+                                <widget row="1"  column="0" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Y_Inc_10_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>+10</string>
+                                    </property>
+                                </widget>
+                                <spacer row="0"  column="1" >
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer11</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <spacer row="3"  column="1" >
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer15</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <spacer row="4"  column="1" >
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer16</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget row="2"  column="0" >
+                                    <class>QLineEdit</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Y_Goto_Value</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>50</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>0</string>
+                                    </property>
+                                </widget>
+                                <spacer row="1"  column="1" >
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer12</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget row="2"  column="1" >
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Y_Go_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>minimumSize</name>
+                                        <size>
+                                            <width>50</width>
+                                            <height>0</height>
+                                        </size>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Go</string>
+                                    </property>
+                                </widget>
+                            </grid>
+                        </widget>
+                        <widget>
+                            <class>QLayoutWidget</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Layout9</cstring>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>0</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>FocusButton</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Focus</string>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer18</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>DefocusButton</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Defocus</string>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <widget>
+                            <class>QLayoutWidget</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Layout9</cstring>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>0</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QCheckBox</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Laser_Check</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Laser</string>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer17</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Center_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Center</string>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                        <widget>
+                            <class>QLayoutWidget</class>
+                            <property stdset="1">
+                                <name>name</name>
+                                <cstring>Layout10</cstring>
+                            </property>
+                            <hbox>
+                                <property stdset="1">
+                                    <name>margin</name>
+                                    <number>0</number>
+                                </property>
+                                <property stdset="1">
+                                    <name>spacing</name>
+                                    <number>6</number>
+                                </property>
+                                <widget>
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>Calibrate_Button</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Calibrate</string>
+                                    </property>
+                                </widget>
+                                <spacer>
+                                    <property>
+                                        <name>name</name>
+                                        <cstring>Spacer17_3</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>orientation</name>
+                                        <enum>Horizontal</enum>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>sizeType</name>
+                                        <enum>Expanding</enum>
+                                    </property>
+                                    <property>
+                                        <name>sizeHint</name>
+                                        <size>
+                                            <width>20</width>
+                                            <height>20</height>
+                                        </size>
+                                    </property>
+                                </spacer>
+                                <widget>
+                                    <class>QPushButton</class>
+                                    <property stdset="1">
+                                        <name>name</name>
+                                        <cstring>DefocusAllButton</cstring>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>enabled</name>
+                                        <bool>true</bool>
+                                    </property>
+                                    <property stdset="1">
+                                        <name>text</name>
+                                        <string>Defocus all</string>
+                                    </property>
+                                </widget>
+                            </hbox>
+                        </widget>
+                    </vbox>
+                </widget>
+            </vbox>
+        </widget>
+    </grid>
+</widget>
+<connections>
+    <connection>
+        <sender>m_exitButton</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>accept()</slot>
+    </connection>
+    <connection>
+        <sender>StoreButton</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>storeSlot()</slot>
+    </connection>
+    <connection>
+        <sender>X_Inc_100_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>incX100Slot()</slot>
+    </connection>
+    <connection>
+        <sender>X_Inc_10_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>incX10Slot()</slot>
+    </connection>
+    <connection>
+        <sender>X_Dec_10_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>decX10Slot()</slot>
+    </connection>
+    <connection>
+        <sender>X_Dec_100_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>decX100Slot()</slot>
+    </connection>
+    <connection>
+        <sender>Y_Inc_100_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>incY100Slot()</slot>
+    </connection>
+    <connection>
+        <sender>Y_Inc_10_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>incY10Slot()</slot>
+    </connection>
+    <connection>
+        <sender>Y_Dec_10_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>decY10Slot()</slot>
+    </connection>
+    <connection>
+        <sender>Y_Dec_100_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>decY100Slot()</slot>
+    </connection>
+    <connection>
+        <sender>Laser_Check</sender>
+        <signal>toggled(bool)</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>switchLaserSlot( bool )</slot>
+    </connection>
+    <connection>
+        <sender>X_Go_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>goXSlot()</slot>
+    </connection>
+    <connection>
+        <sender>Y_Go_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>goYSlot()</slot>
+    </connection>
+    <connection>
+        <sender>SaveRefButton</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>saveRefSlot()</slot>
+    </connection>
+    <connection>
+        <sender>SaveGRefButton</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>saveGRefSlot()</slot>
+    </connection>
+    <connection>
+        <sender>AdjustButton</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>adjustRefSlot()</slot>
+    </connection>
+    <connection>
+        <sender>Center_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>centerSlot()</slot>
+    </connection>
+    <connection>
+        <sender>Brightness</sender>
+        <signal>valueChanged(int)</signal>
+        <receiver>Brightness_LCD</receiver>
+        <slot>display(int)</slot>
+    </connection>
+    <connection>
+        <sender>Contrast</sender>
+        <signal>valueChanged(int)</signal>
+        <receiver>Contrast_LCD</receiver>
+        <slot>display(int)</slot>
+    </connection>
+    <connection>
+        <sender>Take_Dark_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>takeDarkSlot()</slot>
+    </connection>
+    <connection>
+        <sender>Clear_Darks_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>clearDarksSlot()</slot>
+    </connection>
+    <connection>
+        <sender>scaleValSlider</sender>
+        <signal>valueChanged(int)</signal>
+        <receiver>scaleValLCD</receiver>
+        <slot>display(int)</slot>
+    </connection>
+    <connection>
+        <sender>thresholdSlider</sender>
+        <signal>valueChanged(int)</signal>
+        <receiver>thresholdLCD</receiver>
+        <slot>display(int)</slot>
+    </connection>
+    <connection>
+        <sender>Calibrate_Button</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>calibrateSlot()</slot>
+    </connection>
+    <connection>
+        <sender>GAdjustButton</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>adjustGRefSlot()</slot>
+    </connection>
+    <connection>
+        <sender>DefocusAllButton</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>defocusAllSlot()</slot>
+    </connection>
+    <connection>
+        <sender>FocusButton</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>focusSlot()</slot>
+    </connection>
+    <connection>
+        <sender>DefocusButton</sender>
+        <signal>clicked()</signal>
+        <receiver>VideoDisplayBase</receiver>
+        <slot>defocusSlot()</slot>
+    </connection>
+    <slot access="public">adjustGRefSlot()</slot>
+    <slot access="public">adjustRefSlot()</slot>
+    <slot access="public">calibrateSlot()</slot>
+    <slot access="public">centerSlot()</slot>
+    <slot access="public">clearDarksSlot()</slot>
+    <slot access="public">decX100Slot()</slot>
+    <slot access="public">decX10Slot()</slot>
+    <slot access="public">decY100Slot()</slot>
+    <slot access="public">decY10Slot()</slot>
+    <slot access="public">defocusAllSlot()</slot>
+    <slot access="public">defocusSlot()</slot>
+    <slot access="public">goXSlot()</slot>
+    <slot access="public">goYSlot()</slot>
+    <slot access="public">incX100Slot()</slot>
+    <slot access="public">incX10Slot()</slot>
+    <slot access="public">incY100Slot()</slot>
+    <slot access="public">incY10Slot()</slot>
+    <slot access="public">focusSlot()</slot>
+    <slot access="public">saveGRefSlot()</slot>
+    <slot access="public">saveRefSlot()</slot>
+    <slot access="public">storeSlot()</slot>
+    <slot access="public">switchLaserSlot( bool )</slot>
+    <slot access="public">takeDarkSlot()</slot>
+</connections>
+</UI>
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videoframe.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videoframe.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videoframe.cpp	(revision 3401)
@@ -0,0 +1,415 @@
+/***************************************************************************
+                          videoframe.cpp  -  description
+                             -------------------
+    begin                : Fri Nov 22 2002
+    copyright            : (C) 2002 by 
+    email                : 
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "amcdefs.h"
+#include "amcframegrabber.h"
+#include "calibratepaneldialog.h"
+#include "linearregression.h"
+#include "threadevent.h"
+#include "videoframe.h"
+#include "videospot.h"
+#include "videospotthread.h"
+#include "videothread.h"
+#include <math.h>
+#include <qframe.h>
+#include <qfile.h>
+#include <qpainter.h>
+#include <qdatetime.h>
+#include <qtextstream.h>
+#include <qtimer.h>
+#include <qimage.h>
+
+#define HEADERSIZE	15
+
+extern int g_iRefX, g_iRefY;
+
+
+VideoFrame::VideoFrame( QWidget *parent, const char *name, AMCFrameGrabber* p_pFG )
+	 : QFrame( parent, name )
+{
+
+  qDebug("Thread for VideoFrame PID: %d - PPID: %d", getpid(), getppid() );
+
+  qDebug("Creating Image arrays");
+	m_pImage = new QImage( MY_WIDTH, MY_HEIGHT, MY_DEPTH*8 );
+	m_darkFrame = new QByteArray( BUFSIZE );
+
+	m_iFrame = 0;
+	m_iGoodFrame = 0;
+	m_iDarks = 0;
+	m_iFrameNum = 0;
+
+	m_ix = m_iy = -1;
+	m_iRefX = m_iRefY = -1;
+  m_iCenterX = m_iCenterY = 1;
+	m_pCalibDlg = 0;
+//	m_qlSpots.setAutoDelete( true );
+	
+  qDebug("Creating VideoThread");
+	m_pVideoThread = new VideoThread( this, p_pFG );
+	m_pVideoThread->init( BUFSIZE );
+  qDebug("Creating SpotThread");
+	m_pSpotThread = new VideoSpotThread( this, m_pImage, (uchar*) m_darkFrame->data() );
+  qDebug("Starting VideoThread");
+  qDebug("Thread for VideoFrame when starting VideoThread PID: %d - PPID: %d", getpid(), getppid() );
+	m_pVideoThread->start();
+}
+
+VideoFrame::~VideoFrame()
+{
+	qDebug("Stoping video thread");
+	m_pVideoThread->stop();
+	m_pVideoThread->wait( );
+	qDebug("deleting video thread");
+	delete m_pVideoThread;
+	qDebug("Stoping spot thread");
+	m_pSpotThread->wait();
+	qDebug("deleting spot thread");
+	delete m_pSpotThread;
+	delete m_darkFrame;
+	delete m_pImage;
+	m_qlSpots.clear();
+}
+
+/** overridden painter for the frame */
+void VideoFrame::drawContents( QPainter* windowPainter )
+{
+//	qDebug("In drawContents");
+	// Draw image
+	QRect rect = contentsRect();
+	windowPainter->drawImage( 0,0, *m_pImage );
+
+  // Overlay camera center if it was determined from the LEDs
+  if( m_iCenterX != -1 )
+	windowPainter->setPen( Qt::white );
+  windowPainter->drawEllipse( m_iCenterX-2, m_iCenterY-2, 5, 5);
+	windowPainter->drawEllipse( m_iCenterX-4, m_iCenterY-4, 9, 9);
+
+	// Overlay Spots
+	windowPainter->setPen( Qt::red );
+	for( VideoSpot* pActualSpot = m_qlSpots.first();
+	  	 pActualSpot; pActualSpot = m_qlSpots.next() )
+	{
+		if( pActualSpot->isValid() )
+			windowPainter->drawEllipse( pActualSpot->getX()-4, pActualSpot->getY()-4, 9, 9);
+	}
+
+	if( m_pCalibDlg != 0 )
+	{
+		QList<VideoSpot>* pLineList = m_pCalibDlg->getLineList();
+		windowPainter->setPen( Qt::magenta );
+		for( VideoSpot* pActualSpot = pLineList->first();
+	  		 pActualSpot; pActualSpot = pLineList->next() )
+		{
+			if( pActualSpot->isValid() )
+				windowPainter->drawEllipse( pActualSpot->getX()-4, pActualSpot->getY()-4, 9, 9);
+		}
+
+		int iX1, iX2;
+		windowPainter->setPen( Qt::yellow );
+		LinearRegression* pRegression = m_pCalibDlg->getXRegression();
+		if( pRegression->isValid() )
+		{
+			iX1 = (int) ((   0. - pRegression->getAxis()) / pRegression->getSlope());
+			iX2 = (int) (( 479. - pRegression->getAxis()) / pRegression->getSlope());
+			windowPainter->drawLine( iX1, 0, iX2, 479 );	
+		}
+
+		pRegression = m_pCalibDlg->getYRegression();
+		if( pRegression->isValid() )
+		{
+			iX1 = (int) ((   0. - pRegression->getAxis() ) / pRegression->getSlope());
+			iX2 = (int) (( 479. - pRegression->getAxis() ) / pRegression->getSlope());
+			windowPainter->drawLine( iX1, 0, iX2, 479 );	
+		}
+		
+	}
+	
+	// Draw a blue cross for the global reference point
+	windowPainter->setPen( Qt::blue );
+	windowPainter->drawLine( g_iRefX-4, g_iRefY, g_iRefX+4, g_iRefY);
+	windowPainter->drawLine( g_iRefX, g_iRefY-4, g_iRefX, g_iRefY+4);
+
+	// Draw a green rectangle showing the reference point for this panel
+	if( m_iRefX > 0)
+	{
+		windowPainter->setPen( Qt::green );
+		windowPainter->drawRect( m_iRefX-4, m_iRefY-4, 9, 9 );
+	}
+
+	// Draw a blue rectangle showing the Region Of Interest (ROI)
+	// which is used to find the spot
+	if( ! m_qrROI.isEmpty() )
+	{
+		windowPainter->setPen( Qt::blue );
+		windowPainter->drawRect( m_qrROI );
+	}
+
+}
+
+/** No descriptions */
+void VideoFrame::saveFrame()
+{
+	QString fileName;
+	fileName.sprintf("Frame%02d.png",m_iFrameNum);
+	m_pImage->save( fileName, "PNG");
+
+	fileName.sprintf("Spots%02d.txt",m_iFrameNum++);
+	QFile file( fileName );
+	if( file.open( IO_WriteOnly ) )
+	{
+		QTextStream stream( &file );
+
+		QString str;
+
+		str.sprintf("LEDs\n" );
+  	stream << str;
+		for( VideoSpot* pActualSpot = m_qlLEDs.first();
+		  	 pActualSpot; pActualSpot = m_qlLEDs.next() )
+		{
+			if( pActualSpot->isValid() )
+			{
+				str.sprintf("%d %d\n", pActualSpot->getX(), pActualSpot->getY() );
+				stream << str;
+			}
+		}
+
+		str.sprintf("\nSpots\n" );
+  	stream << str;
+		for( VideoSpot* pActualSpot = m_qlSpots.first();
+		  	 pActualSpot; pActualSpot = m_qlSpots.next() )
+		{
+			if( pActualSpot->isValid() )
+			{
+				str.sprintf("%d %d\n", pActualSpot->getX(), pActualSpot->getY() );
+				stream << str;
+			}
+		}
+		
+	}
+}
+
+/** Save a dark frame */
+void VideoFrame::takeDark()
+{
+	qDebug("Taking dark frame");
+	uchar* pFrame = m_pImage->bits();
+	m_pVideoThread->getLastFrame( pFrame );
+	uchar* pDark = m_darkFrame->data();
+
+	for(int ind=0; ind< (MY_HEIGHT * MY_WIDTH * MY_DEPTH); ind++, pDark++, pFrame++ )
+	{
+		int help = *pDark;
+		help = (help * m_iDarks) + (int) *pFrame;
+		*pDark = (uchar) (help / (m_iDarks+1));
+	}
+	m_iDarks++;
+}
+
+/** Clear dark frames */
+void VideoFrame::clearDarks()
+{
+	m_darkFrame->fill(0);
+	m_iDarks = 0;
+}
+
+/** No descriptions */
+void VideoFrame::timerDone()
+{
+//	qDebug("Frames per second %d %d", m_iFrame, m_iGoodFrame);
+	emit framesGrabbed( m_iFrame );
+	emit framesProcessed( m_iGoodFrame );
+	m_iFrame = 0;
+	m_iGoodFrame=0;
+}
+
+/** No descriptions */
+void VideoFrame::mouseMoveEvent( QMouseEvent* event )
+{
+	if( (event->state() & LeftButton) == 0 )
+		return;
+
+	int x = event->x();
+	int y = event->y();
+	if( x > m_qrROI.left() )
+		m_qrROI.setRight( x );
+	else
+	{	
+		if( x == m_qrROI.left() )
+			m_qrROI.setRight( event->x() -1 );
+		else
+			m_qrROI.setLeft( x );
+	}
+	if( y > m_qrROI.top() )
+		m_qrROI.setBottom( y );
+	else
+	{	
+		if( y == m_qrROI.bottom() )
+			m_qrROI.setBottom( event->y() -1 );
+		else
+			m_qrROI.setTop( y );
+	}
+	if ( m_qrROI.isValid() );
+	m_pSpotThread->setROI( m_qrROI );		
+}
+
+/** No descriptions */
+void VideoFrame::mousePressEvent( QMouseEvent* event )
+{
+	if( event->button() == LeftButton )
+	{
+		m_qrROI.setLeft( event->x() );
+		m_qrROI.setRight( event->x() -1 );
+		m_qrROI.setTop( event->y() );
+		m_qrROI.setBottom( event->y() -1 );
+		m_pSpotThread->setROI( m_qrROI );		
+	}
+	if( event->button() == MidButton )
+	{
+		m_qrROI.setLeft( 0 );
+		m_qrROI.setRight( -1 );
+		m_qrROI.setTop( 0 );
+		m_qrROI.setBottom( -1 );
+		m_pSpotThread->setROI( m_qrROI );		
+	}
+	if( event->button() == RightButton )
+	{
+		g_iRefX = event->x();
+		g_iRefY = event->y();
+		emit gref( g_iRefX, g_iRefY );
+	}
+}
+
+void VideoFrame::customEvent(QCustomEvent *e)
+{
+  if ( e->type() == THREAD_END_EVENT )
+	{
+		repaint( FALSE );
+    calcCenter();
+		if( m_qlSpots.count() == 1)
+		{
+			VideoSpot* pSpot = m_qlSpots.first();
+			emit spot( pSpot->getX(), pSpot->getY() );
+		}
+		else
+			emit spot( -1, -1 );
+	}
+  if ( e->type() == THREAD_FRAME_EVENT )
+	{
+		m_iFrame++;
+		if( ! m_pSpotThread->running() )	
+		{
+			m_iGoodFrame++;
+			m_pVideoThread->getLastFrame( m_pImage->bits() );
+			m_pSpotThread->start();
+		}
+//		else
+//			qDebug("Dropping Frame");
+	}
+}
+
+/** No descriptions */
+void VideoFrame::threshold( int p_iValue )
+{
+	m_pSpotThread->setSigmas( p_iValue );	
+}
+
+/** No descriptions */
+void VideoFrame::scaleValue( int p_iValue )
+{
+	m_pSpotThread->setScalingMax( p_iValue );		
+}
+
+void VideoFrame::halt( bool p_zStop )
+{
+	if ( p_zStop == true )
+ 	{
+		m_pVideoThread->stop();
+		m_pVideoThread->wait();		// Wait for video thread to finish
+		m_pSpotThread->wait();		// Wait for spot thread to finish
+	}
+	else
+		m_pVideoThread->start();
+}
+
+/** Calculate the location of the central pixel. We do this by identifiying the
+    position of the camera LEDs and getting the relative offsets. */
+void VideoFrame::calcCenter()
+{
+  double dX = 0.0, dX1 = 0.0, dX2 = 0.0, dX3 = 0.0, dX4 = 0.0;
+  double dY = 0.0, dY1 = 0.0, dY2 = 0.0, dY3 = 0.0, dY4 = 0.0;
+  int iNumLEDs = 0;
+
+  m_iCenterX = m_iCenterY = 1;
+  m_qlLEDs.clear();
+  m_qlSpots.clear();
+
+	QList<VideoSpot>& qlSpotList = m_pSpotThread->getSpotList();
+	for( VideoSpot* pActualSpot = qlSpotList.first();
+	  	 pActualSpot; pActualSpot = qlSpotList.next() )
+	{
+    // Check if this spot is compatible with the spot of the
+		// upper left LED
+    if ( pActualSpot->contains( LED1_X, LED1_Y ) )
+		{
+			dX1 = pActualSpot->getX() + (CAMERA_X - LED1_X);	
+			dY1 = pActualSpot->getY() + (CAMERA_Y - LED1_Y);
+			dX += dX1; dY += dY1;
+			m_qlLEDs.append( new VideoSpot( pActualSpot->getX(), pActualSpot->getY()) );
+      iNumLEDs++;
+		}	
+    // Check if this spot is compatible with the spot of the
+		// upper right LED
+    else if ( pActualSpot->contains( LED2_X, LED2_Y ) )
+		{
+			dX2 = pActualSpot->getX() + (CAMERA_X - LED2_X);	
+			dY2 = pActualSpot->getY() + (CAMERA_Y - LED2_Y);
+			dX += dX2; dY += dY2;
+			m_qlLEDs.append( new VideoSpot( pActualSpot->getX(), pActualSpot->getY()) );
+      iNumLEDs++;
+		}	
+    // Check if this spot is compatible with the spot of the
+		// lower left LED
+    else if ( pActualSpot->contains( LED3_X, LED3_Y ) )
+		{
+			dX3 = pActualSpot->getX() + (CAMERA_X - LED3_X);	
+			dY3 = pActualSpot->getY() + (CAMERA_Y - LED3_Y);
+			dX += dX3; dY += dY3;
+			m_qlLEDs.append( new VideoSpot( pActualSpot->getX(), pActualSpot->getY()) );
+      iNumLEDs++;
+		}	
+    // Check if this spot is compatible with the spot of the
+		// lower right LED
+    else if ( pActualSpot->contains( LED4_X, LED4_Y ) )
+		{
+			dX4 = pActualSpot->getX() + (CAMERA_X - LED4_X);	
+			dY4 = pActualSpot->getY() + (CAMERA_Y - LED4_Y);
+			dX += dX4; dY += dY4;
+			m_qlLEDs.append( new VideoSpot( pActualSpot->getX(), pActualSpot->getY()) );
+      iNumLEDs++;
+		}
+    else
+			m_qlSpots.append( new VideoSpot( pActualSpot->getX(), pActualSpot->getY()) );
+  }
+  if( iNumLEDs != 0)
+	{
+		m_iCenterX = (int) rint(dX / iNumLEDs);	
+		m_iCenterY = (int) rint(dY / iNumLEDs);
+//		qDebug("Center %d %d", m_iCenterX, m_iCenterY);	
+	}
+  qDebug("Center at: %d %d -- with %d LEDs",m_iCenterX, m_iCenterY, iNumLEDs );
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videoframe.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videoframe.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videoframe.h	(revision 3401)
@@ -0,0 +1,141 @@
+/***************************************************************************
+                          videoframe.h  -  description
+                             -------------------
+    begin                : Fri Nov 22 2002
+    copyright            : (C) 2002 by 
+    email                : 
+ ***************************************************************************/
+
+/***************************************************************************
+ *                                                                         *
+ *   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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef VIDEOFRAME_H
+#define VIDEOFRAME_H
+
+#include <qdatetime.h>
+#include <qframe.h>
+#include <qimage.h>
+#include <qlist.h>
+#include <qpoint.h>
+#include <qrect.h>
+#include "videothread.h"
+#include "videospotthread.h"
+
+// class QPixmap;
+class AMCFrameGrabber;
+class QTimer;
+class QMouseEvent;
+class CalibratePanelDialog;
+
+/**subclased frame to display video data
+  *@author 
+  */
+class VideoFrame : public QFrame
+{
+  Q_OBJECT
+
+public:
+	VideoFrame( QWidget *parent, const char *name, AMCFrameGrabber* p_pFG );
+	virtual ~VideoFrame();
+
+  /** Handle events from the spot finder thread. */
+	void customEvent( QCustomEvent* e );
+  /** No descriptions */
+  void saveFrame();
+  /** Set the reference position */
+  void setRef( int p_iX, int p_iY ) { m_iRefX = p_iX; m_iRefY = p_iY; };
+  /** Set list of spots used to calibrate panel movement */
+  void setCalibDlg( CalibratePanelDialog* p_pDlg ) { m_pCalibDlg = p_pDlg; };
+  /** accumulate flat field images */
+  void halt( bool p_zStop );
+  /** No descriptions */
+  void mouseMoveEvent( QMouseEvent* event );
+  /** No descriptions */
+  void mousePressEvent( QMouseEvent* event );
+  /** Calculate the location of the central pixel. We do this by identifiying the 
+position of the camera LEDs and getting the relative offsets. */
+  void calcCenter();
+
+protected: // Protected methods
+
+  /** overridden painter for the frame */
+  virtual void drawContents( QPainter* );
+
+private: // Private attributes
+  /**  */
+  QImage* m_pImage;
+  /**  */
+  QByteArray* m_darkFrame;
+  /**  */
+	CalibratePanelDialog* m_pCalibDlg;
+  /**  */
+  int m_iLength;
+	/** */
+	VideoSpotThread* m_pSpotThread;
+	/** */
+	VideoThread* m_pVideoThread;
+  /**  */
+  QRect m_qrROI;
+  /**  */
+  QPoint m_qpRef;
+  /** List of spots found in frame. In this list the spots from the camera LEDs are removed */
+	QList<VideoSpot> m_qlSpots;
+  /** List spots from the camera LEDs */
+	QList<VideoSpot> m_qlLEDs;
+
+public: // Public attributes
+  /**  */
+  int m_ix;
+  /**  */
+  int m_iy;
+  /**  */
+  int m_iRefX;
+  /**  */
+  int m_iRefY;
+  /**  */
+  int m_iCenterX;
+  /**  */
+  int m_iCenterY;
+  /**  */
+  int m_iFrame;
+  /**  */
+  int m_iGoodFrame;
+  /**  */
+  int m_iDarks;
+	/** */
+  int m_iFrameNum;
+
+public slots: // Public slots
+  /** No descriptions */
+  void timerDone();
+  /** No descriptions */
+  void threshold( int p_iValue );
+  /** No descriptions */
+  void substractDarks( bool p_zOn ) { m_pSpotThread->setDarkSubtract( p_zOn ); };
+  /** No descriptions */
+  void scaleValue( int p_iValue );
+  /** No descriptions */
+  void scaleImage( bool p_zOn ) { m_pSpotThread->setScaling( p_zOn ); };
+  /** accumulate flat field images */
+  void takeDark();
+  /** accumulate flat field images */
+  void clearDarks();
+
+signals: // Signals
+  /** Signal emitted when we find a spot. */
+  void spot( int p_iX, int p_iY );
+  /** Signal emitted when we set a global reference. */
+  void gref( int p_iX, int p_iY );
+  /** Signal emitted whit the number of grabbed frames per second. */
+  void framesGrabbed( int p_iFrames );
+  /** Signal emitted whit the number of processed frames per second. */
+  void framesProcessed( int p_iFrames );
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videoframe.moc.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videoframe.moc.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videoframe.moc.cpp	(revision 3401)
@@ -0,0 +1,261 @@
+/****************************************************************************
+** VideoFrame meta object code from reading C++ file 'videoframe.h'
+**
+** Created: Thu Jan 29 00:51:52 2004
+**      by: The Qt MOC ($Id: videoframe.moc.cpp,v 1.1 2004-03-04 16:31:19 merck Exp $)
+**
+** WARNING! All changes made in this file will be lost!
+*****************************************************************************/
+
+#if !defined(Q_MOC_OUTPUT_REVISION)
+#define Q_MOC_OUTPUT_REVISION 9
+#elif Q_MOC_OUTPUT_REVISION != 9
+#error "Moc format conflict - please regenerate all moc files"
+#endif
+
+#include "videoframe.h"
+#include <qmetaobject.h>
+#include <qapplication.h>
+
+
+
+const char *VideoFrame::className() const
+{
+    return "VideoFrame";
+}
+
+QMetaObject *VideoFrame::metaObj = 0;
+
+void VideoFrame::initMetaObject()
+{
+    if ( metaObj )
+	return;
+    if ( qstrcmp(QFrame::className(), "QFrame") != 0 )
+	badSuperclassWarning("VideoFrame","QFrame");
+    (void) staticMetaObject();
+}
+
+#ifndef QT_NO_TRANSLATION
+
+QString VideoFrame::tr(const char* s)
+{
+    return qApp->translate( "VideoFrame", s, 0 );
+}
+
+QString VideoFrame::tr(const char* s, const char * c)
+{
+    return qApp->translate( "VideoFrame", s, c );
+}
+
+#endif // QT_NO_TRANSLATION
+
+QMetaObject* VideoFrame::staticMetaObject()
+{
+    if ( metaObj )
+	return metaObj;
+    (void) QFrame::staticMetaObject();
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    typedef void (VideoFrame::*m1_t0)();
+    typedef void (QObject::*om1_t0)();
+    typedef void (VideoFrame::*m1_t1)(int);
+    typedef void (QObject::*om1_t1)(int);
+    typedef void (VideoFrame::*m1_t2)(bool);
+    typedef void (QObject::*om1_t2)(bool);
+    typedef void (VideoFrame::*m1_t3)(int);
+    typedef void (QObject::*om1_t3)(int);
+    typedef void (VideoFrame::*m1_t4)(bool);
+    typedef void (QObject::*om1_t4)(bool);
+    typedef void (VideoFrame::*m1_t5)();
+    typedef void (QObject::*om1_t5)();
+    typedef void (VideoFrame::*m1_t6)();
+    typedef void (QObject::*om1_t6)();
+    m1_t0 v1_0 = &VideoFrame::timerDone;
+    om1_t0 ov1_0 = (om1_t0)v1_0;
+    m1_t1 v1_1 = &VideoFrame::threshold;
+    om1_t1 ov1_1 = (om1_t1)v1_1;
+    m1_t2 v1_2 = &VideoFrame::substractDarks;
+    om1_t2 ov1_2 = (om1_t2)v1_2;
+    m1_t3 v1_3 = &VideoFrame::scaleValue;
+    om1_t3 ov1_3 = (om1_t3)v1_3;
+    m1_t4 v1_4 = &VideoFrame::scaleImage;
+    om1_t4 ov1_4 = (om1_t4)v1_4;
+    m1_t5 v1_5 = &VideoFrame::takeDark;
+    om1_t5 ov1_5 = (om1_t5)v1_5;
+    m1_t6 v1_6 = &VideoFrame::clearDarks;
+    om1_t6 ov1_6 = (om1_t6)v1_6;
+    QMetaData *slot_tbl = QMetaObject::new_metadata(7);
+    QMetaData::Access *slot_tbl_access = QMetaObject::new_metaaccess(7);
+    slot_tbl[0].name = "timerDone()";
+    slot_tbl[0].ptr = (QMember)ov1_0;
+    slot_tbl_access[0] = QMetaData::Public;
+    slot_tbl[1].name = "threshold(int)";
+    slot_tbl[1].ptr = (QMember)ov1_1;
+    slot_tbl_access[1] = QMetaData::Public;
+    slot_tbl[2].name = "substractDarks(bool)";
+    slot_tbl[2].ptr = (QMember)ov1_2;
+    slot_tbl_access[2] = QMetaData::Public;
+    slot_tbl[3].name = "scaleValue(int)";
+    slot_tbl[3].ptr = (QMember)ov1_3;
+    slot_tbl_access[3] = QMetaData::Public;
+    slot_tbl[4].name = "scaleImage(bool)";
+    slot_tbl[4].ptr = (QMember)ov1_4;
+    slot_tbl_access[4] = QMetaData::Public;
+    slot_tbl[5].name = "takeDark()";
+    slot_tbl[5].ptr = (QMember)ov1_5;
+    slot_tbl_access[5] = QMetaData::Public;
+    slot_tbl[6].name = "clearDarks()";
+    slot_tbl[6].ptr = (QMember)ov1_6;
+    slot_tbl_access[6] = QMetaData::Public;
+    typedef void (VideoFrame::*m2_t0)(int,int);
+    typedef void (QObject::*om2_t0)(int,int);
+    typedef void (VideoFrame::*m2_t1)(int,int);
+    typedef void (QObject::*om2_t1)(int,int);
+    typedef void (VideoFrame::*m2_t2)(int);
+    typedef void (QObject::*om2_t2)(int);
+    typedef void (VideoFrame::*m2_t3)(int);
+    typedef void (QObject::*om2_t3)(int);
+    m2_t0 v2_0 = &VideoFrame::spot;
+    om2_t0 ov2_0 = (om2_t0)v2_0;
+    m2_t1 v2_1 = &VideoFrame::gref;
+    om2_t1 ov2_1 = (om2_t1)v2_1;
+    m2_t2 v2_2 = &VideoFrame::framesGrabbed;
+    om2_t2 ov2_2 = (om2_t2)v2_2;
+    m2_t3 v2_3 = &VideoFrame::framesProcessed;
+    om2_t3 ov2_3 = (om2_t3)v2_3;
+    QMetaData *signal_tbl = QMetaObject::new_metadata(4);
+    signal_tbl[0].name = "spot(int,int)";
+    signal_tbl[0].ptr = (QMember)ov2_0;
+    signal_tbl[1].name = "gref(int,int)";
+    signal_tbl[1].ptr = (QMember)ov2_1;
+    signal_tbl[2].name = "framesGrabbed(int)";
+    signal_tbl[2].ptr = (QMember)ov2_2;
+    signal_tbl[3].name = "framesProcessed(int)";
+    signal_tbl[3].ptr = (QMember)ov2_3;
+    metaObj = QMetaObject::new_metaobject(
+	"VideoFrame", "QFrame",
+	slot_tbl, 7,
+	signal_tbl, 4,
+#ifndef QT_NO_PROPERTIES
+	0, 0,
+	0, 0,
+#endif // QT_NO_PROPERTIES
+	0, 0 );
+    metaObj->set_slot_access( slot_tbl_access );
+#ifndef QT_NO_PROPERTIES
+#endif // QT_NO_PROPERTIES
+    return metaObj;
+}
+
+#include <qobjectdefs.h>
+#include <qsignalslotimp.h>
+
+// SIGNAL spot
+void VideoFrame::spot( int t0, int t1 )
+{
+    // No builtin function for signal parameter type int,int
+    QConnectionList *clist = receivers("spot(int,int)");
+    if ( !clist || signalsBlocked() )
+	return;
+    typedef void (QObject::*RT0)();
+    typedef void (QObject::*RT1)(int);
+    typedef void (QObject::*RT2)(int,int);
+    RT0 r0;
+    RT1 r1;
+    RT2 r2;
+    QConnectionListIt it(*clist);
+    QConnection   *c;
+    QSenderObject *object;
+    while ( (c=it.current()) ) {
+	++it;
+	object = (QSenderObject*)c->object();
+	object->setSender( this );
+	switch ( c->numArgs() ) {
+	    case 0:
+#ifdef Q_FP_CCAST_BROKEN
+		r0 = reinterpret_cast<RT0>(*(c->member()));
+#else
+		r0 = (RT0)*(c->member());
+#endif
+		(object->*r0)();
+		break;
+	    case 1:
+#ifdef Q_FP_CCAST_BROKEN
+		r1 = reinterpret_cast<RT1>(*(c->member()));
+#else
+		r1 = (RT1)*(c->member());
+#endif
+		(object->*r1)(t0);
+		break;
+	    case 2:
+#ifdef Q_FP_CCAST_BROKEN
+		r2 = reinterpret_cast<RT2>(*(c->member()));
+#else
+		r2 = (RT2)*(c->member());
+#endif
+		(object->*r2)(t0, t1);
+		break;
+	}
+    }
+}
+
+// SIGNAL gref
+void VideoFrame::gref( int t0, int t1 )
+{
+    // No builtin function for signal parameter type int,int
+    QConnectionList *clist = receivers("gref(int,int)");
+    if ( !clist || signalsBlocked() )
+	return;
+    typedef void (QObject::*RT0)();
+    typedef void (QObject::*RT1)(int);
+    typedef void (QObject::*RT2)(int,int);
+    RT0 r0;
+    RT1 r1;
+    RT2 r2;
+    QConnectionListIt it(*clist);
+    QConnection   *c;
+    QSenderObject *object;
+    while ( (c=it.current()) ) {
+	++it;
+	object = (QSenderObject*)c->object();
+	object->setSender( this );
+	switch ( c->numArgs() ) {
+	    case 0:
+#ifdef Q_FP_CCAST_BROKEN
+		r0 = reinterpret_cast<RT0>(*(c->member()));
+#else
+		r0 = (RT0)*(c->member());
+#endif
+		(object->*r0)();
+		break;
+	    case 1:
+#ifdef Q_FP_CCAST_BROKEN
+		r1 = reinterpret_cast<RT1>(*(c->member()));
+#else
+		r1 = (RT1)*(c->member());
+#endif
+		(object->*r1)(t0);
+		break;
+	    case 2:
+#ifdef Q_FP_CCAST_BROKEN
+		r2 = reinterpret_cast<RT2>(*(c->member()));
+#else
+		r2 = (RT2)*(c->member());
+#endif
+		(object->*r2)(t0, t1);
+		break;
+	}
+    }
+}
+
+// SIGNAL framesGrabbed
+void VideoFrame::framesGrabbed( int t0 )
+{
+    activate_signal( "framesGrabbed(int)", t0 );
+}
+
+// SIGNAL framesProcessed
+void VideoFrame::framesProcessed( int t0 )
+{
+    activate_signal( "framesProcessed(int)", t0 );
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videopixel.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videopixel.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videopixel.cpp	(revision 3401)
@@ -0,0 +1,25 @@
+/***************************************************************************
+                          videopixel.cpp  -  description
+                             -------------------
+    begin                : Thu Aug 28 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "videopixel.h"
+
+VideoPixel::VideoPixel( int p_iX, int p_iY, int p_iWeight )
+ : m_iX(p_iX), m_iY(p_iY), m_iWeight(p_iWeight)
+{
+}
+VideoPixel::~VideoPixel(){
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videopixel.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videopixel.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videopixel.h	(revision 3401)
@@ -0,0 +1,48 @@
+/***************************************************************************
+                          videopixel.h  -  description
+                             -------------------
+    begin                : Thu Aug 28 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef VIDEOPIXEL_H
+#define VIDEOPIXEL_H
+
+#include <qwidget.h>
+#include <qobject.h>
+
+/**
+  *@author Martin Merck
+  */
+
+class VideoPixel{
+public:
+	VideoPixel( int p_iX, int p_iY, int p_iWeight );
+	virtual ~VideoPixel();
+  /** No descriptions */
+  virtual int getX() { return m_iX; };
+  /** No descriptions */
+  virtual int getY() { return m_iY; };
+  /** No descriptions */
+  virtual int getWeight() { return m_iWeight; };
+
+private: // Private attributes
+  /**  */
+  int m_iX ;
+  /**  */
+  int m_iY;
+  /**  */
+  int m_iWeight;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospot.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospot.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospot.cpp	(revision 3401)
@@ -0,0 +1,78 @@
+/***************************************************************************
+                          videospot.cpp  -  description
+                             -------------------
+    begin                : Thu Aug 28 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "videospot.h"
+#include "stdlib.h"
+
+VideoSpot::VideoSpot()
+{
+	m_iNumPixel = 0;
+	m_iXSum = 0;
+	m_iYSum = 0;
+	m_iWSum = 0;
+}
+
+VideoSpot::VideoSpot( int p_iX, int p_iY )
+{
+	m_iNumPixel = 10;
+	m_iXSum = p_iX;
+	m_iYSum = p_iY;
+	m_iWSum = 1;
+}
+
+VideoSpot::~VideoSpot()
+{
+}
+
+/** No descriptions */
+bool VideoSpot::contains( int p_iX, int p_iY )
+{
+	if( ( abs( p_iX - getX() ) < 10 )
+			&&
+			( abs( p_iY - getY() ) < 10 ) )
+		return true;
+	else
+		return false;
+}
+
+/** No descriptions */
+void VideoSpot::append( int p_iX, int p_iY, int p_iWeight )
+{
+//	if( contains( p_iX , p_iY  ) )
+//		m_glPixels.append( new VideoPixel( p_iX, p_iY, p_iWeight ) );
+		m_iXSum += p_iX * p_iWeight;
+		m_iYSum += p_iY * p_iWeight;
+		m_iWSum += p_iWeight;
+		m_iNumPixel++;
+}
+
+/** No descriptions */
+int VideoSpot::getX()
+{
+	return ( m_iXSum / m_iWSum );
+}
+
+/** No descriptions */
+int VideoSpot::getY()
+{
+	return ( m_iYSum / m_iWSum );
+}
+/** No descriptions */
+bool VideoSpot::isValid()
+{
+	return ( m_iNumPixel >= 3 );
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospot.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospot.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospot.h	(revision 3401)
@@ -0,0 +1,58 @@
+/***************************************************************************
+                          videospot.h  -  description
+                             -------------------
+    begin                : Thu Aug 28 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef VIDEOSPOT_H
+#define VIDEOSPOT_H
+
+#include <qobject.h>
+
+/**
+  *@author Martin Merck
+  */
+
+class VideoSpot : public QObject
+{
+public: 
+	VideoSpot();
+	VideoSpot(  int p_iX, int p_iY  );
+	virtual ~VideoSpot();
+  /** No descriptions */
+  virtual bool contains( int p_iX, int p_iY );
+  /** No descriptions */
+  virtual void append( int p_iX, int p_iY, int p_iWeight );
+  /** No descriptions */
+  virtual int getX();
+  /** No descriptions */
+  virtual int getY();
+  /** No descriptions */
+  virtual bool isValid();
+public: // Public attributes
+  /**  */
+//  QList<VideoPixel> m_qlPixels;
+private: // Private attributes
+  /**  */
+  int m_iXSum;
+  /**  */
+  int m_iYSum;
+public: // Public attributes
+  /**  */
+  int m_iNumPixel;
+  /**  */
+  int m_iWSum;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospotthread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospotthread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospotthread.cpp	(revision 3401)
@@ -0,0 +1,165 @@
+/***************************************************************************
+                          videospotthread.cpp  -  description
+                             -------------------
+    begin                : Sat Aug 30 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "amcframegrabber.h"
+#include "videospotthread.h"
+#include "videospot.h"
+#include "threadevent.h"
+#include <math.h>
+#include <qpixmap.h>
+#include <qimage.h>
+#include <qrect.h>
+#include <qpoint.h>
+#include <qlist.h>
+
+VideoSpotThread::VideoSpotThread( QObject* p_pReceiver, QImage* p_pImage, uchar* p_pDark )
+  : m_pReceiver(p_pReceiver), m_pImage(p_pImage), m_pDark(p_pDark)
+{
+	m_pData = m_pImage->bits();
+	m_iScaleMax = 200;
+	m_zDarks = false;
+	m_zScale = false;
+	m_iSigmas = 15;
+
+	m_qlSpotList.setAutoDelete( true );
+}
+
+VideoSpotThread::~VideoSpotThread()
+{
+	m_qlSpotList.clear();
+}
+
+/** No descriptions */
+void VideoSpotThread::run()
+{
+//  qDebug("VideoSpotThread PID: %d - PPID: %d", getpid(), getppid() );
+  findSpot();
+	QThread::postEvent( m_pReceiver, new QCustomEvent( THREAD_END_EVENT ) );
+}
+
+/** Find the Laser spot */
+void VideoSpotThread::findSpot()
+{
+
+	if( m_zDarks )
+		subtractDarks();
+
+	// Rescale image to maximum
+	if( m_zScale )
+		rescaleImage();
+
+  int threshold = getThreshold();
+
+	m_qlSpotList.clear();
+	int top = 0;
+	int bottom = MY_HEIGHT;
+	int left = 0;
+	int right = MY_WIDTH;
+	if( ! m_qrROI.isEmpty() )
+	{
+		top    = m_qrROI.top();
+		bottom = m_qrROI.bottom();
+		left   = m_qrROI.left();
+		right  = m_qrROI.right();
+	}
+
+  for (int i=top; i <bottom; i++)
+	{
+     for (int j=left; j < right ; j++)
+		{
+			int index= (j + i * MY_WIDTH) * MY_DEPTH;
+			bool zFound = false;
+			uchar data = m_pData[index];
+			if( data > threshold )
+	 		{
+				for( VideoSpot* pActualSpot = m_qlSpotList.first();
+		 				 pActualSpot; pActualSpot = m_qlSpotList.next() )
+				{
+					if( pActualSpot->contains( j, i ) )
+					{
+						pActualSpot->append( j, i, data );
+						zFound = true;
+						break;
+					}
+				}
+				if( zFound == false )
+				{
+					VideoSpot* pSpot = new VideoSpot();
+					pSpot->append( j, i, data );
+					m_qlSpotList.append( pSpot );
+				}
+
+	 		}
+		}
+	}
+}
+
+/** No descriptions */
+void VideoSpotThread::subtractDarks()
+{
+	uchar* pData = m_pData;
+	uchar* pDark = m_pDark;
+	uchar* pEnd = m_pData + ( MY_HEIGHT * MY_WIDTH * MY_DEPTH);
+	for( ; pData < pEnd; pData++, pDark++ )
+	{
+		int help = (int) *pData - (int) *pDark;
+		if(help < 0)
+			help = 0;
+		*pData = (uchar) help;
+	}
+}
+
+/** No descriptions */
+void VideoSpotThread::rescaleImage()
+{
+//	qDebug("Rescaling image to %d",m_iScaleMax);
+	uchar* pData = m_pData;
+//	uchar* pEnd = pData + ( MY_HEIGHT * MY_WIDTH * MY_DEPTH);
+//	for( ; pData < pEnd; pData++)
+	
+	long dScale = (255 * 256) / m_iScaleMax;
+	for( int ind = 0; ind < MY_HEIGHT * MY_WIDTH * MY_DEPTH; ind++,pData++)
+	{
+		long help = ( ( ((long) *pData) ) * dScale ) >> 8;
+		if( help > 255)
+			help = 255;
+		*pData = (uchar) help;
+	}
+}
+
+/** No descriptions */
+int VideoSpotThread::getThreshold()
+{
+	double sumx =0;
+	double sumx2 = 0;
+
+	long numPixel = MY_HEIGHT * MY_WIDTH;
+	for(int ind=0; ind < ( numPixel * MY_DEPTH); ind+=MY_DEPTH)
+	{
+		double data = (double) m_pData[ind];
+		sumx += data;
+		sumx2 += data * data;
+	}
+
+	double mean = ((double) sumx) / ((double) (numPixel));
+	double var = ((double) sumx2) / ((double) (numPixel)) - mean * mean;
+	double stddev = sqrt(var);
+
+  int threshold = (int) (mean + m_iSigmas * stddev);
+//	qDebug("Mean: %f StdDev: %f   Threshold %d", mean, stddev, threshold );
+	return threshold;
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospotthread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospotthread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videospotthread.h	(revision 3401)
@@ -0,0 +1,84 @@
+/***************************************************************************
+                          videospotthread.h  -  description
+                             -------------------
+    begin                : Sat Aug 30 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef VIDEOSPOTTHREAD_H
+#define VIDEOSPOTTHREAD_H
+
+#include <qthread.h>
+#include <qlist.h>
+#include <qrect.h>
+
+class VideoSpot;
+
+/**
+  *@author Martin Merck
+  */
+
+class VideoSpotThread : public QThread
+{
+public:
+	VideoSpotThread( QObject* p_pReceiver, QImage* p_pImage, uchar* p_pDark );
+	virtual ~VideoSpotThread();
+
+  /** No descriptions */
+  virtual void subtractDarks();
+  /** No descriptions */
+  virtual void rescaleImage();
+  /** No descriptions */
+  virtual void findSpot();
+  /** No descriptions */
+	virtual int getThreshold();
+  /** No descriptions */
+	virtual QList<VideoSpot>& getSpotList() { return m_qlSpotList; };
+  /** No descriptions */
+  virtual void setScalingMax( int p_iVal ) { m_iScaleMax = p_iVal; };
+  /** No descriptions */
+  virtual void setScaling( bool p_zOn ) { m_zScale = p_zOn; };
+  /** No descriptions */
+  virtual void setDarkSubtract( bool p_zOn ) { m_zDarks = p_zOn; };
+  /** No descriptions */
+  virtual void setSigmas( int p_iSigmas ) { m_iSigmas = p_iSigmas; };
+  /** No descriptions */
+	virtual void setROI( QRect& p_qrRect) { m_qrROI = p_qrRect; };
+
+protected: // Protected methods
+  /** No descriptions */
+  virtual void run();
+private: // Private attributes
+  /**  */
+	QObject* m_pReceiver;
+  /**  */
+  QImage* m_pImage;
+  /**  */
+  uchar* m_pDark;
+  /**  */
+  uchar* m_pData;
+  /**  */
+	QList<VideoSpot> m_qlSpotList;
+  /**  */
+  bool m_zDarks;
+  /**  */
+  bool m_zScale;
+	/** */
+	int m_iScaleMax;
+	/** */
+	QRect m_qrROI;
+	/** */
+	int m_iSigmas;
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videothread.cpp
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videothread.cpp	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videothread.cpp	(revision 3401)
@@ -0,0 +1,105 @@
+/***************************************************************************
+                          videothread.cpp  -  description
+                             -------------------
+    begin                : Sat Aug 30 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#include "videothread.h"
+#include "amcframegrabber.h"
+#include "threadevent.h"
+#include <unistd.h>
+
+VideoThread::VideoThread( QObject* p_pReceiver, AMCFrameGrabber* p_pFG )
+	: m_pReceiver(p_pReceiver), m_pFG(p_pFG), m_zValid(false), m_zRun(false), m_iCurFrame(0)
+{
+}
+
+VideoThread::~VideoThread()
+{
+  if( m_zRun )
+    stop();
+	if( m_zValid )
+		for( int i=0; i<2; i++)
+		{
+	  	if ( m_pData != NULL )
+				delete[] m_pData[i];
+	}
+}
+
+/** No descriptions */
+void VideoThread::init( int p_iSize )
+{
+	if( m_zValid )
+		return;
+	m_iSize = p_iSize;
+	for( int i=0; i<2; i++)
+	{
+		m_pData[i] = new uchar[ p_iSize ];
+		if ( m_pData == NULL )
+		{
+			fprintf(stderr, "new char(%d) failed\n", m_iSize);
+			return;
+		}
+		m_zValid = true;
+	}	
+}
+
+/** No descriptions */
+void VideoThread::run()
+{
+  qDebug("VideoThread PID: %d - PPID: %d", getpid(), getppid() );
+	m_aMutex.lock();
+	if( ! m_zValid )
+	{
+		m_aMutex.unlock();
+		return;
+	}
+
+	m_zRun = true;
+	m_aMutex.unlock();
+	while( true )
+	{
+		m_aMutex.lock();
+		if( ! m_zRun )
+		{
+			m_aMutex.unlock();
+			return;
+		}	
+		uchar* pData = m_pData[m_iCurFrame];
+		if ( m_iCurFrame == 0 )
+			m_iCurFrame = 1;
+		else
+			m_iCurFrame = 0;
+		m_aMutex.unlock();
+		
+		m_pFG->grabFrame( pData );
+		QThread::postEvent( m_pReceiver, new QCustomEvent( THREAD_FRAME_EVENT ) );
+		
+	}
+		
+}
+
+void VideoThread::stop()
+{
+	m_aMutex.lock();
+	m_zRun = false;
+	m_aMutex.unlock();
+}
+
+void VideoThread::getLastFrame( uchar* p_pData )
+{
+	m_aMutex.lock();
+	memcpy( p_pData, m_pData[m_iCurFrame], m_iSize);
+	m_aMutex.unlock();
+}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videothread.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videothread.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/activemirrorcontrol/videothread.h	(revision 3401)
@@ -0,0 +1,58 @@
+/***************************************************************************
+                          videothread.h  -  description
+                             -------------------
+    begin                : Sat Aug 30 2003
+    copyright            : (C) 2003 by Martin Merck
+    email                : merck@astro.uni-wuerzburg.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.                                   *
+ *                                                                         *
+ ***************************************************************************/
+
+#ifndef VIDEOTHREAD_H
+#define VIDEOTHREAD_H
+
+#include <qthread.h>
+
+/**
+  *@author Martin Merck
+  */
+class AMCFrameGrabber;
+
+
+class VideoThread : public QThread  {
+public: 
+	VideoThread( QObject* p_pReceiver, AMCFrameGrabber* p_pFG );
+	virtual ~VideoThread();
+
+  /** No descriptions */
+  virtual void init( int p_iSize );
+
+  /** No descriptions */
+  virtual void stop();
+
+  /** No descriptions */
+  virtual void getLastFrame( uchar* p_pData );
+
+protected: // Protected methods
+  /** No descriptions */
+  virtual void run();
+
+private:
+	QObject*					m_pReceiver;
+	AMCFrameGrabber*	m_pFG;
+	bool							m_zValid;
+	bool							m_zRun;
+	int								m_iCurFrame;
+	int								m_iSize;
+	QMutex 					 	m_aMutex;
+	uchar*						m_pData[2];
+};
+
+#endif
Index: trunk/MagicSoft/AMC/activemirrorcontrol/confdefs.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/confdefs.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/confdefs.h	(revision 3401)
@@ -0,0 +1,3 @@
+
+#define PACKAGE "activemirrorcontrol"
+#define VERSION "0.1"
Index: trunk/MagicSoft/AMC/activemirrorcontrol/config.cache
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/config.cache	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/config.cache	(revision 3401)
@@ -0,0 +1,103 @@
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+ac_cv_archive_cmds_needs_lc=${ac_cv_archive_cmds_needs_lc=yes}
+ac_cv_cygwin=${ac_cv_cygwin=no}
+ac_cv_exeext=${ac_cv_exeext=no}
+ac_cv_func_connect=${ac_cv_func_connect=yes}
+ac_cv_func_inet_ntoa=${ac_cv_func_inet_ntoa=yes}
+ac_cv_func_remove=${ac_cv_func_remove=yes}
+ac_cv_func_res_init=${ac_cv_func_res_init=no}
+ac_cv_func_shmat=${ac_cv_func_shmat=yes}
+ac_cv_have_dlfcn=${ac_cv_have_dlfcn=yes}
+ac_cv_have_kde=${ac_cv_have_kde=$'have_kde=yes     ac_kde_includes=/opt/kde2/include ac_kde_libraries=/opt/kde2/lib'}
+ac_cv_have_qt=${ac_cv_have_qt=$'have_qt=yes     ac_qt_includes=/usr/lib/qt2/include ac_qt_libraries=/usr/lib/qt2/lib'}
+ac_cv_header_dlfcn_h=${ac_cv_header_dlfcn_h=yes}
+ac_cv_ksize_t=${ac_cv_ksize_t=socklen_t}
+ac_cv_lib_ICE_IceConnectionNumber=${ac_cv_lib_ICE_IceConnectionNumber=yes}
+ac_cv_lib_compat_main=${ac_cv_lib_compat_main=no}
+ac_cv_lib_crypt_crypt=${ac_cv_lib_crypt_crypt=yes}
+ac_cv_lib_dl_dlopen=${ac_cv_lib_dl_dlopen=yes}
+ac_cv_lib_dld_shl_unload=${ac_cv_lib_dld_shl_unload=no}
+ac_cv_lib_dnet_dnet_ntoa=${ac_cv_lib_dnet_dnet_ntoa=no}
+ac_cv_lib_dnet_stub_dnet_ntoa=${ac_cv_lib_dnet_stub_dnet_ntoa=no}
+ac_cv_lib_jpeg_6b=${ac_cv_lib_jpeg_6b=no}
+ac_cv_lib_jpeg_normal=${ac_cv_lib_jpeg_normal=-ljpeg}
+ac_cv_lib_png=${ac_cv_lib_png=$'-lpng -lz -lm'}
+ac_cv_lib_resolv_res_init=${ac_cv_lib_resolv_res_init=no}
+ac_cv_lib_ucb_killpg=${ac_cv_lib_ucb_killpg=no}
+ac_cv_lib_z=${ac_cv_lib_z=-lz}
+ac_cv_mingw32=${ac_cv_mingw32=no}
+ac_cv_objext=${ac_cv_objext=o}
+ac_cv_path_GMSGFMT=${ac_cv_path_GMSGFMT=/usr/bin/msgfmt}
+ac_cv_path_MSGFMT=${ac_cv_path_MSGFMT=/usr/bin/msgfmt}
+ac_cv_path_XGETTEXT=${ac_cv_path_XGETTEXT=/usr/bin/xgettext}
+ac_cv_path_install=${ac_cv_path_install=$'/usr/bin/ginstall -c'}
+ac_cv_prog_CC=${ac_cv_prog_CC=gcc}
+ac_cv_prog_CPP=${ac_cv_prog_CPP=$'gcc -E'}
+ac_cv_prog_CXX=${ac_cv_prog_CXX=g++}
+ac_cv_prog_CXXCPP=${ac_cv_prog_CXXCPP=$'g++ -E'}
+ac_cv_prog_LN_S=${ac_cv_prog_LN_S=$'ln -s'}
+ac_cv_prog_RANLIB=${ac_cv_prog_RANLIB=ranlib}
+ac_cv_prog_STRIP=${ac_cv_prog_STRIP=strip}
+ac_cv_prog_cc_can_build_shared=${ac_cv_prog_cc_can_build_shared=yes}
+ac_cv_prog_cc_cross=${ac_cv_prog_cc_cross=no}
+ac_cv_prog_cc_no_builtin=${ac_cv_prog_cc_no_builtin=}
+ac_cv_prog_cc_pic=${ac_cv_prog_cc_pic=$' -fPIC -DPIC'}
+ac_cv_prog_cc_pic_works=${ac_cv_prog_cc_pic_works=yes}
+ac_cv_prog_cc_shlib=${ac_cv_prog_cc_shlib=}
+ac_cv_prog_cc_static=${ac_cv_prog_cc_static=-static}
+ac_cv_prog_cc_static_works=${ac_cv_prog_cc_static_works=yes}
+ac_cv_prog_cc_wl=${ac_cv_prog_cc_wl=-Wl,}
+ac_cv_prog_cc_works=${ac_cv_prog_cc_works=yes}
+ac_cv_prog_cxx_cross=${ac_cv_prog_cxx_cross=no}
+ac_cv_prog_cxx_works=${ac_cv_prog_cxx_works=yes}
+ac_cv_prog_gcc=${ac_cv_prog_gcc=yes}
+ac_cv_prog_gxx=${ac_cv_prog_gxx=yes}
+ac_cv_prog_make_make_set=${ac_cv_prog_make_make_set=yes}
+ac_cv_sizeof_char_p=${ac_cv_sizeof_char_p=4}
+ac_cv_sizeof_int=${ac_cv_sizeof_int=4}
+ac_cv_sizeof_long=${ac_cv_sizeof_long=4}
+kde_cv_all_paths=${kde_cv_all_paths=$'kde_have_all_paths="yes" \tkde_htmldir="\\${prefix}/share/doc/HTML" \tkde_appsdir="\\${prefix}/share/applnk" \tkde_icondir="\\${prefix}/share/icons" \tkde_sounddir="\\${prefix}/share/sounds" \tkde_datadir="\\${prefix}/share/apps" \tkde_locale="\\${prefix}/share/locale" \tkde_cgidir="\\${exec_prefix}/cgi-bin" \tkde_confdir="\\${prefix}/share/config" \tkde_mimedir="\\${prefix}/share/mimelnk" \tkde_toolbardir="\\${prefix}/share/toolbar" \tkde_wallpaperdir="\\${prefix}/share/wallpapers" \tkde_templatesdir="\\${prefix}/share/templates" \tkde_bindir="\\${exec_prefix}/bin" \tkde_servicesdir="\\${prefix}/share/services" \tkde_servicetypesdir="\\${prefix}/share/servicetypes" \tkde_moduledir="\\${prefix}/lib/kde2" \tkde_result=defaults'}
+kde_cv_have_libXext=${kde_cv_have_libXext=yes}
+kde_cv_have_x=${kde_cv_have_x=$'have_x=yes          kde_x_includes=/usr/X11R6/include kde_x_libraries=/usr/X11R6/lib'}
+kde_cv_path=${kde_cv_path=/opt/kde2/bin/kde-config}
+kde_cv_path_artsc_config=${kde_cv_path_artsc_config=/opt/kde2/bin/artsc-config}
+kde_cv_path_dcopidl=${kde_cv_path_dcopidl=/opt/kde2/bin/dcopidl}
+kde_cv_path_dcopidl2cpp=${kde_cv_path_dcopidl2cpp=/opt/kde2/bin/dcopidl2cpp}
+kde_cv_path_kdb2html=${kde_cv_path_kdb2html=/opt/kde2/bin/kdb2html}
+kde_cv_path_kde_config=${kde_cv_path_kde_config=/opt/kde2/bin/kde-config}
+kde_cv_path_mcopidl=${kde_cv_path_mcopidl=/opt/kde2/bin/mcopidl}
+kde_cv_path_moc=${kde_cv_path_moc=/usr/lib/qt2/bin/moc}
+kde_cv_path_uic=${kde_cv_path_uic=/usr/lib/qt2/bin/uic}
+kde_cv_prog_cxx_Wno_long_long=${kde_cv_prog_cxx_Wno_long_long=yes}
+kde_cv_prog_cxx_Wnon_virtual_dtor=${kde_cv_prog_cxx_Wnon_virtual_dtor=yes}
+kde_cv_prog_cxx_fexceptions=${kde_cv_prog_cxx_fexceptions=yes}
+kde_cv_prog_cxx_fno_builtin=${kde_cv_prog_cxx_fno_builtin=yes}
+kde_cv_prog_cxx_fno_check_new=${kde_cv_prog_cxx_fno_check_new=yes}
+kde_cv_prog_cxx_fno_exceptions=${kde_cv_prog_cxx_fno_exceptions=yes}
+kde_cv_prog_cxx_frepo=${kde_cv_prog_cxx_frepo=yes}
+kde_cv_prog_cxx_frtti=${kde_cv_prog_cxx_frtti=yes}
+kde_cv_qt_direct=${kde_cv_qt_direct=no}
+lt_cv_deplibs_check_method=${lt_cv_deplibs_check_method=pass_all}
+lt_cv_dlopen=${lt_cv_dlopen=dlopen}
+lt_cv_dlopen_libs=${lt_cv_dlopen_libs=-ldl}
+lt_cv_dlopen_self=${lt_cv_dlopen_self=yes}
+lt_cv_dlopen_self_static=${lt_cv_dlopen_self_static=no}
+lt_cv_file_magic_cmd=${lt_cv_file_magic_cmd=$'$MAGIC_CMD'}
+lt_cv_file_magic_test_file=${lt_cv_file_magic_test_file=$'/lib/libc.so.6 /lib/libc-*.so'}
+lt_cv_ld_reload_flag=${lt_cv_ld_reload_flag=-r}
+lt_cv_path_LD=${lt_cv_path_LD=/usr/i486-suse-linux/bin/ld}
+lt_cv_path_NM=${lt_cv_path_NM=$'/usr/bin/nm -B'}
+lt_cv_prog_gnu_ld=${lt_cv_prog_gnu_ld=yes}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/config.h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/config.h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/config.h	(revision 3401)
@@ -0,0 +1,37 @@
+/* config.h.  Generated automatically by configure.  */
+/* config.h.in.  Generated automatically from configure.in by autoheader.  */
+
+/* The number of bytes in a char *.  */
+#define SIZEOF_CHAR_P 4
+
+/* The number of bytes in a int.  */
+#define SIZEOF_INT 4
+
+/* The number of bytes in a long.  */
+#define SIZEOF_LONG 4
+
+/* Name of package */
+#define PACKAGE "activemirrorcontrol"
+
+/* Version number of package */
+#define VERSION "0.1"
+
+/* C++ compiler supports template repository */
+#define HAVE_TEMPLATE_REPOSITORY 1
+
+/* Defines if your system has the crypt function */
+#define HAVE_CRYPT 1
+
+/* Define the type of the third argument for getsockname
+ */
+#define ksize_t socklen_t
+
+/* Define if you have libz */
+#define HAVE_LIBZ 1
+
+/* Define if you have libpng */
+#define HAVE_LIBPNG 1
+
+/* Define if you have libjpeg */
+#define HAVE_LIBJPEG 1
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/config.h.in
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/config.h.in	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/config.h.in	(revision 3401)
@@ -0,0 +1,36 @@
+/* config.h.in.  Generated automatically from configure.in by autoheader.  */
+
+/* The number of bytes in a char *.  */
+#undef SIZEOF_CHAR_P
+
+/* The number of bytes in a int.  */
+#undef SIZEOF_INT
+
+/* The number of bytes in a long.  */
+#undef SIZEOF_LONG
+
+/* Name of package */
+#undef PACKAGE
+
+/* Version number of package */
+#undef VERSION
+
+/* C++ compiler supports template repository */
+#undef HAVE_TEMPLATE_REPOSITORY
+
+/* Defines if your system has the crypt function */
+#undef HAVE_CRYPT
+
+/* Define the type of the third argument for getsockname
+ */
+#undef ksize_t
+
+/* Define if you have libz */
+#undef HAVE_LIBZ
+
+/* Define if you have libpng */
+#undef HAVE_LIBPNG
+
+/* Define if you have libjpeg */
+#undef HAVE_LIBJPEG
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/config.log
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/config.log	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/config.log	(revision 3401)
@@ -0,0 +1,25 @@
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+configure:617: checking host system type
+configure:638: checking target system type
+configure:656: checking build system type
+configure:715: checking for a BSD compatible install
+configure:772: checking for -p flag to install
+configure:795: checking whether build environment is sane
+configure:833: checking whether make sets ${MAKE}
+configure:879: checking for working aclocal
+configure:892: checking for working autoconf
+configure:905: checking for working automake
+configure:918: checking for working autoheader
+configure:931: checking for working makeinfo
+configure:1037: checking for a C-Compiler
+configure:1149: checking whether the C compiler (i386-linux-gcc  ) works
+configure:1165: i386-linux-gcc -o conftest    conftest.c  1>&5
+./configure: i386-linux-gcc: command not found
+configure: failed program was:
+
+#line 1160 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
Index: trunk/MagicSoft/AMC/activemirrorcontrol/config.status
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/config.status	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/config.status	(revision 3401)
@@ -0,0 +1,316 @@
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host pc7:
+#
+# ./configure  --with-qt-dir=/usr/lib/qt2 --prefix=/opt/kde2
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: ./config.status [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running ${CONFIG_SHELL-/bin/sh} ./configure  --with-qt-dir=/usr/lib/qt2 --prefix=/opt/kde2 --no-create --no-recursion"
+    exec ${CONFIG_SHELL-/bin/sh} ./configure  --with-qt-dir=/usr/lib/qt2 --prefix=/opt/kde2 --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "./config.status generated by autoconf version 2.13"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "$ac_cs_usage"; exit 0 ;;
+  *) echo "$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=.
+ac_given_INSTALL="/usr/bin/ginstall -c -p"
+
+trap 'rm -fr ./Makefile activemirrorcontrol/Makefile doc/Makefile doc/en/Makefile po/Makefile  config.h conftest*; exit 1' 1 2 15
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g$/@g/; /@g$/s/[\\&%]/\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g$/%g/' > conftest.subs <<\CEOF
+/^[ 	]*VPATH[ 	]*=[^:]*$/d
+
+s%@SHELL@%/bin/sh%g
+s%@CFLAGS@%-O2%g
+s%@CPPFLAGS@%%g
+s%@CXXFLAGS@%-O2 -fno-exceptions -fno-check-new -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -Wnon-virtual-dtor -fno-builtin -O0 -g2 -Wall -fexceptions -DQT_THREAD_SUPPORT%g
+s%@FFLAGS@%%g
+s%@DEFS@%-DHAVE_CONFIG_H%g
+s%@LDFLAGS@%  %g
+s%@LIBS@%%g
+s%@exec_prefix@%${prefix}%g
+s%@prefix@%/opt/kde2%g
+s%@program_transform_name@%s,x,x,%g
+s%@bindir@%${exec_prefix}/bin%g
+s%@sbindir@%${exec_prefix}/sbin%g
+s%@libexecdir@%${exec_prefix}/libexec%g
+s%@datadir@%${prefix}/share%g
+s%@sysconfdir@%${prefix}/etc%g
+s%@sharedstatedir@%${prefix}/com%g
+s%@localstatedir@%${prefix}/var%g
+s%@libdir@%${exec_prefix}/lib%g
+s%@includedir@%${prefix}/include%g
+s%@oldincludedir@%/usr/include%g
+s%@infodir@%${prefix}/info%g
+s%@mandir@%${prefix}/man%g
+s%@host@%i686-pc-linux-gnu%g
+s%@host_alias@%i686-pc-linux-gnu%g
+s%@host_cpu@%i686%g
+s%@host_vendor@%pc%g
+s%@host_os@%linux-gnu%g
+s%@target@%i686-pc-linux-gnu%g
+s%@target_alias@%i686-pc-linux-gnu%g
+s%@target_cpu@%i686%g
+s%@target_vendor@%pc%g
+s%@target_os@%linux-gnu%g
+s%@build@%i686-pc-linux-gnu%g
+s%@build_alias@%i686-pc-linux-gnu%g
+s%@build_cpu@%i686%g
+s%@build_vendor@%pc%g
+s%@build_os@%linux-gnu%g
+s%@INSTALL_PROGRAM@%${INSTALL} $(INSTALL_STRIP_FLAG)%g
+s%@INSTALL_SCRIPT@%${INSTALL}%g
+s%@INSTALL_DATA@%${INSTALL} -m 644%g
+s%@PACKAGE@%activemirrorcontrol%g
+s%@VERSION@%0.1%g
+s%@ACLOCAL@%aclocal%g
+s%@AUTOCONF@%autoconf%g
+s%@AUTOMAKE@%automake%g
+s%@AUTOHEADER@%autoheader%g
+s%@MAKEINFO@%makeinfo%g
+s%@SET_MAKE@%%g
+s%@CONF_FILES@% $(top_srcdir)/./admin/configure.in.min $(top_srcdir)/configure.in.in%g
+s%@CC@%gcc%g
+s%@CPP@%gcc -E%g
+s%@CXX@%g++%g
+s%@USE_EXCEPTIONS@%-fexceptions%g
+s%@USE_RTTI@%-frtti%g
+s%@CXXCPP@%g++ -E%g
+s%@NOOPT_CXXFLAGS@% -fno-exceptions -fno-check-new -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -Wnon-virtual-dtor -fno-builtin -g2 -Wall -fexceptions -DQT_THREAD_SUPPORT%g
+s%@REPO@%-frepo%g
+s%@NOREPO@%-fno-repo%g
+s%@KDE_USE_FINAL_TRUE@%#%g
+s%@KDE_USE_FINAL_FALSE@%%g
+s%@KDE_USE_CLOSURE_TRUE@%%g
+s%@KDE_USE_CLOSURE_FALSE@%#%g
+s%@KDE_CXXFLAGS@%%g
+s%@OBJEXT@%o%g
+s%@EXEEXT@%%g
+s%@LN_S@%ln -s%g
+s%@RANLIB@%ranlib%g
+s%@STRIP@%strip%g
+s%@LIBTOOL@%$(SHELL) $(top_builddir)/libtool%g
+s%@KDE_PLUGIN@%-avoid-version -module -no-undefined%g
+s%@MSGFMT@%/usr/bin/msgfmt%g
+s%@GMSGFMT@%/usr/bin/msgfmt%g
+s%@XGETTEXT@%/usr/bin/xgettext%g
+s%@LIBCOMPAT@%%g
+s%@LIBCRYPT@%-lcrypt%g
+s%@LIBSOCKET@%%g
+s%@X_EXTRA_LIBS@%%g
+s%@LIBUCB@%%g
+s%@LIBDL@%-ldl%g
+s%@X_INCLUDES@%-I/usr/X11R6/include%g
+s%@X_LDFLAGS@%-L/usr/X11R6/lib%g
+s%@x_libraries@%/usr/X11R6/lib%g
+s%@x_includes@%/usr/X11R6/include%g
+s%@LIBSM@%-lSM -lICE%g
+s%@X_PRE_LIBS@%%g
+s%@LIB_X11@%-lX11 $(LIBSOCKET)%g
+s%@USER_INCLUDES@%%g
+s%@USER_LDFLAGS@%%g
+s%@LIBZ@%-lz%g
+s%@LIBPNG@%-lpng -lz -lm%g
+s%@LIBJPEG@%-ljpeg%g
+s%@qt_libraries@%/usr/lib/qt2/lib%g
+s%@qt_includes@%/usr/lib/qt2/include%g
+s%@QT_INCLUDES@%-I/usr/lib/qt2/include%g
+s%@QT_LDFLAGS@%-L/usr/lib/qt2/lib%g
+s%@MOC@%/usr/lib/qt2/bin/moc%g
+s%@UIC@%/usr/lib/qt2/bin/uic%g
+s%@LIB_QT@%-lqt $(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)%g
+s%@KDE_EXTRA_RPATH@%%g
+s%@KDE_RPATH@%-R $(kde_libraries) -R $(qt_libraries) -R $(x_libraries)%g
+s%@kde_libraries@%/opt/kde2/lib%g
+s%@kde_includes@%/opt/kde2/include%g
+s%@KDE_LDFLAGS@%-L/opt/kde2/lib%g
+s%@KDE_INCLUDES@%-I/opt/kde2/include%g
+s%@all_includes@%-I/opt/kde2/include -I/usr/lib/qt2/include -I/usr/X11R6/include %g
+s%@all_libraries@%-L/usr/X11R6/lib -L/usr/lib/qt2/lib -L/opt/kde2/lib %g
+s%@AUTODIRS@%%g
+s%@DCOPIDL@%/opt/kde2/bin/dcopidl%g
+s%@DCOPIDL2CPP@%/opt/kde2/bin/dcopidl2cpp%g
+s%@DCOP_DEPENDENCIES@%$(DCOPIDL)%g
+s%@MCOPIDL@%/opt/kde2/bin/mcopidl%g
+s%@KDB2HTML@%/opt/kde2/bin/kdb2html%g
+s%@ARTSCCONFIG@%/opt/kde2/bin/artsc-config%g
+s%@KDECONFIG@%/opt/kde2/bin/kde-config%g
+s%@kde_libs_prefix@%/opt/kde2%g
+s%@kde_libs_htmldir@%/opt/kde2/share/doc/HTML%g
+s%@kde_htmldir@%${prefix}/share/doc/HTML%g
+s%@kde_appsdir@%${prefix}/share/applnk%g
+s%@kde_icondir@%${prefix}/share/icons%g
+s%@kde_sounddir@%${prefix}/share/sounds%g
+s%@kde_datadir@%${prefix}/share/apps%g
+s%@kde_locale@%${prefix}/share/locale%g
+s%@kde_confdir@%${prefix}/share/config%g
+s%@kde_mimedir@%${prefix}/share/mimelnk%g
+s%@kde_wallpaperdir@%${prefix}/share/wallpapers%g
+s%@kde_bindir@%${exec_prefix}/bin%g
+s%@kde_templatesdir@%${prefix}/share/templates%g
+s%@kde_servicesdir@%${prefix}/share/services%g
+s%@kde_servicetypesdir@%${prefix}/share/servicetypes%g
+s%@kde_moduledir@%${prefix}/lib/kde2%g
+s%@LIB_KDECORE@%-lkdecore%g
+s%@LIB_KDEUI@%-lkdeui%g
+s%@LIB_KFORMULA@%-lkformula%g
+s%@LIB_KIO@%-lkio%g
+s%@LIB_KSYCOCA@%-lksycoca%g
+s%@LIB_SMB@%-lsmb%g
+s%@LIB_KFILE@%-lkfile%g
+s%@LIB_KAB@%-lkab%g
+s%@LIB_KHTML@%-lkhtml%g
+s%@LIB_KSPELL@%-lkspell%g
+s%@LIB_KPARTS@%-lkparts%g
+s%@LIB_KWRITE@%-lkwrite%g
+s%@LIB_KFM@%%g
+s%@TOPSUBDIRS@% activemirrorcontrol doc po%g
+
+CEOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+CONFIG_FILES=${CONFIG_FILES-"./Makefile activemirrorcontrol/Makefile doc/Makefile doc/en/Makefile po/Makefile "}
+#echo Doing the fast build of Makefiles -- autoconf 213
+if test "x$ac_cs_root" = "x" ; then
+    ac_cs_root=conftest
+fi
+rm -f $ac_cs_root.sacfiles
+for ac_file in .. $CONFIG_FILES ; do
+    if test "x$ac_file" != x..; then
+        echo $ac_file >> $ac_cs_root.sacfiles
+    fi
+done
+if test -f $ac_cs_root.sacfiles ; then
+    perl admin/config.pl "$ac_cs_root" "$ac_given_srcdir" "$ac_given_INSTALL"
+fi
+rm -f $ac_cs_root.s*
+
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
+ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_uB='\([ 	]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+  CONFIG_HEADERS="config.h"
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  echo creating $ac_file
+
+  rm -f conftest.frag conftest.in conftest.out
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  cat $ac_file_inputs > conftest.in
+
+  cat > conftest.frag <<CEOF
+${ac_dA}PACKAGE${ac_dB}PACKAGE${ac_dC}"activemirrorcontrol"${ac_dD}
+${ac_uA}PACKAGE${ac_uB}PACKAGE${ac_uC}"activemirrorcontrol"${ac_uD}
+${ac_eA}PACKAGE${ac_eB}PACKAGE${ac_eC}"activemirrorcontrol"${ac_eD}
+${ac_dA}VERSION${ac_dB}VERSION${ac_dC}"0.1"${ac_dD}
+${ac_uA}VERSION${ac_uB}VERSION${ac_uC}"0.1"${ac_uD}
+${ac_eA}VERSION${ac_eB}VERSION${ac_eC}"0.1"${ac_eD}
+${ac_dA}HAVE_TEMPLATE_REPOSITORY${ac_dB}HAVE_TEMPLATE_REPOSITORY${ac_dC}1${ac_dD}
+${ac_uA}HAVE_TEMPLATE_REPOSITORY${ac_uB}HAVE_TEMPLATE_REPOSITORY${ac_uC}1${ac_uD}
+${ac_eA}HAVE_TEMPLATE_REPOSITORY${ac_eB}HAVE_TEMPLATE_REPOSITORY${ac_eC}1${ac_eD}
+${ac_dA}HAVE_CRYPT${ac_dB}HAVE_CRYPT${ac_dC}1${ac_dD}
+${ac_uA}HAVE_CRYPT${ac_uB}HAVE_CRYPT${ac_uC}1${ac_uD}
+${ac_eA}HAVE_CRYPT${ac_eB}HAVE_CRYPT${ac_eC}1${ac_eD}
+CEOF
+  sed -f conftest.frag conftest.in > conftest.out
+  rm -f conftest.in
+  mv conftest.out conftest.in
+
+  cat > conftest.frag <<CEOF
+${ac_dA}ksize_t${ac_dB}ksize_t${ac_dC}socklen_t${ac_dD}
+${ac_uA}ksize_t${ac_uB}ksize_t${ac_uC}socklen_t${ac_uD}
+${ac_eA}ksize_t${ac_eB}ksize_t${ac_eC}socklen_t${ac_eD}
+${ac_dA}SIZEOF_INT${ac_dB}SIZEOF_INT${ac_dC}4${ac_dD}
+${ac_uA}SIZEOF_INT${ac_uB}SIZEOF_INT${ac_uC}4${ac_uD}
+${ac_eA}SIZEOF_INT${ac_eB}SIZEOF_INT${ac_eC}4${ac_eD}
+${ac_dA}SIZEOF_LONG${ac_dB}SIZEOF_LONG${ac_dC}4${ac_dD}
+${ac_uA}SIZEOF_LONG${ac_uB}SIZEOF_LONG${ac_uC}4${ac_uD}
+${ac_eA}SIZEOF_LONG${ac_eB}SIZEOF_LONG${ac_eC}4${ac_eD}
+${ac_dA}SIZEOF_CHAR_P${ac_dB}SIZEOF_CHAR_P${ac_dC}4${ac_dD}
+${ac_uA}SIZEOF_CHAR_P${ac_uB}SIZEOF_CHAR_P${ac_uC}4${ac_uD}
+${ac_eA}SIZEOF_CHAR_P${ac_eB}SIZEOF_CHAR_P${ac_eC}4${ac_eD}
+CEOF
+  sed -f conftest.frag conftest.in > conftest.out
+  rm -f conftest.in
+  mv conftest.out conftest.in
+
+  cat > conftest.frag <<CEOF
+${ac_dA}HAVE_LIBZ${ac_dB}HAVE_LIBZ${ac_dC}1${ac_dD}
+${ac_uA}HAVE_LIBZ${ac_uB}HAVE_LIBZ${ac_uC}1${ac_uD}
+${ac_eA}HAVE_LIBZ${ac_eB}HAVE_LIBZ${ac_eC}1${ac_eD}
+${ac_dA}HAVE_LIBPNG${ac_dB}HAVE_LIBPNG${ac_dC}1${ac_dD}
+${ac_uA}HAVE_LIBPNG${ac_uB}HAVE_LIBPNG${ac_uC}1${ac_uD}
+${ac_eA}HAVE_LIBPNG${ac_eB}HAVE_LIBPNG${ac_eC}1${ac_eD}
+${ac_dA}HAVE_LIBJPEG${ac_dB}HAVE_LIBJPEG${ac_dC}1${ac_dD}
+${ac_uA}HAVE_LIBJPEG${ac_uB}HAVE_LIBJPEG${ac_uC}1${ac_uD}
+${ac_eA}HAVE_LIBJPEG${ac_eB}HAVE_LIBJPEG${ac_eC}1${ac_eD}
+s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+CEOF
+  sed -f conftest.frag conftest.in > conftest.out
+  rm -f conftest.in
+  mv conftest.out conftest.in
+
+  rm -f conftest.frag conftest.h
+  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
+  cat conftest.in >> conftest.h
+  rm -f conftest.in
+  if cmp -s $ac_file conftest.h 2>/dev/null; then
+    echo "$ac_file is unchanged"
+    rm -f conftest.h
+  else
+    # Remove last slash and all that follows it.  Not all systems have dirname.
+      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+      # The file is in a subdirectory.
+      test ! -d "$ac_dir" && mkdir "$ac_dir"
+    fi
+    rm -f $ac_file
+    mv conftest.h $ac_file
+  fi
+fi; done
+
+
+
+test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+
+exit 0
Index: trunk/MagicSoft/AMC/activemirrorcontrol/configure
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/configure	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/configure	(revision 3401)
@@ -0,0 +1,7489 @@
+#! /bin/sh
+
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf version 2.13 
+# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc.
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+
+# Defaults:
+ac_help=
+ac_default_prefix=/usr/local
+# Any additions from configure.in:
+ac_default_prefix=${KDEDIR:-/usr/local/kde}
+ac_help="$ac_help
+  --disable-fast-perl     disable fast Makefile generation (needs perl)"
+ac_help="$ac_help
+  --enable-debug          enables debug symbols [default=no]"
+ac_help="$ac_help
+  --disable-debug         disables debug output and debug symbols [default=no]"
+ac_help="$ac_help
+  --enable-strict         compiles with strict compiler options (may not work!)"
+ac_help="$ac_help
+  --enable-profile        creates profiling infos [default=no]"
+ac_help="$ac_help
+  --enable-final          build size optimized apps (experimental - needs lots of memory)"
+ac_help="$ac_help
+  --disable-closure       don't delay template instantiation"
+ac_help="$ac_help
+  --enable-shared[=PKGS]  build shared libraries [default=yes]"
+ac_help="$ac_help
+  --enable-static[=PKGS]  build static libraries [default=no]"
+ac_help="$ac_help
+  --enable-fast-install[=PKGS]  optimize for fast installation [default=yes]"
+ac_help="$ac_help
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]"
+ac_help="$ac_help
+  --disable-libtool-lock  avoid locking (might break parallel builds)"
+ac_help="$ac_help
+  --with-pic              try to use only PIC/non-PIC objects [default=use both]"
+ac_help="$ac_help
+  --enable-mt             link to threaded Qt (experimental)"
+ac_help="$ac_help
+  --with-extra-includes=DIR
+                          adds non standard include paths"
+ac_help="$ac_help
+  --with-extra-libs=DIR   adds non standard library paths"
+ac_help="$ac_help
+  --with-qt-dir=DIR       where the root of Qt is installed "
+ac_help="$ac_help
+  --with-qt-includes=DIR  where the Qt includes are. "
+ac_help="$ac_help
+  --with-qt-libraries=DIR where the Qt library is installed."
+ac_help="$ac_help
+  --disable-rpath         do not use the rpath feature of ld"
+ac_help="$ac_help
+  --disable-path-check    don't try to find out, where to install"
+
+# Initialize some variables set by options.
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+build=NONE
+cache_file=./config.cache
+exec_prefix=NONE
+host=NONE
+no_create=
+nonopt=NONE
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+target=NONE
+verbose=
+x_includes=NONE
+x_libraries=NONE
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datadir='${prefix}/share'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+libdir='${exec_prefix}/lib'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+infodir='${prefix}/info'
+mandir='${prefix}/man'
+
+# Initialize some other variables.
+subdirs=
+MFLAGS= MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+# Maximum number of lines to put in a shell here document.
+ac_max_here_lines=12
+
+ac_prev=
+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=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) ac_optarg= ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case "$ac_option" in
+
+  -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 ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build="$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" ;;
+
+  -datadir | --datadir | --datadi | --datad | --data | --dat | --da)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \
+  | --da=*)
+    datadir="$ac_optarg" ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*disable-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    eval "enable_${ac_feature}=no" ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; }
+    fi
+    ac_feature=`echo $ac_feature| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "enable_${ac_feature}='$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)
+    # 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 << EOF
+Usage: configure [options] [host]
+Options: [defaults in brackets after descriptions]
+Configuration:
+  --cache-file=FILE       cache test results in FILE
+  --help                  print this message
+  --no-create             do not create output files
+  --quiet, --silent       do not print \`checking...' messages
+  --version               print the version of autoconf that created configure
+Directory and file names:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [same as prefix]
+  --bindir=DIR            user executables in DIR [EPREFIX/bin]
+  --sbindir=DIR           system admin executables in DIR [EPREFIX/sbin]
+  --libexecdir=DIR        program executables in DIR [EPREFIX/libexec]
+  --datadir=DIR           read-only architecture-independent data in DIR
+                          [PREFIX/share]
+  --sysconfdir=DIR        read-only single-machine data in DIR [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data in DIR
+                          [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data in DIR [PREFIX/var]
+  --libdir=DIR            object code libraries in DIR [EPREFIX/lib]
+  --includedir=DIR        C header files in DIR [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc in DIR [/usr/include]
+  --infodir=DIR           info documentation in DIR [PREFIX/info]
+  --mandir=DIR            man documentation in DIR [PREFIX/man]
+  --srcdir=DIR            find the sources in DIR [configure dir or ..]
+  --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
+EOF
+    cat << EOF
+Host type:
+  --build=BUILD           configure for building on BUILD [BUILD=HOST]
+  --host=HOST             configure for HOST [guessed]
+  --target=TARGET         configure for TARGET [TARGET=HOST]
+Features and packages:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --x-includes=DIR        X include files are in DIR
+  --x-libraries=DIR       X library files are in DIR
+EOF
+    if test -n "$ac_help"; then
+      echo "--enable and --with options recognized:$ac_help"
+    fi
+    exit 0 ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host="$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" ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst \
+  | --locals | --local | --loca | --loc | --lo)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* \
+  | --locals=* | --local=* | --loca=* | --loc=* | --lo=*)
+    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)
+    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" ;;
+
+  -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 ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target="$ac_optarg" ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers)
+    echo "configure generated by autoconf version 2.13"
+    exit 0 ;;
+
+  -with-* | --with-*)
+    ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    case "$ac_option" in
+      *=*) ;;
+      *) ac_optarg=yes ;;
+    esac
+    eval "with_${ac_package}='$ac_optarg'" ;;
+
+  -without-* | --without-*)
+    ac_package=`echo $ac_option|sed -e 's/-*without-//'`
+    # Reject names that are not valid shell variable names.
+    if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then
+      { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; }
+    fi
+    ac_package=`echo $ac_package| sed 's/-/_/g'`
+    eval "with_${ac_package}=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" ;;
+
+  -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; }
+    ;;
+
+  *)
+    if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then
+      echo "configure: warning: $ac_option: invalid host type" 1>&2
+    fi
+    if test "x$nonopt" != xNONE; then
+      { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; }
+    fi
+    nonopt="$ac_option"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; }
+fi
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+# File descriptor usage:
+# 0 standard input
+# 1 file creation
+# 2 errors and warnings
+# 3 some systems may open it to /dev/tty
+# 4 used on the Kubota Titan
+# 6 checking for... messages and results
+# 5 compiler messages saved in config.log
+if test "$silent" = yes; then
+  exec 6>/dev/null
+else
+  exec 6>&1
+fi
+exec 5>./config.log
+
+echo "\
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+" 1>&5
+
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Also quote any args containing shell metacharacters.
+ac_configure_args=
+for ac_arg
+do
+  case "$ac_arg" in
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c) ;;
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;;
+  *" "*|*"	"*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*)
+  ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+  *) ac_configure_args="$ac_configure_args $ac_arg" ;;
+  esac
+done
+
+# NLS nuisances.
+# Only set these to C if already set.  These must not be set unconditionally
+# because not all systems understand e.g. LANG=C (notably SCO).
+# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'!
+# Non-C LC_CTYPE values break the ctype check.
+if test "${LANG+set}"   = set; then LANG=C;   export LANG;   fi
+if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi
+if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi
+if test "${LC_CTYPE+set}"    = set; then LC_CTYPE=C;    export LC_CTYPE;    fi
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -rf conftest* confdefs.h
+# AIX cpp loses on an empty file, so make sure it contains at least a newline.
+echo > confdefs.h
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+ac_unique_file=acinclude.m4
+
+# 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 its parent.
+  ac_prog=$0
+  ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'`
+  test "x$ac_confdir" = "x$ac_prog" && ac_confdir=.
+  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
+  if test "$ac_srcdir_defaulted" = yes; then
+    { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; }
+  else
+    { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; }
+  fi
+fi
+srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'`
+
+# Prefer explicitly selected file to automatically selected ones.
+if test -z "$CONFIG_SITE"; then
+  if test "x$prefix" != xNONE; then
+    CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site"
+  else
+    CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site"
+  fi
+fi
+for ac_site_file in $CONFIG_SITE; do
+  if test -r "$ac_site_file"; then
+    echo "loading site script $ac_site_file"
+    . "$ac_site_file"
+  fi
+done
+
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_exeext=
+ac_objext=o
+if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then
+  # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu.
+  if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then
+    ac_n= ac_c='
+' ac_t='	'
+  else
+    ac_n=-n ac_c= ac_t=
+  fi
+else
+  ac_n= ac_c='\c' ac_t=
+fi
+
+ 
+ac_aux_dir=
+for ac_dir in admin $srcdir/admin; 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
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { echo "configure: error: can not find install-sh or install.sh in admin $srcdir/admin" 1>&2; exit 1; }
+fi
+ac_config_guess=$ac_aux_dir/config.guess
+ac_config_sub=$ac_aux_dir/config.sub
+ac_configure=$ac_aux_dir/configure # This should be Cygnus configure.
+
+
+
+# Do some error checking and defaulting for the host and target type.
+# The inputs are:
+#    configure --host=HOST --target=TARGET --build=BUILD NONOPT
+#
+# The rules are:
+# 1. You are not allowed to specify --host, --target, and nonopt at the
+#    same time.
+# 2. Host defaults to nonopt.
+# 3. If nonopt is not specified, then host defaults to the current host,
+#    as determined by config.guess.
+# 4. Target and build default to nonopt.
+# 5. If nonopt is not specified, then target and build default to host.
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+case $host---$target---$nonopt in
+NONE---*---* | *---NONE---* | *---*---NONE) ;;
+*) { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ;;
+esac
+
+
+# Make sure we can run config.sub.
+if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then :
+else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
+fi
+
+echo $ac_n "checking host system type""... $ac_c" 1>&6
+echo "configure:617: checking host system type" >&5
+
+host_alias=$host
+case "$host_alias" in
+NONE)
+  case $nonopt in
+  NONE)
+    if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then :
+    else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; }
+    fi ;;
+  *) host_alias=$nonopt ;;
+  esac ;;
+esac
+
+host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias`
+host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$host" 1>&6
+
+echo $ac_n "checking target system type""... $ac_c" 1>&6
+echo "configure:638: checking target system type" >&5
+
+target_alias=$target
+case "$target_alias" in
+NONE)
+  case $nonopt in
+  NONE) target_alias=$host_alias ;;
+  *) target_alias=$nonopt ;;
+  esac ;;
+esac
+
+target=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $target_alias`
+target_cpu=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+target_vendor=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+target_os=`echo $target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$target" 1>&6
+
+echo $ac_n "checking build system type""... $ac_c" 1>&6
+echo "configure:656: checking build system type" >&5
+
+build_alias=$build
+case "$build_alias" in
+NONE)
+  case $nonopt in
+  NONE) build_alias=$host_alias ;;
+  *) build_alias=$nonopt ;;
+  esac ;;
+esac
+
+build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias`
+build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
+build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
+build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
+echo "$ac_t""$build" 1>&6
+
+test "$host_alias" != "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+ 
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+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"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+
+
+    
+          test -n "$INSTALL" && kde_save_INSTALL_given=$INSTALL
+  test -n "$INSTALL_PROGRAM" && kde_save_INSTALL_PROGRAM_given=$INSTALL_PROGRAM
+  test -n "$INSTALL_SCRIPT" && kde_save_INSTALL_SCRIPT_given=$INSTALL_SCRIPT
+  # 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
+# 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"
+# ./install, which can be erroneously created by make from ./install.sh.
+echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
+echo "configure:715: checking for a BSD compatible install" >&5
+if test -z "$INSTALL"; then
+if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    IFS="${IFS= 	}"; ac_save_IFS="$IFS"; IFS=":"
+  for ac_dir in $PATH; do
+    # Account for people who put trailing slashes in PATH elements.
+    case "$ac_dir/" in
+    /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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
+        if test -f $ac_dir/$ac_prog; then
+	  if test $ac_prog = install &&
+            grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  else
+	    ac_cv_path_install="$ac_dir/$ac_prog -c"
+	    break 2
+	  fi
+	fi
+      done
+      ;;
+    esac
+  done
+  IFS="$ac_save_IFS"
+
+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.  We don't cache a
+    # path for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the path is relative.
+    INSTALL="$ac_install_sh"
+  fi
+fi
+echo "$ac_t""$INSTALL" 1>&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_PROGRAM}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+
+  if test -z "$kde_save_INSTALL_given" ; then
+    # OK, user hasn't given any INSTALL, autoconf found one for us
+    # now we test, if it supports the -p flag
+    echo $ac_n "checking for -p flag to install""... $ac_c" 1>&6
+echo "configure:772: checking for -p flag to install" >&5
+    rm -f confinst.$$.* > /dev/null 2>&1
+    echo "Testtest" > confinst.$$.orig
+    ac_res=no
+    if ${INSTALL} -p confinst.$$.orig confinst.$$.new > /dev/null 2>&1 ; then
+      if test -f confinst.$$.new ; then
+        # OK, -p seems to do no harm to install
+	INSTALL="${INSTALL} -p"
+	ac_res=yes
+      fi
+    fi
+    rm -f confinst.$$.*
+    echo "$ac_t""$ac_res" 1>&6
+  fi
+                                                      
+  if test -z "$kde_save_INSTALL_PROGRAM_given" ; then
+    INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
+  fi
+  if test -z "$kde_save_INSTALL_SCRIPT_given" ; then
+    INSTALL_SCRIPT='${INSTALL}'
+  fi
+
+echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6
+echo "configure:795: checking whether build environment is sane" >&5
+# Just in case
+sleep 1
+echo timestamp > conftestfile
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t $srcdir/configure conftestfile`
+   fi
+   if test "$*" != "X $srcdir/configure conftestfile" \
+      && test "$*" != "X conftestfile $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".
+      { echo "configure: error: ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" 1>&2; exit 1; }
+   fi
+
+   test "$2" = conftestfile
+   )
+then
+   # Ok.
+   :
+else
+   { echo "configure: error: newly created file is older than distributed files!
+Check your system clock" 1>&2; exit 1; }
+fi
+rm -f conftest*
+echo "$ac_t""yes" 1>&6
+echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6
+echo "configure:833: checking whether ${MAKE-make} sets \${MAKE}" >&5
+set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftestmake <<\EOF
+all:
+	@echo 'ac_maketemp="${MAKE}"'
+EOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=`
+if test -n "$ac_maketemp"; then
+  eval ac_cv_prog_make_${ac_make}_set=yes
+else
+  eval ac_cv_prog_make_${ac_make}_set=no
+fi
+rm -f conftestmake
+fi
+if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  SET_MAKE=
+else
+  echo "$ac_t""no" 1>&6
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+PACKAGE=activemirrorcontrol
+
+VERSION=0.1
+
+if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then
+  { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; }
+fi
+cat >> confdefs.h <<EOF
+#define PACKAGE "$PACKAGE"
+EOF
+
+cat >> confdefs.h <<EOF
+#define VERSION "$VERSION"
+EOF
+
+
+
+missing_dir=`cd $ac_aux_dir && pwd`
+echo $ac_n "checking for working aclocal""... $ac_c" 1>&6
+echo "configure:879: checking for working aclocal" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (aclocal --version) < /dev/null > /dev/null 2>&1; then
+   ACLOCAL=aclocal
+   echo "$ac_t""found" 1>&6
+else
+   ACLOCAL="$missing_dir/missing aclocal"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoconf""... $ac_c" 1>&6
+echo "configure:892: checking for working autoconf" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoconf --version) < /dev/null > /dev/null 2>&1; then
+   AUTOCONF=autoconf
+   echo "$ac_t""found" 1>&6
+else
+   AUTOCONF="$missing_dir/missing autoconf"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working automake""... $ac_c" 1>&6
+echo "configure:905: checking for working automake" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (automake --version) < /dev/null > /dev/null 2>&1; then
+   AUTOMAKE=automake
+   echo "$ac_t""found" 1>&6
+else
+   AUTOMAKE="$missing_dir/missing automake"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working autoheader""... $ac_c" 1>&6
+echo "configure:918: checking for working autoheader" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (autoheader --version) < /dev/null > /dev/null 2>&1; then
+   AUTOHEADER=autoheader
+   echo "$ac_t""found" 1>&6
+else
+   AUTOHEADER="$missing_dir/missing autoheader"
+   echo "$ac_t""missing" 1>&6
+fi
+
+echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6
+echo "configure:931: checking for working makeinfo" >&5
+# Run test in a subshell; some versions of sh will print an error if
+# an executable is not found, even if stderr is redirected.
+# Redirect stdin to placate older versions of autoconf.  Sigh.
+if (makeinfo --version) < /dev/null > /dev/null 2>&1; then
+   MAKEINFO=makeinfo
+   echo "$ac_t""found" 1>&6
+else
+   MAKEINFO="$missing_dir/missing makeinfo"
+   echo "$ac_t""missing" 1>&6
+fi
+
+ 
+
+  unset CDPATH
+    
+
+  if test "x$prefix" = "xNONE"; then
+    prefix=$ac_default_prefix
+    ac_configure_args="$ac_configure_args --prefix $prefix"
+  fi
+  
+    # Check whether --enable-fast-perl or --disable-fast-perl was given.
+if test "${enable_fast_perl+set}" = set; then
+  enableval="$enable_fast_perl"
+  with_fast_perl=$enableval
+else
+  with_fast_perl=yes
+fi
+
+
+  
+  val=
+  if test -f $srcdir/configure.files ; then
+    val=`sed -e 's%^%\$(top_srcdir)/%' $srcdir/configure.files`
+  fi
+  CONF_FILES=
+  if test -n "$val" ; then
+    for i in $val ; do
+      CONF_FILES="$CONF_FILES $i"
+    done
+  fi
+  
+
+
+
+
+
+ 
+
+    
+  
+  
+  
+
+  # Check whether --enable-debug or --disable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval="$enable_debug"
+  
+   if test $enableval = "no";      then
+       kde_use_debug_code="no"
+       kde_use_debug_define=yes
+     else
+       kde_use_debug_code="yes"
+       kde_use_debug_define=no
+   fi
+  
+else
+  kde_use_debug_code="no"
+      kde_use_debug_define=no
+    
+fi
+
+    # Check whether --enable-dummyoption or --disable-dummyoption was given.
+if test "${enable_dummyoption+set}" = set; then
+  enableval="$enable_dummyoption"
+  :
+fi
+
+
+  # Check whether --enable-strict or --disable-strict was given.
+if test "${enable_strict+set}" = set; then
+  enableval="$enable_strict"
+  
+    if test $enableval = "no"; then
+         kde_use_strict_options="no"
+       else
+         kde_use_strict_options="yes"
+    fi
+   
+else
+  kde_use_strict_options="no"
+fi
+
+
+  # Check whether --enable-profile or --disable-profile was given.
+if test "${enable_profile+set}" = set; then
+  enableval="$enable_profile"
+  kde_use_profiling=$enableval
+else
+  kde_use_profiling="no"
+  
+fi
+
+
+  echo $ac_n "checking for a C-Compiler""... $ac_c" 1>&6
+echo "configure:1037: checking for a C-Compiler" >&5
+    echo "$ac_t""$CC" 1>&6
+
+  if test -z "$CC"; then # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1043: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="gcc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+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
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1072: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_prog_rejected=no
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then
+        ac_prog_rejected=yes
+	continue
+      fi
+      ac_cv_prog_CC="cc"
+      break
+    fi
+  done
+  IFS="$ac_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 $# -gt 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
+    set dummy "$ac_dir/$ac_word" "$@"
+    shift
+    ac_cv_prog_CC="$@"
+  fi
+fi
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ fi
+  if test -z "$CC"; then # Extract the first word of "xlc", so it can be a program name with args.
+set dummy xlc; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1120: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CC="xlc"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CC="$ac_cv_prog_CC"
+if test -n "$CC"; then
+  echo "$ac_t""$CC" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ fi
+  test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; }
+
+  echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1149: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext << EOF
+
+#line 1160 "configure"
+#include "confdefs.h"
+
+main(){return(0);}
+EOF
+if { (eval echo configure:1165: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cc_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cc_cross=no
+  else
+    ac_cv_prog_cc_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cc_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cc_works" 1>&6
+if test $ac_cv_prog_cc_works = no; then
+  { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1191: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6
+cross_compiling=$ac_cv_prog_cc_cross
+
+  echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6
+echo "configure:1196: checking whether we are using GNU C" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.c <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1205: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gcc=yes
+else
+  ac_cv_prog_gcc=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gcc" 1>&6
+
+  if test $ac_cv_prog_gcc = yes; then
+    GCC=yes
+  else
+    GCC=
+  fi
+
+  USER_CFLAGS=$CFLAGS
+  CFLAGS=
+
+  if test -z "$CFLAGS"; then
+    if test "$kde_use_debug_code" = "yes"; then
+      echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6
+echo "configure:1226: checking whether ${CC-cc} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+  ac_cv_prog_cc_g=yes
+else
+  ac_cv_prog_cc_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cc_g" 1>&6
+      if test $ac_cv_prog_cc_g = yes; then
+	CFLAGS="-g"
+	case $host in
+   	*-*-linux-gnu)	
+           CFLAGS="$CFLAGS -ansi -W -Wall -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -D_XOPEN_SOURCE -D_BSD_SOURCE"
+         ;;
+        esac
+      fi
+    else
+      if test "$GCC" = "yes"; then
+        CFLAGS="-O2"
+      else
+        CFLAGS=""
+      fi
+      if test "$kde_use_debug_define" = "yes"; then
+        CFLAGS="$CFLAGS -DNDEBUG"
+		    			      fi
+    fi
+
+    if test "$kde_use_profiling" = yes; then
+       echo $ac_n "checking whether ${CC-cc} accepts -pg""... $ac_c" 1>&6
+echo "configure:1262: checking whether ${CC-cc} accepts -pg" >&5
+if eval "test \"`echo '$''{'kde_cv_prog_cc_pg'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.c
+   if test -z "`${CC-cc} -pg -c conftest.c 2>&1`"; then
+     kde_cv_prog_cc_pg=yes
+   else
+     kde_cv_prog_cc_pg=no
+   fi
+   rm -f conftest*
+
+fi
+
+echo "$ac_t""$kde_cv_prog_cc_pg" 1>&6
+      if test "$kde_cv_prog_cc_pg" = yes; then
+        CFLAGS="$CFLAGS -pg"
+      fi
+    fi
+
+    if test "$GCC" = "yes"; then
+     CFLAGS="$CFLAGS"
+
+     if test "$kde_use_strict_options" = "yes"; then
+	CFLAGS="$CFLAGS -W -Wall -ansi -pedantic -Wshadow -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
+     fi
+    fi
+
+  fi
+
+  case "$host" in
+  *-*-sysv4.2uw*) CFLAGS="$CFLAGS -D_UNIXWARE";;
+  *-*-sysv5uw7*) CFLAGS="$CFLAGS -D_UNIXWARE7";;
+  esac
+
+  if test -n "$USER_CFLAGS"; then
+    CFLAGS="$CFLAGS $USER_CFLAGS"
+  fi
+
+  if test -z "$LDFLAGS" && test "$kde_use_debug_code" = "no" && test "$GCC" = "yes"; then
+     LDFLAGS=""
+  fi
+
+
+
+  echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6
+echo "configure:1308: checking how to run the C preprocessor" >&5
+  # On Suns, sometimes $CPP names a directory.
+  if test -n "$CPP" && test -d "$CPP"; then
+    CPP=
+  fi
+  if test -z "$CPP"; then
+  if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+    # This must be in double quotes, not single quotes, because CPP may get
+    # substituted into the Makefile and "${CC-cc}" will confuse make.
+    CPP="${CC-cc} -E"
+    # On the NeXT, cc -E runs the code through the compiler's parser,
+    # not just through cpp.
+            cat > conftest.$ac_ext <<EOF
+#line 1323 "configure"
+#include "confdefs.h"
+#include <assert.h>
+    Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1329: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP="${CC-cc} -E -traditional-cpp"
+    cat > conftest.$ac_ext <<EOF
+#line 1340 "configure"
+#include "confdefs.h"
+#include <assert.h>
+    Syntax Error
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1346: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+    ac_cv_prog_CPP="$CPP"
+fi
+    CPP="$ac_cv_prog_CPP"
+  else
+    ac_cv_prog_CPP="$CPP"
+  fi
+  echo "$ac_t""$CPP" 1>&6
+  
+
+  echo $ac_n "checking for a C++-Compiler""... $ac_c" 1>&6
+echo "configure:1370: checking for a C++-Compiler" >&5
+    echo "$ac_t""$CXX" 1>&6
+
+  if test -z "$CXX"; then # Extract the first word of "g++", so it can be a program name with args.
+set dummy g++; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1376: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CXX="g++"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+  echo "$ac_t""$CXX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ fi
+  if test -z "$CXX"; then # Extract the first word of "CC", so it can be a program name with args.
+set dummy CC; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1405: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CXX="CC"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+  echo "$ac_t""$CXX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ fi
+  if test -z "$CXX"; then # Extract the first word of "xlC", so it can be a program name with args.
+set dummy xlC; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1434: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CXX="xlC"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+  echo "$ac_t""$CXX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ fi
+  if test -z "$CXX"; then # Extract the first word of "DCC", so it can be a program name with args.
+set dummy DCC; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1463: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_CXX="DCC"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+CXX="$ac_cv_prog_CXX"
+if test -n "$CXX"; then
+  echo "$ac_t""$CXX" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+ fi
+  test -z "$CXX" && { echo "configure: error: no acceptable C++-compiler found in \$PATH" 1>&2; exit 1; }
+
+  echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6
+echo "configure:1492: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5
+
+
+ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+
+cat > conftest.$ac_ext << EOF
+
+#line 1508 "configure"
+#include "confdefs.h"
+
+int main(){return(0);}
+EOF
+if { (eval echo configure:1513: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  ac_cv_prog_cxx_works=yes
+  # If we can't run a trivial program, we are probably using a cross compiler.
+  if (./conftest; exit) 2>/dev/null; then
+    ac_cv_prog_cxx_cross=no
+  else
+    ac_cv_prog_cxx_cross=yes
+  fi
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_cv_prog_cxx_works=no
+fi
+rm -fr conftest*
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6
+if test $ac_cv_prog_cxx_works = no; then
+  { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; }
+fi
+echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6
+echo "configure:1539: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5
+echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6
+cross_compiling=$ac_cv_prog_cxx_cross
+
+  echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6
+echo "configure:1544: checking whether we are using GNU C++" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.C <<EOF
+#ifdef __GNUC__
+  yes;
+#endif
+EOF
+if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1553: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then
+  ac_cv_prog_gxx=yes
+else
+  ac_cv_prog_gxx=no
+fi
+fi
+
+echo "$ac_t""$ac_cv_prog_gxx" 1>&6
+
+  if test $ac_cv_prog_gxx = yes; then
+    GXX=yes
+  fi
+
+  USER_CXXFLAGS=$CXXFLAGS
+  CXXFLAGS=""
+
+  if test -z "$CXXFLAGS"; then
+    if test "$kde_use_debug_code" = "yes"; then
+      echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6
+echo "configure:1572: checking whether ${CXX-g++} accepts -g" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.cc
+if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
+  ac_cv_prog_cxx_g=yes
+else
+  ac_cv_prog_cxx_g=no
+fi
+rm -f conftest*
+
+fi
+
+echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6
+      if test $ac_cv_prog_cxx_g = yes; then
+        CXXFLAGS="-g"
+	case $host in     	*-*-linux-gnu)
+           CXXFLAGS="$CXXFLAGS -ansi -D_XOPEN_SOURCE -D_BSD_SOURCE -Wbad-function-cast -Wcast-align -Wundef -Wconversion"
+         ;;
+        esac
+      fi
+    else
+      if test "$GXX" = "yes"; then
+         CXXFLAGS="-O2"
+      fi
+      if test "$kde_use_debug_define" = "yes"; then
+         CXXFLAGS="$CXXFLAGS -DNDEBUG"
+      fi
+    fi
+
+    if test "$kde_use_profiling" = yes; then
+       echo $ac_n "checking whether ${CXX-g++} accepts -pg""... $ac_c" 1>&6
+echo "configure:1605: checking whether ${CXX-g++} accepts -pg" >&5
+if eval "test \"`echo '$''{'kde_cv_prog_cxx_pg'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  echo 'void f(){}' > conftest.cc
+   if test -z "`${CXX-g++} -pg -c conftest.cc 2>&1`"; then
+     kde_cv_prog_cxx_pg=yes
+   else
+     kde_cv_prog_cxx_pg=no
+   fi
+  rm -f conftest*
+
+fi
+
+echo "$ac_t""$kde_cv_prog_cxx_pg" 1>&6
+      if test "$kde_cv_prog_cxx_pg" = yes; then
+        CXXFLAGS="$CXXFLAGS -pg"
+      fi
+    fi
+    
+    
+
+echo $ac_n "checking whether $CXX supports -fno-exceptions""... $ac_c" 1>&6
+echo "configure:1628: checking whether $CXX supports -fno-exceptions" >&5
+kde_cache=`echo fno-exceptions | sed 'y%.=/+-%___p_%'`
+if eval "test \"`echo '$''{'kde_cv_prog_cxx_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -fno-exceptions -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -fno-exceptions -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+ 
+      CXXFLAGS="$CXXFLAGS -fno-exceptions"
+    
+else
+ echo "$ac_t""no" 1>&6
+ :
+ 
+fi
+
+      
+
+    
+
+echo $ac_n "checking whether $CXX supports -fno-check-new""... $ac_c" 1>&6
+echo "configure:1662: checking whether $CXX supports -fno-check-new" >&5
+kde_cache=`echo fno-check-new | sed 'y%.=/+-%___p_%'`
+if eval "test \"`echo '$''{'kde_cv_prog_cxx_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -fno-check-new -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -fno-check-new -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+ 
+	  CXXFLAGS="$CXXFLAGS -fno-check-new"
+	
+else
+ echo "$ac_t""no" 1>&6
+ :
+ 
+fi
+
+
+    if test "$GXX" = "yes"; then
+       CXXFLAGS="$CXXFLAGS"
+
+       if test true || test "$kde_use_debug_code" = "yes"; then
+	 CXXFLAGS="$CXXFLAGS -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings"
+
+         
+
+echo $ac_n "checking whether $CXX supports -Wno-long-long""... $ac_c" 1>&6
+echo "configure:1701: checking whether $CXX supports -Wno-long-long" >&5
+kde_cache=`echo Wno-long-long | sed 'y%.=/+-%___p_%'`
+if eval "test \"`echo '$''{'kde_cv_prog_cxx_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -Wno-long-long -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -Wno-long-long -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+ 
+	   CXXFLAGS="$CXXFLAGS -Wno-long-long"
+	 
+else
+ echo "$ac_t""no" 1>&6
+ :
+ 
+fi
+
+         
+
+echo $ac_n "checking whether $CXX supports -Wnon-virtual-dtor""... $ac_c" 1>&6
+echo "configure:1733: checking whether $CXX supports -Wnon-virtual-dtor" >&5
+kde_cache=`echo Wnon-virtual-dtor | sed 'y%.=/+-%___p_%'`
+if eval "test \"`echo '$''{'kde_cv_prog_cxx_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -Wnon-virtual-dtor -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -Wnon-virtual-dtor -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+ 
+           CXXFLAGS="$CXXFLAGS -Wnon-virtual-dtor"
+         
+else
+ echo "$ac_t""no" 1>&6
+ :
+ 
+fi
+
+         
+
+echo $ac_n "checking whether $CXX supports -fno-builtin""... $ac_c" 1>&6
+echo "configure:1765: checking whether $CXX supports -fno-builtin" >&5
+kde_cache=`echo fno-builtin | sed 'y%.=/+-%___p_%'`
+if eval "test \"`echo '$''{'kde_cv_prog_cxx_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -fno-builtin -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -fno-builtin -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+ 
+           CXXFLAGS="$CXXFLAGS -fno-builtin"
+         
+else
+ echo "$ac_t""no" 1>&6
+ :
+ 
+fi
+
+	
+       fi
+
+       if test "$kde_use_strict_options" = "yes"; then
+	CXXFLAGS="$CXXFLAGS -Wcast-qual -Wbad-function-cast -Wshadow -Wcast-align"
+       fi
+
+       if test "$kde_very_strict" = "yes"; then
+         CXXFLAGS="$CXXFLAGS -Wold-style-cast -Wredundant-decls -Wconversion"
+       fi
+    fi
+  fi
+
+    
+
+echo $ac_n "checking whether $CXX supports -fexceptions""... $ac_c" 1>&6
+echo "configure:1810: checking whether $CXX supports -fexceptions" >&5
+kde_cache=`echo fexceptions | sed 'y%.=/+-%___p_%'`
+if eval "test \"`echo '$''{'kde_cv_prog_cxx_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -fexceptions -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -fexceptions -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+ 
+	  USE_EXCEPTIONS="-fexceptions"
+	
+else
+ echo "$ac_t""no" 1>&6
+ :
+ USE_EXCEPTIONS=
+	
+fi
+
+    
+
+    
+
+echo $ac_n "checking whether $CXX supports -frtti""... $ac_c" 1>&6
+echo "configure:1845: checking whether $CXX supports -frtti" >&5
+kde_cache=`echo frtti | sed 'y%.=/+-%___p_%'`
+if eval "test \"`echo '$''{'kde_cv_prog_cxx_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -frtti -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -frtti -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+ 
+	  USE_RTTI="-frtti"
+	
+else
+ echo "$ac_t""no" 1>&6
+ :
+ USE_RTTI=
+	
+fi
+
+    
+
+    case "$host" in
+      *-*-irix*)  test "$GXX" = yes && CXXFLAGS="$CXXFLAGS -D_LANGUAGE_C_PLUS_PLUS -D__LANGUAGE_C_PLUS_PLUS" ;;
+      *-*-sysv4.2uw*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE";;
+      *-*-sysv5uw7*) CXXFLAGS="$CXXFLAGS -D_UNIXWARE7";;
+      *-*-solaris*) 
+        if test "$GXX" = yes; then
+          libstdcpp=`gcc -print-file-name=libstdc++.so`
+          if test ! -f $libstdcpp; then
+             { echo "configure: error: You've compiled gcc without --enable-shared. This doesn't work with KDE. Please recompile gcc with --enable-shared to receive a libstdc++.so" 1>&2; exit 1; }
+          fi
+        fi
+        ;;
+    esac
+
+    if test -n "$USER_CXXFLAGS"; then
+       CXXFLAGS="$CXXFLAGS $USER_CXXFLAGS"
+    fi
+
+      __val=$CXX
+  __forbid=" -fno-rtti -rpath "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS=" 	"
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) echo "configure: warning: found forbidden $i in CXX, removing it" 1>&2 ;;
+	*) # Careful to not add spaces, where there were none, because otherwise
+	   # libtool gets confused, if we change e.g. CXX
+	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    CXX=$__new
+  fi
+
+  __val=$CXXFLAGS
+  __forbid=" -fno-rtti -rpath "
+  if test -n "$__val"; then
+    __new=""
+    ac_save_IFS=$IFS
+    IFS=" 	"
+    for i in $__val; do
+      case "$__forbid" in
+        *" $i "*) echo "configure: warning: found forbidden $i in CXXFLAGS, removing it" 1>&2 ;;
+	*) # Careful to not add spaces, where there were none, because otherwise
+	   # libtool gets confused, if we change e.g. CXX
+	   if test -z "$__new" ; then __new=$i ; else __new="$__new $i" ; fi ;;
+      esac
+    done
+    IFS=$ac_save_IFS
+    CXXFLAGS=$__new
+  fi
+
+
+
+    echo $ac_n "checking how to run the C++ preprocessor""... $ac_c" 1>&6
+echo "configure:1934: checking how to run the C++ preprocessor" >&5
+    if test -z "$CXXCPP"; then
+      if eval "test \"`echo '$''{'ac_cv_prog_CXXCPP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+                   ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+         CXXCPP="${CXX-g++} -E"
+         cat > conftest.$ac_ext <<EOF
+#line 1951 "configure"
+#include "confdefs.h"
+#include <stdlib.h>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:1956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  :
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  CXXCPP=/lib/cpp
+fi
+rm -f conftest*
+         ac_cv_prog_CXXCPP="$CXXCPP"
+         ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+     
+fi
+     CXXCPP="$ac_cv_prog_CXXCPP"
+    fi
+    echo "$ac_t""$CXXCPP" 1>&6
+    
+    # the following is to allow programs, that are known to
+    # have problems when compiled with -O2
+    if test -n "$CXXFLAGS"; then
+      kde_safe_IFS=$IFS
+      IFS=" "
+      NOOPT_CXXFLAGS=""
+      for i in $CXXFLAGS; do
+        case $i in
+          -O*)
+                ;;
+          *)
+                NOOPT_CXXFLAGS="$NOOPT_CXXFLAGS $i"
+                ;;
+        esac
+      done
+      IFS=$kde_safe_IFS
+    fi
+    
+
+    
+  # Check whether --enable-final or --disable-final was given.
+if test "${enable_final+set}" = set; then
+  enableval="$enable_final"
+  kde_use_final=$enableval
+else
+  kde_use_final=no
+fi
+
+
+  
+  REPO=""
+  NOREPO=""
+
+  
+
+echo $ac_n "checking whether $CXX supports -frepo""... $ac_c" 1>&6
+echo "configure:2017: checking whether $CXX supports -frepo" >&5
+kde_cache=`echo frepo | sed 'y%.=/+-%___p_%'`
+if eval "test \"`echo '$''{'kde_cv_prog_cxx_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -frepo -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -frepo -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+ 
+     REPO="-frepo"
+     NOREPO="-fno-repo"
+   
+else
+ echo "$ac_t""no" 1>&6
+ :
+ 
+fi
+
+
+  if test -z "$REPO"; then
+  
+
+echo $ac_n "checking whether $CXX supports -instances=explicit""... $ac_c" 1>&6
+echo "configure:2052: checking whether $CXX supports -instances=explicit" >&5
+kde_cache=`echo instances=explicit | sed 'y%.=/+-%___p_%'`
+if eval "test \"`echo '$''{'kde_cv_prog_cxx_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+echo 'int main() { return 0; }' >conftest.cc
+eval "kde_cv_prog_cxx_$kde_cache=no"
+if test -z "`$CXX -instances=explicit -c conftest.cc 2>&1`"; then
+  if test -z "`$CXX -instances=explicit -o conftest conftest.o 2>&1`"; then
+    eval "kde_cv_prog_cxx_$kde_cache=yes"
+  fi
+fi
+rm -f conftest*
+
+fi
+
+if eval "test \"`echo '$kde_cv_prog_cxx_'$kde_cache`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ :
+ 
+     REPO="-instances=explicit"
+     NOREPO="-instances=extern"
+  
+else
+ echo "$ac_t""no" 1>&6
+ :
+ 
+fi
+
+  fi
+
+  if test -n "$REPO"; then
+     cat >> confdefs.h <<EOF
+#define HAVE_TEMPLATE_REPOSITORY 1
+EOF
+
+     
+  fi
+
+  
+  
+
+  if test "x$kde_use_final" = "xyes"; then
+      KDE_USE_FINAL_TRUE=""
+      KDE_USE_FINAL_FALSE="#"
+   else
+      KDE_USE_FINAL_TRUE="#"
+      KDE_USE_FINAL_FALSE=""
+  fi
+  
+  
+
+  # Check whether --enable-closure or --disable-closure was given.
+if test "${enable_closure+set}" = set; then
+  enableval="$enable_closure"
+  kde_use_closure=$enableval
+else
+  kde_use_closure=yes
+fi
+
+
+  if test "x$kde_use_closure" = "xyes"; then
+       KDE_USE_CLOSURE_TRUE=""
+       KDE_USE_CLOSURE_FALSE="#"
+#       CXXFLAGS="$CXXFLAGS $REPO"
+  else
+       KDE_USE_CLOSURE_TRUE="#"
+       KDE_USE_CLOSURE_FALSE=""
+  fi
+  
+  
+
+
+    
+
+    KDE_CXXFLAGS=
+    
+
+# Check whether --enable-shared or --disable-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.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_shared=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_shared=yes
+fi
+
+# Check whether --enable-static or --disable-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.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_static=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_static=no
+fi
+
+# Check whether --enable-fast-install or --disable-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.
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
+  for pkg in $enableval; do
+    if test "X$pkg" = "X$p"; then
+      enable_fast_install=yes
+    fi
+  done
+  IFS="$ac_save_ifs"
+  ;;
+esac
+else
+  enable_fast_install=yes
+fi
+
+# Check whether --with-gnu-ld or --without-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.
+  echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6
+echo "configure:2212: checking for ld used by GCC" >&5
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case "$ac_prog" in
+    # Accept absolute paths.
+    [\\/]* | [A-Za-z]:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the path of ld
+      ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
+      while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  echo $ac_n "checking for GNU ld""... $ac_c" 1>&6
+echo "configure:2242: checking for GNU ld" >&5
+else
+  echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6
+echo "configure:2245: checking for non-GNU ld" >&5
+fi
+if eval "test \"`echo '$''{'lt_cv_path_LD'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -z "$LD"; then
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      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 GNU ld's only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      if "$lt_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
+	test "$with_gnu_ld" != no && break
+      else
+	test "$with_gnu_ld" != yes && break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  echo "$ac_t""$LD" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; }
+echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6
+echo "configure:2280: checking if the linker ($LD) is GNU ld" >&5
+if eval "test \"`echo '$''{'lt_cv_prog_gnu_ld'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # I'd rather use --version here, but apparently some GNU ld's only accept -v.
+if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
+  lt_cv_prog_gnu_ld=yes
+else
+  lt_cv_prog_gnu_ld=no
+fi
+fi
+
+echo "$ac_t""$lt_cv_prog_gnu_ld" 1>&6
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+echo $ac_n "checking for $LD option to reload object files""... $ac_c" 1>&6
+echo "configure:2297: checking for $LD option to reload object files" >&5
+if eval "test \"`echo '$''{'lt_cv_ld_reload_flag'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+
+echo "$ac_t""$lt_cv_ld_reload_flag" 1>&6
+reload_flag=$lt_cv_ld_reload_flag
+test -n "$reload_flag" && reload_flag=" $reload_flag"
+
+echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6
+echo "configure:2309: checking for BSD-compatible nm" >&5
+if eval "test \"`echo '$''{'lt_cv_path_NM'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
+  for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
+    test -z "$ac_dir" && ac_dir=.
+    tmp_nm=$ac_dir/${ac_tool_prefix}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
+      if ($tmp_nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep '(/dev/null|Invalid file or object type)' >/dev/null; then
+	lt_cv_path_NM="$tmp_nm -B"
+	break
+      elif ($tmp_nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
+	lt_cv_path_NM="$tmp_nm -p"
+	break
+      else
+	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
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$lt_cv_path_NM" && lt_cv_path_NM=nm
+fi
+fi
+
+NM="$lt_cv_path_NM"
+echo "$ac_t""$NM" 1>&6
+
+echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6
+echo "configure:2347: checking whether ln -s works" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftestdata
+if ln -s X conftestdata 2>/dev/null
+then
+  rm -f conftestdata
+  ac_cv_prog_LN_S="ln -s"
+else
+  ac_cv_prog_LN_S=ln
+fi
+fi
+LN_S="$ac_cv_prog_LN_S"
+if test "$ac_cv_prog_LN_S" = "ln -s"; then
+  echo "$ac_t""yes" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+echo $ac_n "checking how to recognise dependant libraries""... $ac_c" 1>&6
+echo "configure:2368: checking how to recognise dependant libraries" >&5
+if eval "test \"`echo '$''{'lt_cv_deplibs_check_method'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&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 egrep 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
+aix4*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi4*)
+    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* | mingw* |pw32*)
+  lt_cv_deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method='file_magic Mach-O dynamically linked shared library'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=`echo /System/Library/Frameworks/System.framework/Versions/*/System | head -1`
+  ;;
+
+freebsd* )
+  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)/i[3-9]86 (compact )?demand paged shared library'
+            lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20*|hpux11*)
+  # TODO:  Does this work for hpux-11 too?
+    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_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libc.sl
+  ;;
+
+irix5* | irix6*)
+  case "$host_os" in
+  irix5*)
+    # this will be overridden with pass_all, but let us keep it just in case
+    lt_cv_deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1"
+    ;;
+  *)
+    case "$LD" in
+    *-32|*"-32 ") libmagic=32-bit;;
+    *-n32|*"-n32 ") libmagic=N32;;
+    *-64|*"-64 ") libmagic=64-bit;;
+    *) libmagic=never-match;;
+    esac
+    # this will be overridden with pass_all, but let us keep it just in case
+        lt_cv_deplibs_check_method="file_magic ELF ${libmagic} MSB mips-[1234] dynamic lib MIPS - version 1"
+        ;;
+  esac
+  lt_cv_file_magic_test_file=`echo /lib${libsuff}/libc.so*`
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux-gnu*)
+  case "$host_cpu" in
+  alpha* | i*86 | powerpc* | sparc* | ia64* | s390* )
+    lt_cv_deplibs_check_method=pass_all ;;
+  *)
+    # glibc up to 2.1.1 does not perform some relocations on ARM
+        lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' ;;
+      esac
+  lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='file_magic NetBSD/[a-z0-9]* demand paged shared library'
+  else
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object'
+  fi
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+  ;;
+
+openbsd* )
+  if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
+    case "$host_cpu" in
+    i*86 )
+            lt_cv_deplibs_check_method='file_magic OpenBSD/i[3-9]86 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
+  ;;
+
+newsos6)
+  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
+  ;;
+
+osf3* | osf4* | osf5*)
+  # this will be overridden with pass_all, but let us keep it just in case
+  lt_cv_deplibs_check_method='file_magic COFF format alpha shared library'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sco3.2v5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=/lib/libc.so
+  ;;
+
+sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+  case "$host_vendor" in
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  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*`
+    ;;
+  esac
+  ;;
+esac
+
+fi
+
+echo "$ac_t""$lt_cv_deplibs_check_method" 1>&6
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+
+if test $host != $build; then
+  ac_tool_prefix=${host_alias}-
+else
+  ac_tool_prefix=
+fi
+
+# Autoconf 2.13's AC_OBJEXT and AC_EXEEXT macros only works for C compilers!
+
+# Only perform the check for file, if the check method requires it
+case "$deplibs_check_method" in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6
+echo "configure:2550: checking for ${ac_tool_prefix}file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$MAGIC_CMD" in
+  /*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC_CMD="$MAGIC_CMD"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="/usr/bin:$PATH"
+  for ac_dir in $ac_dummy; do
+    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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC_CMD="$ac_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$ac_t""$MAGIC_CMD" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    echo $ac_n "checking for file""... $ac_c" 1>&6
+echo "configure:2612: checking for file" >&5
+if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$MAGIC_CMD" in
+  /*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+  ?:/*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a dos path.
+  ;;
+  *)
+  ac_save_MAGIC_CMD="$MAGIC_CMD"
+  IFS="${IFS=   }"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="/usr/bin:$PATH"
+  for ac_dir in $ac_dummy; do
+    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 <<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
+
+EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  MAGIC_CMD="$ac_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  echo "$ac_t""$MAGIC_CMD" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# 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
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2683: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_RANLIB"; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2715: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_RANLIB="ranlib"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":"
+fi
+fi
+RANLIB="$ac_cv_prog_RANLIB"
+if test -n "$RANLIB"; then
+  echo "$ac_t""$RANLIB" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+  RANLIB=":"
+fi
+fi
+
+# 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
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2750: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+  echo "$ac_t""$STRIP" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+if test -z "$ac_cv_prog_STRIP"; then
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:2782: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_prog_STRIP="strip"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_prog_STRIP" && ac_cv_prog_STRIP=":"
+fi
+fi
+STRIP="$ac_cv_prog_STRIP"
+if test -n "$STRIP"; then
+  echo "$ac_t""$STRIP" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+else
+  STRIP=":"
+fi
+fi
+
+
+# Check for any special flags to pass to ltconfig.
+libtool_flags="--cache-file=$cache_file"
+test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
+test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
+test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
+test "$GCC" = yes && libtool_flags="$libtool_flags --with-gcc"
+test "$lt_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
+libtool_flags="$libtool_flags --enable-dlopen"
+
+# Check whether --enable-libtool-lock or --disable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then
+  enableval="$enable_libtool_lock"
+  :
+fi
+
+test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
+test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
+
+# Check whether --with-pic or --without-pic was given.
+if test "${with_pic+set}" = set; then
+  withval="$with_pic"
+  pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+test x"$pic_mode" = xyes && libtool_flags="$libtool_flags --prefer-pic"
+test x"$pic_mode" = xno && libtool_flags="$libtool_flags --prefer-non-pic"
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case "$host" in
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line 2849 "configure"' > conftest.$ac_ext
+  if { (eval echo configure:2850: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+    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
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6
+echo "configure:2871: checking whether the C compiler needs -belf" >&5
+if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+     ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+     cat > conftest.$ac_ext <<EOF
+#line 2884 "configure"
+#include "confdefs.h"
+
+int main() {
+
+; return 0; }
+EOF
+if { (eval echo configure:2891: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  lt_cv_cc_needs_belf=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  lt_cv_cc_needs_belf=no
+fi
+rm -f conftest*
+     ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+fi
+
+echo "$ac_t""$lt_cv_cc_needs_belf" 1>&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
+  ;;
+
+
+esac
+
+
+echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6
+echo "configure:2922: checking for Cygwin environment" >&5
+if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2927 "configure"
+#include "confdefs.h"
+
+int main() {
+
+#ifndef __CYGWIN__
+#define __CYGWIN__ __CYGWIN32__
+#endif
+return __CYGWIN__;
+; return 0; }
+EOF
+if { (eval echo configure:2938: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_cygwin=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_cygwin=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_cygwin" 1>&6
+CYGWIN=
+test "$ac_cv_cygwin" = yes && CYGWIN=yes
+echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6
+echo "configure:2955: checking for mingw32 environment" >&5
+if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 2960 "configure"
+#include "confdefs.h"
+
+int main() {
+return __MINGW32__;
+; return 0; }
+EOF
+if { (eval echo configure:2967: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_mingw32=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_mingw32=no
+fi
+rm -f conftest*
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_mingw32" 1>&6
+MINGW32=
+test "$ac_cv_mingw32" = yes && MINGW32=yes
+
+# Save cache, so that ltconfig can load it
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+
+# Actually configure libtool.  ac_aux_dir is where install-sh is found.
+AR="$AR" LTCC="$CC" CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
+$libtool_flags --no-verify --build="$build" $ac_aux_dir/ltmain.sh $host \
+|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; }
+
+# Reload cache, that may have been modified by ltconfig
+if test -r "$cache_file"; then
+  echo "loading cache $cache_file"
+  . $cache_file
+else
+  echo "creating cache $cache_file"
+  > $cache_file
+fi
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh $ac_aux_dir/ltcf-c.sh"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+
+LIBTOOL_DEPS=$LIBTOOL_DEPS" $ac_aux_dir/ltcf-cxx.sh"
+lt_save_CC="$CC"
+lt_save_CFLAGS="$CFLAGS"
+AR="$AR" LTCC="$CC" CC="$CXX" CXX="$CXX" CFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" \
+MAGIC_CMD="$MAGIC_CMD" LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
+LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" STRIP="$STRIP" \
+AS="$AS" DLLTOOL="$DLLTOOL" OBJDUMP="$OBJDUMP" \
+objext="$OBJEXT" exeext="$EXEEXT" reload_flag="$reload_flag" \
+deplibs_check_method="$deplibs_check_method" \
+file_magic_cmd="$file_magic_cmd" \
+${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig -o libtool $libtool_flags \
+--build="$build" --add-tag=CXX $ac_aux_dir/ltcf-cxx.sh $host \
+|| { echo "configure: error: libtool tag configuration failed" 1>&2; exit 1; }
+CC="$lt_save_CC"
+CFLAGS="$lt_save_CFLAGS"
+
+# Redirect the config.log output again, so that the ltconfig log is not
+# clobbered by the next message.
+exec 5>>./config.log
+
+
+
+
+
+
+
+
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+echo $ac_n "checking for object suffix""... $ac_c" 1>&6
+echo "configure:3102: checking for object suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  rm -f conftest*
+echo 'int i = 1;' > conftest.$ac_ext
+if { (eval echo configure:3108: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  for ac_file in conftest.*; do
+    case $ac_file in
+    *.c) ;;
+    *) ac_cv_objext=`echo $ac_file | sed -e s/conftest.//` ;;
+    esac
+  done
+else
+  { echo "configure: error: installation or configuration problem; compiler does not work" 1>&2; exit 1; }
+fi
+rm -f conftest*
+fi
+
+echo "$ac_t""$ac_cv_objext" 1>&6
+OBJEXT=$ac_cv_objext
+ac_objext=$ac_cv_objext
+
+
+
+echo $ac_n "checking for executable suffix""... $ac_c" 1>&6
+echo "configure:3128: checking for executable suffix" >&5
+if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+  ac_cv_exeext=.exe
+else
+  rm -f conftest*
+  echo 'int main () { return 0; }' > conftest.$ac_ext
+  ac_cv_exeext=
+  if { (eval echo configure:3138: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then
+    for file in conftest.*; do
+      case $file in
+      *.c | *.o | *.obj) ;;
+      *) ac_cv_exeext=`echo $file | sed -e s/conftest//` ;;
+      esac
+    done
+  else
+    { echo "configure: error: installation or configuration problem: compiler cannot create executables." 1>&2; exit 1; }
+  fi
+  rm -f conftest*
+  test x"${ac_cv_exeext}" = x && ac_cv_exeext=no
+fi
+fi
+
+EXEEXT=""
+test x"${ac_cv_exeext}" != xno && EXEEXT=${ac_cv_exeext}
+echo "$ac_t""${ac_cv_exeext}" 1>&6
+ac_exeext=$EXEEXT
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+  
+
+  
+	 
+	 
+
+
+LIBTOOL_SHELL="/bin/sh ./libtool"
+#  LIBTOOL="$LIBTOOL --silent"
+KDE_PLUGIN="-avoid-version -module -no-undefined"
+
+
+
+
+    
+    # Extract the first word of "msgfmt", so it can be a program name with args.
+set dummy msgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3184: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$MSGFMT" in
+  /*)
+  ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test -n "`$ac_dir/$ac_word --version 2>&1 | grep 'GNU gettext'`"; then
+	ac_cv_path_MSGFMT="$ac_dir/$ac_word"
+	break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT="msgfmt"
+  ;;
+esac
+fi
+MSGFMT="$ac_cv_path_MSGFMT"
+if test -n "$MSGFMT"; then
+  echo "$ac_t""$MSGFMT" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+    # Extract the first word of "gmsgfmt", so it can be a program name with args.
+set dummy gmsgfmt; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3218: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$GMSGFMT" in
+  /*)
+  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path.
+  ;;
+  ?:/*)			 
+  ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS=":"
+  ac_dummy="$PATH"
+  for ac_dir in $ac_dummy; do 
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      ac_cv_path_GMSGFMT="$ac_dir/$ac_word"
+      break
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT"
+  ;;
+esac
+fi
+GMSGFMT="$ac_cv_path_GMSGFMT"
+if test -n "$GMSGFMT"; then
+  echo "$ac_t""$GMSGFMT" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+     if test -z "`$GMSGFMT --version 2>&1 | grep 'GNU gettext'`"; then
+        echo "$ac_t""found msgfmt program is not GNU msgfmt; ignore it" 1>&6
+        GMSGFMT=":"
+      fi
+      MSGFMT=$GMSGFMT
+      
+      
+
+      # Extract the first word of "xgettext", so it can be a program name with args.
+set dummy xgettext; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:3263: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  case "$XGETTEXT" in
+  /*)
+  ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path.
+  ;;
+  *)
+  IFS="${IFS= 	}"; ac_save_ifs="$IFS"; IFS="${IFS}:"
+  for ac_dir in $PATH; do
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$ac_word; then
+      if test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"; then
+	ac_cv_path_XGETTEXT="$ac_dir/$ac_word"
+	break
+      fi
+    fi
+  done
+  IFS="$ac_save_ifs"
+  test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":"
+  ;;
+esac
+fi
+XGETTEXT="$ac_cv_path_XGETTEXT"
+if test -n "$XGETTEXT"; then
+  echo "$ac_t""$XGETTEXT" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+            if test "$XGETTEXT" != ":"; then
+			if $XGETTEXT --omit-header /dev/null 2> /dev/null; then
+	  : ;
+	else
+	  echo "$ac_t""found xgettext programs is not GNU xgettext; ignore it" 1>&6
+	  XGETTEXT=":"
+	fi
+      fi
+     
+
+  
+
+
+   ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+      echo $ac_n "checking for main in -lcompat""... $ac_c" 1>&6
+echo "configure:3316: checking for main in -lcompat" >&5
+ac_lib_var=`echo compat'_'main | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lcompat  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3324 "configure"
+#include "confdefs.h"
+
+int main() {
+main()
+; return 0; }
+EOF
+if { (eval echo configure:3331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBCOMPAT="-lcompat"
+else
+  echo "$ac_t""no" 1>&6
+fi
+    
+   kde_have_crypt=
+   echo $ac_n "checking for crypt in -lcrypt""... $ac_c" 1>&6
+echo "configure:3353: checking for crypt in -lcrypt" >&5
+ac_lib_var=`echo crypt'_'crypt | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lcrypt  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3361 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char crypt();
+
+int main() {
+crypt()
+; return 0; }
+EOF
+if { (eval echo configure:3372: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBCRYPT="-lcrypt"; kde_have_crypt=yes
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for crypt in -lc""... $ac_c" 1>&6
+echo "configure:3391: checking for crypt in -lc" >&5
+ac_lib_var=`echo c'_'crypt | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lc  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3399 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char crypt();
+
+int main() {
+crypt()
+; return 0; }
+EOF
+if { (eval echo configure:3410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  kde_have_crypt=yes
+else
+  echo "$ac_t""no" 1>&6
+
+        echo "configure: warning: you have no crypt in either libcrypt or libc.
+You should install libcrypt from another source or configure with PAM
+support" 1>&2
+	kde_have_crypt=no
+      
+fi
+
+fi
+
+   
+   if test $kde_have_crypt = yes; then
+      cat >> confdefs.h <<EOF
+#define HAVE_CRYPT 1
+EOF
+
+   fi
+   echo $ac_n "checking for the third argument of getsockname""... $ac_c" 1>&6
+echo "configure:3446: checking for the third argument of getsockname" >&5
+if eval "test \"`echo '$''{'ac_cv_ksize_t'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+cat > conftest.$ac_ext <<EOF
+#line 3462 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int main() {
+
+socklen_t a=0;
+getsockname(0,(struct sockaddr*)0, &a);
+
+; return 0; }
+EOF
+if { (eval echo configure:3475: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_ksize_t=socklen_t
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_ksize_t=
+fi
+rm -f conftest*
+if test -z "$ac_cv_ksize_t"; then
+ac_safe_cxxflags="$CXXFLAGS"
+if test "$GCC" = "yes"; then
+  CXXFLAGS="-Werror $CXXFLAGS"
+fi
+cat > conftest.$ac_ext <<EOF
+#line 3491 "configure"
+#include "confdefs.h"
+
+#include <sys/types.h>
+#include <sys/socket.h>
+
+int main() {
+
+int a=0;
+getsockname(0,(struct sockaddr*)0, &a);
+
+; return 0; }
+EOF
+if { (eval echo configure:3504: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+  rm -rf conftest*
+  ac_cv_ksize_t=int
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  ac_cv_ksize_t=size_t
+fi
+rm -f conftest*
+CXXFLAGS="$ac_safe_cxxflags"
+fi
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+
+if test -z "$ac_cv_ksize_t"; then
+  ac_cv_ksize_t=int
+fi
+
+echo "$ac_t""$ac_cv_ksize_t" 1>&6
+cat >> confdefs.h <<EOF
+#define ksize_t $ac_cv_ksize_t
+EOF
+
+
+
+   ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+   echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6
+echo "configure:3546: checking for dnet_ntoa in -ldnet" >&5
+ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldnet  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3554 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dnet_ntoa();
+
+int main() {
+dnet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:3565: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+   if test $ac_cv_lib_dnet_dnet_ntoa = no; then
+      echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6
+echo "configure:3587: checking for dnet_ntoa in -ldnet_stub" >&5
+ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldnet_stub  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3595 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dnet_ntoa();
+
+int main() {
+dnet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:3606: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+   fi
+   echo $ac_n "checking for inet_ntoa""... $ac_c" 1>&6
+echo "configure:3628: checking for inet_ntoa" >&5
+if eval "test \"`echo '$''{'ac_cv_func_inet_ntoa'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3633 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char inet_ntoa(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char inet_ntoa();
+
+int main() {
+
+/* 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_inet_ntoa) || defined (__stub___inet_ntoa)
+choke me
+#else
+inet_ntoa();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3656: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_inet_ntoa=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_inet_ntoa=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'inet_ntoa`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+   if test $ac_cv_func_inet_ntoa = no; then
+     echo $ac_n "checking for inet_ntoa in -lnsl""... $ac_c" 1>&6
+echo "configure:3677: checking for inet_ntoa in -lnsl" >&5
+ac_lib_var=`echo nsl'_'inet_ntoa | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lnsl  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3685 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char inet_ntoa();
+
+int main() {
+inet_ntoa()
+; return 0; }
+EOF
+if { (eval echo configure:3696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+   fi
+   echo $ac_n "checking for connect""... $ac_c" 1>&6
+echo "configure:3718: checking for connect" >&5
+if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3723 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char connect(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char connect();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_connect) || defined (__stub___connect)
+choke me
+#else
+connect();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3746: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_connect=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_connect=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+   if test $ac_cv_func_connect = no; then
+      echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6
+echo "configure:3767: checking for connect in -lsocket" >&5
+ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lsocket $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3775 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char connect();
+
+int main() {
+connect()
+; return 0; }
+EOF
+if { (eval echo configure:3786: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+   fi
+
+   echo $ac_n "checking for remove""... $ac_c" 1>&6
+echo "configure:3809: checking for remove" >&5
+if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3814 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char remove(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char remove();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_remove) || defined (__stub___remove)
+choke me
+#else
+remove();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3837: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_remove=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_remove=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+   if test $ac_cv_func_remove = no; then
+      echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6
+echo "configure:3858: checking for remove in -lposix" >&5
+ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lposix  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3866 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char remove();
+
+int main() {
+remove()
+; return 0; }
+EOF
+if { (eval echo configure:3877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+   fi
+
+   # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay.
+   echo $ac_n "checking for shmat""... $ac_c" 1>&6
+echo "configure:3901: checking for shmat" >&5
+if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3906 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char shmat(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char shmat();
+
+int main() {
+
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined (__stub_shmat) || defined (__stub___shmat)
+choke me
+#else
+shmat();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:3929: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_shmat=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_shmat=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6
+echo "configure:3947: checking for shmat in -lipc" >&5
+ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lipc  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 3955 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char shmat();
+
+int main() {
+shmat()
+; return 0; }
+EOF
+if { (eval echo configure:3966: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+   
+   # Solaris 2.6 needs -lresolv for res_init
+   echo $ac_n "checking for res_init""... $ac_c" 1>&6
+echo "configure:3991: checking for res_init" >&5
+if eval "test \"`echo '$''{'ac_cv_func_res_init'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  cat > conftest.$ac_ext <<EOF
+#line 3996 "configure"
+#include "confdefs.h"
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char res_init(); below.  */
+#include <assert.h>
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char res_init();
+
+int main() {
+
+/* 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_res_init) || defined (__stub___res_init)
+choke me
+#else
+res_init();
+#endif
+
+; return 0; }
+EOF
+if { (eval echo configure:4019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_func_res_init=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_func_res_init=no"
+fi
+rm -f conftest*
+fi
+
+if eval "test \"`echo '$ac_cv_func_'res_init`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  :
+else
+  echo "$ac_t""no" 1>&6
+echo $ac_n "checking for res_init in -lresolv""... $ac_c" 1>&6
+echo "configure:4037: checking for res_init in -lresolv" >&5
+ac_lib_var=`echo resolv'_'res_init | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lresolv  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4045 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char res_init();
+
+int main() {
+res_init()
+; return 0; }
+EOF
+if { (eval echo configure:4056: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  X_EXTRA_LIBS="$X_EXTRA_LIBS -lresolv"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+fi
+
+
+   LIBSOCKET="$X_EXTRA_LIBS"
+   
+   
+   echo $ac_n "checking for killpg in -lucb""... $ac_c" 1>&6
+echo "configure:4083: checking for killpg in -lucb" >&5
+ac_lib_var=`echo ucb'_'killpg | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lucb  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4091 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char killpg();
+
+int main() {
+killpg()
+; return 0; }
+EOF
+if { (eval echo configure:4102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBUCB="-lucb"
+else
+  echo "$ac_t""no" 1>&6
+fi
+    
+
+   case $host in     *-*-lynxos* )
+        echo $ac_n "checking LynxOS header file wrappers""... $ac_c" 1>&6
+echo "configure:4125: checking LynxOS header file wrappers" >&5
+        CFLAGS="$CFLAGS -D__NO_INCLUDE_WARN__"
+        echo "$ac_t""disabled" 1>&6
+        echo $ac_n "checking for gethostbyname in -lbsd""... $ac_c" 1>&6
+echo "configure:4129: checking for gethostbyname in -lbsd" >&5
+ac_lib_var=`echo bsd'_'gethostbyname | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lbsd  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4137 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char gethostbyname();
+
+int main() {
+gethostbyname()
+; return 0; }
+EOF
+if { (eval echo configure:4148: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBSOCKET="-lbsd"
+else
+  echo "$ac_t""no" 1>&6
+fi
+          ;;
+    esac
+
+     echo $ac_n "checking size of int""... $ac_c" 1>&6
+echo "configure:4171: checking size of int" >&5
+if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_sizeof_int=4
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4179 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+main()
+{
+  FILE *f=fopen("conftestval", "w");
+  if (!f) exit(1);
+  fprintf(f, "%d\n", sizeof(int));
+  exit(0);
+}
+EOF
+if { (eval echo configure:4190: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_sizeof_int=`cat conftestval`
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_sizeof_int=0
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$ac_cv_sizeof_int" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF_INT $ac_cv_sizeof_int
+EOF
+
+  echo $ac_n "checking size of long""... $ac_c" 1>&6
+echo "configure:4209: checking size of long" >&5
+if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_sizeof_long=4
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4217 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+main()
+{
+  FILE *f=fopen("conftestval", "w");
+  if (!f) exit(1);
+  fprintf(f, "%d\n", sizeof(long));
+  exit(0);
+}
+EOF
+if { (eval echo configure:4228: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_sizeof_long=`cat conftestval`
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_sizeof_long=0
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$ac_cv_sizeof_long" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF_LONG $ac_cv_sizeof_long
+EOF
+
+  echo $ac_n "checking size of char *""... $ac_c" 1>&6
+echo "configure:4247: checking size of char *" >&5
+if eval "test \"`echo '$''{'ac_cv_sizeof_char_p'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  if test "$cross_compiling" = yes; then
+  ac_cv_sizeof_char_p=4
+else
+  cat > conftest.$ac_ext <<EOF
+#line 4255 "configure"
+#include "confdefs.h"
+#include <stdio.h>
+main()
+{
+  FILE *f=fopen("conftestval", "w");
+  if (!f) exit(1);
+  fprintf(f, "%d\n", sizeof(char *));
+  exit(0);
+}
+EOF
+if { (eval echo configure:4266: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+then
+  ac_cv_sizeof_char_p=`cat conftestval`
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -fr conftest*
+  ac_cv_sizeof_char_p=0
+fi
+rm -fr conftest*
+fi
+
+fi
+echo "$ac_t""$ac_cv_sizeof_char_p" 1>&6
+cat >> confdefs.h <<EOF
+#define SIZEOF_CHAR_P $ac_cv_sizeof_char_p
+EOF
+
+
+   
+echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6
+echo "configure:4287: checking for dlopen in -ldl" >&5
+ac_lib_var=`echo dl'_'dlopen | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldl  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4295 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char dlopen();
+
+int main() {
+dlopen()
+; return 0; }
+EOF
+if { (eval echo configure:4306: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+LIBDL="-ldl"
+ac_cv_have_dlfcn=yes
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+echo $ac_n "checking for shl_unload in -ldld""... $ac_c" 1>&6
+echo "configure:4331: checking for shl_unload in -ldld" >&5
+ac_lib_var=`echo dld'_'shl_unload | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-ldld  $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4339 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char shl_unload();
+
+int main() {
+shl_unload()
+; return 0; }
+EOF
+if { (eval echo configure:4350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  
+LIBDL="-ldld"
+ac_cv_have_shload=yes
+
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+
+
+
+
+echo $ac_n "checking for extra includes""... $ac_c" 1>&6
+echo "configure:4379: checking for extra includes" >&5
+# Check whether --with-extra-includes or --without-extra-includes was given.
+if test "${with_extra_includes+set}" = set; then
+  withval="$with_extra_includes"
+  kde_use_extra_includes="$withval"
+else
+  kde_use_extra_includes=NONE
+
+fi
+
+kde_extra_includes=
+if test -n "$kde_use_extra_includes" && \
+   test "$kde_use_extra_includes" != "NONE"; then
+
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $kde_use_extra_includes; do
+     kde_extra_includes="$kde_extra_includes $dir"
+     USER_INCLUDES="$USER_INCLUDES -I$dir"
+   done
+   IFS=$ac_save_ifs
+   kde_use_extra_includes="added"
+else
+   kde_use_extra_includes="no"
+fi
+
+
+echo "$ac_t""$kde_use_extra_includes" 1>&6
+
+kde_extra_libs=
+echo $ac_n "checking for extra libs""... $ac_c" 1>&6
+echo "configure:4410: checking for extra libs" >&5
+# Check whether --with-extra-libs or --without-extra-libs was given.
+if test "${with_extra_libs+set}" = set; then
+  withval="$with_extra_libs"
+  kde_use_extra_libs=$withval
+else
+  kde_use_extra_libs=NONE
+
+fi
+
+if test -n "$kde_use_extra_libs" && \
+   test "$kde_use_extra_libs" != "NONE"; then
+
+   ac_save_ifs=$IFS
+   IFS=':'
+   for dir in $kde_use_extra_libs; do
+     kde_extra_libs="$kde_extra_libs $dir"
+     KDE_EXTRA_RPATH="$KDE_EXTRA_RPATH -R $dir"
+     USER_LDFLAGS="$USER_LDFLAGS -L$dir"
+   done
+   IFS=$ac_save_ifs
+   kde_use_extra_libs="added"
+else
+   kde_use_extra_libs="no"
+fi
+
+
+
+echo "$ac_t""$kde_use_extra_libs" 1>&6
+
+
+
+
+echo $ac_n "checking for libz""... $ac_c" 1>&6
+echo "configure:4444: checking for libz" >&5
+if eval "test \"`echo '$''{'ac_cv_lib_z'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+kde_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -lz $LIBSOCKET"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+cat > conftest.$ac_ext <<EOF
+#line 4461 "configure"
+#include "confdefs.h"
+
+#include<zlib.h>
+
+int main() {
+return (zlibVersion() == ZLIB_VERSION); 
+; return 0; }
+EOF
+if { (eval echo configure:4470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_z='-lz'"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_z=no"
+fi
+rm -f conftest*
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+
+fi
+if test ! "$ac_cv_lib_z" = no; then
+  cat >> confdefs.h <<EOF
+#define HAVE_LIBZ 1
+EOF
+
+  LIBZ="$ac_cv_lib_z"
+  
+  echo "$ac_t""$ac_cv_lib_z" 1>&6
+else
+  { echo "configure: error: not found. Check your installation and look into config.log" 1>&2; exit 1; }
+  LIBZ=""
+  
+fi
+
+
+echo $ac_n "checking for X""... $ac_c" 1>&6
+echo "configure:4500: checking for X" >&5
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if eval "test \"`echo '$''{'kde_cv_have_x'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+if test "{$x_includes+set}" = set || test "$x_includes" = NONE; then
+   kde_x_includes=NO
+else
+   kde_x_includes=$x_includes
+fi
+if test "{$x_libraries+set}" = set || test "$x_libraries" = NONE; then
+   kde_x_libraries=NO
+else
+   kde_x_libraries=$x_libraries
+fi
+
+# below we use the standard autoconf calls
+ac_x_libraries=$kde_x_libraries
+ac_x_includes=$kde_x_includes
+
+if test "$ac_x_includes" = NO; then
+  # Guess where to find include files, by looking for this one X11 .h file.
+  test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h
+
+  # First, try using that file with no special directory specified.
+cat > conftest.$ac_ext <<EOF
+#line 4534 "configure"
+#include "confdefs.h"
+#include <$x_direct_test_include>
+EOF
+ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
+{ (eval echo configure:4539: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
+if test -z "$ac_err"; then
+  rm -rf conftest*
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$ac_err" >&5
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  # Look for the header file in a standard set of common directories.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+  for ac_dir in               \
+    /usr/X11/include          \
+    /usr/X11R6/include        \
+    /usr/X11R5/include        \
+    /usr/X11R4/include        \
+                              \
+    /usr/include/X11          \
+    /usr/include/X11R6        \
+    /usr/include/X11R5        \
+    /usr/include/X11R4        \
+                              \
+    /usr/local/X11/include    \
+    /usr/local/X11R6/include  \
+    /usr/local/X11R5/include  \
+    /usr/local/X11R4/include  \
+                              \
+    /usr/local/include/X11    \
+    /usr/local/include/X11R6  \
+    /usr/local/include/X11R5  \
+    /usr/local/include/X11R4  \
+                              \
+    /usr/X386/include         \
+    /usr/x386/include         \
+    /usr/XFree86/include/X11  \
+                              \
+    /usr/include              \
+    /usr/local/include        \
+    /usr/unsupported/include  \
+    /usr/athena/include       \
+    /usr/local/x11r5/include  \
+    /usr/lpp/Xamples/include  \
+                              \
+    /usr/openwin/include      \
+    /usr/openwin/share/include \
+    ; \
+  do
+    if test -r "$ac_dir/$x_direct_test_include"; then
+      ac_x_includes=$ac_dir
+      break
+    fi
+  done
+fi
+rm -f conftest*
+fi # $ac_x_includes = NO
+
+if test "$ac_x_libraries" = NO; then
+  # Check for the libraries.
+
+  test -z "$x_direct_test_library" && x_direct_test_library=Xt
+  test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc
+
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS="$LIBS"
+  LIBS="-l$x_direct_test_library $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4608 "configure"
+#include "confdefs.h"
+
+int main() {
+${x_direct_test_function}()
+; return 0; }
+EOF
+if { (eval echo configure:4615: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  LIBS="$ac_save_LIBS"
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  LIBS="$ac_save_LIBS"
+# First see if replacing the include by lib works.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \
+    /usr/X11/lib          \
+    /usr/X11R6/lib        \
+    /usr/X11R5/lib        \
+    /usr/X11R4/lib        \
+                          \
+    /usr/lib/X11          \
+    /usr/lib/X11R6        \
+    /usr/lib/X11R5        \
+    /usr/lib/X11R4        \
+                          \
+    /usr/local/X11/lib    \
+    /usr/local/X11R6/lib  \
+    /usr/local/X11R5/lib  \
+    /usr/local/X11R4/lib  \
+                          \
+    /usr/local/lib/X11    \
+    /usr/local/lib/X11R6  \
+    /usr/local/lib/X11R5  \
+    /usr/local/lib/X11R4  \
+                          \
+    /usr/X386/lib         \
+    /usr/x386/lib         \
+    /usr/XFree86/lib/X11  \
+                          \
+    /usr/lib              \
+    /usr/local/lib        \
+    /usr/unsupported/lib  \
+    /usr/athena/lib       \
+    /usr/local/x11r5/lib  \
+    /usr/lpp/Xamples/lib  \
+    /lib/usr/lib/X11	  \
+                          \
+    /usr/openwin/lib      \
+    /usr/openwin/share/lib \
+    ; \
+do
+  for ac_extension in a so sl; do
+    if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+rm -f conftest*
+fi # $ac_x_libraries = NO
+
+case "$host" in
+mips-sgi-irix6*)
+  ;;
+*)
+  rm -fr conftestdir
+if mkdir conftestdir; then
+  cd conftestdir
+  # Make sure to not put "make" in the Imakefile rules, since we grep it out.
+  cat > Imakefile <<'EOF'
+acfindx:
+	@echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"'
+EOF
+  if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    eval `${MAKE-make} acfindx 2>/dev/null | grep -v make`
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f $ac_im_usrlibdir/libX11.$ac_extension &&
+        test -f $ac_im_libdir/libX11.$ac_extension; then
+        ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case "$ac_im_incroot" in
+	/usr/include) ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;;
+    esac
+    case "$ac_im_usrlibdir" in
+	/usr/lib | /lib) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;;
+    esac
+  fi
+  cd ..
+  rm -fr conftestdir
+fi
+
+  if test -z "$ac_x_includes"; then
+    ac_x_includes="."
+  fi
+  if test -z "$ac_x_libraries"; then
+    ac_x_libraries="/usr/lib"
+  fi
+esac
+#from now on we use our own again
+
+# when the user already gave --x-includes, we ignore
+# what the standard autoconf macros told us.
+if test "$kde_x_includes" = NO; then
+  kde_x_includes=$ac_x_includes
+fi
+
+# for --x-libraries too
+if test "$kde_x_libraries" = NO; then
+  kde_x_libraries=$ac_x_libraries
+fi
+
+if test "$kde_x_includes" = NO; then
+  { echo "configure: error: Can't find X includes. Please check your installation and add the correct paths!" 1>&2; exit 1; }
+fi
+
+if test "$kde_x_libraries" = NO; then
+  { echo "configure: error: Can't find X libraries. Please check your installation and add the correct paths!" 1>&2; exit 1; }
+fi
+
+# Record where we found X for the cache.
+kde_cv_have_x="have_x=yes \
+         kde_x_includes=$kde_x_includes kde_x_libraries=$kde_x_libraries"
+
+fi
+eval "$kde_cv_have_x"
+
+if test "$have_x" != yes; then
+  echo "$ac_t""$have_x" 1>&6
+  no_x=yes
+else
+  echo "$ac_t""libraries $kde_x_libraries, headers $kde_x_includes" 1>&6
+fi
+
+if test -z "$kde_x_includes" || test "x$kde_x_includes" = xNONE; then
+  X_INCLUDES=""
+  x_includes=".";  else
+  x_includes=$kde_x_includes
+  X_INCLUDES="-I$x_includes"
+fi
+
+if test -z "$kde_x_libraries" || test "x$kde_x_libraries" = xNONE; then
+  X_LDFLAGS=""
+  x_libraries="/usr/lib";  else
+  x_libraries=$kde_x_libraries
+  X_LDFLAGS="-L$x_libraries"
+fi
+all_includes="$X_INCLUDES"
+all_libraries="$X_LDFLAGS"
+
+
+
+
+
+
+# Check for libraries that X11R6 Xt/Xaw programs need.
+ac_save_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+# SM needs ICE to (dynamically) link under SunOS 4.x (so we have to
+# check for ICE first), but we must link in the order -lSM -lICE or
+# we get undefined symbols.  So assume we have SM if we have ICE.
+# These have to be linked with before -lX11, unlike the other
+# libraries we check for below, so use a different variable.
+#  --interran@uluru.Stanford.EDU, kb@cs.umb.edu.
+echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6
+echo "configure:4786: checking for IceConnectionNumber in -lICE" >&5
+ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  ac_save_LIBS="$LIBS"
+LIBS="-lICE $X_EXTRA_LIBS $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 4794 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+char IceConnectionNumber();
+
+int main() {
+IceConnectionNumber()
+; return 0; }
+EOF
+if { (eval echo configure:4805: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=yes"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+  echo "$ac_t""yes" 1>&6
+  LIBSM="-lSM -lICE"
+else
+  echo "$ac_t""no" 1>&6
+fi
+
+
+LDFLAGS="$ac_save_LDFLAGS"
+
+
+
+LIB_X11='-lX11 $(LIBSOCKET)'
+
+
+echo $ac_n "checking for libXext""... $ac_c" 1>&6
+echo "configure:4834: checking for libXext" >&5
+if eval "test \"`echo '$''{'kde_cv_have_libXext'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+kde_ldflags_safe="$LDFLAGS"
+kde_libs_safe="$LIBS"
+
+LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS"
+LIBS="-lXext -lX11 $LIBSOCKET"
+
+cat > conftest.$ac_ext <<EOF
+#line 4846 "configure"
+#include "confdefs.h"
+
+#include <stdio.h>
+
+int main() {
+
+printf("hello Xext\n");
+
+; return 0; }
+EOF
+if { (eval echo configure:4857: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  kde_cv_have_libXext=yes
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  kde_cv_have_libXext=no
+   
+fi
+rm -f conftest*
+
+LDFLAGS=$kde_ldflags_safe
+LIBS=$kde_libs_safe
+ 
+fi
+
+
+echo "$ac_t""$kde_cv_have_libXext" 1>&6
+
+if test "$kde_cv_have_libXext" = "no"; then
+  { echo "configure: error: We need a working libXext to proceed. Since configure
+can't find it itself, we stop here assuming that make wouldn't find
+them either." 1>&2; exit 1; }
+fi
+
+
+
+
+if test -z ""; then
+  kde_qtver=2
+  kde_qtsubver=1
+else
+  kde_qtsubver=`echo "" | sed -e 's#[0-9]\+\.\([0-9]\+\).*#\1#'`
+  # following is the check if subversion isn´t found in passed argument
+  if test "$kde_qtsubver" = ""; then
+    kde_qtsubver=1
+  fi
+  kde_qtver=`echo "" | sed -e 's#^\([0-9]\+\)\..*#\1#'`
+  if test "$kde_qtver" = "1"; then
+    kde_qtsubver=42
+  else
+   # this is the version number fallback to 2.1, unless major version is 1 or 2
+   if test "$kde_qtver" != "2"; then
+    kde_qtver=2
+    kde_qtsubver=1
+   fi
+  fi
+fi
+
+if test -z ""; then
+  if test $kde_qtver = 2; then
+    if test $kde_qtsubver -gt 0; then
+      kde_qt_minversion=">= Qt 2.2.2"
+    else
+      kde_qt_minversion=">= Qt 2.0.2"
+    fi
+  else
+    kde_qt_minversion=">= 1.42 and < 2.0"
+  fi
+else
+   kde_qt_minversion=
+fi
+
+if test -z ""; then
+   if test $kde_qtver = 2; then
+    if test $kde_qtsubver -gt 0; then
+      kde_qt_verstring="QT_VERSION >= 222"
+    else
+      kde_qt_verstring="QT_VERSION >= 200"
+    fi
+   else
+    kde_qt_verstring="QT_VERSION >= 142 && QT_VERSION < 200"
+  fi
+else
+   kde_qt_verstring=
+fi
+
+if test $kde_qtver = 2; then
+   kde_qt_dirs="$QTDIR /usr/lib/qt2 /usr/lib/qt"
+else
+   kde_qt_dirs="$QTDIR /usr/lib/qt"
+fi
+
+
+
+
+echo $ac_n "checking for libpng""... $ac_c" 1>&6
+echo "configure:4945: checking for libpng" >&5
+if eval "test \"`echo '$''{'ac_cv_lib_png'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+kde_save_LIBS="$LIBS"
+LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
+kde_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+cat > conftest.$ac_ext <<EOF
+#line 4962 "configure"
+#include "confdefs.h"
+    
+    #include<png.h>
+    
+int main() {
+
+    png_structp png_ptr = png_create_read_struct(  /* image ptr */
+		PNG_LIBPNG_VER_STRING, 0, 0, 0 );
+    return( png_ptr != 0 );
+    
+; return 0; }
+EOF
+if { (eval echo configure:4975: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_png='-lpng $LIBZ -lm'"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_png=no"
+
+fi
+rm -f conftest*
+LIBS="$kde_save_LIBS"
+CFLAGS="$kde_save_CFLAGS"
+
+fi
+if eval "test ! \"`echo $ac_cv_lib_png`\" = no"; then
+  cat >> confdefs.h <<EOF
+#define HAVE_LIBPNG 1
+EOF
+
+  LIBPNG="$ac_cv_lib_png"
+  
+  echo "$ac_t""$ac_cv_lib_png" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+  LIBPNG=""
+  
+fi
+
+
+
+echo $ac_n "checking for libjpeg6b""... $ac_c" 1>&6
+echo "configure:5007: checking for libjpeg6b" >&5
+if eval "test \"`echo '$''{'ac_cv_lib_jpeg_6b'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -ljpeg6b -lm"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+cat > conftest.$ac_ext <<EOF
+#line 5024 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+struct jpeg_decompress_struct;
+typedef struct jpeg_decompress_struct * j_decompress_ptr;
+typedef int size_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+    void jpeg_CreateDecompress(j_decompress_ptr cinfo,
+                                    int version, size_t structsize);
+#ifdef __cplusplus
+}
+#endif
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+
+int main() {
+jpeg_CreateDecompress(0L, 0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:5045: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_jpeg_6b=-ljpeg6b"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_jpeg_6b=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+CFLAGS="$ac_save_CFLAGS"
+
+fi
+
+
+if eval "test ! \"`echo $ac_cv_lib_jpeg_6b`\" = no"; then
+  LIBJPEG="$ac_cv_lib_jpeg_6b"
+  echo "$ac_t""$ac_cv_lib_jpeg_6b" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+  
+echo $ac_n "checking for libjpeg""... $ac_c" 1>&6
+echo "configure:5068: checking for libjpeg" >&5
+if eval "test \"`echo '$''{'ac_cv_lib_jpeg_normal'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+ac_save_LIBS="$LIBS"
+LIBS="$all_libraries $USER_LDFLAGS -ljpeg -lm"
+ac_save_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS $all_includes $USER_INCLUDES"
+cat > conftest.$ac_ext <<EOF
+#line 5085 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error.  */
+struct jpeg_decompress_struct;
+typedef struct jpeg_decompress_struct * j_decompress_ptr;
+typedef int size_t;
+#ifdef __cplusplus
+extern "C" {
+#endif
+    void jpeg_CreateDecompress(j_decompress_ptr cinfo,
+                                    int version, size_t structsize);
+#ifdef __cplusplus
+}
+#endif
+/* We use char because int might match the return type of a gcc2
+    builtin and then its argument prototype would still apply.  */
+
+int main() {
+jpeg_CreateDecompress(0L, 0, 0);
+; return 0; }
+EOF
+if { (eval echo configure:5106: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+  rm -rf conftest*
+  eval "ac_cv_lib_jpeg_normal=-ljpeg"
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  rm -rf conftest*
+  eval "ac_cv_lib_jpeg_normal=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+CFLAGS="$ac_save_CFLAGS"
+
+fi
+
+
+if eval "test ! \"`echo $ac_cv_lib_jpeg_normal`\" = no"; then
+  LIBJPEG="$ac_cv_lib_jpeg_normal"
+  echo "$ac_t""$ac_cv_lib_jpeg_normal" 1>&6
+else
+  echo "$ac_t""no" 1>&6
+  
+	if test -f "$kde_libraries/libjpeg.so"; then
+	   test -f ./libjpegkde.so || $LN_S $kde_libraries/libjpeg.so ./libjpegkde.so
+	   ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
+	else if test -f "$kde_libraries/libjpeg.sl"; then
+	   test -f ./libjpegkde.sl ||$LN_S $kde_libraries/libjpeg.sl ./libjpegkde.sl
+	   ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"	
+	else if test -f "$kde_libraries/libjpeg.a"; then
+	   test -f ./libjpegkde.a || $LN_S $kde_libraries/libjpeg.a ./libjpegkde.a
+	   ac_cv_lib_jpeg="-L\${topdir} -ljpegkde"
+        else
+	  ac_cv_lib_jpeg=
+	fi
+      fi
+   fi
+
+   LIBJPEG=$ac_cv_lib_jpeg
+
+fi
+
+
+fi
+
+
+
+jpeg_incdirs="/usr/include /usr/local/include $kde_extra_includes"
+
+jpeg_incdir=NO
+for i in $jpeg_incdirs;
+do
+  for j in jpeglib.h;
+  do
+    if test -r "$i/$j"; then
+      jpeg_incdir=$i
+      break 2
+    fi
+  done
+done
+
+test "x$jpeg_incdir" = xNO && jpeg_incdir=
+
+if test -n "$jpeg_incdir" && test -n "$LIBJPEG" ; then
+  cat >> confdefs.h <<EOF
+#define HAVE_LIBJPEG 1
+EOF
+
+else
+  if test -n "$jpeg_incdir" || test -n "$LIBJPEG" ; then
+    echo "configure: warning: 
+There is an installation error in jpeg support. You seem to have only one
+of either the headers _or_ the libraries installed. You may need to either
+provide correct --with-extra-... options, or the development package of
+libjpeg6b. You can get a source package of libjpeg from http://www.ijg.org/
+Disabling JPEG support.
+" 1>&2
+  else
+    echo "configure: warning: libjpeg not found. disable JPEG support." 1>&2
+  fi
+  jpeg_incdir=
+  LIBJPEG=
+fi
+
+
+
+
+
+
+
+
+
+# Check whether --enable-mt or --disable-mt was given.
+if test "${enable_mt+set}" = set; then
+  enableval="$enable_mt"
+  kde_use_qt_mt=$enableval
+else
+  kde_use_qt_mt=no
+
+fi
+
+
+USING_QT_MT=""
+
+
+if test "x$kde_use_qt_mt" = "xyes"; then
+
+  case $host in
+  *-*-linux-*)
+    if test "x$GCC" = "xyes"; then
+      CPPFLAGS="$CPPFLAGS -DQT_THREAD_SUPPORT -pthread"
+      X_EXTRA_LIBS="$X_EXTRA_LIBS -pthread"
+    else
+      echo "configure: warning: Compiler is not gcc. MT support disabled." 1>&2
+    fi
+    ;;
+  *)
+    echo "configure: warning: MT not yet supported on $host - disabled." 1>&2
+    ;;
+  esac
+
+fi
+
+kde_qt_was_given=yes
+
+
+if test -z "$LIBQT_GLOB"; then
+
+  LIBQT_GLOB="libqt.*"
+
+fi
+
+if test -z "$LIBQT"; then
+
+  LIBQT="-lqt"
+  kde_int_qt="-lqt"
+
+
+  if test "x$kde_use_qt_mt" = "xyes"; then
+
+      case $host in
+      *-*-linux-*)
+        if test "x$GCC" = "xyes"; then
+          LIBQT="-lqt-mt"
+          kde_int_qt="-lqt-mt"
+          LIBQT_GLOB="libqt-mt.*"
+          USING_QT_MT="using -mt"
+        fi
+      ;;
+      esac
+  fi
+
+  kde_qt_was_given=no
+
+else
+  kde_int_qt="$LIBQT"
+fi
+
+if test $kde_qtver = 2; then
+
+  
+  
+  LIBQT="$LIBQT $LIBPNG $LIBJPEG"
+fi
+
+echo $ac_n "checking for Qt""... $ac_c" 1>&6
+echo "configure:5271: checking for Qt" >&5
+
+LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
+ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
+qt_libraries=""
+qt_includes=""
+# Check whether --with-qt-dir or --without-qt-dir was given.
+if test "${with_qt_dir+set}" = set; then
+  withval="$with_qt_dir"
+    ac_qt_includes="$withval"/include
+       ac_qt_libraries="$withval"/lib
+       ac_qt_bindir="$withval"/bin
+    
+fi
+
+
+# Check whether --with-qt-includes or --without-qt-includes was given.
+if test "${with_qt_includes+set}" = set; then
+  withval="$with_qt_includes"
+  
+       ac_qt_includes="$withval"
+    
+fi
+
+
+kde_qt_libs_given=no
+
+# Check whether --with-qt-libraries or --without-qt-libraries was given.
+if test "${with_qt_libraries+set}" = set; then
+  withval="$with_qt_libraries"
+    ac_qt_libraries="$withval"
+       kde_qt_libs_given=yes
+    
+fi
+
+
+if eval "test \"`echo '$''{'ac_cv_have_qt'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  #try to guess Qt locations
+
+qt_incdirs=""
+for dir in $kde_qt_dirs; do
+   qt_incdirs="$qt_incdirs $dir/include $dir"
+done
+qt_incdirs="$QTINC $qt_incdirs /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt $x_includes"
+if test ! "$ac_qt_includes" = "NO"; then
+   qt_incdirs="$ac_qt_includes $qt_incdirs"
+fi
+
+if test "$kde_qtver" = "2"; then
+  kde_qt_header=qstyle.h
+else
+  kde_qt_header=qglobal.h
+fi
+
+
+qt_incdir=NO
+for i in $qt_incdirs;
+do
+  for j in $kde_qt_header;
+  do
+    if test -r "$i/$j"; then
+      qt_incdir=$i
+      break 2
+    fi
+  done
+done
+
+ac_qt_includes="$qt_incdir"
+
+qt_libdirs=""
+for dir in $kde_qt_dirs; do
+   qt_libdirs="$qt_libdirs $dir/lib $dir"
+done
+qt_libdirs="$QTLIB $qt_libdirs /usr/X11R6/lib /usr/lib /usr/local/qt/lib $x_libraries"
+if test ! "$ac_qt_libraries" = "NO"; then
+  qt_libdir=$ac_qt_libraries
+else
+  qt_libdirs="$ac_qt_libraries $qt_libdirs"
+  # if the Qt was given, the chance is too big that libqt.* doesn't exist
+  qt_libdir=NONE
+  for dir in $qt_libdirs; do
+    try="ls -1 $dir/${LIBQT_GLOB}"
+    if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&5 ; fi
+  done
+fi
+
+ac_qt_libraries="$qt_libdir"
+
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_incdir $all_includes"
+LDFLAGS="$LDFLAGS -L$qt_libdir $all_libraries $USER_LDFLAGS"
+LIBS="$LIBS $LIBQT"
+
+
+
+cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qglobal.h>
+#include <qapplication.h>
+#include <qapp.h>
+#include <qobjcoll.h>
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qevent.h>
+#include <qstring.h>
+#include <qstyle.h>
+EOF
+
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+#include <qiconview.h>
+EOF
+fi
+
+fi
+
+echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
+cat >> conftest.$ac_ext <<EOF
+#error 1
+#endif
+
+int main() {
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+    QStringList *t = new QStringList();
+EOF
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+    QIconView iv(0);
+    iv.setWordWrapIconText(false);
+    QString s;
+    s.setLatin1("Elvis is alive", 14);
+    int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
+EOF
+fi
+fi
+cat >> conftest.$ac_ext <<EOF
+    return 0;
+}
+EOF
+
+
+if { (eval echo configure:5432: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  rm -f conftest*
+else
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+  ac_qt_libraries="NO"
+fi
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+if test "$ac_qt_includes" = NO || test "$ac_qt_libraries" = NO; then
+  ac_cv_have_qt="have_qt=no"
+  ac_qt_notfound=""
+  if test "$ac_qt_includes" = NO; then
+    if test "$ac_qt_libraries" = NO; then
+      ac_qt_notfound="(headers and libraries)";
+    else
+      ac_qt_notfound="(headers)";
+    fi
+  else
+    ac_qt_notfound="(libraries)";
+  fi
+
+  { echo "configure: error: Qt ($kde_qt_minversion) $ac_qt_notfound not found. Please check your installation!
+For more details about this problem, look at the end of config.log." 1>&2; exit 1; }
+else
+  have_qt="yes"
+fi
+
+fi
+
+
+eval "$ac_cv_have_qt"
+
+if test "$have_qt" != yes; then
+  echo "$ac_t""$have_qt" 1>&6;
+else
+  ac_cv_have_qt="have_qt=yes \
+    ac_qt_includes=$ac_qt_includes ac_qt_libraries=$ac_qt_libraries"
+  echo "$ac_t""libraries $ac_qt_libraries, headers $ac_qt_includes $USING_QT_MT" 1>&6
+
+  qt_libraries="$ac_qt_libraries"
+  qt_includes="$ac_qt_includes"
+fi
+
+if test ! "$kde_qt_libs_given" = "yes"; then
+
+
+echo $ac_n "checking if Qt compiles without flags""... $ac_c" 1>&6
+echo "configure:5490: checking if Qt compiles without flags" >&5
+if eval "test \"`echo '$''{'kde_cv_qt_direct'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+
+ ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+ac_LD_LIBRARY_PATH_safe=$LD_LIBRARY_PATH
+ac_LIBRARY_PATH="$LIBRARY_PATH"
+ac_cxxflags_safe="$CXXFLAGS"
+ac_ldflags_safe="$LDFLAGS"
+ac_libs_safe="$LIBS"
+
+CXXFLAGS="$CXXFLAGS -I$qt_includes"
+LDFLAGS="$LDFLAGS $X_LDFLAGS"
+LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
+LD_LIBRARY_PATH=
+export LD_LIBRARY_PATH
+LIBRARY_PATH=
+export LIBRARY_PATH
+
+
+
+cat > conftest.$ac_ext <<EOF
+#include "confdefs.h"
+#include <qglobal.h>
+#include <qapplication.h>
+#include <qapp.h>
+#include <qobjcoll.h>
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+#include <qevent.h>
+#include <qstring.h>
+#include <qstyle.h>
+EOF
+
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+#include <qiconview.h>
+EOF
+fi
+
+fi
+
+echo "#if ! ($kde_qt_verstring)" >> conftest.$ac_ext
+cat >> conftest.$ac_ext <<EOF
+#error 1
+#endif
+
+int main() {
+EOF
+if test "$kde_qtver" = "2"; then
+cat >> conftest.$ac_ext <<EOF
+    QStringList *t = new QStringList();
+EOF
+if test $kde_qtsubver -gt 0; then
+cat >> conftest.$ac_ext <<EOF
+    QIconView iv(0);
+    iv.setWordWrapIconText(false);
+    QString s;
+    s.setLatin1("Elvis is alive", 14);
+    int magnolia = QEvent::Speech; /* new in 2.2 beta2 */
+EOF
+fi
+fi
+cat >> conftest.$ac_ext <<EOF
+    return 0;
+}
+EOF
+
+
+if { (eval echo configure:5571: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  kde_cv_qt_direct="yes"
+else
+  kde_cv_qt_direct="no"
+  echo "configure: failed program was:" >&5
+  cat conftest.$ac_ext >&5
+fi
+
+rm -f conftest*
+CXXFLAGS="$ac_cxxflags_safe"
+LDFLAGS="$ac_ldflags_safe"
+LIBS="$ac_libs_safe"
+
+LD_LIBRARY_PATH="$ac_LD_LIBRARY_PATH_safe"
+export LD_LIBRARY_PATH
+LIBRARY_PATH="$ac_LIBRARY_PATH"
+export LIBRARY_PATH
+ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+fi
+
+
+if test "$kde_cv_qt_direct" = "yes"; then
+  echo "$ac_t""yes" 1>&6
+  qt_libraries= 
+else
+  echo "$ac_t""no" 1>&6
+  
+fi
+
+fi
+
+
+
+
+if test "$qt_includes" = "$x_includes" || test -z "$qt_includes"; then
+ QT_INCLUDES="";
+else
+ QT_INCLUDES="-I$qt_includes"
+ all_includes="$QT_INCLUDES $all_includes"
+fi
+
+if test "$qt_libraries" = "$x_libraries" || test -z "$qt_libraries"; then
+ QT_LDFLAGS=""
+else
+ QT_LDFLAGS="-L$qt_libraries"
+ all_libraries="$all_libraries $QT_LDFLAGS"
+fi
+
+
+
+
+   qt_bindirs=""
+   for dir in $kde_qt_dirs; do
+      qt_bindirs="$qt_bindirs $dir/bin $dir/src/moc"
+   done
+   qt_bindirs="$qt_bindirs /usr/bin /usr/X11R6/bin /usr/local/qt/bin"
+   if test ! "$ac_qt_bindir" = "NO"; then
+      qt_bindirs="$ac_qt_bindir $qt_bindirs"
+   fi
+
+   
+   echo $ac_n "checking for moc""... $ac_c" 1>&6
+echo "configure:5640: checking for moc" >&5
+   if test -n "$MOC"; then
+        kde_cv_path="$MOC";
+   else
+        kde_cache=`echo moc | sed 'y%./+-%__p_%'`
+
+        if eval "test \"`echo '$''{'kde_cv_path_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        kde_cv_path="NONE"
+	dirs="$qt_bindirs"
+	kde_save_IFS=$IFS
+	IFS=':'
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+        done
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/moc"; then
+	    if test -n ""
+	    then
+              evalstr="$dir/moc  2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/moc"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/moc"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        
+fi
+
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      echo "$ac_t""not found" 1>&6
+      
+    { echo "configure: error: No Qt meta object compiler (moc) found!
+Please check whether you installed Qt correctly.
+You need to have a running moc binary.
+configure tried to run $ac_cv_path_moc and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable MOC to the right one before running
+configure.
+" 1>&2; exit 1; }
+
+   else
+      echo "$ac_t""$kde_cv_path" 1>&6
+      MOC=$kde_cv_path
+
+   fi
+
+   
+   echo $ac_n "checking for uic""... $ac_c" 1>&6
+echo "configure:5705: checking for uic" >&5
+   if test -n "$UIC"; then
+        kde_cv_path="$UIC";
+   else
+        kde_cache=`echo uic | sed 'y%./+-%__p_%'`
+
+        if eval "test \"`echo '$''{'kde_cv_path_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        kde_cv_path="NONE"
+	dirs="$qt_bindirs"
+	kde_save_IFS=$IFS
+	IFS=':'
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+        done
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/uic"; then
+	    if test -n ""
+	    then
+              evalstr="$dir/uic  2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/uic"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/uic"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        
+fi
+
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      echo "$ac_t""not found" 1>&6
+      UIC="" ; 
+    echo "configure: warning: No Qt ui compiler (uic) found!
+Please check whether you installed Qt correctly.
+You need to have a running uic binary.
+configure tried to run $ac_cv_path_uic and the test didn't
+succeed. If configure shouldn't have tried this one, set
+the environment variable UIC to the right one before running
+configure.
+" 1>&2
+
+   else
+      echo "$ac_t""$kde_cv_path" 1>&6
+      UIC=$kde_cv_path
+
+   fi
+
+   if test -z "$UIC" ; then
+     if test -z "$UIC_NOT_NEEDED" ; then
+       exit 1
+     else
+       UIC="echo uic not available: "
+     fi
+   fi
+   
+   
+
+
+LIB_QT="$kde_int_qt "'$(LIBPNG) $(LIBJPEG) -lXext $(LIB_X11) $(LIBSM)'
+
+
+
+
+
+  
+
+
+echo $ac_n "checking for rpath""... $ac_c" 1>&6
+echo "configure:5789: checking for rpath" >&5
+# Check whether --enable-rpath or --disable-rpath was given.
+if test "${enable_rpath+set}" = set; then
+  enableval="$enable_rpath"
+  USE_RPATH=$enableval
+else
+  USE_RPATH=yes
+fi
+
+
+if test -z "$KDE_RPATH" && test "$USE_RPATH" = "yes"; then
+
+  KDE_RPATH="-R \$(kde_libraries)"
+
+  if test -n "$qt_libraries"; then
+    KDE_RPATH="$KDE_RPATH -R \$(qt_libraries)"
+  fi
+    if test -n "$X_LDFLAGS"; then
+    KDE_RPATH="$KDE_RPATH -R \$(x_libraries)"
+  fi
+  if test -n "$KDE_EXTRA_RPATH"; then
+    KDE_RPATH="$KDE_RPATH \$(KDE_EXTRA_RPATH)"
+  fi
+fi
+
+
+echo "$ac_t""$USE_RPATH" 1>&6
+
+echo $ac_n "checking for KDE""... $ac_c" 1>&6
+echo "configure:5818: checking for KDE" >&5
+
+if test "${prefix}" != NONE; then
+  kde_includes=${prefix}/include
+  ac_kde_includes=$prefix/include
+
+  if test "${exec_prefix}" != NONE; then
+    kde_libraries=${exec_prefix}/lib
+    ac_kde_libraries=$exec_prefix/lib
+  else
+    kde_libraries=${prefix}/lib
+    ac_kde_libraries=$prefix/lib
+  fi
+else
+  ac_kde_includes=
+  ac_kde_libraries=
+  kde_libraries=""
+  kde_includes=""
+fi
+
+if eval "test \"`echo '$''{'ac_cv_have_kde'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  #try to guess kde locations
+
+if test "$kde_qtver" = 1; then
+  kde_check_header="ksock.h"
+  kde_check_lib="libkdecore.la"
+else
+  kde_check_header="ksharedptr.h"
+  kde_check_lib="libkio.la"
+fi
+
+if test -z ""; then
+
+kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/kde/include /usr/include/kde /usr/include /opt/kde2/include /opt/kde/include $x_includes $qt_includes"
+test -n "$KDEDIR" && kde_incdirs="$KDEDIR/include $KDEDIR/include/kde $KDEDIR $kde_incdirs"
+kde_incdirs="$ac_kde_includes $kde_incdirs"
+
+kde_incdir=NO
+for i in $kde_incdirs;
+do
+  for j in $kde_check_header;
+  do
+    if test -r "$i/$j"; then
+      kde_incdir=$i
+      break 2
+    fi
+  done
+done
+
+ac_kde_includes="$kde_incdir"
+
+if test -n "$ac_kde_includes" && test ! -r "$ac_kde_includes/$kde_check_header"; then
+  { echo "configure: error: 
+in the prefix, you've chosen, are no KDE headers installed. This will fail.
+So, check this please and use another prefix!" 1>&2; exit 1; }
+fi
+
+kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib /usr/X11R6/lib /opt/kde2/lib /opt/kde/lib /usr/X11R6/kde/lib"
+test -n "$KDEDIR" && kde_libdirs="$KDEDIR/lib $KDEDIR $kde_libdirs"
+kde_libdirs="$ac_kde_libraries $kde_libdirs"
+
+kde_libdir=NO
+for i in $kde_libdirs;
+do
+  for j in $kde_check_lib;
+  do
+    if test -r "$i/$j"; then
+      kde_libdir=$i
+      break 2
+    fi
+  done
+done
+
+ac_kde_libraries="$kde_libdir"
+
+if test -n "$ac_kde_libraries" && test ! -r "$ac_kde_libraries/$kde_check_lib"; then
+{ echo "configure: error: 
+in the prefix, you've chosen, are no KDE libraries installed. This will fail.
+So, check this please and use another prefix!" 1>&2; exit 1; }
+fi
+ac_kde_libraries="$kde_libdir"
+
+if test "$ac_kde_includes" = NO || test "$ac_kde_libraries" = NO; then
+  ac_cv_have_kde="have_kde=no"
+else
+  ac_cv_have_kde="have_kde=yes \
+    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+fi
+
+else 
+  ac_cv_have_kde="have_kde=no"
+
+fi
+
+fi
+
+eval "$ac_cv_have_kde"
+
+if test "$have_kde" != "yes"; then
+ if test "${prefix}" = NONE; then
+  ac_kde_prefix="$ac_default_prefix"
+ else
+  ac_kde_prefix="$prefix"
+ fi
+ if test "$exec_prefix" = NONE; then
+  ac_kde_exec_prefix="$ac_kde_prefix"
+  echo "$ac_t""will be installed in $ac_kde_prefix" 1>&6
+ else
+  ac_kde_exec_prefix="$exec_prefix"
+  echo "$ac_t""will be installed in $ac_kde_prefix and $ac_kde_exec_prefix" 1>&6
+ fi
+
+ kde_libraries="${ac_kde_exec_prefix}/lib"
+ kde_includes=${ac_kde_prefix}/include
+
+else
+  ac_cv_have_kde="have_kde=yes \
+    ac_kde_includes=$ac_kde_includes ac_kde_libraries=$ac_kde_libraries"
+  echo "$ac_t""libraries $ac_kde_libraries, headers $ac_kde_includes" 1>&6
+
+  kde_libraries="$ac_kde_libraries"
+  kde_includes="$ac_kde_includes"
+fi
+
+
+
+if test "$kde_includes" = "$x_includes" || test "$kde_includes" = "$qt_includes" ; then
+ KDE_INCLUDES=""
+else
+ KDE_INCLUDES="-I$kde_includes"
+ all_includes="$KDE_INCLUDES $all_includes"
+fi
+ 
+KDE_LDFLAGS="-L$kde_libraries"
+if test ! "$kde_libraries" = "$x_libraries" && test ! "$kde_libraries" = "$qt_libraries" ; then 
+ all_libraries="$all_libraries $KDE_LDFLAGS"
+fi
+
+
+
+
+
+
+all_libraries="$all_libraries $USER_LDFLAGS"
+all_includes="$all_includes $USER_INCLUDES"
+
+
+
+
+
+  # Check whether --enable-path-check or --disable-path-check was given.
+if test "${enable_path_check+set}" = set; then
+  enableval="$enable_path_check"
+  
+  if test "$enableval" = "no";
+    then ac_use_path_checking="default"
+    else ac_use_path_checking=""
+  fi
+  
+else
+  
+  if test "$kde_qtver" = 1;
+    then ac_use_path_checking=""
+    else ac_use_path_checking="default"
+  fi
+  
+  
+fi
+
+
+  
+
+
+echo $ac_n "checking for KDE paths""... $ac_c" 1>&6
+echo "configure:5994: checking for KDE paths" >&5
+kde_result=""
+kde_cached_paths=yes
+if eval "test \"`echo '$''{'kde_cv_all_paths'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+  
+if test "$ac_use_path_checking" = "default"; then
+
+  if test -z "$kde_htmldir"; then
+    kde_htmldir='\${prefix}/share/doc/HTML'
+  fi
+  if test -z "$kde_appsdir"; then
+    kde_appsdir='\${prefix}/share/applnk'
+  fi
+  if test -z "$kde_icondir"; then
+    kde_icondir='\${prefix}/share/icons'
+  fi
+  if test -z "$kde_sounddir"; then
+    kde_sounddir='\${prefix}/share/sounds'
+  fi
+  if test -z "$kde_datadir"; then
+    kde_datadir='\${prefix}/share/apps'
+  fi
+  if test -z "$kde_locale"; then
+    kde_locale='\${prefix}/share/locale'
+  fi
+  if test -z "$kde_cgidir"; then
+    kde_cgidir='\${exec_prefix}/cgi-bin'
+  fi
+  if test -z "$kde_confdir"; then
+    kde_confdir='\${prefix}/share/config'
+  fi
+  if test -z "$kde_mimedir"; then
+    kde_mimedir='\${prefix}/share/mimelnk'
+  fi
+  if test -z "$kde_toolbardir"; then
+    kde_toolbardir='\${prefix}/share/toolbar'
+  fi
+  if test -z "$kde_wallpaperdir"; then
+    kde_wallpaperdir='\${prefix}/share/wallpapers'
+  fi
+  if test -z "$kde_templatesdir"; then
+    kde_templatesdir='\${prefix}/share/templates'
+  fi
+  if test -z "$kde_bindir"; then
+    kde_bindir='\${exec_prefix}/bin'
+  fi
+  if test -z "$kde_servicesdir"; then
+    kde_servicesdir='\${prefix}/share/services'
+  fi
+  if test -z "$kde_servicetypesdir"; then
+    kde_servicetypesdir='\${prefix}/share/servicetypes'
+  fi
+  if test -z "$kde_moduledir"; then
+    kde_moduledir='\${prefix}/lib/kde2'
+  fi
+
+  
+  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+	kde_htmldir=\"$kde_htmldir\" \
+	kde_appsdir=\"$kde_appsdir\" \
+	kde_icondir=\"$kde_icondir\" \
+	kde_sounddir=\"$kde_sounddir\" \
+	kde_datadir=\"$kde_datadir\" \
+	kde_locale=\"$kde_locale\" \
+	kde_cgidir=\"$kde_cgidir\" \
+	kde_confdir=\"$kde_confdir\" \
+	kde_mimedir=\"$kde_mimedir\" \
+	kde_toolbardir=\"$kde_toolbardir\" \
+	kde_wallpaperdir=\"$kde_wallpaperdir\" \
+	kde_templatesdir=\"$kde_templatesdir\" \
+	kde_bindir=\"$kde_bindir\" \
+	kde_servicesdir=\"$kde_servicesdir\" \
+	kde_servicetypesdir=\"$kde_servicetypesdir\" \
+	kde_moduledir=\"$kde_moduledir\" \
+	kde_result=defaults"
+
+
+else
+
+  if test $kde_qtver = 1; then
+     echo "$ac_t""compiling" 1>&6
+     
+  
+    echo $ac_n "checking for KDE headers installed""... $ac_c" 1>&6
+echo "configure:6081: checking for KDE headers installed" >&5
+    
+     ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+cat > conftest.$ac_ext <<EOF
+#include <stdio.h>
+#include "confdefs.h"
+#include <kapp.h>
+
+int main() {
+    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
+    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
+    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
+    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
+    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
+    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
+    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
+    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
+    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
+    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
+    printf("kde_wallpaperdir=\\"%s\\"\n",
+	KApplication::kde_wallpaperdir().data());
+    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
+    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
+    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
+    return 0;
+    }
+EOF
+
+ ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
+ if { (eval echo configure:6121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+   echo "$ac_t""yes" 1>&6
+ else
+   { echo "configure: error: your system is not able to compile a small KDE application!
+Check, if you installed the KDE header files correctly.
+For more details about this problem, look at the end of config.log." 1>&2; exit 1; }
+  fi
+
+  ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+
+  KDE_TEST_RPATH=
+
+  if test -n "$USE_RPATH"; then
+
+     if test -n "$kde_libraries"; then
+       KDE_TEST_RPATH="-R $kde_libraries"
+     fi
+
+     if test -n "$qt_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
+     fi
+
+     if test -n "$x_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
+     fi
+
+     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
+  fi
+
+echo $ac_n "checking for KDE libraries installed""... $ac_c" 1>&6
+echo "configure:6158: checking for KDE libraries installed" >&5
+ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
+
+if { (eval echo configure:6161: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  echo "$ac_t""yes" 1>&6
+else
+  { echo "configure: error: your system fails at linking a small KDE application!
+Check, if your compiler is installed correctly and if you have used the
+same compiler to compile Qt and kdelibs as you did use now.
+For more details about this problem, look at the end of config.log." 1>&2; exit 1; }
+fi
+
+if eval `KDEDIR= ./conftest 2>&5`; then
+  kde_result=done
+else
+  kde_result=problems
+fi
+
+KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
+kde_have_all_paths=yes
+
+
+  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+	kde_htmldir=\"$kde_htmldir\" \
+	kde_appsdir=\"$kde_appsdir\" \
+	kde_icondir=\"$kde_icondir\" \
+	kde_sounddir=\"$kde_sounddir\" \
+	kde_datadir=\"$kde_datadir\" \
+	kde_locale=\"$kde_locale\" \
+	kde_cgidir=\"$kde_cgidir\" \
+	kde_confdir=\"$kde_confdir\" \
+	kde_mimedir=\"$kde_mimedir\" \
+	kde_toolbardir=\"$kde_toolbardir\" \
+	kde_wallpaperdir=\"$kde_wallpaperdir\" \
+	kde_templatesdir=\"$kde_templatesdir\" \
+	kde_bindir=\"$kde_bindir\" \
+	kde_servicesdir=\"$kde_servicesdir\" \
+	kde_servicetypesdir=\"$kde_servicetypesdir\" \
+	kde_moduledir=\"$kde_moduledir\" \
+	kde_result=$kde_result"
+
+
+
+  else
+     { echo "configure: error: path checking not yet supported for KDE 2" 1>&2; exit 1; }
+  fi
+
+fi
+
+  kde_cached_paths=no
+
+fi
+
+eval "$kde_cv_all_paths"
+ if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
+   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
+   test -z "$kde_datadir" || test -z "$kde_locale"  ||
+   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
+   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
+   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
+   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
+   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
+   test "$kde_have_all_paths" != "yes"; then
+     kde_have_all_paths=no
+  fi
+
+if test "$kde_have_all_paths" = "no" && test "$kde_cached_paths" = "yes"; then
+  # wrong values were cached, may be, we can set better ones
+  kde_result=
+  kde_htmldir= kde_appsdir= kde_icondir= kde_sounddir=
+  kde_datadir= kde_locale=  kde_cgidir=  kde_confdir=
+  kde_mimedir= kde_toolbardir= kde_wallpaperdir= kde_templatesdir=
+  kde_bindir= kde_servicesdir= kde_servicetypesdir= kde_moduledir=
+  kde_have_all_paths=
+  
+if test "$ac_use_path_checking" = "default"; then
+
+  if test -z "$kde_htmldir"; then
+    kde_htmldir='\${prefix}/share/doc/HTML'
+  fi
+  if test -z "$kde_appsdir"; then
+    kde_appsdir='\${prefix}/share/applnk'
+  fi
+  if test -z "$kde_icondir"; then
+    kde_icondir='\${prefix}/share/icons'
+  fi
+  if test -z "$kde_sounddir"; then
+    kde_sounddir='\${prefix}/share/sounds'
+  fi
+  if test -z "$kde_datadir"; then
+    kde_datadir='\${prefix}/share/apps'
+  fi
+  if test -z "$kde_locale"; then
+    kde_locale='\${prefix}/share/locale'
+  fi
+  if test -z "$kde_cgidir"; then
+    kde_cgidir='\${exec_prefix}/cgi-bin'
+  fi
+  if test -z "$kde_confdir"; then
+    kde_confdir='\${prefix}/share/config'
+  fi
+  if test -z "$kde_mimedir"; then
+    kde_mimedir='\${prefix}/share/mimelnk'
+  fi
+  if test -z "$kde_toolbardir"; then
+    kde_toolbardir='\${prefix}/share/toolbar'
+  fi
+  if test -z "$kde_wallpaperdir"; then
+    kde_wallpaperdir='\${prefix}/share/wallpapers'
+  fi
+  if test -z "$kde_templatesdir"; then
+    kde_templatesdir='\${prefix}/share/templates'
+  fi
+  if test -z "$kde_bindir"; then
+    kde_bindir='\${exec_prefix}/bin'
+  fi
+  if test -z "$kde_servicesdir"; then
+    kde_servicesdir='\${prefix}/share/services'
+  fi
+  if test -z "$kde_servicetypesdir"; then
+    kde_servicetypesdir='\${prefix}/share/servicetypes'
+  fi
+  if test -z "$kde_moduledir"; then
+    kde_moduledir='\${prefix}/lib/kde2'
+  fi
+
+  
+  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+	kde_htmldir=\"$kde_htmldir\" \
+	kde_appsdir=\"$kde_appsdir\" \
+	kde_icondir=\"$kde_icondir\" \
+	kde_sounddir=\"$kde_sounddir\" \
+	kde_datadir=\"$kde_datadir\" \
+	kde_locale=\"$kde_locale\" \
+	kde_cgidir=\"$kde_cgidir\" \
+	kde_confdir=\"$kde_confdir\" \
+	kde_mimedir=\"$kde_mimedir\" \
+	kde_toolbardir=\"$kde_toolbardir\" \
+	kde_wallpaperdir=\"$kde_wallpaperdir\" \
+	kde_templatesdir=\"$kde_templatesdir\" \
+	kde_bindir=\"$kde_bindir\" \
+	kde_servicesdir=\"$kde_servicesdir\" \
+	kde_servicetypesdir=\"$kde_servicetypesdir\" \
+	kde_moduledir=\"$kde_moduledir\" \
+	kde_result=defaults"
+
+
+else
+
+  if test $kde_qtver = 1; then
+     echo "$ac_t""compiling" 1>&6
+     
+  
+    echo $ac_n "checking for KDE headers installed""... $ac_c" 1>&6
+echo "configure:6312: checking for KDE headers installed" >&5
+    
+     ac_ext=C
+# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cxx_cross
+
+ac_link='rm -rf SunWS_cache; ${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+
+
+cat > conftest.$ac_ext <<EOF
+#include <stdio.h>
+#include "confdefs.h"
+#include <kapp.h>
+
+int main() {
+    printf("kde_htmldir=\\"%s\\"\n", KApplication::kde_htmldir().data());
+    printf("kde_appsdir=\\"%s\\"\n", KApplication::kde_appsdir().data());
+    printf("kde_icondir=\\"%s\\"\n", KApplication::kde_icondir().data());
+    printf("kde_sounddir=\\"%s\\"\n", KApplication::kde_sounddir().data());
+    printf("kde_datadir=\\"%s\\"\n", KApplication::kde_datadir().data());
+    printf("kde_locale=\\"%s\\"\n", KApplication::kde_localedir().data());
+    printf("kde_cgidir=\\"%s\\"\n", KApplication::kde_cgidir().data());
+    printf("kde_confdir=\\"%s\\"\n", KApplication::kde_configdir().data());
+    printf("kde_mimedir=\\"%s\\"\n", KApplication::kde_mimedir().data());
+    printf("kde_toolbardir=\\"%s\\"\n", KApplication::kde_toolbardir().data());
+    printf("kde_wallpaperdir=\\"%s\\"\n",
+	KApplication::kde_wallpaperdir().data());
+    printf("kde_bindir=\\"%s\\"\n", KApplication::kde_bindir().data());
+    printf("kde_partsdir=\\"%s\\"\n", KApplication::kde_partsdir().data());
+    printf("kde_servicesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_servicetypesdir=\\"/tmp/dummy\\"\n");
+    printf("kde_moduledir=\\"/tmp/dummy\\"\n");
+    return 0;
+    }
+EOF
+
+ ac_compile='${CXX-g++} -c $CXXFLAGS $all_includes $CPPFLAGS conftest.$ac_ext'
+ if { (eval echo configure:6352: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+   echo "$ac_t""yes" 1>&6
+ else
+   { echo "configure: error: your system is not able to compile a small KDE application!
+Check, if you installed the KDE header files correctly.
+For more details about this problem, look at the end of config.log." 1>&2; exit 1; }
+  fi
+
+  ac_ext=c
+# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options.
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5'
+ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5'
+cross_compiling=$ac_cv_prog_cc_cross
+
+
+
+  KDE_TEST_RPATH=
+
+  if test -n "$USE_RPATH"; then
+
+     if test -n "$kde_libraries"; then
+       KDE_TEST_RPATH="-R $kde_libraries"
+     fi
+
+     if test -n "$qt_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $qt_libraries"
+     fi
+
+     if test -n "$x_libraries"; then
+       KDE_TEST_RPATH="$KDE_TEST_RPATH -R $x_libraries"
+     fi
+
+     KDE_TEST_RPATH="$KDE_TEST_RPATH $KDE_EXTRA_RPATH"
+  fi
+
+echo $ac_n "checking for KDE libraries installed""... $ac_c" 1>&6
+echo "configure:6389: checking for KDE libraries installed" >&5
+ac_link='$LIBTOOL_SHELL --silent --mode=link ${CXX-g++} -o conftest $CXXFLAGS $all_includes $CPPFLAGS $LDFLAGS $all_libraries conftest.$ac_ext $LIBS -lkdecore $LIBQT $KDE_TEST_RPATH 1>&5'
+
+if { (eval echo configure:6392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+  echo "$ac_t""yes" 1>&6
+else
+  { echo "configure: error: your system fails at linking a small KDE application!
+Check, if your compiler is installed correctly and if you have used the
+same compiler to compile Qt and kdelibs as you did use now.
+For more details about this problem, look at the end of config.log." 1>&2; exit 1; }
+fi
+
+if eval `KDEDIR= ./conftest 2>&5`; then
+  kde_result=done
+else
+  kde_result=problems
+fi
+
+KDEDIR= ./conftest 2> /dev/null >&5 # make an echo for config.log
+kde_have_all_paths=yes
+
+
+  kde_cv_all_paths="kde_have_all_paths=\"yes\" \
+	kde_htmldir=\"$kde_htmldir\" \
+	kde_appsdir=\"$kde_appsdir\" \
+	kde_icondir=\"$kde_icondir\" \
+	kde_sounddir=\"$kde_sounddir\" \
+	kde_datadir=\"$kde_datadir\" \
+	kde_locale=\"$kde_locale\" \
+	kde_cgidir=\"$kde_cgidir\" \
+	kde_confdir=\"$kde_confdir\" \
+	kde_mimedir=\"$kde_mimedir\" \
+	kde_toolbardir=\"$kde_toolbardir\" \
+	kde_wallpaperdir=\"$kde_wallpaperdir\" \
+	kde_templatesdir=\"$kde_templatesdir\" \
+	kde_bindir=\"$kde_bindir\" \
+	kde_servicesdir=\"$kde_servicesdir\" \
+	kde_servicetypesdir=\"$kde_servicetypesdir\" \
+	kde_moduledir=\"$kde_moduledir\" \
+	kde_result=$kde_result"
+
+
+
+  else
+     { echo "configure: error: path checking not yet supported for KDE 2" 1>&2; exit 1; }
+  fi
+
+fi
+
+  eval "$kde_cv_all_paths"
+   if test -z "$kde_htmldir" || test -z "$kde_appsdir" ||
+   test -z "$kde_icondir" || test -z "$kde_sounddir" ||
+   test -z "$kde_datadir" || test -z "$kde_locale"  ||
+   test -z "$kde_cgidir"  || test -z "$kde_confdir" ||
+   test -z "$kde_mimedir" || test -z "$kde_toolbardir" ||
+   test -z "$kde_wallpaperdir" || test -z "$kde_templatesdir" ||
+   test -z "$kde_bindir" || test -z "$kde_servicesdir" ||
+   test -z "$kde_servicetypesdir" || test -z "$kde_moduledir" ||
+   test "$kde_have_all_paths" != "yes"; then
+     kde_have_all_paths=no
+  fi
+
+  kde_result="$kde_result (cache overridden)"
+fi
+if test "$kde_have_all_paths" = "no"; then
+  { echo "configure: error: configure could not run a little KDE program to test the environment.
+Since it had compiled and linked before, it must be a strange problem on your system.
+Look at config.log for details. If you are not able to fix this, look at
+http://www.kde.org/faq/installation.html or any www.kde.org mirror.
+(If you're using an egcs version on Linux, you may update binutils!)
+" 1>&2; exit 1; }
+else
+  rm -f conftest*
+  echo "$ac_t""$kde_result" 1>&6
+fi
+
+bindir=$kde_bindir
+
+
+        kde_default_bindirs="/usr/bin /usr/local/bin /opt/local/bin /usr/X11R6/bin /opt/kde/bin /opt/kde2/bin /usr/kde/bin /usr/local/kde/bin"
+        if test -n "$KDEDIRS"; then
+           kde_save_IFS=$IFS
+           IFS=:
+           for dir in $KDEDIRS; do
+                kde_default_bindirs="$dir/bin $kde_default_bindirs "
+           done
+           IFS=$kde_save_IFS
+        fi
+        kde_default_bindirs="$exec_prefix/bin $prefix/bin $kde_default_bindirs"
+        
+   echo $ac_n "checking for dcopidl""... $ac_c" 1>&6
+echo "configure:6480: checking for dcopidl" >&5
+   if test -n "$DCOPIDL"; then
+        kde_cv_path="$DCOPIDL";
+   else
+        kde_cache=`echo dcopidl | sed 'y%./+-%__p_%'`
+
+        if eval "test \"`echo '$''{'kde_cv_path_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        kde_cv_path="NONE"
+	dirs="$kde_default_bindirs"
+	kde_save_IFS=$IFS
+	IFS=':'
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+        done
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/dcopidl"; then
+	    if test -n ""
+	    then
+              evalstr="$dir/dcopidl  2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/dcopidl"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/dcopidl"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        
+fi
+
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      echo "$ac_t""not found" 1>&6
+      
+    { echo "configure: error: The important program dcopidl was not found!
+Please check whether you installed KDE correctly.
+" 1>&2; exit 1; }
+
+   else
+      echo "$ac_t""$kde_cv_path" 1>&6
+      DCOPIDL=$kde_cv_path
+
+   fi
+
+        
+   echo $ac_n "checking for dcopidl2cpp""... $ac_c" 1>&6
+echo "configure:6540: checking for dcopidl2cpp" >&5
+   if test -n "$DCOPIDL2CPP"; then
+        kde_cv_path="$DCOPIDL2CPP";
+   else
+        kde_cache=`echo dcopidl2cpp | sed 'y%./+-%__p_%'`
+
+        if eval "test \"`echo '$''{'kde_cv_path_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        kde_cv_path="NONE"
+	dirs="$kde_default_bindirs"
+	kde_save_IFS=$IFS
+	IFS=':'
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+        done
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/dcopidl2cpp"; then
+	    if test -n ""
+	    then
+              evalstr="$dir/dcopidl2cpp  2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/dcopidl2cpp"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/dcopidl2cpp"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        
+fi
+
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      echo "$ac_t""not found" 1>&6
+      
+    { echo "configure: error: The important program dcopidl2cpp was not found!
+Please check whether you installed KDE correctly.
+" 1>&2; exit 1; }
+
+   else
+      echo "$ac_t""$kde_cv_path" 1>&6
+      DCOPIDL2CPP=$kde_cv_path
+
+   fi
+
+        
+   echo $ac_n "checking for mcopidl""... $ac_c" 1>&6
+echo "configure:6600: checking for mcopidl" >&5
+   if test -n "$MCOPIDL"; then
+        kde_cv_path="$MCOPIDL";
+   else
+        kde_cache=`echo mcopidl | sed 'y%./+-%__p_%'`
+
+        if eval "test \"`echo '$''{'kde_cv_path_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        kde_cv_path="NONE"
+	dirs="$kde_default_bindirs"
+	kde_save_IFS=$IFS
+	IFS=':'
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+        done
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/mcopidl"; then
+	    if test -n ""
+	    then
+              evalstr="$dir/mcopidl  2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/mcopidl"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/mcopidl"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        
+fi
+
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      echo "$ac_t""not found" 1>&6
+      
+    { echo "configure: error: The important program mcopidl was not found!
+Please check whether you installed KDE correctly.
+" 1>&2; exit 1; }
+
+   else
+      echo "$ac_t""$kde_cv_path" 1>&6
+      MCOPIDL=$kde_cv_path
+
+   fi
+
+        
+   echo $ac_n "checking for kdb2html""... $ac_c" 1>&6
+echo "configure:6660: checking for kdb2html" >&5
+   if test -n "$KDB2HTML"; then
+        kde_cv_path="$KDB2HTML";
+   else
+        kde_cache=`echo kdb2html | sed 'y%./+-%__p_%'`
+
+        if eval "test \"`echo '$''{'kde_cv_path_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        kde_cv_path="NONE"
+	dirs="$kde_default_bindirs"
+	kde_save_IFS=$IFS
+	IFS=':'
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+        done
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/kdb2html"; then
+	    if test -n ""
+	    then
+              evalstr="$dir/kdb2html  2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/kdb2html"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/kdb2html"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        
+fi
+
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      echo "$ac_t""not found" 1>&6
+      
+    { echo "configure: error: The important program kdb2html was not found!
+Please check whether you installed KDE correctly.
+" 1>&2; exit 1; }
+
+   else
+      echo "$ac_t""$kde_cv_path" 1>&6
+      KDB2HTML=$kde_cv_path
+
+   fi
+
+        
+   echo $ac_n "checking for artsc-config""... $ac_c" 1>&6
+echo "configure:6720: checking for artsc-config" >&5
+   if test -n "$ARTSCCONFIG"; then
+        kde_cv_path="$ARTSCCONFIG";
+   else
+        kde_cache=`echo artsc-config | sed 'y%./+-%__p_%'`
+
+        if eval "test \"`echo '$''{'kde_cv_path_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        kde_cv_path="NONE"
+	dirs="$kde_default_bindirs"
+	kde_save_IFS=$IFS
+	IFS=':'
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+        done
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/artsc-config"; then
+	    if test -n ""
+	    then
+              evalstr="$dir/artsc-config  2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/artsc-config"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/artsc-config"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        
+fi
+
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      echo "$ac_t""not found" 1>&6
+      
+    { echo "configure: error: The important program artsc-config was not found!
+Please check whether you installed KDE correctly.
+" 1>&2; exit 1; }
+
+   else
+      echo "$ac_t""$kde_cv_path" 1>&6
+      ARTSCCONFIG=$kde_cv_path
+
+   fi
+
+        
+   echo $ac_n "checking for kde-config""... $ac_c" 1>&6
+echo "configure:6780: checking for kde-config" >&5
+   if test -n "$KDECONFIG"; then
+        kde_cv_path="$KDECONFIG";
+   else
+        kde_cache=`echo kde-config | sed 'y%./+-%__p_%'`
+
+        if eval "test \"`echo '$''{'kde_cv_path_$kde_cache'+set}'`\" = set"; then
+  echo $ac_n "(cached) $ac_c" 1>&6
+else
+  
+        kde_cv_path="NONE"
+	dirs="$kde_default_bindirs"
+	kde_save_IFS=$IFS
+	IFS=':'
+	for dir in $PATH; do
+	  dirs="$dirs $dir"
+        done
+	IFS=$kde_save_IFS
+
+        for dir in $dirs; do
+	  if test -x "$dir/kde-config"; then
+	    if test -n ""
+	    then
+              evalstr="$dir/kde-config  2>&1 "
+	      if eval $evalstr; then
+                kde_cv_path="$dir/kde-config"
+                break
+	      fi
+            else
+		kde_cv_path="$dir/kde-config"
+                break
+	    fi
+          fi
+        done
+
+        eval "kde_cv_path_$kde_cache=$kde_cv_path"
+
+        
+fi
+
+
+      eval "kde_cv_path=\"`echo '$kde_cv_path_'$kde_cache`\""
+
+   fi
+
+   if test -z "$kde_cv_path" || test "$kde_cv_path" = NONE; then
+      echo "$ac_t""not found" 1>&6
+      
+    { echo "configure: error: The important program kde-config was not found!
+Please check whether you installed KDE correctly.
+" 1>&2; exit 1; }
+
+   else
+      echo "$ac_t""$kde_cv_path" 1>&6
+      KDECONFIG=$kde_cv_path
+
+   fi
+
+
+        DCOP_DEPENDENCIES='$(DCOPIDL)'
+        
+        
+        
+        
+        
+        
+        
+
+        if test -x "$KDECONFIG"; then # it can be "compiled"
+          kde_libs_prefix=`$KDECONFIG --prefix`
+          if test -z "$kde_libs_prefix" || test ! -x "$kde_libs_prefix"; then
+               { echo "configure: error: $KDECONFIG --prefix outputed the non existant prefix '$kde_libs_prefix' for kdelibs.
+                          This means it has been moved since you installed it.
+                          This won't work. Please recompile kdelibs for the new prefix.
+                          " 1>&2; exit 1; }
+           fi
+           kde_libs_htmldir=`$KDECONFIG --install html --expandvars`
+        else
+           kde_libs_prefix='$(prefix)'
+           kde_libs_htmldir='$(kde_htmldir)'
+        fi
+        
+        
+
+
+
+
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test "$kde_qtver" = 1; then
+  kde_minidir="$kde_icondir/mini"
+else
+# for KDE 1 - this breaks KDE2 apps using minidir, but
+# that's the plan ;-/
+  kde_minidir="/dev/null"
+fi
+
+  
+   
+   
+   
+
+if test $kde_qtver = 2; then
+   LIB_KDECORE='-lkdecore'
+   
+   LIB_KDEUI='-lkdeui'
+   
+   LIB_KFORMULA='-lkformula'
+   
+   LIB_KIO='-lkio'
+   
+   LIB_KSYCOCA='-lksycoca'
+   
+   LIB_SMB='-lsmb'
+   
+   LIB_KFILE='-lkfile'
+   
+   LIB_KAB='-lkab'
+   
+   LIB_KHTML='-lkhtml'
+   
+   LIB_KSPELL='-lkspell'
+   
+   LIB_KPARTS='-lkparts'
+   
+   LIB_KWRITE='-lkwrite'
+   
+else
+   LIB_KDECORE='-lkdecore -lXext $(LIB_QT)'
+   
+   LIB_KDEUI='-lkdeui $(LIB_KDECORE)'
+   
+   LIB_KFM='-lkfm $(LIB_KDECORE)'
+   
+   LIB_KFILE='-lkfile $(LIB_KFM) $(LIB_KDEUI)'
+   
+   LIB_KAB='-lkab $(LIB_KIMGIO) $(LIB_KDECORE)'
+   
+fi
+
+
+
+if test "$program_transform_name" = s,x,x,; then
+  program_transform_name=
+else
+  # Double any \ or $.  echo might interpret backslashes.
+  cat <<\EOF_SED > conftestsed
+s,\\,\\\\,g; s,\$,$$,g
+EOF_SED
+  program_transform_name="`echo $program_transform_name|sed -f conftestsed`"
+  rm -f conftestsed
+fi
+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"
+
+# sed with no file args requires a program.
+test "$program_transform_name" = "" && program_transform_name="s,x,x,"
+
+
+#MIN_CONFIG
+
+
+
+
+DO_NOT_COMPILE="$DO_NOT_COMPILE CVS debian bsd-port admin"
+
+if test ! -s $srcdir/subdirs; then
+    TOPSUBDIRS=""
+  files=`cd $srcdir && ls -1`
+  dirs=`for i in $files; do if test -d $i; then echo $i; fi; done`
+  for i in $dirs; do
+    echo $i >> $srcdir/subdirs
+  done
+fi
+
+if test -s $srcdir/inst-apps; then
+  ac_topsubdirs="`cat $srcdir/inst-apps`"
+else
+  ac_topsubdirs="`cat $srcdir/subdirs`"
+fi
+
+for i in $ac_topsubdirs; do
+  echo $ac_n "checking if $i should be compiled""... $ac_c" 1>&6
+echo "configure:6979: checking if $i should be compiled" >&5
+  if test -d $srcdir/$i; then
+    install_it="yes"
+    for j in $DO_NOT_COMPILE; do
+      if test $i = $j; then
+        install_it="no"
+      fi
+    done
+  else
+    install_it="no"
+  fi
+  echo "$ac_t""$install_it" 1>&6
+  if test $install_it = "yes"; then
+    TOPSUBDIRS="$TOPSUBDIRS $i"
+  fi
+done
+
+
+
+trap '' 1 2 15
+cat > confcache <<\EOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs.  It is not useful on other systems.
+# If it contains results you don't want to keep, you may remove or edit it.
+#
+# By default, configure uses ./config.cache as the cache file,
+# creating it if it does not exist already.  You can give configure
+# the --cache-file=FILE option to use a different cache file; that is
+# what configure does when it calls configure scripts in
+# subdirectories, so they share the cache.
+# Giving --cache-file=/dev/null disables caching, for debugging configure.
+# config.status only pays attention to the cache file if you give it the
+# --recheck option to rerun configure.
+#
+EOF
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, don't put newlines in cache variables' values.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(set) 2>&1 |
+  case `(ac_space=' '; set | grep ac_space) 2>&1` in
+  *ac_space=\ *)
+    # `set' does not quote correctly, so add quotes (double-quote substitution
+    # turns \\\\ into \\, and sed turns \\ into \).
+    sed -n \
+      -e "s/'/'\\\\''/g" \
+      -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p"
+    ;;
+  *)
+    # `set' quotes correctly as required by POSIX, so do not add quotes.
+    sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p'
+    ;;
+  esac >> confcache
+if cmp -s $cache_file confcache; then
+  :
+else
+  if test -w $cache_file; then
+    echo "updating cache $cache_file"
+    cat confcache > $cache_file
+  else
+    echo "not updating unwritable cache $cache_file"
+  fi
+fi
+rm -f confcache
+
+trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+# Any assignment to VPATH causes Sun make to only execute
+# the first set of double-colon rules, so remove it if not needed.
+# If there is a colon in the path, we need to keep it.
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[ 	]*VPATH[ 	]*=[^:]*$/d'
+fi
+
+trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15
+
+DEFS=-DHAVE_CONFIG_H
+
+# Without the "./", some shells look in PATH for config.status.
+: ${CONFIG_STATUS=./config.status}
+
+echo creating $CONFIG_STATUS
+rm -f $CONFIG_STATUS
+cat > $CONFIG_STATUS <<EOF
+#! /bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+#
+# $0 $ac_configure_args
+#
+# Compiler output produced by configure, useful for debugging
+# configure, is in ./config.log if it exists.
+
+ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]"
+for ac_option
+do
+  case "\$ac_option" in
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+    exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+  -version | --version | --versio | --versi | --vers | --ver | --ve | --v)
+    echo "$CONFIG_STATUS generated by autoconf version 2.13"
+    exit 0 ;;
+  -help | --help | --hel | --he | --h)
+    echo "\$ac_cs_usage"; exit 0 ;;
+  *) echo "\$ac_cs_usage"; exit 1 ;;
+  esac
+done
+
+ac_given_srcdir=$srcdir
+ac_given_INSTALL="$INSTALL"
+
+trap 'rm -fr `echo "\
+./Makefile \
+activemirrorcontrol/Makefile \
+doc/Makefile \
+doc/en/Makefile \
+po/Makefile \
+ config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+# Protect against being on the right side of a sed subst in config.status.
+sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g;
+ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF
+$ac_vpsub
+$extrasub
+s%@SHELL@%$SHELL%g
+s%@CFLAGS@%$CFLAGS%g
+s%@CPPFLAGS@%$CPPFLAGS%g
+s%@CXXFLAGS@%$CXXFLAGS%g
+s%@FFLAGS@%$FFLAGS%g
+s%@DEFS@%$DEFS%g
+s%@LDFLAGS@%$LDFLAGS%g
+s%@LIBS@%$LIBS%g
+s%@exec_prefix@%$exec_prefix%g
+s%@prefix@%$prefix%g
+s%@program_transform_name@%$program_transform_name%g
+s%@bindir@%$bindir%g
+s%@sbindir@%$sbindir%g
+s%@libexecdir@%$libexecdir%g
+s%@datadir@%$datadir%g
+s%@sysconfdir@%$sysconfdir%g
+s%@sharedstatedir@%$sharedstatedir%g
+s%@localstatedir@%$localstatedir%g
+s%@libdir@%$libdir%g
+s%@includedir@%$includedir%g
+s%@oldincludedir@%$oldincludedir%g
+s%@infodir@%$infodir%g
+s%@mandir@%$mandir%g
+s%@host@%$host%g
+s%@host_alias@%$host_alias%g
+s%@host_cpu@%$host_cpu%g
+s%@host_vendor@%$host_vendor%g
+s%@host_os@%$host_os%g
+s%@target@%$target%g
+s%@target_alias@%$target_alias%g
+s%@target_cpu@%$target_cpu%g
+s%@target_vendor@%$target_vendor%g
+s%@target_os@%$target_os%g
+s%@build@%$build%g
+s%@build_alias@%$build_alias%g
+s%@build_cpu@%$build_cpu%g
+s%@build_vendor@%$build_vendor%g
+s%@build_os@%$build_os%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@PACKAGE@%$PACKAGE%g
+s%@VERSION@%$VERSION%g
+s%@ACLOCAL@%$ACLOCAL%g
+s%@AUTOCONF@%$AUTOCONF%g
+s%@AUTOMAKE@%$AUTOMAKE%g
+s%@AUTOHEADER@%$AUTOHEADER%g
+s%@MAKEINFO@%$MAKEINFO%g
+s%@SET_MAKE@%$SET_MAKE%g
+s%@CONF_FILES@%$CONF_FILES%g
+s%@CC@%$CC%g
+s%@CPP@%$CPP%g
+s%@CXX@%$CXX%g
+s%@USE_EXCEPTIONS@%$USE_EXCEPTIONS%g
+s%@USE_RTTI@%$USE_RTTI%g
+s%@CXXCPP@%$CXXCPP%g
+s%@NOOPT_CXXFLAGS@%$NOOPT_CXXFLAGS%g
+s%@REPO@%$REPO%g
+s%@NOREPO@%$NOREPO%g
+s%@KDE_USE_FINAL_TRUE@%$KDE_USE_FINAL_TRUE%g
+s%@KDE_USE_FINAL_FALSE@%$KDE_USE_FINAL_FALSE%g
+s%@KDE_USE_CLOSURE_TRUE@%$KDE_USE_CLOSURE_TRUE%g
+s%@KDE_USE_CLOSURE_FALSE@%$KDE_USE_CLOSURE_FALSE%g
+s%@KDE_CXXFLAGS@%$KDE_CXXFLAGS%g
+s%@OBJEXT@%$OBJEXT%g
+s%@EXEEXT@%$EXEEXT%g
+s%@LN_S@%$LN_S%g
+s%@RANLIB@%$RANLIB%g
+s%@STRIP@%$STRIP%g
+s%@LIBTOOL@%$LIBTOOL%g
+s%@KDE_PLUGIN@%$KDE_PLUGIN%g
+s%@MSGFMT@%$MSGFMT%g
+s%@GMSGFMT@%$GMSGFMT%g
+s%@XGETTEXT@%$XGETTEXT%g
+s%@LIBCOMPAT@%$LIBCOMPAT%g
+s%@LIBCRYPT@%$LIBCRYPT%g
+s%@LIBSOCKET@%$LIBSOCKET%g
+s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g
+s%@LIBUCB@%$LIBUCB%g
+s%@LIBDL@%$LIBDL%g
+s%@X_INCLUDES@%$X_INCLUDES%g
+s%@X_LDFLAGS@%$X_LDFLAGS%g
+s%@x_libraries@%$x_libraries%g
+s%@x_includes@%$x_includes%g
+s%@LIBSM@%$LIBSM%g
+s%@X_PRE_LIBS@%$X_PRE_LIBS%g
+s%@LIB_X11@%$LIB_X11%g
+s%@USER_INCLUDES@%$USER_INCLUDES%g
+s%@USER_LDFLAGS@%$USER_LDFLAGS%g
+s%@LIBZ@%$LIBZ%g
+s%@LIBPNG@%$LIBPNG%g
+s%@LIBJPEG@%$LIBJPEG%g
+s%@qt_libraries@%$qt_libraries%g
+s%@qt_includes@%$qt_includes%g
+s%@QT_INCLUDES@%$QT_INCLUDES%g
+s%@QT_LDFLAGS@%$QT_LDFLAGS%g
+s%@MOC@%$MOC%g
+s%@UIC@%$UIC%g
+s%@LIB_QT@%$LIB_QT%g
+s%@KDE_EXTRA_RPATH@%$KDE_EXTRA_RPATH%g
+s%@KDE_RPATH@%$KDE_RPATH%g
+s%@kde_libraries@%$kde_libraries%g
+s%@kde_includes@%$kde_includes%g
+s%@KDE_LDFLAGS@%$KDE_LDFLAGS%g
+s%@KDE_INCLUDES@%$KDE_INCLUDES%g
+s%@all_includes@%$all_includes%g
+s%@all_libraries@%$all_libraries%g
+s%@AUTODIRS@%$AUTODIRS%g
+s%@DCOPIDL@%$DCOPIDL%g
+s%@DCOPIDL2CPP@%$DCOPIDL2CPP%g
+s%@DCOP_DEPENDENCIES@%$DCOP_DEPENDENCIES%g
+s%@MCOPIDL@%$MCOPIDL%g
+s%@KDB2HTML@%$KDB2HTML%g
+s%@ARTSCCONFIG@%$ARTSCCONFIG%g
+s%@KDECONFIG@%$KDECONFIG%g
+s%@kde_libs_prefix@%$kde_libs_prefix%g
+s%@kde_libs_htmldir@%$kde_libs_htmldir%g
+s%@kde_htmldir@%$kde_htmldir%g
+s%@kde_appsdir@%$kde_appsdir%g
+s%@kde_icondir@%$kde_icondir%g
+s%@kde_sounddir@%$kde_sounddir%g
+s%@kde_datadir@%$kde_datadir%g
+s%@kde_locale@%$kde_locale%g
+s%@kde_confdir@%$kde_confdir%g
+s%@kde_mimedir@%$kde_mimedir%g
+s%@kde_wallpaperdir@%$kde_wallpaperdir%g
+s%@kde_bindir@%$kde_bindir%g
+s%@kde_templatesdir@%$kde_templatesdir%g
+s%@kde_servicesdir@%$kde_servicesdir%g
+s%@kde_servicetypesdir@%$kde_servicetypesdir%g
+s%@kde_moduledir@%$kde_moduledir%g
+s%@LIB_KDECORE@%$LIB_KDECORE%g
+s%@LIB_KDEUI@%$LIB_KDEUI%g
+s%@LIB_KFORMULA@%$LIB_KFORMULA%g
+s%@LIB_KIO@%$LIB_KIO%g
+s%@LIB_KSYCOCA@%$LIB_KSYCOCA%g
+s%@LIB_SMB@%$LIB_SMB%g
+s%@LIB_KFILE@%$LIB_KFILE%g
+s%@LIB_KAB@%$LIB_KAB%g
+s%@LIB_KHTML@%$LIB_KHTML%g
+s%@LIB_KSPELL@%$LIB_KSPELL%g
+s%@LIB_KPARTS@%$LIB_KPARTS%g
+s%@LIB_KWRITE@%$LIB_KWRITE%g
+s%@LIB_KFM@%$LIB_KFM%g
+s%@TOPSUBDIRS@%$TOPSUBDIRS%g
+
+CEOF
+EOF
+
+cat >> $CONFIG_STATUS <<\EOF
+
+# Split the substitutions into bite-sized pieces for seds with
+# small command number limits, like on Digital OSF/1 and HP-UX.
+ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script.
+ac_file=1 # Number of current file.
+ac_beg=1 # First line for current file.
+ac_end=$ac_max_sed_cmds # Line after last line for current file.
+ac_more_lines=:
+ac_sed_cmds=""
+while $ac_more_lines; do
+  if test $ac_beg -gt 1; then
+    sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file
+  else
+    sed "${ac_end}q" conftest.subs > conftest.s$ac_file
+  fi
+  if test ! -s conftest.s$ac_file; then
+    ac_more_lines=false
+    rm -f conftest.s$ac_file
+  else
+    if test -z "$ac_sed_cmds"; then
+      ac_sed_cmds="sed -f conftest.s$ac_file"
+    else
+      ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file"
+    fi
+    ac_file=`expr $ac_file + 1`
+    ac_beg=$ac_end
+    ac_end=`expr $ac_end + $ac_max_sed_cmds`
+  fi
+done
+if test -z "$ac_sed_cmds"; then
+  ac_sed_cmds=cat
+fi
+EOF
+
+cat >> $CONFIG_STATUS <<EOF
+
+CONFIG_FILES=\${CONFIG_FILES-"\
+./Makefile \
+activemirrorcontrol/Makefile \
+doc/Makefile \
+doc/en/Makefile \
+po/Makefile \
+"}
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories.
+
+  # Remove last slash and all that follows it.  Not all systems have dirname.
+  ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+  if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+    # The file is in a subdirectory.
+    test ! -d "$ac_dir" && mkdir "$ac_dir"
+    ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`"
+    # A "../" for each directory in $ac_dir_suffix.
+    ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'`
+  else
+    ac_dir_suffix= ac_dots=
+  fi
+
+  case "$ac_given_srcdir" in
+  .)  srcdir=.
+      if test -z "$ac_dots"; then top_srcdir=.
+      else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;;
+  /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;;
+  *) # Relative path.
+    srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix"
+    top_srcdir="$ac_dots$ac_given_srcdir" ;;
+  esac
+
+  case "$ac_given_INSTALL" in
+  [/$]*) INSTALL="$ac_given_INSTALL" ;;
+"") ;;
+  *) INSTALL="$ac_dots$ac_given_INSTALL" ;;
+  esac
+
+  echo creating "$ac_file"
+  rm -f "$ac_file"
+  configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure."
+  case "$ac_file" in
+  *Makefile*) ac_comsub="1i\\
+# $configure_input" ;;
+  *) ac_comsub= ;;
+  esac
+
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  sed -e "$ac_comsub
+s%@configure_input@%$configure_input%g
+s%@srcdir@%$srcdir%g
+s%@top_srcdir@%$top_srcdir%g
+s%@INSTALL@%$INSTALL%g
+" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file
+fi; done
+rm -f conftest.s*
+
+# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where
+# NAME is the cpp macro being defined and VALUE is the value it is being given.
+#
+# ac_d sets the value in "#define NAME VALUE" lines.
+ac_dA='s%^\([ 	]*\)#\([ 	]*define[ 	][ 	]*\)'
+ac_dB='\([ 	][ 	]*\)[^ 	]*%\1#\2'
+ac_dC='\3'
+ac_dD='%g'
+# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE".
+ac_uA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_uB='\([ 	]\)%\1#\2define\3'
+ac_uC=' '
+ac_uD='\4%g'
+# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE".
+ac_eA='s%^\([ 	]*\)#\([ 	]*\)undef\([ 	][ 	]*\)'
+ac_eB='$%\1#\2define\3'
+ac_eC=' '
+ac_eD='%g'
+
+if test "${CONFIG_HEADERS+set}" != set; then
+EOF
+cat >> $CONFIG_STATUS <<EOF
+  CONFIG_HEADERS="config.h"
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+fi
+for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then
+  # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in".
+  case "$ac_file" in
+  *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'`
+       ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
+  *) ac_file_in="${ac_file}.in" ;;
+  esac
+
+  echo creating $ac_file
+
+  rm -f conftest.frag conftest.in conftest.out
+  ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"`
+  cat $ac_file_inputs > conftest.in
+
+EOF
+
+# Transform confdefs.h into a sed script conftest.vals that substitutes
+# the proper values into config.h.in to produce config.h.  And first:
+# Protect against being on the right side of a sed subst in config.status.
+# Protect against being in an unquoted here document in config.status.
+rm -f conftest.vals
+cat > conftest.hdr <<\EOF
+s/[\\&%]/\\&/g
+s%[\\$`]%\\&%g
+s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp
+s%ac_d%ac_u%gp
+s%ac_u%ac_e%gp
+EOF
+sed -n -f conftest.hdr confdefs.h > conftest.vals
+rm -f conftest.hdr
+
+# This sed command replaces #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+cat >> conftest.vals <<\EOF
+s%^[ 	]*#[ 	]*undef[ 	][ 	]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */%
+EOF
+
+# Break up conftest.vals because some shells have a limit on
+# the size of here documents, and old seds have small limits too.
+
+rm -f conftest.tail
+while :
+do
+  ac_lines=`grep -c . conftest.vals`
+  # grep -c gives empty output for an empty file on some AIX systems.
+  if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi
+  # Write a limited-size here document to conftest.frag.
+  echo '  cat > conftest.frag <<CEOF' >> $CONFIG_STATUS
+  sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS
+  echo 'CEOF
+  sed -f conftest.frag conftest.in > conftest.out
+  rm -f conftest.in
+  mv conftest.out conftest.in
+' >> $CONFIG_STATUS
+  sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail
+  rm -f conftest.vals
+  mv conftest.tail conftest.vals
+done
+rm -f conftest.vals
+
+cat >> $CONFIG_STATUS <<\EOF
+  rm -f conftest.frag conftest.h
+  echo "/* $ac_file.  Generated automatically by configure.  */" > conftest.h
+  cat conftest.in >> conftest.h
+  rm -f conftest.in
+  if cmp -s $ac_file conftest.h 2>/dev/null; then
+    echo "$ac_file is unchanged"
+    rm -f conftest.h
+  else
+    # Remove last slash and all that follows it.  Not all systems have dirname.
+      ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'`
+      if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then
+      # The file is in a subdirectory.
+      test ! -d "$ac_dir" && mkdir "$ac_dir"
+    fi
+    rm -f $ac_file
+    mv conftest.h $ac_file
+  fi
+fi; done
+
+EOF
+cat >> $CONFIG_STATUS <<EOF
+
+
+EOF
+cat >> $CONFIG_STATUS <<\EOF
+test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
+
+exit 0
+EOF
+if test "x$with_fast_perl" = "xyes" ; then
+  perl -i.bak $ac_aux_dir/conf.change.pl $CONFIG_STATUS || mv $CONFIG_STATUS.bak $CONFIG_STATUS; 
+  rm -f $CONFIG_STATUS.bak;
+fi 
+chmod +x $CONFIG_STATUS
+rm -fr confdefs* $ac_clean_files
+test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/configure.files
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/configure.files	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/configure.files	(revision 3401)
@@ -0,0 +1,2 @@
+./admin/configure.in.min
+configure.in.in
Index: trunk/MagicSoft/AMC/activemirrorcontrol/configure.in
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/configure.in	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/configure.in	(revision 3401)
@@ -0,0 +1,49 @@
+# Original Author was Kalle@kde.org
+# I lifted it in some mater. (Stephan Kulow)
+# I used much code from Janos Farkas
+
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(acinclude.m4) dnl a source file from your sub dir
+
+dnl This is so we can use kde-common
+AC_CONFIG_AUX_DIR(admin)
+
+AC_CANONICAL_SYSTEM 
+AC_ARG_PROGRAM
+
+dnl Automake doc recommends to do this only here. (Janos)
+AM_INIT_AUTOMAKE(activemirrorcontrol, 0.1) dnl searches for some needed programs
+
+KDE_SET_PREFIX
+
+dnl generate the config header
+AM_CONFIG_HEADER(config.h) dnl at the distribution this done
+
+dnl Checks for programs.
+AC_CHECK_COMPILERS
+AC_ENABLE_SHARED(yes)
+AC_ENABLE_STATIC(no)
+KDE_PROG_LIBTOOL
+
+dnl for NLS support. Call them in this order!
+dnl WITH_NLS is for the po files
+AM_KDE_WITH_NLS
+
+AC_PATH_KDE
+
+dnl Perform program name transformation
+AC_ARG_PROGRAM
+
+#MIN_CONFIG
+
+dnl PACKAGE set before
+
+KDE_CREATE_SUBDIRSLIST
+AC_OUTPUT( \
+./Makefile \
+activemirrorcontrol/Makefile \
+doc/Makefile \
+doc/en/Makefile \
+po/Makefile \
+)
Index: trunk/MagicSoft/AMC/activemirrorcontrol/configure.in.in
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/configure.in.in	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/configure.in.in	(revision 3401)
@@ -0,0 +1,4 @@
+#MIN_CONFIG
+
+AM_INIT_AUTOMAKE(activemirrorcontrol,0.1)
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/libtool
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/libtool	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/libtool	(revision 3401)
@@ -0,0 +1,5653 @@
+#! /bin/sh
+
+# libtool - Provide generalized library-building support services.
+# Generated automatically by ltconfig (GNU libtool 1.4a (1.641.2.179mm 2001/01/08 01:59:19))
+# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh.
+#
+# Copyright (C) 1996-2000 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="sed -e s/^X//"
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi
+
+# The names of the tagged configurations supported by this script.
+available_tags=" CXX"
+
+### BEGIN LIBTOOL CONFIG
+# Libtool was configured as follows, on host pc7:
+#
+# AR="" AR_FLAGS="" LTCC="gcc" CC="gcc" \
+# CFLAGS="-O2" CPPFLAGS="" \
+# MAGIC_CMD="" LD="/usr/i486-suse-linux/bin/ld" LDFLAGS="  " LIBS="" \
+# LN_S="ln -s" NM="/usr/bin/nm -B" RANLIB="ranlib" STRIP="strip" \
+# AS="" DLLTOOL="" OBJDUMP="" \
+# objext="" exeext="" reload_flag=" -r" \
+# deplibs_check_method="pass_all" \
+# file_magic_cmd="\$MAGIC_CMD" \
+#   admin/ltconfig --cache-file=./config.cache --disable-static --with-gcc --with-gnu-ld --enable-dlopen --no-verify --build=i686-pc-linux-gnu admin/ltmain.sh i686-pc-linux-gnu
+#
+# Compiler and other test output produced by ltconfig, useful for
+# debugging ltconfig, is in ./config.log if it exists.
+
+# The version of ltconfig that generated this script.
+LTCONFIG_VERSION="1.4a"
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/sh"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=yes
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=yes
+
+# Whether or not to build static libraries.
+build_old_libs=no
+
+# Whether or not to optimize for fast installation.
+fast_install=yes
+
+# The host system.
+host_alias=i686-pc-linux-gnu
+host=i686-pc-linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# A language-specific compiler.
+CC="gcc"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# The linker used to build libraries.
+LD="/usr/i486-suse-linux/bin/ld"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP=strip
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="dlltool"
+
+# Used on cygwin: object dumper.
+OBJDUMP="objdump"
+
+# Used on cygwin: assembler.
+AS="as"
+
+# The name of the directory that contains temporary libtool files.
+objdir=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC -DPIC"
+pic_mode=default
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation ?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=yes
+
+# Whether dlopen of programs is supported.
+dlopen_self=yes
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=no
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}.so\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
+old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+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"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects=""
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps=""
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=""
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGISTW]\\)[ 	][ 	]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=unsupported
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+### END LIBTOOL CONFIG
+
+# ltmain.sh - Provide generalized library-building support services.
+# NOTE: Changing this file will not affect anything until you rerun ltconfig.
+#
+# Copyright (C) 1996-2000, 2001 Free Software Foundation, Inc.
+# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Check that we have a working $echo.
+if test "X$1" = X--no-reexec; then
+  # Discard the --no-reexec flag, and continue.
+  shift
+elif test "X$1" = X--fallback-echo; then
+  # Avoid inline document here, it may be left over
+  :
+elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then
+  # Yippee, $echo works!
+  :
+else
+  # Restart under the correct shell, and then maybe $echo will work.
+  exec $SHELL "$0" --no-reexec ${1+"$@"}
+fi
+
+if test "X$1" = X--fallback-echo; then
+  # used as fallback echo
+  shift
+  cat <<EOF
+$*
+EOF
+  exit 0
+fi
+
+# The name of this program.
+progname=`$echo "$0" | sed 's%^.*/%%'`
+modename="$progname"
+
+# Constants.
+PROGRAM=ltmain.sh
+PACKAGE=libtool
+VERSION=1.4a
+TIMESTAMP=" (1.641.2.179mm 2001/02/15 21:55:40)"
+
+default_mode=
+help="Try \`$progname --help' for more information."
+magic="%%%MAGIC variable%%%"
+mkdir="mkdir"
+mv="mv -f"
+rm="rm -f"
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g'
+SP2NL='tr \040 \012'
+NL2SP='tr \015\012 \040\040'
+
+# NLS nuisances.
+# Only set LANG and LC_ALL to C if already set.
+# These must not be set unconditionally because not all systems understand
+# e.g. LANG=C (notably SCO).
+# We save the old values to restore during execute mode.
+if test "${LC_ALL+set}" = set; then
+  save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+  save_LANG="$LANG"; LANG=C; export LANG
+fi
+
+if test "$LTCONFIG_VERSION" != "$VERSION"; then
+  echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2
+  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit 1
+fi
+
+if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+  echo "$modename: not configured to build any kind of library" 1>&2
+  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+  exit 1
+fi
+
+# Global variables.
+mode=$default_mode
+nonopt=
+prev=
+prevopt=
+run=
+show="$echo"
+show_help=
+execute_dlfiles=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+
+# Parse our command line options once, thoroughly.
+while test $# -gt 0
+do
+  arg="$1"
+  shift
+
+  case "$arg" in
+  -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;;
+  *) optarg= ;;
+  esac
+
+  # If the previous option needs an argument, assign it.
+  if test -n "$prev"; then
+    case "$prev" in
+    execute_dlfiles)
+      execute_dlfiles="$execute_dlfiles $arg"
+      ;;
+    tag)
+      tagname="$arg"
+
+      # Check whether tagname contains only valid characters
+      case "$tagname" in
+      *[!-_A-Za-z0-9,/]*)
+	echo "$progname: invalid tag name: $tagname" 1>&2
+	exit 1
+        ;;
+      esac
+
+      if grep "^### BEGIN LIBTOOL TAG CONFIG: $tagname$" < "$0" > /dev/null; then
+        taglist="$taglist $tagname"
+	# Evaluate the configuration.
+	eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$tagname'$/,/^### END LIBTOOL TAG CONFIG: '$tagname'$/p' < $0`"
+      else
+	echo "$progname: ignoring unknown tag $tagname" 1>&2
+      fi
+      ;;
+    *)
+      eval "$prev=\$arg"
+      ;;
+    esac
+
+    prev=
+    prevopt=
+    continue
+  fi
+
+  # Have we seen a non-optional argument yet?
+  case "$arg" in
+  --help)
+    show_help=yes
+    ;;
+
+  --version)
+    echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"
+    exit 0
+    ;;
+
+  --config)
+    sed -n -e '/^### BEGIN LIBTOOL CONFIG/,/^### END LIBTOOL CONFIG/p' < "$0"
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      sed -n -e "/^### BEGIN LIBTOOL TAG CONFIG: $tagname$/,/^### END LIBTOOL TAG CONFIG: $tagname$/p" < "$0"
+    done
+    exit 0
+    ;;
+
+  --debug)
+    echo "$progname: enabling shell trace mode"
+    set -x
+    ;;
+
+  --dry-run | -n)
+    run=:
+    ;;
+
+  --features)
+    echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      echo "enable static libraries"
+    else
+      echo "disable static libraries"
+    fi
+    exit 0
+    ;;
+
+  --finish) mode="finish" ;;
+
+  --mode) prevopt="--mode" prev=mode ;;
+  --mode=*) mode="$optarg" ;;
+
+  --quiet | --silent)
+    show=:
+    ;;
+
+  --tag) prevopt="--tag" prev=tag ;;
+  --tag=*)
+    set tag "$optarg" ${1+"$@"}
+    shift
+    prev=tag
+    ;;
+
+  -dlopen)
+    prevopt="-dlopen"
+    prev=execute_dlfiles
+    ;;
+
+  -*)
+    $echo "$modename: unrecognized option \`$arg'" 1>&2
+    $echo "$help" 1>&2
+    exit 1
+    ;;
+
+  *)
+    nonopt="$arg"
+    break
+    ;;
+  esac
+done
+
+if test -n "$prevopt"; then
+  $echo "$modename: option \`$prevopt' requires an argument" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+fi
+
+if test -z "$show_help"; then
+
+  # Infer the operation mode.
+  if test -z "$mode"; then
+    case "$nonopt" in
+    *cc | *++ | gcc* | *-gcc*)
+      mode=link
+      for arg
+      do
+	case "$arg" in
+	-c)
+	   mode=compile
+	   break
+	   ;;
+	esac
+      done
+      ;;
+    *db | *dbx | *strace | *truss)
+      mode=execute
+      ;;
+    *install*|cp|mv)
+      mode=install
+      ;;
+    *rm)
+      mode=uninstall
+      ;;
+    *)
+      # If we have no mode, but dlfiles were specified, then do execute mode.
+      test -n "$execute_dlfiles" && mode=execute
+
+      # Just use the default operation mode.
+      if test -z "$mode"; then
+	if test -n "$nonopt"; then
+	  $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2
+	else
+	  $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2
+	fi
+      fi
+      ;;
+    esac
+  fi
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    $echo "$modename: unrecognized option \`-dlopen'" 1>&2
+    $echo "$help" 1>&2
+    exit 1
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$modename --help --mode=$mode' for more information."
+
+  # These modes are in order of execution frequency so that they run quickly.
+  case "$mode" in
+  # libtool compile mode
+  compile)
+    modename="$modename: compile"
+    # Get the compilation command and the source file.
+    base_compile=
+    prev=
+    lastarg=
+    srcfile="$nonopt"
+    suppress_output=
+
+    user_target=no
+    for arg
+    do
+      case "$prev" in
+      "") ;;
+      xcompiler)
+	# Aesthetically quote the previous argument.
+	prev=
+	lastarg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+
+	case "$arg" in
+	# Double-quote args containing other shell metacharacters.
+	# Many Bourne shells cannot handle close brackets correctly
+	# in scan sets, so we specify it separately.
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+
+	# Add the previous argument to base_compile.
+	if test -z "$base_compile"; then
+	  base_compile="$lastarg"
+	else
+	  base_compile="$base_compile $lastarg"
+	fi
+	continue
+	;;
+      esac
+
+      # Accept any command-line options.
+      case "$arg" in
+      -o)
+	if test "$user_target" != "no"; then
+	  $echo "$modename: you cannot specify \`-o' more than once" 1>&2
+	  exit 1
+	fi
+	user_target=next
+	;;
+
+      -static)
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Wc,*)
+	args=`$echo "X$arg" | $Xsed -e "s/^-Wc,//"`
+	lastarg=
+	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=','
+	for arg in $args; do
+	  IFS="$save_ifs"
+
+	  # Double-quote args containing other shell metacharacters.
+	  # Many Bourne shells cannot handle close brackets correctly
+	  # in scan sets, so we specify it separately.
+	  case "$arg" in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    arg="\"$arg\""
+	    ;;
+	  esac
+	  lastarg="$lastarg $arg"
+	done
+	IFS="$save_ifs"
+	lastarg=`$echo "X$lastarg" | $Xsed -e "s/^ //"`
+
+	# Add the arguments to base_compile.
+	if test -z "$base_compile"; then
+	  base_compile="$lastarg"
+	else
+	  base_compile="$base_compile $lastarg"
+	fi
+	continue
+	;;
+      esac
+
+      case "$user_target" in
+      next)
+	# The next one is the -o target name
+	user_target=yes
+	continue
+	;;
+      yes)
+	# We got the output file
+	user_target=set
+	libobj="$arg"
+	continue
+	;;
+      esac
+
+      # Accept the current argument as the source file.
+      lastarg="$srcfile"
+      srcfile="$arg"
+
+      # Aesthetically quote the previous argument.
+
+      # Backslashify any backslashes, double quotes, and dollar signs.
+      # These are the only characters that are still specially
+      # interpreted inside of double-quoted scrings.
+      lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"`
+
+      # Double-quote args containing other shell metacharacters.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      case "$lastarg" in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	lastarg="\"$lastarg\""
+	;;
+      esac
+
+      # Add the previous argument to base_compile.
+      if test -z "$base_compile"; then
+	base_compile="$lastarg"
+      else
+	base_compile="$base_compile $lastarg"
+      fi
+    done
+
+    case "$user_target" in
+    set)
+      ;;
+    no)
+      # Get the name of the library object.
+      libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'`
+      ;;
+    *)
+      $echo "$modename: you must specify a target with \`-o'" 1>&2
+      exit 1
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    xform='[cCFSfmso]'
+    case "$libobj" in
+    *.ada) xform=ada ;;
+    *.adb) xform=adb ;;
+    *.ads) xform=ads ;;
+    *.asm) xform=asm ;;
+    *.c++) xform=c++ ;;
+    *.cc) xform=cc ;;
+    *.class) xform=class ;;
+    *.cpp) xform=cpp ;;
+    *.cxx) xform=cxx ;;
+    *.f90) xform=f90 ;;
+    *.for) xform=for ;;
+    *.java) xform=java ;;
+    esac
+
+    libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
+
+    case "$libobj" in
+    *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;;
+    *)
+      $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2
+      exit 1
+      ;;
+    esac
+
+    # Infer tagged configuration to use if any are available and
+    # if one wasn't chosen via the "--tag" command line option.
+    # Only attempt this if the compiler in the base compile
+    # command doesn't match the default compiler.
+    if test -n "$available_tags" && test -z "$tagname"; then
+      case $base_compile in
+      "$CC "*) ;;
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when ltconfig was run.
+      "`$echo $CC` "*) ;;
+      *)
+        for z in $available_tags; do
+          if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+            case $base_compile in
+	    "$CC "*)
+              # The compiler in the base compile command matches
+              # the one in the tagged configuration.
+              # Assume this is the tagged configuration we want.
+              tagname=$z
+              break
+              ;;
+	    "`$echo $CC` "*)
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+          fi
+        done
+        # If $tagname still isn't set, then no tagged configuration
+        # was found and let the user know that the "--tag" command
+        # line option must be used.
+        if test -z "$tagname"; then
+          echo "$modename: unable to infer tagged configuration"
+          echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit 1
+#        else
+#          echo "$modename: using $tagname tagged configuration"
+        fi
+	;;
+      esac
+    fi
+
+    objname=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+    xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$xdir" = "X$obj"; then
+      xdir=
+    else
+      xdir=$xdir/
+    fi
+    lobj=${xdir}$objdir/$objname
+
+    if test -z "$base_compile"; then
+      $echo "$modename: you must specify a compilation command" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    $run $rm $removelist
+    trap "$run $rm $removelist; exit 1" 1 2 15
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case "$host_os" in
+    cygwin* | mingw* | pw32* | os2*)
+      pic_mode=default
+      ;;
+    esac
+    if test $pic_mode = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+      removelist="$removelist $output_obj $lockfile"
+      trap "$run $rm $removelist; exit 1" 1 2 15
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $run ln "$0" "$lockfile" 2>/dev/null; do
+	$show "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	echo "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+      echo $srcfile > "$lockfile"
+    fi
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+
+    $run $rm "$libobj" "${libobj}T"
+
+    # Create a libtool object file (analogous to a ".la" file),
+    # but don't create it if we're doing a dry run.
+    test -z "$run" && cat > ${libobj}T <<EOF
+# $libobj - a libtool object file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+EOF
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $srcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $srcfile"
+      fi
+
+      if test ! -d ${xdir}$objdir; then
+	$show "$mkdir ${xdir}$objdir"
+	$run $mkdir ${xdir}$objdir
+	status=$?
+	if test $status -ne 0 && test ! -d ${xdir}$objdir; then
+	  exit $status
+        fi
+      fi 
+
+      if test -z "$output_obj"; then
+        # Place PIC objects in $objdir
+        command="$command -o $lobj"
+      fi
+
+      $run $rm "$lobj" "$output_obj"
+
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	test -n "$output_obj" && $run $rm $removelist
+	exit 1
+      fi
+
+      if test "$need_locks" = warn &&
+	 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
+	echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "x$output_obj" != "x$lobj"; then
+	$show "$mv $output_obj $lobj"
+	if $run $mv $output_obj $lobj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the PIC object to the libtool object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object='$objdir/$objname'
+
+EOF
+
+      # Allow error messages only from the first compilation.
+      suppress_output=' >/dev/null 2>&1'
+    else
+      # No PIC object so indicate it doesn't exist in the libtool
+      # object file.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+pic_object=none
+
+EOF
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $srcfile"
+      else
+	command="$base_compile $srcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      $run $rm "$obj" "$output_obj"
+      $show "$command"
+      if $run eval "$command"; then :
+      else
+	$run $rm $removelist
+	exit 1
+      fi
+
+      if test "$need_locks" = warn &&
+	 test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then
+	echo "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$run $rm $removelist
+	exit 1
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "x$output_obj" != "x$obj"; then
+	$show "$mv $output_obj $obj"
+	if $run $mv $output_obj $obj; then :
+	else
+	  error=$?
+	  $run $rm $removelist
+	  exit $error
+	fi
+      fi
+
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object='$objname'
+
+EOF
+    else
+      # Append the name of the non-PIC object the libtool object file.
+      # Only append if the libtool object file exists.
+      test -z "$run" && cat >> ${libobj}T <<EOF
+# Name of the non-PIC object.
+non_pic_object=none
+
+EOF
+    fi
+
+    $run $mv "${libobj}T" "${libobj}"
+
+    # Unlock the critical section if it was locked
+    if test "$need_locks" != no; then
+      $run $rm "$lockfile"
+    fi
+
+    exit 0
+    ;;
+
+  # libtool link mode
+  link | relink)
+    modename="$modename: link"
+    case "$host" in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invokation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args="$nonopt"
+    base_compile="$nonopt"
+    compile_command="$nonopt"
+    finalize_command="$nonopt"
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+
+    avoid_version=no
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case "$arg" in
+      -all-static | -static)
+	if test "X$arg" = "X-all-static"; then
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	else
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	fi
+	build_libtool_libs=no
+	build_old_libs=yes
+	prefer_static_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test $# -gt 0; do
+      arg="$1"
+      base_compile="$base_compile $arg"
+      shift
+      case "$arg" in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	qarg=\"`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`\" ### testsuite: skip nested quoting test
+	;;
+      *) qarg=$arg ;;
+      esac
+      libtool_args="$libtool_args $qarg"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case "$prev" in
+	output)
+	  compile_command="$compile_command @OUTPUT@"
+	  finalize_command="$finalize_command @OUTPUT@"
+	  ;;
+	esac
+
+	case "$prev" in
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    compile_command="$compile_command @SYMFILE@"
+	    finalize_command="$finalize_command @SYMFILE@"
+	    preload=yes
+	  fi
+	  case "$arg" in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  if test ! -f "$arg"; then
+	    $echo "$modename: symbol file \`$arg' does not exist"
+	    exit 1
+	  fi
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case "$arg" in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    $echo "$modename: only absolute run-paths are allowed" 1>&2
+	    exit 1
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) rpath="$rpath $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) xrpath="$xrpath $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  compile_command="$compile_command $qarg"
+	  finalize_command="$finalize_command $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
+	  prev=
+	  compile_command="$compile_command $wl$qarg"
+	  finalize_command="$finalize_command $wl$qarg"
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi
+
+      prevarg="$arg"
+
+      case "$arg" in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  compile_command="$compile_command $link_static_flag"
+	  finalize_command="$finalize_command $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	$echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2
+	continue
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  $echo "$modename: not more than one -exported-symbols argument allowed"
+	  exit 1
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix*)
+	  compile_command="$compile_command $arg"
+	  finalize_command="$finalize_command $arg"
+	  ;;
+	esac
+	continue
+	;;
+       
+      -L*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-L//'`
+	# We need an absolute path.
+	case "$dir" in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  if test -z "$absdir"; then
+	    $echo "$modename: cannot determine absolute directory name of \`$dir'" 1>&2
+	    exit 1
+	  fi
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case "$host" in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case ":$dllsearchpath:" in
+	  *":$dir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "$arg" = "-lc"; then
+	  case "$host" in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	    # These systems don't actually have c library (as such)
+	    continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin*)
+	    # Darwin C library is in the System framework
+	    deplibs="$deplibs -framework System"
+	    ;;
+	  esac
+	elif test "$arg" = "-lm"; then
+	  case "$host" in
+	  *-*-cygwin* | *-*-pw32* | *-*-beos*)
+	    # These systems don't actually have math library (as such)
+	    continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin*)
+	    # Darwin math library is in the System framework
+	    deplibs="$deplibs -framework System"
+	    ;;
+	  esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case "$host" in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # in order for the loader to find any dlls it needs.
+	  $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
+	  $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
+	  fast_install=no
+	  ;;
+	*-*-rhapsody* | *-*-darwin*)
+	  # Darwin C library is in the System framework
+	  deplibs="$deplibs -framework System"
+	  ;;
+	*)
+	  no_install=yes
+	  ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	dir=`$echo "X$arg" | $Xsed -e 's/^-R//'`
+	# We need an absolute path.
+	case "$dir" in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  $echo "$modename: only absolute run-paths are allowed" 1>&2
+	  exit 1
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -static)
+        # The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+
+      -Wc,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wc,//'`
+	arg=
+	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case "$flag" in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Wl,*)
+	args=`$echo "X$arg" | $Xsed -e "$sed_quote_subst" -e 's/^-Wl,//'`
+	arg=
+	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+	  case "$flag" in
+	    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	    flag="\"$flag\""
+	    ;;
+	  esac
+	  arg="$arg $wl$flag"
+	  compiler_flags="$compiler_flags $wl$flag"
+	  linker_flags="$linker_flags $flag"
+	done
+	IFS="$save_ifs"
+	arg=`$echo "X$arg" | $Xsed -e "s/^ //"`
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      # Some other compiler flag.
+      -* | +*)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case "$arg" in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	;;
+
+      *.$objext)
+	# A standard object.
+	objs="$objs $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+          pic_object=
+          non_pic_object=
+
+          # Read the .lo file
+          # If there is no directory component, then add one.
+          case "$arg" in
+          */* | *\\*) . $arg ;;
+          *) . ./$arg ;;
+          esac
+
+          if test -z "$pic_object" || \
+             test -z "$non_pic_object" ||
+             test "$pic_object" = none && \
+             test "$non_pic_object" = none; then
+            $echo "$modename: cannot find name of object for \`$arg'" 1>&2
+            exit 1
+          fi
+
+	  # Extract subdirectory from the argument.
+	  xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	  if test "X$xdir" = "X$arg"; then
+	    xdir=
+	  else
+	    xdir="$xdir/"
+	  fi
+
+          if test "$pic_object" != none; then
+            # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+	        dlfiles="$dlfiles $pic_object"
+	        prev=
+	        continue
+	      else
+	        # If libtool objects are unsupported, then we need to preload.
+	        prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+            if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      dlprefiles="$dlprefiles $pic_object"
+	      prev=
+            fi
+
+            # A PIC object.
+	    libobjs="$libobjs $pic_object"
+	    arg="$pic_object"
+          fi
+
+          # Non-PIC object.
+          if test "$non_pic_object" != none; then
+            # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+            # A standard non-PIC object
+            non_pic_objects="$non_pic_objects $non_pic_object"
+            if test -z "$pic_object" || test "$pic_object" = none ; then
+              arg="$non_pic_object"
+            fi
+          fi
+        else
+          # Only an error if not doing a dry-run.
+          if test -z "$run"; then
+            $echo "$modename: \`$arg' is not a valid libtool object" 1>&2
+            exit 1
+          else
+            # Dry-run case.
+
+	    # Extract subdirectory from the argument.
+	    xdir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'`
+	    if test "X$xdir" = "X$arg"; then
+	      xdir=
+	    else
+	      xdir="$xdir/"
+	    fi
+
+            pic_object=`$echo "X${xdir}${objdir}/${arg}" | $Xsed -e "$lo2o"`
+            non_pic_object=`$echo "X${xdir}${arg}" | $Xsed -e "$lo2o"`
+	    libobjs="$libobjs $pic_object"
+            non_pic_objects="$non_pic_objects $non_pic_object"
+          fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	deplibs="$deplibs $arg"
+	old_deplibs="$old_deplibs $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  dlfiles="$dlfiles $arg"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  dlprefiles="$dlprefiles $arg"
+	  prev=
+	else
+	  deplibs="$deplibs $arg"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+	case "$arg" in
+	*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+	  arg="\"$arg\""
+	  ;;
+	esac
+	;;
+      esac
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	compile_command="$compile_command $arg"
+	finalize_command="$finalize_command $arg"
+      fi
+    done
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prevarg' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Infer tagged configuration to use if any are available and
+    # if one wasn't chosen via the "--tag" command line option.
+    # Only attempt this if the compiler in the base link
+    # command doesn't match the default compiler.
+    if test -n "$available_tags" && test -z "$tagname"; then
+      case $base_compile in
+      "$CC "*) ;;
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when ltconfig was run.
+      "`$echo $CC` "*) ;;
+      *)
+        for z in $available_tags; do
+          if grep "^### BEGIN LIBTOOL TAG CONFIG: $z$" < "$0" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`sed -n -e '/^### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^### END LIBTOOL TAG CONFIG: '$z'$/p' < $0`"
+            case $base_compile in
+	    "$CC "*)
+              # The compiler in $compile_command matches
+              # the one in the tagged configuration.
+              # Assume this is the tagged configuration we want.
+              tagname=$z
+              break
+	      ;;
+	    "`$echo $CC` "*)
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+          fi
+        done
+        # If $tagname still isn't set, then no tagged configuration
+        # was found and let the user know that the "--tag" command
+        # line option must be used.
+        if test -z "$tagname"; then
+          echo "$modename: unable to infer tagged configuration"
+          echo "$modename: specify a tag with \`--tag'" 1>&2
+	  exit 1
+#       else
+#         echo "$modename: using $tagname tagged configuration"
+        fi
+	;;
+      esac
+    fi
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      compile_command="$compile_command $arg"
+      finalize_command="$finalize_command $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'`
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$echo \"X\${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'`
+    if test "X$output_objdir" = "X$output"; then
+      output_objdir="$objdir"
+    else
+      output_objdir="$output_objdir/$objdir"
+    fi
+    # Create the object directory.
+    if test ! -d $output_objdir; then
+      $show "$mkdir $output_objdir"
+      $run $mkdir $output_objdir
+      status=$?
+      if test $status -ne 0 && test ! -d $output_objdir; then
+	exit $status
+      fi
+    fi
+
+    # Determine the type of output
+    case "$output" in
+    "")
+      $echo "$modename: you must specify an output file" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      case "$libs " in
+      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+      esac
+      libs="$libs $deplib"
+    done
+
+    if test $linkmode = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    uninst_deplibs= # uninstalled libtool libraries
+    uninst_path= # paths that contain uninstalled libtool libraries
+    case $linkmode in
+    lib)
+	passes="conv link"
+	for file in $dlfiles $dlprefiles; do
+	  case "$file" in
+	  *.la) ;;
+	  *)
+	    $echo "$modename: libraries can \`-dlopen' only libtool libraries: $file" 1>&2
+	    exit 1
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)	passes="conv"
+	;;
+    esac
+    for pass in $passes; do
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test $linkmode = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test $pass = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+      for deplib in $libs; do
+	lib=
+	found=no
+	case "$deplib" in
+	-l*)
+	  if test $linkmode != lib && test $linkmode != prog; then
+	    $echo "$modename: warning: \`-l' is ignored for archives/objects" 1>&2
+	    continue
+	  fi
+	  if test $pass = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  name=`$echo "X$deplib" | $Xsed -e 's/^-l//'`
+	  for searchdir in $newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path; do
+	    # Search the libtool library
+	    lib="$searchdir/lib${name}.la"
+	    if test -f "$lib"; then
+	      found=yes
+	      break
+	    fi
+	  done
+	  if test "$found" != yes; then
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test $linkmode = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  fi
+	  ;;
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test $pass = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    ;;
+	  prog)
+	    if test $pass = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test $pass = scan; then
+	      deplibs="$deplib $deplibs"
+	      newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    ;;
+	  *)
+	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
+	    ;;
+	  esac
+	  continue
+	  ;;
+	-R*)
+	  if test $pass = link; then
+	    dir=`$echo "X$deplib" | $Xsed -e 's/^-R//'`
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test $pass = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    if test "$deplibs_check_method" != pass_all; then
+	      echo
+	      echo "*** Warning: This library needs some functionality provided by $deplib."
+	      echo "*** I have the capability to make that library automatically link in when"
+	      echo "*** you link to this library.  But I can only do this if you have a"
+	      echo "*** shared version of the library, which you do not appear to have."
+	    else
+	      echo
+	      echo "*** Warning: Linking the shared library $output against the"
+	      echo "*** static library $deplib is not portable!"
+	      deplibs="$deplib $deplibs"
+	    fi
+	    continue
+	    ;;
+	  prog)
+	    if test $pass != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac
+	  ;;
+	*.lo | *.$objext)
+	  if test $pass = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test $linkmode = prog; then
+	    if test $pass = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      newdlprefiles="$newdlprefiles $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      newdlfiles="$newdlfiles $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac
+	if test $found = yes || test -f "$lib"; then :
+	else
+	  $echo "$modename: cannot find the library \`$lib'" 1>&2
+	  exit 1
+	fi
+
+	# Check to see that this really is a libtool archive.
+	if (sed -e '2q' $lib | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  exit 1
+	fi
+
+	ladir=`$echo "X$lib" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$ladir" = "X$lib" && ladir="."
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variable installed.
+	installed=yes
+
+	# Read the .la file
+	case "$lib" in
+	*/* | *\\*) . $lib ;;
+	*) . ./$lib ;;
+	esac
+
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test $linkmode != prog && test $linkmode != lib; }; then
+	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	fi
+
+	if test $pass = conv; then
+	  # only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	      exit 1
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    convenience="$convenience $ladir/$objdir/$old_library"
+	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	    tmp_libs=
+	    for deplib in $dependency_libs; do
+	      deplibs="$deplib $deplibs"
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	      tmp_libs="$tmp_libs $deplib"
+	    done
+	  elif test $linkmode != prog && test $linkmode != lib; then
+	    $echo "$modename: \`$lib' is not a convenience library" 1>&2
+	    exit 1
+	  fi
+	  continue
+	fi
+
+	# Get the name of the library we link against.
+	linklib=
+	for l in $old_library $library_names; do
+	  linklib="$l"
+	done
+	if test -z "$linklib"; then
+	  $echo "$modename: cannot find name of link library for \`$lib'" 1>&2
+	  exit 1
+	fi
+
+	# This library was specified with -dlopen.
+	if test $pass = dlopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlopen a convenience library: \`$lib'" 1>&2
+	    exit 1
+	  fi
+	  if test -z "$dlname" || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi
+
+	# We need an absolute path.
+	case "$ladir" in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    $echo "$modename: warning: cannot determine absolute directory name of \`$ladir'" 1>&2
+	    $echo "$modename: passing it literally to the linker, although it might fail" 1>&2
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	laname=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    $echo "$modename: warning: library \`$lib' was moved." 1>&2
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	else
+	  dir="$ladir/$objdir"
+	  absdir="$abs_ladir/$objdir"
+	  # Remove this search path later
+	  uninst_path="$uninst_path $abs_ladir"
+	fi
+	name=`$echo "X$laname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+
+	# This library was specified with -dlpreopen.
+	if test $pass = dlpreopen; then
+	  if test -z "$libdir"; then
+	    $echo "$modename: cannot -dlpreopen a convenience library: \`$lib'" 1>&2
+	    exit 1
+	  fi
+	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+	  # are required to link).
+	  if test -n "$old_library"; then
+	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+	  elif test -n "$dlname"; then
+	    newdlprefiles="$newdlprefiles $dir/$dlname"
+	  else
+	    newdlprefiles="$newdlprefiles $dir/$linklib"
+	  fi
+	fi
+
+	if test -z "$libdir"; then
+	  # link the convenience library
+	  if test $linkmode = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+	if test $linkmode = prog && test $pass != link; then
+	  newlib_search_path="$newlib_search_path $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case "$deplib" in
+	    -L*) newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`;; ### testsuite: skip nested quoting test
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test $linkalldeplibs = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    case "$tmp_libs " in
+	    *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	    esac
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+	  continue
+	fi
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { test "$hardcode_into_libs" != all || test "$alldeplibs" != yes; } &&
+	     { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var"; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath " in
+	      *" $dir "*) ;;
+	      *" $absdir "*) ;;
+	      *) temp_rpath="$temp_rpath $dir" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	if test -n "$library_names" &&
+	   { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
+	  if test "$installed" = no; then
+	    uninst_deplibs="$uninst_deplibs $lib"
+	    need_relink=yes
+	  fi
+	  # This is a shared library
+	  if test $linkmode = lib && test "$hardcode_into_libs" = all; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    realname="$2"
+	    shift; shift
+	    libname=`eval \\$echo \"$libname_spec\"`
+	    if test -n "$soname_spec"; then
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    newlib="libimp-`echo $soname | sed 's/^lib//;s/\.dll$//'`.a"
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      $show "extracting exported symbol list from \`$soname'"
+	      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+	      eval cmds=\"$extract_expsyms_cmds\"
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      $show "generating import library for \`$soname'"
+	      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+	      eval cmds=\"$old_archive_from_expsyms_cmds\"
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd" || exit $?
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi
+
+	  if test $linkmode = prog || test "$mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case "$hardcode_action" in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = no; then
+		case "$host" in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      $echo "$modename: configuration error: unsupported hardcode properties"
+	      exit 1
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case ":$compile_shlibpath:" in
+	      *":$add_shlibpath:"*) ;;
+	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test $linkmode = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes && \
+		 test "$hardcode_minus_L" != yes && \
+		 test "$hardcode_shlibpath_var" = yes; then
+		case ":$finalize_shlibpath:" in
+		*":$libdir:"*) ;;
+		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test $linkmode = prog || test "$mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case ":$finalize_shlibpath:" in
+	      *":$libdir:"*) ;;
+	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    fi
+
+	    if test $linkmode = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test $linkmode = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    echo
+	    echo "*** Warning: This library needs some functionality provided by $lib."
+	    echo "*** I have the capability to make that library automatically link in when"
+	    echo "*** you link to this library.  But I can only do this if you have a"
+	    echo "*** shared version of the library, which you do not appear to have."
+	  else
+	    convenience="$convenience $dir/$old_library"
+	    old_convenience="$old_convenience $dir/$old_library"
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi
+
+	if test $linkmode = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test "$hardcode_into_libs" = no || test $build_old_libs = yes ||
+	       test $link_static = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case "$libdir" in
+	      -R*) temp_xrpath=`$echo "X$libdir" | $Xsed -e 's/^-R//'`
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    case "$tmp_libs " in
+	    *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	    esac
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test $link_all_deplibs != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      case "$deplib" in
+	      -L*) path="$deplib" ;;
+	      *.la)
+		dir=`$echo "X$deplib" | $Xsed -e 's%/[^/]*$%%'`
+		test "X$dir" = "X$deplib" && dir="."
+		# We need an absolute path.
+		case "$dir" in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if grep "^installed=no" $deplib > /dev/null; then
+		  path="-L$absdir/$objdir"
+		else
+		  eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  if test -z "$libdir"; then
+		    $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		    exit 1
+		  fi
+		  if test "$absdir" != "$libdir"; then
+		    $echo "$modename: warning: \`$deplib' seems to be moved" 1>&2
+		  fi
+		  path="-L$absdir"
+		fi
+		;;
+	      *) continue ;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	    done
+	  fi
+	fi
+      done
+      dependency_libs="$newdependency_libs"
+      if test $pass = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test $pass != dlopen; then
+	if test $pass != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) lib_search_path="$lib_search_path $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Make sure that $var contains only unique libraries
+	  # and add them in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    case "$deplib" in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    *)
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case "$deplib" in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      esac
+	      ;;
+	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done
+      fi
+    done
+    if test $linkmode = prog; then
+      dlfiles="$newdlfiles"
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for archives" 1>&2
+      fi
+
+      if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	$echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2
+      fi
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case "$outputname" in
+      lib*)
+	name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'`
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	if test "$module" = no; then
+	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	  eval libname=\"$libname_spec\"
+	else
+	  libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  $echo "$modename: cannot build libtool library \`$output' from non-libtool objects on this host:$objs" 2>&1
+	  exit 1
+	else
+	  echo
+	  echo "*** Warning: Linking the shared library $output against the non-libtool"
+	  echo "*** objects $objs is not portable!"
+	  libobjs="$libobjs $objs"
+	fi
+      fi
+
+      if test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen self' is ignored for libtool libraries" 1>&2
+      fi
+
+      set dummy $rpath
+      if test $# -gt 2; then
+	$echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2
+      fi
+      install_libdir="$2"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+          # convenience libraries should have the same extension an
+          # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	if test -n "$vinfo"; then
+	  $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2
+	fi
+
+	if test -n "$release"; then
+	  $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2
+	fi
+      else
+
+	# Parse the version information argument.
+	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	IFS="$save_ifs"
+
+	if test -n "$8"; then
+	  $echo "$modename: too many parameters to \`-version-info'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+
+	current="$2"
+	revision="$3"
+	age="$4"
+
+	# Check that each of the things are valid numbers.
+	case "$current" in
+	0 | [1-9] | [1-9][0-9]*) ;;
+	*)
+	  $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	case "$revision" in
+	0 | [1-9] | [1-9][0-9]*) ;;
+	*)
+	  $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	case "$age" in
+	0 | [1-9] | [1-9][0-9]*) ;;
+	*)
+	  $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	if test $age -gt $current; then
+	  $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2
+	  $echo "$modename: \`$vinfo' is not valid version information" 1>&2
+	  exit 1
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case "$version_type" in
+	none) ;;
+
+	irix)
+	  major=`expr $current - $age + 1`
+	  verstring="sgi$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test $loop != 0; do
+	    iface=`expr $revision - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="sgi$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux)
+	  major=.`expr $current - $age`
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  major=`expr $current - $age`
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test $loop != 0; do
+	    iface=`expr $current - $loop`
+	    loop=`expr $loop - 1`
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  verstring="$verstring:${current}.0"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current";
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  major=`expr $current - $age`
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  $echo "$modename: unknown library version type \`$version_type'" 1>&2
+	  echo "Fatal configuration error.  See the $PACKAGE docs for more information." 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  verstring="0.0"
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+      fi
+
+      if test "$mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+        # may have been created when compiling PIC objects.
+        removelist=
+        tempremovelist=`echo "$output_objdir/*"`
+	for p in $tempremovelist; do
+          case "$p" in
+            *.$objext)
+               ;;
+            $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+               removelist="$removelist $p"
+               ;;
+            *) ;;
+          esac
+        done
+        if test -n "$removelist"; then
+	  $show "${rm}r $removelist"
+	  $run ${rm}r $removelist
+        fi
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      for path in $uninst_path; do
+	lib_search_path=`echo "$lib_search_path " | sed -e 's% $path % %g'`
+	deplibs=`echo "$deplibs " | sed -e 's% -L$path % %g'`
+	dependency_libs=`echo "$dependency_libs " | sed -e 's% -L$path % %g'`
+      done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if test "$hardcode_into_libs" = no || test $build_old_libs = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case "$host" in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *)
+ 	    # Add libc to deplibs on all other systems if necessary.
+ 	    if test $build_libtool_need_lc = "yes"; then
+ 	      deplibs="$deplibs -lc"
+ 	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case "$deplibs_check_method" in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behaviour.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $rm conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $rm conftest
+	  $LTCC -o conftest conftest.c $deplibs
+	  if test $? -eq 0 ; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      name="`expr $i : '-l\(.*\)'`"
+	      # If $name is empty we are operating on a -L argument.
+	      if test "$name" != "" -a "$name" != "0"; then
+		libname=`eval \\$echo \"$libname_spec\"`
+		deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		set dummy $deplib_matches
+		deplib_match=$2
+		if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		  newdeplibs="$newdeplibs $i"
+		else
+		  droppeddeps=yes
+		  echo
+		  echo "*** Warning: This library needs some functionality provided by $i."
+		  echo "*** I have the capability to make that library automatically link in when"
+		  echo "*** you link to this library.  But I can only do this if you have a"
+		  echo "*** shared version of the library, which you do not appear to have."
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  else
+	    # Error occured in the first compile.  Let's try to salvage the situation:
+	    # Compile a seperate program for each library.
+	    for i in $deplibs; do
+	      name="`expr $i : '-l\(.*\)'`"
+	     # If $name is empty we are operating on a -L argument.
+	      if test "$name" != "" -a "$name" != "0"; then
+		$rm conftest
+		$LTCC -o conftest conftest.c $i
+		# Did it work?
+		if test $? -eq 0 ; then
+		  ldd_output=`ldd conftest`
+		  libname=`eval \\$echo \"$libname_spec\"`
+		  deplib_matches=`eval \\$echo \"$library_names_spec\"`
+		  set dummy $deplib_matches
+		  deplib_match=$2
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    echo
+		    echo "*** Warning: This library needs some functionality provided by $i."
+		    echo "*** I have the capability to make that library automatically link in when"
+		    echo "*** you link to this library.  But I can only do this if you have a"
+		    echo "*** shared version of the library, which you do not appear to have."
+		  fi
+		else
+		  droppeddeps=yes
+		  echo
+		  echo "*** Warning!  Library $i is needed by this library but I was not able to"
+		  echo "***  make it link in!  You will probably need to install it or some"
+		  echo "*** library that it depends on before this library will be fully"
+		  echo "*** functional.  Installing it before continuing would be even better."
+		fi
+	      else
+		newdeplibs="$newdeplibs $i"
+	      fi
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method
+	  file_magic_regex=`expr "$deplibs_check_method" : "$2 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    name="`expr $a_deplib : '-l\(.*\)'`"
+	    # If $name is empty we are operating on a -L argument.
+	    if test "$name" != "" -a "$name" != "0"; then
+	      libname=`eval \\$echo \"$libname_spec\"`
+	      for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		    potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		    for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null \
+			 | grep " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | sed 's/.* -> //'`
+			case "$potliblink" in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \
+			 | sed 10q \
+			 | egrep "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		    done
+	      done
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		echo
+		echo "*** Warning: This library needs some functionality provided by $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have."
+	      fi
+	    else
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	    fi
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \
+	       -e 's/ -[LR][^ ]*//g' -e 's/[ 	]//g' |
+	     grep . >/dev/null; then
+	    echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	  fi
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    echo
+	    echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    echo "*** dependencies of module $libname.  Therefore, libtool will create"
+	    echo "*** a static module, that should work as long as the dlopening"
+	    echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      echo
+	      echo "*** However, this would only work if libtool was able to extract symbol"
+	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** not find such a program.  So, this module is probably useless."
+	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    echo "*** The inter-library dependencies that have been dropped here will be"
+	    echo "*** automatically added whenever a program is linked with this library"
+	    echo "*** or is declared to -dlopen it."
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	if test "$hardcode_into_libs" != no; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		dep_rpath="$dep_rpath $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      rpath="$rpath$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath="$finalize_shlibpath"
+	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	realname="$2"
+	shift; shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+
+	lib="$output_objdir/$realname"
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+#	# Ensure that we have .o objects for linkers which dislike .lo
+#	# (e.g. aix) in case we are running --disable-static
+#	for obj in $libobjs; do
+#	  xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'`
+#	  if test "X$xdir" = "X$obj"; then
+#	    xdir="."
+#	  else
+#	    xdir="$xdir"
+#	  fi
+#	  baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'`
+#	  oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+#	  if test ! -f $xdir/$oldobj && test "$baseobj" != "$oldobj"; then
+#	    $show "(cd $xdir && ${LN_S} $baseobj $oldobj)"
+#	    $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $?
+#	  fi
+#	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP`
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    $show "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $run $rm $export_symbols
+	    eval cmds=\"$export_symbols_cmds\"
+	    IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      $show "$cmd"
+	      $run eval "$cmd" || exit $?
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex"; then
+	      $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\""
+	      $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      $show "$mv \"${export_symbols}T\" \"$export_symbols\""
+	      $run eval '$mv "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"'
+	fi
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    $show "${rm}r $gentop"
+	    $run ${rm}r "$gentop"
+	    $show "$mkdir $gentop"
+	    $run $mkdir "$gentop"
+	    status=$?
+	    if test $status -ne 0 && test ! -d "$gentop"; then
+	      exit $status
+	    fi
+	    generated="$generated $gentop"
+
+	    for xlib in $convenience; do
+	      # Extract the objects.
+	      case "$xlib" in
+	      [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	      *) xabs=`pwd`"/$xlib" ;;
+	      esac
+	      xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	      xdir="$gentop/$xlib"
+
+	      $show "${rm}r $xdir"
+	      $run ${rm}r "$xdir"
+	      $show "$mkdir $xdir"
+	      $run $mkdir "$xdir"
+	      status=$?
+	      if test $status -ne 0 && test ! -d "$xdir"; then
+		exit $status
+	      fi
+	      $show "(cd $xdir && $AR x $xabs)"
+	      $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+	      libobjs="$libobjs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+	    done
+	  fi
+	fi
+
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink && test "$hardcode_into_libs" = all; then
+	  $run eval '(cd $output_objdir && $rm ${realname}U && $mv $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	  eval cmds=\"$archive_expsym_cmds\"
+	else
+	  eval cmds=\"$archive_cmds\"
+	fi
+	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink && test "$hardcode_into_libs" = all; then
+	  $run eval '(cd $output_objdir && $rm ${realname}T && $mv $realname ${realname}T && $mv "$realname"U $realname)' || exit $?
+	  exit 0
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)"
+	    $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $?
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$deplibs"; then
+	$echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2
+      fi
+
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	$echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$rpath"; then
+	$echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$xrpath"; then
+	$echo "$modename: warning: \`-R' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for objects" 1>&2
+      fi
+
+      case "$output" in
+      *.lo)
+	if test -n "$objs$old_deplibs"; then
+	  $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2
+	  exit 1
+	fi
+	libobj="$output"
+	obj=`$echo "X$output" | $Xsed -e "$lo2o"`
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $run $rm $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
+	else
+	  gentop="$output_objdir/${obj}x"
+	  $show "${rm}r $gentop"
+	  $run ${rm}r "$gentop"
+	  $show "$mkdir $gentop"
+	  $run $mkdir "$gentop"
+	  status=$?
+	  if test $status -ne 0 && test ! -d "$gentop"; then
+	    exit $status
+	  fi
+	  generated="$generated $gentop"
+
+	  for xlib in $convenience; do
+	    # Extract the objects.
+	    case "$xlib" in
+	    [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	    *) xabs=`pwd`"/$xlib" ;;
+	    esac
+	    xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	    xdir="$gentop/$xlib"
+
+	    $show "${rm}r $xdir"
+	    $run ${rm}r "$xdir"
+	    $show "$mkdir $xdir"
+	    $run $mkdir "$xdir"
+	    status=$?
+	    if test $status -ne 0 && test ! -d "$xdir"; then
+	      exit $status
+	    fi
+	    $show "(cd $xdir && $AR x $xabs)"
+	    $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+	    reload_conv_objs="$reload_objs "`find $xdir -name \*.$objext -print -o -name \*.lo -print | $NL2SP`
+	  done
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      eval cmds=\"$reload_cmds\"
+      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	exit 0
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  $show "${rm}r $gentop"
+	  $run ${rm}r $gentop
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $run eval "echo timestamp > $libobj" || exit $?
+	exit 0
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	eval cmds=\"$reload_cmds\"
+	IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  $show "$cmd"
+	  $run eval "$cmd" || exit $?
+	done
+	IFS="$save_ifs"
+#     else
+#	# Just create a symlink.
+#	$show $rm $libobj
+#	$run $rm $libobj
+#	xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'`
+#	if test "X$xdir" = "X$libobj"; then
+#	  xdir="."
+#	else
+#	  xdir="$xdir"
+#	fi
+#	baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'`
+#	oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"`
+#	$show "(cd $xdir && $LN_S $oldobj $baseobj)"
+#	$run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $?
+      fi
+
+      if test -n "$gentop"; then
+	$show "${rm}r $gentop"
+	$run ${rm}r $gentop
+      fi
+
+      exit 0
+      ;;
+
+    prog)
+      if test -n "$vinfo"; then
+	$echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2
+      fi
+
+      if test -n "$release"; then
+	$echo "$modename: warning: \`-release' is ignored for programs" 1>&2
+      fi
+
+      if test "$preload" = yes; then
+	if test "$dlopen_support" = unknown && test "$dlopen_self" = unknown &&
+	   test "$dlopen_self_static" = unknown; then
+	  $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support."
+	fi
+      fi
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  esac
+	fi
+	case "$host" in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
+	  case ":$dllsearchpath:" in
+	  *":$libdir:"*) ;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      dlsyms=
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	  dlsyms="${outputname}S.c"
+	else
+	  $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2
+	fi
+      fi
+
+      if test -n "$dlsyms"; then
+	case "$dlsyms" in
+	"") ;;
+	*.c)
+	  # Discover the nlist of each of the dlfiles.
+	  nlist="$output_objdir/${outputname}.nm"
+
+	  $show "$rm $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Parse the name list into a source file.
+	  $show "creating $output_objdir/$dlsyms"
+
+	  test -z "$run" && $echo > "$output_objdir/$dlsyms" "\
+/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */
+/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+/* Prevent the only kind of declaration conflicts we can make. */
+#define lt_preloaded_symbols some_other_symbol
+
+/* External symbol declarations for the compiler. */\
+"
+
+	  if test "$dlself" = yes; then
+	    $show "generating symbol list for \`$output'"
+
+	    test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist"
+
+	    # Add our own program objects to the symbol list.
+	    progfiles="$objs$old_deplibs"
+	    for arg in $progfiles; do
+	      $show "extracting global C symbols from \`$arg'"
+	      $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	    done
+
+	    if test -n "$exclude_expsyms"; then
+	      $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    if test -n "$export_symbols_regex"; then
+	      $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      $run eval '$mv "$nlist"T "$nlist"'
+	    fi
+
+	    # Prepare the list of exported symbols
+	    if test -z "$export_symbols"; then
+	      export_symbols="$output_objdir/$output.exp"
+	      $run $rm $export_symbols
+	      $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	    else
+	      $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"'
+	      $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T'
+	      $run eval 'mv "$nlist"T "$nlist"'
+	    fi
+	  fi
+
+	  for arg in $dlprefiles; do
+	    $show "extracting global C symbols from \`$arg'"
+	    name=`echo "$arg" | sed -e 's%^.*/%%'`
+	    $run eval 'echo ": $name " >> "$nlist"'
+	    $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -z "$run"; then
+	    # Make sure we have at least an empty file.
+	    test -f "$nlist" || : > "$nlist"
+
+	    if test -n "$exclude_expsyms"; then
+	      egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	      $mv "$nlist"T "$nlist"
+	    fi
+
+	    # Try sorting and uniquifying the output.
+	    if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then
+	      :
+	    else
+	      grep -v "^: " < "$nlist" > "$nlist"S
+	    fi
+
+	    if test -f "$nlist"S; then
+	      eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"'
+	    else
+	      echo '/* NONE */' >> "$output_objdir/$dlsyms"
+	    fi
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+
+#undef lt_preloaded_symbols
+
+#if defined (__STDC__) && __STDC__
+# define lt_ptr_t void *
+#else
+# define lt_ptr_t char *
+# define const
+#endif
+
+/* The mapping between symbol names and symbols. */
+const struct {
+  const char *name;
+  lt_ptr_t address;
+}
+lt_preloaded_symbols[] =
+{\
+"
+
+	    sed -n -e 's/^: \([^ ]*\) $/  {\"\1\", (lt_ptr_t) 0},/p' \
+		-e 's/^. \([^ ]*\) \([^ ]*\)$/  {"\2", (lt_ptr_t) \&\2},/p' \
+		  < "$nlist" >> "$output_objdir/$dlsyms"
+
+	    $echo >> "$output_objdir/$dlsyms" "\
+  {0, (lt_ptr_t) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	  fi
+
+	  pic_flag_for_symtable=
+	  case "$host" in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND";;
+	    esac;;
+	  *-*-hpux*)
+	    case "$compile_command " in
+	    *" -static "*) ;;
+	    *) pic_flag_for_symtable=" $pic_flag";;
+	    esac
+	  esac
+
+	  # Now compile the dynamic symbol file.
+	  $show "(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")"
+	  $run eval '(cd $output_objdir && $LTCC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $?
+
+	  # Clean up the generated files.
+	  $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T"
+	  $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T"
+
+	  # Transform the symbol file into the correct name.
+	  compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+	  ;;
+	*)
+	  $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2
+	  exit 1
+	  ;;
+	esac
+      else
+	# We keep going just in case the user didn't refer to
+	# lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+	# really was required.
+
+	# Nullify the symbol file.
+	compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+	finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
+      fi
+
+      # AIX runtime linking requires linking programs with -Wl,-brtl and libs with -Wl,-G
+      case "$host" in
+        *-*-aix4*) compile_command="$compile_command $wl-brtl"
+                   finalize_command="$finalize_command $wl-brtl" ;;
+      esac
+
+      if test $need_relink = no || test "$build_libtool_libs" != yes; then
+	# Replace the output file specification.
+	compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	link_command="$compile_command$compile_rpath"
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	$show "$link_command"
+	$run eval "$link_command"
+	status=$?
+
+	# Delete the generated files.
+	if test -n "$dlsyms"; then
+	  $show "$rm $output_objdir/${outputname}S.${objext}"
+	  $run $rm "$output_objdir/${outputname}S.${objext}"
+	fi
+
+	exit $status
+      fi
+
+      if test -n "$shlibpath_var"; then
+	# We should set the shlibpath_var
+	rpath=
+	for dir in $temp_rpath; do
+	  case "$dir" in
+	  [\\/]* | [A-Za-z]:[\\/]*)
+	    # Absolute path.
+	    rpath="$rpath$dir:"
+	    ;;
+	  *)
+	    # Relative path: add a thisdir entry.
+	    rpath="$rpath\$thisdir/$dir:"
+	    ;;
+	  esac
+	done
+	temp_rpath="$rpath"
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$run $rm $output
+	# Link the executable and exit
+	$show "$link_command"
+	$run eval "$link_command" || exit $?
+	exit 0
+      fi
+
+      if test "$hardcode_action" = relink || test "$hardcode_into_libs" = all; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	$echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2
+	$echo "$modename: \`$output' will be relinked during installation" 1>&2
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      $show "$link_command"
+      $run eval "$link_command" || exit $?
+
+      # Now create the wrapper script.
+      $show "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	    relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	  fi
+	done
+	relink_command="cd `pwd`; $relink_command"
+	relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Quote $echo for shipping.
+      if test "X$echo" = "X$SHELL $0 --fallback-echo"; then
+	case "$0" in
+	[\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";;
+	*) qecho="$SHELL `pwd`/$0 --fallback-echo";;
+	esac
+	qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"`
+      else
+	qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if our run command is non-null.
+      if test -z "$run"; then
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) output=`echo $output|sed 's,.exe$,,'` ;;
+	esac
+	$rm $output
+	trap "$rm $output; exit 1" 1 2 15
+
+	$echo > $output "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed='sed -e 1s/^X//'
+sed_quote_subst='$sed_quote_subst'
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variable:
+  uninst_deplibs='$uninst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$echo are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    echo=\"$qecho\"
+    file=\"\$0\"
+    # Make sure echo works.
+    if test \"X\$1\" = X--no-reexec; then
+      # Discard the --no-reexec flag, and continue.
+      shift
+    elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then
+      # Yippee, \$echo works!
+      :
+    else
+      # Restart under the correct shell, and then maybe \$echo will work.
+      exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"}
+    fi
+  fi\
+"
+	$echo >> $output "\
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\`
+  done
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  echo >> $output "\
+  program=lt-'$outputname'
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" || \\
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $mkdir \"\$progdir\"
+    else
+      $rm \"\$progdir/\$file\"
+    fi"
+
+	  echo >> $output "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if (eval \$relink_command); then :
+      else
+	$rm \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $rm \"\$progdir/\$program\";
+      $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $rm \"\$progdir/\$file\"
+  fi"
+	else
+	  echo >> $output "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	echo >> $output "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $echo >> $output "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $echo >> $output "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$echo >> $output "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+"
+	case $host in
+	# win32 systems need to use the prog path for dll
+	# lookup to work
+	*-*-cygwin* | *-*-pw32*)
+	  $echo >> $output "\
+      exec \$progdir/\$program \${1+\"\$@\"}
+"
+	  ;;
+
+	# Backslashes separate directories on plain windows
+	*-*-mingw | *-*-os2*)
+	  $echo >> $output "\
+      exec \$progdir\\\\\$program \${1+\"\$@\"}
+"
+	  ;;
+
+	*)
+	  $echo >> $output "\
+      # Export the path to the program.
+      PATH=\"\$progdir:\$PATH\"
+      export PATH
+
+      exec \$program \${1+\"\$@\"}
+"
+	  ;;
+	esac
+	$echo >> $output "\
+      \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
+      exit 1
+    fi
+  else
+    # The program doesn't exist.
+    \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2
+    \$echo \"This script is just a wrapper for \$program.\" 1>&2
+    echo \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+	chmod +x $output
+      fi
+      exit 0
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$objs$old_deplibs $non_pic_objects"
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	$show "${rm}r $gentop"
+	$run ${rm}r "$gentop"
+	$show "$mkdir $gentop"
+	$run $mkdir "$gentop"
+	status=$?
+	if test $status -ne 0 && test ! -d "$gentop"; then
+	  exit $status
+	fi
+	generated="$generated $gentop"
+
+	# Add in members from convenience archives.
+	for xlib in $addlibs; do
+	  # Extract the objects.
+	  case "$xlib" in
+	  [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;;
+	  *) xabs=`pwd`"/$xlib" ;;
+	  esac
+	  xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'`
+	  xdir="$gentop/$xlib"
+
+	  $show "${rm}r $xdir"
+	  $run ${rm}r "$xdir"
+	  $show "$mkdir $xdir"
+	  $run $mkdir "$xdir"
+	  status=$?
+	  if test $status -ne 0 && test ! -d "$xdir"; then
+	    exit $status
+	  fi
+	  $show "(cd $xdir && $AR x $xabs)"
+	  $run eval "(cd \$xdir && $AR x \$xabs)" || exit $?
+
+	  oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print | $NL2SP`
+	done
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+	eval cmds=\"$old_archive_from_new_cmds\"
+      else
+#	# Ensure that we have .o objects in place in case we decided
+#	# not to build a shared library, and have fallen back to building
+#	# static libs even though --disable-static was passed!
+#	for oldobj in $oldobjs; do
+#	  if test ! -f $oldobj; then
+#	    xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'`
+#	    if test "X$xdir" = "X$oldobj"; then
+#	      xdir="."
+#	    else
+#	      xdir="$xdir"
+#	    fi
+#	    baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'`
+#	    obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"`
+#	    $show "(cd $xdir && ${LN_S} $obj $baseobj)"
+#	    $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $?
+#	  fi
+#	done
+
+	eval cmds=\"$old_archive_cmds\"
+      fi
+      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$generated"; then
+      $show "${rm}r$generated"
+      $run ${rm}r$generated
+    fi
+
+    # Now create the libtool archive.
+    case "$output" in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      $show "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  var_value=`$echo "X$var_value" | $Xsed -e "$sed_quote_subst"`
+	  relink_command="$var=\"$var_value\"; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="cd `pwd`; $SHELL $0 --mode=relink $libtool_args"
+      relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
+
+      # Only create the output if not a dry run.
+      if test -z "$run"; then
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case "$deplib" in
+	      *.la)
+		name=`$echo "X$deplib" | $Xsed -e 's%^.*/%%'`
+		eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		if test -z "$libdir"; then
+		  $echo "$modename: \`$deplib' is not a valid libtool archive" 1>&2
+		  exit 1
+		fi
+		newdependency_libs="$newdependency_libs $libdir/$name"
+		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit 1
+	      fi
+	      newdlfiles="$newdlfiles $libdir/$name"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      name=`$echo "X$lib" | $Xsed -e 's%^.*/%%'`
+	      eval libdir=`sed -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+	      if test -z "$libdir"; then
+		$echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+		exit 1
+	      fi
+	      newdlprefiles="$newdlprefiles $libdir/$name"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $rm $output
+	  $echo > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$dlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test $hardcode_into_libs = all &&
+	     test "$installed" = no && test $need_relink = yes; then
+	    $echo >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      fi
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)"
+      $run eval '(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)' || exit $?
+      ;;
+    esac
+    exit 0
+    ;;
+
+  # libtool install mode
+  install)
+    modename="$modename: install"
+
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       $echo "X$nonopt" | $Xsed | grep shtool > /dev/null; then
+      # Aesthetically quote it.
+      arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"`
+      case "$arg" in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$arg "
+      arg="$1"
+      shift
+    else
+      install_prog=
+      arg="$nonopt"
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+    case "$arg" in
+    *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+      arg="\"$arg\""
+      ;;
+    esac
+    install_prog="$install_prog$arg"
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    for arg
+    do
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest="$arg"
+	continue
+      fi
+
+      case "$arg" in
+      -d) isdir=yes ;;
+      -f) prev="-f" ;;
+      -g) prev="-g" ;;
+      -m) prev="-m" ;;
+      -o) prev="-o" ;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*) ;;
+
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  prev=
+	else
+	  dest="$arg"
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"`
+      case "$arg" in
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*)
+	arg="\"$arg\""
+	;;
+      esac
+      install_prog="$install_prog $arg"
+    done
+
+    if test -z "$install_prog"; then
+      $echo "$modename: you must specify an install program" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    if test -n "$prev"; then
+      $echo "$modename: the \`$prev' option requires an argument" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	$echo "$modename: no file or destination specified" 1>&2
+      else
+	$echo "$modename: you must specify a destination" 1>&2
+      fi
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    # Strip any trailing slash from the destination.
+    dest=`$echo "X$dest" | $Xsed -e 's%/$%%'`
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'`
+      test "X$destdir" = "X$dest" && destdir=.
+      destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'`
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files
+      if test $# -gt 2; then
+	$echo "$modename: \`$dest' is not a directory" 1>&2
+	$echo "$help" 1>&2
+	exit 1
+      fi
+    fi
+    case "$destdir" in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case "$file" in
+	*.lo) ;;
+	*)
+	  $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case "$file" in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$file' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+
+	library_names=
+	old_library=
+	relink_command=
+	# If there is no directory component, then add one.
+	case "$file" in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/
+	test "X$dir" = "X$file/" && dir=
+	dir="$dir$objdir"
+
+	if test "$hardcode_into_libs" = all && test -n "$relink_command"; then
+	  $echo "$modename: warning: relinking \`$file'" 1>&2
+	  $show "$relink_command"
+	  if $run eval "$relink_command"; then :
+	  else
+	    $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+	    continue
+	  fi
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names
+	if test -n "$2"; then
+	  realname="$2"
+	  shift
+	  shift
+
+	  srcname="$realname"
+	  test "$hardcode_into_libs" = all && test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  $show "$install_prog $dir/$srcname $destdir/$realname"
+	  $run eval "$install_prog $dir/$srcname $destdir/$realname" || exit $?
+	  if test -n "$stripme" && test -n "$striplib"; then
+	    $show "$striplib $destdir/$realname"
+	    $run eval "$striplib $destdir/$realname" || exit $?
+	  fi
+
+	  if test $# -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    for linkname
+	    do
+	      if test "$linkname" != "$realname"; then
+		$show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+		$run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)"
+	      fi
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  eval cmds=\"$postinstall_cmds\"
+	  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || exit $?
+	  done
+	  IFS="$save_ifs"
+	fi
+
+	# Install the pseudo-library for information purposes.
+	name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	instname="$dir/$name"i
+	$show "$install_prog $instname $destdir/$name"
+	$run eval "$install_prog $instname $destdir/$name" || exit $?
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case "$destfile" in
+	*.lo)
+	  staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"`
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	if test -n "$destfile"; then
+	  $show "$install_prog $file $destfile"
+	  $run eval "$install_prog $file $destfile" || exit $?
+	fi
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  staticobj=`$echo "X$file" | $Xsed -e "$lo2o"`
+
+	  $show "$install_prog $staticobj $staticdest"
+	  $run eval "$install_prog \$staticobj \$staticdest" || exit $?
+	fi
+	exit 0
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Do a test to see if this is really a libtool program.
+	if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  uninst_deplibs=
+	  relink_command=
+
+	  # If there is no directory component, then add one.
+	  case "$file" in
+	  */* | *\\*) . $file ;;
+	  *) . ./$file ;;
+	  esac
+
+	  # Check the variables that should have been set.
+	  if test -z "$uninst_deplibs"; then
+	    $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2
+	    exit 1
+	  fi
+
+	  finalize=yes
+	  for lib in $uninst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      # If there is no directory component, then add one.
+	      case "$lib" in
+	      */* | *\\*) . $lib ;;
+	      *) . ./$lib ;;
+	      esac
+	    fi
+	    libfile="$libdir/"`$echo "X$lib" | $Xsed -e 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  # If there is no directory component, then add one.
+	  case "$file" in
+	  */* | *\\*) . $file ;;
+	  *) . ./$file ;;
+	  esac
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    if test "$finalize" = yes && test -z "$run"; then
+	      tmpdir="/tmp"
+	      test -n "$TMPDIR" && tmpdir="$TMPDIR"
+	      tmpdir="$tmpdir/libtool-$$"
+	      if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then :
+	      else
+		$echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2
+		continue
+	      fi
+	      file=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+	      outputname="$tmpdir/$file"
+	      # Replace the output file specification.
+	      relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
+
+	      $show "$relink_command"
+	      if $run eval "$relink_command"; then :
+	      else
+		$echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2
+		${rm}r "$tmpdir"
+		continue
+	      fi
+	      file="$outputname"
+	    else
+	      $echo "$modename: warning: cannot relink \`$file'" 1>&2
+	    fi
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	$show "$install_prog$stripme $file $destfile"
+	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
+	test -n "$outputname" && ${rm}r "$tmpdir"
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      $show "$install_prog $file $oldlib"
+      $run eval "$install_prog \$file \$oldlib" || exit $?
+
+      if test -n "$stripme" && test -n "$striplib"; then
+	$show "$old_striplib $oldlib"
+	$run eval "$old_striplib $oldlib" || exit $?
+      fi
+
+      # Do each command in the postinstall commands.
+      eval cmds=\"$old_postinstall_cmds\"
+      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+      for cmd in $cmds; do
+	IFS="$save_ifs"
+	$show "$cmd"
+	$run eval "$cmd" || exit $?
+      done
+      IFS="$save_ifs"
+    done
+
+    if test -n "$future_libdirs"; then
+      $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2
+    fi
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      test -n "$run" && current_libdirs=" -n$current_libdirs"
+      exec $SHELL $0 --finish$current_libdirs
+      exit 1
+    fi
+
+    exit 0
+    ;;
+
+  # libtool finish mode
+  finish)
+    modename="$modename: finish"
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  eval cmds=\"$finish_cmds\"
+	  IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+	  for cmd in $cmds; do
+	    IFS="$save_ifs"
+	    $show "$cmd"
+	    $run eval "$cmd" || admincmds="$admincmds
+       $cmd"
+	  done
+	  IFS="$save_ifs"
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $run eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    test "$show" = : && exit 0
+
+    echo "----------------------------------------------------------------------"
+    echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      echo "   $libdir"
+    done
+    echo
+    echo "If you ever happen to want to link against installed libraries"
+    echo "in a given directory, LIBDIR, you must either use libtool, and"
+    echo "specify the full pathname of the library, or use \`-LLIBDIR'"
+    echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      echo "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      echo "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    echo
+    echo "See any operating system documentation about shared libraries for"
+    echo "more information, such as the ld(1) and ld.so(8) manual pages."
+    echo "----------------------------------------------------------------------"
+    exit 0
+    ;;
+
+  # libtool execute mode
+  execute)
+    modename="$modename: execute"
+
+    # The first argument is the command name.
+    cmd="$nonopt"
+    if test -z "$cmd"; then
+      $echo "$modename: you must specify a COMMAND" 1>&2
+      $echo "$help"
+      exit 1
+    fi
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      if test ! -f "$file"; then
+	$echo "$modename: \`$file' is not a file" 1>&2
+	$echo "$help" 1>&2
+	exit 1
+      fi
+
+      dir=
+      case "$file" in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then :
+	else
+	  $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2
+	  $echo "$help" 1>&2
+	  exit 1
+	fi
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+
+	# If there is no directory component, then add one.
+	case "$file" in
+	*/* | *\\*) . $file ;;
+	*) . ./$file ;;
+	esac
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
+	else
+	  $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2
+	  exit 1
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+	test "X$dir" = "X$file" && dir=.
+	;;
+
+      *)
+	$echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case "$file" in
+      -*) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  # If there is no directory component, then add one.
+	  case "$file" in
+	  */* | *\\*) . $file ;;
+	  *) . ./$file ;;
+	  esac
+
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"`
+      args="$args \"$file\""
+    done
+
+    if test -z "$run"; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved enviroment variables
+      if test "${save_LC_ALL+set}" = set; then
+	LC_ALL="$save_LC_ALL"; export LC_ALL
+      fi
+      if test "${save_LANG+set}" = set; then
+	LANG="$save_LANG"; export LANG
+      fi
+
+      # Now actually exec the command.
+      eval "exec \$cmd$args"
+
+      $echo "$modename: cannot exec \$cmd$args"
+      exit 1
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\""
+	$echo "export $shlibpath_var"
+      fi
+      $echo "$cmd$args"
+      exit 0
+    fi
+    ;;
+
+  # libtool clean and uninstall mode
+  clean | uninstall)
+    modename="$modename: $mode"
+    rm="$nonopt"
+    files=
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case "$arg" in
+      -*) rm="$rm $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    if test -z "$rm"; then
+      $echo "$modename: you must specify an RM program" 1>&2
+      $echo "$help" 1>&2
+      exit 1
+    fi
+
+    for file in $files; do
+      dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`
+      if test "X$dir" = "X$file"; then
+	dir=.
+	objdir="$objdir"
+      else
+	objdir="$dir/$objdir"
+      fi
+      name=`$echo "X$file" | $Xsed -e 's%^.*/%%'`
+      test $mode = uninstall && objdir="$dir"
+
+      rmfiles="$file"
+
+      case "$name" in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  . $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+	  test $mode = clean && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+
+	  if test $mode = uninstall; then
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      eval cmds=\"$postuninstall_cmds\"
+	      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd"
+	      done
+	      IFS="$save_ifs"
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      eval cmds=\"$old_postuninstall_cmds\"
+	      IFS="${IFS= 	}"; save_ifs="$IFS"; IFS='~'
+	      for cmd in $cmds; do
+		IFS="$save_ifs"
+		$show "$cmd"
+		$run eval "$cmd"
+	      done
+	      IFS="$save_ifs"
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+
+          # Read the .lo file
+          . ./$file
+
+	  # Add PIC object to the list of files to remove.
+          if test -n "$pic_object" \
+             && test "$pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$pic_object"
+          fi
+
+	  # Add non-PIC object to the list of files to remove.
+          if test -n "$non_pic_object" \
+             && test "$non_pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$non_pic_object"
+          fi
+	fi
+	;;
+
+      *)
+	# Do a test to see if this is a libtool program.
+	if test $mode = clean &&
+	   (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then
+	  relink_command=
+	  . $dir/$file
+
+	  rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	  if test "$fast_install" = yes && test -n "$relink_command"; then
+	    rmfiles="$rmfiles $objdir/lt-$name"
+	  fi
+	fi
+	;;
+      esac
+      $show "$rm $rmfiles"
+      $run $rm $rmfiles
+    done
+    exit 0
+    ;;
+
+  "")
+    $echo "$modename: you must specify a MODE" 1>&2
+    $echo "$generic_help" 1>&2
+    exit 1
+    ;;
+  esac
+
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$generic_help" 1>&2
+  exit 1
+fi # test -z "$show_help"
+
+# We need to display help for each of the modes.
+case "$mode" in
+"") $echo \
+"Usage: $modename [OPTION]... [MODE-ARG]...
+
+Provide generalized library-building support services.
+
+    --config          show all configuration variables
+    --debug           enable verbose shell tracing
+-n, --dry-run         display commands without modifying any files
+    --features        display basic configuration information and exit
+    --finish          same as \`--mode=finish'
+    --help            display this help message and exit
+    --mode=MODE       use operation mode MODE [default=inferred from MODE-ARGS]
+    --quiet           same as \`--silent'
+    --silent          don't print informational messages
+    --tag=TAG         use configuration variables from tag TAG
+    --version         print version information
+
+MODE must be one of the following:
+
+      clean           remove files from the build directory
+      compile         compile a source file into a libtool object
+      execute         automatically set library path, then run a program
+      finish          complete the installation of libtool libraries
+      install         install libraries or executables
+      link            create a library or an executable
+      uninstall       remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE.  Try \`$modename --help --mode=MODE' for
+a more detailed description of MODE."
+  exit 0
+  ;;
+
+clean)
+  $echo \
+"Usage: $modename [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+compile)
+  $echo \
+"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -static           always build a \`.o' file suitable for static linking
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+  ;;
+
+execute)
+  $echo \
+"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+  ;;
+
+finish)
+  $echo \
+"Usage: $modename [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+  ;;
+
+install)
+  $echo \
+"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+  ;;
+
+link)
+  $echo \
+"Usage: $modename [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+		    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+		    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -static           do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+		    specify library version info [each variable defaults to 0]
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+  ;;
+
+uninstall)
+  $echo \
+"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+  ;;
+
+*)
+  $echo "$modename: invalid operation mode \`$mode'" 1>&2
+  $echo "$help" 1>&2
+  exit 1
+  ;;
+esac
+
+echo
+$echo "Try \`$modename --help' for more information about other modes."
+
+exit 0
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+### END LIBTOOL TAG CONFIG: disable-shared
+
+### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+### BEGIN LIBTOOL TAG CONFIG: CXX
+# Libtool was configured as follows, on host pc7:
+#
+# AR="" AR_FLAGS="" LTCC="gcc" CC="g++" \
+# CFLAGS="-O2 -fno-exceptions -fno-check-new -Wall -pedantic -W -Wpointer-arith -Wmissing-prototypes -Wwrite-strings -Wno-long-long -Wnon-virtual-dtor -fno-builtin -O0 -g2 -Wall -fexceptions -DQT_THREAD_SUPPORT" CPPFLAGS="" \
+# MAGIC_CMD="" LD="/usr/i486-suse-linux/bin/ld" LDFLAGS="  " LIBS="" \
+# LN_S="ln -s" NM="/usr/bin/nm -B" RANLIB="ranlib" STRIP="strip" \
+# AS="" DLLTOOL="" OBJDUMP="" \
+# objext="" exeext="" reload_flag=" -r" \
+# deplibs_check_method="pass_all" \
+# file_magic_cmd="\$MAGIC_CMD" \
+#   admin/ltconfig -o libtool --cache-file=./config.cache --disable-static --with-gcc --with-gnu-ld --enable-dlopen --build=i686-pc-linux-gnu --add-tag=CXX admin/ltcf-cxx.sh i686-pc-linux-gnu
+#
+# Compiler and other test output produced by ltconfig, useful for
+# debugging ltconfig, is in ./config.log if it exists.
+
+# The version of ltconfig that generated this script.
+LTCONFIG_VERSION="1.4a"
+
+# Shell to use when invoking shell scripts.
+SHELL="/bin/sh"
+
+# Whether or not to build shared libraries.
+build_libtool_libs=yes
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=no
+
+# Whether or not to build static libraries.
+build_old_libs=no
+
+# Whether or not to optimize for fast installation.
+fast_install=yes
+
+# The host system.
+host_alias=i686-pc-linux-gnu
+host=i686-pc-linux-gnu
+
+# An echo program that does not interpret backslashes.
+echo="echo"
+
+# The archiver.
+AR="ar"
+AR_FLAGS="cru"
+
+# A C compiler.
+LTCC="gcc"
+
+# A language-specific compiler.
+CC="g++"
+
+# Is the compiler the GNU C compiler?
+with_gcc=yes
+
+# The linker used to build libraries.
+LD="g++"
+
+# Whether we need hard or soft links.
+LN_S="ln -s"
+
+# A BSD-compatible nm program.
+NM="/usr/bin/nm -B"
+
+# A symbol stripping program
+STRIP=strip
+
+# Used to examine libraries when file_magic_cmd begins "file"
+MAGIC_CMD=file
+
+# Used on cygwin: DLL creation program.
+DLLTOOL="dlltool"
+
+# Used on cygwin: object dumper.
+OBJDUMP="objdump"
+
+# Used on cygwin: assembler.
+AS="as"
+
+# The name of the directory that contains temporary libtool files.
+objdir=.libs
+
+# How to create reloadable object files.
+reload_flag=" -r"
+reload_cmds="\$LD\$reload_flag -o \$output\$reload_objs"
+
+# How to pass a linker flag through the compiler.
+wl="-Wl,"
+
+# Object file suffix (normally "o").
+objext="o"
+
+# Old archive suffix (normally "a").
+libext="a"
+
+# Executable file suffix (normally "").
+exeext=""
+
+# Additional compiler flags for building library objects.
+pic_flag=" -fPIC -DPIC"
+pic_mode=default
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o="yes"
+
+# Must we lock files when doing compilation ?
+need_locks="no"
+
+# Do we need the lib prefix for modules?
+need_lib_prefix=no
+
+# Do we need a version for libraries?
+need_version=no
+
+# Whether dlopen is supported.
+dlopen_support=yes
+
+# Whether dlopen of programs is supported.
+dlopen_self=yes
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=no
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag="-static"
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=" -fno-builtin -fno-rtti -fno-exceptions"
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec="\${wl}--export-dynamic"
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec="\${wl}--whole-archive\$convenience \${wl}--no-whole-archive"
+
+# Compiler flag to generate thread-safe objects.
+thread_safe_flag_spec=""
+
+# Library versioning type.
+version_type=linux
+
+# Format of library name prefix.
+libname_spec="lib\$name"
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME.
+library_names_spec="\${libname}\${release}.so\$versuffix \${libname}\${release}.so\$major \$libname.so"
+
+# The coded name of the library, if different from the real name.
+soname_spec="\${libname}\${release}.so\$major"
+
+# Commands used to build and install an old-style archive.
+RANLIB="ranlib"
+old_archive_cmds="\$AR \$AR_FLAGS \$oldlib\$oldobjs\$old_deplibs~\$RANLIB \$oldlib"
+old_postinstall_cmds="\$RANLIB \$oldlib~chmod 644 \$oldlib"
+old_postuninstall_cmds=""
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=""
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=""
+
+# Commands used to build and install a shared archive.
+archive_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname -o \$lib"
+archive_expsym_cmds="\$CC -shared -nostdlib \$predep_objects \$libobjs \$deplibs \$postdep_objects \$compiler_flags \${wl}-soname \$wl\$soname \${wl}-retain-symbols-file \$wl\$export_symbols -o \$lib"
+postinstall_cmds=""
+postuninstall_cmds=""
+
+# Commands to strip libraries.
+old_striplib="strip --strip-debug"
+striplib="strip --strip-unneeded"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predep_objects="/usr/lib/crti.o /usr/lib/gcc-lib/i486-suse-linux/2.95.3/crtbeginS.o"
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdep_objects="/usr/lib/gcc-lib/i486-suse-linux/2.95.3/crtendS.o /usr/lib/crtn.o"
+
+# Dependencies to place before the objects being linked to create a
+# shared library.
+predeps=""
+
+# Dependencies to place after the objects being linked to create a
+# shared library.
+postdeps="-lstdc++ -lm -lgcc -lc -lgcc"
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path="-L/usr/lib/qt2/lib -L/opt/kde2/lib -L/usr/lib/qt2/lib -L/opt/kde2/lib -L/usr/lib/qt2/lib -L/opt/kde2/lib -L. -L/usr/lib/gcc-lib/i486-suse-linux/2.95.3 -L/usr/i486-suse-linux/lib"
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method="pass_all"
+
+# Command to use when deplibs_check_method == file_magic.
+file_magic_cmd="\$MAGIC_CMD"
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=""
+
+# Flag that forces no undefined symbols.
+no_undefined_flag=""
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds="PATH=\\\"\\\$PATH:/sbin\\\" ldconfig -n \$libdir"
+
+# Same as above, but a single script fragment to be evaled but not shown.
+finish_eval=""
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe="sed -n -e 's/^.*[ 	]\\([ABCDGISTW]\\)[ 	][ 	]*\\(\\)\\([_A-Za-z][_A-Za-z0-9]*\\)\$/\\1 \\2\\3 \\3/p'"
+
+# Transform the output of nm in a proper C declaration
+global_symbol_to_cdecl="sed -n -e 's/^. .* \\(.*\\)\$/extern char \\1;/p'"
+
+# This is the shared library runtime path variable.
+runpath_var=LD_RUN_PATH
+
+# This is the shared library path variable.
+shlibpath_var=LD_LIBRARY_PATH
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=no
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=immediate
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=yes
+
+# Flag to hardcode $libdir into a binary during linking.
+# This must work even if $libdir does not exist.
+hardcode_libdir_flag_spec="\${wl}--rpath \${wl}\$libdir"
+
+# Whether we need a single -rpath flag with a separated argument.
+hardcode_libdir_separator=""
+
+# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the
+# resulting binary.
+hardcode_direct=no
+
+# Set to yes if using the -LDIR flag during linking hardcodes DIR into the
+# resulting binary.
+hardcode_minus_L=no
+
+# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into
+# the resulting binary.
+hardcode_shlibpath_var=unsupported
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at relink time.
+variables_saved_for_relink="PATH LD_LIBRARY_PATH LD_RUN_PATH GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=unknown
+
+# Compile-time system search path for libraries
+sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+
+# Run-time system search path for libraries
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+
+# Fix the shell variable $srcfile for the compiler.
+fix_srcfile_path=""
+
+# Set to yes if exported symbols are required.
+always_export_symbols=no
+
+# The commands to list exported symbols.
+export_symbols_cmds="\$NM \$libobjs \$convenience | \$global_symbol_pipe | sed 's/.* //' | sort | uniq > \$export_symbols"
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=""
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms="_GLOBAL_OFFSET_TABLE_"
+
+# Symbols that must always be exported.
+include_expsyms=""
+
+### END LIBTOOL TAG CONFIG: CXX
+
Index: trunk/MagicSoft/AMC/activemirrorcontrol/messages.log
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/messages.log	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/messages.log	(revision 3401)
@@ -0,0 +1,5 @@
+./activemirrorcontrol has *.rc or *.ui files, but not correct messages line
+gmake[2]: Entering directory `/home/amc/projects/activemirrorcontrol/activemirrorcontrol'
+/opt/kde/include/kde.pot: warning: charset "CHARSET" is not a portable encoding name
+                          warning: charset conversion might not work
+gmake[2]: Leaving directory `/home/amc/projects/activemirrorcontrol/activemirrorcontrol'
Index: trunk/MagicSoft/AMC/activemirrorcontrol/stamp-h
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/stamp-h	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/stamp-h	(revision 3401)
@@ -0,0 +1,1 @@
+timestamp
Index: trunk/MagicSoft/AMC/activemirrorcontrol/subdirs
===================================================================
--- trunk/MagicSoft/AMC/activemirrorcontrol/subdirs	(revision 3401)
+++ trunk/MagicSoft/AMC/activemirrorcontrol/subdirs	(revision 3401)
@@ -0,0 +1,3 @@
+activemirrorcontrol
+doc
+po
