[lgeneral] 09/12: New upstream version 1.4.3

Markus Koschany apo-guest at moszumanska.debian.org
Mon Dec 25 19:48:08 UTC 2017


This is an automated email from the git hooks/post-receive script.

apo-guest pushed a commit to branch master
in repository lgeneral.

commit 7a420664eb8cca273e0e3f0da442a8381db77014
Author: Markus Koschany <apo at debian.org>
Date:   Mon Dec 25 20:23:08 2017 +0100

    New upstream version 1.4.3
---
 AUTHORS                                 |    3 +
 ChangeLog                               |   36 +
 Makefile.in                             |   48 +-
 TODO                                    |    7 +-
 aclocal.m4                              |  407 +++-
 config.h.in                             |  115 +
 configure                               | 3944 ++++++++++++++++---------------
 configure.in                            |   10 +-
 lgc-pg/Makefile.in                      |   25 +-
 lgc-pg/convdata/Makefile.in             |   25 +-
 lgc-pg/maps.c                           |   16 +-
 lgc-pg/nations.c                        |    8 +-
 lgc-pg/parser.c                         |   19 +-
 lgc-pg/scenarios.c                      |  214 +-
 lgc-pg/terrain.c                        |   52 +-
 lgc-pg/units.c                          |  117 +-
 lged/Makefile.in                        |   25 +-
 po/Makefile.in                          |   25 +-
 src/Makefile.in                         |   25 +-
 src/ai.c                                |    7 +-
 src/ai_group.c                          |    6 +
 src/ai_modules/Makefile.in              |   24 +-
 src/campaigns/Makefile.in               |   24 +-
 src/config.c                            |   36 +-
 src/engine.c                            |  322 ++-
 src/gfx/Makefile.in                     |   24 +-
 src/gfx/flags/Makefile.am               |    5 +-
 src/gfx/flags/Makefile.in               |   45 +-
 src/gfx/terrain/Makefile.am             |    5 +-
 src/gfx/terrain/Makefile.in             |   45 +-
 src/gfx/units/Makefile.am               |    5 +-
 src/gfx/units/Makefile.in               |   45 +-
 src/gui.c                               |  540 ++---
 src/gui.h                               |   26 +-
 src/lg-sdl.c                            |    3 +
 src/main.c                              |    4 +-
 src/map.c                               |   22 +-
 src/map.h                               |    1 +
 src/maps/Makefile.in                    |   24 +-
 src/music/Makefile.in                   |   24 +-
 src/nations/Makefile.in                 |   24 +-
 src/parser.c                            |   21 +-
 src/purchase_dlg.c                      |   16 +-
 src/scenario.c                          |  135 +-
 src/scenario.h                          |   13 +-
 src/scenarios/Makefile.in               |   24 +-
 src/sounds/Makefile.in                  |   24 +-
 src/strat_map.c                         |  125 +
 src/strat_map.h                         |    4 +
 src/terrain/Makefile.in                 |   24 +-
 src/themes/Makefile.in                  |   24 +-
 src/themes/default/Makefile.in          |   25 +-
 src/themes/default/bkgnd.bmp            |  Bin 308278 -> 705722 bytes
 src/themes/default/confirm_buttons.bmp  |  Bin 9654 -> 9722 bytes
 src/themes/default/deploy_buttons.bmp   |  Bin 19254 -> 19322 bytes
 src/themes/default/folder.bmp           |  Bin 486 -> 554 bytes
 src/themes/default/font_std.bmp         |  Bin 27598 -> 79994 bytes
 src/themes/default/menu0_buttons.bmp    |  Bin 83082 -> 331914 bytes
 src/themes/default/menu1_buttons.bmp    |  Bin 48438 -> 258186 bytes
 src/themes/default/menu2_buttons.bmp    |  Bin 82998 -> 147578 bytes
 src/themes/default/menu3_buttons.bmp    |  Bin 69174 -> 368778 bytes
 src/themes/default/scen_dlg_buttons.bmp |  Bin 20790 -> 163978 bytes
 src/themes/default/scroll_buttons.bmp   |  Bin 13878 -> 13946 bytes
 src/themes/default/strength_buttons.bmp |  Bin 48054 -> 123002 bytes
 src/themes/default/unit_buttons.bmp     |  Bin 48438 -> 193658 bytes
 src/unit.c                              |    2 +-
 src/unit.h                              |    2 +-
 src/units/Makefile.in                   |   24 +-
 src/windows.c                           |  368 ++-
 src/windows.h                           |   59 +-
 tools/Makefile.in                       |   24 +-
 tools/ltrextract/Makefile.in            |   25 +-
 util/Makefile.in                        |   25 +-
 73 files changed, 4417 insertions(+), 2929 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index 680760b..0f94a79 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -6,3 +6,6 @@ Contributions:
 Bartłomiej Tez
 Markus Koschany
 and many more ...
+
+Graphics:
+new GUI panel icons: PD graphics from clker.com
\ No newline at end of file
diff --git a/ChangeLog b/ChangeLog
index 2aebd47..f8d94b4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+1.4.3:
+- added minimap (2017/10/07 MS)
+- fixed but in converting weather (2017/10/01 MS)
+
+1.4.2:
+- updated rest of GUI (2017/10/01 MS)
+- load/show settings properly (2017/10/01 MS)
+- moved scenario settings directly to file dialog (2017/10/01 MS)
+- write objective names in capitals (2017/09/30 MS)
+- adjusted fonts to match GUI panel (2017/09/30 MS)
+- do not allow unit deployment on impassable terrain (2017/09/27 MS)
+- put title screen as background (2017/09/27 MS)
+- no entrenchment for naval units (2017/09/17 MS)
+- rearranged panel to prevent confusing quit with end turn (2017/09/17 MS)
+
+1.4.1:
+- fixed configure or automake 1.15.1   (2017/09/17 ales_dj)
+- fixed missing DESTDIR in gfx/* Makefiles (2017/09/17 ales_dj)
+- redesigned GUI panel icons and made panel a little smaller (2017/09/17 MS)
+
+1.4.0:
+- accept = and & as alternative parser tokens (2017/08/26 MS)
+- replaced video mode list with full screen option (2017/08/26 MS)
+- added GUI panel with fixed buttons (2017/08/26 MS)
+
+1.3.2:
+- submarines have 10% less base chance to evade (2017/05/07 Tez Bartlomiej)
+- aircrafts can now spawn at carriers (2017/05/07 Tez Bartlomiej)
+- AI fix: tried to capture harbors with ships which is not possible (2017/05/07 Tez Bartlomiej)
+- AI fix: cannot deploy units in enemy cities (2017/05/07 Tez Bartlomiej)
+- in custom scenarios messages can be displayed at turn begin (2016/09/05 Tez Bartlomiej)
+- added count attribute to escape condition (2016/09/05 Tez Bartlomiej)
+- new victory condition: units may escape to certain area (2016/09/04 MS)
+- always generate gfx sub directories (2016/08/28 MS)
+- do not generate terrain info for bridges if not split off (2016/08/28 MS)
+
 1.3.1:
 - bridge terrain type is now optional for compatibility (2016/01/08 MS) 
 - adjusted file access mode and other stuff for portability (2015/09/13 Ivan Baidakou)
diff --git a/Makefile.in b/Makefile.in
index 1580e86..a13253e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,17 +90,13 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = .
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/configure $(am__configure_deps) acconfig.h \
-	$(srcdir)/config.h.in mkinstalldirs \
-	$(top_srcdir)/intl/Makefile.in AUTHORS COPYING ChangeLog \
-	INSTALL NEWS TODO compile config.guess config.rpath config.sub \
-	depcomp install-sh missing
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+	$(am__configure_deps) $(am__DIST_COMMON)
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
  configure.lineno config.status.lineno
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
@@ -183,6 +189,10 @@ ETAGS = etags
 CTAGS = ctags
 CSCOPE = cscope
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config.h.in \
+	$(top_srcdir)/intl/Makefile.in AUTHORS COPYING ChangeLog \
+	INSTALL NEWS TODO acconfig.h compile config.guess config.rpath \
+	config.sub depcomp install-sh missing mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 distdir = $(PACKAGE)-$(VERSION)
 top_distdir = $(distdir)
@@ -381,6 +391,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -424,7 +435,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -690,15 +700,15 @@ dist-xz: distdir
 	$(am__post_remove_distdir)
 
 dist-tarZ: distdir
-	@echo WARNING: "Support for shar distribution archives is" \
-	               "deprecated." >&2
+	@echo WARNING: "Support for distribution archives compressed with" \
+		       "legacy program 'compress' is deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
 	$(am__post_remove_distdir)
 
 dist-shar: distdir
-	@echo WARNING: "Support for distribution archives compressed with" \
-		       "legacy program 'compress' is deprecated." >&2
+	@echo WARNING: "Support for shar distribution archives is" \
+	               "deprecated." >&2
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
 	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
 	$(am__post_remove_distdir)
@@ -734,18 +744,18 @@ distcheck: dist
 	esac
 	chmod -R a-w $(distdir)
 	chmod u+w $(distdir)
-	mkdir $(distdir)/_build $(distdir)/_inst
+	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
 	chmod a-w $(distdir)
 	test -d $(distdir)/_build || exit 0; \
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
 	  && am__cwd=`pwd` \
-	  && $(am__cd) $(distdir)/_build \
-	  && ../configure \
+	  && $(am__cd) $(distdir)/_build/sub \
+	  && ../../configure \
 	    --with-included-gettext \
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
-	    --srcdir=.. --prefix="$$dc_install_base" \
+	    --srcdir=../.. --prefix="$$dc_install_base" \
 	  && $(MAKE) $(AM_MAKEFLAGS) \
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
@@ -926,6 +936,8 @@ uninstall-am: uninstall-desktopDATA uninstall-iconDATA
 	mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
 	uninstall-am uninstall-desktopDATA uninstall-iconDATA
 
+.PRECIOUS: Makefile
+
 
 package-translations:
 	test x != "x$(LINGUAS)" || { echo "LINGUAS not set" ; exit 1 ; }
diff --git a/TODO b/TODO
index c353ec6..52da0bd 100644
--- a/TODO
+++ b/TODO
@@ -1,5 +1,6 @@
-- transfer prestige?
-- strat map icon for deploy window
+- allow unit air debark even if above enemy
+- submarines not attacked (norway)
+- more agressive with ships
 
 **** Gameplay
 
@@ -8,9 +9,7 @@
 
 **** Display
 
-- victory hexes are bad to see many units are arround
 - edit sometimes broken? (string too long, many blanks)
-- add a video mode of 800x480 for Nokia devices
 
 **** AI 
 
diff --git a/aclocal.m4 b/aclocal.m4
index fd30cd5..40a6fcb 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,6 +1,6 @@
-# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -21,7 +21,7 @@ If you have problems, you may need to regenerate the build system entirely.
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
 
 # codeset.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2006, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2000-2002, 2006, 2008-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -44,8 +44,110 @@ AC_DEFUN([AM_LANGINFO_CODESET],
   fi
 ])
 
+dnl 'extern inline' a la ISO C99.
+
+dnl Copyright 2012-2015 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+AC_DEFUN([gl_EXTERN_INLINE],
+[
+  AH_VERBATIM([extern_inline],
+[/* Please see the Gnulib manual for how to use these macros.
+
+   Suppress extern inline with HP-UX cc, as it appears to be broken; see
+   <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+
+   Suppress extern inline with Sun C in standards-conformance mode, as it
+   mishandles inline functions that call each other.  E.g., for 'inline void f
+   (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+   'reference to static identifier "f" in extern inline function'.
+   This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
+
+   Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
+   on configurations that mistakenly use 'static inline' to implement
+   functions or macros in standard C headers like <ctype.h>.  For example,
+   if isdigit is mistakenly implemented via a static inline function,
+   a program containing an extern inline function that calls isdigit
+   may not work since the C standard prohibits extern inline functions
+   from calling static functions.  This bug is known to occur on:
+
+     OS X 10.8 and earlier; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+
+     DragonFly; see
+     http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+
+     FreeBSD; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
+
+   OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
+   for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
+   Assume DragonFly and FreeBSD will be similar.  */
+#if (((defined __APPLE__ && defined __MACH__) \
+      || defined __DragonFly__ || defined __FreeBSD__) \
+     && (defined __header_inline \
+         ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
+            && ! defined __clang__) \
+         : ((! defined _DONT_USE_CTYPE_INLINE_ \
+             && (defined __GNUC__ || defined __cplusplus)) \
+            || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+                && defined __GNUC__ && ! defined __cplusplus))))
+# define _GL_EXTERN_INLINE_STDHEADER_BUG
+#endif
+#if ((__GNUC__ \
+      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+      : (199901L <= __STDC_VERSION__ \
+         && !defined __HP_cc \
+         && !(defined __SUNPRO_C && __STDC__))) \
+     && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+# define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+       && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
+   /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
+#  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
+# else
+#  define _GL_INLINE extern inline
+# endif
+# define _GL_EXTERN_INLINE extern
+# define _GL_EXTERN_INLINE_IN_USE
+#else
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
+#endif
+
+/* In GCC 4.6 (inclusive) to 5.1 (exclusive),
+   suppress bogus "no previous prototype for 'FOO'"
+   and "no previous declaration for 'FOO'" diagnostics,
+   when FOO is an inline function in the header; see
+   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
+   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>.  */
+#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+#  define _GL_INLINE_HEADER_CONST_PRAGMA
+# else
+#  define _GL_INLINE_HEADER_CONST_PRAGMA \
+     _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+# endif
+# define _GL_INLINE_HEADER_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+    _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+    _GL_INLINE_HEADER_CONST_PRAGMA
+# define _GL_INLINE_HEADER_END \
+    _Pragma ("GCC diagnostic pop")
+#else
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+#endif])
+])
+
 # fcntl-o.m4 serial 4
-dnl Copyright (C) 2006, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2006, 2009-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -179,19 +281,19 @@ AC_DEFUN([gl_FCNTL_O_FLAGS],
     [Define to 1 if O_NOFOLLOW works.])
 ])
 
-# gettext.m4 serial 66 (gettext-0.18.2)
-dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
+# gettext.m4 serial 67 (gettext-0.19.6)
+dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
+dnl This file can be used in projects which are not available under
 dnl the GNU General Public License or the GNU Library General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
 dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
@@ -581,8 +683,12 @@ AC_DEFUN([AM_GNU_GETTEXT_NEED],
 dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version])
 AC_DEFUN([AM_GNU_GETTEXT_VERSION], [])
 
+
+dnl Usage: AM_GNU_GETTEXT_REQUIRE_VERSION([gettext-version])
+AC_DEFUN([AM_GNU_GETTEXT_REQUIRE_VERSION], [])
+
 # glibc2.m4 serial 3
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2015 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -614,7 +720,7 @@ AC_DEFUN([gt_GLIBC2],
 )
 
 # glibc21.m4 serial 5
-dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2013 Free Software Foundation,
+dnl Copyright (C) 2000-2002, 2004, 2008, 2010-2015 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -648,8 +754,8 @@ AC_DEFUN([gl_GLIBC21],
   ]
 )
 
-# iconv.m4 serial 18 (gettext-0.18.2)
-dnl Copyright (C) 2000-2002, 2007-2013 Free Software Foundation, Inc.
+# iconv.m4 serial 19 (gettext-0.18.2)
+dnl Copyright (C) 2000-2002, 2007-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -722,27 +828,33 @@ AC_DEFUN([AM_ICONV_LINK],
       if test $am_cv_lib_iconv = yes; then
         LIBS="$LIBS $LIBICONV"
       fi
-      AC_RUN_IFELSE(
-        [AC_LANG_SOURCE([[
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        AC_RUN_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[
 #include <iconv.h>
 #include <string.h>
-int main ()
-{
-  int result = 0;
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+             ]],
+             [[int result = 0;
   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
      returns.  */
   {
     iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
     if (cd_utf8_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\342\202\254"; /* EURO SIGN */
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
         char buf[10];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_utf8_to_88591,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
           result |= 1;
@@ -755,14 +867,14 @@ int main ()
     iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
     if (cd_ascii_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\263";
+        static ICONV_CONST char input[] = "\263";
         char buf[10];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_ascii_to_88591,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
           result |= 2;
@@ -774,14 +886,14 @@ int main ()
     iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
     if (cd_88591_to_utf8 != (iconv_t)(-1))
       {
-        static const char input[] = "\304";
+        static ICONV_CONST char input[] = "\304";
         static char buf[2] = { (char)0xDE, (char)0xAD };
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = 1;
         char *outptr = buf;
         size_t outbytesleft = 1;
         size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
           result |= 4;
@@ -794,14 +906,14 @@ int main ()
     iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
     if (cd_88591_to_utf8 != (iconv_t)(-1))
       {
-        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
         char buf[50];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
           result |= 8;
@@ -821,17 +933,14 @@ int main ()
       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
     result |= 16;
   return result;
-}]])],
-        [am_cv_func_iconv_works=yes],
-        [am_cv_func_iconv_works=no],
-        [
-changequote(,)dnl
-         case "$host_os" in
-           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
-           *)            am_cv_func_iconv_works="guessing yes" ;;
-         esac
-changequote([,])dnl
-        ])
+]])],
+          [am_cv_func_iconv_works=yes], ,
+          [case "$host_os" in
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac])
+        test "$am_cv_func_iconv_works" = no || break
+      done
       LIBS="$am_save_LIBS"
     ])
     case "$am_cv_func_iconv_works" in
@@ -918,7 +1027,7 @@ size_t iconv();
 ])
 
 # intdiv0.m4 serial 6 (gettext-0.18.2)
-dnl Copyright (C) 2002, 2007-2008, 2010-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002, 2007-2008, 2010-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -1005,19 +1114,19 @@ changequote([,])dnl
     [Define if integer division by zero raises signal SIGFPE.])
 ])
 
-# intl.m4 serial 24 (gettext-0.18.3)
-dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
+# intl.m4 serial 29 (gettext-0.19)
+dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
+dnl This file can be used in projects which are not available under
 dnl the GNU General Public License or the GNU Library General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
 dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
@@ -1049,6 +1158,8 @@ AC_DEFUN([AM_INTL_SUBDIR],
   AC_REQUIRE([gl_XSIZE])dnl
   AC_REQUIRE([gl_FCNTL_O_FLAGS])dnl
   AC_REQUIRE([gt_INTL_MACOSX])dnl
+  AC_REQUIRE([gl_EXTERN_INLINE])dnl
+  AC_REQUIRE([gt_GL_ATTRIBUTE])dnl
 
   dnl Support for automake's --enable-silent-rules.
   case "$enable_silent_rules" in
@@ -1237,6 +1348,12 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
     stpcpy strcasecmp strdup strtoul tsearch uselocale argz_count \
     argz_stringify argz_next __fsetlocking])
 
+  dnl Solaris 12 provides getlocalename_l, while Illumos doesn't have
+  dnl it nor the equivalent.
+  if test $ac_cv_func_uselocale = yes; then
+    AC_CHECK_FUNCS([getlocalename_l])
+  fi
+
   dnl Use the *_unlocked functions only if they are declared.
   dnl (because some of them were defined without being declared in Solaris
   dnl 2.5.1 but were removed in Solaris 2.6, whereas we want binaries built
@@ -1247,8 +1364,7 @@ AC_DEFUN([gt_INTL_SUBDIR_CORE],
 
   dnl intl/plural.c is generated from intl/plural.y. It requires bison,
   dnl because plural.y uses bison specific features. It requires at least
-  dnl bison-1.26 because earlier versions generate a plural.c that doesn't
-  dnl compile.
+  dnl bison-2.7 for %define api.pure.
   dnl bison is only needed for the maintainer (who touches plural.y). But in
   dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
   dnl the rule in general Makefile. Now, some people carelessly touch the
@@ -1265,7 +1381,7 @@ changequote(<<,>>)dnl
     ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
     case $ac_prog_version in
       '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+      2.[7-9]* | [3-9].*)
 changequote([,])dnl
          ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
       *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
@@ -1277,19 +1393,45 @@ changequote([,])dnl
   fi
 ])
 
+dnl Copies _GL_UNUSED and _GL_ATTRIBUTE_PURE definitions from
+dnl gnulib-common.m4 as a fallback, if the project isn't using Gnulib.
+AC_DEFUN([gt_GL_ATTRIBUTE], [
+  m4_ifndef([gl_[]COMMON],
+    AH_VERBATIM([gt_gl_attribute],
+[/* Define as a marker that can be attached to declarations that might not
+    be used.  This helps to reduce warnings, such as from
+    GCC -Wunused-parameter.  */
+#ifndef _GL_UNUSED
+# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+#  define _GL_UNUSED __attribute__ ((__unused__))
+# else
+#  define _GL_UNUSED
+# endif
+#endif
+
+/* The __pure__ attribute was added in gcc 2.96.  */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+#  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+#  define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+]))])
+
 # intlmacosx.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2004-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2004-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
+dnl This file can be used in projects which are not available under
 dnl the GNU General Public License or the GNU Library General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
 dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Checks for special options needed on Mac OS X.
@@ -1335,7 +1477,7 @@ AC_DEFUN([gt_INTL_MACOSX],
 ])
 
 # intmax.m4 serial 6 (gettext-0.18.2)
-dnl Copyright (C) 2002-2005, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2005, 2008-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -1372,7 +1514,7 @@ AC_DEFUN([gt_TYPE_INTMAX_T],
 ])
 
 # inttypes-pri.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1997-2002, 2006, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2002, 2006, 2008-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -1415,7 +1557,7 @@ char *p = PRId32;
 ])
 
 # inttypes_h.m4 serial 10
-dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -1445,19 +1587,19 @@ AC_DEFUN([gl_AC_HEADER_INTTYPES_H],
 ])
 
 # lcmessage.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1995-2002, 2004-2005, 2008-2013 Free Software Foundation,
+dnl Copyright (C) 1995-2002, 2004-2005, 2008-2014 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
+dnl This file can be used in projects which are not available under
 dnl the GNU General Public License or the GNU Library General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
 dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
@@ -1481,7 +1623,7 @@ AC_DEFUN([gt_LC_MESSAGES],
 ])
 
 # lib-ld.m4 serial 6
-dnl Copyright (C) 1996-2003, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2009-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -1601,7 +1743,7 @@ AC_LIB_PROG_LD_GNU
 ])
 
 # lib-link.m4 serial 26 (gettext-0.18.2)
-dnl Copyright (C) 2001-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -2379,7 +2521,7 @@ AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS],
 ])
 
 # lib-prefix.m4 serial 7 (gettext-0.18)
-dnl Copyright (C) 2001-2005, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2001-2005, 2008-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -2604,7 +2746,7 @@ sixtyfour bits
 ])
 
 # lock.m4 serial 13 (gettext-0.18.2)
-dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2005-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -2647,7 +2789,7 @@ return !x;
 AC_DEFUN([gl_PREREQ_LOCK], [:])
 
 # longlong.m4 serial 17
-dnl Copyright (C) 1999-2007, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 1999-2007, 2009-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -2761,19 +2903,19 @@ AC_DEFUN([_AC_TYPE_LONG_LONG_SNIPPET],
 ])
 
 # nls.m4 serial 5 (gettext-0.18)
-dnl Copyright (C) 1995-2003, 2005-2006, 2008-2013 Free Software Foundation,
+dnl Copyright (C) 1995-2003, 2005-2006, 2008-2014 Free Software Foundation,
 dnl Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
+dnl This file can be used in projects which are not available under
 dnl the GNU General Public License or the GNU Library General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
 dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
@@ -2793,19 +2935,19 @@ AC_DEFUN([AM_NLS],
   AC_SUBST([USE_NLS])
 ])
 
-# po.m4 serial 21 (gettext-0.18.3)
-dnl Copyright (C) 1995-2013 Free Software Foundation, Inc.
+# po.m4 serial 24 (gettext-0.19)
+dnl Copyright (C) 1995-2014 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
+dnl This file can be used in projects which are not available under
 dnl the GNU General Public License or the GNU Library General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
 dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
@@ -2825,7 +2967,7 @@ AC_DEFUN([AM_PO_SUBDIRS],
 
   dnl Release version of the gettext macros. This is used to ensure that
   dnl the gettext macros and po/Makefile.in.in are in sync.
-  AC_SUBST([GETTEXT_MACRO_VERSION], [0.18])
+  AC_SUBST([GETTEXT_MACRO_VERSION], [0.19])
 
   dnl Perform the following tests also if --disable-nls has been given,
   dnl because they are needed for "make dist" to work.
@@ -3248,7 +3390,7 @@ AC_DEFUN([AM_XGETTEXT_OPTION],
 ])
 
 # printf-posix.m4 serial 6 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007, 2009-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007, 2009-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -3297,18 +3439,18 @@ int main ()
 ])
 
 # progtest.m4 serial 7 (gettext-0.18.2)
-dnl Copyright (C) 1996-2003, 2005, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 1996-2003, 2005, 2008-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
 dnl
-dnl This file can can be used in projects which are not available under
+dnl This file can be used in projects which are not available under
 dnl the GNU General Public License or the GNU Library General Public
 dnl License but which still want to provide support for the GNU gettext
 dnl functionality.
 dnl Please note that the actual code of the GNU gettext library is covered
 dnl by the GNU Library General Public License, and the rest of the GNU
-dnl gettext package package is covered by the GNU General Public License.
+dnl gettext package is covered by the GNU General Public License.
 dnl They are *not* in the public domain.
 
 dnl Authors:
@@ -3389,7 +3531,7 @@ AC_SUBST([$1])dnl
 ])
 
 # size_max.m4 serial 10
-dnl Copyright (C) 2003, 2005-2006, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2005-2006, 2008-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -3469,7 +3611,7 @@ m4_ifdef([AC_COMPUTE_INT], [], [
 ])
 
 # stdint_h.m4 serial 9
-dnl Copyright (C) 1997-2004, 2006, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2006, 2008-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -3496,8 +3638,8 @@ AC_DEFUN([gl_AC_HEADER_STDINT_H],
   fi
 ])
 
-# threadlib.m4 serial 10 (gettext-0.18.2)
-dnl Copyright (C) 2005-2013 Free Software Foundation, Inc.
+# threadlib.m4 serial 11 (gettext-0.18.2)
+dnl Copyright (C) 2005-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -3520,7 +3662,7 @@ dnl libtool).
 dnl Sets the variables LIBMULTITHREAD and LTLIBMULTITHREAD similarly, for
 dnl programs that really need multithread functionality. The difference
 dnl between LIBTHREAD and LIBMULTITHREAD is that on platforms supporting weak
-dnl symbols, typically LIBTHREAD="" whereas LIBMULTITHREAD="-lpthread".
+dnl symbols, typically LIBTHREAD is empty whereas LIBMULTITHREAD is not.
 dnl Adds to CPPFLAGS the flag -D_REENTRANT or -D_THREAD_SAFE if needed for
 dnl multithread-safe programs.
 
@@ -3660,15 +3802,31 @@ int main ()
         # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
         # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
         # the second one only in libpthread, and lock.c needs it.
-        AC_LINK_IFELSE(
-          [AC_LANG_PROGRAM(
-             [[#include <pthread.h>]],
-             [[pthread_mutex_lock((pthread_mutex_t*)0);
-               pthread_mutexattr_init((pthread_mutexattr_t*)0);]])],
-          [gl_have_pthread=yes])
+        #
+        # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+        # needs -pthread for some reason.  See:
+        # http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html
+        save_LIBS=$LIBS
+        for gl_pthread in '' '-pthread'; do
+          LIBS="$LIBS $gl_pthread"
+          AC_LINK_IFELSE(
+            [AC_LANG_PROGRAM(
+               [[#include <pthread.h>
+                 pthread_mutex_t m;
+                 pthread_mutexattr_t ma;
+               ]],
+               [[pthread_mutex_lock (&m);
+                 pthread_mutexattr_init (&ma);]])],
+            [gl_have_pthread=yes
+             LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread
+             LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread])
+          LIBS=$save_LIBS
+          test -n "$gl_have_pthread" && break
+        done
+
         # Test for libpthread by looking for pthread_kill. (Not pthread_self,
         # since it is defined as a macro on OSF/1.)
-        if test -n "$gl_have_pthread"; then
+        if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then
           # The program links fine without libpthread. But it may actually
           # need to link with libpthread in order to create multiple threads.
           AC_CHECK_LIB([pthread], [pthread_kill],
@@ -3683,7 +3841,7 @@ int main ()
                    [Define if the pthread_in_use() detection is hard.])
              esac
             ])
-        else
+        elif test -z "$gl_have_pthread"; then
           # Some library is needed. Try libpthread and libc_r.
           AC_CHECK_LIB([pthread], [pthread_kill],
             [gl_have_pthread=yes
@@ -3824,6 +3982,8 @@ dnl Linux 2.4/glibc    posix      -lpthread       Y      OK
 dnl
 dnl GNU Hurd/glibc     posix
 dnl
+dnl Ubuntu 14.04       posix      -pthread        Y      OK
+dnl
 dnl FreeBSD 5.3        posix      -lc_r           Y
 dnl                    posix      -lkse ?         Y
 dnl                    posix      -lpthread ?     Y
@@ -3869,7 +4029,7 @@ dnl   0.5 if the first test terminates OK but the second one loops endlessly,
 dnl   0.0 if the first test already loops endlessly.
 
 # uintmax_t.m4 serial 12
-dnl Copyright (C) 1997-2004, 2007-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 1997-2004, 2007-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -3900,7 +4060,7 @@ AC_DEFUN([gl_AC_TYPE_UINTMAX_T],
 ])
 
 # visibility.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2005, 2008, 2010-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2005, 2008, 2010-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -3978,7 +4138,7 @@ AC_DEFUN([gl_VISIBILITY],
 ])
 
 # wchar_t.m4 serial 4 (gettext-0.18.2)
-dnl Copyright (C) 2002-2003, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2002-2003, 2008-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -4003,7 +4163,7 @@ AC_DEFUN([gt_TYPE_WCHAR_T],
 ])
 
 # wint_t.m4 serial 5 (gettext-0.18.2)
-dnl Copyright (C) 2003, 2007-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2003, 2007-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -4036,7 +4196,7 @@ AC_DEFUN([gt_TYPE_WINT_T],
 ])
 
 # xsize.m4 serial 5
-dnl Copyright (C) 2003-2004, 2008-2013 Free Software Foundation, Inc.
+dnl Copyright (C) 2003-2004, 2008-2015 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
 dnl with or without modifications, as long as this notice is preserved.
@@ -4048,7 +4208,7 @@ AC_DEFUN([gl_XSIZE],
   AC_CHECK_HEADERS([stdint.h])
 ])
 
-# Copyright (C) 2002-2013 Free Software Foundation, Inc.
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4060,10 +4220,10 @@ AC_DEFUN([gl_XSIZE],
 # generated from the m4 files accompanying Automake X.Y.
 # (This private macro should not be called outside this file.)
 AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.14'
+[am__api_version='1.15'
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
 dnl require some minimum version.  Point them to the right macro.
-m4_if([$1], [1.14.1], [],
+m4_if([$1], [1.15], [],
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
 ])
 
@@ -4079,14 +4239,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.14.1])dnl
+[AM_AUTOMAKE_VERSION([1.15])dnl
 m4_ifndef([AC_AUTOCONF_VERSION],
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4131,15 +4291,14 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
 # configured tree to be moved without reconfiguration.
 
 AC_DEFUN([AM_AUX_DIR_EXPAND],
-[dnl Rely on autoconf to set up CDPATH properly.
-AC_PREREQ([2.50])dnl
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
 ])
 
 # AM_CONDITIONAL                                            -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4170,7 +4329,7 @@ AC_CONFIG_COMMANDS_PRE(
 Usually this means the macro was only invoked conditionally.]])
 fi])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4361,7 +4520,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
 
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4437,7 +4596,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
 
 # Do all the work for Automake.                             -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4527,8 +4686,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
 AC_REQUIRE([AC_PROG_AWK])dnl
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
@@ -4601,7 +4760,11 @@ to "yes", and re-run configure.
 END
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
   fi
-fi])
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
 
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
@@ -4630,7 +4793,7 @@ for _am_header in $config_headers :; do
 done
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4641,7 +4804,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
 # Define $install_sh.
 AC_DEFUN([AM_PROG_INSTALL_SH],
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-if test x"${install_sh}" != xset; then
+if test x"${install_sh+set}" != xset; then
   case $am_aux_dir in
   *\ * | *\	*)
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
@@ -4651,7 +4814,7 @@ if test x"${install_sh}" != xset; then
 fi
 AC_SUBST([install_sh])])
 
-# Copyright (C) 2003-2013 Free Software Foundation, Inc.
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4672,7 +4835,7 @@ AC_SUBST([am__leading_dot])])
 
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4722,7 +4885,7 @@ rm -f confinc confmf
 
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
 
-# Copyright (C) 1997-2013 Free Software Foundation, Inc.
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4763,7 +4926,7 @@ fi
 # Obsolete and "removed" macros, that must however still report explicit
 # error messages when used, to smooth transition.
 #
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4790,7 +4953,7 @@ AU_DEFUN([fp_C_PROTOTYPES], [AM_C_PROTOTYPES])
 
 # Helper functions for option handling.                     -*- Autoconf -*-
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4819,7 +4982,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
 AC_DEFUN([_AM_IF_OPTION],
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
 
-# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4866,7 +5029,7 @@ AC_LANG_POP([C])])
 # For backward compatibility.
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4885,7 +5048,7 @@ AC_DEFUN([AM_RUN_LOG],
 
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
 
-# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -4966,7 +5129,7 @@ AC_CONFIG_COMMANDS_PRE(
 rm -f conftest.file
 ])
 
-# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+# Copyright (C) 2009-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -5026,7 +5189,7 @@ AC_SUBST([AM_BACKSLASH])dnl
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
 ])
 
-# Copyright (C) 2001-2013 Free Software Foundation, Inc.
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -5054,7 +5217,7 @@ fi
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
 
-# Copyright (C) 2006-2013 Free Software Foundation, Inc.
+# Copyright (C) 2006-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -5073,7 +5236,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
 
 # Check how to create a tarball.                            -*- Autoconf -*-
 
-# Copyright (C) 2004-2013 Free Software Foundation, Inc.
+# Copyright (C) 2004-2014 Free Software Foundation, Inc.
 #
 # This file is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
diff --git a/config.h.in b/config.h.in
index a0ec8c5..7e61803 100644
--- a/config.h.in
+++ b/config.h.in
@@ -104,6 +104,9 @@
 /* Define to 1 if you have the `getgid' function. */
 #undef HAVE_GETGID
 
+/* Define to 1 if you have the `getlocalename_l' function. */
+#undef HAVE_GETLOCALENAME_L
+
 /* Define to 1 if you have the `getpagesize' function. */
 #undef HAVE_GETPAGESIZE
 
@@ -384,6 +387,118 @@
 /* Define to 1 if you need to in order for `stat' and other things to work. */
 #undef _POSIX_SOURCE
 
+/* Please see the Gnulib manual for how to use these macros.
+
+   Suppress extern inline with HP-UX cc, as it appears to be broken; see
+   <http://lists.gnu.org/archive/html/bug-texinfo/2013-02/msg00030.html>.
+
+   Suppress extern inline with Sun C in standards-conformance mode, as it
+   mishandles inline functions that call each other.  E.g., for 'inline void f
+   (void) { } inline void g (void) { f (); }', c99 incorrectly complains
+   'reference to static identifier "f" in extern inline function'.
+   This bug was observed with Sun C 5.12 SunOS_i386 2011/11/16.
+
+   Suppress extern inline (with or without __attribute__ ((__gnu_inline__)))
+   on configurations that mistakenly use 'static inline' to implement
+   functions or macros in standard C headers like <ctype.h>.  For example,
+   if isdigit is mistakenly implemented via a static inline function,
+   a program containing an extern inline function that calls isdigit
+   may not work since the C standard prohibits extern inline functions
+   from calling static functions.  This bug is known to occur on:
+
+     OS X 10.8 and earlier; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2012-12/msg00023.html
+
+     DragonFly; see
+     http://muscles.dragonflybsd.org/bulk/bleeding-edge-potential/latest-per-pkg/ah-tty-0.3.12.log
+
+     FreeBSD; see:
+     http://lists.gnu.org/archive/html/bug-gnulib/2014-07/msg00104.html
+
+   OS X 10.9 has a macro __header_inline indicating the bug is fixed for C and
+   for clang but remains for g++; see <http://trac.macports.org/ticket/41033>.
+   Assume DragonFly and FreeBSD will be similar.  */
+#if (((defined __APPLE__ && defined __MACH__) \
+      || defined __DragonFly__ || defined __FreeBSD__) \
+     && (defined __header_inline \
+         ? (defined __cplusplus && defined __GNUC_STDC_INLINE__ \
+            && ! defined __clang__) \
+         : ((! defined _DONT_USE_CTYPE_INLINE_ \
+             && (defined __GNUC__ || defined __cplusplus)) \
+            || (defined _FORTIFY_SOURCE && 0 < _FORTIFY_SOURCE \
+                && defined __GNUC__ && ! defined __cplusplus))))
+# define _GL_EXTERN_INLINE_STDHEADER_BUG
+#endif
+#if ((__GNUC__ \
+      ? defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__ \
+      : (199901L <= __STDC_VERSION__ \
+         && !defined __HP_cc \
+         && !(defined __SUNPRO_C && __STDC__))) \
+     && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# define _GL_INLINE inline
+# define _GL_EXTERN_INLINE extern inline
+# define _GL_EXTERN_INLINE_IN_USE
+#elif (2 < __GNUC__ + (7 <= __GNUC_MINOR__) && !defined __STRICT_ANSI__ \
+       && !defined _GL_EXTERN_INLINE_STDHEADER_BUG)
+# if defined __GNUC_GNU_INLINE__ && __GNUC_GNU_INLINE__
+   /* __gnu_inline__ suppresses a GCC 4.2 diagnostic.  */
+#  define _GL_INLINE extern inline __attribute__ ((__gnu_inline__))
+# else
+#  define _GL_INLINE extern inline
+# endif
+# define _GL_EXTERN_INLINE extern
+# define _GL_EXTERN_INLINE_IN_USE
+#else
+# define _GL_INLINE static _GL_UNUSED
+# define _GL_EXTERN_INLINE static _GL_UNUSED
+#endif
+
+/* In GCC 4.6 (inclusive) to 5.1 (exclusive),
+   suppress bogus "no previous prototype for 'FOO'"
+   and "no previous declaration for 'FOO'" diagnostics,
+   when FOO is an inline function in the header; see
+   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54113> and
+   <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63877>.  */
+#if __GNUC__ == 4 && 6 <= __GNUC_MINOR__
+# if defined __GNUC_STDC_INLINE__ && __GNUC_STDC_INLINE__
+#  define _GL_INLINE_HEADER_CONST_PRAGMA
+# else
+#  define _GL_INLINE_HEADER_CONST_PRAGMA \
+     _Pragma ("GCC diagnostic ignored \"-Wsuggest-attribute=const\"")
+# endif
+# define _GL_INLINE_HEADER_BEGIN \
+    _Pragma ("GCC diagnostic push") \
+    _Pragma ("GCC diagnostic ignored \"-Wmissing-prototypes\"") \
+    _Pragma ("GCC diagnostic ignored \"-Wmissing-declarations\"") \
+    _GL_INLINE_HEADER_CONST_PRAGMA
+# define _GL_INLINE_HEADER_END \
+    _Pragma ("GCC diagnostic pop")
+#else
+# define _GL_INLINE_HEADER_BEGIN
+# define _GL_INLINE_HEADER_END
+#endif
+
+/* Define as a marker that can be attached to declarations that might not
+    be used.  This helps to reduce warnings, such as from
+    GCC -Wunused-parameter.  */
+#ifndef _GL_UNUSED
+# if __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)
+#  define _GL_UNUSED __attribute__ ((__unused__))
+# else
+#  define _GL_UNUSED
+# endif
+#endif
+
+/* The __pure__ attribute was added in gcc 2.96.  */
+#ifndef _GL_ATTRIBUTE_PURE
+# if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 96)
+#  define _GL_ATTRIBUTE_PURE __attribute__ ((__pure__))
+# else
+#  define _GL_ATTRIBUTE_PURE /* empty */
+# endif
+#endif
+
+
 /* Define to `__inline__' or `__inline' if that's what the C compiler
    calls it, or to nothing if 'inline' is not supported under any name.  */
 #ifndef __cplusplus
diff --git a/configure b/configure
index 39e357b..ac27305 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69.
+# Generated by GNU Autoconf 2.69 for lgeneral 1.4.3.
 #
 #
 # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
@@ -575,12 +575,12 @@ MFLAGS=
 MAKEFLAGS=
 
 # Identity of this package.
-PACKAGE_NAME=
-PACKAGE_TARNAME=
-PACKAGE_VERSION=
-PACKAGE_STRING=
-PACKAGE_BUGREPORT=
-PACKAGE_URL=
+PACKAGE_NAME='lgeneral'
+PACKAGE_TARNAME='lgeneral'
+PACKAGE_VERSION='1.4.3'
+PACKAGE_STRING='lgeneral 1.4.3'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
 
 ac_unique_file="Makefile.am"
 # Factoring default headers for most tests.
@@ -699,10 +699,9 @@ GETTEXT_MACRO_VERSION
 USE_NLS
 SED
 RANLIB
-AM_BACKSLASH
-AM_DEFAULT_VERBOSITY
-AM_DEFAULT_V
-AM_V
+EGREP
+GREP
+CPP
 am__fastdepCC_FALSE
 am__fastdepCC_TRUE
 CCDEPMODE
@@ -713,6 +712,29 @@ AMDEP_TRUE
 am__quote
 am__include
 DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
 am__untar
 am__tar
 AMTAR
@@ -736,28 +758,6 @@ am__isrc
 INSTALL_DATA
 INSTALL_SCRIPT
 INSTALL_PROGRAM
-EGREP
-GREP
-CPP
-OBJEXT
-EXEEXT
-ac_ct_CC
-CPPFLAGS
-LDFLAGS
-CFLAGS
-CC
-target_os
-target_vendor
-target_cpu
-target
-host_os
-host_vendor
-host_cpu
-host
-build_os
-build_vendor
-build_cpu
-build
 target_alias
 host_alias
 build_alias
@@ -777,6 +777,7 @@ infodir
 docdir
 oldincludedir
 includedir
+runstatedir
 localstatedir
 sharedstatedir
 sysconfdir
@@ -799,8 +800,8 @@ SHELL'
 ac_subst_files=''
 ac_user_opts='
 enable_option_checking
-enable_dependency_tracking
 enable_silent_rules
+enable_dependency_tracking
 enable_nls
 enable_threads
 with_gnu_ld
@@ -863,9 +864,10 @@ datadir='${datarootdir}'
 sysconfdir='${prefix}/etc'
 sharedstatedir='${prefix}/com'
 localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
 includedir='${prefix}/include'
 oldincludedir='/usr/include'
-docdir='${datarootdir}/doc/${PACKAGE}'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
 infodir='${datarootdir}/info'
 htmldir='${docdir}'
 dvidir='${docdir}'
@@ -1115,6 +1117,15 @@ do
   | -silent | --silent | --silen | --sile | --sil)
     silent=yes ;;
 
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
     ac_prev=sbindir ;;
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1252,7 +1263,7 @@ fi
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
 		datadir sysconfdir sharedstatedir localstatedir includedir \
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
-		libdir localedir mandir
+		libdir localedir mandir runstatedir
 do
   eval ac_val=\$$ac_var
   # Remove trailing slashes.
@@ -1365,7 +1376,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures this package to adapt to many kinds of systems.
+\`configure' configures lgeneral 1.4.3 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1405,6 +1416,7 @@ Fine tuning of the installation directories:
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
   --libdir=DIR            object code libraries [EPREFIX/lib]
   --includedir=DIR        C header files [PREFIX/include]
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
@@ -1413,7 +1425,7 @@ Fine tuning of the installation directories:
   --infodir=DIR           info documentation [DATAROOTDIR/info]
   --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
   --mandir=DIR            man documentation [DATAROOTDIR/man]
-  --docdir=DIR            documentation root [DATAROOTDIR/doc/PACKAGE]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/lgeneral]
   --htmldir=DIR           html documentation [DOCDIR]
   --dvidir=DIR            dvi documentation [DOCDIR]
   --pdfdir=DIR            pdf documentation [DOCDIR]
@@ -1435,19 +1447,21 @@ _ACEOF
 fi
 
 if test -n "$ac_init_help"; then
-
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of lgeneral 1.4.3:";;
+   esac
   cat <<\_ACEOF
 
 Optional Features:
   --disable-option-checking  ignore unrecognized --enable/--with options
   --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
   --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
   --enable-dependency-tracking
                           do not reject slow dependency extractors
   --disable-dependency-tracking
                           speeds up one-time build
-  --enable-silent-rules   less verbose build output (undo: "make V=1")
-  --disable-silent-rules  verbose build output (undo: "make V=0")
   --disable-nls           do not use Native Language Support
   --enable-threads={posix|solaris|pth|windows}
                           specify multithreading API
@@ -1548,7 +1562,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-configure
+lgeneral configure 1.4.3
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2196,7 +2210,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by $as_me, which was
+It was created by lgeneral $as_me 1.4.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -2550,6 +2564,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
 
+am__api_version='1.15'
+
 ac_aux_dir=
 for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
   if test -f "$ac_dir/install-sh"; then
@@ -2579,134 +2595,220 @@ ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
 ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
 
 
-# Make sure we can run config.sub.
-$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
-  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
-$as_echo_n "checking build system type... " >&6; }
-if ${ac_cv_build+:} false; then :
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  ac_build_alias=$build_alias
-test "x$ac_build_alias" = x &&
-  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
-test "x$ac_build_alias" = x &&
-  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
-ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
-  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
-
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
-$as_echo "$ac_cv_build" >&6; }
-case $ac_cv_build in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
 esac
-build=$ac_cv_build
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_build
-shift
-build_cpu=$1
-build_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-build_os=$*
-IFS=$ac_save_IFS
-case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
+  done
+IFS=$as_save_IFS
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
-$as_echo_n "checking host system type... " >&6; }
-if ${ac_cv_host+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$host_alias" = x; then
-  ac_cv_host=$ac_cv_build
-else
-  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
-fi
+rm -rf conftest.one conftest.two conftest.dir
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
-$as_echo "$ac_cv_host" >&6; }
-case $ac_cv_host in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
-esac
-host=$ac_cv_host
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_host
-shift
-host_cpu=$1
-host_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-host_os=$*
-IFS=$ac_save_IFS
-case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
-$as_echo_n "checking target system type... " >&6; }
-if ${ac_cv_target+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test "x$target_alias" = x; then
-  ac_cv_target=$ac_cv_host
-else
-  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
-    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
-$as_echo "$ac_cv_target" >&6; }
-case $ac_cv_target in
-*-*-*) ;;
-*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
-esac
-target=$ac_cv_target
-ac_save_IFS=$IFS; IFS='-'
-set x $ac_cv_target
-shift
-target_cpu=$1
-target_vendor=$2
-shift; shift
-# Remember, the first character of IFS is used to create $*,
-# except with old shells:
-target_os=$*
-IFS=$ac_save_IFS
-case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+# 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}'
 
-# The aliases save the names the user supplied, while $host etc.
-# will get canonicalized.
-test -n "$target_alias" &&
-  test "$program_prefix$program_suffix$program_transform_name" = \
-    NONENONEs,x,x, &&
-  program_prefix=${target_alias}-
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}gcc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# Do 'set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   am_has_slept=no
+   for am_try in 1 2; do
+     echo "timestamp, slept: $am_has_slept" > conftest.file
+     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+     if test "$*" = "X"; then
+	# -L didn't work.
+	set X `ls -t "$srcdir/configure" conftest.file`
+     fi
+     if test "$*" != "X $srcdir/configure conftest.file" \
+	&& test "$*" != "X conftest.file $srcdir/configure"; then
+
+	# If neither matched, then we have a broken ls.  This can happen
+	# if, for instance, CONFIG_SHELL is bash and it inherits a
+	# broken ls alias from the environment.  This has actually
+	# happened.  Such a system could not be considered "sane".
+	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+  alias in your environment" "$LINENO" 5
+     fi
+     if test "$2" = conftest.file || test $am_try -eq 2; then
+       break
+     fi
+     # Just in case.
+     sleep 1
+     am_has_slept=yes
+   done
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+  ( sleep 1 ) &
+  am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip".  However 'strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the 'STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2715,7 +2817,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -2725,10 +2827,10 @@ IFS=$as_save_IFS
 
 fi
 fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
@@ -2736,17 +2838,17 @@ fi
 
 
 fi
-if test -z "$ac_cv_prog_CC"; then
-  ac_ct_CC=$CC
-  # Extract the first word of "gcc", so it can be a program name with args.
-set dummy gcc; ac_word=$2
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
 else
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
@@ -2755,7 +2857,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="gcc"
+    ac_cv_prog_ac_ct_STRIP="strip"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -2765,17 +2867,17 @@ IFS=$as_save_IFS
 
 fi
 fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
-  if test "x$ac_ct_CC" = x; then
-    CC=""
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
   else
     case $cross_compiling:$ac_tool_warned in
 yes:)
@@ -2783,65 +2885,69 @@ yes:)
 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
 ac_tool_warned=yes ;;
 esac
-    CC=$ac_ct_CC
+    STRIP=$ac_ct_STRIP
   fi
 else
-  CC="$ac_cv_prog_CC"
+  STRIP="$ac_cv_prog_STRIP"
 fi
 
-if test -z "$CC"; then
-          if test -n "$ac_tool_prefix"; then
-    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
-set dummy ${ac_tool_prefix}cc; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
 do
   IFS=$as_save_IFS
   test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="${ac_tool_prefix}cc"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
+    for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
   done
 IFS=$as_save_IFS
 
 fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
 
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
   fi
 fi
-if test -z "$CC"; then
-  # Extract the first word of "cc", so it can be a program name with args.
-set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
 $as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
+if ${ac_cv_prog_AWK+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
 else
-  ac_prog_rejected=no
 as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
 for as_dir in $PATH
 do
@@ -2849,11 +2955,7 @@ do
   test -z "$as_dir" && as_dir=.
     for ac_exec_ext in '' $ac_executable_extensions; do
   if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
-       ac_prog_rejected=yes
-       continue
-     fi
-    ac_cv_prog_CC="cc"
+    ac_cv_prog_AWK="$ac_prog"
     $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
     break 2
   fi
@@ -2861,1115 +2963,1047 @@ done
   done
 IFS=$as_save_IFS
 
-if test $ac_prog_rejected = yes; then
-  # We found a bogon in the path, so make sure we never use it.
-  set dummy $ac_cv_prog_CC
-  shift
-  if test $# != 0; then
-    # We chose a different compiler from the bogus one.
-    # However, it has the same basename, so the bogon will be chosen
-    # first if we set CC to just the basename; use the full file name.
-    shift
-    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
-  fi
 fi
 fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
 fi
 
 
-fi
-if test -z "$CC"; then
-  if test -n "$ac_tool_prefix"; then
-  for ac_prog in cl.exe
-  do
-    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
-set dummy $ac_tool_prefix$ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_CC+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$CC"; then
-  ac_cv_prog_CC="$CC" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
+  test -n "$AWK" && break
 done
-  done
-IFS=$as_save_IFS
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
 fi
-fi
-CC=$ac_cv_prog_CC
-if test -n "$CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
-$as_echo "$CC" >&6; }
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
 else
   { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
 $as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
 fi
 
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
 
-    test -n "$CC" && break
-  done
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+  enableval=$enable_silent_rules;
 fi
-if test -z "$CC"; then
-  ac_ct_CC=$CC
-  for ac_prog in cl.exe
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_CC+:} false; then :
+
+case $enable_silent_rules in # (((
+  yes) AM_DEFAULT_VERBOSITY=0;;
+   no) AM_DEFAULT_VERBOSITY=1;;
+    *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_CC"; then
-  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+  if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+	@$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+  am_cv_make_support_nested_variables=yes
 else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_CC="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
+  am_cv_make_support_nested_variables=no
 fi
 fi
-ac_ct_CC=$ac_cv_prog_ac_ct_CC
-if test -n "$ac_ct_CC"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
-$as_echo "$ac_ct_CC" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+    AM_V='$(V)'
+  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
 else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
+  AM_V=$AM_DEFAULT_VERBOSITY
+  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
 fi
+AM_BACKSLASH='\'
 
-
-  test -n "$ac_ct_CC" && break
-done
-
-  if test "x$ac_ct_CC" = x; then
-    CC=""
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    CC=$ac_ct_CC
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
   fi
 fi
 
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
 fi
 
 
-test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "no acceptable C compiler found in \$PATH
-See \`config.log' for more details" "$LINENO" 5; }
+# Define the identity of the package.
+ PACKAGE='lgeneral'
+ VERSION='1.4.3'
 
-# Provide some information about the compiler.
-$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
-set X $ac_compile
-ac_compiler=$2
-for ac_option in --version -v -V -qversion; do
-  { { ac_try="$ac_compiler $ac_option >&5"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
-  ac_status=$?
-  if test -s conftest.err; then
-    sed '10a\
-... rest of stderr output deleted ...
-         10q' conftest.err >conftest.er1
-    cat conftest.er1 >&5
-  fi
-  rm -f conftest.er1 conftest.err
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-done
 
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
 _ACEOF
-ac_clean_files_save=$ac_clean_files
-ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
-# Try to create an executable without -o first, disregard a.out.
-# It will help us diagnose broken compilers, and finding out an intuition
-# of exeext.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
-$as_echo_n "checking whether the C compiler works... " >&6; }
-ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
-# The possible output files:
-ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+# Some tools Automake needs.
 
-ac_rmfiles=
-for ac_file in $ac_files
-do
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
-  esac
-done
-rm -f $ac_rmfiles
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
 
-if { { ac_try="$ac_link_default"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link_default") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
-# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
-# in a Makefile.  We should not override ac_cv_exeext if it was cached,
-# so that the user can short-circuit this test for compilers unknown to
-# Autoconf.
-for ac_file in $ac_files ''
-do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
-	;;
-    [ab].out )
-	# We found the default executable, but exeext='' is most
-	# certainly right.
-	break;;
-    *.* )
-	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
-	then :; else
-	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	fi
-	# We set ac_cv_exeext here because the later test for it is not
-	# safe: cross compilers may not add the suffix if given an `-o'
-	# argument, so we may need to know it at that point already.
-	# Even if this section looks crufty: it has the advantage of
-	# actually working.
-	break;;
-    * )
-	break;;
-  esac
-done
-test "$ac_cv_exeext" = no && ac_cv_exeext=
 
-else
-  ac_file=''
-fi
-if test -z "$ac_file"; then :
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-$as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
 
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error 77 "C compiler cannot create executables
-See \`config.log' for more details" "$LINENO" 5; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
-$as_echo_n "checking for C compiler default output file name... " >&6; }
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
-$as_echo "$ac_file" >&6; }
-ac_exeext=$ac_cv_exeext
 
-rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
-$as_echo_n "checking for suffix of executables... " >&6; }
-if { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  # If both `conftest.exe' and `conftest' are `present' (well, observable)
-# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
-# work properly (i.e., refer to `conftest.exe'), while it won't with
-# `rm'.
-for ac_file in conftest.exe conftest conftest.*; do
-  test -f "$ac_file" || continue
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
-    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
-	  break;;
-    * ) break;;
-  esac
-done
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of executables: cannot compile and link
-See \`config.log' for more details" "$LINENO" 5; }
-fi
-rm -f conftest conftest$ac_cv_exeext
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
-$as_echo "$ac_cv_exeext" >&6; }
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
 
-rm -f conftest.$ac_ext
-EXEEXT=$ac_cv_exeext
-ac_exeext=$EXEEXT
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdio.h>
-int
-main ()
-{
-FILE *f = fopen ("conftest.out", "w");
- return ferror (f) || fclose (f) != 0;
 
-  ;
-  return 0;
-}
-_ACEOF
-ac_clean_files="$ac_clean_files conftest.out"
-# Check that the compiler produces executables we can run.  If not, either
-# the compiler is broken, or we cross compile.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
-$as_echo_n "checking whether we are cross compiling... " >&6; }
-if test "$cross_compiling" != yes; then
-  { { ac_try="$ac_link"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_link") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }
-  if { ac_try='./conftest$ac_cv_exeext'
-  { { case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_try") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }; then
-    cross_compiling=no
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar  pax cpio none'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake at gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
   else
-    if test "$cross_compiling" = maybe; then
-	cross_compiling=yes
-    else
-	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot run C compiled programs.
-If you meant to cross compile, use \`--host'.
-See \`config.log' for more details" "$LINENO" 5; }
-    fi
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
   fi
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
-$as_echo "$cross_compiling" >&6; }
 
-rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
-ac_clean_files=$ac_clean_files_save
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
-$as_echo_n "checking for suffix of object files... " >&6; }
-if ${ac_cv_objext+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
 
-int
-main ()
-{
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
 
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.o conftest.obj
-if { { ac_try="$ac_compile"
-case "(($ac_try" in
-  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
-  *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
-  (eval "$ac_compile") 2>&5
-  ac_status=$?
-  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; then :
-  for ac_file in conftest.o conftest.obj conftest.*; do
-  test -f "$ac_file" || continue;
-  case $ac_file in
-    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
-    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
-       break;;
-  esac
-done
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  $as_echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
 
-{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "cannot compute suffix of object files: cannot compile
-See \`config.log' for more details" "$LINENO" 5; }
 fi
-rm -f conftest.$ac_cv_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
-$as_echo "$ac_cv_objext" >&6; }
-OBJEXT=$ac_cv_objext
-ac_objext=$OBJEXT
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
-$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
-if ${ac_cv_c_compiler_gnu+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
 
-int
-main ()
-{
-#ifndef __GNUC__
-       choke me
-#endif
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_compiler_gnu=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_compiler_gnu=no
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
-$as_echo "$ac_cv_c_compiler_gnu" >&6; }
-if test $ac_compiler_gnu = yes; then
-  GCC=yes
-else
-  GCC=
-fi
-ac_test_CFLAGS=${CFLAGS+set}
-ac_save_CFLAGS=$CFLAGS
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
-$as_echo_n "checking whether $CC accepts -g... " >&6; }
-if ${ac_cv_prog_cc_g+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_save_c_werror_flag=$ac_c_werror_flag
-   ac_c_werror_flag=yes
-   ac_cv_prog_cc_g=no
-   CFLAGS="-g"
-   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
 
-int
-main ()
-{
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if ${ac_cv_target+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  CFLAGS=""
-      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
 
-int
-main ()
-{
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
 
-else
-  ac_c_werror_flag=$ac_save_c_werror_flag
-	 CFLAGS="-g"
-	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+DEPDIR="${am__leading_dot}deps"
 
-int
-main ()
-{
+ac_config_commands="$ac_config_commands depfiles"
 
-  ;
-  return 0;
-}
-_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_g=yes
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-   ac_c_werror_flag=$ac_save_c_werror_flag
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
-$as_echo "$ac_cv_prog_cc_g" >&6; }
-if test "$ac_test_CFLAGS" = set; then
-  CFLAGS=$ac_save_CFLAGS
-elif test $ac_cv_prog_cc_g = yes; then
-  if test "$GCC" = yes; then
-    CFLAGS="-g -O2"
-  else
-    CFLAGS="-g"
-  fi
-else
-  if test "$GCC" = yes; then
-    CFLAGS="-O2"
-  else
-    CFLAGS=
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
-$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
-if ${ac_cv_prog_cc_c89+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  ac_cv_prog_cc_c89=no
-ac_save_CC=$CC
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <stdarg.h>
-#include <stdio.h>
-struct stat;
-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
-struct buf { int x; };
-FILE * (*rcsopen) (struct buf *, struct stat *, int);
-static char *e (p, i)
-     char **p;
-     int i;
-{
-  return p[i];
-}
-static char *f (char * (*g) (char **, int), char **p, ...)
-{
-  char *s;
-  va_list v;
-  va_start (v,p);
-  s = g (p, va_arg (v,int));
-  va_end (v);
-  return s;
-}
 
-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
-   function prototypes and stuff, but not '\xHH' hex character constants.
-   These don't provoke an error unfortunately, instead are silently treated
-   as 'x'.  The following induces an error, until -std is added to get
-   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
-   array size at least.  It's necessary to write '\x00'==0 to get something
-   that's true only with -std.  */
-int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
 
-/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
-   inside strings and character constants.  */
-#define FOO(x) 'x'
-int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
 
-int test (int i, double x);
-struct s1 {int (*f) (int a);};
-struct s2 {int (*f) (double a);};
-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
-int argc;
-char **argv;
-int
-main ()
-{
-return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
-  ;
-  return 0;
-}
-_ACEOF
-for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
-	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
-do
-  CC="$ac_save_CC $ac_arg"
-  if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_prog_cc_c89=$ac_arg
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
 fi
-rm -f core conftest.err conftest.$ac_objext
-  test "x$ac_cv_prog_cc_c89" != "xno" && break
-done
-rm -f conftest.$ac_ext
-CC=$ac_save_CC
 
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
 fi
-# AC_CACHE_VAL
-case "x$ac_cv_prog_cc_c89" in
-  x)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
-$as_echo "none needed" >&6; } ;;
-  xno)
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
-$as_echo "unsupported" >&6; } ;;
-  *)
-    CC="$CC $ac_cv_prog_cc_c89"
-    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
-$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
-esac
-if test "x$ac_cv_prog_cc_c89" != xno; then :
-
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
 fi
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
 ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
-$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
-if ${am_cv_prog_cc_c_o+:} false; then :
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-int
-main ()
-{
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
-  ;
-  return 0;
-}
-_ACEOF
-  # Make sure it works both with $CC and with simple cc.
-  # Following AC_PROG_CC_C_O, we do the test twice because some
-  # compilers refuse to overwrite an existing .o file with -o,
-  # though they will create one.
-  am_cv_prog_cc_c_o=yes
-  for am_i in 1 2; do
-    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
-   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
-   ac_status=$?
-   echo "$as_me:$LINENO: \$? = $ac_status" >&5
-   (exit $ac_status); } \
-         && test -f conftest2.$ac_objext; then
-      : OK
-    else
-      am_cv_prog_cc_c_o=no
-      break
-    fi
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
   done
-  rm -f core conftest*
-  unset am_i
+IFS=$as_save_IFS
+
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
-$as_echo "$am_cv_prog_cc_c_o" >&6; }
-if test "$am_cv_prog_cc_c_o" != yes; then
-   # Losing compiler, so override with the script.
-   # FIXME: It is wrong to rewrite CC.
-   # But if we don't then we get into trouble of one sort or another.
-   # A longer-term fix would be to have automake use am__CC in this case,
-   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
-   CC="$am_aux_dir/compile $CC"
 fi
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
 
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
-$as_echo_n "checking how to run the C preprocessor... " >&6; }
-# On Suns, sometimes $CPP names a directory.
-if test -n "$CPP" && test -d "$CPP"; then
-  CPP=
+  fi
 fi
-if test -z "$CPP"; then
-  if ${ac_cv_prog_CPP+:} false; then :
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-      # Double quotes because CPP needs to be expanded
-    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
-    do
-      ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
 do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
-else
-  # Broken: fails on valid input.
-continue
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
-
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
 else
-  # Passes both tests.
-ac_preproc_ok=:
-break
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
 
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
 done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
-  break
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
-    done
-    ac_cv_prog_CPP=$CPP
 
+    test -n "$CC" && break
+  done
 fi
-  CPP=$ac_cv_prog_CPP
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_prog_CPP=$CPP
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
-$as_echo "$CPP" >&6; }
-ac_preproc_ok=false
-for ac_c_preproc_warn_flag in '' yes
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
 do
-  # Use a header file that comes with gcc, so configuring glibc
-  # with a fresh cross-compiler works.
-  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
-  # <limits.h> exists even on freestanding compilers.
-  # On the NeXT, cc -E runs the code through the compiler's parser,
-  # not just through cpp. "Syntax error" is here to catch this case.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#ifdef __STDC__
-# include <limits.h>
-#else
-# include <assert.h>
-#endif
-		     Syntax error
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
 
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
 else
-  # Broken: fails on valid input.
-continue
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
 
-  # OK, works on sane cases.  Now check whether nonexistent headers
-  # can be detected and how.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <ac_nonexistent.h>
-_ACEOF
-if ac_fn_c_try_cpp "$LINENO"; then :
-  # Broken: success on invalid input.
-continue
-else
-  # Passes both tests.
-ac_preproc_ok=:
-break
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
 fi
-rm -f conftest.err conftest.i conftest.$ac_ext
 
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
 done
-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
-rm -f conftest.i conftest.err conftest.$ac_ext
-if $ac_preproc_ok; then :
 
-else
-  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
-See \`config.log' for more details" "$LINENO" 5; }
-fi
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-ac_ext=c
-ac_cpp='$CPP $CPPFLAGS'
-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
-ac_compiler_gnu=$ac_cv_c_compiler_gnu
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
 
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
-$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
-if ${ac_cv_path_GREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$GREP"; then
-  ac_path_GREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+ac_rmfiles=
+for ac_file in $ac_files
 do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in grep ggrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_GREP" || continue
-# Check for GNU ac_path_GREP and select it if it is found.
-  # Check for GNU $ac_path_GREP
-case `"$ac_path_GREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'GREP' >> "conftest.nl"
-    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_GREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_GREP="$ac_path_GREP"
-      ac_path_GREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
 
-      $ac_path_GREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_GREP"; then
-    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
 else
-  ac_cv_path_GREP=$GREP
+  ac_file=''
 fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
-$as_echo "$ac_cv_path_GREP" >&6; }
- GREP="$ac_cv_path_GREP"
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
-$as_echo_n "checking for egrep... " >&6; }
-if ${ac_cv_path_EGREP+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
-   then ac_cv_path_EGREP="$GREP -E"
-   else
-     if test -z "$EGREP"; then
-  ac_path_EGREP_found=false
-  # Loop through the user's path and test for each of PROGNAME-LIST
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in egrep; do
-    for ac_exec_ext in '' $ac_executable_extensions; do
-      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
-      as_fn_executable_p "$ac_path_EGREP" || continue
-# Check for GNU ac_path_EGREP and select it if it is found.
-  # Check for GNU $ac_path_EGREP
-case `"$ac_path_EGREP" --version 2>&1` in
-*GNU*)
-  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
-*)
-  ac_count=0
-  $as_echo_n 0123456789 >"conftest.in"
-  while :
-  do
-    cat "conftest.in" "conftest.in" >"conftest.tmp"
-    mv "conftest.tmp" "conftest.in"
-    cp "conftest.in" "conftest.nl"
-    $as_echo 'EGREP' >> "conftest.nl"
-    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
-    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
-    as_fn_arith $ac_count + 1 && ac_count=$as_val
-    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
-      # Best one so far, save it but keep looking for a better one
-      ac_cv_path_EGREP="$ac_path_EGREP"
-      ac_path_EGREP_max=$ac_count
-    fi
-    # 10*(2^10) chars as input seems more than enough
-    test $ac_count -gt 10 && break
-  done
-  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
 esac
-
-      $ac_path_EGREP_found && break 3
-    done
-  done
-  done
-IFS=$as_save_IFS
-  if test -z "$ac_cv_path_EGREP"; then
-    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
-  fi
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
 else
-  ac_cv_path_EGREP=$EGREP
-fi
-
-   fi
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
-$as_echo "$ac_cv_path_EGREP" >&6; }
- EGREP="$ac_cv_path_EGREP"
-
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
-$as_echo_n "checking for ANSI C header files... " >&6; }
-if ${ac_cv_header_stdc+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdlib.h>
-#include <stdarg.h>
-#include <string.h>
-#include <float.h>
-
+#include <stdio.h>
 int
 main ()
 {
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
 
   ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_header_stdc=yes
-else
-  ac_cv_header_stdc=no
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
 fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-
-if test $ac_cv_header_stdc = yes; then
-  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <string.h>
-
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "memchr" >/dev/null 2>&1; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
 
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
-
-fi
-
-if test $ac_cv_header_stdc = yes; then
-  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <stdlib.h>
 
-_ACEOF
-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
-  $EGREP "free" >/dev/null 2>&1; then :
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
 else
-  ac_cv_header_stdc=no
-fi
-rm -f conftest*
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
 
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
 fi
-
-if test $ac_cv_header_stdc = yes; then
-  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
-  if test "$cross_compiling" = yes; then :
-  :
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
-#include <ctype.h>
-#include <stdlib.h>
-#if ((' ' & 0x0FF) == 0x020)
-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
-#else
-# define ISLOWER(c) \
-		   (('a' <= (c) && (c) <= 'i') \
-		     || ('j' <= (c) && (c) <= 'r') \
-		     || ('s' <= (c) && (c) <= 'z'))
-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
-#endif
 
-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
 int
 main ()
 {
-  int i;
-  for (i = 0; i < 256; i++)
-    if (XOR (islower (i), ISLOWER (i))
-	|| toupper (i) != TOUPPER (i))
-      return 2;
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
   return 0;
 }
 _ACEOF
-if ac_fn_c_try_run "$LINENO"; then :
-
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
 else
-  ac_cv_header_stdc=no
-fi
-rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
-  conftest.$ac_objext conftest.beam conftest.$ac_ext
+  ac_compiler_gnu=no
 fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
 
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
-$as_echo "$ac_cv_header_stdc" >&6; }
-if test $ac_cv_header_stdc = yes; then
-
-$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-fi
+int
+main ()
+{
 
-# On IRIX 5.3, sys/types and inttypes.h are conflicting.
-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
-		  inttypes.h stdint.h unistd.h
-do :
-  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
-"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
-  cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+  ;
+  return 0;
+}
 _ACEOF
-
-fi
-
-done
-
-
-
-  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
-if test "x$ac_cv_header_minix_config_h" = xyes; then :
-  MINIX=yes
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
 else
-  MINIX=
-fi
-
-
-  if test "$MINIX" = yes; then
-
-$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
-
-
-$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
-
-
-$as_echo "#define _MINIX 1" >>confdefs.h
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-  fi
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
 
-  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
-$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
-if ${ac_cv_safe_to_define___extensions__+:} false; then :
-  $as_echo_n "(cached) " >&6
 else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
-#         define __EXTENSIONS__ 1
-          $ac_includes_default
 int
 main ()
 {
@@ -3979,794 +4013,774 @@ main ()
 }
 _ACEOF
 if ac_fn_c_try_compile "$LINENO"; then :
-  ac_cv_safe_to_define___extensions__=yes
-else
-  ac_cv_safe_to_define___extensions__=no
+  ac_cv_prog_cc_g=yes
 fi
 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
-$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
-  test $ac_cv_safe_to_define___extensions__ = yes &&
-    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
-
-  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
-
-  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
-
-  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
-
-  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
-
-
-
-am__api_version='1.14'
-
-# Find a good install program.  We prefer a C program (faster),
-# so one script is as good as another.  But avoid the broken or
-# incompatible versions:
-# SysV /etc/install, /usr/sbin/install
-# SunOS /usr/etc/install
-# IRIX /sbin/install
-# AIX /bin/install
-# AmigaOS /C/install, which installs bootblocks on floppy discs
-# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
-# AFS /usr/afsws/bin/install, which mishandles nonexistent args
-# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
-# OS/2's system install, which has a completely different semantic
-# ./install, which can be erroneously created by make from ./install.sh.
-# Reject install programs that cannot install multiple files.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
-$as_echo_n "checking for a BSD-compatible install... " >&6; }
-if test -z "$INSTALL"; then
-if ${ac_cv_path_install+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    # Account for people who put trailing slashes in PATH elements.
-case $as_dir/ in #((
-  ./ | .// | /[cC]/* | \
-  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
-  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
-  /usr/ucb/* ) ;;
-  *)
-    # OSF1 and SCO ODT 3.0 have their own names for install.
-    # Don't use installbsd from OSF since it installs stuff as root
-    # by default.
-    for ac_prog in ginstall scoinst install; do
-      for ac_exec_ext in '' $ac_executable_extensions; do
-	if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
-	  if test $ac_prog = install &&
-	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # AIX install.  It has an incompatible calling convention.
-	    :
-	  elif test $ac_prog = install &&
-	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
-	    # program-specific install script used by HP pwplus--don't use.
-	    :
-	  else
-	    rm -rf conftest.one conftest.two conftest.dir
-	    echo one > conftest.one
-	    echo two > conftest.two
-	    mkdir conftest.dir
-	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
-	      test -s conftest.one && test -s conftest.two &&
-	      test -s conftest.dir/conftest.one &&
-	      test -s conftest.dir/conftest.two
-	    then
-	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
-	      break 3
-	    fi
-	  fi
-	fi
-      done
-    done
-    ;;
-esac
-
-  done
-IFS=$as_save_IFS
-
-rm -rf conftest.one conftest.two conftest.dir
-
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
-  if test "${ac_cv_path_install+set}" = set; then
-    INSTALL=$ac_cv_path_install
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
   else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for INSTALL within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    INSTALL=$ac_install_sh
+    CFLAGS="-g"
   fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
-$as_echo "$INSTALL" >&6; }
-
-# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
-# It thinks the first close brace ends the variable substitution.
-test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
-
-test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
-
-test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
-$as_echo_n "checking whether build environment is sane... " >&6; }
-# Reject unsafe characters in $srcdir or the absolute working directory
-# name.  Accept space and tab only in the latter.
-am_lf='
-'
-case `pwd` in
-  *[\\\"\#\$\&\'\`$am_lf]*)
-    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
-esac
-case $srcdir in
-  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
-    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
-esac
-
-# Do 'set' in a subshell so we don't clobber the current shell's
-# arguments.  Must try -L first in case configure is actually a
-# symlink; some systems play weird games with the mod time of symlinks
-# (eg FreeBSD returns the mod time of the symlink's containing
-# directory).
-if (
-   am_has_slept=no
-   for am_try in 1 2; do
-     echo "timestamp, slept: $am_has_slept" > conftest.file
-     set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
-     if test "$*" = "X"; then
-	# -L didn't work.
-	set X `ls -t "$srcdir/configure" conftest.file`
-     fi
-     if test "$*" != "X $srcdir/configure conftest.file" \
-	&& test "$*" != "X conftest.file $srcdir/configure"; then
-
-	# If neither matched, then we have a broken ls.  This can happen
-	# if, for instance, CONFIG_SHELL is bash and it inherits a
-	# broken ls alias from the environment.  This has actually
-	# happened.  Such a system could not be considered "sane".
-	as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
-  alias in your environment" "$LINENO" 5
-     fi
-     if test "$2" = conftest.file || test $am_try -eq 2; then
-       break
-     fi
-     # Just in case.
-     sleep 1
-     am_has_slept=yes
-   done
-   test "$2" = conftest.file
-   )
-then
-   # Ok.
-   :
 else
-   as_fn_error $? "newly created file is older than distributed files!
-Check your system clock" "$LINENO" 5
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-# If we didn't sleep, we still need to ensure time stamps of config.status and
-# generated files are strictly newer.
-am_sleep_pid=
-if grep 'slept: no' conftest.file >/dev/null 2>&1; then
-  ( sleep 1 ) &
-  am_sleep_pid=$!
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
 
-rm -f conftest.file
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
 
-test "$program_prefix" != NONE &&
-  program_transform_name="s&^&$program_prefix&;$program_transform_name"
-# Use a double $ so make ignores it.
-test "$program_suffix" != NONE &&
-  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
-# Double any \ or $.
-# By default was `s,x,x', remove it if useless.
-ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
-program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
 
-if test x"${MISSING+set}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\	*)
-    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
-  *)
-    MISSING="\${SHELL} $am_aux_dir/missing" ;;
-  esac
-fi
-# Use eval to expand $SHELL
-if eval "$MISSING --is-lightweight"; then
-  am_missing_run="$MISSING "
-else
-  am_missing_run=
-  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
 fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
 
-if test x"${install_sh}" != xset; then
-  case $am_aux_dir in
-  *\ * | *\	*)
-    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
   *)
-    install_sh="\${SHELL} $am_aux_dir/install-sh"
-  esac
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
 fi
 
-# Installed binaries are usually stripped using 'strip' when the user
-# run "make install-strip".  However 'strip' might not be the right
-# tool to use in cross-compilation environments, therefore Automake
-# will honor the 'STRIP' environment variable to overrule this program.
-if test "$cross_compiling" != no; then
-  if test -n "$ac_tool_prefix"; then
-  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
-set dummy ${ac_tool_prefix}strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_STRIP+:} false; then :
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$STRIP"; then
-  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
 fi
-STRIP=$ac_cv_prog_STRIP
-if test -n "$STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
-$as_echo "$STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
-fi
-if test -z "$ac_cv_prog_STRIP"; then
-  ac_ct_STRIP=$STRIP
-  # Extract the first word of "strip", so it can be a program name with args.
-set dummy strip; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if test -n "$ac_ct_STRIP"; then
-  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_ac_ct_STRIP="strip"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
   fi
-done
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
   done
-IFS=$as_save_IFS
-
-fi
-fi
-ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
-if test -n "$ac_ct_STRIP"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
-$as_echo "$ac_ct_STRIP" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
 
-  if test "x$ac_ct_STRIP" = x; then
-    STRIP=":"
-  else
-    case $cross_compiling:$ac_tool_warned in
-yes:)
-{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
-$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
-ac_tool_warned=yes ;;
-esac
-    STRIP=$ac_ct_STRIP
-  fi
+  cd ..
+  rm -rf conftest.dir
 else
-  STRIP="$ac_cv_prog_STRIP"
+  am_cv_CC_dependencies_compiler_type=none
 fi
 
 fi
-INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
-$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
-if test -z "$MKDIR_P"; then
-  if ${ac_cv_path_mkdir+:} false; then :
-  $as_echo_n "(cached) " >&6
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
 else
-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_prog in mkdir gmkdir; do
-	 for ac_exec_ext in '' $ac_executable_extensions; do
-	   as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
-	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
-	     'mkdir (GNU coreutils) '* | \
-	     'mkdir (coreutils) '* | \
-	     'mkdir (fileutils) '4.1*)
-	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
-	       break 3;;
-	   esac
-	 done
-       done
-  done
-IFS=$as_save_IFS
-
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
 fi
 
-  test -d ./--version && rmdir ./--version
-  if test "${ac_cv_path_mkdir+set}" = set; then
-    MKDIR_P="$ac_cv_path_mkdir -p"
-  else
-    # As a last resort, use the slow shell script.  Don't cache a
-    # value for MKDIR_P within a source directory, because that will
-    # break other packages using the cache if that directory is
-    # removed, or if the value is a relative name.
-    MKDIR_P="$ac_install_sh -d"
-  fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
-$as_echo "$MKDIR_P" >&6; }
 
-for ac_prog in gawk mawk nawk awk
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-$as_echo_n "checking for $ac_word... " >&6; }
-if ${ac_cv_prog_AWK+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -n "$AWK"; then
-  ac_cv_prog_AWK="$AWK" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  test -z "$as_dir" && as_dir=.
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
-    ac_cv_prog_AWK="$ac_prog"
-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
 
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
 fi
-fi
-AWK=$ac_cv_prog_AWK
-if test -n "$AWK"; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
-$as_echo "$AWK" >&6; }
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-fi
-
-
-  test -n "$AWK" && break
-done
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
-$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
-set x ${MAKE-make}
-ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
-if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  cat >conftest.make <<\_ACEOF
-SHELL = /bin/sh
-all:
-	@echo '@@@%%%=$(MAKE)=@@@%%%'
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
 _ACEOF
-# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
-case `${MAKE-make} -f conftest.make 2>/dev/null` in
-  *@@@%%%=?*=@@@%%%*)
-    eval ac_cv_prog_make_${ac_make}_set=yes;;
-  *)
-    eval ac_cv_prog_make_${ac_make}_set=no;;
-esac
-rm -f conftest.make
-fi
-if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-  SET_MAKE=
-else
-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-  SET_MAKE="MAKE=${MAKE-make}"
-fi
+if ac_fn_c_try_cpp "$LINENO"; then :
 
-rm -rf .tst 2>/dev/null
-mkdir .tst 2>/dev/null
-if test -d .tst; then
-  am__leading_dot=.
 else
-  am__leading_dot=_
+  # Broken: fails on valid input.
+continue
 fi
-rmdir .tst 2>/dev/null
-
-DEPDIR="${am__leading_dot}deps"
-
-ac_config_commands="$ac_config_commands depfiles"
-
+rm -f conftest.err conftest.i conftest.$ac_ext
 
-am_make=${MAKE-make}
-cat > confinc << 'END'
-am__doit:
-	@echo this is the am__doit target
-.PHONY: am__doit
-END
-# If we don't find an include directive, just comment out the code.
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
-$as_echo_n "checking for style of include used by $am_make... " >&6; }
-am__include="#"
-am__quote=
-_am_result=none
-# First try GNU make style include.
-echo "include confinc" > confmf
-# Ignore all kinds of additional output from 'make'.
-case `$am_make -s -f confmf 2> /dev/null` in #(
-*the\ am__doit\ target*)
-  am__include=include
-  am__quote=
-  _am_result=GNU
-  ;;
-esac
-# Now try BSD make style include.
-if test "$am__include" = "#"; then
-   echo '.include "confinc"' > confmf
-   case `$am_make -s -f confmf 2> /dev/null` in #(
-   *the\ am__doit\ target*)
-     am__include=.include
-     am__quote="\""
-     _am_result=BSD
-     ;;
-   esac
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
-$as_echo "$_am_result" >&6; }
-rm -f confinc confmf
+    done
+    ac_cv_prog_CPP=$CPP
 
-# Check whether --enable-dependency-tracking was given.
-if test "${enable_dependency_tracking+set}" = set; then :
-  enableval=$enable_dependency_tracking;
 fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
 
-if test "x$enable_dependency_tracking" != xno; then
-  am_depcomp="$ac_aux_dir/depcomp"
-  AMDEPBACKSLASH='\'
-  am__nodep='_no'
+else
+  # Broken: fails on valid input.
+continue
 fi
- if test "x$enable_dependency_tracking" != xno; then
-  AMDEP_TRUE=
-  AMDEP_FALSE='#'
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
 else
-  AMDEP_TRUE='#'
-  AMDEP_FALSE=
+  # Passes both tests.
+ac_preproc_ok=:
+break
 fi
+rm -f conftest.err conftest.i conftest.$ac_ext
 
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
 
-# Check whether --enable-silent-rules was given.
-if test "${enable_silent_rules+set}" = set; then :
-  enableval=$enable_silent_rules;
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
-case $enable_silent_rules in # (((
-  yes) AM_DEFAULT_VERBOSITY=0;;
-   no) AM_DEFAULT_VERBOSITY=1;;
-    *) AM_DEFAULT_VERBOSITY=1;;
-esac
-am_make=${MAKE-make}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
-$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
-if ${am_cv_make_support_nested_variables+:} false; then :
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if $as_echo 'TRUE=$(BAR$(V))
-BAR0=false
-BAR1=true
-V=1
-am__doit:
-	@$(TRUE)
-.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
-  am_cv_make_support_nested_variables=yes
-else
-  am_cv_make_support_nested_variables=no
-fi
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
-$as_echo "$am_cv_make_support_nested_variables" >&6; }
-if test $am_cv_make_support_nested_variables = yes; then
-    AM_V='$(V)'
-  AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
-else
-  AM_V=$AM_DEFAULT_VERBOSITY
-  AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
-fi
-AM_BACKSLASH='\'
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_GREP" || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
 
-if test "`cd $srcdir && pwd`" != "`pwd`"; then
-  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
-  # is not polluted with repeated "-I."
-  am__isrc=' -I$(srcdir)'
-  # test to see if srcdir already configured
-  if test -f $srcdir/config.status; then
-    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
   fi
+else
+  ac_cv_path_GREP=$GREP
 fi
 
-# test whether we have cygpath
-if test -z "$CYGPATH_W"; then
-  if (cygpath --version) >/dev/null 2>/dev/null; then
-    CYGPATH_W='cygpath -w'
-  else
-    CYGPATH_W=echo
-  fi
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
 
 
-# Define the identity of the package.
-
- PACKAGE=lgeneral
- VERSION=1.3.1
-
-
-cat >>confdefs.h <<_ACEOF
-#define PACKAGE "$PACKAGE"
-_ACEOF
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_EGREP" || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
 
-cat >>confdefs.h <<_ACEOF
-#define VERSION "$VERSION"
-_ACEOF
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
 
-# Some tools Automake needs.
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
 
-ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
 
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
 
-AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+int
+main ()
+{
 
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 
-AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
 
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
 
-AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
+fi
 
-MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
 
-# For better backward compatibility.  To be removed once Automake 1.9.x
-# dies out for good.  For more background, see:
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
-# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
-mkdir_p='$(MKDIR_P)'
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
 
-# We need awk for the "check" target.  The system "awk" is bad on
-# some platforms.
-# Always define AMTAR for backward compatibility.  Yes, it's still used
-# in the wild :-(  We should find a proper way to deprecate it ...
-AMTAR='$${TAR-tar}'
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
 
+fi
 
-# We'll loop over all known methods to create a tar archive until one works.
-_am_tools='gnutar  pax cpio none'
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
 
-am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
 
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
 
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
 
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
 
+fi
 
-depcc="$CC"   am_compiler_list=
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
 
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
-$as_echo_n "checking dependency style of $depcc... " >&6; }
-if ${am_cv_CC_dependencies_compiler_type+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
-  # We make a subdir and do the tests there.  Otherwise we can end up
-  # making bogus files that we don't know about and never remove.  For
-  # instance it was reported that on HP-UX the gcc test will end up
-  # making a dummy file named 'D' -- because '-MD' means "put the output
-  # in D".
-  rm -rf conftest.dir
-  mkdir conftest.dir
-  # Copy depcomp to subdir because otherwise we won't find it if we're
-  # using a relative directory.
-  cp "$am_depcomp" conftest.dir
-  cd conftest.dir
-  # We will build objects and dependencies in a subdirectory because
-  # it helps to detect inapplicable dependency modes.  For instance
-  # both Tru64's cc and ICC support -MD to output dependencies as a
-  # side effect of compilation, but ICC will put the dependencies in
-  # the current directory while Tru64 will put them in the object
-  # directory.
-  mkdir sub
+fi
 
-  am_cv_CC_dependencies_compiler_type=none
-  if test "$am_compiler_list" = ""; then
-     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
-  fi
-  am__universal=false
-  case " $depcc " in #(
-     *\ -arch\ *\ -arch\ *) am__universal=true ;;
-     esac
+done
 
-  for depmode in $am_compiler_list; do
-    # Setup a source with many dependencies, because some compilers
-    # like to wrap large dependency lists on column 80 (with \), and
-    # we should not choose a depcomp mode which is confused by this.
-    #
-    # We need to recreate these files for each test, as the compiler may
-    # overwrite some of them when testing with obscure command lines.
-    # This happens at least with the AIX C compiler.
-    : > sub/conftest.c
-    for i in 1 2 3 4 5 6; do
-      echo '#include "conftst'$i'.h"' >> sub/conftest.c
-      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
-      # Solaris 10 /bin/sh.
-      echo '/* dummy */' > sub/conftst$i.h
-    done
-    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
 
-    # We check with '-c' and '-o' for the sake of the "dashmstdout"
-    # mode.  It turns out that the SunPro C++ compiler does not properly
-    # handle '-M -o', and we need to detect this.  Also, some Intel
-    # versions had trouble with output in subdirs.
-    am__obj=sub/conftest.${OBJEXT-o}
-    am__minus_obj="-o $am__obj"
-    case $depmode in
-    gcc)
-      # This depmode causes a compiler race in universal mode.
-      test "$am__universal" = false || continue
-      ;;
-    nosideeffect)
-      # After this tag, mechanisms are not by side-effect, so they'll
-      # only be used when explicitly requested.
-      if test "x$enable_dependency_tracking" = xyes; then
-	continue
-      else
-	break
-      fi
-      ;;
-    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
-      # This compiler won't grok '-c -o', but also, the minuso test has
-      # not run yet.  These depmodes are late enough in the game, and
-      # so weak that their functioning should not be impacted.
-      am__obj=conftest.${OBJEXT-o}
-      am__minus_obj=
-      ;;
-    none) break ;;
-    esac
-    if depmode=$depmode \
-       source=sub/conftest.c object=$am__obj \
-       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
-       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
-         >/dev/null 2>conftest.err &&
-       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
-       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
-       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
-      # icc doesn't choke on unknown options, it will just issue warnings
-      # or remarks (even with -Werror).  So we grep stderr for any message
-      # that says an option was ignored or not supported.
-      # When given -MP, icc 7.0 and 7.1 complain thusly:
-      #   icc: Command line warning: ignoring option '-M'; no argument required
-      # The diagnosis changed in icc 8.0:
-      #   icc: Command line remark: option '-MP' not supported
-      if (grep 'ignoring option' conftest.err ||
-          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
-        am_cv_CC_dependencies_compiler_type=$depmode
-        break
-      fi
-    fi
-  done
 
-  cd ..
-  rm -rf conftest.dir
+  ac_fn_c_check_header_mongrel "$LINENO" "minix/config.h" "ac_cv_header_minix_config_h" "$ac_includes_default"
+if test "x$ac_cv_header_minix_config_h" = xyes; then :
+  MINIX=yes
 else
-  am_cv_CC_dependencies_compiler_type=none
+  MINIX=
 fi
 
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
-$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
-CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
 
- if
-  test "x$enable_dependency_tracking" != xno \
-  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
-  am__fastdepCC_TRUE=
-  am__fastdepCC_FALSE='#'
-else
-  am__fastdepCC_TRUE='#'
-  am__fastdepCC_FALSE=
-fi
+  if test "$MINIX" = yes; then
+
+$as_echo "#define _POSIX_SOURCE 1" >>confdefs.h
 
 
+$as_echo "#define _POSIX_1_SOURCE 2" >>confdefs.h
 
-# POSIX will say in a future version that running "rm -f" with no argument
-# is OK; and we want to be able to make that assumption in our Makefile
-# recipes.  So use an aggressive probe to check that the usage we want is
-# actually supported "in the wild" to an acceptable degree.
-# See automake bug#10828.
-# To make any issue more visible, cause the running configure to be aborted
-# by default if the 'rm' program in use doesn't match our expectations; the
-# user can still override this though.
-if rm -f && rm -fr && rm -rf; then : OK; else
-  cat >&2 <<'END'
-Oops!
 
-Your 'rm' program seems unable to run without file operands specified
-on the command line, even when the '-f' option is present.  This is contrary
-to the behaviour of most rm programs out there, and not conforming with
-the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+$as_echo "#define _MINIX 1" >>confdefs.h
 
-Please tell bug-automake at gnu.org about your system, including the value
-of your $PATH and any error possibly output before this message.  This
-can help us improve future automake versions.
+  fi
 
-END
-  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
-    echo 'Configuration will proceed anyway, since you have set the' >&2
-    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
-    echo >&2
-  else
-    cat >&2 <<'END'
-Aborting the configuration process, to ensure you take notice of the issue.
 
-You can download and install GNU coreutils to get an 'rm' implementation
-that behaves properly: <http://www.gnu.org/software/coreutils/>.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether it is safe to define __EXTENSIONS__" >&5
+$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; }
+if ${ac_cv_safe_to_define___extensions__+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
 
-If you want to complete the configuration process using your problematic
-'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
-to "yes", and re-run configure.
+#         define __EXTENSIONS__ 1
+          $ac_includes_default
+int
+main ()
+{
 
-END
-    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
-  fi
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_safe_to_define___extensions__=yes
+else
+  ac_cv_safe_to_define___extensions__=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
 fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_safe_to_define___extensions__" >&5
+$as_echo "$ac_cv_safe_to_define___extensions__" >&6; }
+  test $ac_cv_safe_to_define___extensions__ = yes &&
+    $as_echo "#define __EXTENSIONS__ 1" >>confdefs.h
+
+  $as_echo "#define _ALL_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _GNU_SOURCE 1" >>confdefs.h
+
+  $as_echo "#define _POSIX_PTHREAD_SEMANTICS 1" >>confdefs.h
+
+  $as_echo "#define _TANDEM_SOURCE 1" >>confdefs.h
+
+
 
 ac_config_headers="$ac_config_headers config.h"
 
@@ -5369,6 +5383,134 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
 ac_compiler_gnu=$ac_cv_c_compiler_gnu
 
 
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
 if test -n "$ac_tool_prefix"; then
   # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
@@ -5464,7 +5606,7 @@ fi
 
 
 CFLAGS="$CFLAGS -Wall -std=gnu89"
-#CFLAGS="-O0 -g -Wall"
+CFLAGS="$CFLAGS -O0 -g"
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lm" >&5
 $as_echo_n "checking for main in -lm... " >&6; }
@@ -5636,7 +5778,7 @@ $as_echo "$USE_NLS" >&6; }
 
 
 
-      GETTEXT_MACRO_VERSION=0.18
+      GETTEXT_MACRO_VERSION=0.19
 
 
 
@@ -7152,26 +7294,42 @@ fi
         # Test whether both pthread_mutex_lock and pthread_mutexattr_init exist
         # in libc. IRIX 6.5 has the first one in both libc and libpthread, but
         # the second one only in libpthread, and lock.c needs it.
-        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+        #
+        # If -pthread works, prefer it to -lpthread, since Ubuntu 14.04
+        # needs -pthread for some reason.  See:
+        # http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00023.html
+        save_LIBS=$LIBS
+        for gl_pthread in '' '-pthread'; do
+          LIBS="$LIBS $gl_pthread"
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 #include <pthread.h>
+                 pthread_mutex_t m;
+                 pthread_mutexattr_t ma;
+
 int
 main ()
 {
-pthread_mutex_lock((pthread_mutex_t*)0);
-               pthread_mutexattr_init((pthread_mutexattr_t*)0);
+pthread_mutex_lock (&m);
+                 pthread_mutexattr_init (&ma);
   ;
   return 0;
 }
 _ACEOF
 if ac_fn_c_try_link "$LINENO"; then :
   gl_have_pthread=yes
+             LIBTHREAD=$gl_pthread LTLIBTHREAD=$gl_pthread
+             LIBMULTITHREAD=$gl_pthread LTLIBMULTITHREAD=$gl_pthread
 fi
 rm -f core conftest.err conftest.$ac_objext \
     conftest$ac_exeext conftest.$ac_ext
+          LIBS=$save_LIBS
+          test -n "$gl_have_pthread" && break
+        done
+
         # Test for libpthread by looking for pthread_kill. (Not pthread_self,
         # since it is defined as a macro on OSF/1.)
-        if test -n "$gl_have_pthread"; then
+        if test -n "$gl_have_pthread" && test -z "$LIBTHREAD"; then
           # The program links fine without libpthread. But it may actually
           # need to link with libpthread in order to create multiple threads.
           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
@@ -7225,7 +7383,7 @@ $as_echo "#define PTHREAD_IN_USE_DETECTION_HARD 1" >>confdefs.h
 
 fi
 
-        else
+        elif test -z "$gl_have_pthread"; then
           # Some library is needed. Try libpthread and libc_r.
           { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_kill in -lpthread" >&5
 $as_echo_n "checking for pthread_kill in -lpthread... " >&6; }
@@ -8576,36 +8734,42 @@ else
       if test $am_cv_lib_iconv = yes; then
         LIBS="$LIBS $LIBICONV"
       fi
-      if test "$cross_compiling" = yes; then :
-
-         case "$host_os" in
-           aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
-           *)            am_cv_func_iconv_works="guessing yes" ;;
-         esac
-
+      am_cv_func_iconv_works=no
+      for ac_iconv_const in '' 'const'; do
+        if test "$cross_compiling" = yes; then :
+  case "$host_os" in
+             aix* | hpux*) am_cv_func_iconv_works="guessing no" ;;
+             *)            am_cv_func_iconv_works="guessing yes" ;;
+           esac
 else
   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
 /* end confdefs.h.  */
 
 #include <iconv.h>
 #include <string.h>
-int main ()
+
+#ifndef ICONV_CONST
+# define ICONV_CONST $ac_iconv_const
+#endif
+
+int
+main ()
 {
-  int result = 0;
+int result = 0;
   /* Test against AIX 5.1 bug: Failures are not distinguishable from successful
      returns.  */
   {
     iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8");
     if (cd_utf8_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\342\202\254"; /* EURO SIGN */
+        static ICONV_CONST char input[] = "\342\202\254"; /* EURO SIGN */
         char buf[10];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_utf8_to_88591,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
           result |= 1;
@@ -8618,14 +8782,14 @@ int main ()
     iconv_t cd_ascii_to_88591 = iconv_open ("ISO8859-1", "646");
     if (cd_ascii_to_88591 != (iconv_t)(-1))
       {
-        static const char input[] = "\263";
+        static ICONV_CONST char input[] = "\263";
         char buf[10];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_ascii_to_88591,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res == 0)
           result |= 2;
@@ -8637,14 +8801,14 @@ int main ()
     iconv_t cd_88591_to_utf8 = iconv_open ("UTF-8", "ISO-8859-1");
     if (cd_88591_to_utf8 != (iconv_t)(-1))
       {
-        static const char input[] = "\304";
+        static ICONV_CONST char input[] = "\304";
         static char buf[2] = { (char)0xDE, (char)0xAD };
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = 1;
         char *outptr = buf;
         size_t outbytesleft = 1;
         size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if (res != (size_t)(-1) || outptr - buf > 1 || buf[1] != (char)0xAD)
           result |= 4;
@@ -8657,14 +8821,14 @@ int main ()
     iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591");
     if (cd_88591_to_utf8 != (iconv_t)(-1))
       {
-        static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
+        static ICONV_CONST char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337";
         char buf[50];
-        const char *inptr = input;
+        ICONV_CONST char *inptr = input;
         size_t inbytesleft = strlen (input);
         char *outptr = buf;
         size_t outbytesleft = sizeof (buf);
         size_t res = iconv (cd_88591_to_utf8,
-                            (char **) &inptr, &inbytesleft,
+                            &inptr, &inbytesleft,
                             &outptr, &outbytesleft);
         if ((int)res > 0)
           result |= 8;
@@ -8684,17 +8848,20 @@ int main ()
       && iconv_open ("utf8", "eucJP") == (iconv_t)(-1))
     result |= 16;
   return result;
+
+  ;
+  return 0;
 }
 _ACEOF
 if ac_fn_c_try_run "$LINENO"; then :
   am_cv_func_iconv_works=yes
-else
-  am_cv_func_iconv_works=no
 fi
 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
   conftest.$ac_objext conftest.beam conftest.$ac_ext
 fi
 
+        test "$am_cv_func_iconv_works" = no || break
+      done
       LIBS="$am_save_LIBS"
 
 fi
@@ -8827,6 +8994,20 @@ fi
 done
 
 
+      if test $ac_cv_func_uselocale = yes; then
+    for ac_func in getlocalename_l
+do :
+  ac_fn_c_check_func "$LINENO" "getlocalename_l" "ac_cv_func_getlocalename_l"
+if test "x$ac_cv_func_getlocalename_l" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETLOCALENAME_L 1
+_ACEOF
+
+fi
+done
+
+  fi
+
           ac_fn_c_check_decl "$LINENO" "feof_unlocked" "ac_cv_have_decl_feof_unlocked" "#include <stdio.h>
 "
 if test "x$ac_cv_have_decl_feof_unlocked" = xyes; then :
@@ -8853,7 +9034,7 @@ _ACEOF
 
 
 
-                      for ac_prog in bison
+                    for ac_prog in bison
 do
   # Extract the first word of "$ac_prog", so it can be a program name with args.
 set dummy $ac_prog; ac_word=$2
@@ -8903,7 +9084,7 @@ $as_echo_n "checking version of bison... " >&6; }
     ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
     case $ac_prog_version in
       '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-      1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*)
+      2.[7-9]* | [3-9].*)
          ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
       *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
     esac
@@ -9546,6 +9727,11 @@ $as_echo "#define HAVE_CFLOCALECOPYCURRENT 1" >>confdefs.h
 
 
 
+
+
+
+
+
     case "$enable_silent_rules" in
     yes) INTL_DEFAULT_VERBOSITY=0;;
     no)  INTL_DEFAULT_VERBOSITY=1;;
@@ -10785,7 +10971,7 @@ $as_echo_n "checking whether xgettext needs --from-code... " >&6; }
   ac_xgettext_needs_from_code=error
   ac_xgettext_from_code=--from-code=iso-8859-1
   cat <<EOF >ac_tmp.c
-int main() { _("�������"); }
+int main() { _("�������"); }
 EOF
   $XGETTEXT -k_ $ac_xgettext_from_code ac_tmp.c >/dev/null 2>&1 && ac_xgettext_needs_from_code=yes
   $XGETTEXT -k_ ac_tmp.c >/dev/null 2>&1 && ac_xgettext_needs_from_code=no
@@ -11304,6 +11490,14 @@ $as_echo_n "checking that generated files are newer than configure... " >&6; }
    fi
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
 $as_echo "done" >&6; }
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
 if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
   as_fn_error $? "conditional \"AMDEP\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -11312,14 +11506,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
   as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
- if test -n "$EXEEXT"; then
-  am__EXEEXT_TRUE=
-  am__EXEEXT_FALSE='#'
-else
-  am__EXEEXT_TRUE='#'
-  am__EXEEXT_FALSE=
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
-
 if test -z "${compile_paths_linux_TRUE}" && test -z "${compile_paths_linux_FALSE}"; then
   as_fn_error $? "conditional \"compile_paths_linux\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -11721,7 +11911,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by $as_me, which was
+This file was extended by lgeneral $as_me 1.4.3, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -11787,7 +11977,7 @@ _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-config.status
+lgeneral config.status 1.4.3
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
diff --git a/configure.in b/configure.in
index e009eff..3f80ef9 100644
--- a/configure.in
+++ b/configure.in
@@ -1,11 +1,11 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT(Makefile.am)
+AC_INIT(lgeneral,1.4.3)
+AC_CONFIG_SRCDIR(Makefile.am)
+AM_INIT_AUTOMAKE
 
 AC_CANONICAL_TARGET
 AC_USE_SYSTEM_EXTENSIONS
 
-AM_INIT_AUTOMAKE(lgeneral,1.3.1)
-
 AM_CONFIG_HEADER(config.h)
 
 dnl Checks for programs.
@@ -15,7 +15,7 @@ AM_PROG_CC_C_O
 
 dnl various CFLAGS
 CFLAGS="$CFLAGS -Wall -std=gnu89"
-#CFLAGS="-O0 -g -Wall"
+CFLAGS="$CFLAGS -O0 -g"
 
 dnl Checks for libraries.
 AC_CHECK_LIB(m, main,, AC_MSG_ERROR(maths library is needed))
@@ -57,7 +57,7 @@ if test x$USE_NLS = xyes -a x$XGETTEXT != "x:" ; then
   ac_xgettext_needs_from_code=error
   ac_xgettext_from_code=--from-code=iso-8859-1
   cat <<EOF >ac_tmp.c
-int main() { _("�������"); }
+int main() { _("�������"); }
 EOF
   $XGETTEXT -k_ $ac_xgettext_from_code ac_tmp.c >/dev/null 2>&1 && ac_xgettext_needs_from_code=yes
   $XGETTEXT -k_ ac_tmp.c >/dev/null 2>&1 && ac_xgettext_needs_from_code=no
diff --git a/lgc-pg/Makefile.in b/lgc-pg/Makefile.in
index 1064b9d..1cc51bf 100644
--- a/lgc-pg/Makefile.in
+++ b/lgc-pg/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -81,13 +91,12 @@ host_triplet = @host@
 target_triplet = @target@
 bin_PROGRAMS = lgc-pg$(EXEEXT) shptool$(EXEEXT)
 subdir = lgc-pg
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -214,6 +223,8 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -396,6 +407,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -437,7 +449,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lgc-pg/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign lgc-pg/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -1045,6 +1056,8 @@ uninstall-man: uninstall-man1
 	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
 	uninstall-man uninstall-man1
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/lgc-pg/convdata/Makefile.in b/lgc-pg/convdata/Makefile.in
index 10cb9a4..e8b91eb 100644
--- a/lgc-pg/convdata/Makefile.in
+++ b/lgc-pg/convdata/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,13 +90,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = lgc-pg/convdata
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs COPYING
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -140,6 +149,8 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(convdatadir)"
 DATA = $(convdata_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \
+	COPYING
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -297,6 +308,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -333,7 +345,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lgc-pg/convdata/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign lgc-pg/convdata/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -526,6 +537,8 @@ uninstall-am: uninstall-convdataDATA
 	pdf-am ps ps-am tags-am uninstall uninstall-am \
 	uninstall-convdataDATA
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/lgc-pg/maps.c b/lgc-pg/maps.c
index 7fb9d87..66d4415 100644
--- a/lgc-pg/maps.c
+++ b/lgc-pg/maps.c
@@ -162,11 +162,11 @@ int maps_convert( int map_id )
             fprintf( dest_file, "@\n" );
         /* terrain types */
         if (map_id == -1)
-            fprintf( dest_file, "terrain_db�%s.tdb\n", target_name );
+            fprintf( dest_file, "terrain_db=%s.tdb\n", target_name );
         else
-            fprintf( dest_file, "terrain_db�pg.tdb\n" );
+            fprintf( dest_file, "terrain_db=pg.tdb\n" );
         /* domain */
-        fprintf( dest_file, "domain�pg\n" );
+        fprintf( dest_file, "domain=pg\n" );
         /* read/write map size */
         width = height = 0;
         fseek( source_file, 101, SEEK_SET );
@@ -176,10 +176,10 @@ int maps_convert( int map_id )
         _fread( &height, 2, 1, source_file ); 
         height = SDL_SwapLE16( height );
         width++; height++;
-        fprintf( dest_file, "width�%i\nheight�%i\n", width, height );
+        fprintf( dest_file, "width=%i\nheight=%i\n", width, height );
         /* picture ids */
         fseek( source_file, 123 + 5 * width * height, SEEK_SET );
-        fprintf( dest_file, "tiles�" );
+        fprintf( dest_file, "tiles=" );
         for ( y = 0; y < height; y++ ) {
             for ( x = 0; x < width; x++ ) {
                 tile_id = 0;
@@ -188,11 +188,11 @@ int maps_convert( int map_id )
                 tile_get_id_string( tile_id, map_tile_str );
                 fprintf( dest_file, "%s", map_tile_str );
                 if ( y < height - 1 || x < width - 1 )
-                    fprintf( dest_file, "�" );
+                    fprintf( dest_file, "&" );
             }
         }
         fprintf( dest_file, "\n" );
-        fprintf( dest_file, "names�" );
+        fprintf( dest_file, "names=" );
         fseek( source_file, 123, SEEK_SET );
         for ( y = 0; y < height; y++ ) {
             for ( x = 0; x < width; x++ ) {
@@ -201,7 +201,7 @@ int maps_convert( int map_id )
                 tile_get_name( name_file, ibuf, name_buf );
                 fprintf( dest_file, "%s", name_buf );
                 if ( y < height - 1 || x < width - 1 )
-                    fprintf( dest_file, "�" );
+                    fprintf( dest_file, "&" );
             }
         }
         fprintf( dest_file, "\n" );
diff --git a/lgc-pg/nations.c b/lgc-pg/nations.c
index 3673549..28a4cea 100644
--- a/lgc-pg/nations.c
+++ b/lgc-pg/nations.c
@@ -90,13 +90,13 @@ int nations_convert( void )
         return 0;
     }
     fprintf( file, "@\n" );
-    fprintf( file, "icons�%s.bmp\n", target_name );
-    fprintf( file, "icon_width�20\nicon_height�13\n" );
+    fprintf( file, "icons=%s.bmp\n", target_name );
+    fprintf( file, "icon_width=20\nicon_height=13\n" );
     /* domain */
-    fprintf( file, "domain�pg\n" );
+    fprintf( file, "domain=pg\n" );
     fprintf( file, "<nations\n" );
     for ( i = 0; i < nation_count; i++ )
-        fprintf( file, "<%s\nname�%s\nicon_id�%s\n>\n", nations[i * 3], nations[i * 3 + 1], nations[i * 3 + 2] );
+        fprintf( file, "<%s\nname=%s\nicon_id=%s\n>\n", nations[i * 3], nations[i * 3 + 1], nations[i * 3 + 2] );
     fprintf( file, ">\n" );
     fclose( file );
     
diff --git a/lgc-pg/parser.c b/lgc-pg/parser.c
index 37d2111..e9ac5a8 100644
--- a/lgc-pg/parser.c
+++ b/lgc-pg/parser.c
@@ -445,6 +445,12 @@ static int parser_read_file_full( FILE *file, PData *top )
 }
 static int parser_read_file_compact( PData *section )
 {
+	char entryToken1 = 0xbb;
+	char itemToken1 = 0xb0;
+	char entryToken2 = '=';
+	char itemToken2 = '&';
+	int useNewTokens = 0;
+
     /* section is the parent pdata that needs some 
        entries */
     PData *pd = 0;
@@ -467,14 +473,19 @@ static int parser_read_file_compact( PData *section )
                 /* read values as subsection */
                 pd = calloc( 1, sizeof( PData ) );
                 /* check name */
-                if ( ( cur = strchr( line, '�' ) ) == 0 ) {
-                    sprintf( parser_sub_error, "parse error: use '�' for assignment or '<' for section" );
-                    return 0;
+                if ( ( cur = strchr( line, entryToken1 ) ) == 0 ) {
+                	if ( ( cur = strchr( line, entryToken2 ) ) == 0 ) {
+                		sprintf( parser_sub_error,
+                				"parse error: use '%c' or '%c' for assignment or '<' for section",
+                				entryToken1, entryToken2 );
+                		return 0;
+                	} else
+                		useNewTokens = 1;
                 }
                 cur[0] = 0; cur++;
                 pd->name = strdup( line );
                 /* get values */
-                pd->values = parser_explode_string( cur, '�' );
+                pd->values = parser_explode_string( cur, useNewTokens?itemToken2:itemToken1 );
                 /* add to section */
                 list_add( section->entries, pd );
                 break;
diff --git a/lgc-pg/scenarios.c b/lgc-pg/scenarios.c
index 04c2961..9796f61 100644
--- a/lgc-pg/scenarios.c
+++ b/lgc-pg/scenarios.c
@@ -295,7 +295,7 @@ int scen_add_flags( FILE *dest_file, FILE *scen_file, int id )
                     if ( vic_hexes[i * 2] == x && vic_hexes[i * 2 + 1] == y ) {
                         obj = 1; break;
                     }
-                fprintf( dest_file, "<flag\nx�%i\ny�%i\nnation�%s\nobj�%i\n>\n", x, y, nations[(ibuf - 1) * 3], obj );
+                fprintf( dest_file, "<flag\nx=%i\ny=%i\nnation=%s\nobj=%i\n>\n", x, y, nations[(ibuf - 1) * 3], obj );
             }
         }
     }
@@ -357,12 +357,12 @@ void scen_create_random_weather( FILE *dest_file, FILE *scen_file, int month, in
     }
    
     /* write weather */
-    fprintf( dest_file, "weather�" );
+    fprintf( dest_file, "weather=" );
     i = 0;
     while ( i < turns ) {
         fprintf( dest_file, "%s", weather[i]==0?"fair":weather[i]==1?"clouds":weather[i]==2?"rain":"snow" );
         if ( i < turns - 1 )
-            fprintf( dest_file, "�" );
+            fprintf( dest_file, "&" );
         i++;
     }
     fprintf( dest_file, "\n" );
@@ -380,8 +380,8 @@ void scen_create_pg_weather( FILE *dest_file, int scen_id, FILE *scen_file, int
     char *weathers[] = {
         "fffffroRff",
         "ffffffffffffrooorRff",
-        "fffforRRRmfffforRROffffff",
-        "fffffffrROooffffffffffooroffff",
+        "fffforRRRmfffforRRoffffff",
+        "fffffffrRoooffffffffffooroffff",
         "ffffffffffffoorfffffffffff",
         "ffffffooorfffff",
         "",
@@ -423,7 +423,7 @@ void scen_create_pg_weather( FILE *dest_file, int scen_id, FILE *scen_file, int
         fprintf(stderr,"ERROR: scen %d: mismatch in length of weather (%d) and turn number (%d)\n",
                 scen_id,strlen(weathers[scen_id]),turns);
     /* write weather */
-    fprintf( dest_file, "weather�" );
+    fprintf( dest_file, "weather=" );
     i = 0;
     while ( i < turns ) {
         if (weathers[0]==0)
@@ -438,7 +438,7 @@ void scen_create_pg_weather( FILE *dest_file, int scen_id, FILE *scen_file, int
         }
         fprintf( dest_file, "%s", w );
         if ( i < turns - 1 )
-            fprintf( dest_file, "�" );
+            fprintf( dest_file, "&" );
         i++;
     }
     fprintf( dest_file, "\n" );
@@ -483,19 +483,19 @@ void scen_create_unit( int scen_id, FILE *dest_file, FILE *scen_file, int is_cor
             unit_entry_used[org_trsp_id - 1] = 1;
     /* write unit */
     fprintf( dest_file, "<unit\n" );
-    fprintf( dest_file, "id�%i\nnation�%s\n", 
+    fprintf( dest_file, "id=%i\nnation=%s\n",
     					 id - 1, nations[nation * 3]);
 	if (is_core_unit)
-		fprintf( dest_file, "core�1\n");
-    fprintf( dest_file, "x�%i\ny�%i\n", x, y );
-    fprintf( dest_file, "str�%i\nentr�%i\nexp�%i\n", str, entr, exp );
+		fprintf( dest_file, "core=1\n");
+    fprintf( dest_file, "x=%i\ny=%i\n", x, y );
+    fprintf( dest_file, "str=%i\nentr=%i\nexp=%i\n", str, entr, exp );
     if ( trsp_id == 0 && org_trsp_id == 0 )
-        fprintf( dest_file, "trsp�none\n" );
+        fprintf( dest_file, "trsp=none\n" );
     else {
         if ( trsp_id ) 
-            fprintf( dest_file, "trsp�%i\n", trsp_id - 1 );
+            fprintf( dest_file, "trsp=%i\n", trsp_id - 1 );
         else
-            fprintf( dest_file, "trsp�%i\n", org_trsp_id - 1 );
+            fprintf( dest_file, "trsp=%i\n", org_trsp_id - 1 );
     }
     fprintf( dest_file, ">\n" );
 }
@@ -551,8 +551,8 @@ int major_limits[] = {
 };
 #define COND_BEGIN fprintf( file, "<cond\n" )
 #define COND_END   fprintf( file, ">\n" )
-#define COND_RESULT( str ) fprintf( file, "result�%s\n", str )
-#define COND_MESSAGE( str ) fprintf( file, "message�%s\n", str )
+#define COND_RESULT( str ) fprintf( file, "result=%s\n", str )
+#define COND_MESSAGE( str ) fprintf( file, "message=%s\n", str )
 void scen_add_vic_conds( FILE *file, int id )
 {
     /* for panzer general the check is usually run every turn.
@@ -565,18 +565,18 @@ void scen_add_vic_conds( FILE *file, int id )
      *    the end 
      */
     if ( id == 15 || id == 16 || id == 17 )
-        fprintf( file, "<result\ncheck�last_turn\n" );
+        fprintf( file, "<result\ncheck=last_turn\n" );
     else
-        fprintf( file, "<result\ncheck�every_turn\n" );
+        fprintf( file, "<result\ncheck=every_turn\n" );
     /* add conditions */
     if ( major_limits[id] != -1 ) {
         COND_BEGIN;
-        fprintf( file, "<and\n<control_all_hexes\nplayer�axis\n>\n<turns_left\ncount�%i\n>\n>\n", major_limits[id] );
+        fprintf( file, "<and\n<control_all_hexes\nplayer=axis\n>\n<turns_left\ncount=%i\n>\n>\n", major_limits[id] );
         COND_RESULT( "major" ); 
         COND_MESSAGE( "Axis Major Victory" );
         COND_END;
         COND_BEGIN;
-        fprintf( file, "<and\n<control_all_hexes\nplayer�axis\n>\n>\n" );
+        fprintf( file, "<and\n<control_all_hexes\nplayer=axis\n>\n>\n" );
         COND_RESULT( "minor" ); 
         COND_MESSAGE( "Axis Minor Victory" );
         COND_END;
@@ -590,20 +590,20 @@ void scen_add_vic_conds( FILE *file, int id )
         /* ardennes is a special axis offensive */
         COND_BEGIN;
         fprintf( file, "<and\n"\
-                       "<control_hex\nplayer�axis\nx�16\ny�16\n>\n"\
-                       "<control_hex\nplayer�axis\nx�26\ny�4\n>\n"\
-                       "<control_hex\nplayer�axis\nx�27\ny�21\n>\n"\
-                       "<control_hex\nplayer�axis\nx�39\ny�21\n>\n"\
-                       "<control_hex\nplayer�axis\nx�48\ny�8\n>\n"\
-                       "<control_hex\nplayer�axis\nx�54\ny�14\n>\n"\
-                       "<control_hex\nplayer�axis\nx�59\ny�18\n>\n"\
+                       "<control_hex\nplayer=axis\nx=16\ny=16\n>\n"\
+                       "<control_hex\nplayer=axis\nx=26\ny=4\n>\n"\
+                       "<control_hex\nplayer=axis\nx=27\ny=21\n>\n"\
+                       "<control_hex\nplayer=axis\nx=39\ny=21\n>\n"\
+                       "<control_hex\nplayer=axis\nx=48\ny=8\n>\n"\
+                       "<control_hex\nplayer=axis\nx=54\ny=14\n>\n"\
+                       "<control_hex\nplayer=axis\nx=59\ny=18\n>\n"\
                        ">\n" );
         COND_RESULT( "minor" );
         COND_MESSAGE( "Axis Minor Victory" ); 
         COND_END;
         /* major victory */
         COND_BEGIN;
-        fprintf( file, "<or\n<control_all_hexes\nplayer�axis\n>\n>\n" );
+        fprintf( file, "<or\n<control_all_hexes\nplayer=axis\n>\n>\n" );
         COND_RESULT( "major" );
         COND_MESSAGE( "Axis Major Victory" );
         COND_END;
@@ -618,40 +618,40 @@ void scen_add_vic_conds( FILE *file, int id )
         COND_BEGIN;
         switch ( id ) {
             case 12: /* TORCH */
-                fprintf( file, "<or\n<control_hex\nplayer�allies\nx�27\ny�5\n>\n<control_hex_num\nplayer�allies\ncount�6\n>\n>\n" );
+                fprintf( file, "<or\n<control_hex\nplayer=allies\nx=27\ny=5\n>\n<control_hex_num\nplayer=allies\ncount=6\n>\n>\n" );
                 break;
             case 13: /* HUSKY */
-                fprintf( file, "<or\n<control_hex_num\nplayer�allies\ncount�14\n>\n>\n" );
+                fprintf( file, "<or\n<control_hex_num\nplayer=allies\ncount=14\n>\n>\n" );
                 break;
             case 14: /* ANZIO */
-                fprintf( file, "<or\n<control_hex\nplayer�allies\nx�13\ny�17\n>\n<control_hex_num\nplayer�allies\ncount�5\n>\n>\n" );
+                fprintf( file, "<or\n<control_hex\nplayer=allies\nx=13\ny=17\n>\n<control_hex_num\nplayer=allies\ncount=5\n>\n>\n" );
                 break;
             case 15: /* D-DAY */
-                fprintf( file, "<or\n<control_hex_num\nplayer�allies\ncount�4\n>\n>\n" );
+                fprintf( file, "<or\n<control_hex_num\nplayer=allies\ncount=4\n>\n>\n" );
                 break;
             case 16: /* ANVIL */
-                fprintf( file, "<or\n<control_hex_num\nplayer�allies\ncount�5\n>\n>\n" );
+                fprintf( file, "<or\n<control_hex_num\nplayer=allies\ncount=5\n>\n>\n" );
                 break;
             case 18: /* COBRA */
-                fprintf( file, "<or\n<control_hex_num\nplayer�allies\ncount�5\n>\n>\n" );
+                fprintf( file, "<or\n<control_hex_num\nplayer=allies\ncount=5\n>\n>\n" );
                 break;
             case 19: /* MARKET-GARDEN */
-                fprintf( file, "<and\n<control_hex\nplayer�allies\nx�37\ny�10\n>\n>\n" );
+                fprintf( file, "<and\n<control_hex\nplayer=allies\nx=37\ny=10\n>\n>\n" );
                 break;
             case 20: /* BERLIN WEST */
-                fprintf( file, "<or\n<control_hex\nplayer�allies\nx�36\ny�14\n>\n<control_hex_num\nplayer�allies\ncount�5\n>\n>\n" );
+                fprintf( file, "<or\n<control_hex\nplayer=allies\nx=36\ny=14\n>\n<control_hex_num\nplayer=allies\ncount=5\n>\n>\n" );
                 break;
             case 30: /* KURSK */
-                fprintf( file, "<or\n<control_all_hexes\nplayer�allies\n>\n>\n" );
+                fprintf( file, "<or\n<control_all_hexes\nplayer=allies\n>\n>\n" );
                 break;
             case 32: /* BYELORUSSIA */
-                fprintf( file, "<or\n<control_hex\nplayer�allies\nx�3\ny�12\n>\n>\n" );
+                fprintf( file, "<or\n<control_hex\nplayer=allies\nx=3\ny=12\n>\n>\n" );
                 break;
             case 34: /* BERLIN EAST */
-                fprintf( file, "<or\n<control_hex\nplayer�allies\nx�36\ny�14\n>\n<control_hex_num\nplayer�allies\ncount�8\n>\n>\n" );
+                fprintf( file, "<or\n<control_hex\nplayer=allies\nx=36\ny=14\n>\n<control_hex_num\nplayer=allies\ncount=8\n>\n>\n" );
                 break;
             case 35: /* BERLIN */
-                fprintf( file, "<or\n<control_hex\nplayer�allies\nx�36\ny�14\n>\n>\n" );
+                fprintf( file, "<or\n<control_hex\nplayer=allies\nx=36\ny=14\n>\n>\n" );
                 break;
         }
         COND_RESULT( "defeat" );
@@ -663,26 +663,26 @@ void scen_add_vic_conds( FILE *file, int id )
         {
             /* D-DAY */
             fprintf( file, "<and\n"\
-                           "<control_hex\nplayer�axis\nx�11\ny�7\n>\n"\
-                           "<control_hex\nplayer�axis\nx�22\ny�28\n>\n"\
-                           "<control_hex\nplayer�axis\nx�43\ny�27\n>\n"\
+                           "<control_hex\nplayer=axis\nx=11\ny=7\n>\n"\
+                           "<control_hex\nplayer=axis\nx=22\ny=28\n>\n"\
+                           "<control_hex\nplayer=axis\nx=43\ny=27\n>\n"\
                            ">\n" );
         }
         else if ( id == 16 )
         {
             /* ANVIL */
             fprintf( file, "<and\n"\
-                           "<control_hex\nplayer�axis\nx�7\ny�3\n>\n"\
-                           "<control_hex\nplayer�axis\nx�15\ny�4\n>\n"\
-                           "<control_hex\nplayer�axis\nx�5\ny�22\n>\n"\
-                           "<control_hex\nplayer�axis\nx�12\ny�27\n>\n"\
-                           "<control_hex\nplayer�axis\nx�31\ny�21\n>\n"\
+                           "<control_hex\nplayer=axis\nx=7\ny=3\n>\n"\
+                           "<control_hex\nplayer=axis\nx=15\ny=4\n>\n"\
+                           "<control_hex\nplayer=axis\nx=5\ny=22\n>\n"\
+                           "<control_hex\nplayer=axis\nx=12\ny=27\n>\n"\
+                           "<control_hex\nplayer=axis\nx=31\ny=21\n>\n"\
                            ">\n" );
         }
         else
         {
             /* capture all */
-            fprintf( file, "<or\n<control_all_hexes\nplayer�axis\n>\n>\n" );
+            fprintf( file, "<or\n<control_all_hexes\nplayer=axis\n>\n>\n" );
         }
         COND_RESULT( "major" );
         COND_MESSAGE( "Axis Major Victory" );
@@ -806,10 +806,10 @@ int write_prestige_info( FILE *file, int turns, int *ppt )
 {
 	int i;
 	
-	fprintf( file, "prestige�" );
+	fprintf( file, "prestige=" );
 	for (i = 0; i < turns; i++)
 		fprintf( file, "%d%c", ppt[i],
-			(i < turns - 1) ? '�' : '\n');
+			(i < turns - 1) ? '&' : '\n');
 	return 0;
 }
 
@@ -1003,41 +1003,41 @@ int scenarios_convert( int scen_id )
         fprintf( dest_file, "@\n" );
         
         /* scenario name and description */
-        fprintf( dest_file, "name�%s\n", scen_title );
-        fprintf( dest_file, "desc�%s\n", scen_desc );
-        fprintf( dest_file, "authors�%s\n", scen_author );
+        fprintf( dest_file, "name=%s\n", scen_title );
+        fprintf( dest_file, "desc=%s\n", scen_desc );
+        fprintf( dest_file, "authors=%s\n", scen_author );
         
         /* date */
         fseek( scen_file, 22, SEEK_SET );
         day = 0; _fread( &day, 1, 1, scen_file );
         month = 0; _fread( &month, 1, 1, scen_file );
         year = 0; _fread( &year, 1, 1, scen_file );
-        fprintf( dest_file, "date�%02i.%02i.19%i\n", day, month, year );
+        fprintf( dest_file, "date=%02i.%02i.19%i\n", day, month, year );
         
         /* turn limit */
         fseek( scen_file, 21, SEEK_SET );
         turns = 0; _fread( &turns, 1, 1, scen_file );
-        fprintf( dest_file, "turns�%i\n", turns );
+        fprintf( dest_file, "turns=%i\n", turns );
         fseek( scen_file, 25, SEEK_SET );
         turns_per_day = 0; _fread( &turns_per_day, 1, 1, scen_file );
-        fprintf( dest_file, "turns_per_day�%i\n", turns_per_day );
+        fprintf( dest_file, "turns_per_day=%i\n", turns_per_day );
         days_per_turn = 0; _fread( &days_per_turn, 1, 1, scen_file );
         if ( turns_per_day == 0 && days_per_turn == 0 )
             days_per_turn = 1;
-        fprintf( dest_file, "days_per_turn�%i\n", days_per_turn );
+        fprintf( dest_file, "days_per_turn=%i\n", days_per_turn );
         
         /* domain */
-        fprintf( dest_file, "domain�pg\n" );
+        fprintf( dest_file, "domain=pg\n" );
         /* nations */
         if ( scen_id == -1 )
-            fprintf( dest_file, "nation_db�%s.ndb\n", target_name );
+            fprintf( dest_file, "nation_db=%s.ndb\n", target_name );
         else
-            fprintf( dest_file, "nation_db�pg.ndb\n" );
+            fprintf( dest_file, "nation_db=pg.ndb\n" );
         /* units */
         if ( scen_id == -1 )
-            fprintf( dest_file, "<unit_db\nmain�%s.udb\n>\n", target_name );
+            fprintf( dest_file, "<unit_db\nmain=%s.udb\n>\n", target_name );
         else if (!units_find_panzequp())
-            fprintf( dest_file, "<unit_db\nmain�pg.udb\n>\n");
+            fprintf( dest_file, "<unit_db\nmain=pg.udb\n>\n");
         /* if there modified units they are added to the 
            scenario file. lgeneral loads from the scenario file
            if no unit_db was specified. */
@@ -1046,7 +1046,7 @@ int scenarios_convert( int scen_id )
            will be checked when no map was specified.
            */
         if ( scen_id == -1 )
-            fprintf( dest_file, "map�%s/map%02d\n", target_name, i );
+            fprintf( dest_file, "map=%s/map%02d\n", target_name, i );
         /* weather */
         if (scen_id == -1 && strcmp(target_name,"pg") == 0)
             scen_create_pg_weather( dest_file, i-1, scen_file, turns );
@@ -1083,22 +1083,22 @@ int scenarios_convert( int scen_id )
             axis_strat = -1;
         /* definition */
         if (axis_name)
-            fprintf( dest_file, "<axis\nname�%s\n", axis_name );
+            fprintf( dest_file, "<axis\nname=%s\n", axis_name );
         else 
-            fprintf( dest_file, "<axis\nname�Axis\n" );
+            fprintf( dest_file, "<axis\nname=Axis\n" );
         if (axis_nations) {
             char *ptr, auxstr[256]; /* commata need conversion */
             snprintf(auxstr,256,"%s",axis_nations);
             for (ptr = auxstr; *ptr != 0; ptr++)
                 if (ptr[0] == ',')
-                    ptr[0] = '�';
-            fprintf( dest_file, "nations�%s\n", auxstr );
+                    ptr[0] = '=';
+            fprintf( dest_file, "nations=%s\n", auxstr );
         } else
-            fprintf( dest_file, "nations�ger�aus�it�hun�bul�rum�fin�esp\n" );
-        fprintf( dest_file, "allied_players�\n" );
-        fprintf( dest_file, "unit_limit�%d\n", axis_ulimit );
-        fprintf( dest_file, "core_unit_limit�%d\n", axis_core_ulimit );
-        fprintf( dest_file, "orientation�%s\ncontrol�human\nstrategy�%i\n", dummy, axis_strat );
+            fprintf( dest_file, "nations=ger&aus&it&hun&bul&rum&fin&esp\n" );
+        fprintf( dest_file, "allied_players=\n" );
+        fprintf( dest_file, "unit_limit=%d\n", axis_ulimit );
+        fprintf( dest_file, "core_unit_limit=%d\n", axis_core_ulimit );
+        fprintf( dest_file, "orientation=%s\ncontrol=human\nstrategy=%i\n", dummy, axis_strat );
 	{
 		int ppt[turns]; /* prestige per turn with dynamic size */
 		convert_prestige_info((scen_id==-1)?(i-1):-1, 0, &pi_axis, 
@@ -1106,9 +1106,9 @@ int scenarios_convert( int scen_id )
 		write_prestige_info( dest_file, turns, ppt );
 	}
         if ( scen_id == -1 && strcmp(target_name,"pg") == 0 )
-            fprintf( dest_file, "ai_module�%s\n", ai_modules[i*2] );
+            fprintf( dest_file, "ai_module=%s\n", ai_modules[i*2] );
         else
-            fprintf( dest_file, "ai_module�default\n" );
+            fprintf( dest_file, "ai_module=default\n" );
         /* transporter */
         fprintf( dest_file, "<transporters\n" );
         /* air */
@@ -1116,13 +1116,13 @@ int scenarios_convert( int scen_id )
         ibuf = 0; _fread( &ibuf, 2, 1, scen_file );
         ibuf = SDL_SwapLE16(ibuf);
         if ( ibuf )
-            fprintf( dest_file, "<air\nunit�%i\ncount�50\n>\n", ibuf - 1 );
+            fprintf( dest_file, "<air\nunit=%i\ncount=50\n>\n", ibuf - 1 );
         /* sea */
         fseek( scen_file, unit_offset - 4, SEEK_SET );
         ibuf = 0; _fread( &ibuf, 2, 1, scen_file );
         ibuf = SDL_SwapLE16(ibuf);
         if ( ibuf )
-            fprintf( dest_file, "<sea\nunit�%i\ncount�50\n>\n", ibuf - 1 );
+            fprintf( dest_file, "<sea\nunit=%i\ncount=50\n>\n", ibuf - 1 );
         fprintf( dest_file, ">\n" );
         fprintf( dest_file, ">\n" );
         /* allies */
@@ -1135,22 +1135,22 @@ int scenarios_convert( int scen_id )
         else
             allied_strat = 1;
         if (allies_name)
-            fprintf( dest_file, "<allies\nname�%s\n", allies_name );
+            fprintf( dest_file, "<allies\nname=%s\n", allies_name );
         else 
-            fprintf( dest_file, "<allies\nname�Allies\n" );
+            fprintf( dest_file, "<allies\nname=Allies\n" );
         if (allies_nations) {
             char *ptr, auxstr[256]; /* commata need conversion */
             snprintf(auxstr,256,"%s",allies_nations);
             for (ptr = auxstr; *ptr != 0; ptr++)
                 if (ptr[0] == ',')
-                    ptr[0] = '�';
-            fprintf( dest_file, "nations�%s\n", auxstr );
+                    ptr[0] = '=';
+            fprintf( dest_file, "nations=%s\n", auxstr );
         } else
-            fprintf( dest_file, "nations�bel�lux�den�fra�gre�usa�tur�net�nor�pol�por�so�swe�swi�eng�yug\n" );
-        fprintf( dest_file, "allied_players�\n" );
-        fprintf( dest_file, "unit_limit�%d\n", allies_ulimit );
-		fprintf( dest_file, "core_unit_limit�0\n" );
-        fprintf( dest_file, "orientation�%s\ncontrol�cpu\nstrategy�%i\n", dummy, allied_strat );
+            fprintf( dest_file, "nations=bel&lux&den&fra&gre&usa&tur&net&nor&pol&por&so&swe&swi&eng&yug\n" );
+        fprintf( dest_file, "allied_players=\n" );
+        fprintf( dest_file, "unit_limit=%d\n", allies_ulimit );
+		fprintf( dest_file, "core_unit_limit=0\n" );
+        fprintf( dest_file, "orientation=%s\ncontrol=cpu\nstrategy=%i\n", dummy, allied_strat );
 	{
 		int ppt[turns]; /* prestige per turn with dynamic size */
 		convert_prestige_info((scen_id==-1)?(i-1):-1, 1, &pi_allies, 
@@ -1158,9 +1158,9 @@ int scenarios_convert( int scen_id )
 		write_prestige_info( dest_file, turns, ppt );
 	}
         if ( scen_id == -1 && strcmp(target_name,"pg") == 0 )
-            fprintf( dest_file, "ai_module�%s\n", ai_modules[i*2 + 1] );
+            fprintf( dest_file, "ai_module=%s\n", ai_modules[i*2 + 1] );
         else
-            fprintf( dest_file, "ai_module�default\n" );
+            fprintf( dest_file, "ai_module=default\n" );
         /* transporter */
         fprintf( dest_file, "<transporters\n" );
         /* air */
@@ -1168,13 +1168,13 @@ int scenarios_convert( int scen_id )
         ibuf = 0; _fread( &ibuf, 2, 1, scen_file );
         ibuf = SDL_SwapLE16(ibuf);
         if ( ibuf )
-            fprintf( dest_file, "<air\nunit�%i\ncount�50\n>\n", ibuf - 1 );
+            fprintf( dest_file, "<air\nunit=%i\ncount=50\n>\n", ibuf - 1 );
         /* sea */
         fseek( scen_file, unit_offset - 2, SEEK_SET );
         ibuf = 0; _fread( &ibuf, 2, 1, scen_file );
         ibuf = SDL_SwapLE16(ibuf);
         if ( ibuf )
-            fprintf( dest_file, "<sea\nunit�%i\ncount�50\n>\n", ibuf - 1 );
+            fprintf( dest_file, "<sea\nunit=%i\ncount=50\n>\n", ibuf - 1 );
         fprintf( dest_file, ">\n" );
         fprintf( dest_file, ">\n" );
         fprintf( dest_file, ">\n" );
@@ -1184,17 +1184,17 @@ int scenarios_convert( int scen_id )
         else {
             /* and the default is that the attacker must capture
                all targets */
-            fprintf( dest_file, "<result\ncheck�every_turn\n" );
+            fprintf( dest_file, "<result\ncheck=every_turn\n" );
             fprintf( dest_file, "<cond\n" );
-            fprintf( dest_file, "<and\n<control_all_hexes\nplayer�%s\n>\n>\n",
+            fprintf( dest_file, "<and\n<control_all_hexes\nplayer=%s\n>\n>\n",
                      (axis_strat > 0) ? "axis" : "allies" );
-            fprintf( dest_file, "result�victory\n" );
-            fprintf( dest_file, "message�%s\n", 
+            fprintf( dest_file, "result=victory\n" );
+            fprintf( dest_file, "message=%s\n",
                      (axis_strat > 0) ? "Axis Victory" : "Allied Victory" );
             fprintf( dest_file, ">\n" );
             fprintf( dest_file, "<else\n" );
-            fprintf( dest_file, "result�defeat\n" );
-            fprintf( dest_file, "message�%s\n", 
+            fprintf( dest_file, "result=defeat\n" );
+            fprintf( dest_file, "message=%s\n",
                      (axis_strat > 0) ? "Axis Defeat" : "Allied Defeat" );
             fprintf( dest_file, ">\n" );
             fprintf( dest_file, ">\n" );
@@ -1203,7 +1203,7 @@ int scenarios_convert( int scen_id )
         fseek( scen_file, 117, SEEK_SET );
         ibuf = 0; _fread( &ibuf, 2, 1, scen_file );
         deploy_fields_count = SDL_SwapLE16(ibuf);
-        fprintf( dest_file, "<deployfields\n<player\nid�axis\ncoordinates�default�" );
+        fprintf( dest_file, "<deployfields\n<player\nid=axis\ncoordinates=default&" );
         /* last coordinate is always (-1, -1) */
         for (j = 0; j < deploy_fields_count - 1; j++) {
             int x, y;
@@ -1211,14 +1211,14 @@ int scenarios_convert( int scen_id )
             x = SDL_SwapLE16(ibuf);
             ibuf = 0; _fread( &ibuf, 2, 1, scen_file );
             y = SDL_SwapLE16(ibuf);
-            fprintf( dest_file, "%s%d,%d", j ? "�" : "", x, y );
+            fprintf( dest_file, "%s%d,%d", j ? "&" : "", x, y );
         }
         fprintf( dest_file, "\n>\n" );
         if (scen_id == -1 && strcmp(target_name,"pg") == 0 && i == 19)
             /* MarketGarden's Allies may not deploy freely */
-            fprintf( dest_file, "<player\nid�allies\ncoordinates�none\n>\n" );
+            fprintf( dest_file, "<player\nid=allies\ncoordinates=none\n>\n" );
         else
-            fprintf( dest_file, "<player\nid�allies\ncoordinates�default\n>\n" );
+            fprintf( dest_file, "<player\nid=allies\ncoordinates=default\n>\n" );
         fprintf( dest_file, ">\n" );
         /* units */
         /* mark all id's that will be used from PANZEQUP.EQP
@@ -1251,20 +1251,20 @@ int scenarios_convert( int scen_id )
                         fprintf( dest_file, "<unit\n" );
                         if ( !parser_get_value( unit, "nation", &str, 0 ) )
                             goto failure;
-                        fprintf( dest_file, "nation�%s\n", str );
+                        fprintf( dest_file, "nation=%s\n", str );
                         if ( !parser_get_int( unit, "id", &ibuf ) )
                             goto failure;
-                        fprintf( dest_file, "id�%i\n", ibuf );
+                        fprintf( dest_file, "id=%i\n", ibuf );
                         ibuf = def_str;  parser_get_int( unit, "str", &ibuf );
-                        fprintf( dest_file, "str�%i\n", ibuf );
+                        fprintf( dest_file, "str=%i\n", ibuf );
                         ibuf = def_exp;  parser_get_int( unit, "exp", &ibuf );
-                        fprintf( dest_file, "exp�%i\n", ibuf );
-                        fprintf( dest_file, "entr�0\n" );
+                        fprintf( dest_file, "exp=%i\n", ibuf );
+                        fprintf( dest_file, "entr=0\n" );
                         if ( parser_get_value( unit, "trsp", &str, 0 ) )
-                            fprintf( dest_file, "trsp�%s\n", str );
+                            fprintf( dest_file, "trsp=%s\n", str );
                         if ( !parser_get_int( unit, "delay", &ibuf ) )
                             goto failure;
-                        fprintf( dest_file, "delay�%i\n", ibuf );
+                        fprintf( dest_file, "delay=%i\n", ibuf );
                         fprintf( dest_file, ">\n" );
                     }
             }
diff --git a/lgc-pg/terrain.c b/lgc-pg/terrain.c
index 3ffb9ea..9190039 100644
--- a/lgc-pg/terrain.c
+++ b/lgc-pg/terrain.c
@@ -47,16 +47,16 @@ struct {
 } weatherTypes[NUM_WEATHER_TYPES] = {
     { "fair",   "Fair(Dry)",     0, "none", "" }, /* f */
     { "clouds", "Overcast(Dry)", 0, "none", "" }, /* o */
-    { "r",      "Raining(Dry)",  0, "no_air_attack�bad_sight", "" },
-    { "s",      "Snowing(Dry)",  0, "no_air_attack�bad_sight", "" },
+    { "r",      "Raining(Dry)",  0, "no_air_attack&bad_sight", "" },
+    { "s",      "Snowing(Dry)",  0, "no_air_attack&bad_sight", "" },
     { "m",      "Fair(Mud)",     1, "none", "_rain" },
     { "M",      "Overcast(Mud)", 1, "none", "_rain" },
-    { "rain",   "Raining(Mud)",  1, "no_air_attack�bad_sight", "_rain" }, /* R */
-    { "x",      "Snowing(Mud)",  1, "no_air_attack�bad_sight", "_rain" },
+    { "rain",   "Raining(Mud)",  1, "no_air_attack&bad_sight", "_rain" }, /* R */
+    { "x",      "Snowing(Mud)",  1, "no_air_attack&bad_sight", "_rain" },
     { "i",      "Fair(Ice)",     2, "double_fuel_cost", "_snow" },
     { "I",      "Overcast(Ice)", 2, "double_fuel_cost", "_snow" },
-    { "X",      "Raining(Ice)",  2, "double_fuel_cost�no_air_attack�bad_sight", "_snow" },
-    { "snow",   "Snowing(Ice)",  2, "double_fuel_cost�no_air_attack�bad_sight", "_snow" } /* S */
+    { "X",      "Raining(Ice)",  2, "double_fuel_cost&no_air_attack&bad_sight", "_snow" },
+    { "snow",   "Snowing(Ice)",  2, "double_fuel_cost&no_air_attack&bad_sight", "_snow" } /* S */
 };
 /*
 ====================================================================
@@ -105,11 +105,11 @@ struct {
     { 'a', "Airfield", "airfield", 2, 7, 99,
         "112211221122",
         { "1111A1X1", "1121A1X1", "1121A1X1" },
-        { "supply_air�supply_ground","supply_air�supply_ground","supply_air�supply_ground"} }, 
+        { "supply_air&supply_ground","supply_air&supply_ground","supply_air&supply_ground"} },
     { 't', "Town", "town", 3, 8, 1,
         "222222222222",
         { "1111A1X1", "1121A1X1", "1121A1X1" },
-        { "inf_close_def�supply_ground","inf_close_def�supply_ground","inf_close_def�supply_ground"} },
+        { "inf_close_def&supply_ground","inf_close_def&supply_ground","inf_close_def&supply_ground"} },
     { 'o', "Ocean", "ocean", 0, 0, 99,
         "112211221122",
         { "XXXXX11X", "XXXXX11X", "XXXXX11X" },
@@ -133,9 +133,9 @@ struct {
     { 'h', "Harbor", "harbor", 3, 8, 5, 
         "112211221122",
         { "1111A111", "1121A111", "1121A111" },
-        { "inf_close_def�supply_ground�supply_ships",
-          "inf_close_def�supply_ground�supply_ships",
-          "inf_close_def�supply_ground�supply_ships"} }
+        { "inf_close_def&supply_ground&supply_ships",
+          "inf_close_def&supply_ground&supply_ships",
+          "inf_close_def&supply_ground&supply_ships"} }
 };
 /*
 ====================================================================
@@ -304,47 +304,49 @@ int terrain_convert_database( void )
     fprintf( file, "@\n" );
     fprintf( file, "<weather\n" );
     for ( i = 0; i < NUM_WEATHER_TYPES; i++ )
-        fprintf( file, "<%s\nname�%s\nflags�%s\n>\n", 
+        fprintf( file, "<%s\nname=%s\nflags=%s\n>\n",
                  weatherTypes[i].id, weatherTypes[i].name, weatherTypes[i].flags );
     fprintf( file, ">\n" );
     /* domain */
-    fprintf( file, "domain�pg\n" );
+    fprintf( file, "domain=pg\n" );
     /* additional graphics and sounds */
-    fprintf( file, "hex_width�60\nhex_height�50\nhex_x_offset�45\nhex_y_offset�25\n" );
-    fprintf( file, "fog�pg/fog.bmp\ndanger�pg/danger.bmp\ngrid�pg/grid.bmp\nframe�pg/select_frame.bmp\n" );
-    fprintf( file, "crosshair�pg/crosshair.bmp\nexplosion�pg/explosion.bmp\ndamage_bar�pg/damage_bars.bmp\n" );
-    fprintf( file, "explosion_sound�pg/explosion.wav\nselect_sound�pg/select.wav\n" );
+    fprintf( file, "hex_width=60\nhex_height=50\nhex_x_offset=45\nhex_y_offset=25\n" );
+    fprintf( file, "fog=pg/fog.bmp\ndanger=pg/danger.bmp\ngrid=pg/grid.bmp\nframe=pg/select_frame.bmp\n" );
+    fprintf( file, "crosshair=pg/crosshair.bmp\nexplosion=pg/explosion.bmp\ndamage_bar=pg/damage_bars.bmp\n" );
+    fprintf( file, "explosion_sound=pg/explosion.wav\nselect_sound=pg/select.wav\n" );
     /* terrain types */
     fprintf( file, "<terrain\n" );
     for ( i = 0; i < NUM_TERRAIN_TYPES; i++ ) {
+		if (!separate_bridges && terrainTypes[i].id=='b') 
+			continue; /* skip bridge definition if road is used instead */
         fprintf( file, "<%c\n", terrainTypes[i].id );
-        fprintf( file, "name�%s\n", terrainTypes[i].name );
+        fprintf( file, "name=%s\n", terrainTypes[i].name );
         fprintf( file, "<image\n" );
         for ( j = 0; j < NUM_WEATHER_TYPES; j++ )
-            fprintf( file, "%s�%s/%s%s.bmp\n", weatherTypes[j].id, 
+            fprintf( file, "%s=%s/%s%s.bmp\n", weatherTypes[j].id,
                                     target_name, terrainTypes[i].set_name, 
                                     weatherTypes[j].set_ext );
         fprintf( file, ">\n" );
         fprintf( file, "<spot_cost\n" );
         for ( j = 0; j < NUM_WEATHER_TYPES; j++ )
-            fprintf( file, "%s�%c\n", weatherTypes[j].id, terrainTypes[i].spot_costs[j] );
+            fprintf( file, "%s=%c\n", weatherTypes[j].id, terrainTypes[i].spot_costs[j] );
         fprintf( file, ">\n" );
         fprintf( file, "<move_cost\n" );
         for ( k = 0; k < move_type_count; k++ ) 
         {
             fprintf( file, "<%s\n", move_types[k * 3] );
                 for ( j = 0; j < NUM_WEATHER_TYPES; j++ )
-                    fprintf( file, "%s�%c\n", weatherTypes[j].id,
+                    fprintf( file, "%s=%c\n", weatherTypes[j].id,
                              terrainTypes[i].move_costs[weatherTypes[j].ground][k] );
             fprintf( file, ">\n" );
         }
         fprintf( file, ">\n" );
-        fprintf( file, "min_entr�%d\nmax_entr�%d\n",
+        fprintf( file, "min_entr=%d\nmax_entr=%d\n",
                  terrainTypes[i].min_entr,terrainTypes[i].max_entr);
-        fprintf( file, "max_init�%d\n", terrainTypes[i].max_ini );
+        fprintf( file, "max_init=%d\n", terrainTypes[i].max_ini );
         fprintf( file, "<flags\n" );
         for ( j = 0; j < NUM_WEATHER_TYPES; j++ )
-            fprintf( file, "%s�%s\n", weatherTypes[j].id, 
+            fprintf( file, "%s=%s\n", weatherTypes[j].id,
                      terrainTypes[i].flags[weatherTypes[j].ground] );
         fprintf( file, ">\n" );
         fprintf( file, ">\n" );
@@ -432,7 +434,7 @@ int terrain_convert_graphics( void )
     if ( !terrain_convert_tiles( 'c', shp, "clear" ) ) goto failure;
     if ( !terrain_convert_tiles( 'r', shp, "road" ) ) goto failure;
     if (separate_bridges) /* if not, it's replaced with r ids */
-	if ( !terrain_convert_tiles( 'b', shp, "bridge" ) ) goto failure;
+      if ( !terrain_convert_tiles( 'b', shp, "bridge" ) ) goto failure;
     if ( !terrain_convert_tiles( '#', shp, "fields" ) ) goto failure;
     if ( !terrain_convert_tiles( '~', shp, "rough" ) ) goto failure;
     if ( !terrain_convert_tiles( 'R', shp, "river" ) ) goto failure;
diff --git a/lgc-pg/units.c b/lgc-pg/units.c
index af69384..0fbd6d0 100644
--- a/lgc-pg/units.c
+++ b/lgc-pg/units.c
@@ -129,23 +129,23 @@ enum {
 };
 char *unit_classes[] = {
     "inf",      "Infantry",         "infantry",                         
-    "tank",     "Tank",             "low_entr_rate�tank",                             
-    "recon",    "Recon",            "recon�tank",                            
+    "tank",     "Tank",             "low_entr_rate&tank",
+    "recon",    "Recon",            "recon&tank",
     "antitank", "Anti-Tank",        "anti_tank",                             
-    "art",      "Artillery",        "artillery�suppr_fire�attack_first",                        
+    "art",      "Artillery",        "artillery&suppr_fire&attack_first",
     "antiair",  "Anti-Aircraft",    "low_entr_rate",
-    "airdef",   "Air-Defense",      "air_defense�attack_first",                      
-    "fort",     "Fortification",    "low_entr_rate�suppr_fire",                             
-    "fighter",  "Fighter",          "interceptor�carrier_ok�flying",    
-    "tacbomb",  "Tactical Bomber",  "bomber�carrier_ok�flying",         
-    "levbomb",  "Level Bomber",     "flying�suppr_fire�turn_suppr�carpet_bombing",                           
-    "sub",      "Submarine",        "swimming�diving",                  
-    "dest",     "Destroyer",        "destroyer�swimming�suppr_fire",               
-    "cap",      "Capital Ship",     "swimming�suppr_fire",                         
-    "carrier",  "Aircraft Carrier", "carrier�swimming",                 
+    "airdef",   "Air-Defense",      "air_defense&attack_first",
+    "fort",     "Fortification",    "low_entr_rate&suppr_fire",
+    "fighter",  "Fighter",          "interceptor&carrier_ok&flying",
+    "tacbomb",  "Tactical Bomber",  "bomber&carrier_ok&flying",
+    "levbomb",  "Level Bomber",     "flying&suppr_fire&turn_suppr&carpet_bombing",
+    "sub",      "Submarine",        "swimming&diving",
+    "dest",     "Destroyer",        "destroyer&swimming&suppr_fire",
+    "cap",      "Capital Ship",     "swimming&suppr_fire",
+    "carrier",  "Aircraft Carrier", "carrier&swimming",
     "landtrp",  "Land Transport",   "transporter",                      
-    "airtrp",   "Air Transport",    "transporter�flying",               
-    "seatrp",   "Sea Transport",    "transporter�swimming",             
+    "airtrp",   "Air Transport",    "transporter&flying",
+    "seatrp",   "Sea Transport",    "transporter&swimming",
 };
 int move_type_count = 8;
 char *move_types[] = {
@@ -171,17 +171,17 @@ char *add_flags[] = {
     "108", "parachute",
     "109", "parachute",
     "168", "jet",
-    "214", "bridge_eng�ignore_entr",
+    "214", "bridge_eng&ignore_entr",
     "215", "parachute",
     "226", "parachute",
     "270", "parachute",
-    "275", "bridge_eng�ignore_entr",
-    "329", "bridge_eng�ignore_entr",
+    "275", "bridge_eng&ignore_entr",
+    "329", "bridge_eng&ignore_entr",
     "382", "parachute",
     "383", "parachute",
     "385", "ignore_entr",
     "386", "ignore_entr",
-    "387", "bridge_eng�ignore_entr",
+    "387", "bridge_eng&ignore_entr",
     "415", "parachute",
     "X"
 };
@@ -409,11 +409,11 @@ void units_write_classes( FILE *file )
     int i;
     fprintf( file, "<target_types\n" );
     for ( i = 0; i < TARGET_TYPE_COUNT; i++ )
-        fprintf( file, "<%s\nname�%s\n>\n", target_types[i * 2], target_types[i * 2 + 1] );
+        fprintf( file, "<%s\nname=%s\n>\n", target_types[i * 2], target_types[i * 2 + 1] );
     fprintf( file, ">\n" );
     fprintf( file, "<move_types\n" );
     for ( i = 0; i < move_type_count; i++ )
-        fprintf( file, "<%s\nname�%s\nsound�%s\n>\n", 
+        fprintf( file, "<%s\nname=%s\nsound=%s\n>\n",
                  move_types[i * 3], move_types[i * 3 + 1], move_types[i * 3 + 2] );
     fprintf( file, ">\n" );
 
@@ -421,15 +421,15 @@ void units_write_classes( FILE *file )
 	fprintf( file, "<unit_classes\n" );
 	for ( i = 0; i < UNIT_CLASS_COUNT; i++ ) {
 		fprintf( file, "<%s\n", unit_classes[i * 3] );
-		fprintf( file, "name�%s\n", unit_classes[i * 3 + 1] );
+		fprintf( file, "name=%s\n", unit_classes[i * 3 + 1] );
 		if (i == LAND_TRANS)
-			fprintf( file, "purchase�trsp\n" );
+			fprintf( file, "purchase=trsp\n" );
 		else if (i == FORT || i == SUBMARINE || i == DESTROYER || 
 					i == CAPITAL || i == CARRIER ||	
 					i == AIR_TRANS || i == SEA_TRANS)
-			fprintf( file, "purchase�none\n" );
+			fprintf( file, "purchase=none\n" );
 		else
-			fprintf( file, "purchase�normal\n" );
+			fprintf( file, "purchase=normal\n" );
 		fprintf( file, ">\n" );
 	}
 	fprintf( file, ">\n" );
@@ -481,14 +481,14 @@ int units_convert_database( char *tac_icons )
     if ( !single_scen )
         fprintf( dest_file, "@\n" ); /* only a new file needs this magic */
     /* domain */
-    fprintf( dest_file, "domain�pg\n" );
-    fprintf( dest_file, "icons�%s\nicon_type�%s\n", tac_icons,
+    fprintf( dest_file, "domain=pg\n" );
+    fprintf( dest_file, "icons=%s\nicon_type=%s\n", tac_icons,
                                         apply_unit_mods?"single":"fixed");
-    fprintf( dest_file, "strength_icons�pg_strength.bmp\n" );
-    fprintf( dest_file, "strength_icon_width�16\nstrength_icon_height�12\n" );
-    fprintf( dest_file, "attack_icon�pg_attack.bmp\n" );
-    fprintf( dest_file, "move_icon�pg_move.bmp\n" );
-    fprintf( dest_file, "guard_icon�pg_guard.bmp\n" );
+    fprintf( dest_file, "strength_icons=pg_strength.bmp\n" );
+    fprintf( dest_file, "strength_icon_width=16\nstrength_icon_height=12\n" );
+    fprintf( dest_file, "attack_icon=pg_attack.bmp\n" );
+    fprintf( dest_file, "move_icon=pg_move.bmp\n" );
+    fprintf( dest_file, "guard_icon=pg_guard.bmp\n" );
     units_write_classes( dest_file );
     fprintf( dest_file, "<unit_lib\n" );
     /* first entry is RESERVED */
@@ -544,7 +544,7 @@ int units_convert_database( char *tac_icons )
             i = 0;
             while ( add_flags[i*2][0] != 'X' ) {
                 if ( atoi( add_flags[i * 2] ) == id ) {
-                    strcat( flags, "�" );
+                    strcat( flags, "&" );
                     strcat( flags, add_flags[i * 2 + 1] );
                     i = -1;
                     break;
@@ -554,44 +554,43 @@ int units_convert_database( char *tac_icons )
         }
 	/* whatever is legged or towed may use ground/air transporter */
         if ( entry.move > 0 && (entry.move_type == 3 || entry.move_type == 4) )
-            strcat( flags, "�air_trsp_ok�ground_trsp_ok" );
+            strcat( flags, "&air_trsp_ok&ground_trsp_ok" );
         /* all artillery with range 1 has no attack_first */
         if (entry.class==4&&entry.range==1)
         {
-            sprintf( flags, "artillery�suppr_fire" );
-            printf( "%s: overwrite flags to: artillery,suppr_fire\n",
-                                                                entry.name);
+            sprintf( flags, "artillery&suppr_fire" );
+            printf( "%s: overwrite flags to: artillery,suppr_fire\n", entry.name);
         }
         /* write entry */
         fprintf( dest_file, "<%i\n", id++ );
         string_replace_quote( entry.name, buf );
         if ( apply_unit_mods )
             fix_spelling_mistakes( buf );
-        fprintf( dest_file, "name�%s\n", buf );
-        fprintf( dest_file, "nation�%s\n", (entry.nation==-1)?"none":
+        fprintf( dest_file, "name=%s\n", buf );
+        fprintf( dest_file, "nation=%s\n", (entry.nation==-1)?"none":
 						nations[entry.nation * 3] );
-        fprintf( dest_file, "class�%s\n", unit_classes[entry.class * 3] );
-        fprintf( dest_file, "target_type�%s\n", target_types[entry.target_type * 2] );
-        fprintf( dest_file, "initiative�%i\n", entry.init );
-        fprintf( dest_file, "spotting�%i\n", entry.spot );
-        fprintf( dest_file, "movement�%i\n", entry.move );
-        fprintf( dest_file, "move_type�%s\n", move_types[entry.move_type * 3] );
-        fprintf( dest_file, "fuel�%i\n", entry.fuel );
-        fprintf( dest_file, "range�%i\n", entry.range );
-        fprintf( dest_file, "ammo�%i\n", entry.ammo );
-        fprintf( dest_file, "<attack\ncount�1\nsoft�%i\nhard�%i\nair�%i\nnaval�%i\n>\n",
+        fprintf( dest_file, "class=%s\n", unit_classes[entry.class * 3] );
+        fprintf( dest_file, "target_type=%s\n", target_types[entry.target_type * 2] );
+        fprintf( dest_file, "initiative=%i\n", entry.init );
+        fprintf( dest_file, "spotting=%i\n", entry.spot );
+        fprintf( dest_file, "movement=%i\n", entry.move );
+        fprintf( dest_file, "move_type=%s\n", move_types[entry.move_type * 3] );
+        fprintf( dest_file, "fuel=%i\n", entry.fuel );
+        fprintf( dest_file, "range=%i\n", entry.range );
+        fprintf( dest_file, "ammo=%i\n", entry.ammo );
+        fprintf( dest_file, "<attack\ncount=1\nsoft=%i\nhard=%i\nair=%i\nnaval=%i\n>\n",
                  entry.atk_soft, entry.atk_hard, entry.atk_air, entry.atk_naval );
-        fprintf( dest_file, "def_ground�%i\n", entry.def_ground );
-        fprintf( dest_file, "def_air�%i\n", entry.def_air );
-        fprintf( dest_file, "def_close�%i\n", entry.def_close );
-        fprintf( dest_file, "flags�%s\n", flags );
-        fprintf( dest_file, "icon_id�%i\n", entry.pic_id );
-        if ( strstr( flags, "�jet" ) )
-            fprintf( dest_file, "move_sound�%s\n", "pg/air2.wav" );
-        fprintf( dest_file, "cost�%i\n", entry.cost );
-        fprintf( dest_file, "start_year�19%i\n", entry.year );
-        fprintf( dest_file, "start_month�%i\n", entry.month );
-        fprintf( dest_file, "last_year�19%i\n", entry.last_year );
+        fprintf( dest_file, "def_ground=%i\n", entry.def_ground );
+        fprintf( dest_file, "def_air=%i\n", entry.def_air );
+        fprintf( dest_file, "def_close=%i\n", entry.def_close );
+        fprintf( dest_file, "flags=%s\n", flags );
+        fprintf( dest_file, "icon_id=%i\n", entry.pic_id );
+        if ( strstr( flags, "&jet" ) )
+            fprintf( dest_file, "move_sound=%s\n", "pg/air2.wav" );
+        fprintf( dest_file, "cost=%i\n", entry.cost );
+        fprintf( dest_file, "start_year=19%i\n", entry.year );
+        fprintf( dest_file, "start_month=%i\n", entry.month );
+        fprintf( dest_file, "last_year=19%i\n", entry.last_year );
         fprintf( dest_file, ">\n" );
     }
     fprintf( dest_file, ">\n" );
diff --git a/lged/Makefile.in b/lged/Makefile.in
index 1fea5eb..117fd2a 100644
--- a/lged/Makefile.in
+++ b/lged/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -81,13 +91,12 @@ host_triplet = @host@
 target_triplet = @target@
 bin_PROGRAMS = lged$(EXEEXT)
 subdir = lged
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp README
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -158,6 +167,8 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/mkinstalldirs README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -315,6 +326,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -353,7 +365,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign lged/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign lged/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -703,6 +714,8 @@ uninstall-am: uninstall-binPROGRAMS
 	ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-binPROGRAMS
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/po/Makefile.in b/po/Makefile.in
index 8568ec3..f7e3cff 100644
--- a/po/Makefile.in
+++ b/po/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = po
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs README
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -145,6 +154,8 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \
+	README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -327,6 +338,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -356,7 +368,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign po/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign po/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -644,6 +655,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/Makefile.in b/src/Makefile.in
index bbd4269..457150e 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -82,13 +92,12 @@ target_triplet = @target@
 bin_PROGRAMS = lgeneral$(EXEEXT)
 check_PROGRAMS = testfile$(EXEEXT)
 subdir = src
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -221,6 +230,8 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -403,6 +414,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -462,7 +474,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -955,6 +966,8 @@ uninstall-man: uninstall-man6
 	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
 	uninstall-local uninstall-man uninstall-man6
 
+.PRECIOUS: Makefile
+
 
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(inst_dir)
diff --git a/src/ai.c b/src/ai.c
index 6975738..34b37e2 100644
--- a/src/ai.c
+++ b/src/ai.c
@@ -545,7 +545,12 @@ void ai_run( void )
                     dist = 1000; found = 0;
                     for ( i = 1; i < map_w - 1; i++ )
                         for ( j = 1; j < map_h - 1; j++ )
-                            if ( mask[i][j].aux > 0 && mask[i][j].aux < dist ) {
+                            if ( mask[i][j].aux > 0 && mask[i][j].aux < dist )
+                            //that line is to avoid unit deployment in enemy
+                            //city, that makes it impossible to capture
+                            //it by the AI
+                            if( !map_tile(i,j)->player || ( map_tile(i,j)->player == cur_player ) )
+                             {
                                 dist = mask[i][j].aux;
                                 x = i; y = j;
                                 found = 1; /* deploy close to enemy */
diff --git a/src/ai_group.c b/src/ai_group.c
index 5ec59ae..edae129 100644
--- a/src/ai_group.c
+++ b/src/ai_group.c
@@ -301,11 +301,17 @@ int ai_evaluate_hex( AI_Eval *eval )
         /* conquering a flag gives a bonus */
         if ( map[eval->x][eval->y].player )
             if ( !player_is_ally( eval->unit->player, map[eval->x][eval->y].player ) )
+            {
+		//however ships are unable to do that
+		if( (eval->unit->sel_prop->flags & SWIMMING) )
+			eval->mov_score -= 1000;
+		else
                 if ( map[eval->x][eval->y].g_unit == 0 ) {
                     eval->mov_score += 600;
                     if ( map[eval->x][eval->y].obj )
                         eval->mov_score += 600;
                 }
+            }
         /* if this position allows debarking or is just one hex away
            this tile receives a big bonus. */
         if ( eval->unit->embark == EMBARK_SEA ) {
diff --git a/src/ai_modules/Makefile.in b/src/ai_modules/Makefile.in
index 68a5106..ec3e81d 100644
--- a/src/ai_modules/Makefile.in
+++ b/src/ai_modules/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/ai_modules
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -110,6 +119,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -267,6 +277,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -295,7 +306,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/ai_modules/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/ai_modules/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -463,6 +473,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(inst_dir)/ai_modules
 
diff --git a/src/campaigns/Makefile.in b/src/campaigns/Makefile.in
index 2d9eb65..2b5d2d2 100644
--- a/src/campaigns/Makefile.in
+++ b/src/campaigns/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,13 +90,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/campaigns
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -140,6 +149,7 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(campaigndir)"
 DATA = $(campaign_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -297,6 +307,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -328,7 +339,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/campaigns/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/campaigns/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -521,6 +531,8 @@ uninstall-am: uninstall-campaignDATA
 	pdf-am ps ps-am tags-am uninstall uninstall-am \
 	uninstall-campaignDATA
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/config.c b/src/config.c
index 3b1dfef..bfa95fa 100644
--- a/src/config.c
+++ b/src/config.c
@@ -127,24 +127,24 @@ void save_config( )
         fprintf( stderr, tr("Cannot access config file '%s' to save settings\n"), file_name );
     else {
         fprintf( file, "@\n" );
-        fprintf( file, "grid�%i\n", config.grid );
-        fprintf( file, "tran�%i\n", config.tran );
-        fprintf( file, "bar�%i\n", config.show_bar );
-        fprintf( file, "width�%i\n", config.width );
-        fprintf( file, "height�%i\n", config.height );
-        fprintf( file, "fullscreen�%i\n", config.fullscreen );
-        fprintf( file, "anim_speed�%i\n", config.anim_speed );
-        fprintf( file, "supply�%i\n", config.supply );
-        fprintf( file, "weather�%i\n", config.weather );
-        fprintf( file, "fog_of_war�%i\n", config.fog_of_war );
-        fprintf( file, "cpu_turn�%i\n", config.show_cpu_turn );
-        fprintf( file, "deploy�%i\n", config.deploy_turn );
-        fprintf( file, "purchase�%i\n", config.purchase );
-        fprintf( file, "ai_debug�%i\n", config.ai_debug );
-        fprintf( file, "sound_on�%i\n", config.sound_on );
-        fprintf( file, "sound_volume�%i\n", config.sound_volume );
-        fprintf( file, "music_on�%i\n", config.music_on );
-        fprintf( file, "music_volume�%i\n", config.music_volume );
+        fprintf( file, "grid=%i\n", config.grid );
+        fprintf( file, "tran=%i\n", config.tran );
+        fprintf( file, "bar=%i\n", config.show_bar );
+        fprintf( file, "width=%i\n", config.width );
+        fprintf( file, "height=%i\n", config.height );
+        fprintf( file, "fullscreen=%i\n", config.fullscreen );
+        fprintf( file, "anim_speed=%i\n", config.anim_speed );
+        fprintf( file, "supply=%i\n", config.supply );
+        fprintf( file, "weather=%i\n", config.weather );
+        fprintf( file, "fog_of_war=%i\n", config.fog_of_war );
+        fprintf( file, "cpu_turn=%i\n", config.show_cpu_turn );
+        fprintf( file, "deploy=%i\n", config.deploy_turn );
+        fprintf( file, "purchase=%i\n", config.purchase );
+        fprintf( file, "ai_debug=%i\n", config.ai_debug );
+        fprintf( file, "sound_on=%i\n", config.sound_on );
+        fprintf( file, "sound_volume=%i\n", config.sound_volume );
+        fprintf( file, "music_on=%i\n", config.music_on );
+        fprintf( file, "music_volume=%i\n", config.music_volume );
         fclose( file );
     }
 }
diff --git a/src/engine.c b/src/engine.c
index a65a6c1..86614b5 100644
--- a/src/engine.c
+++ b/src/engine.c
@@ -68,6 +68,9 @@ extern Setup setup;
 extern int  term_game, sdl_quit;
 extern List *prev_scen_core_units;
 extern char *prev_scen_fname;
+extern Scen_Message *sMessages;
+extern int sMessage_count;
+extern int gui_panel_w;
 
 /*
 ====================================================================
@@ -128,6 +131,7 @@ int *hex_mask = 0;             /* used to determine hex from pointer pos */
 int map_x, map_y;              /* current position in map */
 int map_sw, map_sh;            /* number of tiles drawn to screen */
 int map_sx, map_sy;            /* position where to draw first tile */
+int mapview_w = 0;	/* remainder to full screen width, updated before use */
 int draw_map = 0;              /* if this flag is true engine_update() calls engine_draw_map() */
 enum {
     SCROLL_NONE = 0,
@@ -255,7 +259,7 @@ static void engine_set_status( int newstat );
 static void engine_show_final_message( void );
 static void engine_select_player( Player *player, int skip_unit_prep );
 static int engine_capture_flag( Unit *unit );
-static void engine_show_game_menu( int cx, int cy );
+//static void engine_show_game_menu( int cx, int cy );
 static void engine_handle_button( int id );
 static int engine_has_strategic_target(int active, int x,int y);
 
@@ -329,8 +333,8 @@ static void engine_set_status( int newstat )
     if ( newstat == STATUS_NONE && setup.type == SETUP_RUN_TITLE )
     {
         status = STATUS_TITLE;
-        /* re-show main menu */
-        if (!term_game) engine_show_game_menu(10,10);
+        /* re-show main menu
+        if (!term_game) engine_show_game_menu(10,10); */
     }
     else
         status = newstat;
@@ -344,18 +348,26 @@ Draw wallpaper and background.
 static void engine_draw_bkgnd()
 {
     int i, j;
+    /* wallpaper */
     for ( j = 0; j < sdl.screen->h; j += gui->wallpaper->h )
         for ( i = 0; i < sdl.screen->w; i += gui->wallpaper->w ) {
             DEST( sdl.screen, i, j, gui->wallpaper->w, gui->wallpaper->h );
             SOURCE( gui->wallpaper, 0, 0 );
             blit_surf();
         }
+    /* title picture */
     DEST( sdl.screen, 
-          ( sdl.screen->w - gui->bkgnd->w ) / 2,
+          ( sdl.screen->w - gui_panel_w - gui->bkgnd->w ) / 2,
           ( sdl.screen->h - gui->bkgnd->h ) / 2,
           gui->bkgnd->w, gui->bkgnd->h );
     SOURCE( gui->bkgnd, 0, 0 );
     blit_surf();
+    /* credits */
+    gui->font_std->align = ALIGN_X_RIGHT | ALIGN_Y_BOTTOM;
+    write_text( gui->font_std, sdl.screen, sdl.screen->w - gui_panel_w - 2, sdl.screen->h - 2, tr("(C) 2001-2017 Michael Speck"), 255 );
+    gui->font_std->align = ALIGN_X_LEFT | ALIGN_Y_BOTTOM;
+    write_text( gui->font_std, sdl.screen, 2, sdl.screen->h - 2, tr("http://lgames.sf.net"), 255 );
+
 }
 
 /*
@@ -466,6 +478,7 @@ static void engine_prep_camp_brief()
     }
     
     gui_draw_message_pane(camp_pane);
+    gui_panel_hide();
     engine_set_status(STATUS_CAMP_BRIEFING);
 }
 
@@ -476,7 +489,27 @@ Check menu buttons and enable/disable according to engine status.
 */
 static void engine_check_menu_buttons()
 {
-    /* airmode */
+	if (status == STATUS_TITLE || status == STATUS_TITLE_MENU ||
+		 status == STATUS_DEPLOY || status == STATUS_PURCHASE) {
+		group_set_active( gui->base_menu, ID_AIR_MODE, 0 );
+		group_set_active( gui->base_menu, ID_MENU, 0 );
+		group_set_active( gui->base_menu, ID_SCEN_INFO, 0 );
+		group_set_active( gui->base_menu, ID_PURCHASE, 0 );
+		group_set_active( gui->base_menu, ID_DEPLOY, 0 );
+		group_set_active( gui->base_menu, ID_UNIT_LIST, 0 );
+		group_set_active( gui->base_menu, ID_STRAT_MAP, 0 );
+		group_set_active( gui->base_menu, ID_END_TURN, 0 );
+		group_set_active( gui->base_menu, ID_CONDITIONS, 0 );
+
+	        group_set_active( gui->main_menu, ID_SAVE, 0 );
+	        group_set_active( gui->main_menu, ID_RESTART, 0 );
+		return;
+	}
+	/* we're in the game */
+        group_set_active( gui->main_menu, ID_SAVE, 1 );
+        group_set_active( gui->main_menu, ID_RESTART, 1 );
+
+	/* airmode */
     group_set_active( gui->base_menu, ID_AIR_MODE, 1 );
     /* menu */
     if ( cur_ctrl == PLAYER_CTRL_NOBODY )
@@ -494,7 +527,7 @@ static void engine_check_menu_buttons()
     else
         group_set_active( gui->base_menu, ID_PURCHASE, 0 );
     /* deploy */
-    if ( ( avail_units->count > 0 || deploy_turn ) && status == STATUS_NONE )
+    if ( ( avail_units->count > 0 ) && status == STATUS_NONE )
         group_set_active( gui->base_menu, ID_DEPLOY, 1 );
     else
         group_set_active( gui->base_menu, ID_DEPLOY, 0 );
@@ -509,7 +542,7 @@ static void engine_check_menu_buttons()
     else
         group_set_active( gui->base_menu, ID_STRAT_MAP, 0 );
     /* end turn */
-    if ( status != STATUS_NONE )
+    if ( status != STATUS_NONE || deploy_turn)
         group_set_active( gui->base_menu, ID_END_TURN, 0 );
     else
         group_set_active( gui->base_menu, ID_END_TURN, 1 );
@@ -528,7 +561,16 @@ Check unit buttons. (use current unit)
 static void engine_check_unit_buttons()
 {
     char str[128];
-    if ( cur_unit == 0 ) return;
+    if ( cur_unit == 0 || status == STATUS_TITLE_MENU) {
+	    group_set_active( gui->unit_buttons, ID_RENAME, 0 );
+	    group_set_active( gui->unit_buttons, ID_SUPPLY, 0 );
+	    group_set_active( gui->unit_buttons, ID_MERGE, 0 );
+	    group_set_active( gui->unit_buttons, ID_SPLIT, 0 );
+	    group_set_active( gui->unit_buttons, ID_UNDO, 0 );
+	    group_set_active( gui->unit_buttons, ID_EMBARK_AIR, 0 );
+	    group_set_active( gui->unit_buttons, ID_DISBAND, 0 );
+	    return;
+    }
     /* rename */
     group_set_active( gui->unit_buttons, ID_RENAME, 1 );
     /* supply */
@@ -598,6 +640,7 @@ static void engine_hide_deploy_unit_info()
 Show/Hide game menu.
 ====================================================================
 */
+/* NOT USED: Game menu is static now
 static void engine_show_game_menu( int cx, int cy )
 {
     int i;
@@ -617,23 +660,24 @@ static void engine_show_game_menu( int cx, int cy )
         group_set_active( gui->main_menu, ID_SAVE, 1 );
         group_set_active( gui->main_menu, ID_RESTART, 1 );
     }
-    /* lock config buttons */
+    // lock config buttons
     group_lock_button( gui->opt_menu, ID_C_SUPPLY, config.supply );
     group_lock_button( gui->opt_menu, ID_C_WEATHER, config.weather );
     group_lock_button( gui->opt_menu, ID_C_GRID, config.grid );
     group_lock_button( gui->opt_menu, ID_C_SHOW_CPU, config.show_cpu_turn );
     group_lock_button( gui->opt_menu, ID_C_SHOW_STRENGTH, config.show_bar );
     group_lock_button( gui->opt_menu, ID_C_SOUND, config.sound_on );
-    /* loads */
+    // loads
     gui_update_slot_tooltips();
     for ( i = 0; i < SLOT_COUNT; i++ )
         if ( slot_is_valid( i ) )
             group_set_active( gui->load_menu, ID_LOAD_0 + i, 1 );
         else
             group_set_active( gui->load_menu, ID_LOAD_0 + i, 0 );
-}
+} */
 static void engine_hide_game_menu()
 {
+	/* disabled for now it is displayed permanently
     if ( setup.type == SETUP_RUN_TITLE ) {
         status = STATUS_TITLE;
         label_hide( gui->label, 1 );
@@ -642,7 +686,7 @@ static void engine_hide_game_menu()
     else
         engine_set_status( STATUS_NONE );
     group_hide( gui->base_menu, 1 );
-    group_hide( gui->main_menu, 1 );
+    group_hide( gui->main_menu, 1 ); */
     group_hide( gui->save_menu, 1 );
     group_hide( gui->load_menu, 1 );
     group_hide( gui->opt_menu, 1 );
@@ -654,16 +698,18 @@ static void engine_hide_game_menu()
 Show/Hide unit menu.
 ====================================================================
 */
+/* NOT USED: Unit menu is static now
 static void engine_show_unit_menu( int cx, int cy )
 {
     engine_check_unit_buttons();
     gui_show_unit_buttons( cx, cy );
     status = STATUS_UNIT_MENU;
-}
+} */
 static void engine_hide_unit_menu()
 {
+	/* disabled for now it is displayed permanently
     engine_set_status( STATUS_NONE );
-    group_hide( gui->unit_buttons, 1 );
+    group_hide( gui->unit_buttons, 1 ); */
     group_hide( gui->split_menu, 1 );
     old_mx = old_my = -1;
 }
@@ -726,13 +772,14 @@ static void engine_show_turn_info()
     int text_x, text_y;
     int time_factor;
     char text[400];
+    int n;
     FULL_DEST( sdl.screen );
     fill_surf( 0x0 );
 #if 0
 #  define i time_factor 
     gui->font_std->align = ALIGN_X_LEFT | ALIGN_Y_TOP;
     text_x = text_y = 0;
-    write_line( sdl.screen, gui->font_std, "Charset Test (latin1): Fl��e �ber Wasser. \241Se��lalo!", text_x, &text_y );
+    write_line( sdl.screen, gui->font_std, "Charset Test (latin1): Fl��e �ber Wasser. \241Se��lalo!", text_x, &text_y );
     text[32] = 0;
     for (i = 0; i < 256; i++) {
         text[i % 32] = i ? i : 127;
@@ -780,14 +827,23 @@ static void engine_show_turn_info()
         sprintf( text, tr("Last Turn") );
     write_text( gui->font_turn_info, sdl.screen, text_x, text_y, text, OPAQUE );
 
+	text_y += gui->font_turn_info->height;
 	/* hint about available reinforcements */
 	if (avail_units->count > 0) {
 		text_y += gui->font_turn_info->height;
-		text_y += gui->font_turn_info->height;
 		sprintf( text, tr("New units can be deployed!") );
 		write_text( gui->font_turn_info, sdl.screen, text_x, text_y, text, OPAQUE );
 	}
-	
+	/* user-defined hints */
+	if( sMessages )
+	{
+		n = 0;
+		text_y += gui->font_turn_info->height;
+		for( n = 0; n < sMessage_count; n++ )
+			if( sMessages[n].turn == turn )
+				if( !strcmp( sMessages[n].player->id, cur_player->id ) )
+					write_text( gui->font_turn_info, sdl.screen, text_x, text_y, sMessages[n].message, OPAQUE );
+	}
     refresh_screen( 0, 0, 0, 0 );
     SDL_PumpEvents(); event_clear();
     time_factor = 3000/20;		/* wait 3 sec */
@@ -878,7 +934,7 @@ static void engine_remove_unit( Unit *unit )
 
 /*
 ====================================================================
-Select this unit and unselect old selection if nescessary.
+Select this unit and unselect old selection if necessary.
 Clear the selection if NULL is passed as unit.
 ====================================================================
 */
@@ -891,6 +947,8 @@ static void engine_select_unit( Unit *unit )
         /* clear view */
         if ( modify_fog ) map_set_fog( F_SPOT );
         engine_clear_backup();
+        engine_check_unit_buttons();
+        group_hide(gui->split_menu, 1);
         return;
     }
     /* switch air/ground */
@@ -912,6 +970,8 @@ static void engine_select_unit( Unit *unit )
     if ( modify_fog && config.supply && unit->cur_mov
          && (unit->sel_prop->flags & FLYING) && unit->sel_prop->fuel)
         has_danger_zone = map_get_danger_mask( unit );
+    /* adjust unit buttons */
+    engine_check_unit_buttons();
     return;
 }
 
@@ -1064,6 +1124,8 @@ static void engine_select_player( Player *player, int skip_unit_prep )
     list_clear( df_units );
     actions_clear();
     scroll_block = 0;
+    /* render minimap */
+    gui_update_minimap(1);
 }
 
 /*
@@ -1147,6 +1209,8 @@ static void engine_begin_turn( Player *forced_player, int skip_unit_prep )
     engine_show_turn_info();
     engine_set_status( deploy_turn ? STATUS_DEPLOY : STATUS_NONE );
     phase = PHASE_NONE;
+    engine_check_unit_buttons();
+    engine_check_menu_buttons();
     /* update screen */
     if ( cur_ctrl != PLAYER_CTRL_CPU || config.show_cpu_turn ) {
         if ( cur_ctrl == PLAYER_CTRL_CPU )
@@ -1397,6 +1461,7 @@ static void engine_goto_xy( int x, int y )
     if ( x != map_x || y != map_y ) {
         map_x = x; map_y = y;
         draw_map = 1;
+        gui_update_minimap(0);
     }
 }
 
@@ -1485,6 +1550,7 @@ static void engine_draw_map()
     int use_frame = ( cur_ctrl != PLAYER_CTRL_CPU );
     enum Stage { DrawTerrain, DrawUnits, DrawDangerZone } stage = DrawTerrain;
     enum Stage top_stage = has_danger_zone ? DrawDangerZone : DrawUnits;
+    SDL_Rect cr = {0,0,mapview_w,sdl.screen->h};
     
     /* reset_timer(); */
     
@@ -1502,6 +1568,8 @@ static void engine_draw_map()
         return;
     }
     
+    SDL_SetClipRect(sdl.screen, &cr);
+
     /* screen copy? */
     start_map_x = map_x;
     start_map_y = map_y;
@@ -1611,6 +1679,17 @@ static void engine_draw_map()
             x = map_sx + ( start_map_x - map_x ) * hex_x_offset;
         }
     }
+
+    SDL_SetClipRect(sdl.screen, NULL);
+
+    /* wallpaper gui panel */
+    for ( j = 0; j < sdl.screen->h; j += gui->wallpaper->h )
+            for ( i = mapview_w; i < sdl.screen->w; i += gui->wallpaper->w ) {
+                DEST( sdl.screen, i, j, gui->wallpaper->w, gui->wallpaper->h );
+                SOURCE( gui->wallpaper, 0, 0 );
+                blit_surf();
+            }
+
     /* printf( "time needed: %i ms\n", get_time() ); */
 }
 
@@ -2119,11 +2198,20 @@ static void engine_handle_button( int id )
             config.show_cpu_turn = !config.show_cpu_turn;
             break;
         case ID_C_VMODE:
-            engine_hide_game_menu();
+        	/* no video mode menu: change fullscreen, is all */
+        	if (config.fullscreen) {
+        		config.fullscreen = 0;
+                	action_queue_set_vmode(800, 600, 0);
+        	} else {
+        		config.fullscreen = 1;
+        		action_queue_set_vmode(1366, 768, 1);
+        	}
+        	group_hide(gui->opt_menu,1);
+            /*engine_hide_game_menu();
             gui_vmode_dlg_show();
-            status = STATUS_VMODE_DLG;
+            status = STATUS_VMODE_DLG;*/
             break;
-        /* main menu */
+        /* main menu -- is fixed now
         case ID_MENU:
             x = gui->base_menu->frame->img->bkgnd->surf_rect.x + 30 - 1;
             y = gui->base_menu->frame->img->bkgnd->surf_rect.y;
@@ -2131,12 +2219,15 @@ static void engine_handle_button( int id )
                 y = sdl.screen->h - gui->main_menu->frame->img->img->h;
             group_move( gui->main_menu, x, y );
             group_hide( gui->main_menu, 0 );
-            break;
+            break; */
         case ID_OPTIONS:
             group_hide( gui->load_menu, 1 );
             group_hide( gui->save_menu, 1 );
-            x = gui->main_menu->frame->img->bkgnd->surf_rect.x + 30 - 1;
-            y = gui->main_menu->frame->img->bkgnd->surf_rect.y;
+            /* x = gui->main_menu->frame->img->bkgnd->surf_rect.x + 30 - 1;
+            y = gui->main_menu->frame->img->bkgnd->surf_rect.y; */
+        	x = gui->main_menu->frame->img->bkgnd->surf_rect.x -
+        				gui->opt_menu->frame->img->img->w;
+        	y = gui->main_menu->frame->img->bkgnd->surf_rect.y;
             if ( y + gui->opt_menu->frame->img->img->h >= sdl.screen->h )
                 y = sdl.screen->h - gui->opt_menu->frame->img->img->h;
             group_move( gui->opt_menu, x, y );
@@ -2144,20 +2235,23 @@ static void engine_handle_button( int id )
             break;
         case ID_RESTART:
             engine_hide_game_menu();
+            fdlg_hide(gui->camp_dlg, 1); // be sure it's closed
+            sdlg_hide(gui->scen_dlg, 1); // be sure it's closed
             action_queue_restart();
             engine_confirm_action( tr("Do you really want to restart this scenario?") );
             break;
         case ID_SCEN:
             engine_hide_game_menu();
+            fdlg_hide(gui->camp_dlg, 1); // be sure it's closed
             sprintf( path, "%s/scenarios", get_gamedir() );
-            fdlg_open( gui->scen_dlg, path );
-            group_set_active( gui->scen_dlg->group, ID_SCEN_SETUP, 0 );
-            group_set_active( gui->scen_dlg->group, ID_SCEN_OK, 0 );
-            group_set_active( gui->scen_dlg->group, ID_SCEN_CANCEL, 1 );
+            sdlg_open( gui->scen_dlg, path );
+            group_set_active( gui->scen_dlg->fdlg->group, ID_SCEN_OK, 0 );
+            group_set_active( gui->scen_dlg->fdlg->group, ID_SCEN_CANCEL, 1 );
             status = STATUS_RUN_SCEN_DLG;
             break;
         case ID_CAMP:
             engine_hide_game_menu();
+            sdlg_hide(gui->scen_dlg, 1); // be sure it's closed
             sprintf( path, "%s/campaigns", get_gamedir() );
             fdlg_open( gui->camp_dlg, path );
             group_set_active( gui->camp_dlg->group, ID_CAMP_OK, 0 );
@@ -2167,7 +2261,10 @@ static void engine_handle_button( int id )
         case ID_SAVE:
             group_hide( gui->load_menu, 1 );
             group_hide( gui->opt_menu, 1 );
-            x = gui->main_menu->frame->img->bkgnd->surf_rect.x + 30 - 1;
+            /*x = gui->main_menu->frame->img->bkgnd->surf_rect.x + 30 - 1;
+            y = gui->main_menu->frame->img->bkgnd->surf_rect.y; */
+            x = gui->main_menu->frame->img->bkgnd->surf_rect.x -
+        		    	    gui->save_menu->frame->img->img->w;
             y = gui->main_menu->frame->img->bkgnd->surf_rect.y;
             if ( y + gui->save_menu->frame->img->img->h >= sdl.screen->h )
                 y = sdl.screen->h - gui->save_menu->frame->img->img->h;
@@ -2177,7 +2274,10 @@ static void engine_handle_button( int id )
         case ID_LOAD:
             group_hide( gui->save_menu, 1 );
             group_hide( gui->opt_menu, 1 );
-            x = gui->main_menu->frame->img->bkgnd->surf_rect.x + 30 - 1;
+            /* x = gui->main_menu->frame->img->bkgnd->surf_rect.x + 30 - 1;
+            y = gui->main_menu->frame->img->bkgnd->surf_rect.y; */
+            x = gui->main_menu->frame->img->bkgnd->surf_rect.x -
+        		    	    gui->load_menu->frame->img->img->w;
             y = gui->main_menu->frame->img->bkgnd->surf_rect.y;
             if ( y + gui->load_menu->frame->img->img->h >= sdl.screen->h )
                 y = sdl.screen->h - gui->load_menu->frame->img->img->h;
@@ -2186,6 +2286,8 @@ static void engine_handle_button( int id )
             break;
         case ID_QUIT:
             engine_hide_game_menu();
+            sdlg_hide(gui->scen_dlg,1);
+            fdlg_hide(gui->camp_dlg,1);
             action_queue_quit();
             engine_confirm_action( tr("Do you really want to quit?") );
             break;
@@ -2197,7 +2299,7 @@ static void engine_handle_button( int id )
         case ID_END_TURN:
             engine_hide_game_menu();
             action_queue_end_turn();
-            group_set_active( gui->base_menu, ID_END_TURN, 0 );
+            //group_set_active( gui->base_menu, ID_END_TURN, 0 );
             engine_confirm_action( tr("Do you really want to end your turn?") );
             break;
         case ID_SCEN_INFO:
@@ -2274,7 +2376,10 @@ static void engine_handle_button( int id )
             max = unit_get_split_strength(cur_unit);
             for (i=0;i<10;i++)
                 group_set_active(gui->split_menu,ID_SPLIT_1+i,i<max);
-            x = gui->unit_buttons->frame->img->bkgnd->surf_rect.x + 30 - 1;
+            /*x = gui->unit_buttons->frame->img->bkgnd->surf_rect.x + 30 - 1;
+            y = gui->unit_buttons->frame->img->bkgnd->surf_rect.y; */
+            x = gui->unit_buttons->frame->img->bkgnd->surf_rect.x -
+        		    	    gui->split_menu->frame->img->img->w;
             y = gui->unit_buttons->frame->img->bkgnd->surf_rect.y;
             if ( y + gui->split_menu->frame->img->img->h >= sdl.screen->h )
                 y = sdl.screen->h - gui->split_menu->frame->img->img->h;
@@ -2349,6 +2454,7 @@ static void engine_handle_button( int id )
                 map_get_deploy_mask(cur_player,deploy_unit,deploy_turn);
                 map_set_fog( F_DEPLOY );
                 status = STATUS_DEPLOY;
+                engine_check_menu_buttons();
                 draw_map = 1;
             }
             break;
@@ -2359,7 +2465,8 @@ static void engine_handle_button( int id )
             status = STATUS_UNIT_LIST;
             break;
         case ID_STRAT_MAP:
-            engine_hide_game_menu();
+            //engine_hide_game_menu();
+            gui_panel_hide();
             status = STATUS_STRAT_MAP;
             strat_map_update_terrain_layer();
             strat_map_update_unit_layer();
@@ -2367,11 +2474,11 @@ static void engine_handle_button( int id )
             draw_map = 1;
             break; 
         case ID_SCEN_CANCEL:
-            fdlg_hide( gui->scen_dlg, 1 );
+            sdlg_hide( gui->scen_dlg, 1 );
             engine_set_status( STATUS_NONE );
             break;
         case ID_SCEN_OK:
-            fdlg_hide( gui->scen_dlg, 1 );
+            sdlg_hide( gui->scen_dlg, 1 );
             engine_set_status( STATUS_NONE );
             action_queue_start_scen();
             break;
@@ -2385,57 +2492,38 @@ static void engine_handle_button( int id )
             engine_set_status( STATUS_NONE );
             action_queue_start_camp();
             break;
-        case ID_SCEN_SETUP:
-            fdlg_hide( gui->scen_dlg, 1 );
-            gui_open_scen_setup();
-            status = STATUS_RUN_SETUP;
-            break;
         case ID_SETUP_OK:
-            fdlg_hide( gui->scen_dlg, 0 );
-            sdlg_hide( gui->setup, 1 );
+            sdlg_hide( gui->scen_dlg, 0 );
             status = STATUS_RUN_SCEN_DLG;
             break;
-        case ID_SETUP_SUPPLY:
+        case ID_SCEN_SUPPLY:
             config.supply = !config.supply;
             break;
-        case ID_SETUP_WEATHER:
+        case ID_SCEN_WEATHER:
             config.weather = !config.weather;
             break;
-        case ID_SETUP_FOG:
+        case ID_SCEN_FOG:
             config.fog_of_war = !config.fog_of_war;
             break;
-        case ID_SETUP_DEPLOYTURN:
+        case ID_SCEN_DEPLOYTURN:
             config.deploy_turn = !config.deploy_turn;
             break;
-        case ID_SETUP_PURCHASE:
+        case ID_SCEN_PURCHASE:
             config.purchase = !config.purchase;
             break;
-        case ID_SETUP_CTRL:
-            setup.ctrl[gui->setup->sel_id] = !(setup.ctrl[gui->setup->sel_id] - 1) + 1;
-            gui_handle_player_select( gui->setup->list->cur_item );
+        case ID_SCEN_SWITCHCTRL1:
+        	if (setup.ctrl[0] == PLAYER_CTRL_CPU)
+        		setup.ctrl[0] = PLAYER_CTRL_HUMAN;
+        	else
+        		setup.ctrl[0] = PLAYER_CTRL_CPU;
+        	sdlg_update_controlview(gui->scen_dlg,1);
             break;
-        case ID_SETUP_MODULE:
-            sdlg_hide( gui->setup, 1 );
-            group_set_active( gui->module_dlg->group, ID_MODULE_OK, 0 );
-            group_set_active( gui->module_dlg->group, ID_MODULE_CANCEL, 1 );
-            sprintf( path, "%s/ai_modules", get_gamedir() );
-            fdlg_open( gui->module_dlg, path );
-            status = STATUS_RUN_MODULE_DLG;
-            break;
-        case ID_MODULE_OK:
-            if ( gui->module_dlg->lbox->cur_item ) {
-                if ( gui->module_dlg->subdir[0] != 0 )
-                    sprintf( path, "%s/%s", gui->module_dlg->subdir, (char*)gui->module_dlg->lbox->cur_item );
-                else
-                    sprintf( path, "%s", (char*)gui->module_dlg->lbox->cur_item );
-                free( setup.modules[gui->setup->sel_id] );
-                setup.modules[gui->setup->sel_id] = strdup( path );
-                gui_handle_player_select( gui->setup->list->cur_item );
-            }
-        case ID_MODULE_CANCEL:
-            fdlg_hide( gui->module_dlg, 1 );
-            sdlg_hide( gui->setup, 0 );
-            status = STATUS_RUN_SETUP;
+        case ID_SCEN_SWITCHCTRL2:
+        	if (setup.ctrl[1] == PLAYER_CTRL_CPU)
+        		setup.ctrl[1] = PLAYER_CTRL_HUMAN;
+        	else
+        		setup.ctrl[1] = PLAYER_CTRL_CPU;
+        	sdlg_update_controlview(gui->scen_dlg,1);
             break;
         case ID_DEPLOY_UP:
             gui_scroll_deploy_up();
@@ -2462,6 +2550,7 @@ static void engine_handle_button( int id )
             if ( !deploy_turn ) {
                 engine_set_status( STATUS_NONE );
                 group_hide( gui->deploy_window, 1 );
+                engine_check_menu_buttons();
             }
             break;
         case ID_CANCEL_DEPLOY:
@@ -2473,6 +2562,8 @@ static void engine_handle_button( int id )
             engine_set_status( STATUS_NONE );
             group_hide( gui->deploy_window, 1 );
             map_set_fog( F_SPOT );
+            if (!deploy_turn)
+                    engine_check_menu_buttons();
             break;
 	case ID_VMODE_OK:
 		i = select_dlg_get_selected_item_index( gui->vmode_dlg );
@@ -2525,6 +2616,7 @@ static void engine_check_events(int *reinit)
     Unit *unit;
     int cx, cy, button = 0;
     int mx, my, keypressed = 0;
+    int nx, ny;
     SDL_PumpEvents(); /* gather events in the queue */
     if ( sdl_quit ) term_game = 1; /* end game by window manager */
     if ( status == STATUS_MOVE || status == STATUS_ATTACK || status == STATUS_STRAT_ATTACK )
@@ -2558,7 +2650,9 @@ static void engine_check_events(int *reinit)
                     }
                 }
             }
-            gui_handle_motion( cx, cy );
+            if (!gui_handle_motion( cx, cy ))
+        	    if (mmview_handle_motion(gui->minimap,cx,cy,&nx,&ny))
+        		    engine_goto_xy(nx,ny);
 	    /* if gui->label is hidden we are on a gui window and there is no
 	     * tooltip; in case of purchase dialogue unhide it to show prestige
 	     * info */
@@ -2573,13 +2667,14 @@ static void engine_check_events(int *reinit)
 #ifdef WITH_SOUND
                 wav_play( gui->wav_click );
 #endif                
-            }
-            else {
+            } else if (mmview_handle_click(gui->minimap, button, cx, cy, &nx, &ny)) {
+        	    engine_goto_xy(nx,ny);
+            } else {
                 switch ( status ) {
                     case STATUS_TITLE:
-                        /* title menu */
+                        /* title menu
                         if ( button == BUTTON_RIGHT )
-                            engine_show_game_menu( cx, cy );
+                            engine_show_game_menu( cx, cy ); */
                         break;
                     case STATUS_TITLE_MENU:
                         if ( button == BUTTON_RIGHT )
@@ -2621,6 +2716,8 @@ static void engine_check_events(int *reinit)
                                 if ( button == BUTTON_LEFT )
                                     engine_focus( mx, my, 0 );
                                 engine_set_status( STATUS_NONE );
+                                gui_update_minimap(0);
+                                gui_panel_show();
                                 old_mx = old_my = -1;
                                 /* before updating the map, clear the screen */
                                 SDL_FillRect( sdl.screen, 0, 0x0 );
@@ -2784,9 +2881,9 @@ static void engine_check_events(int *reinit)
                                     case BUTTON_LEFT:
                                         if ( cur_unit ) {
                                             /* handle current unit */
-                                            if ( cur_unit->x == mx && cur_unit->y == my && engine_get_prim_unit( mx, my, region ) == cur_unit)
+                                            /*if ( cur_unit->x == mx && cur_unit->y == my && engine_get_prim_unit( mx, my, region ) == cur_unit)
                                                 engine_show_unit_menu( cx, cy );
-                                            else
+                                            else*/
                                             if ( ( unit = engine_get_target( mx, my, region ) ) ) {
                                                 action_queue_attack( cur_unit, unit );
                                                 frame_hide( gui->qinfo1, 1 );
@@ -2817,7 +2914,8 @@ static void engine_check_events(int *reinit)
                                                         if ( ( unit = engine_get_select_unit( mx, my, region ) ) && cur_unit != unit ) {
                                                             /* first capture the flag for the human unit */
                                                             if ( cur_ctrl == PLAYER_CTRL_HUMAN ) {
-                                                                if ( engine_capture_flag( cur_unit ) ) {
+                                                                if ( engine_capture_flag( cur_unit ) ||
+																		map[cur_unit->x][cur_unit->y].escape_zone) {
                                                                     /* CHECK IF SCENARIO IS FINISHED */
                                                                     if ( scen_check_result( 0 ) )  {
                                                                         engine_finish_scenario();
@@ -2851,19 +2949,20 @@ static void engine_check_events(int *reinit)
                                                 gui_set_cursor( CURSOR_STD );
                                             }
                                             else {
-                                                /* show menu */
-                                                engine_show_game_menu( cx, cy );
+                                                /* show menu
+                                                engine_show_game_menu( cx, cy ); */
                                             }
                                         }
                                         else
                                             if ( cur_unit ) {
                                                 /* handle current unit */
-                                                if ( cur_unit->x == mx && cur_unit->y == my && engine_get_prim_unit( mx, my, region ) == cur_unit )
-                                                    engine_show_unit_menu( cx, cy );
-                                                else {
+                                                /*if ( cur_unit->x == mx && cur_unit->y == my && engine_get_prim_unit( mx, my, region ) == cur_unit )
+                                                	engine_show_unit_menu( cx, cy );
+                                                else {*/
                                                     /* first capture the flag for the human unit */
                                                     if ( cur_ctrl == PLAYER_CTRL_HUMAN ) {
-                                                        if ( engine_capture_flag( cur_unit ) ) {
+                                                        if ( engine_capture_flag( cur_unit ) ||
+																map[cur_unit->x][cur_unit->y].escape_zone ) {
                                                             /* CHECK IF SCENARIO IS FINISHED */
                                                             if ( scen_check_result( 0 ) )  {
                                                                 engine_finish_scenario();
@@ -2875,8 +2974,10 @@ static void engine_check_events(int *reinit)
                                                     engine_select_unit( 0 );
                                                     engine_update_info( mx, my, region );
                                                     draw_map = 1;
-                                                }
+                                                //} old unit show menu block
                                             }
+                                        /* anytime anywhere: hide game menu on right click */
+                                        engine_hide_game_menu();
                                         break;
                                 }
                                 break;
@@ -3210,7 +3311,19 @@ static int engine_capture_flag( Unit *unit ) {
                 }
     return 0;
 }
-                                
+
+/* get new map view port after screen resolution change */
+static void engine_update_mapview_size()
+{
+	int i,j;
+	    mapview_w = sdl.screen->w - gui_panel_w;
+        /* reset engine's map size (number of tiles on screen) */
+        for ( i = map_sx, map_sw = 0; i < mapview_w; i += hex_x_offset )
+            map_sw++;
+        for ( j = map_sy, map_sh = 0; j < sdl.screen->h; j += hex_h )
+            map_sh++;
+}
+
 /*
 ====================================================================
 Deqeue the next action and perform it.
@@ -3220,7 +3333,7 @@ static void engine_handle_next_action( int *reinit )
 {
     Action *action = 0;
     int enemy_spotted = 0;
-    int depth, flags, i, j;
+    int depth, flags;
     /* lock action queue? */
     if ( status == STATUS_CONF || status == STATUS_ATTACK || status == STATUS_STRAT_ATTACK || status == STATUS_MOVE )
         return;
@@ -3279,14 +3392,11 @@ static void engine_handle_next_action( int *reinit )
                                         (flags&SDL_FULLSCREEN)?tr("Fullscreen"):
                                             tr("Window"));
                 /* adjust windows */
+                gui_resize_panel();
                 gui_adjust();
                 if ( setup.type != SETUP_RUN_TITLE ) {
-                    /* reset engine's map size (number of tiles on screen) */
-                    for ( i = map_sx, map_sw = 0; i < sdl.screen->w; i += hex_x_offset )
-                        map_sw++;
-                    for ( j = map_sy, map_sh = 0; j < sdl.screen->h; j += hex_h )
-                        map_sh++;
-                    /* reset map pos if nescessary */
+                	engine_update_mapview_size();
+                    /* reset map pos if necessary */
                     if ( map_x + map_sw >= map_w )
                         map_x = map_w - map_sw;
                     if ( map_y + map_sh >= map_h )
@@ -3296,6 +3406,7 @@ static void engine_handle_next_action( int *reinit )
                     /* recreate strategic map */
                     strat_map_delete();
                     strat_map_create();
+                    gui_init_minimap();
                     /* recreate screen buffer */
                     free_surf( &sc_buffer );
                     sc_buffer = create_surf( sdl.screen->w, sdl.screen->h, SDL_SWSURFACE );
@@ -3305,7 +3416,7 @@ static void engine_handle_next_action( int *reinit )
                 /* set config */
                 config.width = action->w;
                 config.height = action->h;
-                config.fullscreen = flags & SDL_FULLSCREEN;
+                config.fullscreen = (flags & SDL_FULLSCREEN)?1:0;
             }
             break;
         case ACTION_SET_SPOT_MASK:
@@ -3682,7 +3793,8 @@ static void engine_update( int ms )
                      * original Panzer General behaviour
                      */
                     if ( cur_ctrl == PLAYER_CTRL_CPU ) {
-                        if ( engine_capture_flag( move_unit ) ) {
+                        if ( engine_capture_flag( move_unit ) ||
+								map[move_unit->x][move_unit->y].escape_zone ) {
                             /* CHECK IF SCENARIO IS FINISHED */
                             if ( scen_check_result( 0 ) )  {
                                 engine_finish_scenario();
@@ -3700,6 +3812,8 @@ static void engine_update( int ms )
                     phase = PHASE_END_MOVE;
                     break;
                 case PHASE_END_MOVE:
+                	/* update minimap */
+                	gui_update_minimap(1);
                     /* fade out sound */
 #ifdef WITH_SOUND         
                     audio_fade_out( 0, 500 ); /* move sound channel */
@@ -4180,7 +4294,7 @@ static void engine_main_loop( int *reinit )
     int ms;
     if ( status == STATUS_TITLE && !term_game ) {
         engine_draw_bkgnd();
-        engine_show_game_menu(10,10);
+        //engine_show_game_menu(10,10);
         refresh_screen( 0, 0, 0, 0 );
     }
     else if ( status == STATUS_CAMP_BRIEFING )
@@ -4270,6 +4384,8 @@ int engine_init()
     /* scenario&campaign or title*/
     if ( setup.type == SETUP_RUN_TITLE ) {
         status = STATUS_TITLE;
+        engine_check_unit_buttons();
+        engine_check_menu_buttons();
         return 1;
     }
     if ( setup.type == SETUP_CAMP_BRIEFING ) {
@@ -4373,10 +4489,7 @@ int engine_init()
     map_x = map_y = 0;
     map_sx = -hex_x_offset;
     map_sy = -hex_h;
-    for ( i = map_sx, map_sw = 0; i < sdl.screen->w; i += hex_x_offset )
-        map_sw++;
-    for ( j = map_sy, map_sh = 0; j < sdl.screen->h; j += hex_h )
-        map_sh++;
+    engine_update_mapview_size();
     /* reset scroll delay */
     set_delay( &scroll_delay, 0 );
     scroll_block = 0;
@@ -4390,10 +4503,15 @@ int engine_init()
     left_deploy_units = list_create( LIST_NO_AUTO_DELETE, LIST_NO_CALLBACK );
     /* build strategic map */
     strat_map_create();
+    gui_init_minimap();
     /* clear status */
     status = STATUS_NONE;
     /* weather */
     cur_weather = scen_get_weather();
+    /* unit buttons */
+    gui_panel_show();
+    engine_check_unit_buttons();
+    engine_check_menu_buttons();
     return 1;
 }
 void engine_shutdown()
diff --git a/src/gfx/Makefile.in b/src/gfx/Makefile.in
index 6e8fcf7..d7bb0b8 100644
--- a/src/gfx/Makefile.in
+++ b/src/gfx/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,13 +90,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/gfx
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -175,6 +184,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -357,6 +367,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -389,7 +400,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gfx/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/gfx/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -702,6 +712,8 @@ uninstall-am: uninstall-gfxDATA
 	mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
 	uninstall-am uninstall-gfxDATA
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/gfx/flags/Makefile.am b/src/gfx/flags/Makefile.am
index f2300b1..2b7efc1 100644
--- a/src/gfx/flags/Makefile.am
+++ b/src/gfx/flags/Makefile.am
@@ -1,2 +1,5 @@
 flagsdir = $(inst_dir)/gfx/flags
-flags_DATA =
\ No newline at end of file
+flags_DATA =
+
+install-data-local:
+		$(mkinstalldirs) $(DESTDIR)$(flagsdir)
diff --git a/src/gfx/flags/Makefile.in b/src/gfx/flags/Makefile.in
index 9d8e0a8..a55b3fc 100644
--- a/src/gfx/flags/Makefile.in
+++ b/src/gfx/flags/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,13 +90,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/gfx/flags
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -140,6 +149,7 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(flagsdir)"
 DATA = $(flags_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -297,6 +307,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -327,7 +338,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gfx/flags/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/gfx/flags/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -460,7 +470,7 @@ info: info-am
 
 info-am:
 
-install-data-am: install-flagsDATA
+install-data-am: install-data-local install-flagsDATA
 
 install-dvi: install-dvi-am
 
@@ -511,15 +521,20 @@ uninstall-am: uninstall-flagsDATA
 .PHONY: all all-am check check-am clean clean-generic cscopelist-am \
 	ctags-am distclean distclean-generic distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-flagsDATA install-html install-html-am \
-	install-info install-info-am install-man install-pdf \
-	install-pdf-am install-ps install-ps-am install-strip \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-	pdf-am ps ps-am tags-am uninstall uninstall-am \
-	uninstall-flagsDATA
+	install-data-am install-data-local install-dvi install-dvi-am \
+	install-exec install-exec-am install-flagsDATA install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am uninstall-flagsDATA
+
+.PRECIOUS: Makefile
+
 
+install-data-local:
+		$(mkinstalldirs) $(DESTDIR)$(flagsdir)
 
 # 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.
diff --git a/src/gfx/terrain/Makefile.am b/src/gfx/terrain/Makefile.am
index f7b397b..ea32b44 100644
--- a/src/gfx/terrain/Makefile.am
+++ b/src/gfx/terrain/Makefile.am
@@ -1,2 +1,5 @@
 terraindir = $(inst_dir)/gfx/terrain
-terrain_DATA =
\ No newline at end of file
+terrain_DATA =
+
+install-data-local:
+		$(mkinstalldirs) $(DESTDIR)$(terraindir)
diff --git a/src/gfx/terrain/Makefile.in b/src/gfx/terrain/Makefile.in
index fc9119d..ec7c592 100644
--- a/src/gfx/terrain/Makefile.in
+++ b/src/gfx/terrain/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,13 +90,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/gfx/terrain
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -140,6 +149,7 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(terraindir)"
 DATA = $(terrain_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -297,6 +307,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -327,7 +338,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gfx/terrain/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/gfx/terrain/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -460,7 +470,7 @@ info: info-am
 
 info-am:
 
-install-data-am: install-terrainDATA
+install-data-am: install-data-local install-terrainDATA
 
 install-dvi: install-dvi-am
 
@@ -511,15 +521,20 @@ uninstall-am: uninstall-terrainDATA
 .PHONY: all all-am check check-am clean clean-generic cscopelist-am \
 	ctags-am distclean distclean-generic distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip install-terrainDATA \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-	pdf-am ps ps-am tags-am uninstall uninstall-am \
-	uninstall-terrainDATA
+	install-data-am install-data-local install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	install-terrainDATA installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am uninstall-terrainDATA
+
+.PRECIOUS: Makefile
+
 
+install-data-local:
+		$(mkinstalldirs) $(DESTDIR)$(terraindir)
 
 # 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.
diff --git a/src/gfx/units/Makefile.am b/src/gfx/units/Makefile.am
index b360301..183da9d 100644
--- a/src/gfx/units/Makefile.am
+++ b/src/gfx/units/Makefile.am
@@ -1,2 +1,5 @@
 unitsdir = $(inst_dir)/gfx/units
-units_DATA =
\ No newline at end of file
+units_DATA =
+
+install-data-local:
+		$(mkinstalldirs) $(DESTDIR)$(unitsdir)
diff --git a/src/gfx/units/Makefile.in b/src/gfx/units/Makefile.in
index 7c57789..2672b35 100644
--- a/src/gfx/units/Makefile.in
+++ b/src/gfx/units/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,13 +90,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/gfx/units
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -140,6 +149,7 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(unitsdir)"
 DATA = $(units_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -297,6 +307,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -327,7 +338,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gfx/units/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/gfx/units/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -460,7 +470,7 @@ info: info-am
 
 info-am:
 
-install-data-am: install-unitsDATA
+install-data-am: install-data-local install-unitsDATA
 
 install-dvi: install-dvi-am
 
@@ -511,15 +521,20 @@ uninstall-am: uninstall-unitsDATA
 .PHONY: all all-am check check-am clean clean-generic cscopelist-am \
 	ctags-am distclean distclean-generic distdir dvi dvi-am html \
 	html-am info info-am install install-am install-data \
-	install-data-am install-dvi install-dvi-am install-exec \
-	install-exec-am install-html install-html-am install-info \
-	install-info-am install-man install-pdf install-pdf-am \
-	install-ps install-ps-am install-strip install-unitsDATA \
-	installcheck installcheck-am installdirs maintainer-clean \
-	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
-	pdf-am ps ps-am tags-am uninstall uninstall-am \
-	uninstall-unitsDATA
+	install-data-am install-data-local install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	install-unitsDATA installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic pdf pdf-am ps ps-am tags-am uninstall \
+	uninstall-am uninstall-unitsDATA
+
+.PRECIOUS: Makefile
+
 
+install-data-local:
+		$(mkinstalldirs) $(DESTDIR)$(unitsdir)
 
 # 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.
diff --git a/src/gui.c b/src/gui.c
index 05e8d9b..415fd62 100644
--- a/src/gui.c
+++ b/src/gui.c
@@ -23,6 +23,7 @@
 #include "unit.h"
 #include "file.h"
 #include "map.h"
+#include "strat_map.h"
 #include "list.h"
 #include "nation.h"
 #include "unit_lib.h"
@@ -67,6 +68,9 @@ extern VCond *vconds;
 extern int vcond_count;
 extern Config config;
 extern int camp_loaded;
+extern int mm_width;
+extern int mm_height;
+extern SDL_Surface *minimap;
 
 /*
 ====================================================================
@@ -105,6 +109,7 @@ int deploy_show_count = 7; /* number of displayed units in list */
 int unit_list_offset = 0; /* offset in unit_list */
 int unit_list_max_offset = 0;
 int unit_list_graphical_offset=150; /* y-offset for rendering in dialog */ 
+int gui_panel_w = 220;	/* size of fixed GUI panel */;
 
 /*
 ====================================================================
@@ -197,9 +202,9 @@ Create the gui and use the graphics in gfx/themes/...
 int gui_load( const char *dir )
 {
     char str[128];
-    int i;
+    int i, dy, dx;
     int sx, sy;
-    char path[256], path2[256], path3[256], path4[256];
+    char path[256], path2[256], path3[256];
 	
     gui_delete();
     gui = calloc( 1, sizeof( GUI ) );
@@ -237,11 +242,11 @@ int gui_load( const char *dir )
     /* basic fonts */
     sprintf( path, "../themes/%s/font_std.bmp", dir );
     gui->font_std = load_font( path );
-    sprintf( path, "../themes/%s/font_status.bmp", dir );
+    sprintf( path, "../themes/%s/font_std.bmp", dir );
     gui->font_status = load_font( path );
     sprintf( path, "../themes/%s/font_error.bmp", dir );
     gui->font_error = load_font( path );
-    sprintf( path, "../themes/%s/font_turn_info.bmp", dir );
+    sprintf( path, "../themes/%s/font_std.bmp", dir );
     gui->font_turn_info = load_font( path );
     sprintf( path, "../themes/%s/font_brief.bmp", dir );
     gui->font_brief = load_font( path );
@@ -249,35 +254,41 @@ int gui_load( const char *dir )
     sprintf( path, "../themes/%s/cursors.bmp", dir );
     if ( ( gui->cursors = image_create( load_surf( path, SDL_SWSURFACE ), 22, 22, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
+    /* gui panel */
+    if ( ( gui->panel = frame_create( gui_create_frame( gui_panel_w, sdl.screen->h ), 160, sdl.screen, 0, 0 ) ) == 0 )
+        goto failure;
     /* info label */
-    if ( ( gui->label = label_create( gui_create_frame( 240, 30 ), 160, gui->font_std, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->label = label_create( gui_create_frame( 214, 30 ), 160, gui->font_std, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
-    if ( ( gui->label2 = label_create( gui_create_frame( 240, 30 ), 160, gui->font_std, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->label2 = label_create( gui_create_frame( 214, 30 ), 160, gui->font_std, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     label_hide( gui->label, 1 );
     label_hide( gui->label2, 1 );
     /* quick unit infos */
-    if ( ( gui->qinfo1 = frame_create( gui_create_frame( 240, 60 ), 160, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->qinfo1 = frame_create( gui_create_frame( 214, 60 ), 160, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     frame_hide( gui->qinfo1, 1 );
-    if ( ( gui->qinfo2 = frame_create( gui_create_frame( 240, 60 ), 160, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->qinfo2 = frame_create( gui_create_frame( 214, 60 ), 160, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     frame_hide( gui->qinfo2, 1 );
+    /* minimap */
+    if ( ( gui->minimap = mmview_create( 210, 210 )) == 0 )
+        goto failure;
     /* full unit info */
-    if ( ( gui->finfo = frame_create( gui_create_frame( 460, 280 ), 160, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->finfo = frame_create( gui_create_frame( 460, 280 ), 200, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     frame_hide( gui->finfo, 1 );
     //unit list
-    if ( ( gui->unit_list = frame_create( gui_create_frame( 600, 460 ), 160, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->unit_list = frame_create( gui_create_frame( 600, 460 ), 200, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     frame_hide( gui->unit_list, 1 );
     /* scenario info */
-    if ( ( gui->sinfo = frame_create( gui_create_frame( 300, 260 ), 160, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->sinfo = frame_create( gui_create_frame( 300, 260 ), 200, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     frame_hide( gui->sinfo, 1 );
     /* confirm window */
     sprintf( path2, "../themes/%s/confirm_buttons.bmp", dir );
-    if ( ( gui->confirm = group_create( gui_create_frame( 200, 80 ), 160, load_surf( path2, SDL_SWSURFACE ),
+    if ( ( gui->confirm = group_create( gui_create_frame( 200, 80 ), 200, load_surf( path2, SDL_SWSURFACE ),
                                         20, 20, 6, ID_OK, gui->label, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     sx = gui->confirm->frame->img->img->w - 60; sy = gui->confirm->frame->img->img->h - 30;
@@ -285,34 +296,34 @@ int gui_load( const char *dir )
     group_add_button( gui->confirm, ID_CANCEL, sx, sy, 0, tr("Cancel") );
     group_hide( gui->confirm, 1 );
     /* unit buttons */
+    sx = 6; sy = 6;
+    dx = dy = 51;
     sprintf( path2, "../themes/%s/unit_buttons.bmp", dir );
-    if ( ( gui->unit_buttons = group_create( gui_create_frame( 30, 230 ), 160, load_surf( path2, SDL_SWSURFACE ),
-                                             24, 24, 7, ID_SUPPLY, gui->label, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->unit_buttons = group_create( gui_create_frame( 2*sx+4*dx-3, 2*sy+2*dy-3 ), 160, load_surf( path2, SDL_SWSURFACE ),
+                                             48, 48, 7, ID_SUPPLY, gui->label, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
-    sx = 3; sy = 3;
-    group_add_button( gui->unit_buttons, ID_UNDO, sx, sy, 0, tr("Undo Turn [u]") ); sy += 40; 
-    group_add_button( gui->unit_buttons, ID_SUPPLY, sx, sy, 0, tr("Supply Unit [s]") ); sy += 30; 
-    group_add_button( gui->unit_buttons, ID_EMBARK_AIR, sx, sy, 0, tr("Air Embark") ); sy += 30; 
-    group_add_button( gui->unit_buttons, ID_MERGE, sx, sy, 0, tr("Merge Unit [j]") ); sy += 30; 
-    group_add_button( gui->unit_buttons, ID_SPLIT, sx, sy, 0, tr("Split Unit [x+1..9]") ); sy += 30; 
-    group_add_button( gui->unit_buttons, ID_RENAME, sx, sy, 0, tr("Rename Unit") ); sy += 40;
+    group_add_button( gui->unit_buttons, ID_UNDO, sx, sy, 0, tr("Undo Turn [u]") ); sx += dx;
+    group_add_button( gui->unit_buttons, ID_SUPPLY, sx, sy, 0, tr("Supply Unit [s]") ); sx += dx;
+    group_add_button( gui->unit_buttons, ID_EMBARK_AIR, sx, sy, 0, tr("Air Embark") ); sx += dx;
+    group_add_button( gui->unit_buttons, ID_RENAME, sx, sy, 0, tr("Rename Unit") ); sx = 6; sy += dy;
+    group_add_button( gui->unit_buttons, ID_MERGE, sx, sy, 0, tr("Merge Unit [j]") ); sx += dx;
+    group_add_button( gui->unit_buttons, ID_SPLIT, sx, sy, 0, tr("Split Unit [x+1..9]") ); sx += 2*dx;
     group_add_button( gui->unit_buttons, ID_DISBAND, sx, sy, 0, tr("Disband Unit") ); 
-    group_hide( gui->unit_buttons, 1 );
     /* split menu */
     sprintf( path2, "../themes/%s/strength_buttons.bmp", dir );
-    if ( ( gui->split_menu = group_create( gui_create_frame( 26, 186 ), 160, load_surf( path2, SDL_SWSURFACE ),
-                                          20, 20, 10, ID_SPLIT_1, gui->label, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->split_menu = group_create( gui_create_frame( 40, 296 ), 200, load_surf( path2, SDL_SWSURFACE ),
+                                          32, 32, 10, ID_SPLIT_1, gui->label, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
-    sx = 3; sy = 3;
+    sx = 4; sy = 4;
     for ( i = 0; i < 9; i++ ) {
         sprintf( str, tr("Split Up %d Strength"), i+1 );
         group_add_button( gui->split_menu, ID_SPLIT_1 + i, sx, sy, 0, str );
-        sy += 20;
+        sy += 32;
     }
     group_hide( gui->split_menu, 1 );
     /* deploy window */
     sprintf( path2, "../themes/%s/deploy_buttons.bmp", dir );
-    if ( ( gui->deploy_window = group_create( gui_create_frame( 80, 440 ), 160, load_surf( path2, SDL_SWSURFACE ),
+    if ( ( gui->deploy_window = group_create( gui_create_frame( 80, 440 ), 200, load_surf( path2, SDL_SWSURFACE ),
                                               20, 20, 6, ID_APPLY_DEPLOY, gui->label, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     sx = gui->deploy_window->frame->img->img->w - 65;
@@ -323,79 +334,85 @@ int gui_load( const char *dir )
     group_add_button( gui->deploy_window, ID_CANCEL_DEPLOY, sx + 30, sy, 0, tr("Cancel Deployment") );
     group_hide( gui->deploy_window, 1 );
     /* edit */
-    if ( ( gui->edit = edit_create( gui_create_frame( 240, 30 ), 160, gui->font_std, 20, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->edit = edit_create( gui_create_frame( 214, 30 ), 160, gui->font_std, 20, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     edit_hide( gui->edit, 1 );
     /* base menu */
+    sx = 6; sy = 6;
+    dx = dy = 51;
     sprintf( path2, "../themes/%s/menu0_buttons.bmp", dir );
-    if ( ( gui->base_menu = group_create( gui_create_frame( 30, 280 ), 160, load_surf( path2, SDL_SWSURFACE ),
-                                          24, 24, 9, ID_MENU, gui->label, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->base_menu = group_create( gui_create_frame( 2*sx+4*dx-3, 2*sy+2*dy-3 ), 160, load_surf( path2, SDL_SWSURFACE ),
+                                          48, 48, 9, ID_MENU, gui->label, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
-    sx = 3; sy = 3;
-    group_add_button( gui->base_menu, ID_AIR_MODE, sx, sy, 0, tr("Switch Air/Ground [t]") ); sy += 30; 
-    group_add_button( gui->base_menu, ID_STRAT_MAP, sx, sy, 0, tr("Strategic Map [o]") ); sy += 30; 
-    group_add_button( gui->base_menu, ID_PURCHASE, sx, sy, 0, tr("Request Reinforcements") ); sy += 30;
-    group_add_button( gui->base_menu, ID_DEPLOY, sx, sy, 0, tr("Deploy Reinforcements [d]") ); sy += 30; 
-    group_add_button( gui->base_menu, ID_UNIT_LIST, sx, sy, 0, tr("Unit List") ); sy += 30; 
-    group_add_button( gui->base_menu, ID_SCEN_INFO, sx, sy, 0, tr("Scenario Info [i]") ); sy += 30; 
-    group_add_button( gui->base_menu, ID_CONDITIONS, sx, sy, 0, tr("Victory Conditions") ); sy += 30; 
-    group_add_button( gui->base_menu, ID_END_TURN, sx, sy, 0, tr("End Turn [e]") ); sy += 40; 
-    group_add_button( gui->base_menu, ID_MENU, sx, sy, 0, tr("Main Menu") );
-    group_hide( gui->base_menu, 1 );
+    group_add_button( gui->base_menu, ID_AIR_MODE, sx, sy, 0, tr("Switch Air/Ground [t]") ); sx += dx;
+    group_add_button( gui->base_menu, ID_STRAT_MAP, sx, sy, 0, tr("Strategic Map [o]") ); sx += dx;
+    group_add_button( gui->base_menu, ID_PURCHASE, sx, sy, 0, tr("Request Reinforcements") ); sx += dx;
+    group_add_button( gui->base_menu, ID_DEPLOY, sx, sy, 0, tr("Deploy Reinforcements [d]") ); sx = 6; sy += dy;
+    group_add_button( gui->base_menu, ID_UNIT_LIST, sx, sy, 0, tr("Unit List") ); sx += dx;
+    group_add_button( gui->base_menu, ID_SCEN_INFO, sx, sy, 0, tr("Scenario Info [i]") ); sx += dx;
+    group_add_button( gui->base_menu, ID_CONDITIONS, sx, sy, 0, tr("Victory Conditions") ); sx += dx;
+    group_add_button( gui->base_menu, ID_END_TURN, sx, sy, 0, tr("End Turn [e]") );
     /* main_menu */
+    sx = 6; sy = 6;
+    dx = dy = 51;
     sprintf( path2, "../themes/%s/menu1_buttons.bmp", dir );
-    if ( ( gui->main_menu = group_create( gui_create_frame( 30, 210 ), 160, load_surf( path2, SDL_SWSURFACE ),
-                                          24, 24, 7, ID_SAVE, gui->label, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->main_menu = group_create( gui_create_frame( 2*sx+4*dx-3, 2*sy+2*dy-3 ), 160, load_surf( path2, SDL_SWSURFACE ),
+                                          48, 48, 7, ID_SAVE, gui->label, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
-    sx = 3; sy = 3;
-    group_add_button( gui->main_menu, ID_SAVE, sx, sy, 0, tr("Save Game") ); sy += 30;
-    group_add_button( gui->main_menu, ID_LOAD, sx, sy, 0, tr("Load Game") ); sy += 30;
-    group_add_button( gui->main_menu, ID_RESTART, sx, sy, 0, tr("Restart Scenario") ); sy += 30;
-    group_add_button( gui->main_menu, ID_CAMP, sx, sy, 0, tr("Load Campaign") ); sy += 30;
-    group_add_button( gui->main_menu, ID_SCEN, sx, sy, 0, tr("Load Scenario") ); sy += 30;
-    group_add_button( gui->main_menu, ID_OPTIONS, sx, sy, 0, tr("Options") ); sy += 30;
+    group_add_button( gui->main_menu, ID_SAVE, sx, sy, 0, tr("Save Game") ); sx += dx;
+    group_add_button( gui->main_menu, ID_LOAD, sx, sy, 0, tr("Load Game") ); sx += dx;
+    group_add_button( gui->main_menu, ID_SCEN, sx, sy, 0, tr("Load Scenario") ); sx += dx;
+    group_add_button( gui->main_menu, ID_CAMP, sx, sy, 0, tr("Load Campaign") ); sx = 6; sy += dy;
+    group_add_button( gui->main_menu, ID_OPTIONS, sx, sy, 0, tr("Options") ); sx += dx;
+    group_add_button( gui->main_menu, ID_RESTART, sx, sy, 0, tr("Restart Scenario") ); sx += 2*dx;
     group_add_button( gui->main_menu, ID_QUIT, sx, sy, 0, tr("Quit Game") );
-    group_hide( gui->main_menu, 1 );
     /* load menu */
     sprintf( path2, "../themes/%s/menu2_buttons.bmp", dir );
-    if ( ( gui->load_menu = group_create( gui_create_frame( 30, 246+24 ), 160, load_surf( path2, SDL_SWSURFACE ),
-                                          24, 24, 11, ID_LOAD_0, gui->label, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->load_menu = group_create( gui_create_frame( 38, 11*32+6 ), 200, load_surf( path2, SDL_SWSURFACE ),
+                                          32, 32, 11, ID_LOAD_0, gui->label, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     sx = 3; sy = 3;
+    dy = 32;
     for ( i = 0; i < SLOT_COUNT; i++ ) {
         sprintf( str, tr("Load: %s"), slot_get_name( i ) );
         group_add_button( gui->load_menu, ID_LOAD_0 + i, sx, sy, 0, str );
-        sy += 24;
+        sy += dy;
     }
     group_hide( gui->load_menu, 1 );
     /* save menu */
     sprintf( path2, "../themes/%s/menu2_buttons.bmp", dir );
-    if ( ( gui->save_menu = group_create( gui_create_frame( 30, 246 ), 160, load_surf( path2, SDL_SWSURFACE ),
-                                          24, 24, 10, ID_SAVE_0, gui->label, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->save_menu = group_create( gui_create_frame( 38, 10*32+6 ), 200, load_surf( path2, SDL_SWSURFACE ),
+                                          32, 32, 10, ID_SAVE_0, gui->label, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     sx = 3; sy = 3;
     for ( i = 0; i < 10; i++ ) {
         sprintf( str, tr("Save: %s"), slot_get_name( i ) );
         group_add_button( gui->save_menu, ID_SAVE_0 + i, sx, sy, 0, str );
-        sy += 24;
+        sy += dy;
     }
     group_hide( gui->save_menu, 1 );
     /* options */
     sprintf( path2, "../themes/%s/menu3_buttons.bmp", dir );
-    if ( ( gui->opt_menu = group_create( gui_create_frame( 30, 300 - 60 ), 160, load_surf( path2, SDL_SWSURFACE ),
-                                          24, 24, 10, ID_C_SUPPLY, gui->label, sdl.screen, 0, 0 ) ) == 0 )
+    if ( ( gui->opt_menu = group_create( gui_create_frame( 54, 6+7*54 ), 200, load_surf( path2, SDL_SWSURFACE ),
+                                          48, 48, 10, ID_C_SUPPLY, gui->label, sdl.screen, 0, 0 ) ) == 0 )
         goto failure;
     sx = 3; sy = 3;
+    dy = 54;
     //group_add_button( gui->opt_menu, ID_C_SUPPLY, sx, sy, 1, "Unit Supply" ); sy += 30;
     //group_add_button( gui->opt_menu, ID_C_WEATHER, sx, sy, 1, "Weather Influence" ); sy += 30;
-    group_add_button( gui->opt_menu, ID_C_GRID, sx, sy, 1, tr("Hex Grid [g]") ); sy += 30;
-    group_add_button( gui->opt_menu, ID_C_SHOW_CPU, sx, sy, 1, tr("Show CPU Turn") ); sy += 30;
-    group_add_button( gui->opt_menu, ID_C_SHOW_STRENGTH, sx, sy, 1, tr("Show Unit Strength [.]") ); sy += 30;
-    group_add_button( gui->opt_menu, ID_C_SOUND, sx, sy, 1, tr("Sound") ); sy += 30;
-    group_add_button( gui->opt_menu, ID_C_SOUND_INC, sx, sy, 0, tr("Sound Volume Up") ); sy += 30;
-    group_add_button( gui->opt_menu, ID_C_SOUND_DEC, sx, sy, 0, tr("Sound Volume Down") ); sy += 30;
-    group_add_button( gui->opt_menu, ID_C_MUSIC, sx, sy, 1, tr("Music") ); sy += 30;
-    group_add_button( gui->opt_menu, ID_C_VMODE, sx, sy, 0, tr("Video Mode [v]") );
+    group_add_button( gui->opt_menu, ID_C_GRID, sx, sy, 1, tr("Hex Grid [g]") ); sy += dy;
+    group_add_button( gui->opt_menu, ID_C_SHOW_CPU, sx, sy, 1, tr("Show CPU Turn") ); sy += dy;
+    group_add_button( gui->opt_menu, ID_C_SHOW_STRENGTH, sx, sy, 1, tr("Show Unit Strength [.]") ); sy += dy;
+    group_add_button( gui->opt_menu, ID_C_SOUND, sx, sy, 1, tr("Sound") ); sy += dy;
+    group_add_button( gui->opt_menu, ID_C_SOUND_INC, sx, sy, 0, tr("Sound Volume Up") ); sy += dy;
+    group_add_button( gui->opt_menu, ID_C_SOUND_DEC, sx, sy, 0, tr("Sound Volume Down") ); sy += dy;
+    //group_add_button( gui->opt_menu, ID_C_MUSIC, sx, sy, 1, tr("Music") ); sy += dy;
+    group_add_button( gui->opt_menu, ID_C_VMODE, sx, sy, 1, tr("Fullscreen/Window [v]") );
+    group_lock_button(gui->opt_menu, ID_C_GRID, config.grid);
+    group_lock_button(gui->opt_menu, ID_C_SHOW_CPU, config.show_cpu_turn);
+    group_lock_button(gui->opt_menu, ID_C_SHOW_STRENGTH, config.show_bar);
+    group_lock_button(gui->opt_menu, ID_C_SOUND, config.sound_on);
+    group_lock_button(gui->opt_menu, ID_C_VMODE, !config.fullscreen);
     group_hide( gui->opt_menu, 1 );
     /* video mode dialog */
     sprintf( path, "../themes/%s/scroll_buttons.bmp", dir );
@@ -407,24 +424,30 @@ int gui_load( const char *dir )
 			    load_surf( path2, SDL_SWSURFACE ), 20, 20,
 			    ID_VMODE_OK, sdl.screen, 0, 0);
     select_dlg_hide( gui->vmode_dlg, 1 );
-    /* scenario dialogue */
+
+    /* scenario dialogue + setup */
     sprintf( path, "../themes/%s/scen_dlg_buttons.bmp", dir );
     sprintf( path2, "../themes/%s/scroll_buttons.bmp", dir );
-    gui->scen_dlg = fdlg_create( gui_create_frame( 120, 240 ), 160, 10,
+    sprintf( path3, "../themes/%s/confirm_buttons.bmp", dir );
+    gui->scen_dlg = sdlg_create( gui_create_frame( 120, 300 ), 200, 10,
                                  load_surf( path2, SDL_SWSURFACE), 24, 24,
                                  20,
-                                 gui_create_frame( 220, 240),
-                                 load_surf( path, SDL_SWSURFACE ), 24, 24,
+                                 gui_create_frame( 240, 220),
+                                 load_surf( path3, SDL_SWSURFACE ), 20, 20,
                                  ID_SCEN_OK, 
                                  gui->label, 
                                  gui_render_file_name, gui_render_scen_info,
+                                 gui_create_frame( 240, 40),
+                                 load_surf( path, SDL_SWSURFACE ), 32, 32,
+                                 gui_create_frame( 240, 40),
+                                 load_surf( path, SDL_SWSURFACE ), 32, 32,
                                  sdl.screen, 0, 0 );
-    fdlg_add_button( gui->scen_dlg, ID_SCEN_SETUP, 0, tr("Player Setup") );
-    fdlg_hide( gui->scen_dlg, 1 );
+    sdlg_hide( gui->scen_dlg, 1 );
+
     /* campaign dialogue */
     sprintf( path, "../themes/%s/confirm_buttons.bmp", dir );
     sprintf( path2, "../themes/%s/scroll_buttons.bmp", dir );
-    gui->camp_dlg = fdlg_create( gui_create_frame( 120, 240 ), 160, 10,
+    gui->camp_dlg = fdlg_create( gui_create_frame( 120, 240 ), 200, 10,
                                  load_surf( path2, SDL_SWSURFACE), 24, 24,
                                  20,
                                  gui_create_frame( 220, 240),
@@ -434,33 +457,6 @@ int gui_load( const char *dir )
                                  gui_render_file_name, gui_render_camp_info,
                                  sdl.screen, 0, 0 );
     fdlg_hide( gui->camp_dlg, 1 );
-    /* setup window */
-    sprintf( path, "../themes/%s/scroll_buttons.bmp", dir );
-    sprintf( path2, "../themes/%s/ctrl_buttons.bmp", dir );
-    sprintf( path3, "../themes/%s/module_buttons.bmp", dir );
-    sprintf( path4, "../themes/%s/setup_confirm_buttons.bmp", dir );
-    gui->setup = sdlg_create( 
-                             gui_create_frame( 120, 120 ), load_surf( path, SDL_SWSURFACE ),  24, 24, 20, 
-                             gui_create_frame( 220, 40 ),  load_surf( path2, SDL_SWSURFACE ), 24, 24, ID_SETUP_CTRL,
-                             gui_create_frame( 220, 40 ),  load_surf( path3, SDL_SWSURFACE ), 24, 24, ID_SETUP_MODULE,
-                             gui_create_frame( 220, 40 ),  load_surf( path4, SDL_SWSURFACE ), 24, 24, ID_SETUP_OK,
-                             gui->label,
-                             gui_render_player_name, gui_handle_player_select,
-                             sdl.screen, 0, 0 );
-    sdlg_hide( gui->setup, 1 );
-    /* module dialogue */
-    sprintf( path, "../themes/%s/confirm_buttons.bmp", dir );
-    sprintf( path2, "../themes/%s/scroll_buttons.bmp", dir );
-    gui->module_dlg = fdlg_create( gui_create_frame( 120, 240 ), 160, 10,
-                                 load_surf( path2, SDL_SWSURFACE), 24, 24,
-                                 20,
-                                 gui_create_frame( 220, 240),
-                                 load_surf( path, SDL_SWSURFACE ), 20, 20,
-                                 ID_MODULE_OK, 
-                                 gui->label, 
-                                 gui_render_file_name, gui_render_module_info,
-                                 sdl.screen, 0, 0 );
-    fdlg_hide( gui->module_dlg, 1 );
     /* purchase dialogue */
     sprintf( path2, "../themes/%s", dir );
     if ( (gui->purchase_dlg = purchase_dlg_create( path2 )) == NULL)
@@ -510,6 +506,8 @@ void gui_delete()
         frame_delete( &gui->finfo );
         frame_delete( &gui->unit_list );
         frame_delete( &gui->sinfo );
+        frame_delete( &gui->panel );
+        mmview_delete( &gui->minimap );
         group_delete( &gui->confirm );
         group_delete( &gui->unit_buttons );
         group_delete( &gui->split_menu );
@@ -520,10 +518,8 @@ void gui_delete()
         group_delete( &gui->save_menu );
         group_delete( &gui->opt_menu );
 	select_dlg_delete( &gui->vmode_dlg );
-        fdlg_delete( &gui->scen_dlg );
+        sdlg_delete( &gui->scen_dlg );
         fdlg_delete( &gui->camp_dlg );
-        sdlg_delete( &gui->setup );
-        fdlg_delete( &gui->module_dlg );
         edit_delete( &gui->edit );
 	purchase_dlg_delete( &gui->purchase_dlg );
 #ifdef WITH_SOUND
@@ -542,54 +538,84 @@ measurements.
 */
 void gui_adjust()
 {
-    int label_top = 10;
-    int label_x = (sdl.screen->w - gui->label->frame->img->img->w ) >> 1;
-    /* info labels */
-    label_move( gui->label, label_x, label_top );
-    label_top += gui->label->frame->img->img->h + 5;
-    label_move( gui->label2, label_x, label_top );
-    /* unit infos */
-    frame_move( gui->qinfo1, 10, sdl.screen->h - 10 - gui->qinfo1->img->img->h );
-    frame_move( gui->qinfo2, 10, sdl.screen->h - 20 - gui->qinfo1->img->img->h * 2 );
-    /* full info */
-    frame_move( gui->finfo, ( sdl.screen->w - gui->finfo->img->img->w ) >> 1, ( sdl.screen->h - gui->finfo->img->img->h ) >> 1 );
-    frame_move( gui->unit_list, ( sdl.screen->w - gui->unit_list->img->img->w ) >> 1, ( sdl.screen->h - gui->unit_list->img->img->h ) >> 1 );
-    /* basic menu */
-    group_move( gui->base_menu, sdl.screen->w - 10 - gui->base_menu->frame->img->img->w, 
-                                sdl.screen->h - 10 - gui->base_menu->frame->img->img->h );
-    /* scenario info */
-    frame_move( gui->sinfo, ( sdl.screen->w - gui->sinfo->img->img->w ) >> 1, ( sdl.screen->h - gui->sinfo->img->img->h ) >> 1 );
-    /* confirm window */
-    group_move( gui->confirm, ( sdl.screen->w - gui->confirm->frame->img->img->w ) >> 1, ( sdl.screen->h - gui->confirm->frame->img->img->h ) >> 1 );
-    /* deploy window */
-    group_move( gui->deploy_window, ( sdl.screen->w - gui->deploy_window->frame->img->img->w ) - 10, 
-                ( sdl.screen->h - gui->deploy_window->frame->img->img->h ) / 2 );
-    /* edit */
-    edit_move( gui->edit, (sdl.screen->w - gui->edit->label->frame->img->img->w ) >> 1, 50 );
-    /* select dialogs */
-    select_dlg_move( gui->vmode_dlg, 
-                    (sdl.screen->w - select_dlg_get_width(gui->vmode_dlg)) /2,
-                    (sdl.screen->h - select_dlg_get_height(gui->vmode_dlg)) /2);
-    /* scenario dialogue */
-    fdlg_move( gui->scen_dlg, ( sdl.screen->w - ( gui->scen_dlg->group->frame->img->img->w  + 
-                                                  gui->scen_dlg->lbox->group->frame->img->img->w ) ) / 2,
-               ( sdl.screen->h - gui->scen_dlg->group->frame->img->img->h ) / 2 );
-    /* campaign dialogue */
-    fdlg_move( gui->camp_dlg, ( sdl.screen->w - ( gui->camp_dlg->group->frame->img->img->w  + 
-                                                  gui->camp_dlg->lbox->group->frame->img->img->w ) ) / 2,
-               ( sdl.screen->h - gui->camp_dlg->group->frame->img->img->h ) / 2 );
-    /* scenario setup */
-    sdlg_move( gui->setup, ( sdl.screen->w - ( gui->setup->list->group->frame->img->img->w + gui->setup->ctrl->frame->img->img->w ) ) / 2,
-                           ( sdl.screen->h - ( gui->setup->list->group->frame->img->img->h ) ) / 2 );
-    /* module dialogue */
-    fdlg_move( gui->module_dlg, ( sdl.screen->w - ( gui->module_dlg->group->frame->img->img->w  + 
-                                                  gui->module_dlg->lbox->group->frame->img->img->w ) ) / 2,
-               ( sdl.screen->h - gui->module_dlg->group->frame->img->img->h ) / 2 );
-	       
-    /* purchase dialogue */
-    purchase_dlg_move(gui->purchase_dlg, 
-		(sdl.screen->w - purchase_dlg_get_width(gui->purchase_dlg)) /2,
-		(sdl.screen->h - purchase_dlg_get_height(gui->purchase_dlg)) /2);
+	int sw = sdl.screen->w, sh = sdl.screen->h;
+	int cx, cy = 10;
+	int panel_x = sdl.screen->w - gui_panel_w;
+
+	/* panel */
+	frame_move(gui->panel, sw - gui_panel_w, 0);
+	/* info labels + edit */
+	if (sh <= 600) {
+		int label_top = 10;
+		cx = (sw - gui_panel_w - gui->label->frame->img->img->w) / 2;
+		label_move( gui->label, cx, label_top );
+		label_top += gui->label->frame->img->img->h;
+		label_move( gui->label2, cx, label_top );
+		cx = ( sw - gui_panel_w - gui->edit->label->frame->img->img->w)/2;
+		edit_move( gui->edit, cx, label_top );
+	} else {
+		cx = panel_x + (gui_panel_w - gui->label->frame->img->img->w)/2;
+		label_move( gui->label, cx, cy );
+		cy += gui->label->frame->img->img->h;
+		label_move( gui->label2, cx, cy );
+		cx = panel_x + (gui_panel_w - gui->edit->label->frame->img->img->w)/2;
+		edit_move( gui->edit, cx, cy );
+		cy += gui->label->frame->img->img->h + 5;
+	}
+	/* unit menu */
+	cx = panel_x + (gui_panel_w - gui->unit_buttons->frame->img->img->w)/2;
+	group_move(gui->unit_buttons, cx, cy);
+	cy += gui->unit_buttons->frame->img->img->h;
+	/* basic menu */
+	cx = panel_x + (gui_panel_w - gui->base_menu->frame->img->img->w)/2;
+	group_move(gui->base_menu, cx, cy );
+	cy += gui->base_menu->frame->img->img->h + 10;
+	/* unit infos */
+	if (sh <= 600) {
+		int dist = 10;
+		frame_move( gui->qinfo1, dist, sh - dist - gui->qinfo1->img->img->h );
+		frame_move( gui->qinfo2, dist, sh - dist - 2*gui->qinfo1->img->img->h );
+	} else {
+		cx = panel_x + (gui_panel_w - gui->qinfo1->img->img->w)/2;
+		frame_move( gui->qinfo1, cx, cy );
+		cy += gui->qinfo1->img->img->h;
+		frame_move( gui->qinfo2, cx, cy );
+		cy += gui->qinfo2->img->img->h + 5;
+	}
+	/* minimap */
+	cx = panel_x + (gui_panel_w - gui->minimap->w)/2;
+	mmview_move( gui->minimap, cx, cy);
+	/* main menu */
+	cx = panel_x + (gui_panel_w - gui->main_menu->frame->img->img->w)/2;
+	group_move(gui->main_menu, cx, sdl.screen->h - gui->main_menu->frame->img->img->h - 10 );
+	/* full info */
+	frame_move( gui->finfo, ( sdl.screen->w - gui_panel_w - gui->finfo->img->img->w ) >> 1, ( sdl.screen->h - gui->finfo->img->img->h ) >> 1 );
+	frame_move( gui->unit_list, ( sdl.screen->w - gui_panel_w - gui->unit_list->img->img->w ) >> 1, ( sdl.screen->h - gui->unit_list->img->img->h ) >> 1 );
+	/* scenario info */
+	frame_move( gui->sinfo, ( sdl.screen->w - gui_panel_w - gui->sinfo->img->img->w ) >> 1, ( sdl.screen->h - gui->sinfo->img->img->h ) >> 1 );
+	/* confirm window */
+	group_move( gui->confirm, ( sdl.screen->w - gui_panel_w - gui->confirm->frame->img->img->w ) >> 1, ( sdl.screen->h - gui->confirm->frame->img->img->h ) >> 1 );
+	/* deploy window */
+	group_move( gui->deploy_window, ( sdl.screen->w - gui_panel_w - gui->deploy_window->frame->img->img->w ),
+			( sdl.screen->h - gui->deploy_window->frame->img->img->h ) / 2 );
+	/* select dialogs */
+	select_dlg_move( gui->vmode_dlg,
+			(sdl.screen->w - gui_panel_w - select_dlg_get_width(gui->vmode_dlg)) /2,
+			(sdl.screen->h - select_dlg_get_height(gui->vmode_dlg)) /2);
+	/* scenario dialogue */
+	sdlg_move( gui->scen_dlg, ( sdl.screen->w - gui_panel_w -
+			( gui->scen_dlg->fdlg->group->frame->img->img->w  +
+					gui->scen_dlg->fdlg->lbox->group->frame->img->img->w ) ) / 2,
+			( sdl.screen->h - gui->scen_dlg->fdlg->lbox->group->frame->img->img->h ) / 2 );
+	/* campaign dialogue */
+	fdlg_move( gui->camp_dlg, ( sdl.screen->w - gui_panel_w -
+			( gui->camp_dlg->group->frame->img->img->w  +
+					gui->camp_dlg->lbox->group->frame->img->img->w ) ) / 2,
+			( sdl.screen->h - gui->camp_dlg->group->frame->img->img->h ) / 2 );
+	/* purchase dialogue */
+	purchase_dlg_move(gui->purchase_dlg,
+			(sdl.screen->w - gui_panel_w - purchase_dlg_get_width(gui->purchase_dlg)) /2,
+			(sdl.screen->h - purchase_dlg_get_height(gui->purchase_dlg)) /2);
 }
 
 /*
@@ -606,10 +632,12 @@ Hide/draw from/to screen
 */
 void gui_get_bkgnds()
 {
+	frame_get_bkgnd( gui->panel );
     label_get_bkgnd( gui->label );
     label_get_bkgnd( gui->label2 );
     frame_get_bkgnd( gui->qinfo1 );
     frame_get_bkgnd( gui->qinfo2 );
+    mmview_get_bkgnd( gui->minimap );
     frame_get_bkgnd( gui->finfo );
     frame_get_bkgnd( gui->unit_list );
     frame_get_bkgnd( gui->sinfo );
@@ -624,46 +652,47 @@ void gui_get_bkgnds()
     group_get_bkgnd( gui->confirm );
     group_get_bkgnd( gui->deploy_window );
     select_dlg_get_bkgnd( gui->vmode_dlg );
-    fdlg_get_bkgnd( gui->scen_dlg );
+    sdlg_get_bkgnd( gui->scen_dlg );
     fdlg_get_bkgnd( gui->camp_dlg );
-    fdlg_get_bkgnd( gui->module_dlg );
-    sdlg_get_bkgnd( gui->setup );
     purchase_dlg_get_bkgnd( gui->purchase_dlg );
     image_get_bkgnd( gui->cursors );
 }
 void gui_draw_bkgnds()
 {
-    label_draw_bkgnd( gui->label ); 
-    label_draw_bkgnd( gui->label2 ); 
-    frame_draw_bkgnd( gui->qinfo1 ); 
-    frame_draw_bkgnd( gui->qinfo2 ); 
+	frame_draw_bkgnd( gui->panel ); // includes some windows
+	if (sdl.screen->h <= 600) {
+		label_draw_bkgnd( gui->label );
+		label_draw_bkgnd( gui->label2 );
+		frame_draw_bkgnd( gui->qinfo1 );
+		frame_draw_bkgnd( gui->qinfo2 );
+		edit_draw_bkgnd( gui->edit );
+	}
     frame_draw_bkgnd( gui->finfo ); 
     frame_draw_bkgnd( gui->unit_list ); 
     frame_draw_bkgnd( gui->sinfo );
-    group_draw_bkgnd( gui->base_menu );
-    group_draw_bkgnd( gui->main_menu );
+    //group_draw_bkgnd( gui->base_menu );
+    //group_draw_bkgnd( gui->main_menu );
     group_draw_bkgnd( gui->load_menu );
     group_draw_bkgnd( gui->save_menu );
     group_draw_bkgnd( gui->opt_menu );
-    group_draw_bkgnd( gui->unit_buttons);
+    //group_draw_bkgnd( gui->unit_buttons);
     group_draw_bkgnd( gui->split_menu );
-    edit_draw_bkgnd( gui->edit );
     group_draw_bkgnd( gui->confirm );
     group_draw_bkgnd( gui->deploy_window );
     select_dlg_draw_bkgnd( gui->vmode_dlg );
-    fdlg_draw_bkgnd( gui->scen_dlg );
+    sdlg_draw_bkgnd( gui->scen_dlg );
     fdlg_draw_bkgnd( gui->camp_dlg );
-    fdlg_draw_bkgnd( gui->module_dlg );
-    sdlg_draw_bkgnd( gui->setup );
     purchase_dlg_draw_bkgnd( gui->purchase_dlg );
     image_draw_bkgnd( gui->cursors );
 }
 void gui_draw()
 {
+	frame_draw(gui->panel);
     label_draw( gui->label ); 
     label_draw( gui->label2 ); 
     frame_draw( gui->qinfo1 ); 
     frame_draw( gui->qinfo2 ); 
+    mmview_draw( gui->minimap );
     frame_draw( gui->finfo ); 
     frame_draw( gui->unit_list ); 
     frame_draw( gui->sinfo ); 
@@ -678,10 +707,8 @@ void gui_draw()
     group_draw( gui->confirm ); 
     group_draw( gui->deploy_window );
     select_dlg_draw( gui->vmode_dlg );
-    fdlg_draw( gui->scen_dlg );
+    sdlg_draw( gui->scen_dlg );
     fdlg_draw( gui->camp_dlg );
-    fdlg_draw( gui->module_dlg );
-    sdlg_draw( gui->setup );
     purchase_dlg_draw( gui->purchase_dlg );
     image_draw( gui->cursors ); 
 }
@@ -742,10 +769,8 @@ int gui_handle_motion( int cx, int cy )
     if ( !group_handle_motion( gui->split_menu, cx, cy ) )
     if ( !group_handle_motion( gui->confirm, cx, cy ) )
     if ( !select_dlg_handle_motion( gui->vmode_dlg, cx, cy ) )
-    if ( !fdlg_handle_motion( gui->scen_dlg, cx, cy  ) )
+    if ( !sdlg_handle_motion( gui->scen_dlg, cx, cy  ) )
     if ( !fdlg_handle_motion( gui->camp_dlg, cx, cy  ) )
-    if ( !fdlg_handle_motion( gui->module_dlg, cx, cy  ) )
-    if ( !sdlg_handle_motion( gui->setup, cx, cy  ) )
     if ( !purchase_dlg_handle_motion( gui->purchase_dlg, cx, cy  ) )
         ret = 0;
     /* cursor */
@@ -767,10 +792,8 @@ int  gui_handle_button( int button_id, int cx, int cy, Button **button )
     if ( !group_handle_button( gui->confirm, button_id, cx, cy, button ) )
     if ( !group_handle_button( gui->deploy_window, button_id, cx, cy, button ) )
     if ( !select_dlg_handle_button( gui->vmode_dlg, button_id, cx, cy, button ) )
-    if ( !fdlg_handle_button( gui->scen_dlg, button_id, cx, cy, button ) )
+    if ( !sdlg_handle_button( gui->scen_dlg, button_id, cx, cy, button ) )
     if ( !fdlg_handle_button( gui->camp_dlg, button_id, cx, cy, button ) )
-    if ( !fdlg_handle_button( gui->module_dlg, button_id, cx, cy, button ) )
-    if ( !sdlg_handle_button( gui->setup, button_id, cx, cy, button ) )
     if ( !purchase_dlg_handle_button( gui->purchase_dlg, button_id, cx, cy, button ) )
         ret = 0;
     return ret;
@@ -813,19 +836,29 @@ void gui_show_quick_info( Frame *qinfo, Unit *unit )
 					6, qinfo->contents->h - 6, 
 					(unit->core==1)?"C":"A", 255 );
 	}
-    /* name */
+    /* name - clip to 16 chars */
     gui->font_std->align = ALIGN_X_LEFT | ALIGN_Y_TOP;
-    write_text( gui->font_std, qinfo->contents, 12 + hex_w, 10, unit->name, 255 );
-    write_text( gui->font_std, qinfo->contents, 12 + hex_w, 22, unit->prop.name, 255 );
+    if (strlen(unit->name) > 16) {
+	    snprintf(str,17,"%s",unit->name);
+	    str[15] = str[14] = str[13] = '.';
+    } else
+	    sprintf(str,"%s",unit->name);
+    write_text( gui->font_std, qinfo->contents, 12 + hex_w, 10, str, 255 );
+    if (strlen(unit->prop.name) > 16) {
+	    snprintf(str,17,"%s",unit->prop.name);
+	    str[15] = str[14] = str[13] = '.';
+    } else
+	    sprintf(str,"%s",unit->prop.name);
+    write_text( gui->font_std, qinfo->contents, 12 + hex_w, 22, str, 255 );
     /* status */
     gui->font_status->align = ALIGN_X_LEFT | ALIGN_Y_TOP;
     if ( cur_player && !player_is_ally( unit->player, cur_player ) )
-        len = sprintf( str, GS_AMMO "? " GS_FUEL "? " GS_ENTR "%i  " GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP " ", unit->entr );
+        len = sprintf( str, GS_AMMO "? " GS_FUEL "? " GS_ENTR "%i " GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP " ", unit->entr );
     else
         if ( unit_check_fuel_usage( unit ) )
-            len = sprintf( str, GS_AMMO "%i " GS_FUEL "%i " GS_ENTR "%i  " GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP " ", unit->cur_ammo, unit->cur_fuel, unit->entr );
+            len = sprintf( str, GS_AMMO "%i " GS_FUEL "%i " GS_ENTR "%i " GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP " ", unit->cur_ammo, unit->cur_fuel, unit->entr );
         else
-            len = sprintf( str, GS_AMMO "%i " GS_FUEL "- " GS_ENTR "%i  " GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP " ", unit->cur_ammo, unit->entr );
+            len = sprintf( str, GS_AMMO "%i " GS_FUEL "- " GS_ENTR "%i " GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP GS_NOEXP " ", unit->cur_ammo, unit->entr );
     for ( i = 0; i < unit->exp_level; i++ )
         str[len - 6 + i] = (char)CharExp;
     str[len - 6 + i] = (char)(CharExpGrowth + (unit->exp % 100 / 20));
@@ -939,6 +972,12 @@ void gui_show_full_info( Unit *unit )
     DEST( contents, x, y, nation_flag_width, nation_flag_height );
     SOURCE( nation_flags, 0, unit->nation->flag_offset );
     blit_surf();
+    /* tag (if any) */
+    if (unit->tag[0] != 0) {
+		x = border; y = border + hex_h - gui->font_std->height;
+		snprintf(str,8,"[%s]",unit->tag);
+		write_line( contents, gui->font_std, str, x, &y );
+	}
     /* name and type */
     x = border; y = border + hex_h;
     write_line( contents, gui->font_std, unit->name, x, &y );
@@ -1146,6 +1185,9 @@ void gui_render_subcond( VSubCond *cond, char *str )
         case VSUBCOND_UNITS_SAVED:
             sprintf( str, tr("save units with tag '%s'"), cond->tag );
             break;
+        case VSUBCOND_UNITS_ESCAPED:
+            sprintf( str, tr("units with tag '%s' escape"), cond->tag );
+            break;
     }
 }
 void gui_show_conds()
@@ -1432,14 +1474,14 @@ void gui_render_scen_info( const char *path, SDL_Surface *buffer )
     char *info;
     if ( path == 0 ) {
         /* no selection met */
-        group_set_active( gui->scen_dlg->group, ID_SCEN_SETUP, 0 );
-        group_set_active( gui->scen_dlg->group, ID_SCEN_OK, 0 );
+        group_set_active( gui->scen_dlg->fdlg->group, ID_SCEN_OK, 0 );
+        sdlg_update_controlview(gui->scen_dlg,0);
         SDL_FillRect( buffer, 0, 0x0 );
     }
     else
     if ( ( info = scen_load_info( path ) ) ) {
-        group_set_active( gui->scen_dlg->group, ID_SCEN_SETUP, 1 );
-        group_set_active( gui->scen_dlg->group, ID_SCEN_OK, 1 );
+        group_set_active( gui->scen_dlg->fdlg->group, ID_SCEN_OK, 1 );
+        sdlg_update_controlview(gui->scen_dlg,1);
         /* render info */
         SDL_FillRect( buffer, 0, 0x0 );
         gui->font_std->align = ALIGN_X_LEFT | ALIGN_Y_TOP;
@@ -1732,34 +1774,6 @@ void gui_handle_message_pane_event( MessagePane *pane, int mx, int my, int butto
 
 /*
 ====================================================================
-Open scenario setup and set first player as selected.
-====================================================================
-*/
-void gui_open_scen_setup()
-{
-    int i;
-    List *list;
-    /* adjust the config settings, might have changed
-       due to loading */
-    group_lock_button( gui->setup->confirm, ID_SETUP_FOG, config.fog_of_war );
-    group_lock_button( gui->setup->confirm, ID_SETUP_SUPPLY, config.supply );
-    group_lock_button( gui->setup->confirm, ID_SETUP_WEATHER, config.weather );
-    group_lock_button( gui->setup->confirm, ID_SETUP_DEPLOYTURN, config.deploy_turn );
-    group_lock_button( gui->setup->confirm, ID_SETUP_PURCHASE, config.purchase);
-    /* do the list and chose first entry */
-    list = list_create( LIST_AUTO_DELETE, LIST_NO_CALLBACK );
-    for ( i = 0; i < setup.player_count; i++ )
-        list_add( list, strdup( setup.names[i] ) );
-    lbox_set_items( gui->setup->list, list );
-    gui->setup->list->cur_item = list_first( list );
-    lbox_apply( gui->setup->list );
-    if ( gui->setup->list->cur_item )
-        gui_handle_player_select( gui->setup->list->cur_item );
-    sdlg_hide( gui->setup, 0 );
-}
-
-/*
-====================================================================
 Render the player name in the scenario setup
 ====================================================================
 */
@@ -1772,54 +1786,6 @@ void gui_render_player_name( void *item, SDL_Surface *buffer )
 
 /*
 ====================================================================
-Handle the selection of a player in setup.
-====================================================================
-*/
-void gui_handle_player_select( void *item )
-{
-    int i;
-    const char *name;
-    char str[64];
-    SDL_Surface *contents;
-    /* update selection */
-    name = (const char*)item;
-    for ( i = 0; i < setup.player_count; i++ )
-        if ( STRCMP( name, setup.names[i] ) ) {
-            gui->setup->sel_id = i;
-            gui->font_std->align = ALIGN_X_LEFT | ALIGN_Y_CENTER;
-            contents = gui->setup->ctrl->frame->contents;
-            SDL_FillRect( contents, 0, 0x0 );
-            if ( setup.ctrl[i] == PLAYER_CTRL_HUMAN )
-                sprintf( str, tr("Control: Human") );
-            else
-                sprintf( str, tr("Control: CPU") );
-            write_text( gui->font_std, contents, 10, contents->h >> 1, str, 255 );
-            frame_apply( gui->setup->ctrl->frame );
-            contents = gui->setup->module->frame->contents;
-            SDL_FillRect( contents, 0, 0x0 );
-            sprintf( str, tr("AI Module: %s"), setup.modules[i] );
-            write_text( gui->font_std, contents, 10, contents->h >> 1, str, 255 );
-            frame_apply( gui->setup->module->frame );
-            break;
-        }
-}
-
-
-/*
-====================================================================
-Load a module's info
-====================================================================
-*/
-void gui_render_module_info( const char *path, SDL_Surface *buffer )
-{
-    if ( path )
-        group_set_active( gui->module_dlg->group, ID_MODULE_OK, 1 );
-    else
-        group_set_active( gui->module_dlg->group, ID_MODULE_OK, 0 );
-}
-
-/*
-====================================================================
 Mirror position of asymmetric windows.
 ====================================================================
 */
@@ -1832,14 +1798,14 @@ static int mirror_hori( int plane_x, int x, int w )
 }
 void gui_mirror_asymm_windows()
 {
-    int plane_x=sdl.screen->w/2;
+    int plane_x=(sdl.screen->w  - gui_panel_w)/2;
     int x,y,w,h;
     gui->mirror_asymm = !gui->mirror_asymm;
-    /* quick info's */
+    /* quick info's
     frame_get_geometry(gui->qinfo1,&x,&y,&w,&h);
     frame_move(gui->qinfo1,mirror_hori(plane_x,x,w),y);
     frame_get_geometry(gui->qinfo2,&x,&y,&w,&h);
-    frame_move(gui->qinfo2,mirror_hori(plane_x,x,w),y);
+    frame_move(gui->qinfo2,mirror_hori(plane_x,x,w),y); */
     /* deploy window */
     group_get_geometry(gui->deploy_window,&x,&y,&w,&h);
     group_move(gui->deploy_window,mirror_hori(plane_x,x,w),y);
@@ -2123,3 +2089,49 @@ Unit *gui_unit_list_unit_clicked( List * units ,int cx,int cy)
         }
     return NULL;
 }
+
+/** Show/hide GUI. Buttons are not checked. */
+void gui_panel_hide()
+{
+	frame_hide(gui->panel,1);
+	group_hide(gui->unit_buttons,1);
+	group_hide(gui->split_menu,1);
+	group_hide(gui->base_menu,1);
+	group_hide(gui->main_menu,1);
+	group_hide(gui->load_menu,1);
+	group_hide(gui->save_menu,1);
+	group_hide(gui->opt_menu,1);
+	mmview_hide(gui->minimap,1);
+}
+void gui_panel_show()
+{
+	frame_hide(gui->panel,0);
+	group_hide(gui->unit_buttons,0);
+	group_hide(gui->split_menu,1);
+	group_hide(gui->base_menu,0);
+	group_hide(gui->main_menu,0);
+	group_hide(gui->load_menu,1);
+	group_hide(gui->save_menu,1);
+	group_hide(gui->opt_menu,1);
+	mmview_hide(gui->minimap,0);
+}
+void gui_resize_panel()
+{
+	frame_delete(&gui->panel);
+	gui->panel = frame_create(gui_create_frame( gui_panel_w, sdl.screen->h ), 160, sdl.screen, 0, 0 );
+}
+
+/** Init first time after map was loaded */
+void gui_init_minimap()
+{
+	mmview_resize_viewport(gui->minimap);
+	mmview_render(gui->minimap,1);
+}
+
+/** Rerender actual minimap if "full" otherwise just update box position and
+ * render only view */
+void gui_update_minimap(int full)
+{
+	mmview_adjust_viewport(gui->minimap);
+	mmview_render(gui->minimap,full);
+}
diff --git a/src/gui.h b/src/gui.h
index de049c5..9ce8810 100644
--- a/src/gui.h
+++ b/src/gui.h
@@ -103,10 +103,16 @@ enum {
     ID_C_VMODE,
     ID_SCEN_OK,
     ID_SCEN_CANCEL,
-    ID_SCEN_SETUP,
+    ID_SCEN_FOG,
+    ID_SCEN_SUPPLY,
+    ID_SCEN_WEATHER,
+    ID_SCEN_DEPLOYTURN,
+    ID_SCEN_PURCHASE,
+    ID_SCEN_SWITCHCTRL1,
+    ID_SCEN_SWITCHCTRL2,
     ID_CAMP_OK,
     ID_CAMP_CANCEL,
-    ID_SETUP_OK,
+    ID_SETUP_OK, /* old setup dialog now in scenario */
     ID_SETUP_FOG,
     ID_SETUP_SUPPLY,
     ID_SETUP_WEATHER,
@@ -141,6 +147,8 @@ typedef struct {
     Frame *finfo; /* full unit info */
     Frame *sinfo; /* scenario information */
     Frame *unit_list;
+    Frame *panel;
+    MMView *minimap;
     Group *unit_buttons; /* unit action buttons */
     Group *split_menu; /* menu of number of units to split up */
     Group *confirm; /* confirmation window */
@@ -153,10 +161,8 @@ typedef struct {
     Group *load_menu;
     Group *save_menu;
     SelectDlg *vmode_dlg;
-    FDlg *scen_dlg;    /* scenario selection */
+    SDlg *scen_dlg;    /* scenario selection */
     FDlg *camp_dlg;    /* campaign selection */
-    SDlg *setup;       /* scenario setup (controls and ai modules) */
-    FDlg *module_dlg;  /* ai module selection */
     /* frame tiles */
     SDL_Surface *fr_luc, *fr_llc, *fr_ruc, *fr_rlc, *fr_hori, *fr_vert;
     SDL_Surface *brief_frame;   /* briefing window */
@@ -179,6 +185,7 @@ struct MessagePane;
 Create the gui and use the graphics in gfx/themes/path
 ====================================================================
 */
+SDL_Surface *gui_create_frame( int w, int h );
 int gui_load( const char *path );
 void gui_delete();
 
@@ -500,4 +507,13 @@ void gui_scroll_unit_list_up(List * units);
 void gui_scroll_unit_list_down(List * units);
 Unit *gui_unit_list_unit_clicked(List * units,int cx,int cy);
 
+/** Show/hide GUI. Buttons are not checked */
+void gui_panel_hide();
+void gui_panel_show();
+void gui_resize_panel();
+
+/* Update(=render) minimap */
+void gui_init_minimap();
+void gui_update_minimap(int full);
+
 #endif
diff --git a/src/lg-sdl.c b/src/lg-sdl.c
index e5e056e..8e73488 100644
--- a/src/lg-sdl.c
+++ b/src/lg-sdl.c
@@ -175,6 +175,9 @@ Uint32 set_pixel( SDL_Surface *surf, int x, int y, int pixel )
 {
     int pos = 0;
 
+    if (x < 0 || y < 0 || x >= surf->w || y >= surf->h)
+	    return pixel;
+
     pos = y * surf->pitch + x * surf->format->BytesPerPixel;
     memcpy( surf->pixels + pos, &pixel, surf->format->BytesPerPixel );
     return pixel;
diff --git a/src/main.c b/src/main.c
index 9bc522c..f459876 100644
--- a/src/main.c
+++ b/src/main.c
@@ -159,7 +159,7 @@ static void syntax(int argc, char *argv[])
 static void print_version()
 {
     /* display some credits */
-    printf( tr("LGeneral %s\nCopyright 2001-2015 Michael Speck\nPublished under GNU GPL\n---\n"), VERSION );
+    printf( tr("LGeneral %s\nCopyright 2001-2017 Michael Speck\nPublished under GNU GPL\n---\n"), VERSION );
     printf( tr("Looking up data in: %s\n"), get_gamedir() );
 #ifndef WITH_SOUND
     printf( tr("Compiled without sound and music\n") );
@@ -266,7 +266,7 @@ int main(int argc, char *argv[])
     event_enable_filter();
     
     /* show lgeneral title */
-    if (!suppress_title) show_title();
+    //if (!suppress_title) show_title();
     
     /* switch to configs resolution */
     sdl.num_vmodes = get_video_modes( &sdl.vmodes ); /* always successful */
diff --git a/src/map.c b/src/map.c
index 971ed56..89ca5e9 100644
--- a/src/map.c
+++ b/src/map.c
@@ -950,6 +950,12 @@ void map_draw_terrain( SDL_Surface *surf, int map_x, int map_y, int x, int y )
         SOURCE( terrain_icons->grid, 0, 0 );
         blit_surf();
     }
+    /* escape zone? do danger mask overlay with less transparency */
+    if (tile->escape_zone) {
+		DEST( surf, x, y, hex_w, hex_h );
+		SOURCE( terrain_icons->danger, 0, 0);
+		alpha_blit_surf(DANGER_ALPHA/2);
+	}
 }
 /*
 ====================================================================
@@ -1583,6 +1589,13 @@ is given, check whether it is any
 */
 static int map_check_deploy_center( Player *player, Unit *unit, int mx, int my )
 {
+    //that part allows planes to spawn from an aircraft carrier
+    if( unit )
+	if(unit->sel_prop->flags&FLYING)
+		if( map_tile(mx,my)->g_unit )
+			if( (map_tile(mx,my)->g_unit->sel_prop->flags & CARRIER) )
+				if( player_is_ally( map_tile(mx,my)->g_unit->player, unit->player ) )
+					return 1;
     if (map[mx][my].deploy_center!=1||!map[mx][my].player) return 0;
     if (!player_is_ally(map[mx][my].player,player)) return 0;
     if (unit)
@@ -1706,8 +1719,13 @@ void map_get_deploy_mask( Player *player, Unit *unit, int init )
                 {
                     if (map[x][y].a_unit) mask[x][y].deploy = 0;
                 } else {
-                    if (map[x][y].g_unit&&(!init||!map_check_unit_embark(unit,x,y,EMBARK_AIR,1))) 
-                        mask[x][y].deploy = 0;
+                	/* blocked by unit and we are not embarkable? */
+                	if (map[x][y].g_unit&&(!init||!map_check_unit_embark(unit,x,y,EMBARK_AIR,1)))
+                		mask[x][y].deploy = 0;
+                	/* can we move on tile? (don't go into ocean...)
+                	 * unless initial deploy */
+                	if (!init && terrain_get_mov(map[x][y].terrain,unit->prop.mov_type,cur_weather) == 0)
+                		mask[x][y].deploy = 0;
                 }
     }
 }
diff --git a/src/map.h b/src/map.h
index f26849e..1a6dcc0 100644
--- a/src/map.h
+++ b/src/map.h
@@ -38,6 +38,7 @@ typedef struct {
     int obj;                /* military objective ? */
     int deploy_center;      /* deploy allowed? */
     int damaged;  			/* if carped bombed >0, counts down to 0 again */
+    int escape_zone;		/* whether map tile is used for escape victory condition */
     Unit *g_unit;           /* ground/naval unit pointer */
     Unit *a_unit;           /* air unit pointer */
 } Map_Tile;
diff --git a/src/maps/Makefile.in b/src/maps/Makefile.in
index ed7b17b..229732b 100644
--- a/src/maps/Makefile.in
+++ b/src/maps/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/maps
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -110,6 +119,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -267,6 +277,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -295,7 +306,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/maps/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/maps/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -463,6 +473,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(inst_dir)/maps
 
diff --git a/src/music/Makefile.in b/src/music/Makefile.in
index 23140ae..d508a35 100644
--- a/src/music/Makefile.in
+++ b/src/music/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/music
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -110,6 +119,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -267,6 +277,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -295,7 +306,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/music/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/music/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -463,6 +473,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(inst_dir)/music
 
diff --git a/src/nations/Makefile.in b/src/nations/Makefile.in
index 5e68f4e..2c35ade 100644
--- a/src/nations/Makefile.in
+++ b/src/nations/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/nations
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -110,6 +119,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -267,6 +277,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -295,7 +306,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/nations/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/nations/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -463,6 +473,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(inst_dir)/nations
 
diff --git a/src/parser.c b/src/parser.c
index e762400..8ea6785 100644
--- a/src/parser.c
+++ b/src/parser.c
@@ -460,6 +460,12 @@ static int parser_read_file_full( ParserState *st, PData *top )
 }
 static int parser_read_file_compact( ParserState *st, PData *section )
 {
+	char entryToken1 = 0xbb;
+	char itemToken1 = 0xb0;
+	char entryToken2 = '=';
+	char itemToken2 = '&';
+	int useNewTokens = 0;
+
     /* section is the parent pdata that needs some 
        entries */
     PData *pd = 0;
@@ -479,15 +485,20 @@ static int parser_read_file_compact( ParserState *st, PData *section )
                 break;
             default:
                 /* check name */
-                if ( ( cur = strchr( line, '�' ) ) == 0 ) {
-                    sprintf( parser_sub_error, tr("parse error: use '%c' for assignment or '<' for section"), '�' );
-                    return 0;
+                if ( ( cur = strchr( line, entryToken1 ) ) == 0 ) {
+                	if ( ( cur = strchr( line, entryToken2 ) ) == 0 ) {
+                		sprintf( parser_sub_error,
+                				tr("parse error: use '%c' or '%c' for assignment or '<' for section"),
+                				entryToken1, entryToken2 );
+                		return 0;
+                	} else
+                		useNewTokens = 1;
                 }
                 cur[0] = 0; cur++;
                 /* read values as subsection */
                 pd = parser_create_pdata(strdup( line ),
-                                         parser_explode_string( cur, '�' ),
-                                         st->lineno, st->ctd);
+                               parser_explode_string( cur, useNewTokens?itemToken2:itemToken1 ),
+                               st->lineno, st->ctd);
                 /* add to section */
                 list_add( section->entries, pd );
                 break;
diff --git a/src/purchase_dlg.c b/src/purchase_dlg.c
index 0cb6d3f..288ab55 100644
--- a/src/purchase_dlg.c
+++ b/src/purchase_dlg.c
@@ -577,7 +577,7 @@ PurchaseDlg *purchase_dlg_create( const char *theme_path )
 {
 	PurchaseDlg *pdlg = NULL;
 	char path[512];
-	int sx, sy;
+	int sx, sy, alpha=200;
 	
 	pdlg = calloc( 1, sizeof(PurchaseDlg) );
 	if (pdlg == NULL)
@@ -585,7 +585,7 @@ PurchaseDlg *purchase_dlg_create( const char *theme_path )
 	
 	/* create main group (= main window) */
 	snprintf( path, 512, "%s/confirm_buttons.bmp", theme_path );
-	pdlg->main_group = group_create( gui_create_frame( 300, 320 ), 160, 
+	pdlg->main_group = group_create( gui_create_frame( 300, 320 ), alpha,
 				load_surf( path, SDL_SWSURFACE ),
 				20, 20, 2, ID_PURCHASE_OK,
 				gui->label, sdl.screen, 0, 0 );
@@ -599,14 +599,14 @@ PurchaseDlg *purchase_dlg_create( const char *theme_path )
 							tr("Exit") );
 	
 	/* create unit limit info frame */
-	pdlg->ulimit_frame = frame_create( gui_create_frame( 112, 40 ), 160,
+	pdlg->ulimit_frame = frame_create( gui_create_frame( 112, 40 ), alpha,
 							sdl.screen, 0, 0);
 	if (pdlg->ulimit_frame == NULL)
 		goto failure;
 	
 	/* create nation listbox */
 	snprintf( path, 512, "%s/scroll_buttons.bmp", theme_path );
-	pdlg->nation_lbox = lbox_create( gui_create_frame( 112, 74 ), 160, 6,
+	pdlg->nation_lbox = lbox_create( gui_create_frame( 112, 74 ), alpha, 6,
 			load_surf( path, SDL_SWSURFACE ), 24, 24, gui->label,
 			3, 1, 100, 12, 1, 0x0000ff,
 			render_lbox_nation, sdl.screen, 0, 0);
@@ -615,7 +615,7 @@ PurchaseDlg *purchase_dlg_create( const char *theme_path )
 	
 	/* create class listbox */
 	snprintf( path, 512, "%s/scroll_buttons.bmp", theme_path );
-	pdlg->uclass_lbox = lbox_create( gui_create_frame( 112, 166 ), 160, 6,
+	pdlg->uclass_lbox = lbox_create( gui_create_frame( 112, 166 ), alpha, 6,
 			load_surf( path, SDL_SWSURFACE ), 24, 24, gui->label,
 			10, 2, 100, 12, 1, 0x0000ff,
 			render_lbox_uclass, sdl.screen, 0, 0);
@@ -624,7 +624,7 @@ PurchaseDlg *purchase_dlg_create( const char *theme_path )
 	
 	/* create units listbox */
 	snprintf( path, 512, "%s/scroll_buttons.bmp", theme_path );
-	pdlg->unit_lbox = lbox_create( gui_create_frame( 112, 200 ), 160, 6,
+	pdlg->unit_lbox = lbox_create( gui_create_frame( 112, 200 ), alpha, 6,
 			load_surf( path, SDL_SWSURFACE ), 24, 24, gui->label,
 			4, 3, 100, 40, 1, 0x0000ff,
 			render_lbox_unit, sdl.screen, 0, 0);
@@ -633,7 +633,7 @@ PurchaseDlg *purchase_dlg_create( const char *theme_path )
 	
 	/* create transporters listbox */
 	snprintf( path, 512, "%s/scroll_buttons.bmp", theme_path );
-	pdlg->trsp_lbox = lbox_create( gui_create_frame( 112, 120 ), 160, 6,
+	pdlg->trsp_lbox = lbox_create( gui_create_frame( 112, 120 ), alpha, 6,
 			load_surf( path, SDL_SWSURFACE ), 24, 24, gui->label,
 			2, 1, 100, 40, 1, 0x0000ff,
 			render_lbox_unit, sdl.screen, 0, 0);
@@ -642,7 +642,7 @@ PurchaseDlg *purchase_dlg_create( const char *theme_path )
 	
 	/* create reinforcements listbox */
 	snprintf( path, 512, "%s/scroll_buttons.bmp", theme_path );
-	pdlg->reinf_lbox = lbox_create( gui_create_frame( 112, 280 ), 160, 6,
+	pdlg->reinf_lbox = lbox_create( gui_create_frame( 112, 280 ), alpha, 6,
 			load_surf( path, SDL_SWSURFACE ), 24, 24, gui->label,
 			6, 3, 100, 40, 1, 0x0000ff,
 			render_lbox_reinf, sdl.screen, 0, 0);
diff --git a/src/scenario.c b/src/scenario.c
index 276f7e1..ca828fb 100644
--- a/src/scenario.c
+++ b/src/scenario.c
@@ -90,6 +90,8 @@ char scen_message[128] = ""; /* the final scenario message is saved here */
 int vcond_check_type = 0;   /* test victory conditions this turn */
 VCond *vconds = 0;          /* victory conditions */
 int vcond_count = 0;
+Scen_Message *sMessages = NULL;	/* messages to show during the scenario */
+int sMessage_count = 0;		/* and their number */
 static int *casualties;	/* sum of casualties grouped by unit class and player */
 
 /*
@@ -156,6 +158,35 @@ static int subcond_check( VSubCond *cond )
             if ( count == cond->count )
                 return 1;
             return 0;
+        case VSUBCOND_UNITS_ESCAPED:
+			/* check all tagged units of player (or ally) whether they are 
+			* on a map tile marked as escape_zone */
+			list_reset( units );
+			count = 0;
+			while ( ( unit = list_next( units ) ) ) {
+				if ( !player_is_ally( cond->player, unit->player ) )
+					continue; /* not our unit */
+				if ( unit->tag[0] == 0 || !STRCMP( unit->tag, cond->tag ) )
+					continue; /* not or differently tagged */
+				if (unit->killed)
+					continue; /* has already been handeled or lost */
+                if (map[unit->x][unit->y].escape_zone) {
+					/* kill (the only true escape) unit directly? */
+					if (cond->remove) {
+						/* XXX not sure if this is ok here,
+						 * better place would be engine.c:2866
+						 * when deselecting unit on right click
+						 * but maybe it is ok here */
+						 map_remove_unit(unit);
+						 unit->killed = 1;
+						 cond->count--; /* only works if there is ONE condition for escaping only! */
+					} else 
+						count++; /* escaped but not removed directly */
+				}
+			}
+            if ( count == cond->count )
+                return 1;
+            return 0;
     }
     return 0;
 }
@@ -424,6 +455,14 @@ int scen_load( const char *fname )
         if ( map[x][y].nation )
             map[x][y].deploy_center = 1;
         map[x][y].obj = obj;
+        if (obj) {
+        	/* Convert to upper case */
+        	char *s = map[x][y].name;
+        	while (*s) {
+        		*s = toupper((unsigned char) *s);
+        		s++;
+        	}
+        }
     }
     /* victory conditions */
     scen_result[0] = 0;
@@ -509,6 +548,38 @@ int scen_load( const char *fname )
                         strcpy_lt( vconds[i].subconds_and[j].tag, str, 31 );
                         vconds[i].subconds_and[j].count = 0; /* units will be counted */
                     }
+                    else
+                    if ( STRCMP( pd_vsubcond->name, "units_escaped" ) ) {
+                        vconds[i].subconds_and[j].type = VSUBCOND_UNITS_ESCAPED;
+                        if ( !parser_get_value( pd_vsubcond, "player", &str, 0 ) ) goto parser_failure;
+                        vconds[i].subconds_and[j].player = player_get_by_id( str );
+                        if ( !parser_get_value( pd_vsubcond, "tag", &str, 0 ) ) goto parser_failure;
+                        strcpy_lt( vconds[i].subconds_and[j].tag, str, 31 );
+                        if ( parser_get_value( pd_vsubcond, "remove", &str, 0 ) && str[0] == '1') 
+							vconds[i].subconds_and[j].remove = 1;
+						else
+							vconds[i].subconds_and[j].remove = 0;
+                        vconds[i].subconds_and[j].coord_count = 0;
+						if ( parser_get_values( pd_vsubcond, "coordinates", &values ) && values->count>0 )
+						{
+							list_reset( values );
+							while ( ( lib = list_next( values ) ) ) {
+								get_coord( lib, &x, &y );
+								vconds[i].subconds_and[j].coords[vconds[i].subconds_and[j].coord_count][0]=x;
+								vconds[i].subconds_and[j].coords[vconds[i].subconds_and[j].coord_count][1]=y;
+								vconds[i].subconds_and[j].coord_count++;
+								/* map is already created so set tile as escape zone */
+								map[x][y].escape_zone = 1;
+								/* XXX hardcoded limit, see scenario.h */
+								if (vconds[i].subconds_and[j].coord_count == 100)
+									break;
+							}
+						}
+						if ( !parser_get_int( pd_vsubcond, "count", &vconds[i].subconds_and[j].count ) )
+							vconds[i].subconds_and[j].count = 0; /* units will be counted */
+						else
+							vconds[i].subconds_and[j].count *= -1; /* XXX add sign to prevent counting when reading unit flags */
+                    }
                     j++;
                 }
             }
@@ -648,16 +719,20 @@ int scen_load( const char *fname )
         if ( parser_get_value( sub, "tag", &str, 0 ) ) {
             strcpy_lt( unit_base.tag, str, 31 );
             /* check all subconds for UNITS_SAVED and increase the counter
-               if this unit is allied */
+               if this unit is allied; same for UNITS_ESCAPED */
             for ( i = 1; i < vcond_count; i++ ) {
                 for ( j = 0; j < vconds[i].sub_and_count; j++ )
-                    if ( vconds[i].subconds_and[j].type == VSUBCOND_UNITS_SAVED )
-                        if ( STRCMP( unit_base.tag, vconds[i].subconds_and[j].tag ) )
-                            vconds[i].subconds_and[j].count++;
+                    if ( vconds[i].subconds_and[j].type == VSUBCOND_UNITS_SAVED ||
+							vconds[i].subconds_and[j].type == VSUBCOND_UNITS_ESCAPED)
+						if( vconds[i].subconds_and[j].count>=0 ) /* negative means fixed predefined count */
+							if ( STRCMP( unit_base.tag, vconds[i].subconds_and[j].tag ) )
+								vconds[i].subconds_and[j].count++;
                 for ( j = 0; j < vconds[i].sub_or_count; j++ )
-                    if ( vconds[i].subconds_or[j].type == VSUBCOND_UNITS_SAVED )
-                        if ( STRCMP( unit_base.tag, vconds[i].subconds_or[j].tag ) )
-                            vconds[i].subconds_or[j].count++;
+                    if ( vconds[i].subconds_or[j].type == VSUBCOND_UNITS_SAVED ||
+							vconds[i].subconds_or[j].type == VSUBCOND_UNITS_ESCAPED)
+						if( vconds[i].subconds_or[j].count>=0 ) /* negative means fixed predefined count */
+							if ( STRCMP( unit_base.tag, vconds[i].subconds_or[j].tag ) )
+								vconds[i].subconds_or[j].count++;
             }
         }
         /* actual unit */
@@ -685,6 +760,13 @@ int scen_load( const char *fname )
 	    unit_ref++;
 	}
     }
+    /* check if any escape condition has negative count
+     * -> fixed number of units to be saved: remove sign */
+	for ( i = 1; i < vcond_count; i++ )
+		for ( j = 0; j < vconds[i].sub_and_count; j++ )
+			if ( vconds[i].subconds_and[j].type == VSUBCOND_UNITS_ESCAPED )
+				if( vconds[i].subconds_and[j].count < 0)
+					vconds[i].subconds_and[j].count *= -1;
     /* load deployment hexes */
     if ( parser_get_entries( pd, "deployfields", &entries ) ) {
         list_reset( entries );
@@ -710,6 +792,31 @@ int scen_load( const char *fname )
             }
         }
     }
+    /* load messages */
+    if ( parser_get_entries( pd, "messages", &entries ) ) {
+	/* count and alloc scenario messages */
+	list_reset( entries );
+	while ( ( list_next( entries ) ) )
+		sMessage_count++;
+	sMessages = calloc( sMessage_count, sizeof( Scen_Message ) );
+
+	/* load them now */
+	list_reset( entries ); i = 0;
+	while ( ( sub = list_next( entries ) ) ) {
+		if ( !parser_get_value( sub, "player", &str, 0 ) )
+			goto parser_failure;
+		sMessages[i].player = player_get_by_id( str );
+		if ( !sMessages[i].player )
+			goto parser_failure;
+		if( !parser_get_int( sub, "turn", &sMessages[i].turn ) )
+			goto parser_failure;
+		if( !parser_get_value( sub, "text", &str,0) )
+			goto parser_failure;
+		else
+			strcpy_lt( sMessages[i].message, str, 128 );
+		i++;
+	}
+    }
     parser_free( &pd );
 
     casualties = calloc( scen_info->player_count * unit_class_count, sizeof casualties[0] );
@@ -883,6 +990,15 @@ void scen_delete()
         free( vconds ); vconds = 0;
         vcond_count = 0;
     }
+    if( sMessages ) {
+/*        for ( i = 0; i < sMessage_count; i++ ) {
+		free( sMessages[i].message );
+		free( sMessages[i].player );
+	}
+*/	free( sMessages );
+	sMessages = NULL;
+	sMessage_count = 0;
+    }
     if ( units ) {
         list_delete( units );
         units = 0;
@@ -940,8 +1056,9 @@ void scen_prep_unit( Unit *unit, int type )
             unit->cur_mov = unit->cur_fuel;
     unit_unmount( unit );
     unit->cur_atk_count = unit->sel_prop->atk_count;
-    /* if unit is preparded normally check entrenchment */
-    if ( type == SCEN_PREP_UNIT_NORMAL && !(unit->sel_prop->flags & FLYING) ) {
+    /* if unit is prepared normally check entrenchment */
+    if ( type == SCEN_PREP_UNIT_NORMAL && !(unit->sel_prop->flags & FLYING)
+		    	    	    && !(unit->sel_prop->flags & SWIMMING)) {
         min_entr = map_tile( unit->x, unit->y )->terrain->min_entr;
         max_entr = map_tile( unit->x,unit->y )->terrain->max_entr;
         if ( unit->entr < min_entr )
diff --git a/src/scenario.h b/src/scenario.h
index cca2699..2140164 100644
--- a/src/scenario.h
+++ b/src/scenario.h
@@ -92,14 +92,18 @@ enum {
     VSUBCOND_TURNS_LEFT,
     VSUBCOND_CTRL_HEX_NUM,
     VSUBCOND_UNITS_KILLED,
-    VSUBCOND_UNITS_SAVED
+    VSUBCOND_UNITS_SAVED,
+    VSUBCOND_UNITS_ESCAPED
 };
 typedef struct {
     int type;           /* type as above */
     Player *player;     /* player this condition is checked for */
     int x,y;            /* special */
-    int count;           
+    int count;          /* of relevant tagged units */
     char tag[32];       /* tag of unit group */
+    int coords[100][2];	/* coordinates for escaping */
+    int coord_count;
+    int remove;			/* remove escaped units immediately */	
 } VSubCond;
 typedef struct {
     VSubCond *subconds_or;    /* sub conditions linked with logical or */
@@ -109,6 +113,11 @@ typedef struct {
     char result[64];
     char message[128];
 } VCond;
+typedef struct {
+	Player *player;		//who should see that message
+	int turn;		//and when
+	char message[128];	//and what is that message anyway
+} Scen_Message;
 
 /*
 ====================================================================
diff --git a/src/scenarios/Makefile.in b/src/scenarios/Makefile.in
index 8c31476..1b5e567 100644
--- a/src/scenarios/Makefile.in
+++ b/src/scenarios/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/scenarios
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -110,6 +119,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -267,6 +277,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -295,7 +306,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/scenarios/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/scenarios/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -463,6 +473,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(inst_dir)/scenarios
 
diff --git a/src/sounds/Makefile.in b/src/sounds/Makefile.in
index 709afe0..cb4f4a3 100644
--- a/src/sounds/Makefile.in
+++ b/src/sounds/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/sounds
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -110,6 +119,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -267,6 +277,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -295,7 +306,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/sounds/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/sounds/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -463,6 +473,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(inst_dir)/sounds
 
diff --git a/src/strat_map.c b/src/strat_map.c
index 5e932e9..8870acd 100644
--- a/src/strat_map.c
+++ b/src/strat_map.c
@@ -47,6 +47,7 @@ extern Mask_Tile **mask;
 extern Map_Tile **map;
 extern int air_mode;
 extern Player *cur_player;
+extern int gui_panel_w;
 
 /*
 ====================================================================
@@ -73,12 +74,130 @@ static SDL_Surface *blink_dot = 0; /* white and black dot that blinks indicating
 static List *dots = 0; /* list of dot positions that need blinking */
 static int blink_on = 0; /* switch used for blinking */
 
+/** Minimap data */
+int mmtw, mmth;
+int mm_width, mm_height;
+SDL_Surface *minimap;
+SDL_Surface *mm_terrain;
+SDL_Surface *mm_fogtile;
+SDL_Surface *mm_unit_friend;
+SDL_Surface *mm_unit_foe;
+SDL_Surface *mm_objtile;
+int mm_friend_color = 0x0000ff; // not good to see: 8b8b8;
+int mm_foe_color = 0xff0000; // 0x8bb2a0; /* and all others */
+int mm_obj_color = 0xfffc00;
+
 /*
 ====================================================================
 LOCALS
 ====================================================================
 */
 
+/** Create a minimap as close as possible to wanted sized. */
+void minimap_create(int wanted_w, int wanted_h)
+{
+	int i, j, tx, ty, sx, sy;
+	Uint32 pixel;
+
+	mmtw = wanted_w / map_w;
+	mmth = wanted_h / map_h;
+	if (mmth < mmtw)
+		mmtw = mmth;
+	else
+		mmth = mmtw;
+	mm_width = map_w * mmtw;
+	mm_height = map_h * mmth - mmth/2;
+	minimap = create_surf(mm_width, mm_height, SDL_SWSURFACE);
+	mm_terrain = create_surf(mm_width, mm_height, SDL_SWSURFACE);
+
+	for (j = 0; j < map_h; j++) {
+		for (i = 0; i < map_w; i++) {
+			SDL_Surface *tpic = terrain_types[map[i][j].terrain_id].images[0];
+			sx = i * mmtw;
+			sy = j * mmth;
+			if ((i & 1) == 0)
+				sy -= mmth/2;
+			for (ty = 0; ty < mmth; ty++)
+				for (tx = 0; tx < mmtw; tx++) {
+					pixel = get_pixel( tpic,
+							map[i][j].image_offset +
+								hex_w/4 + hex_w/2 * tx / mmtw,
+								hex_h/4 + hex_h/2 * ty / mmth );
+					set_pixel( mm_terrain, sx + tx, sy + ty, pixel);
+				}
+		}
+	}
+
+	mm_fogtile = create_surf(mmtw,mmth,SDL_SWSURFACE);
+	FULL_DEST(mm_fogtile);
+	fill_surf(0x020202);
+
+	mm_unit_friend = create_surf(mmtw,mmth,SDL_SWSURFACE);
+	FULL_DEST(mm_unit_friend);
+	fill_surf(mm_friend_color);
+
+	mm_unit_foe = create_surf(mmtw,mmth,SDL_SWSURFACE);
+	FULL_DEST(mm_unit_foe);
+	fill_surf(mm_foe_color);
+
+	mm_objtile = create_surf(mmtw+2,mmth+2,SDL_SWSURFACE);
+	FULL_DEST(mm_objtile);
+	fill_surf(mm_obj_color);
+}
+
+void minimap_delete()
+{
+	free_surf(&minimap);
+	free_surf(&mm_terrain);
+	free_surf(&mm_fogtile);
+	free_surf(&mm_unit_foe);
+	free_surf(&mm_unit_friend);
+	free_surf(&mm_objtile);
+}
+
+/** Render minimap from terrain and current map/unit state to minimap */
+void minimap_render()
+{
+	int sx,sy,i,j;
+
+	FULL_DEST(minimap);
+	FULL_SOURCE(mm_terrain);
+	blit_surf();
+
+	for (j = 0; j < map_h; j++)
+		for (i = 0; i < map_w; i++) {
+			sx = i * mmtw;
+			sy = j * mmth;
+			if ((i & 1) == 0)
+				sy -= mmth/2;
+			if (mask[i][j].fog) {
+				DEST(minimap,sx,sy,mm_fogtile->w,mm_fogtile->h);
+				FULL_SOURCE(mm_fogtile);
+				alpha_blit_surf(FOG_ALPHA);
+			} else if ( map[i][j].g_unit || map[i][j].a_unit ) {
+				SDL_Surface *surf = mm_unit_foe;
+				if (map[i][j].g_unit && player_is_ally(cur_player,map[i][j].g_unit->player))
+					surf = mm_unit_friend;
+				if (map[i][j].a_unit && player_is_ally(cur_player,map[i][j].a_unit->player))
+					surf = mm_unit_friend;
+				DEST(minimap,sx,sy,surf->w,surf->h);
+				FULL_SOURCE(surf);
+				alpha_blit_surf(200);
+			}
+			if (map[i][j].obj) {
+				SDL_Surface *surf = mm_unit_foe;
+				DEST(minimap,sx-1,sy-1,mm_objtile->w,mm_objtile->h);
+				FULL_SOURCE(mm_objtile);
+				alpha_blit_surf(200);
+				if (map[i][j].player && player_is_ally(cur_player,map[i][j].player))
+					surf = mm_unit_friend;
+				DEST(minimap,sx,sy,surf->w,surf->h);
+				FULL_SOURCE(surf);
+				alpha_blit_surf(200);
+			}
+		}
+}
+
 /*
 ====================================================================
 Get size of strategic map depending on scale where
@@ -209,6 +328,9 @@ void strat_map_create()
     set_pixel( blink_dot, 0, 1, SDL_MapRGB( blink_dot->format, 16, 16, 16 ) );
     /* position list */
     dots = list_create( LIST_AUTO_DELETE, LIST_NO_CALLBACK );
+
+    /* create our smaller brother */
+    minimap_create(gui_panel_w - 10, gui_panel_w - 1);
 }
 
 /*
@@ -235,6 +357,8 @@ void strat_map_delete()
         list_delete( dots );
         dots = 0;
     }
+
+    minimap_delete();
 }
 
 /*
@@ -444,3 +568,4 @@ void strat_map_blink()
     }
     add_refresh_region( screen_x, screen_y, width, height );
 }
+
diff --git a/src/strat_map.h b/src/strat_map.h
index ee26cff..7480340 100644
--- a/src/strat_map.h
+++ b/src/strat_map.h
@@ -58,4 +58,8 @@ Blink the dots that show unmoved units.
 */
 void strat_map_blink();
 
+/** Render new minimap after any changes. */
+void minimap_render();
+
+
 #endif
diff --git a/src/terrain/Makefile.in b/src/terrain/Makefile.in
index c4bda1c..3318dbc 100644
--- a/src/terrain/Makefile.in
+++ b/src/terrain/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/terrain
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -110,6 +119,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -267,6 +277,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -295,7 +306,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/terrain/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/terrain/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -463,6 +473,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(inst_dir)/terrain
 
diff --git a/src/themes/Makefile.in b/src/themes/Makefile.in
index fd72615..0812537 100644
--- a/src/themes/Makefile.in
+++ b/src/themes/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/themes
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -145,6 +154,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -327,6 +337,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -356,7 +367,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/themes/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/themes/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -644,6 +654,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/themes/default/Makefile.in b/src/themes/default/Makefile.in
index a85b6ea..48900a7 100644
--- a/src/themes/default/Makefile.in
+++ b/src/themes/default/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,13 +90,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/themes/default
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs COPYING
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -140,6 +149,8 @@ am__uninstall_files_from_dir = { \
 am__installdirs = "$(DESTDIR)$(themedir)"
 DATA = $(theme_DATA)
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs \
+	COPYING
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -297,6 +308,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -337,7 +349,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/themes/default/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/themes/default/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -530,6 +541,8 @@ uninstall-am: uninstall-themeDATA
 	pdf-am ps ps-am tags-am uninstall uninstall-am \
 	uninstall-themeDATA
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/themes/default/bkgnd.bmp b/src/themes/default/bkgnd.bmp
index 9d636b5..57f7618 100644
Binary files a/src/themes/default/bkgnd.bmp and b/src/themes/default/bkgnd.bmp differ
diff --git a/src/themes/default/confirm_buttons.bmp b/src/themes/default/confirm_buttons.bmp
index 3318f7a..8b24fa9 100644
Binary files a/src/themes/default/confirm_buttons.bmp and b/src/themes/default/confirm_buttons.bmp differ
diff --git a/src/themes/default/deploy_buttons.bmp b/src/themes/default/deploy_buttons.bmp
index f8001f0..6d6152b 100644
Binary files a/src/themes/default/deploy_buttons.bmp and b/src/themes/default/deploy_buttons.bmp differ
diff --git a/src/themes/default/folder.bmp b/src/themes/default/folder.bmp
index 7d6f684..4459191 100644
Binary files a/src/themes/default/folder.bmp and b/src/themes/default/folder.bmp differ
diff --git a/src/themes/default/font_std.bmp b/src/themes/default/font_std.bmp
index 245038b..925a290 100644
Binary files a/src/themes/default/font_std.bmp and b/src/themes/default/font_std.bmp differ
diff --git a/src/themes/default/menu0_buttons.bmp b/src/themes/default/menu0_buttons.bmp
index eace22f..2df032c 100644
Binary files a/src/themes/default/menu0_buttons.bmp and b/src/themes/default/menu0_buttons.bmp differ
diff --git a/src/themes/default/menu1_buttons.bmp b/src/themes/default/menu1_buttons.bmp
index 89f0103..de84173 100644
Binary files a/src/themes/default/menu1_buttons.bmp and b/src/themes/default/menu1_buttons.bmp differ
diff --git a/src/themes/default/menu2_buttons.bmp b/src/themes/default/menu2_buttons.bmp
index c07245c..22537ab 100644
Binary files a/src/themes/default/menu2_buttons.bmp and b/src/themes/default/menu2_buttons.bmp differ
diff --git a/src/themes/default/menu3_buttons.bmp b/src/themes/default/menu3_buttons.bmp
index b91025c..d77ca7b 100644
Binary files a/src/themes/default/menu3_buttons.bmp and b/src/themes/default/menu3_buttons.bmp differ
diff --git a/src/themes/default/scen_dlg_buttons.bmp b/src/themes/default/scen_dlg_buttons.bmp
index 7ec64ca..1af61c8 100644
Binary files a/src/themes/default/scen_dlg_buttons.bmp and b/src/themes/default/scen_dlg_buttons.bmp differ
diff --git a/src/themes/default/scroll_buttons.bmp b/src/themes/default/scroll_buttons.bmp
index 492934b..57bdcf8 100644
Binary files a/src/themes/default/scroll_buttons.bmp and b/src/themes/default/scroll_buttons.bmp differ
diff --git a/src/themes/default/strength_buttons.bmp b/src/themes/default/strength_buttons.bmp
index 84ddb42..b69e16f 100644
Binary files a/src/themes/default/strength_buttons.bmp and b/src/themes/default/strength_buttons.bmp differ
diff --git a/src/themes/default/unit_buttons.bmp b/src/themes/default/unit_buttons.bmp
index 81299d3..5bccf8e 100644
Binary files a/src/themes/default/unit_buttons.bmp and b/src/themes/default/unit_buttons.bmp differ
diff --git a/src/unit.c b/src/unit.c
index c8e20c8..50def54 100644
--- a/src/unit.c
+++ b/src/unit.c
@@ -244,7 +244,7 @@ static int unit_attack( Unit *unit, Unit *target, int type, int real, int force_
 #endif
     /* in a real combat a submarine may evade */
     if ( real && type == UNIT_ACTIVE_ATTACK && ( target->sel_prop->flags & DIVING ) ) { 
-        if ( DICE(10) <= 7 + ( target->exp_level - unit->exp_level ) / 2 )
+        if ( DICE(10) <= 6 + ( target->exp_level - unit->exp_level ) / 2 )
         {
             strike = ATK_NO_STRIKE;
             ret |= AR_EVADED;
diff --git a/src/unit.h b/src/unit.h
index 5422471..d3a178a 100644
--- a/src/unit.h
+++ b/src/unit.h
@@ -116,7 +116,7 @@ typedef struct _Unit {
                                    same turn */
     char tag[32];               /* if tag is set the unit belongs to a unit group that
                                    is monitored by the victory conditions units_killed()
-                                   and units_saved() */
+                                   and units_saved() and units_escaped() */
     int eval_score;             /* between 0 - 1000 indicating the worth of the unit */
     /* AI eval */
     int target_score;           /* when targets of an AI unit are gathered this value is set
diff --git a/src/units/Makefile.in b/src/units/Makefile.in
index b9aaa9a..407ee00 100644
--- a/src/units/Makefile.in
+++ b/src/units/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = src/units
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -110,6 +119,7 @@ am__can_run_installinfo = \
     *) (install-info --version) >/dev/null 2>&1;; \
   esac
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -267,6 +277,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -295,7 +306,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/units/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign src/units/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -463,6 +473,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 install-data-local:
 	$(mkinstalldirs) $(DESTDIR)$(inst_dir)/units
 
diff --git a/src/windows.c b/src/windows.c
index 5b77823..9c26e88 100644
--- a/src/windows.c
+++ b/src/windows.c
@@ -22,6 +22,9 @@
 #include "windows.h"
 #include "localize.h"
 #include "purchase_dlg.h"
+#include "date.h"
+#include "scenario.h"
+#include "strat_map.h"
 #include "gui.h"
 
 /*
@@ -34,6 +37,10 @@ extern int hex_w;
 extern int old_mx, old_my;
 extern Config config;
 extern GUI *gui;
+extern Setup setup;            /* engine setup with scenario information */
+extern int mm_width, mm_height;
+extern int mmtw, mmth;
+extern SDL_Surface *minimap;
 
 /*
 ====================================================================
@@ -829,6 +836,10 @@ void fdlg_add_button( FDlg *fdlg, int id, int lock, const char *tooltip )
     int x = fdlg->button_x - ( id - fdlg->group->base_id + 1 ) * fdlg->button_dist;
     group_add_button( fdlg->group, id, x, fdlg->button_y, lock, tooltip );
 }
+void fdlg_add_button_xy( FDlg *fdlg, int id, int x, int y, int lock, const char *tooltip )
+{
+    group_add_button( fdlg->group, id, x, y, lock, tooltip );
+}
 
 /*
 ====================================================================
@@ -924,71 +935,70 @@ int fdlg_handle_button( FDlg *fdlg, int button_id, int cx, int cy, Button **butt
 Create setup dialogue.
 ====================================================================
 */
-SDlg *sdlg_create( SDL_Surface *list_frame, SDL_Surface *list_buttons,
-                   int list_button_w, int list_button_h, int cell_h,
-                   SDL_Surface *ctrl_frame, SDL_Surface *ctrl_buttons,
-                   int ctrl_button_w, int ctrl_button_h, int id_ctrl,
-                   SDL_Surface *mod_frame, SDL_Surface *mod_buttons,
-                   int mod_button_w, int mod_button_h, int id_mod,
-                   SDL_Surface *conf_frame, SDL_Surface *conf_buttons,
-                   int conf_button_w, int conf_button_h, int id_conf,
+SDlg *sdlg_create(
+                   SDL_Surface *lbox_frame, int alpha, int border,
+                   SDL_Surface *lbox_buttons, int lbox_button_w, int lbox_button_h,
+                   int cell_h,
+                   SDL_Surface *file_frame,
+                   SDL_Surface *file_buttons, int file_button_w, int file_button_h,
+                   int id_ok,
                    Label *label,
-                   void (*list_render_cb)(void*,SDL_Surface*),
-                   void (*list_select_cb)(void*),
+                   void (*lbox_cb)( void*, SDL_Surface* ),
+                   void (*file_cb)( const char*, SDL_Surface* ),
+                   SDL_Surface *conf_frame,
+                   SDL_Surface *conf_buttons, int conf_button_w, int conf_button_h,
+                   SDL_Surface *ctrl_frame,
+                   SDL_Surface *ctrl_buttons, int ctrl_button_w, int ctrl_button_h,
                    SDL_Surface *surf, int x, int y )
 {
-    int border = 10, alpha = 160, px, py;
-    int cell_w = list_frame->w - 2 * border;
-    int cell_count = ( list_frame->h - 2 * border ) / ( cell_h + 1 );
+    int px, py;
 
     SDlg *sdlg = calloc( 1, sizeof( SDlg ) );
 
-    /* listbox for players */
-    if ( ( sdlg->list = lbox_create( list_frame, alpha, border, list_buttons, list_button_w, list_button_h, label,
-                                     cell_count, 2, cell_w, cell_h, 1, 0x0000ff, list_render_cb, surf, x, y ) ) == 0 )
-        goto failure;
+    if ((sdlg->fdlg = fdlg_create(lbox_frame, alpha, border,
+                   lbox_buttons, lbox_button_w, lbox_button_h, cell_h,
+                   file_frame,file_buttons, file_button_w, file_button_h,
+                   id_ok, label, lbox_cb, file_cb,
+                  surf, x, y)) == 0)
+	    goto failure;
 
     /* group with human/cpu control button */
-    if ( ( sdlg->ctrl = group_create( ctrl_frame, alpha, ctrl_buttons, 
-                                      ctrl_button_w, ctrl_button_h, 1, id_ctrl, label, surf, x + list_frame->w - 1, y ) ) == 0 )
+    if ( ( sdlg->config = group_create( conf_frame, alpha,
+		    conf_buttons, conf_button_w, conf_button_h,
+		    	    	5, ID_SCEN_OK, label,
+		    	    	surf, x + lbox_frame->w - 1, y + file_frame->h ) ) == 0 )
         goto failure;
-    group_add_button( sdlg->ctrl, id_ctrl, ctrl_frame->w - border - ctrl_button_w, ( ctrl_frame->h - ctrl_button_h ) / 2, 0, tr("Switch Control") );
-
-    /* group with ai module select button */
-    if ( ( sdlg->module = group_create( mod_frame, alpha, mod_buttons, 
-                                        mod_button_w, mod_button_h, 1, id_mod, label, surf, 
-                                        x + list_frame->w - 1, y + ctrl_frame->h ) ) == 0 )
-        goto failure;
-    group_add_button( sdlg->module, id_mod, ctrl_frame->w - border - ctrl_button_w, ( mod_frame->h - mod_button_h ) / 2, 0, tr("Select AI Module") );
-#ifndef USE_DL
-    group_set_active( sdlg->module, id_mod, 0 );
-#endif
-
-    /* group with settings and confirm buttons; id_conf is id of first button
-     * in image conf_buttons */
-    if ( ( sdlg->confirm = group_create( conf_frame, alpha, conf_buttons, 
-                                         conf_button_w, conf_button_h, 6, id_conf, label, surf, 
-                                         x + list_frame->w - 1, y + ctrl_frame->h + mod_frame->h ) ) == 0 )
-        goto failure;
-    px = conf_frame->w - (border + conf_button_w);
+    px = border+10;
     py = (conf_frame->h - conf_button_h) / 2;
-    group_add_button( sdlg->confirm, ID_SETUP_OK, px, py, 0, tr("Ok") );
-    px = border;
-    group_add_button( sdlg->confirm, ID_SETUP_FOG, px, py, 1, tr("Fog Of War") );
+    group_add_button( sdlg->config, ID_SCEN_FOG, px, py, 1, tr("Fog Of War") );
     px += border + conf_button_w;
-    group_add_button( sdlg->confirm, ID_SETUP_SUPPLY, px, py, 1, tr("Unit Supply") );
+    group_add_button( sdlg->config, ID_SCEN_SUPPLY, px, py, 1, tr("Unit Supply") );
     px += border + conf_button_w;
-    group_add_button( sdlg->confirm, ID_SETUP_WEATHER, px, py, 1, tr("Weather Influence") );
+    group_add_button( sdlg->config, ID_SCEN_WEATHER, px, py, 1, tr("Weather Influence") );
     px += border + conf_button_w;
-    group_add_button( sdlg->confirm, ID_SETUP_DEPLOYTURN, px, py, 1, tr("Deploy Turn") );
+    group_add_button( sdlg->config, ID_SCEN_DEPLOYTURN, px, py, 1, tr("Deploy Turn") );
     px += border + conf_button_w;
-    group_add_button( sdlg->confirm, ID_SETUP_PURCHASE, px, py, 1, tr("Purchase Option") );
-    group_lock_button( sdlg->confirm, ID_SETUP_FOG, config.fog_of_war );
-    group_lock_button( sdlg->confirm, ID_SETUP_SUPPLY, config.supply );
-    group_lock_button( sdlg->confirm, ID_SETUP_WEATHER, config.weather );
-    group_lock_button( sdlg->confirm, ID_SETUP_DEPLOYTURN, config.deploy_turn );
-    group_lock_button( sdlg->confirm, ID_SETUP_PURCHASE, config.purchase );
-    sdlg->select_cb = list_select_cb;
+    group_add_button( sdlg->config, ID_SCEN_PURCHASE, px, py, 1, tr("Purchase Option") );
+    group_lock_button( sdlg->config, ID_SCEN_FOG, config.fog_of_war );
+    group_lock_button( sdlg->config, ID_SCEN_SUPPLY, config.supply );
+    group_lock_button( sdlg->config, ID_SCEN_WEATHER, config.weather );
+    group_lock_button( sdlg->config, ID_SCEN_DEPLOYTURN, config.deploy_turn );
+    group_lock_button( sdlg->config, ID_SCEN_PURCHASE, config.purchase );
+
+    /* group with settings and confirm buttons; id_conf is id of first button
+     * in image conf_buttons */
+    if ( ( sdlg->ctrl = group_create( ctrl_frame, alpha, ctrl_buttons,
+		    	    ctrl_button_w, ctrl_button_h,
+	    	    	2, ID_SCEN_OK, label, surf,
+                        x + lbox_frame->w - 1, y + file_frame->h + conf_frame->h ) ) == 0 )
+        goto failure;
+    group_add_button( sdlg->ctrl, ID_SCEN_SWITCHCTRL1, border,
+		    ( ctrl_frame->h - ctrl_button_h ) / 2, 0, tr("Switch Control") );
+    group_add_button( sdlg->ctrl, ID_SCEN_SWITCHCTRL2,
+		    ctrl_frame->w - border - ctrl_button_w,
+		    ( ctrl_frame->h - ctrl_button_h ) / 2, 0, tr("Switch Control") );
+    sdlg_update_controlview(sdlg,0);
+
     return sdlg;
 failure:
     sdlg_delete( &sdlg );
@@ -997,10 +1007,9 @@ failure:
 void sdlg_delete( SDlg **sdlg )
 {
     if ( *sdlg ) {
-        lbox_delete( &(*sdlg)->list );
+        fdlg_delete( &(*sdlg)->fdlg );
         group_delete( &(*sdlg)->ctrl );
-        group_delete( &(*sdlg)->module );
-        group_delete( &(*sdlg)->confirm );
+        group_delete( &(*sdlg)->config );
         free( *sdlg ); *sdlg = 0;
     }
 }
@@ -1012,31 +1021,27 @@ Draw setup dialogue.
 */
 void sdlg_hide( SDlg *sdlg, int hide )
 {
-    lbox_hide( sdlg->list, hide );
-    group_hide( sdlg->ctrl, hide );
-    group_hide( sdlg->module, hide );
-    group_hide( sdlg->confirm, hide );
+    fdlg_hide( sdlg->fdlg, hide );
+    group_hide( sdlg->ctrl, 1 );
+    group_hide( sdlg->config, 1 );
 }
 void sdlg_get_bkgnd( SDlg *sdlg )
 {
-    lbox_get_bkgnd( sdlg->list );
+	fdlg_get_bkgnd( sdlg->fdlg );
     group_get_bkgnd( sdlg->ctrl );
-    group_get_bkgnd( sdlg->module );
-    group_get_bkgnd( sdlg->confirm );
+    group_get_bkgnd( sdlg->config );
 }
 void sdlg_draw_bkgnd( SDlg *sdlg )
 {
-    lbox_draw_bkgnd( sdlg->list );
+	fdlg_draw_bkgnd( sdlg->fdlg );
     group_draw_bkgnd( sdlg->ctrl );
-    group_draw_bkgnd( sdlg->module );
-    group_draw_bkgnd( sdlg->confirm );
+    group_draw_bkgnd( sdlg->config );
 }
 void sdlg_draw( SDlg *sdlg )
 {
-    lbox_draw( sdlg->list );
+    fdlg_draw( sdlg->fdlg );
     group_draw( sdlg->ctrl );
-    group_draw( sdlg->module );
-    group_draw( sdlg->confirm );
+    group_draw( sdlg->config );
 }
 
 /*
@@ -1046,19 +1051,17 @@ Scenario setup dialogue
 */
 void sdlg_set_surface( SDlg *sdlg, SDL_Surface *surf )
 {
-    lbox_set_surface( sdlg->list, surf );
+    fdlg_set_surface( sdlg->fdlg, surf );
     group_set_surface( sdlg->ctrl, surf );
-    group_set_surface( sdlg->module, surf );
-    group_set_surface( sdlg->confirm, surf );
+    group_set_surface( sdlg->config, surf );
 }
 void sdlg_move( SDlg *sdlg, int x, int y )
 {
-    lbox_move( sdlg->list, x, y );
-    group_move( sdlg->ctrl, x + sdlg->list->group->frame->img->img->w - 1, y );
-    group_move( sdlg->module, x + sdlg->list->group->frame->img->img->w - 1, 
-                sdlg->ctrl->frame->img->img->h + y );
-    group_move( sdlg->confirm, x + sdlg->list->group->frame->img->img->w - 1, 
-                sdlg->ctrl->frame->img->img->h + sdlg->module->frame->img->img->h + y );
+	int fw = sdlg->fdlg->lbox->group->frame->img->img->w;
+	int fh = sdlg->fdlg->group->frame->img->img->h;
+	fdlg_move( sdlg->fdlg, x, y );
+    group_move( sdlg->config, x + fw - 1, y + fh);
+    group_move( sdlg->ctrl, x + fw - 1, y + fh + sdlg->ctrl->frame->img->img->h);
 }
 
 /*
@@ -1068,12 +1071,10 @@ handle_motion updates the focus of the buttons
 */
 int sdlg_handle_motion( SDlg *sdlg, int cx, int cy )
 {
-    void *item;
-    if ( !sdlg->list->group->frame->img->bkgnd->hide ) {
+    if ( !sdlg->fdlg->group->frame->img->bkgnd->hide ) {
         if ( !group_handle_motion( sdlg->ctrl, cx, cy ) )
-        if ( !group_handle_motion( sdlg->module, cx, cy ) )
-        if ( !group_handle_motion( sdlg->confirm, cx, cy ) )
-        if ( !lbox_handle_motion( sdlg->list, cx, cy, &item ) )
+        if ( !group_handle_motion( sdlg->config, cx, cy ) )
+        if ( !fdlg_handle_motion( sdlg->fdlg, cx, cy ) )
             return 0;
         return 1;
     }
@@ -1086,23 +1087,59 @@ handle_button
 */
 int sdlg_handle_button( SDlg *sdlg, int button_id, int cx, int cy, Button **button )
 {
-    void *item = 0;
-    if ( !sdlg->list->group->frame->img->bkgnd->hide ) {
+    if ( !sdlg->fdlg->group->frame->img->bkgnd->hide ) {
         if ( group_handle_button( sdlg->ctrl, button_id, cx, cy, button ) )
             return 1;
-        if ( group_handle_button( sdlg->module, button_id, cx, cy, button ) )
+        if ( group_handle_button( sdlg->config, button_id, cx, cy, button ) )
             return 1;
-        if ( group_handle_button( sdlg->confirm, button_id, cx, cy, button ) )
-            return 1;
-        if ( lbox_handle_button( sdlg->list, button_id, cx, cy, button, &item ) ) {
-            if ( item ) {
-                (sdlg->select_cb)(item);
-            }
-        }
+        if ( fdlg_handle_button( sdlg->fdlg, button_id, cx, cy, button ) )
+           return 1;
     }
     return 0;
 }
 
+/** Open path in scenarion dialog */
+void sdlg_open( SDlg *sdlg, const char *root )
+{
+	fdlg_open(sdlg->fdlg,root);
+	sdlg_hide(sdlg,0);
+}
+
+/** Read setup and render current control selections to group */
+void sdlg_update_controlview(SDlg *sdlg, int show)
+{
+	Font *font = gui->font_std;
+	int xoff = 50;
+	int x = xoff, y = (sdlg->ctrl->frame->contents->h - font->height*2)/2;
+
+	SDL_FillRect(sdlg->ctrl->frame->contents,0,0);
+	if (!show) {
+		group_hide(sdlg->ctrl,1);
+		group_hide(sdlg->config,1);
+		frame_apply(sdlg->ctrl->frame); /* render content to image */
+		return;
+	}
+
+	/* XXX only for first to players won't have more anyway */
+	font->align = ALIGN_X_LEFT | ALIGN_Y_TOP;
+	write_text(font, sdlg->ctrl->frame->contents, x, y, setup.names[0], 0);
+	y += font->height;
+	write_text(font, sdlg->ctrl->frame->contents, x, y,
+			setup.ctrl[0]==PLAYER_CTRL_CPU?"CPU":tr("Human"), 0);
+
+	x = sdlg->ctrl->frame->contents->w - xoff;
+	y -= font->height;
+	font->align = ALIGN_X_RIGHT | ALIGN_Y_TOP;
+	write_text(font, sdlg->ctrl->frame->contents, x, y, setup.names[1], 0);
+	y += font->height;
+	write_text(font, sdlg->ctrl->frame->contents, x, y,
+			setup.ctrl[1]==PLAYER_CTRL_CPU?"CPU":tr("Human"), 0);
+
+	frame_apply(sdlg->ctrl->frame); /* render content to image */
+	group_hide(sdlg->ctrl,0);
+	group_hide(sdlg->config,0);
+}
+
 
 /** Select dialog:
  * A listbox for selection with OK/Cancel buttons */
@@ -1221,3 +1258,152 @@ int select_dlg_handle_button( SelectDlg *sdlg, int bid, int cx, int cy,
 		return 0; /* internal up/down buttons */
 	return 0;
 }
+
+/** Minimap view */
+extern int map_x, map_y;              /* current position in map */
+extern int map_sw, map_sh;            /* number of tiles drawn to screen */
+extern int map_w, map_h;
+
+MMView *mmview_create(int w, int h)
+{
+	MMView *mmv = calloc(1, sizeof(MMView));
+	if (mmv == 0)
+		fprintf(stderr,"mmview_create: Out of memory\n");
+	mmv->w = w;
+	mmv->h = h;
+	mmv->minimap_frame = frame_create( gui_create_frame( w, h ), 160, sdl.screen, 0, 0 );
+	if (mmv->minimap_frame == 0)
+		fprintf(stderr,"mmview_create: Out of memory\n");
+	/* viewport can only be created after minimap, so not yet */
+	return mmv;
+}
+
+void mmview_delete(MMView **mmv)
+{
+	if (*mmv) {
+		frame_delete(&(*mmv)->minimap_frame);
+		free_surf(&(*mmv)->viewport_box);
+		free(*mmv);
+		*mmv = 0;
+	}
+}
+
+/** Recalc size of viewport and recreate box image. */
+void mmview_resize_viewport(MMView *mmv)
+{
+	if (!minimap)
+		return;
+
+	mmv->vw = map_sw * mmtw;
+	mmv->vh = map_sh * mmth;
+	mmv->vsx = (mmv->w - minimap->w)/2;
+	mmv->vsy = (mmv->h - minimap->h)/2;
+	free_surf(&mmv->viewport_box);
+	mmv->viewport_box = create_surf(mmv->vw,mmv->vh,SDL_SWSURFACE);
+	FULL_DEST(mmv->viewport_box);
+	fill_surf(0xffffff);
+	DEST(mmv->viewport_box,1,1,mmv->vw-2,mmv->vh-2);
+	fill_surf(0x0);
+	mmview_adjust_viewport(mmv);
+}
+
+void mmview_adjust_viewport(MMView *mmv)
+{
+	if (!minimap)
+		return;
+
+	//printf("%d,%d,%d,%d\n",map_x,map_y,map_sw,map_sh);
+	mmv->vx = map_x * mmtw;
+	mmv->vy = map_y * mmth;
+	//printf("%d,%d,%d,%d\n",mmv->vx,mmv->vy,mmv->vw,mmv->vh);
+	if (mmv->vx < 0)
+		mmv->vx = 0;
+	if (mmv->vy < 0)
+		mmv->vy = 0;
+	if (mmv->vx + mmv->vw > mm_width)
+		mmv->vx = mm_width - mmv->vw;
+	if (mmv->vy + mmv->vh > mm_height)
+		mmv->vy = mm_height - mmv->vh;
+}
+
+void mmview_move(MMView *mmv, int x, int y)
+{
+	frame_move(mmv->minimap_frame,x,y);
+}
+
+void mmview_render(MMView *mmv, int full)
+{
+	Frame *mmf = mmv->minimap_frame;
+	int x = mmv->vsx;
+	int y = mmv->vsy;
+
+	if (!minimap)
+		return;
+
+	if (full) {
+		minimap_render();
+		FULL_DEST(mmf->contents);
+		fill_surf(0x0);
+	}
+
+	DEST(mmf->contents,x,y,mm_width,mm_height);
+	FULL_SOURCE(minimap);
+	blit_surf();
+
+	if (mmv->viewport_box) {
+		DEST(mmf->contents,x + mmv->vx, y + mmv->vy,
+				mmv->viewport_box->w,mmv->viewport_box->h);
+		FULL_SOURCE(mmv->viewport_box);
+		alpha_blit_surf(200);
+	}
+	frame_apply(mmf);
+}
+
+static int mmview_has_focus(MMView *mmv, int x, int y)
+{
+	int cx = x - mmv->minimap_frame->img->bkgnd->surf_rect.x - mmv->vsx;
+	int cy = y - mmv->minimap_frame->img->bkgnd->surf_rect.y - mmv->vsy;
+
+	if ( mmv->minimap_frame->img->bkgnd->hide )
+		return 0;
+	if ( cx < 0 || cy < 0)
+		return 0;
+	if ( cx >= minimap->w )
+		return 0;
+	if ( cy >= minimap->h )
+		return 0;
+	return 1;
+}
+
+/** Check if clicked on minimap and translate position to new map coords */
+int mmview_handle_click( MMView *mmv, int button_id, int x, int y, int *newx, int *newy )
+{
+	int cx = x - mmv->minimap_frame->img->bkgnd->surf_rect.x - mmv->vsx;
+	int cy = y - mmv->minimap_frame->img->bkgnd->surf_rect.y - mmv->vsy;
+
+	if (!minimap)
+		return 0;
+	if ( button_id != BUTTON_LEFT )
+		return 0;
+	if (!mmview_has_focus(mmv,x,y))
+		return 0;
+	*newx = cx / mmtw - map_sw/2;
+	*newy = cy / mmth - map_sh/2;
+	return 1;
+}
+
+int mmview_handle_motion( MMView *mmv, int x, int y, int *newx, int *newy )
+{
+	int cx = x - mmv->minimap_frame->img->bkgnd->surf_rect.x - mmv->vsx;
+	int cy = y - mmv->minimap_frame->img->bkgnd->surf_rect.y - mmv->vsy;
+
+	if (!minimap)
+		return 0;
+	if (!event_check_button(BUTTON_LEFT))
+		return 0;
+	if (!mmview_has_focus(mmv,x,y))
+		return 0;
+	*newx = cx / mmtw - map_sw/2;
+	*newy = cy / mmth - map_sh/2;
+	return 1;
+}
diff --git a/src/windows.h b/src/windows.h
index b4470b6..90d1612 100644
--- a/src/windows.h
+++ b/src/windows.h
@@ -419,6 +419,7 @@ Add button. Graphic is taken from conf_buttons.
 ====================================================================
 */
 void fdlg_add_button( FDlg *fdlg, int id, int lock, const char *tooltip );
+void fdlg_add_button_xy( FDlg *fdlg, int id, int x, int y, int lock, const char *tooltip );
 
 /*
 ====================================================================
@@ -443,16 +444,13 @@ int fdlg_handle_button( FDlg *fdlg, int button_id, int cx, int cy, Button **butt
 
 /*
 ====================================================================
-Setup dialogue
+Scenario + Setup dialogue
 ====================================================================
 */
 typedef struct {
-    LBox *list;
-    Group *ctrl;
-    Group *module;
-    Group *confirm;
-    void (*select_cb)(void*); /* called on selecting an item */
-    int sel_id; /* id of selected entry */
+	FDlg *fdlg;
+	Group *config;
+	Group *ctrl;
 } SDlg;
 
 /*
@@ -460,17 +458,20 @@ typedef struct {
 Create setup dialogue.
 ====================================================================
 */
-SDlg *sdlg_create( SDL_Surface *list_frame, SDL_Surface *list_buttons,
-                   int list_button_w, int list_button_h, int cell_h,
-                   SDL_Surface *ctrl_frame, SDL_Surface *ctrl_buttons,
-                   int ctrl_button_w, int ctrl_button_h, int id_ctrl,
-                   SDL_Surface *mod_frame, SDL_Surface *mod_buttons,
-                   int mod_button_w, int mod_button_h, int id_mod,
-                   SDL_Surface *conf_frame, SDL_Surface *conf_buttons,
-                   int conf_button_w, int conf_button_h, int id_conf,
+SDlg *sdlg_create(
+                   SDL_Surface *lbox_frame, int alpha, int border,
+                   SDL_Surface *lbox_buttons, int lbox_button_w, int lbox_button_h,
+                   int cell_h,
+                   SDL_Surface *file_frame,
+                   SDL_Surface *file_buttons, int file_button_w, int file_button_h,
+                   int id_ok,
                    Label *label,
-                   void (*list_render_cb)(void*,SDL_Surface*),
-                   void (*list_select_cb)(void*),
+                   void (*lbox_cb)( void*, SDL_Surface* ),
+                   void (*file_cb)( const char*, SDL_Surface* ),
+                   SDL_Surface *conf_frame,
+                   SDL_Surface *conf_buttons, int conf_button_w, int conf_button_h,
+                   SDL_Surface *ctrl_frame,
+                   SDL_Surface *ctrl_buttons, int ctrl_button_w, int ctrl_button_h,
                    SDL_Surface *surf, int x, int y );
 void sdlg_delete( SDlg **sdlg );
 
@@ -505,6 +506,9 @@ handle_button
 */
 int sdlg_handle_button( SDlg *sdlg, int button_id, int cx, int cy, Button **button );
 
+void sdlg_open( SDlg *sdlg, const char *root );
+void sdlg_update_controlview(SDlg *sdlg, int show);
+
 /*
 ====================================================================
 Select dialog:
@@ -545,4 +549,25 @@ int select_dlg_handle_button( SelectDlg *sdlg, int bid, int cx, int cy,
 #define select_dlg_get_selected_item_index( sdlg ) \
 	lbox_get_selected_item_index( sdlg->select_lbox )
 
+/** Minimap view */
+typedef struct {
+	Frame *minimap_frame;
+	SDL_Surface *viewport_box;
+	int w,h; /* of minimap frame, actual size is extern mm_width/height */
+	int vsx, vsy; /* start position in frame */
+	int vx, vy, vw, vh; /* of viewport in minimap */
+} MMView;
+
+MMView *mmview_create(int w, int h);
+void mmview_delete(MMView **mmv);
+void mmview_resize_viewport(MMView *mmv);
+void mmview_adjust_viewport(MMView *mmv);
+void mmview_move(MMView *mmv, int x, int y);
+#define mmview_get_bkgnd(__MMV) frame_get_bkgnd((__MMV)->minimap_frame)
+#define mmview_draw(__MMV) frame_draw((__MMV)->minimap_frame)
+#define mmview_hide(__MMV,__ON) frame_hide((__MMV)->minimap_frame,__ON)
+void mmview_render(MMView *mmv, int full);
+int mmview_handle_click( MMView *mmv, int button_id, int x, int y, int *newx, int *newy );
+int mmview_handle_motion( MMView *mmv, int x, int y, int *newx, int *newy );
+
 #endif
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 15e4d01..769e2a9 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -14,7 +14,17 @@
 
 @SET_MAKE@
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -79,13 +89,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = tools
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -145,6 +154,7 @@ am__define_uniq_tagged_files = \
 ETAGS = etags
 CTAGS = ctags
 DIST_SUBDIRS = $(SUBDIRS)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 am__relativize = \
   dir0=`pwd`; \
@@ -327,6 +337,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -356,7 +367,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign tools/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -644,6 +654,8 @@ uninstall-am:
 	maintainer-clean-generic mostlyclean mostlyclean-generic pdf \
 	pdf-am ps ps-am tags tags-am uninstall uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/tools/ltrextract/Makefile.in b/tools/ltrextract/Makefile.in
index 74532dd..718e8e9 100644
--- a/tools/ltrextract/Makefile.in
+++ b/tools/ltrextract/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -81,13 +91,12 @@ host_triplet = @host@
 target_triplet = @target@
 bin_PROGRAMS = ltrextract$(EXEEXT)
 subdir = tools/ltrextract
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp README
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -160,6 +169,8 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/mkinstalldirs README
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -317,6 +328,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -356,7 +368,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign tools/ltrextract/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign tools/ltrextract/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -684,6 +695,8 @@ uninstall-am: uninstall-binPROGRAMS
 	ps ps-am tags tags-am uninstall uninstall-am \
 	uninstall-binPROGRAMS
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/util/Makefile.in b/util/Makefile.in
index a2d2adf..714aaea 100644
--- a/util/Makefile.in
+++ b/util/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
 # @configure_input@
 
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
 
 # This Makefile.in is free software; the Free Software Foundation
 # gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
 @SET_MAKE@
 
 VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
 am__make_running_with_option = \
   case $${target_option-} in \
       ?) ;; \
@@ -80,13 +90,12 @@ build_triplet = @build@
 host_triplet = @host@
 target_triplet = @target@
 subdir = util
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
-	$(top_srcdir)/mkinstalldirs $(top_srcdir)/depcomp
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/acinclude.m4 \
 	$(top_srcdir)/configure.in
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
 	$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs
 CONFIG_HEADER = $(top_builddir)/config.h
 CONFIG_CLEAN_FILES =
@@ -163,6 +172,8 @@ am__define_uniq_tagged_files = \
   done | $(am__uniquify_input)`
 ETAGS = etags
 CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp \
+	$(top_srcdir)/mkinstalldirs
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
 ACLOCAL = @ACLOCAL@
 ALLOCA = @ALLOCA@
@@ -320,6 +331,7 @@ pdfdir = @pdfdir@
 prefix = @prefix@
 program_transform_name = @program_transform_name@
 psdir = @psdir@
+runstatedir = @runstatedir@
 sbindir = @sbindir@
 sharedstatedir = @sharedstatedir@
 sound_flag = @sound_flag@
@@ -358,7 +370,6 @@ $(srcdir)/Makefile.in:  $(srcdir)/Makefile.am  $(am__configure_deps)
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign util/Makefile'; \
 	$(am__cd) $(top_srcdir) && \
 	  $(AUTOMAKE) --foreign util/Makefile
-.PRECIOUS: Makefile
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
 	@case '$?' in \
 	  *config.status*) \
@@ -613,6 +624,8 @@ uninstall-am:
 	mostlyclean-generic pdf pdf-am ps ps-am tags tags-am uninstall \
 	uninstall-am
 
+.PRECIOUS: Makefile
+
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/lgeneral.git



More information about the Pkg-games-commits mailing list